Files
openzeppelin-contracts/build/contracts/SafeERC20.json
2018-08-23 11:45:35 -03:00

1663 lines
65 KiB
JSON

{
"contractName": "SafeERC20",
"abi": [],
"bytecode": "0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f30073000000000000000000000000000000000000000030146080604052600080fd00a165627a7a72305820d25f06bda5e2d73d555d67eb66fa09a8da50ec5fecb655e25743e10c6c7247b20029",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fd00a165627a7a72305820d25f06bda5e2d73d555d67eb66fa09a8da50ec5fecb655e25743e10c6c7247b20029",
"sourceMap": "346:444:40:-;;132:2:-1;166:7;155:9;146:7;137:37;252:7;246:14;243:1;238:23;232:4;229:33;270:1;265:20;;;;222:63;;265:20;274:9;222:63;;298:9;295:1;288:20;328:4;319:7;311:22;352:7;343;336:24",
"deployedSourceMap": "346:444:40:-;;;;;;;;",
"source": "pragma solidity ^0.4.21;\n\nimport \"./ERC20Basic.sol\";\nimport \"./ERC20.sol\";\n\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure.\n * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n function safeTransfer(ERC20Basic token, address to, uint256 value) internal {\n assert(token.transfer(to, value));\n }\n\n function safeTransferFrom(\n ERC20 token,\n address from,\n address to,\n uint256 value\n )\n internal\n {\n assert(token.transferFrom(from, to, value));\n }\n\n function safeApprove(ERC20 token, address spender, uint256 value) internal {\n assert(token.approve(spender, value));\n }\n}\n",
"sourcePath": "/home/spalladino/Projects/openzeppelin-zos/contracts/token/ERC20/SafeERC20.sol",
"ast": {
"absolutePath": "/home/spalladino/Projects/openzeppelin-zos/contracts/token/ERC20/SafeERC20.sol",
"exportedSymbols": {
"SafeERC20": [
2807
]
},
"id": 2808,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 2747,
"literals": [
"solidity",
"^",
"0.4",
".21"
],
"nodeType": "PragmaDirective",
"src": "0:24:40"
},
{
"absolutePath": "/home/spalladino/Projects/openzeppelin-zos/contracts/token/ERC20/ERC20Basic.sol",
"file": "./ERC20Basic.sol",
"id": 2748,
"nodeType": "ImportDirective",
"scope": 2808,
"sourceUnit": 2512,
"src": "26:26:40",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/spalladino/Projects/openzeppelin-zos/contracts/token/ERC20/ERC20.sol",
"file": "./ERC20.sol",
"id": 2749,
"nodeType": "ImportDirective",
"scope": 2808,
"sourceUnit": 2480,
"src": "53:21:40",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": "@title SafeERC20\n@dev Wrappers around ERC20 operations that throw on failure.\nTo use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,\nwhich allows you to call the safe operations as `token.safeTransfer(...)`, etc.",
"fullyImplemented": true,
"id": 2807,
"linearizedBaseContracts": [
2807
],
"name": "SafeERC20",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 2766,
"nodeType": "Block",
"src": "444:44:40",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 2761,
"name": "to",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2753,
"src": "472:2:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 2762,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2755,
"src": "476:5:40",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 2759,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2751,
"src": "457:5:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20Basic_$2511",
"typeString": "contract ERC20Basic"
}
},
"id": 2760,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": 2502,
"src": "457:14:40",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$",
"typeString": "function (address,uint256) external returns (bool)"
}
},
"id": 2763,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "457:25:40",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 2758,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4773,
"src": "450:6:40",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 2764,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "450:33:40",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 2765,
"nodeType": "ExpressionStatement",
"src": "450:33:40"
}
]
},
"documentation": null,
"id": 2767,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "safeTransfer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2756,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2751,
"name": "token",
"nodeType": "VariableDeclaration",
"scope": 2767,
"src": "390:16:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20Basic_$2511",
"typeString": "contract ERC20Basic"
},
"typeName": {
"contractScope": null,
"id": 2750,
"name": "ERC20Basic",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2511,
"src": "390:10:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20Basic_$2511",
"typeString": "contract ERC20Basic"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2753,
"name": "to",
"nodeType": "VariableDeclaration",
"scope": 2767,
"src": "408:10:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2752,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "408:7:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2755,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 2767,
"src": "420:13:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2754,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "420:7:40",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "389:45:40"
},
"payable": false,
"returnParameters": {
"id": 2757,
"nodeType": "ParameterList",
"parameters": [],
"src": "444:0:40"
},
"scope": 2807,
"src": "368:120:40",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 2787,
"nodeType": "Block",
"src": "607:54:40",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 2781,
"name": "from",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2771,
"src": "639:4:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 2782,
"name": "to",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2773,
"src": "645:2:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 2783,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2775,
"src": "649:5:40",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 2779,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2769,
"src": "620:5:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20_$2479",
"typeString": "contract ERC20"
}
},
"id": 2780,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transferFrom",
"nodeType": "MemberAccess",
"referencedDeclaration": 2461,
"src": "620:18:40",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$",
"typeString": "function (address,address,uint256) external returns (bool)"
}
},
"id": 2784,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "620:35:40",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 2778,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4773,
"src": "613:6:40",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 2785,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "613:43:40",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 2786,
"nodeType": "ExpressionStatement",
"src": "613:43:40"
}
]
},
"documentation": null,
"id": 2788,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "safeTransferFrom",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2776,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2769,
"name": "token",
"nodeType": "VariableDeclaration",
"scope": 2788,
"src": "523:11:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20_$2479",
"typeString": "contract ERC20"
},
"typeName": {
"contractScope": null,
"id": 2768,
"name": "ERC20",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2479,
"src": "523:5:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20_$2479",
"typeString": "contract ERC20"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2771,
"name": "from",
"nodeType": "VariableDeclaration",
"scope": 2788,
"src": "540:12:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2770,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "540:7:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2773,
"name": "to",
"nodeType": "VariableDeclaration",
"scope": 2788,
"src": "558:10:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2772,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "558:7:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2775,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 2788,
"src": "574:13:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2774,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "574:7:40",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "517:74:40"
},
"payable": false,
"returnParameters": {
"id": 2777,
"nodeType": "ParameterList",
"parameters": [],
"src": "607:0:40"
},
"scope": 2807,
"src": "492:169:40",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 2805,
"nodeType": "Block",
"src": "740:48:40",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 2800,
"name": "spender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2792,
"src": "767:7:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 2801,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2794,
"src": "776:5:40",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 2798,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2790,
"src": "753:5:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20_$2479",
"typeString": "contract ERC20"
}
},
"id": 2799,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "approve",
"nodeType": "MemberAccess",
"referencedDeclaration": 2470,
"src": "753:13:40",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$",
"typeString": "function (address,uint256) external returns (bool)"
}
},
"id": 2802,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "753:29:40",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 2797,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4773,
"src": "746:6:40",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 2803,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "746:37:40",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 2804,
"nodeType": "ExpressionStatement",
"src": "746:37:40"
}
]
},
"documentation": null,
"id": 2806,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "safeApprove",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2795,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2790,
"name": "token",
"nodeType": "VariableDeclaration",
"scope": 2806,
"src": "686:11:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20_$2479",
"typeString": "contract ERC20"
},
"typeName": {
"contractScope": null,
"id": 2789,
"name": "ERC20",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2479,
"src": "686:5:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20_$2479",
"typeString": "contract ERC20"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2792,
"name": "spender",
"nodeType": "VariableDeclaration",
"scope": 2806,
"src": "699:15:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2791,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "699:7:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2794,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 2806,
"src": "716:13:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2793,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "716:7:40",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "685:45:40"
},
"payable": false,
"returnParameters": {
"id": 2796,
"nodeType": "ParameterList",
"parameters": [],
"src": "740:0:40"
},
"scope": 2807,
"src": "665:123:40",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
}
],
"scope": 2808,
"src": "346:444:40"
}
],
"src": "0:791:40"
},
"legacyAST": {
"absolutePath": "/home/spalladino/Projects/openzeppelin-zos/contracts/token/ERC20/SafeERC20.sol",
"exportedSymbols": {
"SafeERC20": [
2807
]
},
"id": 2808,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 2747,
"literals": [
"solidity",
"^",
"0.4",
".21"
],
"nodeType": "PragmaDirective",
"src": "0:24:40"
},
{
"absolutePath": "/home/spalladino/Projects/openzeppelin-zos/contracts/token/ERC20/ERC20Basic.sol",
"file": "./ERC20Basic.sol",
"id": 2748,
"nodeType": "ImportDirective",
"scope": 2808,
"sourceUnit": 2512,
"src": "26:26:40",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/spalladino/Projects/openzeppelin-zos/contracts/token/ERC20/ERC20.sol",
"file": "./ERC20.sol",
"id": 2749,
"nodeType": "ImportDirective",
"scope": 2808,
"sourceUnit": 2480,
"src": "53:21:40",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": "@title SafeERC20\n@dev Wrappers around ERC20 operations that throw on failure.\nTo use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,\nwhich allows you to call the safe operations as `token.safeTransfer(...)`, etc.",
"fullyImplemented": true,
"id": 2807,
"linearizedBaseContracts": [
2807
],
"name": "SafeERC20",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 2766,
"nodeType": "Block",
"src": "444:44:40",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 2761,
"name": "to",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2753,
"src": "472:2:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 2762,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2755,
"src": "476:5:40",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 2759,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2751,
"src": "457:5:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20Basic_$2511",
"typeString": "contract ERC20Basic"
}
},
"id": 2760,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": 2502,
"src": "457:14:40",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$",
"typeString": "function (address,uint256) external returns (bool)"
}
},
"id": 2763,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "457:25:40",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 2758,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4773,
"src": "450:6:40",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 2764,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "450:33:40",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 2765,
"nodeType": "ExpressionStatement",
"src": "450:33:40"
}
]
},
"documentation": null,
"id": 2767,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "safeTransfer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2756,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2751,
"name": "token",
"nodeType": "VariableDeclaration",
"scope": 2767,
"src": "390:16:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20Basic_$2511",
"typeString": "contract ERC20Basic"
},
"typeName": {
"contractScope": null,
"id": 2750,
"name": "ERC20Basic",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2511,
"src": "390:10:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20Basic_$2511",
"typeString": "contract ERC20Basic"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2753,
"name": "to",
"nodeType": "VariableDeclaration",
"scope": 2767,
"src": "408:10:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2752,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "408:7:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2755,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 2767,
"src": "420:13:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2754,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "420:7:40",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "389:45:40"
},
"payable": false,
"returnParameters": {
"id": 2757,
"nodeType": "ParameterList",
"parameters": [],
"src": "444:0:40"
},
"scope": 2807,
"src": "368:120:40",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 2787,
"nodeType": "Block",
"src": "607:54:40",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 2781,
"name": "from",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2771,
"src": "639:4:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 2782,
"name": "to",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2773,
"src": "645:2:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 2783,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2775,
"src": "649:5:40",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 2779,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2769,
"src": "620:5:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20_$2479",
"typeString": "contract ERC20"
}
},
"id": 2780,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transferFrom",
"nodeType": "MemberAccess",
"referencedDeclaration": 2461,
"src": "620:18:40",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$",
"typeString": "function (address,address,uint256) external returns (bool)"
}
},
"id": 2784,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "620:35:40",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 2778,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4773,
"src": "613:6:40",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 2785,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "613:43:40",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 2786,
"nodeType": "ExpressionStatement",
"src": "613:43:40"
}
]
},
"documentation": null,
"id": 2788,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "safeTransferFrom",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2776,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2769,
"name": "token",
"nodeType": "VariableDeclaration",
"scope": 2788,
"src": "523:11:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20_$2479",
"typeString": "contract ERC20"
},
"typeName": {
"contractScope": null,
"id": 2768,
"name": "ERC20",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2479,
"src": "523:5:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20_$2479",
"typeString": "contract ERC20"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2771,
"name": "from",
"nodeType": "VariableDeclaration",
"scope": 2788,
"src": "540:12:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2770,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "540:7:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2773,
"name": "to",
"nodeType": "VariableDeclaration",
"scope": 2788,
"src": "558:10:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2772,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "558:7:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2775,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 2788,
"src": "574:13:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2774,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "574:7:40",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "517:74:40"
},
"payable": false,
"returnParameters": {
"id": 2777,
"nodeType": "ParameterList",
"parameters": [],
"src": "607:0:40"
},
"scope": 2807,
"src": "492:169:40",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 2805,
"nodeType": "Block",
"src": "740:48:40",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 2800,
"name": "spender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2792,
"src": "767:7:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 2801,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2794,
"src": "776:5:40",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 2798,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2790,
"src": "753:5:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20_$2479",
"typeString": "contract ERC20"
}
},
"id": 2799,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "approve",
"nodeType": "MemberAccess",
"referencedDeclaration": 2470,
"src": "753:13:40",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$",
"typeString": "function (address,uint256) external returns (bool)"
}
},
"id": 2802,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "753:29:40",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 2797,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4773,
"src": "746:6:40",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 2803,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "746:37:40",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 2804,
"nodeType": "ExpressionStatement",
"src": "746:37:40"
}
]
},
"documentation": null,
"id": 2806,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "safeApprove",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2795,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2790,
"name": "token",
"nodeType": "VariableDeclaration",
"scope": 2806,
"src": "686:11:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20_$2479",
"typeString": "contract ERC20"
},
"typeName": {
"contractScope": null,
"id": 2789,
"name": "ERC20",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2479,
"src": "686:5:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20_$2479",
"typeString": "contract ERC20"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2792,
"name": "spender",
"nodeType": "VariableDeclaration",
"scope": 2806,
"src": "699:15:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2791,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "699:7:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2794,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 2806,
"src": "716:13:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2793,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "716:7:40",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "685:45:40"
},
"payable": false,
"returnParameters": {
"id": 2796,
"nodeType": "ParameterList",
"parameters": [],
"src": "740:0:40"
},
"scope": 2807,
"src": "665:123:40",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
}
],
"scope": 2808,
"src": "346:444:40"
}
],
"src": "0:791:40"
},
"compiler": {
"name": "solc",
"version": "0.4.24+commit.e67f0147.Emscripten.clang"
},
"networks": {},
"schemaVersion": "2.0.1",
"updatedAt": "2018-08-23T14:35:50.640Z"
}