@aragon/apps-payroll
Version:
_**Code in Github:**_ [aragon-apps/apps/payroll](https://github.com/aragon/aragon-apps/tree/master/future-apps/payroll)
1,187 lines (1,186 loc) • 129 kB
JSON
{
"contractName": "VaultRecoverable",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "vault",
"type": "address"
},
{
"indexed": true,
"name": "token",
"type": "address"
},
{
"indexed": false,
"name": "amount",
"type": "uint256"
}
],
"name": "RecoverToVault",
"type": "event"
},
{
"constant": false,
"inputs": [
{
"name": "_token",
"type": "address"
}
],
"name": "transferToVault",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "token",
"type": "address"
}
],
"name": "allowRecoverability",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getRecoveryVault",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x",
"deployedBytecode": "0x",
"sourceMap": "",
"deployedSourceMap": "",
"source": "/*\n * SPDX-License-Identitifer: MIT\n */\n\npragma solidity ^0.4.24;\n\nimport \"../lib/token/ERC20.sol\";\nimport \"./EtherTokenConstant.sol\";\nimport \"./IsContract.sol\";\nimport \"./IVaultRecoverable.sol\";\nimport \"./SafeERC20.sol\";\n\n\ncontract VaultRecoverable is IVaultRecoverable, EtherTokenConstant, IsContract {\n using SafeERC20 for ERC20;\n\n string private constant ERROR_DISALLOWED = \"RECOVER_DISALLOWED\";\n string private constant ERROR_VAULT_NOT_CONTRACT = \"RECOVER_VAULT_NOT_CONTRACT\";\n string private constant ERROR_TOKEN_TRANSFER_FAILED = \"RECOVER_TOKEN_TRANSFER_FAILED\";\n\n /**\n * @notice Send funds to recovery Vault. This contract should never receive funds,\n * but in case it does, this function allows one to recover them.\n * @param _token Token balance to be sent to recovery vault.\n */\n function transferToVault(address _token) external {\n require(allowRecoverability(_token), ERROR_DISALLOWED);\n address vault = getRecoveryVault();\n require(isContract(vault), ERROR_VAULT_NOT_CONTRACT);\n\n uint256 balance;\n if (_token == ETH) {\n balance = address(this).balance;\n vault.transfer(balance);\n } else {\n ERC20 token = ERC20(_token);\n balance = token.staticBalanceOf(this);\n require(token.safeTransfer(vault, balance), ERROR_TOKEN_TRANSFER_FAILED);\n }\n\n emit RecoverToVault(vault, _token, balance);\n }\n\n /**\n * @dev By default deriving from AragonApp makes it recoverable\n * @param token Token address that would be recovered\n * @return bool whether the app allows the recovery\n */\n function allowRecoverability(address token) public view returns (bool) {\n return true;\n }\n\n // Cast non-implemented interface to be public so we can use it internally\n function getRecoveryVault() public view returns (address);\n}\n",
"sourcePath": "@aragon/os/contracts/common/VaultRecoverable.sol",
"ast": {
"absolutePath": "@aragon/os/contracts/common/VaultRecoverable.sol",
"exportedSymbols": {
"VaultRecoverable": [
11422
]
},
"id": 11423,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 11308,
"literals": [
"solidity",
"^",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "44:24:40"
},
{
"absolutePath": "@aragon/os/contracts/lib/token/ERC20.sol",
"file": "../lib/token/ERC20.sol",
"id": 11309,
"nodeType": "ImportDirective",
"scope": 11423,
"sourceUnit": 14295,
"src": "70:32:40",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "@aragon/os/contracts/common/EtherTokenConstant.sol",
"file": "./EtherTokenConstant.sol",
"id": 11310,
"nodeType": "ImportDirective",
"scope": 11423,
"sourceUnit": 10663,
"src": "103:34:40",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "@aragon/os/contracts/common/IsContract.sol",
"file": "./IsContract.sol",
"id": 11311,
"nodeType": "ImportDirective",
"scope": 11423,
"sourceUnit": 10839,
"src": "138:26:40",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "@aragon/os/contracts/common/IVaultRecoverable.sol",
"file": "./IVaultRecoverable.sol",
"id": 11312,
"nodeType": "ImportDirective",
"scope": 11423,
"sourceUnit": 10713,
"src": "165:33:40",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "@aragon/os/contracts/common/SafeERC20.sol",
"file": "./SafeERC20.sol",
"id": 11313,
"nodeType": "ImportDirective",
"scope": 11423,
"sourceUnit": 11154,
"src": "199:25:40",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 11314,
"name": "IVaultRecoverable",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 10712,
"src": "256:17:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IVaultRecoverable_$10712",
"typeString": "contract IVaultRecoverable"
}
},
"id": 11315,
"nodeType": "InheritanceSpecifier",
"src": "256:17:40"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 11316,
"name": "EtherTokenConstant",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 10662,
"src": "275:18:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_EtherTokenConstant_$10662",
"typeString": "contract EtherTokenConstant"
}
},
"id": 11317,
"nodeType": "InheritanceSpecifier",
"src": "275:18:40"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 11318,
"name": "IsContract",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 10838,
"src": "295:10:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IsContract_$10838",
"typeString": "contract IsContract"
}
},
"id": 11319,
"nodeType": "InheritanceSpecifier",
"src": "295:10:40"
}
],
"contractDependencies": [
10662,
10712,
10838
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": false,
"id": 11422,
"linearizedBaseContracts": [
11422,
10838,
10662,
10712
],
"name": "VaultRecoverable",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 11322,
"libraryName": {
"contractScope": null,
"id": 11320,
"name": "SafeERC20",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11153,
"src": "318:9:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeERC20_$11153",
"typeString": "library SafeERC20"
}
},
"nodeType": "UsingForDirective",
"src": "312:26:40",
"typeName": {
"contractScope": null,
"id": 11321,
"name": "ERC20",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 14294,
"src": "332:5:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20_$14294",
"typeString": "contract ERC20"
}
}
},
{
"constant": true,
"id": 11325,
"name": "ERROR_DISALLOWED",
"nodeType": "VariableDeclaration",
"scope": 11422,
"src": "344:63:40",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory",
"typeString": "string"
},
"typeName": {
"id": 11323,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "344:6:40",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": {
"argumentTypes": null,
"hexValue": "5245434f5645525f444953414c4c4f574544",
"id": 11324,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "387:20:40",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_47aa147597a7b552a4e71045691780a16af5fd5e8d5d273726c17abe45b2d846",
"typeString": "literal_string \"RECOVER_DISALLOWED\""
},
"value": "RECOVER_DISALLOWED"
},
"visibility": "private"
},
{
"constant": true,
"id": 11328,
"name": "ERROR_VAULT_NOT_CONTRACT",
"nodeType": "VariableDeclaration",
"scope": 11422,
"src": "413:79:40",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory",
"typeString": "string"
},
"typeName": {
"id": 11326,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "413:6:40",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": {
"argumentTypes": null,
"hexValue": "5245434f5645525f5641554c545f4e4f545f434f4e5452414354",
"id": 11327,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "464:28:40",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_75ee4922bd8110ebf690d2268404281e15c05946c72e21f392a98d678433c1b8",
"typeString": "literal_string \"RECOVER_VAULT_NOT_CONTRACT\""
},
"value": "RECOVER_VAULT_NOT_CONTRACT"
},
"visibility": "private"
},
{
"constant": true,
"id": 11331,
"name": "ERROR_TOKEN_TRANSFER_FAILED",
"nodeType": "VariableDeclaration",
"scope": 11422,
"src": "498:85:40",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory",
"typeString": "string"
},
"typeName": {
"id": 11329,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "498:6:40",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": {
"argumentTypes": null,
"hexValue": "5245434f5645525f544f4b454e5f5452414e534645525f4641494c4544",
"id": 11330,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "552:31:40",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_50ced607ee32fa6b84ba381cb0e7349b0ffb77cff346ccdcab72221c40403f1a",
"typeString": "literal_string \"RECOVER_TOKEN_TRANSFER_FAILED\""
},
"value": "RECOVER_TOKEN_TRANSFER_FAILED"
},
"visibility": "private"
},
{
"body": {
"id": 11405,
"nodeType": "Block",
"src": "886:573:40",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 11338,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11333,
"src": "924:6:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 11337,
"name": "allowRecoverability",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11416,
"src": "904:19:40",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$",
"typeString": "function (address) view returns (bool)"
}
},
"id": 11339,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "904:27:40",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"id": 11340,
"name": "ERROR_DISALLOWED",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11325,
"src": "933:16:40",
"typeDescriptions": {
"typeIdentifier": "t_string_memory",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_string_memory",
"typeString": "string memory"
}
],
"id": 11336,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
15156,
15157
],
"referencedDeclaration": 15157,
"src": "896:7:40",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 11341,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "896:54:40",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 11342,
"nodeType": "ExpressionStatement",
"src": "896:54:40"
},
{
"assignments": [
11344
],
"declarations": [
{
"constant": false,
"id": 11344,
"name": "vault",
"nodeType": "VariableDeclaration",
"scope": 11406,
"src": "960:13:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 11343,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "960:7:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 11347,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 11345,
"name": "getRecoveryVault",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11421,
"src": "976:16:40",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_address_$",
"typeString": "function () view returns (address)"
}
},
"id": 11346,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "976:18:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "960:34:40"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 11350,
"name": "vault",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11344,
"src": "1023:5:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 11349,
"name": "isContract",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10837,
"src": "1012:10:40",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$",
"typeString": "function (address) view returns (bool)"
}
},
"id": 11351,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1012:17:40",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"id": 11352,
"name": "ERROR_VAULT_NOT_CONTRACT",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11328,
"src": "1031:24:40",
"typeDescriptions": {
"typeIdentifier": "t_string_memory",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_string_memory",
"typeString": "string memory"
}
],
"id": 11348,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
15156,
15157
],
"referencedDeclaration": 15157,
"src": "1004:7:40",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 11353,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1004:52:40",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 11354,
"nodeType": "ExpressionStatement",
"src": "1004:52:40"
},
{
"assignments": [],
"declarations": [
{
"constant": false,
"id": 11356,
"name": "balance",
"nodeType": "VariableDeclaration",
"scope": 11406,
"src": "1067:15:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 11355,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1067:7:40",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 11357,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "1067:15:40"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 11360,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 11358,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11333,
"src": "1096:6:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 11359,
"name": "ETH",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10661,
"src": "1106:3:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1096:13:40",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 11397,
"nodeType": "Block",
"src": "1210:189:40",
"statements": [
{
"assignments": [
11376
],
"declarations": [
{
"constant": false,
"id": 11376,
"name": "token",
"nodeType": "VariableDeclaration",
"scope": 11406,
"src": "1224:11:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20_$14294",
"typeString": "contract ERC20"
},
"typeName": {
"contractScope": null,
"id": 11375,
"name": "ERC20",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 14294,
"src": "1224:5:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20_$14294",
"typeString": "contract ERC20"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 11380,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 11378,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11333,
"src": "1244:6:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 11377,
"name": "ERC20",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14294,
"src": "1238:5:40",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ERC20_$14294_$",
"typeString": "type(contract ERC20)"
}
},
"id": 11379,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1238:13:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20_$14294",
"typeString": "contract ERC20"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1224:27:40"
},
{
"expression": {
"argumentTypes": null,
"id": 11386,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 11381,
"name": "balance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11356,
"src": "1265:7:40",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 11384,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15204,
"src": "1297:4:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_VaultRecoverable_$11422",
"typeString": "contract VaultRecoverable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_VaultRecoverable_$11422",
"typeString": "contract VaultRecoverable"
}
],
"expression": {
"argumentTypes": null,
"id": 11382,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11376,
"src": "1275:5:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20_$14294",
"typeString": "contract ERC20"
}
},
"id": 11383,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "staticBalanceOf",
"nodeType": "MemberAccess",
"referencedDeclaration": 11080,
"src": "1275:21:40",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_ERC20_$14294_$_t_address_$returns$_t_uint256_$bound_to$_t_contract$_ERC20_$14294_$",
"typeString": "function (contract ERC20,address) view returns (uint256)"
}
},
"id": 11385,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1275:27:40",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1265:37:40",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 11387,
"nodeType": "ExpressionStatement",
"src": "1265:37:40"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 11391,
"name": "vault",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11344,
"src": "1343:5:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 11392,
"name": "balance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11356,
"src": "1350:7:40",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 11389,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11376,
"src": "1324:5:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20_$14294",
"typeString": "contract ERC20"
}
},
"id": 11390,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "safeTransfer",
"nodeType": "MemberAccess",
"referencedDeclaration": 10985,
"src": "1324:18:40",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_ERC20_$14294_$_t_address_$_t_uint256_$returns$_t_bool_$bound_to$_t_contract$_ERC20_$14294_$",
"typeString": "function (contract ERC20,address,uint256) returns (bool)"
}
},
"id": 11393,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1324:34:40",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"id": 11394,
"name": "ERROR_TOKEN_TRANSFER_FAILED",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11331,
"src": "1360:27:40",
"typeDescriptions": {
"typeIdentifier": "t_string_memory",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_string_memory",
"typeString": "string memory"
}
],
"id": 11388,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
15156,
15157
],
"referencedDeclaration": 15157,
"src": "1316:7:40",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 11395,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1316:72:40",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 11396,
"nodeType": "ExpressionStatement",
"src": "1316:72:40"
}
]
},
"id": 11398,
"nodeType": "IfStatement",
"src": "1092:307:40",
"trueBody": {
"id": 11374,
"nodeType": "Block",
"src": "1111:93:40",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 11366,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 11361,
"name": "balance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11356,
"src": "1125:7:40",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 11363,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15204,
"src": "1143:4:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_VaultRecoverable_$11422",
"typeString": "contract VaultRecoverable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_VaultRecoverable_$11422",
"typeString": "contract VaultRecoverable"
}
],
"id": 11362,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1135:7:40",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 11364,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1135:13:40",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 11365,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",