moonwalkerswap-v2-periphery
Version:
Moonwalkerswap v2 periphery
802 lines • 239 kB
JSON
{
"contractName": "MoonwalkerswapV2Migrator",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_factoryV1",
"type": "address"
},
{
"internalType": "address",
"name": "_router",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"stateMutability": "payable",
"type": "receive"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint256",
"name": "amountTokenMin",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountETHMin",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "migrate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.6.6+commit.6c089d02\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factoryV1\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_router\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountTokenMin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountETHMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"migrate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/Moonwalkerswap-v2-periphery/contracts/MoonwalkerswapV2Migrator.sol\":\"MoonwalkerswapV2Migrator\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/Moonwalkerswap-v2-periphery/contracts/MoonwalkerswapV2Migrator.sol\":{\"keccak256\":\"0x18db3b0af2a7762501ba9d120831c0c2b42784f527781b1b33bf1fe36d60f73a\",\"urls\":[\"bzz-raw://f80d9c0082ba979380372df82bd891e0687b00ac790e4d745179dfcc1d463aef\",\"dweb:/ipfs/QmfPRxUHSNmqdrVgFAov6Yv5CZ3ybgSuGkwARXWcASFs6R\"]},\"/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/Moonwalkerswap-v2-periphery/contracts/interfaces/IERC20.sol\":{\"keccak256\":\"0x61db17aebc5d812c7002d15c1da954065e56abe49d64b14c034abe5604d70eb3\",\"urls\":[\"bzz-raw://b006685e753f9120469f10b09c159f222d4cb8b507a6c1f0c14ed50c883ebe66\",\"dweb:/ipfs/QmSyY7iTugbczPwfGK67etiyPULenYGzzRYbt8aabwwkUb\"]},\"/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/Moonwalkerswap-v2-periphery/contracts/interfaces/IMoonwalkerswapV2Migrator.sol\":{\"keccak256\":\"0x38d7aea5942b3e335de97be62433ce7bef345fe49bcebb946b6c676a69bb2ab6\",\"urls\":[\"bzz-raw://de004ccf513484acfb2b7af9f9f7453d3caa3471b44d9f0daa9db9a4dff40590\",\"dweb:/ipfs/QmNWDZomMPBFnGse9CLyqGUn7Rbu326Ys7mZwPGvkAxJ9D\"]},\"/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/Moonwalkerswap-v2-periphery/contracts/interfaces/IMoonwalkerswapV2Router01.sol\":{\"keccak256\":\"0xca122eb08288a7222f98a734e2ad9a338bf02293d0894dc7f1d8dcbd808eef4c\",\"urls\":[\"bzz-raw://1c596c0213ac56f727eaaa15208e68a61a3eabd5351a59de7cabc171213faa8f\",\"dweb:/ipfs/QmPCMAZUk5uuQAHWyBQ68kPhdSUcecQDctvfaUHDaNT28K\"]},\"/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/Moonwalkerswap-v2-periphery/contracts/interfaces/V1/IMoonwalkerswapV1Exchange.sol\":{\"keccak256\":\"0x2788c69fa93f52896bb4eaf5eba53f1a3a6f0ad6bf279638e6a4ba4654f32849\",\"urls\":[\"bzz-raw://3ddd98f3b9f1575bf1aadfcd871e466bd9b604d7bcce4eef78c02d18caab26bf\",\"dweb:/ipfs/QmbQtYPJYcZBLYJGBRoaLKHj6HhnQ4EKV4X3348KfooNXm\"]},\"/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/Moonwalkerswap-v2-periphery/contracts/interfaces/V1/IMoonwalkerswapV1Factory.sol\":{\"keccak256\":\"0xbfb8fca4335994a5042028071385b1d21e186ea3bacc102ec75875bf78e68741\",\"urls\":[\"bzz-raw://1f707903f7366258f445367f29231c910854a47771c2ca21315fd36cdf906b55\",\"dweb:/ipfs/QmXHz64F3abcEVPUaQTYkWbJQNp1xwzyXGhzWaQLsF39rc\"]},\"moonwalkerswap-libraries/contracts/libraries/TransferHelper.sol\":{\"keccak256\":\"0xaff99b54915f57e2a4e71b8d15afd4ee425410e5a6f45c07517ae1beb806f8bd\",\"urls\":[\"bzz-raw://15432ec031f4cfa6709921289e198b030a0c5eac75b5a3e0eb64827a2b3b5595\",\"dweb:/ipfs/QmZvR1KuuDvuzXFiADCngTKyMCTy31uhq9U6CazP59B55j\"]}},\"version\":1}",
"bytecode": "0x60c060405234801561001057600080fd5b506040516109443803806109448339818101604052604081101561003357600080fd5b5080516020909101516001600160601b0319606092831b8116608052911b1660a05260805160601c60a05160601c6108bd6100876000398061030752806103775280610409525080608352506108bd6000f3fe6080604052600436106100225760003560e01c8063b7df1d251461002e57610029565b3661002957005b600080fd5b34801561003a57600080fd5b5061007d600480360360a081101561005157600080fd5b506001600160a01b0381358116916020810135916040820135916060810135909116906080013561007f565b005b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166306f2bf62876040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b1580156100f757600080fd5b505afa15801561010b573d6000803e3d6000fd5b505050506040513d602081101561012157600080fd5b5051604080516370a0823160e01b815233600482015290519192506000916001600160a01b038416916370a08231916024808301926020929190829003018186803b15801561016f57600080fd5b505afa158015610183573d6000803e3d6000fd5b505050506040513d602081101561019957600080fd5b5051604080516323b872dd60e01b81523360048201523060248201526044810183905290519192506001600160a01b038416916323b872dd916064808201926020929091908290030181600087803b1580156101f457600080fd5b505af1158015610208573d6000803e3d6000fd5b505050506040513d602081101561021e57600080fd5b5051610268576040805162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b604482015290519081900360640190fd5b60408051637c45f8ad60e11b81526004810183905260016024820181905260448201526000196064820152815160009283926001600160a01b0387169263f88bf15a9260848084019391929182900301818787803b1580156102c957600080fd5b505af11580156102dd573d6000803e3d6000fd5b505050506040513d60408110156102f357600080fd5b508051602090910151909250905061032c897f000000000000000000000000000000000000000000000000000000000000000083610462565b6040805163f305d71960e01b81526001600160a01b038b8116600483015260248201849052604482018b9052606482018a9052888116608483015260a48201889052915160009283927f00000000000000000000000000000000000000000000000000000000000000009091169163f305d71991879160c480830192606092919082900301818588803b1580156103c257600080fd5b505af11580156103d6573d6000803e3d6000fd5b50505050506040513d60608110156103ed57600080fd5b5080516020909101519092509050818311156104415761042f8b7f00000000000000000000000000000000000000000000000000000000000000006000610462565b61043c8b338486036105b6565b610455565b808411156104555761045533828603610703565b5050505050505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b178152925182516000946060949389169392918291908083835b602083106104df5780518252601f1990920191602091820191016104c0565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610541576040519150601f19603f3d011682016040523d82523d6000602084013e610546565b606091505b5091509150818015610574575080511580610574575080806020019051602081101561057157600080fd5b50515b6105af5760405162461bcd60e51b815260040180806020018281038252602b815260200180610830602b913960400191505060405180910390fd5b5050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b602083106106335780518252601f199092019160209182019101610614565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610695576040519150601f19603f3d011682016040523d82523d6000602084013e61069a565b606091505b50915091508180156106c85750805115806106c857508080602001905160208110156106c557600080fd5b50515b6105af5760405162461bcd60e51b815260040180806020018281038252602d81526020018061085b602d913960400191505060405180910390fd5b604080516000808252602082019092526001600160a01b0384169083906040518082805190602001908083835b6020831061074f5780518252601f199092019160209182019101610730565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146107b1576040519150601f19603f3d011682016040523d82523d6000602084013e6107b6565b606091505b50509050806107f65760405162461bcd60e51b81526004018080602001828103825260348152602001806107fc6034913960400191505060405180910390fd5b50505056fe5472616e7366657248656c7065723a3a736166655472616e736665724554483a20455448207472616e73666572206661696c65645472616e7366657248656c7065723a3a73616665417070726f76653a20617070726f7665206661696c65645472616e7366657248656c7065723a3a736166655472616e736665723a207472616e73666572206661696c6564a26469706673582212201326fb2c417c9636409a48754a8b6537195c7f1a00d30a6510100635e74c10fc64736f6c63430006060033",
"deployedBytecode": "0x6080604052600436106100225760003560e01c8063b7df1d251461002e57610029565b3661002957005b600080fd5b34801561003a57600080fd5b5061007d600480360360a081101561005157600080fd5b506001600160a01b0381358116916020810135916040820135916060810135909116906080013561007f565b005b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166306f2bf62876040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b1580156100f757600080fd5b505afa15801561010b573d6000803e3d6000fd5b505050506040513d602081101561012157600080fd5b5051604080516370a0823160e01b815233600482015290519192506000916001600160a01b038416916370a08231916024808301926020929190829003018186803b15801561016f57600080fd5b505afa158015610183573d6000803e3d6000fd5b505050506040513d602081101561019957600080fd5b5051604080516323b872dd60e01b81523360048201523060248201526044810183905290519192506001600160a01b038416916323b872dd916064808201926020929091908290030181600087803b1580156101f457600080fd5b505af1158015610208573d6000803e3d6000fd5b505050506040513d602081101561021e57600080fd5b5051610268576040805162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b604482015290519081900360640190fd5b60408051637c45f8ad60e11b81526004810183905260016024820181905260448201526000196064820152815160009283926001600160a01b0387169263f88bf15a9260848084019391929182900301818787803b1580156102c957600080fd5b505af11580156102dd573d6000803e3d6000fd5b505050506040513d60408110156102f357600080fd5b508051602090910151909250905061032c897f000000000000000000000000000000000000000000000000000000000000000083610462565b6040805163f305d71960e01b81526001600160a01b038b8116600483015260248201849052604482018b9052606482018a9052888116608483015260a48201889052915160009283927f00000000000000000000000000000000000000000000000000000000000000009091169163f305d71991879160c480830192606092919082900301818588803b1580156103c257600080fd5b505af11580156103d6573d6000803e3d6000fd5b50505050506040513d60608110156103ed57600080fd5b5080516020909101519092509050818311156104415761042f8b7f00000000000000000000000000000000000000000000000000000000000000006000610462565b61043c8b338486036105b6565b610455565b808411156104555761045533828603610703565b5050505050505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b178152925182516000946060949389169392918291908083835b602083106104df5780518252601f1990920191602091820191016104c0565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610541576040519150601f19603f3d011682016040523d82523d6000602084013e610546565b606091505b5091509150818015610574575080511580610574575080806020019051602081101561057157600080fd5b50515b6105af5760405162461bcd60e51b815260040180806020018281038252602b815260200180610830602b913960400191505060405180910390fd5b5050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b602083106106335780518252601f199092019160209182019101610614565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610695576040519150601f19603f3d011682016040523d82523d6000602084013e61069a565b606091505b50915091508180156106c85750805115806106c857508080602001905160208110156106c557600080fd5b50515b6105af5760405162461bcd60e51b815260040180806020018281038252602d81526020018061085b602d913960400191505060405180910390fd5b604080516000808252602082019092526001600160a01b0384169083906040518082805190602001908083835b6020831061074f5780518252601f199092019160209182019101610730565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146107b1576040519150601f19603f3d011682016040523d82523d6000602084013e6107b6565b606091505b50509050806107f65760405162461bcd60e51b81526004018080602001828103825260348152602001806107fc6034913960400191505060405180910390fd5b50505056fe5472616e7366657248656c7065723a3a736166655472616e736665724554483a20455448207472616e73666572206661696c65645472616e7366657248656c7065723a3a73616665417070726f76653a20617070726f7665206661696c65645472616e7366657248656c7065723a3a736166655472616e736665723a207472616e73666572206661696c6564a26469706673582212201326fb2c417c9636409a48754a8b6537195c7f1a00d30a6510100635e74c10fc64736f6c63430006060033",
"immutableReferences": {
"11": [
{
"length": 32,
"start": 131
}
],
"13": [
{
"length": 32,
"start": 775
},
{
"length": 32,
"start": 887
},
{
"length": 32,
"start": 1033
}
]
},
"sourceMap": "352:1742:0:-:0;;;520:174;5:9:-1;2:2;;;27:1;24;17:12;2:2;520:174:0;;;;;;;;;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;520:174:0;;;;;;;-1:-1:-1;;;;;;586:48:0;;;;;;;;644:43;;;;;352:1742;;;;;;;;;;;;;;;;",
"deployedSourceMap": "352:1742:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;12:1:-1;9;2:12;735:1357:0;;5:9:-1;2:2;;;27:1;24;17:12;2:2;735:1357:0;;;;;;15:3:-1;10;7:12;4:2;;;32:1;29;22:12;4:2;-1:-1;;;;;;735:1357:0;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;882:36;947:9;-1:-1:-1;;;;;947:21:0;;969:5;947:28;;;;;;;;;;;;;-1:-1:-1;;;;;947:28:0;-1:-1:-1;;;;;947:28:0;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;947:28:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;947:28:0;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;947:28:0;1005:32;;;-1:-1:-1;;;1005:32:0;;1026:10;1005:32;;;;;;947:28;;-1:-1:-1;986:16:0;;-1:-1:-1;;;;;1005:20:0;;;;;:32;;;;;947:28;;1005:32;;;;;;;:20;:32;;;2:2:-1;;;;27:1;24;17:12;2:2;1005:32:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1005:32:0;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1005:32:0;1055:63;;;-1:-1:-1;;;1055:63:0;;1079:10;1055:63;;;;1099:4;1055:63;;;;;;;;;;;;1005:32;;-1:-1:-1;;;;;;1055:23:0;;;;;:63;;;;;1005:32;;1055:63;;;;;;;;-1:-1:-1;1055:23:0;:63;;;2:2:-1;;;;27:1;24;17:12;2:2;1055:63:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1055:63:0;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1055:63:0;1047:96;;;;;-1:-1:-1;;;1047:96:0;;;;;;;;;;;;-1:-1:-1;;;1047:96:0;;;;;;;;;;;;;;;1194:55;;;-1:-1:-1;;;1194:55:0;;;;;;;;1234:1;1194:55;;;;;;;;;;-1:-1:-1;;1194:55:0;;;;;;1154:16;;;;-1:-1:-1;;;;;1194:26:0;;;;;:55;;;;;;;;;;;;;1154:16;1194:26;:55;;;2:2:-1;;;;27:1;24;17:12;2:2;1194:55:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1194:55:0;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1194:55:0;;;;;;;;;-1:-1:-1;1194:55:0;-1:-1:-1;1259:65:0;1286:5;1301:6;1194:55;1259:26;:65::i;:::-;1376:190;;;-1:-1:-1;;;1376:190:0;;-1:-1:-1;;;;;1376:190:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;1376:6:0;:22;;;;;;1406:11;;1376:190;;;;;;;;;;;;;;1406:11;1376:22;:190;;;2:2:-1;;;;27:1;24;17:12;2:2;1376:190:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1376:190:0;;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1376:190:0;;;;;;;;;-1:-1:-1;1376:190:0;-1:-1:-1;1580:29:0;;;1576:510;;;1625:53;1652:5;1667:6;1676:1;1625:26;:53::i;:::-;1746:77;1774:5;1781:10;1809:13;1793;:29;1746:27;:77::i;:::-;1576:510;;;1858:11;1844;:25;1840:246;;;2006:69;2037:10;2063:11;2049;:25;2006:30;:69::i;:::-;735:1357;;;;;;;;;;;:::o;212:434:6:-;436:45;;;-1:-1:-1;;;;;436:45:6;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;436:45:6;;;;;;;25:18:-1;;61:17;;-1:-1;;;;;182:15;-1:-1;;;179:29;160:49;;425:57:6;;;;390:12;;404:17;;425:10;;;;436:45;425:57;;;25:18:-1;425:57:6;;25:18:-1;36:153;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;425:57:6;;;;;;;;;;;;;;;;;;;;;;;;12:1:-1;19;14:27;;;;67:4;61:11;56:16;;134:4;130:9;123:4;105:16;101:27;97:43;94:1;90:51;84:4;77:65;157:16;154:1;147:27;211:16;208:1;201:4;198:1;194:12;179:49;5:228;;14:27;32:4;27:9;;5:228;;389:93:6;;;;513:7;:57;;;;-1:-1:-1;525:11:6;;:16;;:44;;;556:4;545:24;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;545:24:6;525:44;492:147;;;;-1:-1:-1;;;492:147:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;212:434;;;;;:::o;652:438::-;878:45;;;-1:-1:-1;;;;;878:45:6;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;878:45:6;;;;;;;25:18:-1;;61:17;;-1:-1;;;;;182:15;-1:-1;;;179:29;160:49;;867:57:6;;;;832:12;;846:17;;867:10;;;;878:45;867:57;;;25:18:-1;867:57:6;;25:18:-1;36:153;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;867:57:6;;;;;;;;;;;;;;;;;;;;;;;;12:1:-1;19;14:27;;;;67:4;61:11;56:16;;134:4;130:9;123:4;105:16;101:27;97:43;94:1;90:51;84:4;77:65;157:16;154:1;147:27;211:16;208:1;201:4;198:1;194:12;179:49;5:228;;14:27;32:4;27:9;;5:228;;831:93:6;;;;955:7;:57;;;;-1:-1:-1;967:11:6;;:16;;:44;;;998:4;987:24;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;987:24:6;967:44;934:149;;;;-1:-1:-1;;;934:149:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1588:214;1700:12;;;1660;1700;;;;;;;;;-1:-1:-1;;;;;1678:7:6;;;1693:5;;1678:35;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;1678:35:6;;;;;;;;;;;;;;;;;;;;;;;;;12:1:-1;19;14:27;;;;67:4;61:11;56:16;;134:4;130:9;123:4;105:16;101:27;97:43;94:1;90:51;84:4;77:65;157:16;154:1;147:27;211:16;208:1;201:4;198:1;194:12;179:49;5:228;;14:27;32:4;27:9;;5:228;;1659:54:6;;;1731:7;1723:72;;;;-1:-1:-1;;;1723:72:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1588:214;;;:::o",
"source": "pragma solidity =0.6.6;\n\nimport 'moonwalkerswap-libraries/contracts/libraries/TransferHelper.sol';\n\nimport './interfaces/IMoonwalkerswapV2Migrator.sol';\nimport './interfaces/V1/IMoonwalkerswapV1Factory.sol';\nimport './interfaces/V1/IMoonwalkerswapV1Exchange.sol';\nimport './interfaces/IMoonwalkerswapV2Router01.sol';\nimport './interfaces/IERC20.sol';\n\ncontract MoonwalkerswapV2Migrator is IMoonwalkerswapV2Migrator {\n IMoonwalkerswapV1Factory immutable factoryV1;\n IMoonwalkerswapV2Router01 immutable router;\n\n constructor(address _factoryV1, address _router) public {\n factoryV1 = IMoonwalkerswapV1Factory(_factoryV1);\n router = IMoonwalkerswapV2Router01(_router);\n }\n\n receive() external payable {}\n\n function migrate(address token, uint amountTokenMin, uint amountETHMin, address to, uint deadline)\n external\n override\n {\n IMoonwalkerswapV1Exchange exchangeV1 = IMoonwalkerswapV1Exchange(factoryV1.getExchange(token));\n uint liquidityV1 = exchangeV1.balanceOf(msg.sender);\n require(exchangeV1.transferFrom(msg.sender, address(this), liquidityV1), 'TRANSFER_FROM_FAILED');\n (uint amountETHV1, uint amountTokenV1) = exchangeV1.removeLiquidity(liquidityV1, 1, 1, uint(-1));\n TransferHelper.safeApprove(token, address(router), amountTokenV1);\n (uint amountTokenV2, uint amountETHV2,) = router.addLiquidityETH{value: amountETHV1}(\n token,\n amountTokenV1,\n amountTokenMin,\n amountETHMin,\n to,\n deadline\n );\n if (amountTokenV1 > amountTokenV2) {\n TransferHelper.safeApprove(token, address(router), 0); // be a good blockchain citizen, reset allowance to 0\n TransferHelper.safeTransfer(token, msg.sender, amountTokenV1 - amountTokenV2);\n } else if (amountETHV1 > amountETHV2) {\n // addLiquidityETH guarantees that all of amountETHV1 or amountTokenV1 will be used, hence this else is safe\n TransferHelper.safeTransferETH(msg.sender, amountETHV1 - amountETHV2);\n }\n }\n}\n",
"sourcePath": "/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/Moonwalkerswap-v2-periphery/contracts/MoonwalkerswapV2Migrator.sol",
"ast": {
"absolutePath": "/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/Moonwalkerswap-v2-periphery/contracts/MoonwalkerswapV2Migrator.sol",
"exportedSymbols": {
"MoonwalkerswapV2Migrator": [
169
]
},
"id": 170,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"=",
"0.6",
".6"
],
"nodeType": "PragmaDirective",
"src": "0:23:0"
},
{
"absolutePath": "moonwalkerswap-libraries/contracts/libraries/TransferHelper.sol",
"file": "moonwalkerswap-libraries/contracts/libraries/TransferHelper.sol",
"id": 2,
"nodeType": "ImportDirective",
"scope": 170,
"sourceUnit": 804,
"src": "25:73:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/Moonwalkerswap-v2-periphery/contracts/interfaces/IMoonwalkerswapV2Migrator.sol",
"file": "./interfaces/IMoonwalkerswapV2Migrator.sol",
"id": 3,
"nodeType": "ImportDirective",
"scope": 170,
"sourceUnit": 270,
"src": "100:52:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/Moonwalkerswap-v2-periphery/contracts/interfaces/V1/IMoonwalkerswapV1Factory.sol",
"file": "./interfaces/V1/IMoonwalkerswapV1Factory.sol",
"id": 4,
"nodeType": "ImportDirective",
"scope": 170,
"sourceUnit": 644,
"src": "153:54:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/Moonwalkerswap-v2-periphery/contracts/interfaces/V1/IMoonwalkerswapV1Exchange.sol",
"file": "./interfaces/V1/IMoonwalkerswapV1Exchange.sol",
"id": 5,
"nodeType": "ImportDirective",
"scope": 170,
"sourceUnit": 634,
"src": "208:55:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/Moonwalkerswap-v2-periphery/contracts/interfaces/IMoonwalkerswapV2Router01.sol",
"file": "./interfaces/IMoonwalkerswapV2Router01.sol",
"id": 6,
"nodeType": "ImportDirective",
"scope": 170,
"sourceUnit": 578,
"src": "264:52:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/Moonwalkerswap-v2-periphery/contracts/interfaces/IERC20.sol",
"file": "./interfaces/IERC20.sol",
"id": 7,
"nodeType": "ImportDirective",
"scope": 170,
"sourceUnit": 254,
"src": "317:33:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 8,
"name": "IMoonwalkerswapV2Migrator",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 269,
"src": "389:25:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IMoonwalkerswapV2Migrator_$269",
"typeString": "contract IMoonwalkerswapV2Migrator"
}
},
"id": 9,
"nodeType": "InheritanceSpecifier",
"src": "389:25:0"
}
],
"contractDependencies": [
269
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 169,
"linearizedBaseContracts": [
169,
269
],
"name": "MoonwalkerswapV2Migrator",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 11,
"mutability": "immutable",
"name": "factoryV1",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 169,
"src": "421:44:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IMoonwalkerswapV1Factory_$643",
"typeString": "contract IMoonwalkerswapV1Factory"
},
"typeName": {
"contractScope": null,
"id": 10,
"name": "IMoonwalkerswapV1Factory",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 643,
"src": "421:24:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IMoonwalkerswapV1Factory_$643",
"typeString": "contract IMoonwalkerswapV1Factory"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13,
"mutability": "immutable",
"name": "router",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 169,
"src": "471:42:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IMoonwalkerswapV2Router01_$577",
"typeString": "contract IMoonwalkerswapV2Router01"
},
"typeName": {
"contractScope": null,
"id": 12,
"name": "IMoonwalkerswapV2Router01",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 577,
"src": "471:25:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IMoonwalkerswapV2Router01_$577",
"typeString": "contract IMoonwalkerswapV2Router01"
}
},
"value": null,
"visibility": "internal"
},
{
"body": {
"id": 32,
"nodeType": "Block",
"src": "576:118:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 24,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 20,
"name": "factoryV1",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "586:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IMoonwalkerswapV1Factory_$643",
"typeString": "contract IMoonwalkerswapV1Factory"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 22,
"name": "_factoryV1",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15,
"src": "623:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 21,
"name": "IMoonwalkerswapV1Factory",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 643,
"src": "598:24:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IMoonwalkerswapV1Factory_$643_$",
"typeString": "type(contract IMoonwalkerswapV1Factory)"
}
},
"id": 23,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "598:36:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IMoonwalkerswapV1Factory_$643",
"typeString": "contract IMoonwalkerswapV1Factory"
}
},
"src": "586:48:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IMoonwalkerswapV1Factory_$643",
"typeString": "contract IMoonwalkerswapV1Factory"
}
},
"id": 25,
"nodeType": "ExpressionStatement",
"src": "586:48:0"
},
{
"expression": {
"argumentTypes": null,
"id": 30,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 26,
"name": "router",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13,
"src": "644:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IMoonwalkerswapV2Router01_$577",
"typeString": "contract IMoonwalkerswapV2Router01"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 28,
"name": "_router",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 17,
"src": "679:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 27,
"name": "IMoonwalkerswapV2Router01",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 577,
"src": "653:25:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IMoonwalkerswapV2Router01_$577_$",
"typeString": "type(contract IMoonwalkerswapV2Router01)"
}
},
"id": 29,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "653:34:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IMoonwalkerswapV2Router01_$577",
"typeString": "contract IMoonwalkerswapV2Router01"
}
},
"src": "644:43:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IMoonwalkerswapV2Router01_$577",
"typeString": "contract IMoonwalkerswapV2Router01"
}
},
"id": 31,
"nodeType": "ExpressionStatement",
"src": "644:43:0"
}
]
},
"documentation": null,
"id": 33,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 18,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15,
"mutability": "mutable",
"name": "_factoryV1",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 33,
"src": "532:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 14,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "532:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 17,
"mutability": "mutable",
"name": "_router",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 33,
"src": "552:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 16,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "552:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "531:37:0"
},
"returnParameters": {
"id": 19,
"nodeType": "ParameterList",
"parameters": [],
"src": "576:0:0"
},
"scope": 169,
"src": "520:174:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 36,
"nodeType": "Block",
"src": "727:2:0",
"statements": []
},
"documentation": null,
"id": 37,
"implemented": true,
"kind": "receive",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 34,
"nodeType": "ParameterList",
"parameters": [],
"src": "707:2:0"
},
"returnParameters": {
"id": 35,
"nodeType": "ParameterList",
"parameters": [],
"src": "727:0:0"
},
"scope": 169,
"src": "700:29:0",
"stateMutability": "payable",
"virtual": false,
"visibility": "external"
},
{
"baseFunctions": [
268
],
"body": {
"id": 167,
"nodeType": "Block",
"src": "872:1220:0",
"statements": [
{
"assignments": [
52
],
"declarations": [
{
"constant": false,
"id": 52,
"mutability": "mutable",
"name": "exchangeV1",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 167,
"src": "882:36:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IMoonwalkerswapV1Exchange_$633",
"typeString": "contract IMoonwalkerswapV1Exchange"
},
"typeName": {
"contractScope": null,
"id": 51,
"name": "IMoonwalkerswapV1Exchange",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 633,
"src": "882:25:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IMoonwalkerswapV1Exchange_$633",
"typeString": "contract IMoonwalkerswapV1Exchange"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 59,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 56,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 39,
"src": "969:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 54,
"name": "factoryV1",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "947:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IMoonwalkerswapV1Factory_$643",
"typeString": "contract IMoonwalkerswapV1Factory"
}
},
"id": 55,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "getExchange",
"nodeType": "MemberAccess",
"referencedDeclaration": 642,
"src": "947:21:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_address_$returns$_t_address_$",
"typeString": "function (address) view external returns (address)"
}
},
"id": 57,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "947:28:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 53,
"name": "IMoonwalkerswapV1Exchange",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 633,
"src": "921:25:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IMoonwalkerswapV1Exchange_$633_$",
"typeString": "type(contract IMoonwalkerswapV1Exchange)"
}
},
"id": 58,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "921:55:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IMoonwalkerswapV1Exchange_$633",
"typeString": "contract IMoonwalkerswapV1Exchange"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "882:94:0"
},
{
"assignments": [
61
],
"declarations": [
{
"constant": false,
"id": 61,
"mutability": "mutable",
"name": "liquidityV1",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 167,
"src": "986:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 60,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "986:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 67,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 64,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "1026:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 65,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1026:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"expression": {
"argumentTypes": null,
"id": 62,
"name": "exchangeV1",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 52,
"src": "1005:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IMoonwalkerswapV1Exchange_$633",
"typeString": "contract IMoonwalkerswapV1Exchange"
}
},
"