build/contracts/ERC20Token.json
{
"contractName": "ERC20Token",
"abi": [
{
"constant": false,
"inputs": [
{
"name": "to",
"type": "address"
},
{
"name": "value",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x",
"deployedBytecode": "0x",
"sourceMap": "",
"deployedSourceMap": "",
"source": "/** @title Hey Token Sale\n* @author Thomas Vanderstraeten - <thomas@hey.network>\n* Keep in mind that smart contracts still rely on experimental technology.\n*/\n\npragma solidity ^0.5.0;\n\nimport \"openzeppelin-solidity/contracts/math/SafeMath.sol\";\nimport \"./gateway/ValidatorsManager.sol\";\nimport \"./gateway/ERC20Receiver.sol\";\n\ncontract ERC20Token {\n function transfer(address to, uint256 value) public returns (bool);\n}\n\ncontract Gateway is ERC20Receiver, ValidatorsManager {\n\n using SafeMath for uint256;\n\n // From user to ERC20 balance\n mapping (address => uint256) public balances;\n // ERC20 contract address (HEY token)\n address public tokenAddress;\n\n event ERC20Withdrawn(address indexed owner, uint256 value);\n event ERC20Received(address from, uint256 amount);\n\n constructor (\n address _tokenAddress,\n address[] memory _validators,\n uint8 _threshold_num,\n uint8 _threshold_denom\n )\n public\n ValidatorsManager(_tokenAddress, _validators, _threshold_num, _threshold_denom)\n {\n tokenAddress = _tokenAddress;\n }\n\n function withdrawERC20(\n uint256 amount,\n bytes calldata signature\n )\n external\n isVerifiedByValidator(amount, signature)\n {\n // This transfer transaction depletes the ERC20 balance of the Gateway\n // contract itself - using the balance provisioned by the admin.\n ERC20Token(tokenAddress).transfer(msg.sender, amount);\n emit ERC20Withdrawn(msg.sender, amount);\n }\n\n function onERC20Received(\n address _from,\n uint256 amount\n )\n public\n returns (bytes4)\n {\n emit ERC20Received(_from, amount);\n return ERC20_RECEIVED;\n }\n}\n",
"sourcePath": "/Users/thomasvanderstraeten/code/hey/mainchain/contracts/Gateway.sol",
"ast": {
"absolutePath": "/Users/thomasvanderstraeten/code/hey/mainchain/contracts/Gateway.sol",
"exportedSymbols": {
"ERC20Token": [
14
],
"Gateway": [
107
]
},
"id": 108,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"^",
"0.5",
".0"
],
"nodeType": "PragmaDirective",
"src": "162:23:0"
},
{
"absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol",
"file": "openzeppelin-solidity/contracts/math/SafeMath.sol",
"id": 2,
"nodeType": "ImportDirective",
"scope": 108,
"sourceUnit": 2547,
"src": "187:59:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/Users/thomasvanderstraeten/code/hey/mainchain/contracts/gateway/ValidatorsManager.sol",
"file": "./gateway/ValidatorsManager.sol",
"id": 3,
"nodeType": "ImportDirective",
"scope": 108,
"sourceUnit": 1371,
"src": "247:41:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/Users/thomasvanderstraeten/code/hey/mainchain/contracts/gateway/ERC20Receiver.sol",
"file": "./gateway/ERC20Receiver.sol",
"id": 4,
"nodeType": "ImportDirective",
"scope": 108,
"sourceUnit": 962,
"src": "289:37:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": false,
"id": 14,
"linearizedBaseContracts": [
14
],
"name": "ERC20Token",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": null,
"id": 13,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "transfer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 9,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6,
"name": "to",
"nodeType": "VariableDeclaration",
"scope": 13,
"src": "372:10:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 5,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "372:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 13,
"src": "384:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "384:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "371:27:0"
},
"returnParameters": {
"id": 12,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 11,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 13,
"src": "415:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 10,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "415:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "414:6:0"
},
"scope": 14,
"src": "354:67:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
}
],
"scope": 108,
"src": "328:95:0"
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 15,
"name": "ERC20Receiver",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 961,
"src": "445:13:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20Receiver_$961",
"typeString": "contract ERC20Receiver"
}
},
"id": 16,
"nodeType": "InheritanceSpecifier",
"src": "445:13:0"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 17,
"name": "ValidatorsManager",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1370,
"src": "460:17:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ValidatorsManager_$1370",
"typeString": "contract ValidatorsManager"
}
},
"id": 18,
"nodeType": "InheritanceSpecifier",
"src": "460:17:0"
}
],
"contractDependencies": [
961,
1370,
2655
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 107,
"linearizedBaseContracts": [
107,
1370,
2655,
961
],
"name": "Gateway",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 21,
"libraryName": {
"contractScope": null,
"id": 19,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2546,
"src": "491:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$2546",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "485:27:0",
"typeName": {
"id": 20,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "504:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"constant": false,
"id": 25,
"name": "balances",
"nodeType": "VariableDeclaration",
"scope": 107,
"src": "552:44:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"typeName": {
"id": 24,
"keyType": {
"id": 22,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "561:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "552:28:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"valueType": {
"id": 23,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "572:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 27,
"name": "tokenAddress",
"nodeType": "VariableDeclaration",
"scope": 107,
"src": "644:27:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 26,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "644:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"anonymous": false,
"documentation": null,
"id": 33,
"name": "ERC20Withdrawn",
"nodeType": "EventDefinition",
"parameters": {
"id": 32,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 29,
"indexed": true,
"name": "owner",
"nodeType": "VariableDeclaration",
"scope": 33,
"src": "699:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 28,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "699:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 31,
"indexed": false,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 33,
"src": "722:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 30,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "722:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "698:38:0"
},
"src": "678:59:0"
},
{
"anonymous": false,
"documentation": null,
"id": 39,
"name": "ERC20Received",
"nodeType": "EventDefinition",
"parameters": {
"id": 38,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 35,
"indexed": false,
"name": "from",
"nodeType": "VariableDeclaration",
"scope": 39,
"src": "762:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 34,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "762:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 37,
"indexed": false,
"name": "amount",
"nodeType": "VariableDeclaration",
"scope": 39,
"src": "776:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 36,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "776:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "761:30:0"
},
"src": "742:50:0"
},
{
"body": {
"id": 61,
"nodeType": "Block",
"src": "1055:45:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 59,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 57,
"name": "tokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 27,
"src": "1065:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 58,
"name": "_tokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 41,
"src": "1080:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1065:28:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 60,
"nodeType": "ExpressionStatement",
"src": "1065:28:0"
}
]
},
"documentation": null,
"id": 62,
"implemented": true,
"kind": "constructor",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 51,
"name": "_tokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 41,
"src": "989:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 52,
"name": "_validators",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44,
"src": "1004:11:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 53,
"name": "_threshold_num",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 46,
"src": "1017:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
{
"argumentTypes": null,
"id": 54,
"name": "_threshold_denom",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 48,
"src": "1033:16:0",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
}
],
"id": 55,
"modifierName": {
"argumentTypes": null,
"id": 50,
"name": "ValidatorsManager",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1370,
"src": "971:17:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ValidatorsManager_$1370_$",
"typeString": "type(contract ValidatorsManager)"
}
},
"nodeType": "ModifierInvocation",
"src": "971:79:0"
}
],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 49,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 41,
"name": "_tokenAddress",
"nodeType": "VariableDeclaration",
"scope": 62,
"src": "820:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 40,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "820:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 44,
"name": "_validators",
"nodeType": "VariableDeclaration",
"scope": 62,
"src": "851:28:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 42,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "851:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 43,
"length": null,
"nodeType": "ArrayTypeName",
"src": "851:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 46,
"name": "_threshold_num",
"nodeType": "VariableDeclaration",
"scope": 62,
"src": "889:20:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 45,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "889:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 48,
"name": "_threshold_denom",
"nodeType": "VariableDeclaration",
"scope": 62,
"src": "919:22:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 47,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "919:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "810:137:0"
},
"returnParameters": {
"id": 56,
"nodeType": "ParameterList",
"parameters": [],
"src": "1055:0:0"
},
"scope": 107,
"src": "798:302:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 88,
"nodeType": "Block",
"src": "1263:271:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 77,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3404,
"src": "1459:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 78,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1459:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 79,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 64,
"src": "1471:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 74,
"name": "tokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 27,
"src": "1436:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 73,
"name": "ERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14,
"src": "1425:10:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ERC20Token_$14_$",
"typeString": "type(contract ERC20Token)"
}
},
"id": 75,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1425:24:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20Token_$14",
"typeString": "contract ERC20Token"
}
},
"id": 76,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": 13,
"src": "1425:33:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$",
"typeString": "function (address,uint256) external returns (bool)"
}
},
"id": 80,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1425:53:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 81,
"nodeType": "ExpressionStatement",
"src": "1425:53:0"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 83,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3404,
"src": "1508:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 84,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1508:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 85,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 64,
"src": "1520:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 82,
"name": "ERC20Withdrawn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 33,
"src": "1493:14:0",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256)"
}
},
"id": 86,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1493:34:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 87,
"nodeType": "EmitStatement",
"src": "1488:39:0"
}
]
},
"documentation": null,
"id": 89,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 69,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 64,
"src": "1240:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 70,
"name": "signature",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "1248:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes calldata"
}
}
],
"id": 71,
"modifierName": {
"argumentTypes": null,
"id": 68,
"name": "isVerifiedByValidator",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1119,
"src": "1218:21:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_uint256_$_t_bytes_memory_ptr_$",
"typeString": "modifier (uint256,bytes memory)"
}
},
"nodeType": "ModifierInvocation",
"src": "1218:40:0"
}
],
"name": "withdrawERC20",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 67,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 64,
"name": "amount",
"nodeType": "VariableDeclaration",
"scope": 89,
"src": "1138:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 63,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1138:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 66,
"name": "signature",
"nodeType": "VariableDeclaration",
"scope": 89,
"src": "1162:24:0",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 65,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "1162:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1128:64:0"
},
"returnParameters": {
"id": 72,
"nodeType": "ParameterList",
"parameters": [],
"src": "1263:0:0"
},
"scope": 107,
"src": "1106:428:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
},
{
"body": {
"id": 105,
"nodeType": "Block",
"src": "1662:81:0",
"statements": [
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 99,
"name": "_from",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 91,
"src": "1691:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 100,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 93,
"src": "1698:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 98,
"name": "ERC20Received",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 39,
"src": "1677:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256)"
}
},
"id": 101,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1677:28:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 102,
"nodeType": "EmitStatement",
"src": "1672:33:0"
},
{
"expression": {
"argumentTypes": null,
"id": 103,
"name": "ERC20_RECEIVED",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 951,
"src": "1722:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"functionReturnParameters": 97,
"id": 104,
"nodeType": "Return",
"src": "1715:21:0"
}
]
},
"documentation": null,
"id": 106,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "onERC20Received",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 94,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 91,
"name": "_from",
"nodeType": "VariableDeclaration",
"scope": 106,
"src": "1574:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 90,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1574:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 93,
"name": "amount",
"nodeType": "VariableDeclaration",
"scope": 106,
"src": "1597:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 92,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1597:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1564:53:0"
},
"returnParameters": {
"id": 97,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 96,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 106,
"src": "1650:6:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 95,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "1650:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1649:8:0"
},
"scope": 107,
"src": "1540:203:0",
"stateMutability": "nonpayable",
"superFunction": 960,
"visibility": "public"
}
],
"scope": 108,
"src": "425:1320:0"
}
],
"src": "162:1584:0"
},
"legacyAST": {
"absolutePath": "/Users/thomasvanderstraeten/code/hey/mainchain/contracts/Gateway.sol",
"exportedSymbols": {
"ERC20Token": [
14
],
"Gateway": [
107
]
},
"id": 108,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"^",
"0.5",
".0"
],
"nodeType": "PragmaDirective",
"src": "162:23:0"
},
{
"absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol",
"file": "openzeppelin-solidity/contracts/math/SafeMath.sol",
"id": 2,
"nodeType": "ImportDirective",
"scope": 108,
"sourceUnit": 2547,
"src": "187:59:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/Users/thomasvanderstraeten/code/hey/mainchain/contracts/gateway/ValidatorsManager.sol",
"file": "./gateway/ValidatorsManager.sol",
"id": 3,
"nodeType": "ImportDirective",
"scope": 108,
"sourceUnit": 1371,
"src": "247:41:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/Users/thomasvanderstraeten/code/hey/mainchain/contracts/gateway/ERC20Receiver.sol",
"file": "./gateway/ERC20Receiver.sol",
"id": 4,
"nodeType": "ImportDirective",
"scope": 108,
"sourceUnit": 962,
"src": "289:37:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": false,
"id": 14,
"linearizedBaseContracts": [
14
],
"name": "ERC20Token",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": null,
"id": 13,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "transfer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 9,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6,
"name": "to",
"nodeType": "VariableDeclaration",
"scope": 13,
"src": "372:10:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 5,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "372:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 13,
"src": "384:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "384:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "371:27:0"
},
"returnParameters": {
"id": 12,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 11,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 13,
"src": "415:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 10,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "415:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "414:6:0"
},
"scope": 14,
"src": "354:67:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
}
],
"scope": 108,
"src": "328:95:0"
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 15,
"name": "ERC20Receiver",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 961,
"src": "445:13:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20Receiver_$961",
"typeString": "contract ERC20Receiver"
}
},
"id": 16,
"nodeType": "InheritanceSpecifier",
"src": "445:13:0"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 17,
"name": "ValidatorsManager",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1370,
"src": "460:17:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ValidatorsManager_$1370",
"typeString": "contract ValidatorsManager"
}
},
"id": 18,
"nodeType": "InheritanceSpecifier",
"src": "460:17:0"
}
],
"contractDependencies": [
961,
1370,
2655
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 107,
"linearizedBaseContracts": [
107,
1370,
2655,
961
],
"name": "Gateway",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 21,
"libraryName": {
"contractScope": null,
"id": 19,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2546,
"src": "491:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$2546",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "485:27:0",
"typeName": {
"id": 20,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "504:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"constant": false,
"id": 25,
"name": "balances",
"nodeType": "VariableDeclaration",
"scope": 107,
"src": "552:44:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"typeName": {
"id": 24,
"keyType": {
"id": 22,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "561:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "552:28:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"valueType": {
"id": 23,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "572:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 27,
"name": "tokenAddress",
"nodeType": "VariableDeclaration",
"scope": 107,
"src": "644:27:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 26,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "644:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"anonymous": false,
"documentation": null,
"id": 33,
"name": "ERC20Withdrawn",
"nodeType": "EventDefinition",
"parameters": {
"id": 32,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 29,
"indexed": true,
"name": "owner",
"nodeType": "VariableDeclaration",
"scope": 33,
"src": "699:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 28,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "699:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 31,
"indexed": false,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 33,
"src": "722:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 30,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "722:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "698:38:0"
},
"src": "678:59:0"
},
{
"anonymous": false,
"documentation": null,
"id": 39,
"name": "ERC20Received",
"nodeType": "EventDefinition",
"parameters": {
"id": 38,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 35,
"indexed": false,
"name": "from",
"nodeType": "VariableDeclaration",
"scope": 39,
"src": "762:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 34,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "762:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 37,
"indexed": false,
"name": "amount",
"nodeType": "VariableDeclaration",
"scope": 39,
"src": "776:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 36,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "776:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "761:30:0"
},
"src": "742:50:0"
},
{
"body": {
"id": 61,
"nodeType": "Block",
"src": "1055:45:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 59,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 57,
"name": "tokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 27,
"src": "1065:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 58,
"name": "_tokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 41,
"src": "1080:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1065:28:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 60,
"nodeType": "ExpressionStatement",
"src": "1065:28:0"
}
]
},
"documentation": null,
"id": 62,
"implemented": true,
"kind": "constructor",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 51,
"name": "_tokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 41,
"src": "989:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 52,
"name": "_validators",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44,
"src": "1004:11:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 53,
"name": "_threshold_num",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 46,
"src": "1017:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
{
"argumentTypes": null,
"id": 54,
"name": "_threshold_denom",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 48,
"src": "1033:16:0",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
}
],
"id": 55,
"modifierName": {
"argumentTypes": null,
"id": 50,
"name": "ValidatorsManager",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1370,
"src": "971:17:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ValidatorsManager_$1370_$",
"typeString": "type(contract ValidatorsManager)"
}
},
"nodeType": "ModifierInvocation",
"src": "971:79:0"
}
],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 49,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 41,
"name": "_tokenAddress",
"nodeType": "VariableDeclaration",
"scope": 62,
"src": "820:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 40,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "820:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 44,
"name": "_validators",
"nodeType": "VariableDeclaration",
"scope": 62,
"src": "851:28:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 42,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "851:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 43,
"length": null,
"nodeType": "ArrayTypeName",
"src": "851:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 46,
"name": "_threshold_num",
"nodeType": "VariableDeclaration",
"scope": 62,
"src": "889:20:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 45,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "889:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 48,
"name": "_threshold_denom",
"nodeType": "VariableDeclaration",
"scope": 62,
"src": "919:22:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 47,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "919:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "810:137:0"
},
"returnParameters": {
"id": 56,
"nodeType": "ParameterList",
"parameters": [],
"src": "1055:0:0"
},
"scope": 107,
"src": "798:302:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 88,
"nodeType": "Block",
"src": "1263:271:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 77,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3404,
"src": "1459:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 78,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1459:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 79,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 64,
"src": "1471:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 74,
"name": "tokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 27,
"src": "1436:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 73,
"name": "ERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14,
"src": "1425:10:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ERC20Token_$14_$",
"typeString": "type(contract ERC20Token)"
}
},
"id": 75,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1425:24:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20Token_$14",
"typeString": "contract ERC20Token"
}
},
"id": 76,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": 13,
"src": "1425:33:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$",
"typeString": "function (address,uint256) external returns (bool)"
}
},
"id": 80,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1425:53:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 81,
"nodeType": "ExpressionStatement",
"src": "1425:53:0"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 83,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3404,
"src": "1508:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 84,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1508:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 85,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 64,
"src": "1520:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 82,
"name": "ERC20Withdrawn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 33,
"src": "1493:14:0",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256)"
}
},
"id": 86,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1493:34:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 87,
"nodeType": "EmitStatement",
"src": "1488:39:0"
}
]
},
"documentation": null,
"id": 89,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 69,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 64,
"src": "1240:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 70,
"name": "signature",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "1248:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes calldata"
}
}
],
"id": 71,
"modifierName": {
"argumentTypes": null,
"id": 68,
"name": "isVerifiedByValidator",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1119,
"src": "1218:21:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_uint256_$_t_bytes_memory_ptr_$",
"typeString": "modifier (uint256,bytes memory)"
}
},
"nodeType": "ModifierInvocation",
"src": "1218:40:0"
}
],
"name": "withdrawERC20",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 67,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 64,
"name": "amount",
"nodeType": "VariableDeclaration",
"scope": 89,
"src": "1138:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 63,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1138:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 66,
"name": "signature",
"nodeType": "VariableDeclaration",
"scope": 89,
"src": "1162:24:0",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 65,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "1162:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1128:64:0"
},
"returnParameters": {
"id": 72,
"nodeType": "ParameterList",
"parameters": [],
"src": "1263:0:0"
},
"scope": 107,
"src": "1106:428:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
},
{
"body": {
"id": 105,
"nodeType": "Block",
"src": "1662:81:0",
"statements": [
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 99,
"name": "_from",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 91,
"src": "1691:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 100,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 93,
"src": "1698:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 98,
"name": "ERC20Received",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 39,
"src": "1677:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256)"
}
},
"id": 101,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1677:28:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 102,
"nodeType": "EmitStatement",
"src": "1672:33:0"
},
{
"expression": {
"argumentTypes": null,
"id": 103,
"name": "ERC20_RECEIVED",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 951,
"src": "1722:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"functionReturnParameters": 97,
"id": 104,
"nodeType": "Return",
"src": "1715:21:0"
}
]
},
"documentation": null,
"id": 106,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "onERC20Received",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 94,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 91,
"name": "_from",
"nodeType": "VariableDeclaration",
"scope": 106,
"src": "1574:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 90,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1574:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 93,
"name": "amount",
"nodeType": "VariableDeclaration",
"scope": 106,
"src": "1597:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 92,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1597:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1564:53:0"
},
"returnParameters": {
"id": 97,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 96,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 106,
"src": "1650:6:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 95,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "1650:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1649:8:0"
},
"scope": 107,
"src": "1540:203:0",
"stateMutability": "nonpayable",
"superFunction": 960,
"visibility": "public"
}
],
"scope": 108,
"src": "425:1320:0"
}
],
"src": "162:1584:0"
},
"compiler": {
"name": "solc",
"version": "0.5.0+commit.1d4f565a.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.0.2",
"updatedAt": "2019-02-28T16:14:49.612Z",
"devdoc": {
"methods": {}
},
"userdoc": {
"methods": {}
}
}