Skip to content

Instantly share code, notes, and snippets.

@rocky
Last active November 6, 2018 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rocky/f7ac558aa7b4b4eaff0743c7f8bbc9d4 to your computer and use it in GitHub Desktop.
Save rocky/f7ac558aa7b4b4eaff0743c7f8bbc9d4 to your computer and use it in GitHub Desktop.
Solc AST vs Maru
{
"type": "VariableDeclaration",
"typeName": {
"type": "ArrayTypeName",
"baseTypeName": {
"type": "ElementaryTypeName",
"name": "bytes32",
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 4
}
},
"range": [
60,
66
]
},
"length": null,
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 12
}
},
"range": [
60,
68
]
}
}
pragma solidity ^0.4.22;
contract PublicStorageArray {
bytes32[] public states = [bytes32(0)];
}
{
"attributes" : {
"constant" : false,
"name" : "states",
"scope" : 9,
"stateVariable" : true,
"storageLocation" : "default",
"type" : "bytes32[]",
"visibility" : "public"
},
"id" : 8,
"name" : "VariableDeclaration",
"src" : "60:38:0"
}

Fields used:

  • name: VariableDeclaration
  • attributes.name: states
  • attributes.visibility: public
  • attributes.type: bytes32[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment