Skip to content

Instantly share code, notes, and snippets.

@ajile-in
Created October 24, 2017 16:00
Show Gist options
  • Save ajile-in/97cd6509f4147035a4feffaa07bcffee to your computer and use it in GitHub Desktop.
Save ajile-in/97cd6509f4147035a4feffaa07bcffee to your computer and use it in GitHub Desktop.
Solidity Contract- MyContract
pragma solidity ^0.4.0;
contract MyContract {
string[] listOfStates = new string[](26);
function myFunction(uint len) {
bytes memory anotherB = new bytes(listOfStates.length);
}
function populateAState(string aState, uint index){
listOfStates[index] = aState;
}
function queryAState(uint index) public constant returns (string) {
return listOfStates[index];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment