Skip to content

Instantly share code, notes, and snippets.

@kingcocomango
Created November 23, 2017 16:16
Show Gist options
  • Save kingcocomango/912fd00c8cc838231f2894ad4a154291 to your computer and use it in GitHub Desktop.
Save kingcocomango/912fd00c8cc838231f2894ad4a154291 to your computer and use it in GitHub Desktop.
The command used to create this was running `migrate --reset` twice
{
"contractName": "MetaCoin",
"abi": [
{
"constant": true,
"inputs": [],
"name": "specialFn",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "endTime",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "getBalanceInEth",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "receiver",
"type": "address"
},
{
"name": "amount",
"type": "uint256"
}
],
"name": "sendCoin",
"outputs": [
{
"name": "sufficient",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "getBalance",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_from",
"type": "address"
},
{
"indexed": true,
"name": "_to",
"type": "address"
},
{
"indexed": false,
"name": "_value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
}
],
"bytecode": "0x6060604052341561000f57600080fd5b6127106000803273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042016001819055506104518061006e6000396000f30060606040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063037af3af146100725780633197cbb61461009f5780637bd703e8146100c857806390b98a1114610115578063f8b2cb4f1461016f575b600080fd5b341561007d57600080fd5b6100856101bc565b604051808215151515815260200191505060405180910390f35b34156100aa57600080fd5b6100b26101d6565b6040518082815260200191505060405180910390f35b34156100d357600080fd5b6100ff600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506101dc565b6040518082815260200191505060405180910390f35b341561012057600080fd5b610155600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610284565b604051808215151515815260200191505060405180910390f35b341561017a57600080fd5b6101a6600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506103dd565b6040518082815260200191505060405180910390f35b600060015442111515156101cf57600080fd5b6001905090565b60015481565b600073__ConvertLib____________________________6396e4ee3d610201846103dd565b60026000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b151561026257600080fd5b6102c65a03f4151561027357600080fd5b505050604051805190509050919050565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156102d557600090506103d7565b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490509190505600a165627a7a72305820edffc1a07742c4fc3b54a83f4f51e3a189df486bedb617d74c0a76084a0b2d170029",
"deployedBytecode": "0x60606040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063037af3af146100725780633197cbb61461009f5780637bd703e8146100c857806390b98a1114610115578063f8b2cb4f1461016f575b600080fd5b341561007d57600080fd5b6100856101bc565b604051808215151515815260200191505060405180910390f35b34156100aa57600080fd5b6100b26101d6565b6040518082815260200191505060405180910390f35b34156100d357600080fd5b6100ff600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506101dc565b6040518082815260200191505060405180910390f35b341561012057600080fd5b610155600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610284565b604051808215151515815260200191505060405180910390f35b341561017a57600080fd5b6101a6600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506103dd565b6040518082815260200191505060405180910390f35b600060015442111515156101cf57600080fd5b6001905090565b60015481565b600073__ConvertLib____________________________6396e4ee3d610201846103dd565b60026000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b151561026257600080fd5b6102c65a03f4151561027357600080fd5b505050604051805190509050919050565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156102d557600090506103d7565b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490509190505600a165627a7a72305820edffc1a07742c4fc3b54a83f4f51e3a189df486bedb617d74c0a76084a0b2d170029",
"sourceMap": "315:989:1:-;;;568:104;;;;;;;;627:5;605:8;:19;614:9;605:19;;;;;;;;;;;;;;;:27;;;;658:7;652:3;:13;642:7;:23;;;;315:989;;;;;;",
"deployedSourceMap": "315:989:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1213:89;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;379:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;976:127;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;678:292;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1109:98;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1213:89;1268:4;455:7;;448:3;:14;;440:23;;;;;;;;1291:4;1284:11;;1213:89;:::o;379:19::-;;;;:::o;976:127::-;1035:4;1057:10;:18;1076:16;1087:4;1076:10;:16::i;:::-;1094:1;1057:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1050:46;;976:127;;;:::o;678:292::-;742:15;796:6;773:8;:20;782:10;773:20;;;;;;;;;;;;;;;;:29;769:47;;;811:5;804:12;;;;769:47;850:6;826:8;:20;835:10;826:20;;;;;;;;;;;;;;;;:30;;;;;;;;;;;888:6;866:8;:18;875:8;866:18;;;;;;;;;;;;;;;;:28;;;;;;;;;;;925:8;904:38;;913:10;904:38;;;935:6;904:38;;;;;;;;;;;;;;;;;;959:4;952:11;;678:292;;;;;:::o;1109:98::-;1163:4;1186:8;:14;1195:4;1186:14;;;;;;;;;;;;;;;;1179:21;;1109:98;;;:::o",
"source": "pragma solidity ^0.4.4;\n\nimport \"./ConvertLib.sol\";\n\n// This is just a simple example of a coin-like contract.\n// It is not standards compatible and cannot be expected to talk to other\n// coin/token contracts. If you want to create a standards-compliant\n// token, see: https://github.com/ConsenSys/Tokens. Cheers!\n\ncontract MetaCoin {\n mapping (address => uint) balances;\n uint public endTime;\n\n modifier onlyAfterDate() {\n require(now <= endTime);\n _;\n }\n\n event Transfer(address indexed _from, address indexed _to, uint256 _value);\n\n function MetaCoin() public {\n balances[tx.origin] = 10000;\n endTime = now + 1 hours;\n }\n\n function sendCoin(address receiver, uint amount) public returns(bool sufficient) {\n if (balances[msg.sender] < amount) return false;\n balances[msg.sender] -= amount;\n balances[receiver] += amount;\n Transfer(msg.sender, receiver, amount);\n return true;\n }\n\n function getBalanceInEth(address addr) public view returns(uint){\n return ConvertLib.convert(getBalance(addr), 2);\n }\n\n function getBalance(address addr) public view returns(uint) {\n return balances[addr];\n }\n\n function specialFn() public onlyAfterDate view returns(bool) {\n return true;\n }\n}\n",
"sourcePath": "/home/mango/Git/truffle-testing/contracts/MetaCoin.sol",
"ast": {
"attributes": {
"absolutePath": "/home/mango/Git/truffle-testing/contracts/MetaCoin.sol",
"exportedSymbols": {
"MetaCoin": [
140
]
}
},
"children": [
{
"attributes": {
"literals": [
"solidity",
"^",
"0.4",
".4"
]
},
"id": 18,
"name": "PragmaDirective",
"src": "0:23:1"
},
{
"attributes": {
"SourceUnit": 17,
"absolutePath": "/home/mango/Git/truffle-testing/contracts/ConvertLib.sol",
"file": "./ConvertLib.sol",
"scope": 141,
"symbolAliases": [
null
],
"unitAlias": ""
},
"id": 19,
"name": "ImportDirective",
"src": "25:26:1"
},
{
"attributes": {
"baseContracts": [
null
],
"contractDependencies": [
null
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"linearizedBaseContracts": [
140
],
"name": "MetaCoin",
"scope": 141
},
"children": [
{
"attributes": {
"constant": false,
"name": "balances",
"scope": 140,
"stateVariable": true,
"storageLocation": "default",
"type": "mapping(address => uint256)",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"type": "mapping(address => uint256)"
},
"children": [
{
"attributes": {
"name": "address",
"type": "address"
},
"id": 20,
"name": "ElementaryTypeName",
"src": "348:7:1"
},
{
"attributes": {
"name": "uint",
"type": "uint256"
},
"id": 21,
"name": "ElementaryTypeName",
"src": "359:4:1"
}
],
"id": 22,
"name": "Mapping",
"src": "339:25:1"
}
],
"id": 23,
"name": "VariableDeclaration",
"src": "339:34:1"
},
{
"attributes": {
"constant": false,
"name": "endTime",
"scope": 140,
"stateVariable": true,
"storageLocation": "default",
"type": "uint256",
"value": null,
"visibility": "public"
},
"children": [
{
"attributes": {
"name": "uint",
"type": "uint256"
},
"id": 24,
"name": "ElementaryTypeName",
"src": "379:4:1"
}
],
"id": 25,
"name": "VariableDeclaration",
"src": "379:19:1"
},
{
"attributes": {
"name": "onlyAfterDate",
"visibility": "internal"
},
"children": [
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 26,
"name": "ParameterList",
"src": "427:2:1"
},
{
"children": [
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "tuple()",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"overloadedDeclarations": [
null
],
"referencedDeclaration": 212,
"type": "function (bool) pure",
"value": "require"
},
"id": 27,
"name": "Identifier",
"src": "440:7:1"
},
{
"attributes": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "<=",
"type": "bool"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 211,
"type": "uint256",
"value": "now"
},
"id": 28,
"name": "Identifier",
"src": "448:3:1"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 25,
"type": "uint256",
"value": "endTime"
},
"id": 29,
"name": "Identifier",
"src": "455:7:1"
}
],
"id": 30,
"name": "BinaryOperation",
"src": "448:14:1"
}
],
"id": 31,
"name": "FunctionCall",
"src": "440:23:1"
}
],
"id": 32,
"name": "ExpressionStatement",
"src": "440:23:1"
},
{
"id": 33,
"name": "PlaceholderStatement",
"src": "473:1:1"
}
],
"id": 34,
"name": "Block",
"src": "430:51:1"
}
],
"id": 35,
"name": "ModifierDefinition",
"src": "405:76:1"
},
{
"attributes": {
"anonymous": false,
"name": "Transfer"
},
"children": [
{
"children": [
{
"attributes": {
"constant": false,
"indexed": true,
"name": "_from",
"scope": 43,
"stateVariable": false,
"storageLocation": "default",
"type": "address",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "address",
"type": "address"
},
"id": 36,
"name": "ElementaryTypeName",
"src": "502:7:1"
}
],
"id": 37,
"name": "VariableDeclaration",
"src": "502:21:1"
},
{
"attributes": {
"constant": false,
"indexed": true,
"name": "_to",
"scope": 43,
"stateVariable": false,
"storageLocation": "default",
"type": "address",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "address",
"type": "address"
},
"id": 38,
"name": "ElementaryTypeName",
"src": "525:7:1"
}
],
"id": 39,
"name": "VariableDeclaration",
"src": "525:19:1"
},
{
"attributes": {
"constant": false,
"indexed": false,
"name": "_value",
"scope": 43,
"stateVariable": false,
"storageLocation": "default",
"type": "uint256",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "uint256",
"type": "uint256"
},
"id": 40,
"name": "ElementaryTypeName",
"src": "546:7:1"
}
],
"id": 41,
"name": "VariableDeclaration",
"src": "546:14:1"
}
],
"id": 42,
"name": "ParameterList",
"src": "501:60:1"
}
],
"id": 43,
"name": "EventDefinition",
"src": "487:75:1"
},
{
"attributes": {
"constant": false,
"implemented": true,
"isConstructor": true,
"modifiers": [
null
],
"name": "MetaCoin",
"payable": false,
"scope": 140,
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
"children": [
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 44,
"name": "ParameterList",
"src": "585:2:1"
},
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 45,
"name": "ParameterList",
"src": "595:0:1"
},
{
"children": [
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "=",
"type": "uint256"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"type": "uint256"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 23,
"type": "mapping(address => uint256)",
"value": "balances"
},
"id": 46,
"name": "Identifier",
"src": "605:8:1"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "origin",
"referencedDeclaration": null,
"type": "address"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 219,
"type": "tx",
"value": "tx"
},
"id": 47,
"name": "Identifier",
"src": "614:2:1"
}
],
"id": 48,
"name": "MemberAccess",
"src": "614:9:1"
}
],
"id": 49,
"name": "IndexAccess",
"src": "605:19:1"
},
{
"attributes": {
"argumentTypes": null,
"hexvalue": "3130303030",
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"subdenomination": null,
"token": "number",
"type": "int_const 10000",
"value": "10000"
},
"id": 50,
"name": "Literal",
"src": "627:5:1"
}
],
"id": 51,
"name": "Assignment",
"src": "605:27:1"
}
],
"id": 52,
"name": "ExpressionStatement",
"src": "605:27:1"
},
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "=",
"type": "uint256"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 25,
"type": "uint256",
"value": "endTime"
},
"id": 53,
"name": "Identifier",
"src": "642:7:1"
},
{
"attributes": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "+",
"type": "uint256"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 211,
"type": "uint256",
"value": "now"
},
"id": 54,
"name": "Identifier",
"src": "652:3:1"
},
{
"attributes": {
"argumentTypes": null,
"hexvalue": "31",
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"subdenomination": "hours",
"token": "number",
"type": "int_const 3600",
"value": "1"
},
"id": 55,
"name": "Literal",
"src": "658:7:1"
}
],
"id": 56,
"name": "BinaryOperation",
"src": "652:13:1"
}
],
"id": 57,
"name": "Assignment",
"src": "642:23:1"
}
],
"id": 58,
"name": "ExpressionStatement",
"src": "642:23:1"
}
],
"id": 59,
"name": "Block",
"src": "595:77:1"
}
],
"id": 60,
"name": "FunctionDefinition",
"src": "568:104:1"
},
{
"attributes": {
"constant": false,
"implemented": true,
"isConstructor": false,
"modifiers": [
null
],
"name": "sendCoin",
"payable": false,
"scope": 140,
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
"children": [
{
"children": [
{
"attributes": {
"constant": false,
"name": "receiver",
"scope": 101,
"stateVariable": false,
"storageLocation": "default",
"type": "address",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "address",
"type": "address"
},
"id": 61,
"name": "ElementaryTypeName",
"src": "696:7:1"
}
],
"id": 62,
"name": "VariableDeclaration",
"src": "696:16:1"
},
{
"attributes": {
"constant": false,
"name": "amount",
"scope": 101,
"stateVariable": false,
"storageLocation": "default",
"type": "uint256",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "uint",
"type": "uint256"
},
"id": 63,
"name": "ElementaryTypeName",
"src": "714:4:1"
}
],
"id": 64,
"name": "VariableDeclaration",
"src": "714:11:1"
}
],
"id": 65,
"name": "ParameterList",
"src": "695:31:1"
},
{
"children": [
{
"attributes": {
"constant": false,
"name": "sufficient",
"scope": 101,
"stateVariable": false,
"storageLocation": "default",
"type": "bool",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "bool",
"type": "bool"
},
"id": 66,
"name": "ElementaryTypeName",
"src": "742:4:1"
}
],
"id": 67,
"name": "VariableDeclaration",
"src": "742:15:1"
}
],
"id": 68,
"name": "ParameterList",
"src": "741:17:1"
},
{
"children": [
{
"attributes": {
"falseBody": null
},
"children": [
{
"attributes": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "<",
"type": "bool"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"type": "uint256"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 23,
"type": "mapping(address => uint256)",
"value": "balances"
},
"id": 69,
"name": "Identifier",
"src": "773:8:1"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "sender",
"referencedDeclaration": null,
"type": "address"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 209,
"type": "msg",
"value": "msg"
},
"id": 70,
"name": "Identifier",
"src": "782:3:1"
}
],
"id": 71,
"name": "MemberAccess",
"src": "782:10:1"
}
],
"id": 72,
"name": "IndexAccess",
"src": "773:20:1"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 64,
"type": "uint256",
"value": "amount"
},
"id": 73,
"name": "Identifier",
"src": "796:6:1"
}
],
"id": 74,
"name": "BinaryOperation",
"src": "773:29:1"
},
{
"attributes": {
"functionReturnParameters": 68
},
"children": [
{
"attributes": {
"argumentTypes": null,
"hexvalue": "66616c7365",
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"subdenomination": null,
"token": "bool",
"type": "bool",
"value": "false"
},
"id": 75,
"name": "Literal",
"src": "811:5:1"
}
],
"id": 76,
"name": "Return",
"src": "804:12:1"
}
],
"id": 77,
"name": "IfStatement",
"src": "769:47:1"
},
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "-=",
"type": "uint256"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"type": "uint256"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 23,
"type": "mapping(address => uint256)",
"value": "balances"
},
"id": 78,
"name": "Identifier",
"src": "826:8:1"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "sender",
"referencedDeclaration": null,
"type": "address"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 209,
"type": "msg",
"value": "msg"
},
"id": 79,
"name": "Identifier",
"src": "835:3:1"
}
],
"id": 80,
"name": "MemberAccess",
"src": "835:10:1"
}
],
"id": 81,
"name": "IndexAccess",
"src": "826:20:1"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 64,
"type": "uint256",
"value": "amount"
},
"id": 82,
"name": "Identifier",
"src": "850:6:1"
}
],
"id": 83,
"name": "Assignment",
"src": "826:30:1"
}
],
"id": 84,
"name": "ExpressionStatement",
"src": "826:30:1"
},
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "+=",
"type": "uint256"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"type": "uint256"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 23,
"type": "mapping(address => uint256)",
"value": "balances"
},
"id": 85,
"name": "Identifier",
"src": "866:8:1"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 62,
"type": "address",
"value": "receiver"
},
"id": 86,
"name": "Identifier",
"src": "875:8:1"
}
],
"id": 87,
"name": "IndexAccess",
"src": "866:18:1"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 64,
"type": "uint256",
"value": "amount"
},
"id": 88,
"name": "Identifier",
"src": "888:6:1"
}
],
"id": 89,
"name": "Assignment",
"src": "866:28:1"
}
],
"id": 90,
"name": "ExpressionStatement",
"src": "866:28:1"
},
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "tuple()",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"overloadedDeclarations": [
null
],
"referencedDeclaration": 43,
"type": "function (address,address,uint256)",
"value": "Transfer"
},
"id": 91,
"name": "Identifier",
"src": "904:8:1"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "sender",
"referencedDeclaration": null,
"type": "address"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 209,
"type": "msg",
"value": "msg"
},
"id": 92,
"name": "Identifier",
"src": "913:3:1"
}
],
"id": 93,
"name": "MemberAccess",
"src": "913:10:1"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 62,
"type": "address",
"value": "receiver"
},
"id": 94,
"name": "Identifier",
"src": "925:8:1"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 64,
"type": "uint256",
"value": "amount"
},
"id": 95,
"name": "Identifier",
"src": "935:6:1"
}
],
"id": 96,
"name": "FunctionCall",
"src": "904:38:1"
}
],
"id": 97,
"name": "ExpressionStatement",
"src": "904:38:1"
},
{
"attributes": {
"functionReturnParameters": 68
},
"children": [
{
"attributes": {
"argumentTypes": null,
"hexvalue": "74727565",
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"subdenomination": null,
"token": "bool",
"type": "bool",
"value": "true"
},
"id": 98,
"name": "Literal",
"src": "959:4:1"
}
],
"id": 99,
"name": "Return",
"src": "952:11:1"
}
],
"id": 100,
"name": "Block",
"src": "759:211:1"
}
],
"id": 101,
"name": "FunctionDefinition",
"src": "678:292:1"
},
{
"attributes": {
"constant": true,
"implemented": true,
"isConstructor": false,
"modifiers": [
null
],
"name": "getBalanceInEth",
"payable": false,
"scope": 140,
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
"children": [
{
"children": [
{
"attributes": {
"constant": false,
"name": "addr",
"scope": 117,
"stateVariable": false,
"storageLocation": "default",
"type": "address",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "address",
"type": "address"
},
"id": 102,
"name": "ElementaryTypeName",
"src": "1001:7:1"
}
],
"id": 103,
"name": "VariableDeclaration",
"src": "1001:12:1"
}
],
"id": 104,
"name": "ParameterList",
"src": "1000:14:1"
},
{
"children": [
{
"attributes": {
"constant": false,
"name": "",
"scope": 117,
"stateVariable": false,
"storageLocation": "default",
"type": "uint256",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "uint",
"type": "uint256"
},
"id": 105,
"name": "ElementaryTypeName",
"src": "1035:4:1"
}
],
"id": 106,
"name": "VariableDeclaration",
"src": "1035:4:1"
}
],
"id": 107,
"name": "ParameterList",
"src": "1034:6:1"
},
{
"children": [
{
"attributes": {
"functionReturnParameters": 107
},
"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"
},
{
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
}
],
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "convert",
"referencedDeclaration": 15,
"type": "function (uint256,uint256) pure returns (uint256)"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 16,
"type": "type(library ConvertLib)",
"value": "ConvertLib"
},
"id": 108,
"name": "Identifier",
"src": "1057:10:1"
}
],
"id": 109,
"name": "MemberAccess",
"src": "1057:18:1"
},
{
"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_address",
"typeString": "address"
}
],
"overloadedDeclarations": [
null
],
"referencedDeclaration": 129,
"type": "function (address) view returns (uint256)",
"value": "getBalance"
},
"id": 110,
"name": "Identifier",
"src": "1076:10:1"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 103,
"type": "address",
"value": "addr"
},
"id": 111,
"name": "Identifier",
"src": "1087:4:1"
}
],
"id": 112,
"name": "FunctionCall",
"src": "1076:16:1"
},
{
"attributes": {
"argumentTypes": null,
"hexvalue": "32",
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"subdenomination": null,
"token": "number",
"type": "int_const 2",
"value": "2"
},
"id": 113,
"name": "Literal",
"src": "1094:1:1"
}
],
"id": 114,
"name": "FunctionCall",
"src": "1057:39:1"
}
],
"id": 115,
"name": "Return",
"src": "1050:46:1"
}
],
"id": 116,
"name": "Block",
"src": "1040:63:1"
}
],
"id": 117,
"name": "FunctionDefinition",
"src": "976:127:1"
},
{
"attributes": {
"constant": true,
"implemented": true,
"isConstructor": false,
"modifiers": [
null
],
"name": "getBalance",
"payable": false,
"scope": 140,
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
"children": [
{
"children": [
{
"attributes": {
"constant": false,
"name": "addr",
"scope": 129,
"stateVariable": false,
"storageLocation": "default",
"type": "address",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "address",
"type": "address"
},
"id": 118,
"name": "ElementaryTypeName",
"src": "1129:7:1"
}
],
"id": 119,
"name": "VariableDeclaration",
"src": "1129:12:1"
}
],
"id": 120,
"name": "ParameterList",
"src": "1128:14:1"
},
{
"children": [
{
"attributes": {
"constant": false,
"name": "",
"scope": 129,
"stateVariable": false,
"storageLocation": "default",
"type": "uint256",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "uint",
"type": "uint256"
},
"id": 121,
"name": "ElementaryTypeName",
"src": "1163:4:1"
}
],
"id": 122,
"name": "VariableDeclaration",
"src": "1163:4:1"
}
],
"id": 123,
"name": "ParameterList",
"src": "1162:6:1"
},
{
"children": [
{
"attributes": {
"functionReturnParameters": 123
},
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"type": "uint256"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 23,
"type": "mapping(address => uint256)",
"value": "balances"
},
"id": 124,
"name": "Identifier",
"src": "1186:8:1"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 119,
"type": "address",
"value": "addr"
},
"id": 125,
"name": "Identifier",
"src": "1195:4:1"
}
],
"id": 126,
"name": "IndexAccess",
"src": "1186:14:1"
}
],
"id": 127,
"name": "Return",
"src": "1179:21:1"
}
],
"id": 128,
"name": "Block",
"src": "1169:38:1"
}
],
"id": 129,
"name": "FunctionDefinition",
"src": "1109:98:1"
},
{
"attributes": {
"constant": true,
"implemented": true,
"isConstructor": false,
"name": "specialFn",
"payable": false,
"scope": 140,
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
"children": [
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 130,
"name": "ParameterList",
"src": "1231:2:1"
},
{
"children": [
{
"attributes": {
"constant": false,
"name": "",
"scope": 139,
"stateVariable": false,
"storageLocation": "default",
"type": "bool",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "bool",
"type": "bool"
},
"id": 133,
"name": "ElementaryTypeName",
"src": "1268:4:1"
}
],
"id": 134,
"name": "VariableDeclaration",
"src": "1268:4:1"
}
],
"id": 135,
"name": "ParameterList",
"src": "1267:6:1"
},
{
"attributes": {
"arguments": [
null
]
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 35,
"type": "modifier ()",
"value": "onlyAfterDate"
},
"id": 131,
"name": "Identifier",
"src": "1241:13:1"
}
],
"id": 132,
"name": "ModifierInvocation",
"src": "1241:13:1"
},
{
"children": [
{
"attributes": {
"functionReturnParameters": 135
},
"children": [
{
"attributes": {
"argumentTypes": null,
"hexvalue": "74727565",
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"subdenomination": null,
"token": "bool",
"type": "bool",
"value": "true"
},
"id": 136,
"name": "Literal",
"src": "1291:4:1"
}
],
"id": 137,
"name": "Return",
"src": "1284:11:1"
}
],
"id": 138,
"name": "Block",
"src": "1274:28:1"
}
],
"id": 139,
"name": "FunctionDefinition",
"src": "1213:89:1"
}
],
"id": 140,
"name": "ContractDefinition",
"src": "315:989:1"
}
],
"id": 141,
"name": "SourceUnit",
"src": "0:1305:1"
},
"compiler": {
"name": "solc",
"version": "0.4.18+commit.9cf6e910.Emscripten.clang"
},
"networks": {
"1511392414462": {
"events": {},
"links": {
"ConvertLib": "0x017df06d28217e7585269f1f6f9cfde231b004ba"
},
"address": "0xc7999f6105b0f51b187f08cc879f4df214c40e7e",
"transactionId": "0x58ac8e18d4ffc582105154d71ffd76a7a939bee72ad98e035b2a2ab62f70d476"
}
},
"schemaVersion": "1.0.0",
"updatedAt": "2017-11-23T16:05:53.998Z"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment