DEV Community

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

Deployed a Advance Storage on XinFin XDC Network.

mahalakshmiper7 profile image MahaLakshmi Perumal ・1 min read

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;
}
}

Discussion

pic
Editor guide