DEV Community

Cover image for Deployed a Advance Storage on XinFin XDC Network.
MahaLakshmi Perumal
MahaLakshmi Perumal

Posted on

1 1

Deployed a Advance Storage on XinFin XDC Network.

created a #SmartContract in Solidity language for a Advance storage, and successfully deployed on XinFin XDC Network under the injected web 3 environment.
Check the code:

pragma solidity >=0.5.0;
contract AdvancedContracts {
uint[] ids;
function add(uint id) public {
ids.push(id);
}
function get(uint position) public view returns(uint) {
return ids[position];
}
function getall() public view returns(uint[] memory) {
return ids;
}
function length() public view returns(uint) {
return ids.length;
}
}

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay