Skip to content

Instantly share code, notes, and snippets.

Created December 5, 2017 04:51
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 anonymous/fdc0ef75669ab57e40a84faf1bea9a03 to your computer and use it in GitHub Desktop.
Save anonymous/fdc0ef75669ab57e40a84faf1bea9a03 to your computer and use it in GitHub Desktop.
{
"contractName": "Test1",
"abi": [
{
"constant": true,
"inputs": [],
"name": "getB",
"outputs": [
{
"name": "",
"type": "uint256[]"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "x",
"type": "uint256"
}
],
"name": "putX",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "b",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getA",
"outputs": [
{
"name": "",
"type": "uint256[]"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "a",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x6060604052341561000f57600080fd5b6103c18061001e6000396000f30060606040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063a1c5191514610072578063bb325a76146100dc578063cd580ff3146100ff578063d46300fd14610136578063f0fdf834146101a0575b600080fd5b341561007d57600080fd5b6100856101d7565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156100c85780820151818401526020810190506100ad565b505050509050019250505060405180910390f35b34156100e757600080fd5b6100fd6004808035906020019091905050610235565b005b341561010a57600080fd5b610120600480803590602001909190505061028a565b6040518082815260200191505060405180910390f35b341561014157600080fd5b6101496102ae565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561018c578082015181840152602081019050610171565b505050509050019250505060405180910390f35b34156101ab57600080fd5b6101c1600480803590602001909190505061030c565b6040518082815260200191505060405180910390f35b6101df610330565b600180548060200260200160405190810160405280929190818152602001828054801561022b57602002820191906000526020600020905b815481526020019060010190808311610217575b5050505050905090565b600080548060010182816102499190610344565b916000526020600020900160008390919091505550600180548060010182816102729190610344565b91600052602060002090016000439091909150555050565b60018181548110151561029957fe5b90600052602060002090016000915090505481565b6102b6610330565b600080548060200260200160405190810160405280929190818152602001828054801561030257602002820191906000526020600020905b8154815260200190600101908083116102ee575b5050505050905090565b60008181548110151561031b57fe5b90600052602060002090016000915090505481565b602060405190810160405280600081525090565b81548183558181151161036b5781836000526020600020918201910161036a9190610370565b5b505050565b61039291905b8082111561038e576000816000905550600101610376565b5090565b905600a165627a7a72305820be8f69d37f0076fc1d550e47e9bffb028cbc8b38291cedfbda98ccf44fda34600029",
"deployedBytecode": "0x60606040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063a1c5191514610072578063bb325a76146100dc578063cd580ff3146100ff578063d46300fd14610136578063f0fdf834146101a0575b600080fd5b341561007d57600080fd5b6100856101d7565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156100c85780820151818401526020810190506100ad565b505050509050019250505060405180910390f35b34156100e757600080fd5b6100fd6004808035906020019091905050610235565b005b341561010a57600080fd5b610120600480803590602001909190505061028a565b6040518082815260200191505060405180910390f35b341561014157600080fd5b6101496102ae565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561018c578082015181840152602081019050610171565b505050509050019250505060405180910390f35b34156101ab57600080fd5b6101c1600480803590602001909190505061030c565b6040518082815260200191505060405180910390f35b6101df610330565b600180548060200260200160405190810160405280929190818152602001828054801561022b57602002820191906000526020600020905b815481526020019060010190808311610217575b5050505050905090565b600080548060010182816102499190610344565b916000526020600020900160008390919091505550600180548060010182816102729190610344565b91600052602060002090016000439091909150555050565b60018181548110151561029957fe5b90600052602060002090016000915090505481565b6102b6610330565b600080548060200260200160405190810160405280929190818152602001828054801561030257602002820191906000526020600020905b8154815260200190600101908083116102ee575b5050505050905090565b60008181548110151561031b57fe5b90600052602060002090016000915090505481565b602060405190810160405280600081525090565b81548183558181151161036b5781836000526020600020918201910161036a9190610370565b5b505050565b61039291905b8082111561038e576000816000905550600101610376565b5090565b905600a165627a7a72305820be8f69d37f0076fc1d550e47e9bffb028cbc8b38291cedfbda98ccf44fda34600029",
"sourceMap": "26:303:1:-;;;;;;;;;;;;;;;;;",
"deployedSourceMap": "26:303:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;257:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;90:85:1;;;;;;;;;;;;;;;;;;;;;;;;;;68:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;181:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;47:15:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;257:70;294:6;;:::i;:::-;319:1;312:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;257:70;:::o;90:85::-;129:1;:9;;;;;;;;;;;:::i;:::-;;;;;;;;;;136:1;129:9;;;;;;;148:1;:20;;;;;;;;;;;:::i;:::-;;;;;;;;;;155:12;148:20;;;;;;;90:85;:::o;68:15::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;181:70::-;218:6;;:::i;:::-;243:1;236:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;181:70;:::o;47:15::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;26:303::-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o",
"source": "pragma solidity ^0.4.11;\n\ncontract Test1 {\n uint[] public a;\n uint[] public b;\n\n function putX(uint x) public {\n a.push(x);\n b.push(block.number);\n }\n\n function getA() public view returns (uint[]) {\n return a;\n }\n\n function getB() public view returns (uint[]) {\n return b;\n }\n}\n",
"sourcePath": "/Users/juansolo/ethereum/test/contracts/Test1.sol",
"ast": {
"attributes": {
"absolutePath": "/Users/juansolo/ethereum/test/contracts/Test1.sol",
"exportedSymbols": {
"Test1": [
102
]
}
},
"children": [
{
"attributes": {
"literals": [
"solidity",
"^",
"0.4",
".11"
]
},
"id": 58,
"name": "PragmaDirective",
"src": "0:24:1"
},
{
"attributes": {
"baseContracts": [
null
],
"contractDependencies": [
null
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"linearizedBaseContracts": [
102
],
"name": "Test1",
"scope": 103
},
"children": [
{
"attributes": {
"constant": false,
"name": "a",
"scope": 102,
"stateVariable": true,
"storageLocation": "default",
"type": "uint256[] storage ref",
"value": null,
"visibility": "public"
},
"children": [
{
"attributes": {
"length": null,
"type": "uint256[] storage pointer"
},
"children": [
{
"attributes": {
"name": "uint",
"type": "uint256"
},
"id": 59,
"name": "ElementaryTypeName",
"src": "47:4:1"
}
],
"id": 60,
"name": "ArrayTypeName",
"src": "47:6:1"
}
],
"id": 61,
"name": "VariableDeclaration",
"src": "47:15:1"
},
{
"attributes": {
"constant": false,
"name": "b",
"scope": 102,
"stateVariable": true,
"storageLocation": "default",
"type": "uint256[] storage ref",
"value": null,
"visibility": "public"
},
"children": [
{
"attributes": {
"length": null,
"type": "uint256[] storage pointer"
},
"children": [
{
"attributes": {
"name": "uint",
"type": "uint256"
},
"id": 62,
"name": "ElementaryTypeName",
"src": "68:4:1"
}
],
"id": 63,
"name": "ArrayTypeName",
"src": "68:6:1"
}
],
"id": 64,
"name": "VariableDeclaration",
"src": "68:15:1"
},
{
"attributes": {
"constant": false,
"implemented": true,
"isConstructor": false,
"modifiers": [
null
],
"name": "putX",
"payable": false,
"scope": 102,
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
"children": [
{
"children": [
{
"attributes": {
"constant": false,
"name": "x",
"scope": 83,
"stateVariable": false,
"storageLocation": "default",
"type": "uint256",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "uint",
"type": "uint256"
},
"id": 65,
"name": "ElementaryTypeName",
"src": "104:4:1"
}
],
"id": 66,
"name": "VariableDeclaration",
"src": "104:6:1"
}
],
"id": 67,
"name": "ParameterList",
"src": "103:8:1"
},
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 68,
"name": "ParameterList",
"src": "119:0:1"
},
{
"children": [
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "uint256",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "push",
"referencedDeclaration": null,
"type": "function (uint256) returns (uint256)"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 61,
"type": "uint256[] storage ref",
"value": "a"
},
"id": 69,
"name": "Identifier",
"src": "129:1:1"
}
],
"id": 71,
"name": "MemberAccess",
"src": "129:6:1"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 66,
"type": "uint256",
"value": "x"
},
"id": 72,
"name": "Identifier",
"src": "136:1:1"
}
],
"id": 73,
"name": "FunctionCall",
"src": "129:9:1"
}
],
"id": 74,
"name": "ExpressionStatement",
"src": "129:9:1"
},
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "uint256",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "push",
"referencedDeclaration": null,
"type": "function (uint256) returns (uint256)"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 64,
"type": "uint256[] storage ref",
"value": "b"
},
"id": 75,
"name": "Identifier",
"src": "148:1:1"
}
],
"id": 77,
"name": "MemberAccess",
"src": "148:6:1"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "number",
"referencedDeclaration": null,
"type": "uint256"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 106,
"type": "block",
"value": "block"
},
"id": 78,
"name": "Identifier",
"src": "155:5:1"
}
],
"id": 79,
"name": "MemberAccess",
"src": "155:12:1"
}
],
"id": 80,
"name": "FunctionCall",
"src": "148:20:1"
}
],
"id": 81,
"name": "ExpressionStatement",
"src": "148:20:1"
}
],
"id": 82,
"name": "Block",
"src": "119:56:1"
}
],
"id": 83,
"name": "FunctionDefinition",
"src": "90:85:1"
},
{
"attributes": {
"constant": true,
"implemented": true,
"isConstructor": false,
"modifiers": [
null
],
"name": "getA",
"payable": false,
"scope": 102,
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
"children": [
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 84,
"name": "ParameterList",
"src": "194:2:1"
},
{
"children": [
{
"attributes": {
"constant": false,
"name": "",
"scope": 92,
"stateVariable": false,
"storageLocation": "default",
"type": "uint256[] memory",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"length": null,
"type": "uint256[] storage pointer"
},
"children": [
{
"attributes": {
"name": "uint",
"type": "uint256"
},
"id": 85,
"name": "ElementaryTypeName",
"src": "218:4:1"
}
],
"id": 86,
"name": "ArrayTypeName",
"src": "218:6:1"
}
],
"id": 87,
"name": "VariableDeclaration",
"src": "218:6:1"
}
],
"id": 88,
"name": "ParameterList",
"src": "217:8:1"
},
{
"children": [
{
"attributes": {
"functionReturnParameters": 88
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 61,
"type": "uint256[] storage ref",
"value": "a"
},
"id": 89,
"name": "Identifier",
"src": "243:1:1"
}
],
"id": 90,
"name": "Return",
"src": "236:8:1"
}
],
"id": 91,
"name": "Block",
"src": "226:25:1"
}
],
"id": 92,
"name": "FunctionDefinition",
"src": "181:70:1"
},
{
"attributes": {
"constant": true,
"implemented": true,
"isConstructor": false,
"modifiers": [
null
],
"name": "getB",
"payable": false,
"scope": 102,
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
"children": [
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 93,
"name": "ParameterList",
"src": "270:2:1"
},
{
"children": [
{
"attributes": {
"constant": false,
"name": "",
"scope": 101,
"stateVariable": false,
"storageLocation": "default",
"type": "uint256[] memory",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"length": null,
"type": "uint256[] storage pointer"
},
"children": [
{
"attributes": {
"name": "uint",
"type": "uint256"
},
"id": 94,
"name": "ElementaryTypeName",
"src": "294:4:1"
}
],
"id": 95,
"name": "ArrayTypeName",
"src": "294:6:1"
}
],
"id": 96,
"name": "VariableDeclaration",
"src": "294:6:1"
}
],
"id": 97,
"name": "ParameterList",
"src": "293:8:1"
},
{
"children": [
{
"attributes": {
"functionReturnParameters": 97
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 64,
"type": "uint256[] storage ref",
"value": "b"
},
"id": 98,
"name": "Identifier",
"src": "319:1:1"
}
],
"id": 99,
"name": "Return",
"src": "312:8:1"
}
],
"id": 100,
"name": "Block",
"src": "302:25:1"
}
],
"id": 101,
"name": "FunctionDefinition",
"src": "257:70:1"
}
],
"id": 102,
"name": "ContractDefinition",
"src": "26:303:1"
}
],
"id": 103,
"name": "SourceUnit",
"src": "0:330:1"
},
"compiler": {
"name": "solc",
"version": "0.4.18+commit.9cf6e910.Emscripten.clang"
},
"networks": {
"1": {
"events": {},
"links": {},
"address": "0xaf385033c1c8e822d67431f5247c5c83e838acf8"
}
},
"schemaVersion": "1.0.1",
"updatedAt": "2017-12-02T20:12:37.970Z"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment