UNPKG

@dolomite-exchange/dolomite-margin

Version:

Ethereum Smart Contracts and TypeScript library used for the DolomiteMargin trading protocol

805 lines 88.7 kB
{ "contractName": "TestParaswapTransferProxy", "abi": [ { "constant": false, "inputs": [ { "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "address", "name": "_from", "type": "address" }, { "internalType": "address", "name": "_to", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" } ], "name": "doTransfer", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"doTransfer\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{\"doTransfer(address,address,address,uint256)\":{\"notice\":\"This function is called blindly by `LiquidatorProxyV2WithExternalLiquidity` via the pass through \\\"_paraswapCalldata\\\" variable\"}}}},\"settings\":{\"compilationTarget\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestParaswapTransferProxy.sol\":\"TestParaswapTransferProxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/interfaces/IERC20Detailed.sol\":{\"keccak256\":\"0x22a62e2a8155e70300773721902f4b9118e17aa0bb5d9d1b046050a014cfb223\",\"urls\":[\"bzz-raw://03af737a33c552fbe58f6f1fbd5496854fdc28dd57be4365d56663725c083a18\",\"dweb:/ipfs/QmbgLqGAQEd6tXsZB8QaPNCAMiU6nNzP75wNbKdS65BuUF\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Require.sol\":{\"keccak256\":\"0x05a2a90b41b6a5f42f0a72da63d015fb0b406a9ba2172823352e522e8bf3a606\",\"urls\":[\"bzz-raw://19883f0c6d33266f756ec5c3d17539524aa24b993c46c33f8400801d09373a6c\",\"dweb:/ipfs/QmYX2fwK3vQQDSZLMrc5wMfeb8RWrcC9CGX8XECLty8QDk\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestParaswapTransferProxy.sol\":{\"keccak256\":\"0xe21e8eec012a4463ad20a372d87dd3b3372c916f098b49fc15166c7adc289027\",\"urls\":[\"bzz-raw://e079d1523e1a3e9915a1b5823340bed72007e829026440384a6659ef951999a1\",\"dweb:/ipfs/QmWrrwqLS13kkodWtQLJK1Ka7nnAPfmxtKwDcsQSUTBVey\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestToken.sol\":{\"keccak256\":\"0xfbf238308c7b72cfc85387bdcf3a88145ab193c82268bed81f6eeea470c8e1bb\",\"urls\":[\"bzz-raw://ee425eb5d26cf169e6fc1ec50c66a59596bb4af77c9b190e5d8b3a0abd26efa1\",\"dweb:/ipfs/QmRKFYpuX7Q3pJ3UuLMcAHJ8SF1Gegp7Q99r2wZo57hDrR\"]},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x640b6dee7a4b830bdfd52b5031a07fc2b12209f5b2e29e5d364a7d37f69d8076\",\"urls\":[\"bzz-raw://31113152e1ddb78fe7a4197f247591ca894e93f916867beb708d8e747b6cc74f\",\"dweb:/ipfs/QmbZaJyXdpsYGykVhHH9qpVGQg9DGCxE2QufbCUy3daTgq\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe5bb0f57cff3e299f360052ba50f1ea0fff046df2be070b6943e0e3c3fdad8a9\",\"urls\":[\"bzz-raw://59fd025151435da35faa8093a5c7a17de02de9d08ad27275c5cdf05050820d91\",\"dweb:/ipfs/QmQMvwEcPhoRXzbXyrdoeRtvLoifUW9Qh7Luho7bmUPRkc\"]}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b50610846806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063e5654a4c14610030575b600080fd5b6100796004803603608081101561004657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135821691604082013516906060013561007b565b005b610213818573ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156100fc57600080fd5b505afa158015610110573d6000803e3d6000fd5b505050506040513d602081101561012657600080fd5b5051604080517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff888116600483015291519390921015927f5465737450617261737761705472616e7366657250726f787900000000000000927f696e73756666696369656e742062616c616e6365000000000000000000000000928a16916370a0823191602480820192602092909190829003018186803b1580156101e157600080fd5b505afa1580156101f5573d6000803e3d6000fd5b505050506040513d602081101561020b57600080fd5b5051856102d5565b806101a4141561022257600080fd5b604080517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301528481166024830152604482018490529151918616916323b872dd916064808201926020929091908290030181600087803b1580156102a357600080fd5b505af11580156102b7573d6000803e3d6000fd5b505050506040513d60208110156102cd57600080fd5b505050505050565b84610689576102e384610690565b7f3a2000000000000000000000000000000000000000000000000000000000000061030d85610690565b7f203c00000000000000000000000000000000000000000000000000000000000061033786610720565b7f2c2000000000000000000000000000000000000000000000000000000000000061036187610720565b603e60f81b6040516020018089805190602001908083835b602083106103b657805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610379565b51815160209384036101000a60001901801990921691161790527fffff0000000000000000000000000000000000000000000000000000000000008c169190930190815289516002909101928a0191508083835b6020831061044757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161040a565b51815160209384036101000a60001901801990921691161790527fffff0000000000000000000000000000000000000000000000000000000000008a16919093019081528751600290910192880191508083835b602083106104d857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161049b565b51815160209384036101000a60001901801990921691161790527fffff0000000000000000000000000000000000000000000000000000000000008816919093019081528551600290910192860191508083835b6020831061056957805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161052c565b51815160209384036101000a60001901801990921691161790527fff0000000000000000000000000000000000000000000000000000000000000095909516920191825250604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe101815260018301918290527f08c379a00000000000000000000000000000000000000000000000000000000090915260058201848152815160258401528151919b5099508998506045909101965091890194509092508291508490508360005b8381101561064e578181015183820152602001610636565b50505050905090810190601f16801561067b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5050505050565b6040805160208082018490528251808303820181529183019092526060915b8015610707578151600019909101908290829081106106ca57fe5b01602001517fff000000000000000000000000000000000000000000000000000000000000001615610702576001018152905061071b565b6106af565b505060408051600081526020810190915290505b919050565b606081610761575060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015261071b565b8160005b811561077957600101600a82049150610765565b6060816040519080825280601f01601f1916602001820160405280156107a6576020820181803883390190505b508593509050815b80156108085760001901600a840660300160f81b8282815181106107ce57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a840493506107ae565b5094935050505056fea265627a7a7231582096d2479eaf32689ab1ca151728e1fef44b8798a5a30b2b30e370939281e787ff64736f6c63430005100032", "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063e5654a4c14610030575b600080fd5b6100796004803603608081101561004657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135821691604082013516906060013561007b565b005b610213818573ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156100fc57600080fd5b505afa158015610110573d6000803e3d6000fd5b505050506040513d602081101561012657600080fd5b5051604080517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff888116600483015291519390921015927f5465737450617261737761705472616e7366657250726f787900000000000000927f696e73756666696369656e742062616c616e6365000000000000000000000000928a16916370a0823191602480820192602092909190829003018186803b1580156101e157600080fd5b505afa1580156101f5573d6000803e3d6000fd5b505050506040513d602081101561020b57600080fd5b5051856102d5565b806101a4141561022257600080fd5b604080517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301528481166024830152604482018490529151918616916323b872dd916064808201926020929091908290030181600087803b1580156102a357600080fd5b505af11580156102b7573d6000803e3d6000fd5b505050506040513d60208110156102cd57600080fd5b505050505050565b84610689576102e384610690565b7f3a2000000000000000000000000000000000000000000000000000000000000061030d85610690565b7f203c00000000000000000000000000000000000000000000000000000000000061033786610720565b7f2c2000000000000000000000000000000000000000000000000000000000000061036187610720565b603e60f81b6040516020018089805190602001908083835b602083106103b657805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610379565b51815160209384036101000a60001901801990921691161790527fffff0000000000000000000000000000000000000000000000000000000000008c169190930190815289516002909101928a0191508083835b6020831061044757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161040a565b51815160209384036101000a60001901801990921691161790527fffff0000000000000000000000000000000000000000000000000000000000008a16919093019081528751600290910192880191508083835b602083106104d857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161049b565b51815160209384036101000a60001901801990921691161790527fffff0000000000000000000000000000000000000000000000000000000000008816919093019081528551600290910192860191508083835b6020831061056957805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161052c565b51815160209384036101000a60001901801990921691161790527fff0000000000000000000000000000000000000000000000000000000000000095909516920191825250604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe101815260018301918290527f08c379a00000000000000000000000000000000000000000000000000000000090915260058201848152815160258401528151919b5099508998506045909101965091890194509092508291508490508360005b8381101561064e578181015183820152602001610636565b50505050905090810190601f16801561067b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5050505050565b6040805160208082018490528251808303820181529183019092526060915b8015610707578151600019909101908290829081106106ca57fe5b01602001517fff000000000000000000000000000000000000000000000000000000000000001615610702576001018152905061071b565b6106af565b505060408051600081526020810190915290505b919050565b606081610761575060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015261071b565b8160005b811561077957600101600a82049150610765565b6060816040519080825280601f01601f1916602001820160405280156107a6576020820181803883390190505b508593509050815b80156108085760001901600a840660300160f81b8282815181106107ce57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a840493506107ae565b5094935050505056fea265627a7a7231582096d2479eaf32689ab1ca151728e1fef44b8798a5a30b2b30e370939281e787ff64736f6c63430005100032", "sourceMap": "723:776:134:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;723:776:134;;;;;;;", "deployedSourceMap": "723:776:134:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;723:776:134;;;;;;;;;;;;;;;;;;;980:517;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;980:517:134;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;1118:204;1182:7;1154:6;1144:27;;;1172:5;1144:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1144:34:134;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1144:34:134;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1144:34:134;1257;;;;;;:27;:34;;;;;;;;;1144:45;;;;;;1203:4;;1118:204;;1257:27;;;;;:34;;;;;1144;;1257;;;;;;;;:27;:34;;;5:2:-1;;;;30:1;27;20:12;5:2;1257:34:134;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1257:34:134;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1257:34:134;1305:7;1118:12;:204::i;:::-;1336:7;1347:3;1336:14;1332:98;;;1366:8;;;1332:98;1439:51;;;;;;:30;:51;;;;;;;;;;;;;;;;;;;;;;:30;;;;;;:51;;;;;;;;;;;;;;;-1:-1:-1;1439:30:134;:51;;;5:2:-1;;;;30:1;27;20:12;5:2;1439:51:134;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1439:51:134;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;980:517:134:o;2293:663:99:-;2479:4;2474:476;;2593:24;2612:4;2593:18;:24::i;:::-;2643:5;2674:26;2693:6;2674:18;:26::i;:::-;2726:6;2758:19;2768:8;2758:9;:19::i;:::-;2803:5;2834:19;2844:8;2834:9;:19::i;:::-;1182:4;2879:6;;2551:356;;;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;2551:356:99;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2551:356:99;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;2551:356:99;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2551:356:99;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;2551:356:99;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2551:356:99;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;139:12;;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;2551:356:99;;;;;;;;;;-1:-1:-1;2551:356:99;;;26:21:-1;;;22:32;;6:49;;274:1;2551:356:99;;;;;;2499:440;;;;;;;;;;;;;;;;;;2551:356;;-1:-1:-1;2499:440:99;-1:-1:-1;2499:440:99;;-1:-1:-1;2499:440:99;;;;;-1:-1:-1;2499:440:99;;;;-1:-1:-1;2499:440:99;;-1:-1:-1;2499:440:99;;-1:-1:-1;2499:440:99;;-1:-1:-1;2499:440:99;-1:-1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;2499:440:99;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2474:476;2293:663;;;;;:::o;6359:968::-;6560:23;;;;;;;;;;;;26:21:-1;;;22:32;;6:49;;6560:23:99;;;;;;6463:12;;6689:572;6710:6;;6689:572;;6962:9;;-1:-1:-1;;6864:3:99;;;;6962:6;;6864:3;;6962:9;;;;;;;;;;;;:14;6958:293;;7017:1;7013:5;7143:22;;7150:6;-1:-1:-1;7223:13:99;;6958:293;6689:572;;;-1:-1:-1;;7308:12:99;;;7318:1;7308:12;;;;;;;;;-1:-1:-1;6359:968:99;;;;:::o;7333:913::-;7427:12;7459:10;7455:51;;-1:-1:-1;7485:10:99;;;;;;;;;;;;;;;;;;;7455:51;7567:5;7555:9;7606:69;7613:6;;7606:69;;7635:8;;7662:2;7657:7;;;;7606:69;;;7716:17;7746:6;7736:17;;;;;;;;;;;;;;;;;;;;;;;;;21:6:-1;;104:10;7736:17:99;87:34:-1;135:17;;-1:-1;7736:17:99;-1:-1:-1;7845:5:99;;-1:-1:-1;7716:37:99;-1:-1:-1;7877:6:99;7860:358;7885:6;;7860:358;;-1:-1:-1;;8039:3:99;8135:2;8131:1;:6;902:2;8117:21;8106:34;;8096:4;8101:1;8096:7;;;;;;;;;;;:44;;;;;;;;;;-1:-1:-1;8205:2:99;8200:7;;;;7860:358;;;-1:-1:-1;8235:4:99;7333:913;-1:-1:-1;;;;7333:913:99:o", "source": "/*\n\n Copyright 2022 Dolomite.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.5.7;\n\nimport { Require } from \"../protocol/lib/Require.sol\";\n\nimport { TestToken } from \"./TestToken.sol\";\n\n\ncontract TestParaswapTransferProxy {\n\n bytes32 private constant FILE = \"TestParaswapTransferProxy\";\n\n /**\n * This function is called blindly by `LiquidatorProxyV2WithExternalLiquidity` via the pass through \"_paraswapCalldata\" variable\n */\n function doTransfer(\n address _token,\n address _from,\n address _to,\n uint256 _amount\n ) external {\n Require.that(\n TestToken(_token).balanceOf(_from) >= _amount,\n FILE,\n \"insufficient balance\",\n TestToken(_token).balanceOf(_from),\n _amount\n );\n if (_amount == 420) {\n revert(); // fail silently to test the \"no msg\" branch\n }\n TestToken(_token).transferFrom(_from, _to, _amount);\n }\n}\n", "sourcePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestParaswapTransferProxy.sol", "ast": { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestParaswapTransferProxy.sol", "exportedSymbols": { "TestParaswapTransferProxy": [ 36109 ] }, "id": 36110, "nodeType": "SourceUnit", "nodes": [ { "id": 36050, "literals": [ "solidity", "^", "0.5", ".7" ], "nodeType": "PragmaDirective", "src": "595:23:134" }, { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Require.sol", "file": "../protocol/lib/Require.sol", "id": 36052, "nodeType": "ImportDirective", "scope": 36110, "sourceUnit": 28453, "src": "620:54:134", "symbolAliases": [ { "foreign": 36051, "local": null } ], "unitAlias": "" }, { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestToken.sol", "file": "./TestToken.sol", "id": 36054, "nodeType": "ImportDirective", "scope": 36110, "sourceUnit": 36717, "src": "676:44:134", "symbolAliases": [ { "foreign": 36053, "local": null } ], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 36109, "linearizedBaseContracts": [ 36109 ], "name": "TestParaswapTransferProxy", "nodeType": "ContractDefinition", "nodes": [ { "constant": true, "id": 36057, "name": "FILE", "nodeType": "VariableDeclaration", "scope": 36109, "src": "765:59:134", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 36055, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "765:7:134", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": { "argumentTypes": null, "hexValue": "5465737450617261737761705472616e7366657250726f7879", "id": 36056, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "797:27:134", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_ccefc7cb6d9f0d03a4694d603647bb202ac92b5cc42ce4a069fa58a094440582", "typeString": "literal_string \"TestParaswapTransferProxy\"" }, "value": "TestParaswapTransferProxy" }, "visibility": "private" }, { "body": { "id": 36107, "nodeType": "Block", "src": "1108:389:134", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 36078, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 36075, "name": "_from", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 36061, "src": "1172:5:134", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 36072, "name": "_token", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 36059, "src": "1154:6:134", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 36071, "name": "TestToken", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 36716, "src": "1144:9:134", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_TestToken_$36716_$", "typeString": "type(contract TestToken)" } }, "id": 36073, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1144:17:134", "typeDescriptions": { "typeIdentifier": "t_contract$_TestToken_$36716", "typeString": "contract TestToken" } }, "id": 36074, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "balanceOf", "nodeType": "MemberAccess", "referencedDeclaration": 36507, "src": "1144:27:134", "typeDescriptions": { "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", "typeString": "function (address) view external returns (uint256)" } }, "id": 36076, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1144:34:134", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "id": 36077, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 36065, "src": "1182:7:134", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1144:45:134", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "id": 36079, "name": "FILE", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 36057, "src": "1203:4:134", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "hexValue": "696e73756666696369656e742062616c616e6365", "id": 36080, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1221:22:134", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_a6d1ff1db3d0b9b8c60e12ccab5ce7431be9a2cd0518ac362f1c5c1e0b1cefee", "typeString": "literal_string \"insufficient balance\"" }, "value": "insufficient balance" }, { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 36085, "name": "_from", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 36061, "src": "1285:5:134", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 36082, "name": "_token", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 36059, "src": "1267:6:134", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 36081, "name": "TestToken", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 36716, "src": "1257:9:134", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_TestToken_$36716_$", "typeString": "type(contract TestToken)" } }, "id": 36083, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1257:17:134", "typeDescriptions": { "typeIdentifier": "t_contract$_TestToken_$36716", "typeString": "contract TestToken" } }, "id": 36084, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "balanceOf", "nodeType": "MemberAccess", "referencedDeclaration": 36507, "src": "1257:27:134", "typeDescriptions": { "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", "typeString": "function (address) view external returns (uint256)" } }, "id": 36086, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1257:34:134", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 36087, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 36065, "src": "1305:7:134", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, { "typeIdentifier": "t_stringliteral_a6d1ff1db3d0b9b8c60e12ccab5ce7431be9a2cd0518ac362f1c5c1e0b1cefee", "typeString": "literal_string \"insufficient balance\"" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "argumentTypes": null, "id": 36068, "name": "Require", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 28452, "src": "1118:7:134", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Require_$28452_$", "typeString": "type(library Require)" } }, "id": 36070, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "that", "nodeType": "MemberAccess", "referencedDeclaration": 27894, "src": "1118:12:134", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_bool_$_t_bytes32_$_t_bytes32_$_t_uint256_$_t_uint256_$returns$__$", "typeString": "function (bool,bytes32,bytes32,uint256,uint256) pure" } }, "id": 36088, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1118:204:134", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 36089, "nodeType": "ExpressionStatement", "src": "1118:204:134" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 36092, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 36090, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 36065, "src": "1336:7:134", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "hexValue": "343230", "id": 36091, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1347:3:134", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_420_by_1", "typeString": "int_const 420" }, "value": "420" }, "src": "1336:14:134", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 36097, "nodeType": "IfStatement", "src": "1332:98:134", "trueBody": { "id": 36096, "nodeType": "Block", "src": "1352:78:134", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 36093, "name": "revert", "nodeType": "Identifier", "overloadedDeclarations": [ 38112, 38113 ], "referencedDeclaration": 38112, "src": "1366:6:134", "typeDescriptions": { "typeIdentifier": "t_function_revert_pure$__$returns$__$", "typeString": "function () pure" } }, "id": 36094, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1366:8:134", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 36095, "nodeType": "ExpressionStatement", "src": "1366:8:134" } ] } }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 36102, "name": "_from", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 36061, "src": "1470:5:134", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "argumentTypes": null, "id": 36103, "name": "_to", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 36063, "src": "1477:3:134", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "argumentTypes": null, "id": 36104, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 36065, "src": "1482:7:134", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" }, { "typeIdentifier": "t_address", "typeString": "address" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 36099, "name": "_token", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 36059, "src": "1449:6:134", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 36098, "name": "TestToken", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 36716, "src": "1439:9:134", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_TestToken_$36716_$", "typeString": "type(contract TestToken)" } }, "id": 36100, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1439:17:134", "typeDescriptions": { "typeIdentifier": "t_contract$_TestToken_$36716", "typeString": "contract TestToken" } }, "id": 36101, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "transferFrom", "nodeType": "MemberAccess", "referencedDeclaration": 36687, "src": "1439:30:134", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", "typeString": "function (address,address,uint256) external returns (bool)" } }, "id": 36105, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1439:51:134", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 36106, "nodeType": "ExpressionStatement", "src": "1439:51:134" } ] }, "documentation": "This function is called blindly by `LiquidatorProxyV2WithExternalLiquidity` via the pass through \"_paraswapCalldata\" variable", "id": 36108, "implemented": true, "kind": "function", "modifiers": [], "name": "doTransfer", "nodeType": "FunctionDefinition", "parameters": { "id": 36066, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 36059, "name": "_token", "nodeType": "VariableDeclaration", "scope": 36108, "src": "1009:14:134", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 36058, "name": "address", "nodeType": "ElementaryTypeName", "src": "1009:7:134", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 36061, "name": "_from", "nodeType": "VariableDeclaration", "scope": 36108, "src": "1033:13:134", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 36060, "name": "address", "nodeType": "Elem