cic-stack/apps/cic-eth/tests/testdata/bancor/TokenHandler.json

5249 lines
230 KiB
JSON

{
"contractName": "TokenHandler",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/TokenHandler.sol\":\"TokenHandler\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/token/interfaces/IERC20Token.sol\":{\"keccak256\":\"0xe6f988c3156e88258474526a541d5a42b6a9adae98b04177a059d9f723bc82cd\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://9a6eb77a5b9ce70995a11a6e48ac3985a4c70896fe5fe04d46146ad7c1c83ea3\",\"dweb:/ipfs/QmYvGSveZFG51tghwkVuu6eK9Jy8frHpfLxHTMyvNZN461\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/TokenHandler.sol\":{\"keccak256\":\"0xf65b87e3bf3343e368da67878c19d1a043a1025b10e9053d3562b53b4aa447fe\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://b85c5d96642c14c53b8d5062eecd4d27d3bdb457d1d0f130900763a75a512eb7\",\"dweb:/ipfs/QmUHtbqC1khqnRZXYn11Aykus4m5e9MVNUWqorxhpr5ipJ\"]}},\"version\":1}",
"bytecode": "0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea264697066735822122043249e53cab8279fb6ffb75d00d6be49301a7de6016b03d5a2e4d84d7a2ea3a764736f6c634300060c0033",
"deployedBytecode": "0x6080604052600080fdfea264697066735822122043249e53cab8279fb6ffb75d00d6be49301a7de6016b03d5a2e4d84d7a2ea3a764736f6c634300060c0033",
"immutableReferences": {},
"sourceMap": "122:2418:61:-:0;;;;;;;;;;;;;;;;;;;",
"deployedSourceMap": "122:2418:61:-:0;;;;;",
"source": "// SPDX-License-Identifier: SEE LICENSE IN LICENSE\npragma solidity 0.6.12;\nimport \"../token/interfaces/IERC20Token.sol\";\n\ncontract TokenHandler {\n bytes4 private constant APPROVE_FUNC_SELECTOR = bytes4(keccak256(\"approve(address,uint256)\"));\n bytes4 private constant TRANSFER_FUNC_SELECTOR = bytes4(keccak256(\"transfer(address,uint256)\"));\n bytes4 private constant TRANSFER_FROM_FUNC_SELECTOR = bytes4(keccak256(\"transferFrom(address,address,uint256)\"));\n\n /**\n * @dev executes the ERC20 token's `approve` function and reverts upon failure\n * the main purpose of this function is to prevent a non standard ERC20 token\n * from failing silently\n *\n * @param _token ERC20 token address\n * @param _spender approved address\n * @param _value allowance amount\n */\n function safeApprove(IERC20Token _token, address _spender, uint256 _value) internal {\n (bool success, bytes memory data) = address(_token).call(abi.encodeWithSelector(APPROVE_FUNC_SELECTOR, _spender, _value));\n require(success && (data.length == 0 || abi.decode(data, (bool))), 'ERR_APPROVE_FAILED');\n }\n\n /**\n * @dev executes the ERC20 token's `transfer` function and reverts upon failure\n * the main purpose of this function is to prevent a non standard ERC20 token\n * from failing silently\n *\n * @param _token ERC20 token address\n * @param _to target address\n * @param _value transfer amount\n */\n function safeTransfer(IERC20Token _token, address _to, uint256 _value) internal {\n (bool success, bytes memory data) = address(_token).call(abi.encodeWithSelector(TRANSFER_FUNC_SELECTOR, _to, _value));\n require(success && (data.length == 0 || abi.decode(data, (bool))), 'ERR_TRANSFER_FAILED');\n }\n\n /**\n * @dev executes the ERC20 token's `transferFrom` function and reverts upon failure\n * the main purpose of this function is to prevent a non standard ERC20 token\n * from failing silently\n *\n * @param _token ERC20 token address\n * @param _from source address\n * @param _to target address\n * @param _value transfer amount\n */\n function safeTransferFrom(IERC20Token _token, address _from, address _to, uint256 _value) internal {\n (bool success, bytes memory data) = address(_token).call(abi.encodeWithSelector(TRANSFER_FROM_FUNC_SELECTOR, _from, _to, _value));\n require(success && (data.length == 0 || abi.decode(data, (bool))), 'ERR_TRANSFER_FROM_FAILED');\n }\n}\n",
"sourcePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/TokenHandler.sol",
"ast": {
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/TokenHandler.sol",
"exportedSymbols": {
"TokenHandler": [
22526
]
},
"id": 22527,
"license": "SEE LICENSE IN LICENSE",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 22356,
"literals": [
"solidity",
"0.6",
".12"
],
"nodeType": "PragmaDirective",
"src": "51:23:61"
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/token/interfaces/IERC20Token.sol",
"file": "../token/interfaces/IERC20Token.sol",
"id": 22357,
"nodeType": "ImportDirective",
"scope": 22527,
"sourceUnit": 21128,
"src": "75:45:61",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 22526,
"linearizedBaseContracts": [
22526
],
"name": "TokenHandler",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": true,
"id": 22365,
"mutability": "constant",
"name": "APPROVE_FUNC_SELECTOR",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22526,
"src": "150:93:61",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 22358,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "150:6:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"value": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "617070726f766528616464726573732c75696e7432353629",
"id": 22362,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "215:26:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_095ea7b334ae44009aa867bfb386f5c3b4b443ac6f0ee573fa91c4608fbadfba",
"typeString": "literal_string \"approve(address,uint256)\""
},
"value": "approve(address,uint256)"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_095ea7b334ae44009aa867bfb386f5c3b4b443ac6f0ee573fa91c4608fbadfba",
"typeString": "literal_string \"approve(address,uint256)\""
}
],
"id": 22361,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -8,
"src": "205:9:61",
"typeDescriptions": {
"typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 22363,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "205:37:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 22360,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "198:6:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bytes4_$",
"typeString": "type(bytes4)"
},
"typeName": {
"id": 22359,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "198:6:61",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 22364,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "198:45:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"visibility": "private"
},
{
"constant": true,
"id": 22373,
"mutability": "constant",
"name": "TRANSFER_FUNC_SELECTOR",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22526,
"src": "249:95:61",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 22366,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "249:6:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"value": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "7472616e7366657228616464726573732c75696e7432353629",
"id": 22370,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "315:27:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_a9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b",
"typeString": "literal_string \"transfer(address,uint256)\""
},
"value": "transfer(address,uint256)"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_a9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b",
"typeString": "literal_string \"transfer(address,uint256)\""
}
],
"id": 22369,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -8,
"src": "305:9:61",
"typeDescriptions": {
"typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 22371,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "305:38:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 22368,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "298:6:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bytes4_$",
"typeString": "type(bytes4)"
},
"typeName": {
"id": 22367,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "298:6:61",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 22372,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "298:46:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"visibility": "private"
},
{
"constant": true,
"id": 22381,
"mutability": "constant",
"name": "TRANSFER_FROM_FUNC_SELECTOR",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22526,
"src": "350:112:61",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 22374,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "350:6:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"value": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "7472616e7366657246726f6d28616464726573732c616464726573732c75696e7432353629",
"id": 22378,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "421:39:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_23b872dd7302113369cda2901243429419bec145408fa8b352b3dd92b66c680b",
"typeString": "literal_string \"transferFrom(address,address,uint256)\""
},
"value": "transferFrom(address,address,uint256)"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_23b872dd7302113369cda2901243429419bec145408fa8b352b3dd92b66c680b",
"typeString": "literal_string \"transferFrom(address,address,uint256)\""
}
],
"id": 22377,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -8,
"src": "411:9:61",
"typeDescriptions": {
"typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 22379,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "411:50:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 22376,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "404:6:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bytes4_$",
"typeString": "type(bytes4)"
},
"typeName": {
"id": 22375,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "404:6:61",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 22380,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "404:58:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"visibility": "private"
},
{
"body": {
"id": 22427,
"nodeType": "Block",
"src": "899:236:61",
"statements": [
{
"assignments": [
22392,
22394
],
"declarations": [
{
"constant": false,
"id": 22392,
"mutability": "mutable",
"name": "success",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22427,
"src": "910:12:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 22391,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "910:4:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22394,
"mutability": "mutable",
"name": "data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22427,
"src": "924:17:61",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 22393,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "924:5:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 22407,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 22402,
"name": "APPROVE_FUNC_SELECTOR",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22365,
"src": "989:21:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
{
"argumentTypes": null,
"id": 22403,
"name": "_spender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22386,
"src": "1012:8:61",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 22404,
"name": "_value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22388,
"src": "1022:6:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 22400,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "966:3:61",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 22401,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodeWithSelector",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "966:22:61",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodewithselector_pure$_t_bytes4_$returns$_t_bytes_memory_ptr_$",
"typeString": "function (bytes4) pure returns (bytes memory)"
}
},
"id": 22405,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "966:63:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 22397,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22384,
"src": "953:6:61",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 22396,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "945:7:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 22395,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "945:7:61",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 22398,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "945:15:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 22399,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "call",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "945:20:61",
"typeDescriptions": {
"typeIdentifier": "t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "function (bytes memory) payable returns (bool,bytes memory)"
}
},
"id": 22406,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "945:85:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "909:121:61"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 22423,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 22409,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22392,
"src": "1048:7:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 22421,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 22413,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 22410,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22394,
"src": "1060:4:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 22411,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1060:11:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 22412,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1075:1:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1060:16:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 22416,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22394,
"src": "1091:4:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 22418,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1098:4:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
},
"typeName": {
"id": 22417,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1098:4:61",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
}
],
"id": 22419,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "1097:6:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
},
{
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
}
],
"expression": {
"argumentTypes": null,
"id": 22414,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "1080:3:61",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 22415,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "decode",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1080:10:61",
"typeDescriptions": {
"typeIdentifier": "t_function_abidecode_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 22420,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1080:24:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1060:44:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"id": 22422,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "1059:46:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1048:57:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f415050524f56455f4641494c4544",
"id": 22424,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1107:20:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_2db9d067bbe32151e43b44f8c67b0617282758d2c28da1e10a0a607f1e6ac14a",
"typeString": "literal_string \"ERR_APPROVE_FAILED\""
},
"value": "ERR_APPROVE_FAILED"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_2db9d067bbe32151e43b44f8c67b0617282758d2c28da1e10a0a607f1e6ac14a",
"typeString": "literal_string \"ERR_APPROVE_FAILED\""
}
],
"id": 22408,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "1040:7:61",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 22425,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1040:88:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 22426,
"nodeType": "ExpressionStatement",
"src": "1040:88:61"
}
]
},
"documentation": {
"id": 22382,
"nodeType": "StructuredDocumentation",
"src": "469:341:61",
"text": " @dev executes the ERC20 token's `approve` function and reverts upon failure\n the main purpose of this function is to prevent a non standard ERC20 token\n from failing silently\n @param _token ERC20 token address\n @param _spender approved address\n @param _value allowance amount"
},
"id": 22428,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "safeApprove",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 22389,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 22384,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22428,
"src": "836:18:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 22383,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "836:11:61",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22386,
"mutability": "mutable",
"name": "_spender",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22428,
"src": "856:16:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 22385,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "856:7:61",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22388,
"mutability": "mutable",
"name": "_value",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22428,
"src": "874:14:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 22387,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "874:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "835:54:61"
},
"returnParameters": {
"id": 22390,
"nodeType": "ParameterList",
"parameters": [],
"src": "899:0:61"
},
"scope": 22526,
"src": "815:320:61",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 22474,
"nodeType": "Block",
"src": "1565:232:61",
"statements": [
{
"assignments": [
22439,
22441
],
"declarations": [
{
"constant": false,
"id": 22439,
"mutability": "mutable",
"name": "success",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22474,
"src": "1575:12:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 22438,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1575:4:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22441,
"mutability": "mutable",
"name": "data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22474,
"src": "1589:17:61",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 22440,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "1589:5:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 22454,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 22449,
"name": "TRANSFER_FUNC_SELECTOR",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22373,
"src": "1654:22:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
{
"argumentTypes": null,
"id": 22450,
"name": "_to",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22433,
"src": "1678:3:61",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 22451,
"name": "_value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22435,
"src": "1683:6:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 22447,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "1631:3:61",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 22448,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodeWithSelector",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1631:22:61",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodewithselector_pure$_t_bytes4_$returns$_t_bytes_memory_ptr_$",
"typeString": "function (bytes4) pure returns (bytes memory)"
}
},
"id": 22452,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1631:59:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 22444,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22431,
"src": "1618:6:61",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 22443,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1610:7:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 22442,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1610:7:61",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 22445,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1610:15:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 22446,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "call",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1610:20:61",
"typeDescriptions": {
"typeIdentifier": "t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "function (bytes memory) payable returns (bool,bytes memory)"
}
},
"id": 22453,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1610:81:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1574:117:61"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 22470,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 22456,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22439,
"src": "1709:7:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 22468,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 22460,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 22457,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22441,
"src": "1721:4:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 22458,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1721:11:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 22459,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1736:1:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1721:16:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 22463,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22441,
"src": "1752:4:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 22465,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1759:4:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
},
"typeName": {
"id": 22464,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1759:4:61",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
}
],
"id": 22466,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "1758:6:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
},
{
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
}
],
"expression": {
"argumentTypes": null,
"id": 22461,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "1741:3:61",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 22462,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "decode",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1741:10:61",
"typeDescriptions": {
"typeIdentifier": "t_function_abidecode_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 22467,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1741:24:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1721:44:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"id": 22469,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "1720:46:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1709:57:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f5452414e534645525f4641494c4544",
"id": 22471,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1768:21:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c9252e500ac7052178e0516284a4bfdb9c18736079c4cc7803b8d1294a8fb98c",
"typeString": "literal_string \"ERR_TRANSFER_FAILED\""
},
"value": "ERR_TRANSFER_FAILED"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_c9252e500ac7052178e0516284a4bfdb9c18736079c4cc7803b8d1294a8fb98c",
"typeString": "literal_string \"ERR_TRANSFER_FAILED\""
}
],
"id": 22455,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "1701:7:61",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 22472,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1701:89:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 22473,
"nodeType": "ExpressionStatement",
"src": "1701:89:61"
}
]
},
"documentation": {
"id": 22429,
"nodeType": "StructuredDocumentation",
"src": "1141:339:61",
"text": " @dev executes the ERC20 token's `transfer` function and reverts upon failure\n the main purpose of this function is to prevent a non standard ERC20 token\n from failing silently\n @param _token ERC20 token address\n @param _to target address\n @param _value transfer amount"
},
"id": 22475,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "safeTransfer",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 22436,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 22431,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22475,
"src": "1507:18:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 22430,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "1507:11:61",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22433,
"mutability": "mutable",
"name": "_to",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22475,
"src": "1527:11:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 22432,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1527:7:61",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22435,
"mutability": "mutable",
"name": "_value",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22475,
"src": "1540:14:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 22434,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1540:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1506:49:61"
},
"returnParameters": {
"id": 22437,
"nodeType": "ParameterList",
"parameters": [],
"src": "1565:0:61"
},
"scope": 22526,
"src": "1485:312:61",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 22524,
"nodeType": "Block",
"src": "2289:249:61",
"statements": [
{
"assignments": [
22488,
22490
],
"declarations": [
{
"constant": false,
"id": 22488,
"mutability": "mutable",
"name": "success",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22524,
"src": "2299:12:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 22487,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2299:4:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22490,
"mutability": "mutable",
"name": "data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22524,
"src": "2313:17:61",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 22489,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "2313:5:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 22504,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 22498,
"name": "TRANSFER_FROM_FUNC_SELECTOR",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22381,
"src": "2378:27:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
{
"argumentTypes": null,
"id": 22499,
"name": "_from",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22480,
"src": "2407:5:61",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 22500,
"name": "_to",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22482,
"src": "2414:3:61",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 22501,
"name": "_value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22484,
"src": "2419:6:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 22496,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "2355:3:61",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 22497,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodeWithSelector",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2355:22:61",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodewithselector_pure$_t_bytes4_$returns$_t_bytes_memory_ptr_$",
"typeString": "function (bytes4) pure returns (bytes memory)"
}
},
"id": 22502,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2355:71:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 22493,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22478,
"src": "2342:6:61",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 22492,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2334:7:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 22491,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2334:7:61",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 22494,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2334:15:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 22495,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "call",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2334:20:61",
"typeDescriptions": {
"typeIdentifier": "t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "function (bytes memory) payable returns (bool,bytes memory)"
}
},
"id": 22503,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2334:93:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2298:129:61"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 22520,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 22506,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22488,
"src": "2445:7:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 22518,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 22510,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 22507,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22490,
"src": "2457:4:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 22508,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2457:11:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 22509,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2472:1:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "2457:16:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 22513,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22490,
"src": "2488:4:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 22515,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2495:4:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
},
"typeName": {
"id": 22514,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2495:4:61",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
}
],
"id": 22516,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "2494:6:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
},
{
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
}
],
"expression": {
"argumentTypes": null,
"id": 22511,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "2477:3:61",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 22512,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "decode",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2477:10:61",
"typeDescriptions": {
"typeIdentifier": "t_function_abidecode_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 22517,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2477:24:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "2457:44:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"id": 22519,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "2456:46:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "2445:57:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f5452414e534645525f46524f4d5f4641494c4544",
"id": 22521,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2504:26:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_29636ff9911adbbcd58b0c1dc0748d2dd21c5759d7ab755d8ffa50cf291fa76c",
"typeString": "literal_string \"ERR_TRANSFER_FROM_FAILED\""
},
"value": "ERR_TRANSFER_FROM_FAILED"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_29636ff9911adbbcd58b0c1dc0748d2dd21c5759d7ab755d8ffa50cf291fa76c",
"typeString": "literal_string \"ERR_TRANSFER_FROM_FAILED\""
}
],
"id": 22505,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "2437:7:61",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 22522,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2437:94:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 22523,
"nodeType": "ExpressionStatement",
"src": "2437:94:61"
}
]
},
"documentation": {
"id": 22476,
"nodeType": "StructuredDocumentation",
"src": "1803:382:61",
"text": " @dev executes the ERC20 token's `transferFrom` function and reverts upon failure\n the main purpose of this function is to prevent a non standard ERC20 token\n from failing silently\n @param _token ERC20 token address\n @param _from source address\n @param _to target address\n @param _value transfer amount"
},
"id": 22525,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "safeTransferFrom",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 22485,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 22478,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22525,
"src": "2216:18:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 22477,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2216:11:61",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22480,
"mutability": "mutable",
"name": "_from",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22525,
"src": "2236:13:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 22479,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2236:7:61",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22482,
"mutability": "mutable",
"name": "_to",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22525,
"src": "2251:11:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 22481,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2251:7:61",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22484,
"mutability": "mutable",
"name": "_value",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22525,
"src": "2264:14:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 22483,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2264:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2215:64:61"
},
"returnParameters": {
"id": 22486,
"nodeType": "ParameterList",
"parameters": [],
"src": "2289:0:61"
},
"scope": 22526,
"src": "2190:348:61",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
}
],
"scope": 22527,
"src": "122:2418:61"
}
],
"src": "51:2490:61"
},
"legacyAST": {
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/TokenHandler.sol",
"exportedSymbols": {
"TokenHandler": [
22526
]
},
"id": 22527,
"license": "SEE LICENSE IN LICENSE",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 22356,
"literals": [
"solidity",
"0.6",
".12"
],
"nodeType": "PragmaDirective",
"src": "51:23:61"
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/token/interfaces/IERC20Token.sol",
"file": "../token/interfaces/IERC20Token.sol",
"id": 22357,
"nodeType": "ImportDirective",
"scope": 22527,
"sourceUnit": 21128,
"src": "75:45:61",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 22526,
"linearizedBaseContracts": [
22526
],
"name": "TokenHandler",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": true,
"id": 22365,
"mutability": "constant",
"name": "APPROVE_FUNC_SELECTOR",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22526,
"src": "150:93:61",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 22358,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "150:6:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"value": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "617070726f766528616464726573732c75696e7432353629",
"id": 22362,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "215:26:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_095ea7b334ae44009aa867bfb386f5c3b4b443ac6f0ee573fa91c4608fbadfba",
"typeString": "literal_string \"approve(address,uint256)\""
},
"value": "approve(address,uint256)"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_095ea7b334ae44009aa867bfb386f5c3b4b443ac6f0ee573fa91c4608fbadfba",
"typeString": "literal_string \"approve(address,uint256)\""
}
],
"id": 22361,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -8,
"src": "205:9:61",
"typeDescriptions": {
"typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 22363,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "205:37:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 22360,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "198:6:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bytes4_$",
"typeString": "type(bytes4)"
},
"typeName": {
"id": 22359,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "198:6:61",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 22364,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "198:45:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"visibility": "private"
},
{
"constant": true,
"id": 22373,
"mutability": "constant",
"name": "TRANSFER_FUNC_SELECTOR",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22526,
"src": "249:95:61",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 22366,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "249:6:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"value": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "7472616e7366657228616464726573732c75696e7432353629",
"id": 22370,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "315:27:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_a9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b",
"typeString": "literal_string \"transfer(address,uint256)\""
},
"value": "transfer(address,uint256)"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_a9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b",
"typeString": "literal_string \"transfer(address,uint256)\""
}
],
"id": 22369,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -8,
"src": "305:9:61",
"typeDescriptions": {
"typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 22371,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "305:38:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 22368,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "298:6:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bytes4_$",
"typeString": "type(bytes4)"
},
"typeName": {
"id": 22367,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "298:6:61",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 22372,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "298:46:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"visibility": "private"
},
{
"constant": true,
"id": 22381,
"mutability": "constant",
"name": "TRANSFER_FROM_FUNC_SELECTOR",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22526,
"src": "350:112:61",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 22374,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "350:6:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"value": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "7472616e7366657246726f6d28616464726573732c616464726573732c75696e7432353629",
"id": 22378,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "421:39:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_23b872dd7302113369cda2901243429419bec145408fa8b352b3dd92b66c680b",
"typeString": "literal_string \"transferFrom(address,address,uint256)\""
},
"value": "transferFrom(address,address,uint256)"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_23b872dd7302113369cda2901243429419bec145408fa8b352b3dd92b66c680b",
"typeString": "literal_string \"transferFrom(address,address,uint256)\""
}
],
"id": 22377,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -8,
"src": "411:9:61",
"typeDescriptions": {
"typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 22379,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "411:50:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 22376,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "404:6:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bytes4_$",
"typeString": "type(bytes4)"
},
"typeName": {
"id": 22375,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "404:6:61",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 22380,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "404:58:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"visibility": "private"
},
{
"body": {
"id": 22427,
"nodeType": "Block",
"src": "899:236:61",
"statements": [
{
"assignments": [
22392,
22394
],
"declarations": [
{
"constant": false,
"id": 22392,
"mutability": "mutable",
"name": "success",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22427,
"src": "910:12:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 22391,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "910:4:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22394,
"mutability": "mutable",
"name": "data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22427,
"src": "924:17:61",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 22393,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "924:5:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 22407,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 22402,
"name": "APPROVE_FUNC_SELECTOR",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22365,
"src": "989:21:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
{
"argumentTypes": null,
"id": 22403,
"name": "_spender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22386,
"src": "1012:8:61",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 22404,
"name": "_value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22388,
"src": "1022:6:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 22400,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "966:3:61",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 22401,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodeWithSelector",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "966:22:61",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodewithselector_pure$_t_bytes4_$returns$_t_bytes_memory_ptr_$",
"typeString": "function (bytes4) pure returns (bytes memory)"
}
},
"id": 22405,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "966:63:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 22397,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22384,
"src": "953:6:61",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 22396,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "945:7:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 22395,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "945:7:61",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 22398,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "945:15:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 22399,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "call",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "945:20:61",
"typeDescriptions": {
"typeIdentifier": "t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "function (bytes memory) payable returns (bool,bytes memory)"
}
},
"id": 22406,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "945:85:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "909:121:61"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 22423,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 22409,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22392,
"src": "1048:7:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 22421,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 22413,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 22410,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22394,
"src": "1060:4:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 22411,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1060:11:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 22412,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1075:1:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1060:16:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 22416,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22394,
"src": "1091:4:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 22418,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1098:4:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
},
"typeName": {
"id": 22417,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1098:4:61",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
}
],
"id": 22419,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "1097:6:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
},
{
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
}
],
"expression": {
"argumentTypes": null,
"id": 22414,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "1080:3:61",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 22415,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "decode",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1080:10:61",
"typeDescriptions": {
"typeIdentifier": "t_function_abidecode_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 22420,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1080:24:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1060:44:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"id": 22422,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "1059:46:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1048:57:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f415050524f56455f4641494c4544",
"id": 22424,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1107:20:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_2db9d067bbe32151e43b44f8c67b0617282758d2c28da1e10a0a607f1e6ac14a",
"typeString": "literal_string \"ERR_APPROVE_FAILED\""
},
"value": "ERR_APPROVE_FAILED"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_2db9d067bbe32151e43b44f8c67b0617282758d2c28da1e10a0a607f1e6ac14a",
"typeString": "literal_string \"ERR_APPROVE_FAILED\""
}
],
"id": 22408,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "1040:7:61",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 22425,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1040:88:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 22426,
"nodeType": "ExpressionStatement",
"src": "1040:88:61"
}
]
},
"documentation": {
"id": 22382,
"nodeType": "StructuredDocumentation",
"src": "469:341:61",
"text": " @dev executes the ERC20 token's `approve` function and reverts upon failure\n the main purpose of this function is to prevent a non standard ERC20 token\n from failing silently\n @param _token ERC20 token address\n @param _spender approved address\n @param _value allowance amount"
},
"id": 22428,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "safeApprove",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 22389,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 22384,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22428,
"src": "836:18:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 22383,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "836:11:61",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22386,
"mutability": "mutable",
"name": "_spender",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22428,
"src": "856:16:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 22385,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "856:7:61",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22388,
"mutability": "mutable",
"name": "_value",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22428,
"src": "874:14:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 22387,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "874:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "835:54:61"
},
"returnParameters": {
"id": 22390,
"nodeType": "ParameterList",
"parameters": [],
"src": "899:0:61"
},
"scope": 22526,
"src": "815:320:61",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 22474,
"nodeType": "Block",
"src": "1565:232:61",
"statements": [
{
"assignments": [
22439,
22441
],
"declarations": [
{
"constant": false,
"id": 22439,
"mutability": "mutable",
"name": "success",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22474,
"src": "1575:12:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 22438,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1575:4:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22441,
"mutability": "mutable",
"name": "data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22474,
"src": "1589:17:61",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 22440,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "1589:5:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 22454,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 22449,
"name": "TRANSFER_FUNC_SELECTOR",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22373,
"src": "1654:22:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
{
"argumentTypes": null,
"id": 22450,
"name": "_to",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22433,
"src": "1678:3:61",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 22451,
"name": "_value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22435,
"src": "1683:6:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 22447,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "1631:3:61",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 22448,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodeWithSelector",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1631:22:61",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodewithselector_pure$_t_bytes4_$returns$_t_bytes_memory_ptr_$",
"typeString": "function (bytes4) pure returns (bytes memory)"
}
},
"id": 22452,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1631:59:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 22444,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22431,
"src": "1618:6:61",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 22443,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1610:7:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 22442,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1610:7:61",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 22445,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1610:15:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 22446,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "call",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1610:20:61",
"typeDescriptions": {
"typeIdentifier": "t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "function (bytes memory) payable returns (bool,bytes memory)"
}
},
"id": 22453,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1610:81:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1574:117:61"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 22470,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 22456,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22439,
"src": "1709:7:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 22468,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 22460,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 22457,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22441,
"src": "1721:4:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 22458,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1721:11:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 22459,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1736:1:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1721:16:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 22463,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22441,
"src": "1752:4:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 22465,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1759:4:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
},
"typeName": {
"id": 22464,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1759:4:61",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
}
],
"id": 22466,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "1758:6:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
},
{
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
}
],
"expression": {
"argumentTypes": null,
"id": 22461,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "1741:3:61",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 22462,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "decode",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1741:10:61",
"typeDescriptions": {
"typeIdentifier": "t_function_abidecode_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 22467,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1741:24:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1721:44:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"id": 22469,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "1720:46:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1709:57:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f5452414e534645525f4641494c4544",
"id": 22471,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1768:21:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c9252e500ac7052178e0516284a4bfdb9c18736079c4cc7803b8d1294a8fb98c",
"typeString": "literal_string \"ERR_TRANSFER_FAILED\""
},
"value": "ERR_TRANSFER_FAILED"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_c9252e500ac7052178e0516284a4bfdb9c18736079c4cc7803b8d1294a8fb98c",
"typeString": "literal_string \"ERR_TRANSFER_FAILED\""
}
],
"id": 22455,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "1701:7:61",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 22472,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1701:89:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 22473,
"nodeType": "ExpressionStatement",
"src": "1701:89:61"
}
]
},
"documentation": {
"id": 22429,
"nodeType": "StructuredDocumentation",
"src": "1141:339:61",
"text": " @dev executes the ERC20 token's `transfer` function and reverts upon failure\n the main purpose of this function is to prevent a non standard ERC20 token\n from failing silently\n @param _token ERC20 token address\n @param _to target address\n @param _value transfer amount"
},
"id": 22475,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "safeTransfer",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 22436,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 22431,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22475,
"src": "1507:18:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 22430,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "1507:11:61",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22433,
"mutability": "mutable",
"name": "_to",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22475,
"src": "1527:11:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 22432,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1527:7:61",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22435,
"mutability": "mutable",
"name": "_value",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22475,
"src": "1540:14:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 22434,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1540:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1506:49:61"
},
"returnParameters": {
"id": 22437,
"nodeType": "ParameterList",
"parameters": [],
"src": "1565:0:61"
},
"scope": 22526,
"src": "1485:312:61",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 22524,
"nodeType": "Block",
"src": "2289:249:61",
"statements": [
{
"assignments": [
22488,
22490
],
"declarations": [
{
"constant": false,
"id": 22488,
"mutability": "mutable",
"name": "success",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22524,
"src": "2299:12:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 22487,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2299:4:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22490,
"mutability": "mutable",
"name": "data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22524,
"src": "2313:17:61",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 22489,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "2313:5:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 22504,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 22498,
"name": "TRANSFER_FROM_FUNC_SELECTOR",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22381,
"src": "2378:27:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
{
"argumentTypes": null,
"id": 22499,
"name": "_from",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22480,
"src": "2407:5:61",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 22500,
"name": "_to",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22482,
"src": "2414:3:61",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 22501,
"name": "_value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22484,
"src": "2419:6:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 22496,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "2355:3:61",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 22497,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodeWithSelector",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2355:22:61",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodewithselector_pure$_t_bytes4_$returns$_t_bytes_memory_ptr_$",
"typeString": "function (bytes4) pure returns (bytes memory)"
}
},
"id": 22502,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2355:71:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 22493,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22478,
"src": "2342:6:61",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 22492,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2334:7:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 22491,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2334:7:61",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 22494,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2334:15:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 22495,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "call",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2334:20:61",
"typeDescriptions": {
"typeIdentifier": "t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "function (bytes memory) payable returns (bool,bytes memory)"
}
},
"id": 22503,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2334:93:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2298:129:61"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 22520,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 22506,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22488,
"src": "2445:7:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 22518,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 22510,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 22507,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22490,
"src": "2457:4:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 22508,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2457:11:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 22509,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2472:1:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "2457:16:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 22513,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22490,
"src": "2488:4:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 22515,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2495:4:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
},
"typeName": {
"id": 22514,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2495:4:61",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
}
],
"id": 22516,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "2494:6:61",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
},
{
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
}
],
"expression": {
"argumentTypes": null,
"id": 22511,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "2477:3:61",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 22512,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "decode",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2477:10:61",
"typeDescriptions": {
"typeIdentifier": "t_function_abidecode_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 22517,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2477:24:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "2457:44:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"id": 22519,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "2456:46:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "2445:57:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f5452414e534645525f46524f4d5f4641494c4544",
"id": 22521,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2504:26:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_29636ff9911adbbcd58b0c1dc0748d2dd21c5759d7ab755d8ffa50cf291fa76c",
"typeString": "literal_string \"ERR_TRANSFER_FROM_FAILED\""
},
"value": "ERR_TRANSFER_FROM_FAILED"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_29636ff9911adbbcd58b0c1dc0748d2dd21c5759d7ab755d8ffa50cf291fa76c",
"typeString": "literal_string \"ERR_TRANSFER_FROM_FAILED\""
}
],
"id": 22505,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "2437:7:61",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 22522,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2437:94:61",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 22523,
"nodeType": "ExpressionStatement",
"src": "2437:94:61"
}
]
},
"documentation": {
"id": 22476,
"nodeType": "StructuredDocumentation",
"src": "1803:382:61",
"text": " @dev executes the ERC20 token's `transferFrom` function and reverts upon failure\n the main purpose of this function is to prevent a non standard ERC20 token\n from failing silently\n @param _token ERC20 token address\n @param _from source address\n @param _to target address\n @param _value transfer amount"
},
"id": 22525,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "safeTransferFrom",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 22485,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 22478,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22525,
"src": "2216:18:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 22477,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2216:11:61",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22480,
"mutability": "mutable",
"name": "_from",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22525,
"src": "2236:13:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 22479,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2236:7:61",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22482,
"mutability": "mutable",
"name": "_to",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22525,
"src": "2251:11:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 22481,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2251:7:61",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22484,
"mutability": "mutable",
"name": "_value",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 22525,
"src": "2264:14:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 22483,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2264:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2215:64:61"
},
"returnParameters": {
"id": 22486,
"nodeType": "ParameterList",
"parameters": [],
"src": "2289:0:61"
},
"scope": 22526,
"src": "2190:348:61",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
}
],
"scope": 22527,
"src": "122:2418:61"
}
],
"src": "51:2490:61"
},
"compiler": {
"name": "solc",
"version": "0.6.12+commit.27d51765.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.2.3",
"updatedAt": "2020-10-20T08:24:47.845Z",
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
}