@dolomite-exchange/dolomite-margin
Version:
Ethereum Smart Contracts and TypeScript library used for the DolomiteMargin trading protocol
1,092 lines (1,091 loc) • 65.6 kB
JSON
{
"contractName": "TestParaswapAugustusRouter",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_transferProxy",
"type": "address"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"constant": true,
"inputs": [],
"name": "TRANSFER_PROXY",
"outputs": [
{
"internalType": "contract TestParaswapTransferProxy",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "tokenIn",
"type": "address"
},
{
"internalType": "uint256",
"name": "amountIn",
"type": "uint256"
},
{
"internalType": "address",
"name": "tokenOut",
"type": "address"
},
{
"internalType": "uint256",
"name": "amountOut",
"type": "uint256"
}
],
"name": "call",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_transferProxy\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"constant\":true,\"inputs\":[],\"name\":\"TRANSFER_PROXY\",\"outputs\":[{\"internalType\":\"contract TestParaswapTransferProxy\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"call\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{\"call(address,uint256,address,uint256)\":{\"notice\":\"This function is called blindly via the pass-through `_paraswapCalldata` variable\"}}}},\"settings\":{\"compilationTarget\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestParaswapAugustusRouter.sol\":\"TestParaswapAugustusRouter\"},\"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/TestParaswapAugustusRouter.sol\":{\"keccak256\":\"0x0b29a8587ca7b2663a94ea7dbf09d03cf024585ef64331a714a764095b3d4e45\",\"urls\":[\"bzz-raw://63e6f51bf85f1e4e97aaf5120df26379fc83e72882e98c79ec2982c05c11c764\",\"dweb:/ipfs/QmNWkFRrYK8eEZrVQnYqnbv8BYkQjSDEueA8ftqTvqLvRf\"]},\"/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": "0x608060405234801561001057600080fd5b506040516102993803806102998339818101604052602081101561003357600080fd5b5051600080546001600160a01b039092166001600160a01b0319909216919091179055610234806100656000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80632fd077c51461003b57806396d6401d14610084575b600080fd5b6100826004803603608081101561005157600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359160408201351690606001356100b5565b005b61008c6101e3565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b60008054604080517fe5654a4c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152336024830152306044830152606482018890529151919092169263e5654a4c926084808201939182900301818387803b15801561013957600080fd5b505af115801561014d573d6000803e3d6000fd5b5050604080517f21e5383a00000000000000000000000000000000000000000000000000000000815233600482015260248101859052905173ffffffffffffffffffffffffffffffffffffffff861693506321e5383a9250604480830192600092919082900301818387803b1580156101c557600080fd5b505af11580156101d9573d6000803e3d6000fd5b5050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff168156fea265627a7a72315820010b0ac6384e35daed1b179b917725562b3a36ed6708bb467c7a08d1a56de89e64736f6c63430005100032",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80632fd077c51461003b57806396d6401d14610084575b600080fd5b6100826004803603608081101561005157600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359160408201351690606001356100b5565b005b61008c6101e3565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b60008054604080517fe5654a4c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152336024830152306044830152606482018890529151919092169263e5654a4c926084808201939182900301818387803b15801561013957600080fd5b505af115801561014d573d6000803e3d6000fd5b5050604080517f21e5383a00000000000000000000000000000000000000000000000000000000815233600482015260248101859052905173ffffffffffffffffffffffffffffffffffffffff861693506321e5383a9250604480830192600092919082900301818387803b1580156101c557600080fd5b505af11580156101d9573d6000803e3d6000fd5b5050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff168156fea265627a7a72315820010b0ac6384e35daed1b179b917725562b3a36ed6708bb467c7a08d1a56de89e64736f6c63430005100032",
"sourceMap": "744:612:132:-;;;841:118;8:9:-1;5:2;;;30:1;27;20:12;5:2;841:118:132;;;;;;;;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;841:118:132;894:14;:58;;-1:-1:-1;;;;;894:58:132;;;-1:-1:-1;;;;;;894:58:132;;;;;;;;;744:612;;;;;;",
"deployedSourceMap": "744:612:132:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;744:612:132;;;;;;;;;;;;;;;;;;;;;;;;1070:284;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;1070:284:132;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;787:47;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1070:284;1213:14;;;:71;;;;;;:14;:71;;;;;;;1248:10;1213:71;;;;1268:4;1213:71;;;;;;;;;;;;:14;;;;;:25;;:71;;;;;;;;;;;:14;;:71;;;5:2:-1;;;;30:1;27;20:12;5:2;1213:71:132;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;1294:53:132;;;;;;1325:10;1294:53;;;;;;;;;;;;:30;;;;-1:-1:-1;1294:30:132;;-1:-1:-1;1294:53:132;;;;;-1:-1:-1;;1294:53:132;;;;;;;-1:-1:-1;1294:30:132;:53;;;5:2:-1;;;;30:1;27;20:12;5:2;1294:53:132;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1294:53:132;;;;1070:284;;;;:::o;787:47::-;;;;;;:::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 { TestParaswapTransferProxy } from \"./TestParaswapTransferProxy.sol\";\nimport { TestToken } from \"./TestToken.sol\";\n\n\ncontract TestParaswapAugustusRouter {\n\n TestParaswapTransferProxy public TRANSFER_PROXY;\n\n constructor(address _transferProxy) public {\n TRANSFER_PROXY = TestParaswapTransferProxy(_transferProxy);\n }\n\n /**\n * This function is called blindly via the pass-through `_paraswapCalldata` variable\n */\n function call(\n address tokenIn,\n uint256 amountIn,\n address tokenOut,\n uint256 amountOut\n ) external {\n TRANSFER_PROXY.doTransfer(tokenIn, msg.sender, address(this), amountIn);\n TestToken(tokenOut).addBalance(msg.sender, amountOut);\n }\n}\n",
"sourcePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestParaswapAugustusRouter.sol",
"ast": {
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestParaswapAugustusRouter.sol",
"exportedSymbols": {
"TestParaswapAugustusRouter": [
35835
]
},
"id": 35836,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 35783,
"literals": [
"solidity",
"^",
"0.5",
".7"
],
"nodeType": "PragmaDirective",
"src": "595:23:132"
},
{
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestParaswapTransferProxy.sol",
"file": "./TestParaswapTransferProxy.sol",
"id": 35785,
"nodeType": "ImportDirective",
"scope": 35836,
"sourceUnit": 36110,
"src": "620:76:132",
"symbolAliases": [
{
"foreign": 35784,
"local": null
}
],
"unitAlias": ""
},
{
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestToken.sol",
"file": "./TestToken.sol",
"id": 35787,
"nodeType": "ImportDirective",
"scope": 35836,
"sourceUnit": 36717,
"src": "697:44:132",
"symbolAliases": [
{
"foreign": 35786,
"local": null
}
],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 35835,
"linearizedBaseContracts": [
35835
],
"name": "TestParaswapAugustusRouter",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 35789,
"name": "TRANSFER_PROXY",
"nodeType": "VariableDeclaration",
"scope": 35835,
"src": "787:47:132",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TestParaswapTransferProxy_$36109",
"typeString": "contract TestParaswapTransferProxy"
},
"typeName": {
"contractScope": null,
"id": 35788,
"name": "TestParaswapTransferProxy",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 36109,
"src": "787:25:132",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TestParaswapTransferProxy_$36109",
"typeString": "contract TestParaswapTransferProxy"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 35800,
"nodeType": "Block",
"src": "884:75:132",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 35798,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 35794,
"name": "TRANSFER_PROXY",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 35789,
"src": "894:14:132",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TestParaswapTransferProxy_$36109",
"typeString": "contract TestParaswapTransferProxy"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 35796,
"name": "_transferProxy",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 35791,
"src": "937:14:132",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 35795,
"name": "TestParaswapTransferProxy",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 36109,
"src": "911:25:132",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_TestParaswapTransferProxy_$36109_$",
"typeString": "type(contract TestParaswapTransferProxy)"
}
},
"id": 35797,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "911:41:132",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TestParaswapTransferProxy_$36109",
"typeString": "contract TestParaswapTransferProxy"
}
},
"src": "894:58:132",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TestParaswapTransferProxy_$36109",
"typeString": "contract TestParaswapTransferProxy"
}
},
"id": 35799,
"nodeType": "ExpressionStatement",
"src": "894:58:132"
}
]
},
"documentation": null,
"id": 35801,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 35792,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 35791,
"name": "_transferProxy",
"nodeType": "VariableDeclaration",
"scope": 35801,
"src": "853:22:132",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 35790,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "853:7:132",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "852:24:132"
},
"returnParameters": {
"id": 35793,
"nodeType": "ParameterList",
"parameters": [],
"src": "884:0:132"
},
"scope": 35835,
"src": "841:118:132",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 35833,
"nodeType": "Block",
"src": "1203:151:132",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 35815,
"name": "tokenIn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 35803,
"src": "1239:7:132",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 35816,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 38107,
"src": "1248:3:132",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 35817,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1248:10:132",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 35819,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 38407,
"src": "1268:4:132",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TestParaswapAugustusRouter_$35835",
"typeString": "contract TestParaswapAugustusRouter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_TestParaswapAugustusRouter_$35835",
"typeString": "contract TestParaswapAugustusRouter"
}
],
"id": 35818,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1260:7:132",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 35820,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1260:13:132",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 35821,
"name": "amountIn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 35805,
"src": "1275:8:132",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 35812,
"name": "TRANSFER_PROXY",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 35789,
"src": "1213:14:132",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TestParaswapTransferProxy_$36109",
"typeString": "contract TestParaswapTransferProxy"
}
},
"id": 35814,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "doTransfer",
"nodeType": "MemberAccess",
"referencedDeclaration": 36108,
"src": "1213:25:132",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,address,address,uint256) external"
}
},
"id": 35822,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1213:71:132",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 35823,
"nodeType": "ExpressionStatement",
"src": "1213:71:132"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 35828,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 38107,
"src": "1325:3:132",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 35829,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1325:10:132",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 35830,
"name": "amountOut",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 35809,
"src": "1337:9:132",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 35825,
"name": "tokenOut",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 35807,
"src": "1304:8:132",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 35824,
"name": "TestToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 36716,
"src": "1294:9:132",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_TestToken_$36716_$",
"typeString": "type(contract TestToken)"
}
},
"id": 35826,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1294:19:132",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TestToken_$36716",
"typeString": "contract TestToken"
}
},
"id": 35827,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "addBalance",
"nodeType": "MemberAccess",
"referencedDeclaration": 36453,
"src": "1294:30:132",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256) external"
}
},
"id": 35831,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1294:53:132",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 35832,
"nodeType": "ExpressionStatement",
"src": "1294:53:132"
}
]
},
"documentation": "This function is called blindly via the pass-through `_paraswapCalldata` variable",
"id": 35834,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "call",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 35810,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 35803,
"name": "tokenIn",
"nodeType": "VariableDeclaration",
"scope": 35834,
"src": "1093:15:132",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 35802,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1093:7:132",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 35805,
"name": "amountIn",
"nodeType": "VariableDeclaration",
"scope": 35834,
"src": "1118:16:132",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 35804,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1118:7:132",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 35807,
"name": "tokenOut",
"nodeType": "VariableDeclaration",
"scope": 35834,
"src": "1144:16:132",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 35806,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1144:7:132",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 35809,
"name": "amountOut",
"nodeType": "VariableDeclaration",
"scope": 35834,
"src": "1170:17:132",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 35808,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1170:7:132",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1083:110:132"
},
"returnParameters": {
"id": 35811,
"nodeType": "ParameterList",
"parameters": [],
"src": "1203:0:132"
},
"scope": 35835,
"src": "1070:284:132",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
}
],
"scope": 35836,
"src": "744:612:132"
}
],
"src": "595:762:132"
},
"legacyAST": {
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestParaswapAugustusRouter.sol",
"exportedSymbols": {
"TestParaswapAugustusRouter": [
35835
]
},
"id": 35836,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 35783,
"literals": [
"solidity",
"^",
"0.5",
".7"
],
"nodeType": "PragmaDirective",
"src": "595:23:132"
},
{
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestParaswapTransferProxy.sol",
"file": "./TestParaswapTransferProxy.sol",
"id": 35785,
"nodeType": "ImportDirective",
"scope": 35836,
"sourceUnit": 36110,
"src": "620:76:132",
"symbolAliases": [
{
"foreign": 35784,
"local": null
}
],
"unitAlias": ""
},
{
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestToken.sol",
"file": "./TestToken.sol",
"id": 35787,
"nodeType": "ImportDirective",
"scope": 35836,
"sourceUnit": 36717,
"src": "697:44:132",
"symbolAliases": [
{
"foreign": 35786,
"local": null
}
],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 35835,
"linearizedBaseContracts": [
35835
],
"name": "TestParaswapAugustusRouter",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 35789,
"name": "TRANSFER_PROXY",
"nodeType": "VariableDeclaration",
"scope": 35835,
"src": "787:47:132",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TestParaswapTransferProxy_$36109",
"typeString": "contract TestParaswapTransferProxy"
},
"typeName": {
"contractScope": null,
"id": 35788,
"name": "TestParaswapTransferProxy",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 36109,
"src": "787:25:132",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TestParaswapTransferProxy_$36109",
"typeString": "contract TestParaswapTransferProxy"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 35800,
"nodeType": "Block",
"src": "884:75:132",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 35798,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 35794,
"name": "TRANSFER_PROXY",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 35789,
"src": "894:14:132",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TestParaswapTransferProxy_$36109",
"typeString": "contract TestParaswapTransferProxy"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 35796,
"name": "_transferProxy",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 35791,
"src": "937:14:132",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 35795,
"name": "TestParaswapTransferProxy",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 36109,
"src": "911:25:132",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_TestParaswapTransferProxy_$36109_$",
"typeString": "type(contract TestParaswapTransferProxy)"
}
},
"id": 35797,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "911:41:132",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TestParaswapTransferProxy_$36109",
"typeString": "contract TestParaswapTransferProxy"
}
},
"src": "894:58:132",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TestParaswapTransferProxy_$36109",
"typeString": "contract TestParaswapTransferProxy"
}
},
"id": 35799,
"nodeType": "ExpressionStatement",
"src": "894:58:132"
}
]
},
"documentation": null,
"id": 35801,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 35792,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 35791,
"name": "_transferProxy",
"nodeType": "VariableDeclaration",
"scope": 35801,
"src": "853:22:132",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 35790,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "853:7:132",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "852:24:132"
},
"returnParameters": {
"id": 35793,
"nodeType": "ParameterList",
"parameters": [],
"src": "884:0:132"
},
"scope": 35835,
"src": "841:118:132",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 35833,
"nodeType": "Block",
"src": "1203:151:132",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 35815,
"name": "tokenIn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 35803,
"src": "1239:7:132",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 35816,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 38107,
"src": "1248:3:132",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 35817,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1248:10:132",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 35819,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 38407,
"src": "1268:4:132",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TestParaswapAugustusRouter_$35835",
"typeString": "contract TestParaswapAugustusRouter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_TestParaswapAugustusRouter_$35835",
"typeString": "contract TestParaswapAugustusRouter"
}
],
"id": 35818,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1260:7:132",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"