sdk-monorepo/@tornado/sdk-data/resources/abis/ERC20Tornado.json

6991 lines
336 KiB
JSON
Raw Normal View History

{
"contractName": "ERC20Tornado",
"abi": [
{
"inputs": [
{
"internalType": "contract IVerifier",
"name": "_verifier",
"type": "address"
},
{
"internalType": "uint256",
"name": "_denomination",
"type": "uint256"
},
{
"internalType": "uint32",
"name": "_merkleTreeHeight",
"type": "uint32"
},
{
"internalType": "address",
"name": "_operator",
"type": "address"
},
{
"internalType": "address",
"name": "_token",
"type": "address"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "commitment",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "uint32",
"name": "leafIndex",
"type": "uint32"
},
{
"indexed": false,
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
}
],
"name": "Deposit",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "bytes32",
"name": "nullifierHash",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "address",
"name": "relayer",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "fee",
"type": "uint256"
}
],
"name": "Withdrawal",
"type": "event"
},
{
"constant": true,
"inputs": [],
"name": "FIELD_SIZE",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "ROOT_HISTORY_SIZE",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "ZERO_VALUE",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "_newOperator",
"type": "address"
}
],
"name": "changeOperator",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"name": "commitments",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "currentRootIndex",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "denomination",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "bytes32",
"name": "_commitment",
"type": "bytes32"
}
],
"name": "deposit",
"outputs": [],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "filledSubtrees",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getLastRoot",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "bytes32",
"name": "_left",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "_right",
"type": "bytes32"
}
],
"name": "hashLeftRight",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "pure",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "bytes32",
"name": "_root",
"type": "bytes32"
}
],
"name": "isKnownRoot",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "bytes32",
"name": "_nullifierHash",
"type": "bytes32"
}
],
"name": "isSpent",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "bytes32[]",
"name": "_nullifierHashes",
"type": "bytes32[]"
}
],
"name": "isSpentArray",
"outputs": [
{
"internalType": "bool[]",
"name": "spent",
"type": "bool[]"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "levels",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "nextIndex",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"name": "nullifierHashes",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "operator",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "roots",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "token",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "_newVerifier",
"type": "address"
}
],
"name": "updateVerifier",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "verifier",
"outputs": [
{
"internalType": "contract IVerifier",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "bytes",
"name": "_proof",
"type": "bytes"
},
{
"internalType": "bytes32",
"name": "_root",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "_nullifierHash",
"type": "bytes32"
},
{
"internalType": "address payable",
"name": "_recipient",
"type": "address"
},
{
"internalType": "address payable",
"name": "_relayer",
"type": "address"
},
{
"internalType": "uint256",
"name": "_fee",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_refund",
"type": "uint256"
}
],
"name": "withdraw",
"outputs": [],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "zeros",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.5.17+commit.d19bba13\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IVerifier\",\"name\":\"_verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_denomination\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"_merkleTreeHeight\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"_operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"commitment\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"leafIndex\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"nullifierHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"FIELD_SIZE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"ROOT_HISTORY_SIZE\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"ZERO_VALUE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newOperator\",\"type\":\"address\"}],\"name\":\"changeOperator\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"commitments\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"currentRootIndex\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"denomination\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_commitment\",\"type\":\"bytes32\"}],\"name\":\"deposit\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"filledSubtrees\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getLastRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_left\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_right\",\"type\":\"bytes32\"}],\"name\":\"hashLeftRight\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_root\",\"type\":\"bytes32\"}],\"
"bytecode": "0x6080604052600380546001600160401b03191690553480156200002157600080fd5b5060405162001cef38038062001cef833981810160405260a08110156200004757600080fd5b50805160208201516040830151606084015160809094015192939192909190848484848163ffffffff8116620000af5760405162461bcd60e51b815260040180806020018281038252602781526020018062001c666027913960400191505060405180910390fd5b60208163ffffffff1610620000f65760405162461bcd60e51b815260040180806020018281038252602281526020018062001cad6022913960400191505060405180910390fd5b6000805463ffffffff191663ffffffff83161781556002805460018181019092557f2fe54c60d3acabf3343a35b6eba15db4821b340f76e741e2249685ed4899af6c60008051602062001c25833981519152909101819055815480830183559282905260008051602062001ccf8339815191529092018290555b60005463ffffffff9081169082161015620001e4576200019a82806001600160e01b036200029416565b60028054600181810190925560008051602062001c258339815191520182905580548082018255600082905260008051602062001ccf833981519152018290559092500162000170565b50620001fa81806001600160e01b036200029416565b6004555050600160685582620002425760405162461bcd60e51b815260040180806020018281038252602581526020018062001c006025913960400191505060405180910390fd5b606c80546001600160a01b039586166001600160a01b031991821617909155606d80549286169282169290921790915560699290925550606e8054939092169216919091179055506200048192505050565b600060008051602062001c8d8339815191528310620002fa576040805162461bcd60e51b815260206004820181905260248201527f5f6c6566742073686f756c6420626520696e7369646520746865206669656c64604482015290519081900360640190fd5b60008051602062001c8d8339815191528210620003495760405162461bcd60e51b815260040180806020018281038252602181526020018062001c456021913960400191505060405180910390fd5b6040805163f47d33b560e01b81526004810185905260006024820181905282518693919273__Hasher________________________________9263f47d33b592604480840193829003018186803b158015620003a457600080fd5b505af4158015620003b9573d6000803e3d6000fd5b505050506040513d6040811015620003d057600080fd5b508051602090910151909250905060008051602062001c8d833981519152848308915073__Hasher________________________________63f47d33b583836040518363ffffffff1660e01b81526004018083815260200182815260200192505050604080518083038186803b1580156200044a57600080fd5b505af41580156200045f573d6000803e3d6000fd5b505050506040513d60408110156200047657600080fd5b505195945050505050565b61176f80620004916000396000f3fe60806040526004361061014b5760003560e01c806397fc007c116100b6578063e5285dcc1161006f578063e5285dcc14610514578063e82955881461053e578063ec73295914610568578063f178e47c1461057d578063fc0c546a146105a7578063fc7e9c6f146105bc5761014b565b806397fc007c146103a55780639fa12d0b146103d8578063b214faa5146104a3578063ba70f757146104c0578063c2b40ae4146104d5578063cd87a3b4146104ff5761014b565b80634ecf518b116101085780634ecf518b146102e4578063570ca735146103125780636d9833e314610327578063839df945146103515780638bca6d161461037b57806390eeb02b146103905761014b565b806306394c9b1461015057806317cc915c1461018557806321a0adb6146101c35780632b7ac3f31461025c57806338bf282e1461028d578063414a37ba146102cf575b600080fd5b34801561015c57600080fd5b506101836004803603602081101561017357600080fd5b50356001600160a01b03166105d1565b005b34801561019157600080fd5b506101af600480360360208110156101a857600080fd5b503561063c565b604080519115158252519081900360200190f35b610183600480360360e08110156101d957600080fd5b810190602081018135600160201b8111156101f357600080fd5b82018360208201111561020557600080fd5b803590602001918460018302840111600160201b8311171561022657600080fd5b91935091508035906020810135906001600160a01b03604082013581169160608101359091169060808101359060a00135610651565b34801561026857600080fd5b50610271610992565b604080516001600160a01b039092168252519081900360200190f35b34801561029957600080fd5b506102bd600480360360408110156102b057600080fd5b50803590602001356109a1565b60408051918252519081900360200190f35b3480156102db57600080fd5b506102bd610b82565b3480156102f057600080fd5b506102f9610b94565b6040805163ffffffff9092168252519081900360200190f35b34801561031e57600080fd5b50610271610ba0565b34801561033357600080fd5b506101af6004803603602081101561034a57600080fd5b5035610baf565b34801561035d57600080fd5b506101af60048036
"deployedBytecode": "0x60806040526004361061014b5760003560e01c806397fc007c116100b6578063e5285dcc1161006f578063e5285dcc14610514578063e82955881461053e578063ec73295914610568578063f178e47c1461057d578063fc0c546a146105a7578063fc7e9c6f146105bc5761014b565b806397fc007c146103a55780639fa12d0b146103d8578063b214faa5146104a3578063ba70f757146104c0578063c2b40ae4146104d5578063cd87a3b4146104ff5761014b565b80634ecf518b116101085780634ecf518b146102e4578063570ca735146103125780636d9833e314610327578063839df945146103515780638bca6d161461037b57806390eeb02b146103905761014b565b806306394c9b1461015057806317cc915c1461018557806321a0adb6146101c35780632b7ac3f31461025c57806338bf282e1461028d578063414a37ba146102cf575b600080fd5b34801561015c57600080fd5b506101836004803603602081101561017357600080fd5b50356001600160a01b03166105d1565b005b34801561019157600080fd5b506101af600480360360208110156101a857600080fd5b503561063c565b604080519115158252519081900360200190f35b610183600480360360e08110156101d957600080fd5b810190602081018135600160201b8111156101f357600080fd5b82018360208201111561020557600080fd5b803590602001918460018302840111600160201b8311171561022657600080fd5b91935091508035906020810135906001600160a01b03604082013581169160608101359091169060808101359060a00135610651565b34801561026857600080fd5b50610271610992565b604080516001600160a01b039092168252519081900360200190f35b34801561029957600080fd5b506102bd600480360360408110156102b057600080fd5b50803590602001356109a1565b60408051918252519081900360200190f35b3480156102db57600080fd5b506102bd610b82565b3480156102f057600080fd5b506102f9610b94565b6040805163ffffffff9092168252519081900360200190f35b34801561031e57600080fd5b50610271610ba0565b34801561033357600080fd5b506101af6004803603602081101561034a57600080fd5b5035610baf565b34801561035d57600080fd5b506101af6004803603602081101561037457600080fd5b5035610c22565b34801561038757600080fd5b506102bd610c37565b34801561039c57600080fd5b506102f9610c3d565b3480156103b157600080fd5b50610183600480360360208110156103c857600080fd5b50356001600160a01b0316610c49565b3480156103e457600080fd5b50610453600480360360208110156103fb57600080fd5b810190602081018135600160201b81111561041557600080fd5b82018360208201111561042757600080fd5b803590602001918460208302840111600160201b8311171561044857600080fd5b509092509050610cb4565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561048f578181015183820152602001610477565b505050509050019250505060405180910390f35b610183600480360360208110156104b957600080fd5b5035610d3c565b3480156104cc57600080fd5b506102bd610e5d565b3480156104e157600080fd5b506102bd600480360360208110156104f857600080fd5b5035610e7d565b34801561050b57600080fd5b506102f9610e91565b34801561052057600080fd5b506101af6004803603602081101561053757600080fd5b5035610e96565b34801561054a57600080fd5b506102bd6004803603602081101561056157600080fd5b5035610eab565b34801561057457600080fd5b506102bd610ec9565b34801561058957600080fd5b506102bd600480360360208110156105a057600080fd5b5035610eed565b3480156105b357600080fd5b50610271610efa565b3480156105c857600080fd5b506102f9610f09565b606d546001600160a01b0316331461061a5760405162461bcd60e51b81526004018080602001828103825260258152602001806117166025913960400191505060405180910390fd5b606d80546001600160a01b0319166001600160a01b0392909216919091179055565b606a6020526000908152604090205460ff1681565b60688054600101908190556069548311156106b3576040805162461bcd60e51b815260206004820152601a60248201527f4665652065786365656473207472616e736665722076616c7565000000000000604482015290519081900360640190fd5b6000868152606a602052604090205460ff1615610717576040805162461bcd60e51b815260206004820152601f60248201527f546865206e6f746520686173206265656e20616c7265616479207370656e7400604482015290519081900360640190fd5b61072087610baf565b610771576040805162461bcd60e51b815260206004820152601c60248201527f43616e6e6f742066696e6420796f7572206d65726b6c6520726f6f7400000000604482015290519081900360640190fd5b606c546040805160c080820183528a8252602082018a90526001600160a01b038981168385015288811660608401526080830188905260a08301879052925163695ef6f960e01b8152929093169263695ef6f9928d928d9290916004810191829160240190849080838360005b838110156107f657818101518382015260200161
"sourceMap": "805:2189:0:-;;;1430:34:2;;;-1:-1:-1;;;;;;1468:27:2;;;867:237:0;5:2:-1;;;;30:1;27;20:12;5:2;867:237:0;;;;;;;;;;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;867:237:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1646:15:2;;;1638:67;;;;-1:-1:-1;;;1638:67:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1733:2;1719:11;:16;;;1711:63;;;;-1:-1:-1;;;1711:63:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1780:6;:20;;-1:-1:-1;;1780:20:2;;;;;;;1854:5;27:10:-1;;-1:-1;23:18;;;45:23;;;1088:77:2;-1:-1:-1;;;;;;;;;;;1854:23:2;;;;;;27:10:-1;;23:18;;;45:23;;1883:32:2;;;;-1:-1:-1;;;;;;;;;;;1883:32:2;;;;;;1922:175;1945:6;;;;;;1941:10;;;;1922:175;;;1980:39;1994:11;;-1:-1:-1;;;;;1980:13:2;:39;:::i;:::-;2027:5;27:10:-1;;39:1;23:18;;;45:23;;;-1:-1;;;;;;;;;;;2027:23:2;;;;27:10:-1;;23:18;;;45:23;;-1:-1;2058:32:2;;;-1:-1:-1;;;;;;;;;;;2058:32:2;;;;1966:53;;-1:-1:-1;1953:3:2;1922:175;;;-1:-1:-1;2114:39:2;2128:11;;-1:-1:-1;;;;;2114:13:2;:39;:::i;:::-;2103:5;:50;-1:-1:-1;;879:1:18;863:13;:17;2260::8;2252:67;;;;-1:-1:-1;;;2252:67:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2325:8;:20;;-1:-1:-1;;;;;2325:20:8;;;-1:-1:-1;;;;;;2325:20:8;;;;;;;2351:8;:20;;;;;;;;;;;;;;;2377:12;:28;;;;-1:-1:-1;1085:5:0;:14;;;;;;;;;;;;;;-1:-1:-1;805:2189:0;;-1:-1:-1;;;805:2189:0;2230:445:2;2305:7;-1:-1:-1;;;;;;;;;;;2328:27:2;;2320:72;;;;;-1:-1:-1;;;2320:72:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2406:28:2;;2398:74;;;;-1:-1:-1;;;2398:74:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2538:23;;;-1:-1:-1;;;2538:23:2;;;;;;;;2478:9;2538:23;;;;;;;;2498:5;;2478:9;;2538:6;;:17;;:23;;;;;;;;;;:6;:23;;;5:2:-1;;;;30:1;27;20:12;5:2;2538:23:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2538:23:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2538:23:2;;;;;;;;;-1:-1:-1;2538:23:2;-1:-1:-1;;;;;;;;;;;;2589:6:2;2578:1;2571:38;2567:42;;2624:6;:17;2642:1;2645;2624:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2624:23:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2624:23:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2624:23:2;;2230:445;-1:-1:-1;;;;;2230:445:2:o;805:2189:0:-;;;;;;;",
"deployedSourceMap": "805:2189:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5355:102:8;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5355:102:8;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5355:102:8;-1:-1:-1;;;;;5355:102:8;;:::i;:::-;;1089:47;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1089:47:8;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1089:47:8;;:::i;:::-;;;;;;;;;;;;;;;;;;3478:781;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;3478:781:8;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;3478:781:8;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;3478:781:8;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;3478:781:8;;-1:-1:-1;3478:781:8;-1:-1:-1;3478:781:8;;;;;;;;-1:-1:-1;;;;;3478:781:8;;;;;;;;;;;;;;;;;;;;;;;;:::i;1278:25::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1278:25:8;;;:::i;:::-;;;;-1:-1:-1;;;;;1278:25:8;;;;;;;;;;;;;;2230:445:2;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2230:445:2;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2230:445:2;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;933:114;;8:9:-1;5:2;;;30:1;27;20:12;5:2;933:114:2;;;:::i;1209:20::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1209:20:2;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1463:23:8;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1463:23:8;;;:::i;3553:342:2:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3553:342:2;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3553:342:2;;:::i;1231:43:8:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1231:43:8;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1231:43:8;;:::i;1058:27::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1058:27:8;;;:::i;1430:34:2:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1430:34:2;;;:::i;5192:113:8:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5192:113:8;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5192:113:8;-1:-1:-1;;;;;5192:113:8;;:::i;4669:293::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4669:293:8;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4669:293:8;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;4669:293:8;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;4669:293:8;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;-1:-1;;;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;-1:-1;4669:293:8;;-1:-1:-1;4669:293:8;-1:-1:-1;4669:293:8;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;4669:293:8;;;;;;;;;;;;;;;;;2658:324;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2658:324:8;;:::i;3941:93:2:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3941:93:2;;;:::i;1549:39::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1549:39:2;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1549:39:2;;:::i;1499:46::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1499:46:2;;;:::i;4492:116:8:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4492:116:8;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4492:116:8;;:::i;1404:22:2:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1404:22:2;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1404:22:2;;:::i;1051:114::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1051:114:2;;;:::i;1369:31::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1369:31:2;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1369:31:2;;:::i;842:20:0:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;842:20:0;;;:::i;1468:27:2:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1468:27:2;;;:::i;5355:102:8:-;1540:8;;-1:-1:-1;;;;;1540:8:8;1526:10;:22;1518:72;;;;-1:-1:-1;;;1518:72:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5429:8;:23;;-1:-1:-1;;;;;;5429:23:8;-1:-1:-1;;;;;5429:23:8;;;;;;;;;;5355:102::o;1089:47::-;;;;;;;;;;;;;;;:::o;3478:781::-;1296:13:18;:18;;1313:1;1296:18;;;;;3695:12:8;;3687:20;;;3679:59;;;;;-1:-1:-1;;;3679:59:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;3753:31;;;;:15;:31;;;;;;;;3752:32;3744:76;;;;;-1:-1:-1;;;3744:76:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;3834:18;3846:5;3834:11;:18::i;:::-;3826:59;;;;;-1:-1:-1;;;3826:59:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;3932:8;;:126;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;4003:19:8;;;3932:126;;;;4024:17;;;3932:126;;;;;;;;;;;;;;;;;;-1:-1:-1;;;3932:126:8;;:8;;;;;:20;;3953:6;;;;3932:126;;;;;;;;;;;;;;;;:8;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;3932:1
"source": "// https://tornado.cash\n/*\n* d888888P dP a88888b. dP\n* 88 88 d8' `88 88\n* 88 .d8888b. 88d888b. 88d888b. .d8888b. .d888b88 .d8888b. 88 .d8888b. .d8888b. 88d888b.\n* 88 88' `88 88' `88 88' `88 88' `88 88' `88 88' `88 88 88' `88 Y8ooooo. 88' `88\n* 88 88. .88 88 88 88 88. .88 88. .88 88. .88 dP Y8. .88 88. .88 88 88 88\n* dP `88888P' dP dP dP `88888P8 `88888P8 `88888P' 88 Y88888P' `88888P8 `88888P' dP dP\n* ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo\n*/\n\npragma solidity 0.5.17;\n\nimport \"./Tornado.sol\";\n\ncontract ERC20Tornado is Tornado {\n address public token;\n\n constructor(\n IVerifier _verifier,\n uint256 _denomination,\n uint32 _merkleTreeHeight,\n address _operator,\n address _token\n ) Tornado(_verifier, _denomination, _merkleTreeHeight, _operator) public {\n token = _token;\n }\n\n function _processDeposit() internal {\n require(msg.value == 0, \"ETH value is supposed to be 0 for ERC20 instance\");\n _safeErc20TransferFrom(msg.sender, address(this), denomination);\n }\n\n function _processWithdraw(address payable _recipient, address payable _relayer, uint256 _fee, uint256 _refund) internal {\n require(msg.value == _refund, \"Incorrect refund amount received by the contract\");\n\n _safeErc20Transfer(_recipient, denomination - _fee);\n if (_fee > 0) {\n _safeErc20Transfer(_relayer, _fee);\n }\n\n if (_refund > 0) {\n (bool success, ) = _recipient.call.value(_refund)(\"\");\n if (!success) {\n // let's return _refund back to the relayer\n _relayer.transfer(_refund);\n }\n }\n }\n\n function _safeErc20TransferFrom(address _from, address _to, uint256 _amount) internal {\n (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd /* transferFrom */, _from, _to, _amount));\n require(success, \"not enough allowed tokens\");\n\n // if contract returns some data lets make sure that is `true` according to standard\n if (data.length > 0) {\n require(data.length == 32, \"data length should be either 0 or 32 bytes\");\n success = abi.decode(data, (bool));\n require(success, \"not enough allowed tokens. Token returns false.\");\n }\n }\n\n function _safeErc20Transfer(address _to, uint256 _amount) internal {\n (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb /* transfer */, _to, _amount));\n require(success, \"not enough tokens\");\n\n // if contract returns some data lets make sure that is `true` according to standard\n if (data.length > 0) {\n require(data.length == 32, \"data length should be either 0 or 32 bytes\");\n success = abi.decode(data, (bool));\n require(success, \"not enough tokens. Token returns false.\");\n }\n }\n}\n",
"sourcePath": "/Users/rstorm/repos/stormdapps/tornado-core/contracts/ERC20Tornado.sol",
"ast": {
"absolutePath": "/Users/rstorm/repos/stormdapps/tornado-core/contracts/ERC20Tornado.sol",
"exportedSymbols": {
"ERC20Tornado": [
227
]
},
"id": 228,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"0.5",
".17"
],
"nodeType": "PragmaDirective",
"src": "755:23:0"
},
{
"absolutePath": "/Users/rstorm/repos/stormdapps/tornado-core/contracts/Tornado.sol",
"file": "./Tornado.sol",
"id": 2,
"nodeType": "ImportDirective",
"scope": 228,
"sourceUnit": 1195,
"src": "780:23:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 3,
"name": "Tornado",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1194,
"src": "830:7:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Tornado_$1194",
"typeString": "contract Tornado"
}
},
"id": 4,
"nodeType": "InheritanceSpecifier",
"src": "830:7:0"
}
],
"contractDependencies": [
694,
1194,
2931
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 227,
"linearizedBaseContracts": [
227,
1194,
2931,
694
],
"name": "ERC20Tornado",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 6,
"name": "token",
"nodeType": "VariableDeclaration",
"scope": 227,
"src": "842:20:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 5,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "842:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 29,
"nodeType": "Block",
"src": "1079:25:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 27,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 25,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6,
"src": "1085:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 26,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16,
"src": "1093:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1085:14:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 28,
"nodeType": "ExpressionStatement",
"src": "1085:14:0"
}
]
},
"documentation": null,
"id": 30,
"implemented": true,
"kind": "constructor",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 19,
"name": "_verifier",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1016:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IVerifier_$891",
"typeString": "contract IVerifier"
}
},
{
"argumentTypes": null,
"id": 20,
"name": "_denomination",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10,
"src": "1027:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 21,
"name": "_merkleTreeHeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 12,
"src": "1042:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 22,
"name": "_operator",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14,
"src": "1061:9:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 23,
"modifierName": {
"argumentTypes": null,
"id": 18,
"name": "Tornado",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1194,
"src": "1008:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Tornado_$1194_$",
"typeString": "type(contract Tornado)"
}
},
"nodeType": "ModifierInvocation",
"src": "1008:63:0"
}
],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 17,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8,
"name": "_verifier",
"nodeType": "VariableDeclaration",
"scope": 30,
"src": "884:19:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IVerifier_$891",
"typeString": "contract IVerifier"
},
"typeName": {
"contractScope": null,
"id": 7,
"name": "IVerifier",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 891,
"src": "884:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IVerifier_$891",
"typeString": "contract IVerifier"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10,
"name": "_denomination",
"nodeType": "VariableDeclaration",
"scope": 30,
"src": "909:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "909:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 12,
"name": "_merkleTreeHeight",
"nodeType": "VariableDeclaration",
"scope": 30,
"src": "936:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 11,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "936:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14,
"name": "_operator",
"nodeType": "VariableDeclaration",
"scope": 30,
"src": "966:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 13,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "966:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16,
"name": "_token",
"nodeType": "VariableDeclaration",
"scope": 30,
"src": "989:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 15,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "989:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "878:129:0"
},
"returnParameters": {
"id": 24,
"nodeType": "ParameterList",
"parameters": [],
"src": "1079:0:0"
},
"scope": 227,
"src": "867:237:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 50,
"nodeType": "Block",
"src": "1144:155:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 37,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 34,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2946,
"src": "1158:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 35,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1158:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 36,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1171:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1158:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4554482076616c756520697320737570706f73656420746f206265203020666f7220455243323020696e7374616e6365",
"id": 38,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1174:50:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_b14b0818f1fdc710b92ba7e1ce725992b43e47a5b220b1b890f352eeac2e1d5e",
"typeString": "literal_string \"ETH value is supposed to be 0 for ERC20 instance\""
},
"value": "ETH value is supposed to be 0 for ERC20 instance"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_b14b0818f1fdc710b92ba7e1ce725992b43e47a5b220b1b890f352eeac2e1d5e",
"typeString": "literal_string \"ETH value is supposed to be 0 for ERC20 instance\""
}
],
"id": 33,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2949,
2950
],
"referencedDeclaration": 2950,
"src": "1150:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 39,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1150:75:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 40,
"nodeType": "ExpressionStatement",
"src": "1150:75:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 42,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2946,
"src": "1254:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 43,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1254:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 45,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2970,
"src": "1274:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20Tornado_$227",
"typeString": "contract ERC20Tornado"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_ERC20Tornado_$227",
"typeString": "contract ERC20Tornado"
}
],
"id": 44,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1266:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 46,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1266:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 47,
"name": "denomination",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 897,
"src": "1281:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 41,
"name": "_safeErc20TransferFrom",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 171,
"src": "1231:22:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,address,uint256)"
}
},
"id": 48,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1231:63:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 49,
"nodeType": "ExpressionStatement",
"src": "1231:63:0"
}
]
},
"documentation": null,
"id": 51,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_processDeposit",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 31,
"nodeType": "ParameterList",
"parameters": [],
"src": "1132:2:0"
},
"returnParameters": {
"id": 32,
"nodeType": "ParameterList",
"parameters": [],
"src": "1144:0:0"
},
"scope": 227,
"src": "1108:191:0",
"stateMutability": "nonpayable",
"superFunction": 1014,
"visibility": "internal"
},
{
"body": {
"id": 112,
"nodeType": "Block",
"src": "1423:427:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 66,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 63,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2946,
"src": "1437:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 64,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1437:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 65,
"name": "_refund",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 59,
"src": "1450:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1437:20:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "496e636f727265637420726566756e6420616d6f756e742072656365697665642062792074686520636f6e7472616374",
"id": 67,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1459:50:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_3189ced290ffd29dc422911cd3b29574f21c524c91f4b41e6abb0646c581cbff",
"typeString": "literal_string \"Incorrect refund amount received by the contract\""
},
"value": "Incorrect refund amount received by the contract"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_3189ced290ffd29dc422911cd3b29574f21c524c91f4b41e6abb0646c581cbff",
"typeString": "literal_string \"Incorrect refund amount received by the contract\""
}
],
"id": 62,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2949,
2950
],
"referencedDeclaration": 2950,
"src": "1429:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 68,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1429:81:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 69,
"nodeType": "ExpressionStatement",
"src": "1429:81:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 71,
"name": "_recipient",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 53,
"src": "1536:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 74,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 72,
"name": "denomination",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 897,
"src": "1548:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 73,
"name": "_fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 57,
"src": "1563:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1548:19:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 70,
"name": "_safeErc20Transfer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 226,
"src": "1517:18:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256)"
}
},
"id": 75,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1517:51:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 76,
"nodeType": "ExpressionStatement",
"src": "1517:51:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 79,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 77,
"name": "_fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 57,
"src": "1578:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 78,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1585:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1578:8:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 86,
"nodeType": "IfStatement",
"src": "1574:63:0",
"trueBody": {
"id": 85,
"nodeType": "Block",
"src": "1588:49:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 81,
"name": "_relayer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 55,
"src": "1615:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 82,
"name": "_fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 57,
"src": "1625:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 80,
"name": "_safeErc20Transfer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 226,
"src": "1596:18:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256)"
}
},
"id": 83,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1596:34:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 84,
"nodeType": "ExpressionStatement",
"src": "1596:34:0"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 89,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 87,
"name": "_refund",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 59,
"src": "1647:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 88,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1657:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1647:11:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 111,
"nodeType": "IfStatement",
"src": "1643:203:0",
"trueBody": {
"id": 110,
"nodeType": "Block",
"src": "1660:186:0",
"statements": [
{
"assignments": [
91,
null
],
"declarations": [
{
"constant": false,
"id": 91,
"name": "success",
"nodeType": "VariableDeclaration",
"scope": 110,
"src": "1669:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 90,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1669:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
null
],
"id": 99,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "",
"id": 97,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1718:2:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
"typeString": "literal_string \"\""
},
"value": ""
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
"typeString": "literal_string \"\""
}
],
"arguments": [
{
"argumentTypes": null,
"id": 95,
"name": "_refund",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 59,
"src": "1709:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 92,
"name": "_recipient",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 53,
"src": "1687:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 93,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "call",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1687:15:0",
"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": 94,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1687:21:0",
"typeDescriptions": {
"typeIdentifier": "t_function_setvalue_pure$_t_uint256_$returns$_t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$value_$",
"typeString": "function (uint256) pure returns (function (bytes memory) payable returns (bool,bytes memory))"
}
},
"id": 96,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1687:30:0",
"typeDescriptions": {
"typeIdentifier": "t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$value",
"typeString": "function (bytes memory) payable returns (bool,bytes memory)"
}
},
"id": 98,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1687:34:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1668:53:0"
},
{
"condition": {
"argumentTypes": null,
"id": 101,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "1733:8:0",
"subExpression": {
"argumentTypes": null,
"id": 100,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 91,
"src": "1734:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 109,
"nodeType": "IfStatement",
"src": "1729:111:0",
"trueBody": {
"id": 108,
"nodeType": "Block",
"src": "1743:97:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 105,
"name": "_refund",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 59,
"src": "1823:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 102,
"name": "_relayer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 55,
"src": "1805:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 104,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1805:17:0",
"typeDescriptions": {
"typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256)"
}
},
"id": 106,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1805:26:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 107,
"nodeType": "ExpressionStatement",
"src": "1805:26:0"
}
]
}
}
]
}
}
]
},
"documentation": null,
"id": 113,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_processWithdraw",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 60,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 53,
"name": "_recipient",
"nodeType": "VariableDeclaration",
"scope": 113,
"src": "1329:26:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 52,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1329:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 55,
"name": "_relayer",
"nodeType": "VariableDeclaration",
"scope": 113,
"src": "1357:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 54,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1357:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 57,
"name": "_fee",
"nodeType": "VariableDeclaration",
"scope": 113,
"src": "1383:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 56,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1383:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 59,
"name": "_refund",
"nodeType": "VariableDeclaration",
"scope": 113,
"src": "1397:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 58,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1397:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1328:85:0"
},
"returnParameters": {
"id": 61,
"nodeType": "ParameterList",
"parameters": [],
"src": "1423:0:0"
},
"scope": 227,
"src": "1303:547:0",
"stateMutability": "nonpayable",
"superFunction": 1110,
"visibility": "internal"
},
{
"body": {
"id": 170,
"nodeType": "Block",
"src": "1940:504:0",
"statements": [
{
"assignments": [
123,
125
],
"declarations": [
{
"constant": false,
"id": 123,
"name": "success",
"nodeType": "VariableDeclaration",
"scope": 170,
"src": "1947:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 122,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1947:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 125,
"name": "data",
"nodeType": "VariableDeclaration",
"scope": 170,
"src": "1961:17:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 124,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "1961:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 136,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30783233623837326464",
"id": 130,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2016:10:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_599290589_by_1",
"typeString": "int_const 599290589"
},
"value": "0x23b872dd"
},
{
"argumentTypes": null,
"id": 131,
"name": "_from",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 115,
"src": "2047:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 132,
"name": "_to",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 117,
"src": "2054:3:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 133,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 119,
"src": "2059:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_599290589_by_1",
"typeString": "int_const 599290589"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 128,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2933,
"src": "1993:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 129,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodeWithSelector",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1993:22:0",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodewithselector_pure$_t_bytes4_$returns$_t_bytes_memory_ptr_$",
"typeString": "function (bytes4) pure returns (bytes memory)"
}
},
"id": 134,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1993:74:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": null,
"id": 126,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6,
"src": "1982:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 127,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "call",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1982:10:0",
"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": 135,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1982:86:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1946:122:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 138,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 123,
"src": "2082:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "6e6f7420656e6f75676820616c6c6f77656420746f6b656e73",
"id": 139,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2091:27:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_b31c8a8545ea674c554dd2f6bad7d7bd1dfe923a25150b76350dc6970bf3ff5c",
"typeString": "literal_string \"not enough allowed tokens\""
},
"value": "not enough allowed tokens"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_b31c8a8545ea674c554dd2f6bad7d7bd1dfe923a25150b76350dc6970bf3ff5c",
"typeString": "literal_string \"not enough allowed tokens\""
}
],
"id": 137,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2949,
2950
],
"referencedDeclaration": 2950,
"src": "2074:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 140,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2074:45:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 141,
"nodeType": "ExpressionStatement",
"src": "2074:45:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 145,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 142,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 125,
"src": "2219:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 143,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2219:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 144,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2233:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "2219:15:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 169,
"nodeType": "IfStatement",
"src": "2215:225:0",
"trueBody": {
"id": 168,
"nodeType": "Block",
"src": "2236:204:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 150,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 147,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 125,
"src": "2252:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 148,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2252:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3332",
"id": 149,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2267:2:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_32_by_1",
"typeString": "int_const 32"
},
"value": "32"
},
"src": "2252:17:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "64617461206c656e6774682073686f756c64206265206569746865722030206f72203332206279746573",
"id": 151,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2271:44:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_22b4652a1c8fbdfc6305c7ee289e87caf6a45e5ae327ee8f67eb64ba36d62560",
"typeString": "literal_string \"data length should be either 0 or 32 bytes\""
},
"value": "data length should be either 0 or 32 bytes"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_22b4652a1c8fbdfc6305c7ee289e87caf6a45e5ae327ee8f67eb64ba36d62560",
"typeString": "literal_string \"data length should be either 0 or 32 bytes\""
}
],
"id": 146,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2949,
2950
],
"referencedDeclaration": 2950,
"src": "2244:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 152,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2244:72:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 153,
"nodeType": "ExpressionStatement",
"src": "2244:72:0"
},
{
"expression": {
"argumentTypes": null,
"id": 161,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 154,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 123,
"src": "2324:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 157,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 125,
"src": "2345:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 158,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2352:4:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
},
"typeName": "bool"
}
],
"id": 159,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "2351:6:0",
"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": 155,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2933,
"src": "2334:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 156,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "decode",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2334:10:0",
"typeDescriptions": {
"typeIdentifier": "t_function_abidecode_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 160,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2334:24:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "2324:34:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 162,
"nodeType": "ExpressionStatement",
"src": "2324:34:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 164,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 123,
"src": "2374:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "6e6f7420656e6f75676820616c6c6f77656420746f6b656e732e20546f6b656e2072657475726e732066616c73652e",
"id": 165,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2383:49:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_6cfae212a217874b58247660ff4d75d72aa825e8f2120480a7da09cf7efa221d",
"typeString": "literal_string \"not enough allowed tokens. Token returns false.\""
},
"value": "not enough allowed tokens. Token returns false."
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_6cfae212a217874b58247660ff4d75d72aa825e8f2120480a7da09cf7efa221d",
"typeString": "literal_string \"not enough allowed tokens. Token returns false.\""
}
],
"id": 163,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2949,
2950
],
"referencedDeclaration": 2950,
"src": "2366:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 166,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2366:67:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 167,
"nodeType": "ExpressionStatement",
"src": "2366:67:0"
}
]
}
}
]
},
"documentation": null,
"id": 171,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_safeErc20TransferFrom",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 120,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 115,
"name": "_from",
"nodeType": "VariableDeclaration",
"scope": 171,
"src": "1886:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 114,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1886:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 117,
"name": "_to",
"nodeType": "VariableDeclaration",
"scope": 171,
"src": "1901:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 116,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1901:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 119,
"name": "_amount",
"nodeType": "VariableDeclaration",
"scope": 171,
"src": "1914:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 118,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1914:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1885:45:0"
},
"returnParameters": {
"id": 121,
"nodeType": "ParameterList",
"parameters": [],
"src": "1940:0:0"
},
"scope": 227,
"src": "1854:590:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 225,
"nodeType": "Block",
"src": "2515:477:0",
"statements": [
{
"assignments": [
179,
181
],
"declarations": [
{
"constant": false,
"id": 179,
"name": "success",
"nodeType": "VariableDeclaration",
"scope": 225,
"src": "2522:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 178,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2522:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 181,
"name": "data",
"nodeType": "VariableDeclaration",
"scope": 225,
"src": "2536:17:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 180,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "2536:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 191,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30786139303539636262",
"id": 186,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2591:10:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2835717307_by_1",
"typeString": "int_const 2835717307"
},
"value": "0xa9059cbb"
},
{
"argumentTypes": null,
"id": 187,
"name": "_to",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 173,
"src": "2618:3:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 188,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 175,
"src": "2623:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_2835717307_by_1",
"typeString": "int_const 2835717307"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 184,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2933,
"src": "2568:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 185,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodeWithSelector",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2568:22:0",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodewithselector_pure$_t_bytes4_$returns$_t_bytes_memory_ptr_$",
"typeString": "function (bytes4) pure returns (bytes memory)"
}
},
"id": 189,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2568:63:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": null,
"id": 182,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6,
"src": "2557:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 183,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "call",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2557:10:0",
"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": 190,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2557:75:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2521:111:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 193,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 179,
"src": "2646:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "6e6f7420656e6f75676820746f6b656e73",
"id": 194,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2655:19:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_73949bcdc07934e9395e82489bb22c4742e057960a2c090d38e53d68d3caf52a",
"typeString": "literal_string \"not enough tokens\""
},
"value": "not enough tokens"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_73949bcdc07934e9395e82489bb22c4742e057960a2c090d38e53d68d3caf52a",
"typeString": "literal_string \"not enough tokens\""
}
],
"id": 192,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2949,
2950
],
"referencedDeclaration": 2950,
"src": "2638:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 195,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2638:37:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 196,
"nodeType": "ExpressionStatement",
"src": "2638:37:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 200,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 197,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 181,
"src": "2775:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 198,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2775:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 199,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2789:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "2775:15:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 224,
"nodeType": "IfStatement",
"src": "2771:217:0",
"trueBody": {
"id": 223,
"nodeType": "Block",
"src": "2792:196:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 205,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 202,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 181,
"src": "2808:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 203,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2808:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3332",
"id": 204,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2823:2:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_32_by_1",
"typeString": "int_const 32"
},
"value": "32"
},
"src": "2808:17:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "64617461206c656e6774682073686f756c64206265206569746865722030206f72203332206279746573",
"id": 206,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2827:44:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_22b4652a1c8fbdfc6305c7ee289e87caf6a45e5ae327ee8f67eb64ba36d62560",
"typeString": "literal_string \"data length should be either 0 or 32 bytes\""
},
"value": "data length should be either 0 or 32 bytes"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_22b4652a1c8fbdfc6305c7ee289e87caf6a45e5ae327ee8f67eb64ba36d62560",
"typeString": "literal_string \"data length should be either 0 or 32 bytes\""
}
],
"id": 201,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2949,
2950
],
"referencedDeclaration": 2950,
"src": "2800:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 207,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2800:72:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 208,
"nodeType": "ExpressionStatement",
"src": "2800:72:0"
},
{
"expression": {
"argumentTypes": null,
"id": 216,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 209,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 179,
"src": "2880:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 212,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 181,
"src": "2901:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 213,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2908:4:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
},
"typeName": "bool"
}
],
"id": 214,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "2907:6:0",
"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": 210,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2933,
"src": "2890:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 211,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "decode",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2890:10:0",
"typeDescriptions": {
"typeIdentifier": "t_function_abidecode_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 215,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2890:24:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "2880:34:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 217,
"nodeType": "ExpressionStatement",
"src": "2880:34:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 219,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 179,
"src": "2930:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "6e6f7420656e6f75676820746f6b656e732e20546f6b656e2072657475726e732066616c73652e",
"id": 220,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2939:41:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_38fa5aabf87e9f42de902eb4d9022484dde7943d80702b79ba468e9fc08f5e5e",
"typeString": "literal_string \"not enough tokens. Token returns false.\""
},
"value": "not enough tokens. Token returns false."
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_38fa5aabf87e9f42de902eb4d9022484dde7943d80702b79ba468e9fc08f5e5e",
"typeString": "literal_string \"not enough tokens. Token returns false.\""
}
],
"id": 218,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2949,
2950
],
"referencedDeclaration": 2950,
"src": "2922:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 221,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2922:59:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 222,
"nodeType": "ExpressionStatement",
"src": "2922:59:0"
}
]
}
}
]
},
"documentation": null,
"id": 226,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_safeErc20Transfer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 176,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 173,
"name": "_to",
"nodeType": "VariableDeclaration",
"scope": 226,
"src": "2476:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 172,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2476:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 175,
"name": "_amount",
"nodeType": "VariableDeclaration",
"scope": 226,
"src": "2489:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 174,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2489:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2475:30:0"
},
"returnParameters": {
"id": 177,
"nodeType": "ParameterList",
"parameters": [],
"src": "2515:0:0"
},
"scope": 227,
"src": "2448:544:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
}
],
"scope": 228,
"src": "805:2189:0"
}
],
"src": "755:2240:0"
},
"legacyAST": {
"absolutePath": "/Users/rstorm/repos/stormdapps/tornado-core/contracts/ERC20Tornado.sol",
"exportedSymbols": {
"ERC20Tornado": [
227
]
},
"id": 228,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"0.5",
".17"
],
"nodeType": "PragmaDirective",
"src": "755:23:0"
},
{
"absolutePath": "/Users/rstorm/repos/stormdapps/tornado-core/contracts/Tornado.sol",
"file": "./Tornado.sol",
"id": 2,
"nodeType": "ImportDirective",
"scope": 228,
"sourceUnit": 1195,
"src": "780:23:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 3,
"name": "Tornado",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1194,
"src": "830:7:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Tornado_$1194",
"typeString": "contract Tornado"
}
},
"id": 4,
"nodeType": "InheritanceSpecifier",
"src": "830:7:0"
}
],
"contractDependencies": [
694,
1194,
2931
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 227,
"linearizedBaseContracts": [
227,
1194,
2931,
694
],
"name": "ERC20Tornado",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 6,
"name": "token",
"nodeType": "VariableDeclaration",
"scope": 227,
"src": "842:20:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 5,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "842:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 29,
"nodeType": "Block",
"src": "1079:25:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 27,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 25,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6,
"src": "1085:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 26,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16,
"src": "1093:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1085:14:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 28,
"nodeType": "ExpressionStatement",
"src": "1085:14:0"
}
]
},
"documentation": null,
"id": 30,
"implemented": true,
"kind": "constructor",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 19,
"name": "_verifier",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1016:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IVerifier_$891",
"typeString": "contract IVerifier"
}
},
{
"argumentTypes": null,
"id": 20,
"name": "_denomination",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10,
"src": "1027:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 21,
"name": "_merkleTreeHeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 12,
"src": "1042:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 22,
"name": "_operator",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14,
"src": "1061:9:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 23,
"modifierName": {
"argumentTypes": null,
"id": 18,
"name": "Tornado",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1194,
"src": "1008:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Tornado_$1194_$",
"typeString": "type(contract Tornado)"
}
},
"nodeType": "ModifierInvocation",
"src": "1008:63:0"
}
],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 17,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8,
"name": "_verifier",
"nodeType": "VariableDeclaration",
"scope": 30,
"src": "884:19:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IVerifier_$891",
"typeString": "contract IVerifier"
},
"typeName": {
"contractScope": null,
"id": 7,
"name": "IVerifier",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 891,
"src": "884:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IVerifier_$891",
"typeString": "contract IVerifier"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10,
"name": "_denomination",
"nodeType": "VariableDeclaration",
"scope": 30,
"src": "909:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "909:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 12,
"name": "_merkleTreeHeight",
"nodeType": "VariableDeclaration",
"scope": 30,
"src": "936:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 11,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "936:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14,
"name": "_operator",
"nodeType": "VariableDeclaration",
"scope": 30,
"src": "966:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 13,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "966:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16,
"name": "_token",
"nodeType": "VariableDeclaration",
"scope": 30,
"src": "989:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 15,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "989:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "878:129:0"
},
"returnParameters": {
"id": 24,
"nodeType": "ParameterList",
"parameters": [],
"src": "1079:0:0"
},
"scope": 227,
"src": "867:237:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 50,
"nodeType": "Block",
"src": "1144:155:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 37,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 34,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2946,
"src": "1158:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 35,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1158:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 36,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1171:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1158:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4554482076616c756520697320737570706f73656420746f206265203020666f7220455243323020696e7374616e6365",
"id": 38,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1174:50:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_b14b0818f1fdc710b92ba7e1ce725992b43e47a5b220b1b890f352eeac2e1d5e",
"typeString": "literal_string \"ETH value is supposed to be 0 for ERC20 instance\""
},
"value": "ETH value is supposed to be 0 for ERC20 instance"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_b14b0818f1fdc710b92ba7e1ce725992b43e47a5b220b1b890f352eeac2e1d5e",
"typeString": "literal_string \"ETH value is supposed to be 0 for ERC20 instance\""
}
],
"id": 33,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2949,
2950
],
"referencedDeclaration": 2950,
"src": "1150:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 39,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1150:75:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 40,
"nodeType": "ExpressionStatement",
"src": "1150:75:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 42,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2946,
"src": "1254:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 43,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1254:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 45,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2970,
"src": "1274:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20Tornado_$227",
"typeString": "contract ERC20Tornado"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_ERC20Tornado_$227",
"typeString": "contract ERC20Tornado"
}
],
"id": 44,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1266:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 46,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1266:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 47,
"name": "denomination",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 897,
"src": "1281:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 41,
"name": "_safeErc20TransferFrom",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 171,
"src": "1231:22:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,address,uint256)"
}
},
"id": 48,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1231:63:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 49,
"nodeType": "ExpressionStatement",
"src": "1231:63:0"
}
]
},
"documentation": null,
"id": 51,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_processDeposit",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 31,
"nodeType": "ParameterList",
"parameters": [],
"src": "1132:2:0"
},
"returnParameters": {
"id": 32,
"nodeType": "ParameterList",
"parameters": [],
"src": "1144:0:0"
},
"scope": 227,
"src": "1108:191:0",
"stateMutability": "nonpayable",
"superFunction": 1014,
"visibility": "internal"
},
{
"body": {
"id": 112,
"nodeType": "Block",
"src": "1423:427:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 66,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 63,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2946,
"src": "1437:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 64,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1437:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 65,
"name": "_refund",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 59,
"src": "1450:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1437:20:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "496e636f727265637420726566756e6420616d6f756e742072656365697665642062792074686520636f6e7472616374",
"id": 67,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1459:50:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_3189ced290ffd29dc422911cd3b29574f21c524c91f4b41e6abb0646c581cbff",
"typeString": "literal_string \"Incorrect refund amount received by the contract\""
},
"value": "Incorrect refund amount received by the contract"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_3189ced290ffd29dc422911cd3b29574f21c524c91f4b41e6abb0646c581cbff",
"typeString": "literal_string \"Incorrect refund amount received by the contract\""
}
],
"id": 62,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2949,
2950
],
"referencedDeclaration": 2950,
"src": "1429:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 68,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1429:81:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 69,
"nodeType": "ExpressionStatement",
"src": "1429:81:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 71,
"name": "_recipient",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 53,
"src": "1536:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 74,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 72,
"name": "denomination",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 897,
"src": "1548:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 73,
"name": "_fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 57,
"src": "1563:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1548:19:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 70,
"name": "_safeErc20Transfer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 226,
"src": "1517:18:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256)"
}
},
"id": 75,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1517:51:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 76,
"nodeType": "ExpressionStatement",
"src": "1517:51:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 79,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 77,
"name": "_fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 57,
"src": "1578:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 78,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1585:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1578:8:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 86,
"nodeType": "IfStatement",
"src": "1574:63:0",
"trueBody": {
"id": 85,
"nodeType": "Block",
"src": "1588:49:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 81,
"name": "_relayer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 55,
"src": "1615:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 82,
"name": "_fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 57,
"src": "1625:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 80,
"name": "_safeErc20Transfer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 226,
"src": "1596:18:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256)"
}
},
"id": 83,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1596:34:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 84,
"nodeType": "ExpressionStatement",
"src": "1596:34:0"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 89,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 87,
"name": "_refund",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 59,
"src": "1647:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 88,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1657:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1647:11:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 111,
"nodeType": "IfStatement",
"src": "1643:203:0",
"trueBody": {
"id": 110,
"nodeType": "Block",
"src": "1660:186:0",
"statements": [
{
"assignments": [
91,
null
],
"declarations": [
{
"constant": false,
"id": 91,
"name": "success",
"nodeType": "VariableDeclaration",
"scope": 110,
"src": "1669:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 90,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1669:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
null
],
"id": 99,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "",
"id": 97,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1718:2:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
"typeString": "literal_string \"\""
},
"value": ""
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
"typeString": "literal_string \"\""
}
],
"arguments": [
{
"argumentTypes": null,
"id": 95,
"name": "_refund",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 59,
"src": "1709:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 92,
"name": "_recipient",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 53,
"src": "1687:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 93,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "call",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1687:15:0",
"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": 94,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1687:21:0",
"typeDescriptions": {
"typeIdentifier": "t_function_setvalue_pure$_t_uint256_$returns$_t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$value_$",
"typeString": "function (uint256) pure returns (function (bytes memory) payable returns (bool,bytes memory))"
}
},
"id": 96,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1687:30:0",
"typeDescriptions": {
"typeIdentifier": "t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$value",
"typeString": "function (bytes memory) payable returns (bool,bytes memory)"
}
},
"id": 98,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1687:34:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1668:53:0"
},
{
"condition": {
"argumentTypes": null,
"id": 101,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "1733:8:0",
"subExpression": {
"argumentTypes": null,
"id": 100,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 91,
"src": "1734:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 109,
"nodeType": "IfStatement",
"src": "1729:111:0",
"trueBody": {
"id": 108,
"nodeType": "Block",
"src": "1743:97:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 105,
"name": "_refund",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 59,
"src": "1823:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 102,
"name": "_relayer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 55,
"src": "1805:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 104,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1805:17:0",
"typeDescriptions": {
"typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256)"
}
},
"id": 106,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1805:26:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 107,
"nodeType": "ExpressionStatement",
"src": "1805:26:0"
}
]
}
}
]
}
}
]
},
"documentation": null,
"id": 113,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_processWithdraw",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 60,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 53,
"name": "_recipient",
"nodeType": "VariableDeclaration",
"scope": 113,
"src": "1329:26:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 52,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1329:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 55,
"name": "_relayer",
"nodeType": "VariableDeclaration",
"scope": 113,
"src": "1357:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 54,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1357:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 57,
"name": "_fee",
"nodeType": "VariableDeclaration",
"scope": 113,
"src": "1383:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 56,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1383:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 59,
"name": "_refund",
"nodeType": "VariableDeclaration",
"scope": 113,
"src": "1397:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 58,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1397:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1328:85:0"
},
"returnParameters": {
"id": 61,
"nodeType": "ParameterList",
"parameters": [],
"src": "1423:0:0"
},
"scope": 227,
"src": "1303:547:0",
"stateMutability": "nonpayable",
"superFunction": 1110,
"visibility": "internal"
},
{
"body": {
"id": 170,
"nodeType": "Block",
"src": "1940:504:0",
"statements": [
{
"assignments": [
123,
125
],
"declarations": [
{
"constant": false,
"id": 123,
"name": "success",
"nodeType": "VariableDeclaration",
"scope": 170,
"src": "1947:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 122,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1947:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 125,
"name": "data",
"nodeType": "VariableDeclaration",
"scope": 170,
"src": "1961:17:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 124,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "1961:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 136,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30783233623837326464",
"id": 130,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2016:10:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_599290589_by_1",
"typeString": "int_const 599290589"
},
"value": "0x23b872dd"
},
{
"argumentTypes": null,
"id": 131,
"name": "_from",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 115,
"src": "2047:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 132,
"name": "_to",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 117,
"src": "2054:3:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 133,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 119,
"src": "2059:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_599290589_by_1",
"typeString": "int_const 599290589"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 128,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2933,
"src": "1993:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 129,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodeWithSelector",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1993:22:0",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodewithselector_pure$_t_bytes4_$returns$_t_bytes_memory_ptr_$",
"typeString": "function (bytes4) pure returns (bytes memory)"
}
},
"id": 134,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1993:74:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": null,
"id": 126,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6,
"src": "1982:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 127,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "call",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1982:10:0",
"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": 135,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1982:86:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1946:122:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 138,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 123,
"src": "2082:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "6e6f7420656e6f75676820616c6c6f77656420746f6b656e73",
"id": 139,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2091:27:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_b31c8a8545ea674c554dd2f6bad7d7bd1dfe923a25150b76350dc6970bf3ff5c",
"typeString": "literal_string \"not enough allowed tokens\""
},
"value": "not enough allowed tokens"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_b31c8a8545ea674c554dd2f6bad7d7bd1dfe923a25150b76350dc6970bf3ff5c",
"typeString": "literal_string \"not enough allowed tokens\""
}
],
"id": 137,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2949,
2950
],
"referencedDeclaration": 2950,
"src": "2074:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 140,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2074:45:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 141,
"nodeType": "ExpressionStatement",
"src": "2074:45:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 145,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 142,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 125,
"src": "2219:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 143,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2219:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 144,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2233:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "2219:15:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 169,
"nodeType": "IfStatement",
"src": "2215:225:0",
"trueBody": {
"id": 168,
"nodeType": "Block",
"src": "2236:204:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 150,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 147,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 125,
"src": "2252:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 148,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2252:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3332",
"id": 149,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2267:2:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_32_by_1",
"typeString": "int_const 32"
},
"value": "32"
},
"src": "2252:17:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "64617461206c656e6774682073686f756c64206265206569746865722030206f72203332206279746573",
"id": 151,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2271:44:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_22b4652a1c8fbdfc6305c7ee289e87caf6a45e5ae327ee8f67eb64ba36d62560",
"typeString": "literal_string \"data length should be either 0 or 32 bytes\""
},
"value": "data length should be either 0 or 32 bytes"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_22b4652a1c8fbdfc6305c7ee289e87caf6a45e5ae327ee8f67eb64ba36d62560",
"typeString": "literal_string \"data length should be either 0 or 32 bytes\""
}
],
"id": 146,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2949,
2950
],
"referencedDeclaration": 2950,
"src": "2244:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 152,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2244:72:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 153,
"nodeType": "ExpressionStatement",
"src": "2244:72:0"
},
{
"expression": {
"argumentTypes": null,
"id": 161,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 154,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 123,
"src": "2324:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 157,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 125,
"src": "2345:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 158,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2352:4:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
},
"typeName": "bool"
}
],
"id": 159,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "2351:6:0",
"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": 155,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2933,
"src": "2334:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 156,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "decode",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2334:10:0",
"typeDescriptions": {
"typeIdentifier": "t_function_abidecode_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 160,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2334:24:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "2324:34:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 162,
"nodeType": "ExpressionStatement",
"src": "2324:34:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 164,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 123,
"src": "2374:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "6e6f7420656e6f75676820616c6c6f77656420746f6b656e732e20546f6b656e2072657475726e732066616c73652e",
"id": 165,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2383:49:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_6cfae212a217874b58247660ff4d75d72aa825e8f2120480a7da09cf7efa221d",
"typeString": "literal_string \"not enough allowed tokens. Token returns false.\""
},
"value": "not enough allowed tokens. Token returns false."
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_6cfae212a217874b58247660ff4d75d72aa825e8f2120480a7da09cf7efa221d",
"typeString": "literal_string \"not enough allowed tokens. Token returns false.\""
}
],
"id": 163,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2949,
2950
],
"referencedDeclaration": 2950,
"src": "2366:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 166,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2366:67:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 167,
"nodeType": "ExpressionStatement",
"src": "2366:67:0"
}
]
}
}
]
},
"documentation": null,
"id": 171,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_safeErc20TransferFrom",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 120,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 115,
"name": "_from",
"nodeType": "VariableDeclaration",
"scope": 171,
"src": "1886:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 114,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1886:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 117,
"name": "_to",
"nodeType": "VariableDeclaration",
"scope": 171,
"src": "1901:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 116,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1901:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 119,
"name": "_amount",
"nodeType": "VariableDeclaration",
"scope": 171,
"src": "1914:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 118,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1914:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1885:45:0"
},
"returnParameters": {
"id": 121,
"nodeType": "ParameterList",
"parameters": [],
"src": "1940:0:0"
},
"scope": 227,
"src": "1854:590:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 225,
"nodeType": "Block",
"src": "2515:477:0",
"statements": [
{
"assignments": [
179,
181
],
"declarations": [
{
"constant": false,
"id": 179,
"name": "success",
"nodeType": "VariableDeclaration",
"scope": 225,
"src": "2522:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 178,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2522:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 181,
"name": "data",
"nodeType": "VariableDeclaration",
"scope": 225,
"src": "2536:17:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 180,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "2536:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 191,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30786139303539636262",
"id": 186,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2591:10:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2835717307_by_1",
"typeString": "int_const 2835717307"
},
"value": "0xa9059cbb"
},
{
"argumentTypes": null,
"id": 187,
"name": "_to",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 173,
"src": "2618:3:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 188,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 175,
"src": "2623:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_2835717307_by_1",
"typeString": "int_const 2835717307"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 184,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2933,
"src": "2568:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 185,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodeWithSelector",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2568:22:0",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodewithselector_pure$_t_bytes4_$returns$_t_bytes_memory_ptr_$",
"typeString": "function (bytes4) pure returns (bytes memory)"
}
},
"id": 189,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2568:63:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": null,
"id": 182,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6,
"src": "2557:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 183,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "call",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2557:10:0",
"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": 190,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2557:75:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2521:111:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 193,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 179,
"src": "2646:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "6e6f7420656e6f75676820746f6b656e73",
"id": 194,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2655:19:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_73949bcdc07934e9395e82489bb22c4742e057960a2c090d38e53d68d3caf52a",
"typeString": "literal_string \"not enough tokens\""
},
"value": "not enough tokens"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_73949bcdc07934e9395e82489bb22c4742e057960a2c090d38e53d68d3caf52a",
"typeString": "literal_string \"not enough tokens\""
}
],
"id": 192,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2949,
2950
],
"referencedDeclaration": 2950,
"src": "2638:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 195,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2638:37:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 196,
"nodeType": "ExpressionStatement",
"src": "2638:37:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 200,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 197,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 181,
"src": "2775:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 198,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2775:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 199,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2789:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "2775:15:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 224,
"nodeType": "IfStatement",
"src": "2771:217:0",
"trueBody": {
"id": 223,
"nodeType": "Block",
"src": "2792:196:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 205,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 202,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 181,
"src": "2808:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 203,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2808:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3332",
"id": 204,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2823:2:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_32_by_1",
"typeString": "int_const 32"
},
"value": "32"
},
"src": "2808:17:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "64617461206c656e6774682073686f756c64206265206569746865722030206f72203332206279746573",
"id": 206,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2827:44:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_22b4652a1c8fbdfc6305c7ee289e87caf6a45e5ae327ee8f67eb64ba36d62560",
"typeString": "literal_string \"data length should be either 0 or 32 bytes\""
},
"value": "data length should be either 0 or 32 bytes"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_22b4652a1c8fbdfc6305c7ee289e87caf6a45e5ae327ee8f67eb64ba36d62560",
"typeString": "literal_string \"data length should be either 0 or 32 bytes\""
}
],
"id": 201,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2949,
2950
],
"referencedDeclaration": 2950,
"src": "2800:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 207,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2800:72:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 208,
"nodeType": "ExpressionStatement",
"src": "2800:72:0"
},
{
"expression": {
"argumentTypes": null,
"id": 216,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 209,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 179,
"src": "2880:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 212,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 181,
"src": "2901:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 213,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2908:4:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
},
"typeName": "bool"
}
],
"id": 214,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "2907:6:0",
"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": 210,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2933,
"src": "2890:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 211,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "decode",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2890:10:0",
"typeDescriptions": {
"typeIdentifier": "t_function_abidecode_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 215,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2890:24:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "2880:34:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 217,
"nodeType": "ExpressionStatement",
"src": "2880:34:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 219,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 179,
"src": "2930:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "6e6f7420656e6f75676820746f6b656e732e20546f6b656e2072657475726e732066616c73652e",
"id": 220,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2939:41:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_38fa5aabf87e9f42de902eb4d9022484dde7943d80702b79ba468e9fc08f5e5e",
"typeString": "literal_string \"not enough tokens. Token returns false.\""
},
"value": "not enough tokens. Token returns false."
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_38fa5aabf87e9f42de902eb4d9022484dde7943d80702b79ba468e9fc08f5e5e",
"typeString": "literal_string \"not enough tokens. Token returns false.\""
}
],
"id": 218,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2949,
2950
],
"referencedDeclaration": 2950,
"src": "2922:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 221,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2922:59:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 222,
"nodeType": "ExpressionStatement",
"src": "2922:59:0"
}
]
}
}
]
},
"documentation": null,
"id": 226,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_safeErc20Transfer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 176,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 173,
"name": "_to",
"nodeType": "VariableDeclaration",
"scope": 226,
"src": "2476:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 172,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2476:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 175,
"name": "_amount",
"nodeType": "VariableDeclaration",
"scope": 226,
"src": "2489:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 174,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2489:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2475:30:0"
},
"returnParameters": {
"id": 177,
"nodeType": "ParameterList",
"parameters": [],
"src": "2515:0:0"
},
"scope": 227,
"src": "2448:544:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
}
],
"scope": 228,
"src": "805:2189:0"
}
],
"src": "755:2240:0"
},
"compiler": {
"name": "solc",
"version": "0.5.17+commit.d19bba13.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.0.18",
"updatedAt": "2020-05-21T19:03:54.134Z",
"devdoc": {
"methods": {
"changeOperator(address)": {
"details": "operator can change his address "
},
"deposit(bytes32)": {
"details": "Deposit funds into the contract. The caller must send (for ETH) or approve (for ERC20) value equal to or `denomination` of this instance.",
"params": {
"_commitment": "the note commitment, which is PedersenHash(nullifier + secret)"
}
},
"getLastRoot()": {
"details": "Returns the last root"
},
"hashLeftRight(bytes32,bytes32)": {
"details": "Hash 2 tree leaves, returns MiMC(_left, _right)"
},
"isKnownRoot(bytes32)": {
"details": "Whether the root is present in the root history"
},
"isSpent(bytes32)": {
"details": "whether a note is already spent "
},
"isSpentArray(bytes32[])": {
"details": "whether an array of notes is already spent "
},
"updateVerifier(address)": {
"details": "allow operator to update SNARK verification keys. This is needed to update keys after the final trusted setup ceremony is held. After that operator rights are supposed to be transferred to zero address"
},
"withdraw(bytes,bytes32,bytes32,address,address,uint256,uint256)": {
"details": "Withdraw a deposit from the contract. `proof` is a zkSNARK proof data, and input is an array of circuit public inputs `input` array consists of: - merkle root of all deposits in the contract - hash of unique deposit nullifier to prevent double spends - the recipient of funds - optional fee that goes to the transaction sender (usually a relay)"
}
}
},
"userdoc": {
"methods": {}
}
}