UNPKG

test-contracts-sovryn

Version:

Smart contracts for the Sovryn protocol and external integrations.

158 lines (157 loc) 11.9 kB
{ "_format": "hh-sol-artifact-1", "contractName": "TestSovrynSwap", "sourceName": "contracts/testhelpers/TestSovrynSwap.sol", "abi": [ { "inputs": [ { "internalType": "address", "name": "feed", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "constant": true, "inputs": [ { "internalType": "bytes32", "name": "contractName", "type": "bytes32" } ], "name": "addressOf", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "contract IERC20", "name": "_sourceToken", "type": "address" }, { "internalType": "contract IERC20", "name": "_targetToken", "type": "address" } ], "name": "conversionPath", "outputs": [ { "internalType": "contract IERC20[]", "name": "", "type": "address[]" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "contract IERC20[]", "name": "_path", "type": "address[]" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }, { "internalType": "uint256", "name": "_minReturn", "type": "uint256" }, { "internalType": "address", "name": "_beneficiary", "type": "address" }, { "internalType": "address", "name": "_affiliateAccount", "type": "address" }, { "internalType": "uint256", "name": "_affiliateFee", "type": "uint256" } ], "name": "convertByPath", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": true, "inputs": [], "name": "priceFeeds", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "contract IERC20[]", "name": "_path", "type": "address[]" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" } ], "name": "rateByPath", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" } ], "bytecode": "0x608060405234801561001057600080fd5b506040516108893803806108898339818101604052602081101561003357600080fd5b5051600080546001600160a01b039092166001600160a01b0319909216919091179055610824806100656000396000f3fe60806040526004361061004a5760003560e01c806378d849ed1461004f5780637f9c0ecd14610080578063b77d239b1461010f578063bb34534c146101a4578063d734fa19146101ce575b600080fd5b34801561005b57600080fd5b50610064610259565b604080516001600160a01b039092168252519081900360200190f35b34801561008c57600080fd5b506100fd600480360360408110156100a357600080fd5b8101906020810181356401000000008111156100be57600080fd5b8201836020820111156100d057600080fd5b803590602001918460208302840111640100000000831117156100f257600080fd5b919350915035610268565b60408051918252519081900360200190f35b6100fd600480360360c081101561012557600080fd5b81019060208101813564010000000081111561014057600080fd5b82018360208201111561015257600080fd5b8035906020019184602083028401116401000000008311171561017457600080fd5b91935091508035906020810135906001600160a01b03604082013581169160608101359091169060800135610375565b3480156101b057600080fd5b50610064600480360360208110156101c757600080fd5b50356105e6565b3480156101da57600080fd5b50610209600480360360408110156101f157600080fd5b506001600160a01b03813581169160200135166105eb565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561024557818101518382015260200161022d565b505050509050019250505060405180910390f35b6000546001600160a01b031681565b60008054819081906001600160a01b03166329d5277c8787848161028857fe5b905060200201356001600160a01b0316888860018181106102a557fe5b905060200201356001600160a01b03166040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b03168152602001826001600160a01b03166001600160a01b0316815260200192505050604080518083038186803b15801561031357600080fd5b505afa158015610327573d6000803e3d6000fd5b505050506040513d604081101561033d57600080fd5b508051602090910151909250905061036b8161035f868563ffffffff61066c16565b9063ffffffff6106cc16565b9695505050505050565b60008054819081906001600160a01b03166329d5277c8b8b848161039557fe5b905060200201356001600160a01b03168c8c60018181106103b257fe5b905060200201356001600160a01b03166040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b03168152602001826001600160a01b03166001600160a01b0316815260200192505050604080518083038186803b15801561042057600080fd5b505afa158015610434573d6000803e3d6000fd5b505050506040513d604081101561044a57600080fd5b5080516020909101519092509050600061046e8261035f8b8663ffffffff61066c16565b9050878110156104af5760405162461bcd60e51b81526004018080602001828103825260238152602001806107ac6023913960400191505060405180910390fd5b8a8a60008181106104bc57fe5b905060200201356001600160a01b03166001600160a01b0316639dc29fac338b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561052b57600080fd5b505af115801561053f573d6000803e3d6000fd5b505050508a8a600181811061055057fe5b905060200201356001600160a01b03166001600160a01b03166340c10f1988836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156105bf57600080fd5b505af11580156105d3573d6000803e3d6000fd5b50929d9c50505050505050505050505050565b503090565b604080516002808252606080830184529283929190602083019080388339019050509050838160008151811061061d57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050828160018151811061064b57fe5b6001600160a01b039092166020928302919091019091015290505b92915050565b60008261067b57506000610666565b8282028284828161068857fe5b04146106c55760405162461bcd60e51b81526004018080602001828103825260218152602001806107cf6021913960400191505060405180910390fd5b9392505050565b60006106c583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250600081836107955760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561075a578181015183820152602001610742565b50505050905090810190601f1680156107875780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816107a157fe5b049594505050505056fe696e73756666696369656e7420736f7572636520746f6b656e732070726f7669646564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a72315820b3b713377676e7194747a625b274e179d89a1e88d2ea5e20905542e2eecc7b9d64736f6c63430005110032", "deployedBytecode": "0x60806040526004361061004a5760003560e01c806378d849ed1461004f5780637f9c0ecd14610080578063b77d239b1461010f578063bb34534c146101a4578063d734fa19146101ce575b600080fd5b34801561005b57600080fd5b50610064610259565b604080516001600160a01b039092168252519081900360200190f35b34801561008c57600080fd5b506100fd600480360360408110156100a357600080fd5b8101906020810181356401000000008111156100be57600080fd5b8201836020820111156100d057600080fd5b803590602001918460208302840111640100000000831117156100f257600080fd5b919350915035610268565b60408051918252519081900360200190f35b6100fd600480360360c081101561012557600080fd5b81019060208101813564010000000081111561014057600080fd5b82018360208201111561015257600080fd5b8035906020019184602083028401116401000000008311171561017457600080fd5b91935091508035906020810135906001600160a01b03604082013581169160608101359091169060800135610375565b3480156101b057600080fd5b50610064600480360360208110156101c757600080fd5b50356105e6565b3480156101da57600080fd5b50610209600480360360408110156101f157600080fd5b506001600160a01b03813581169160200135166105eb565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561024557818101518382015260200161022d565b505050509050019250505060405180910390f35b6000546001600160a01b031681565b60008054819081906001600160a01b03166329d5277c8787848161028857fe5b905060200201356001600160a01b0316888860018181106102a557fe5b905060200201356001600160a01b03166040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b03168152602001826001600160a01b03166001600160a01b0316815260200192505050604080518083038186803b15801561031357600080fd5b505afa158015610327573d6000803e3d6000fd5b505050506040513d604081101561033d57600080fd5b508051602090910151909250905061036b8161035f868563ffffffff61066c16565b9063ffffffff6106cc16565b9695505050505050565b60008054819081906001600160a01b03166329d5277c8b8b848161039557fe5b905060200201356001600160a01b03168c8c60018181106103b257fe5b905060200201356001600160a01b03166040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b03168152602001826001600160a01b03166001600160a01b0316815260200192505050604080518083038186803b15801561042057600080fd5b505afa158015610434573d6000803e3d6000fd5b505050506040513d604081101561044a57600080fd5b5080516020909101519092509050600061046e8261035f8b8663ffffffff61066c16565b9050878110156104af5760405162461bcd60e51b81526004018080602001828103825260238152602001806107ac6023913960400191505060405180910390fd5b8a8a60008181106104bc57fe5b905060200201356001600160a01b03166001600160a01b0316639dc29fac338b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561052b57600080fd5b505af115801561053f573d6000803e3d6000fd5b505050508a8a600181811061055057fe5b905060200201356001600160a01b03166001600160a01b03166340c10f1988836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156105bf57600080fd5b505af11580156105d3573d6000803e3d6000fd5b50929d9c50505050505050505050505050565b503090565b604080516002808252606080830184529283929190602083019080388339019050509050838160008151811061061d57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050828160018151811061064b57fe5b6001600160a01b039092166020928302919091019091015290505b92915050565b60008261067b57506000610666565b8282028284828161068857fe5b04146106c55760405162461bcd60e51b81526004018080602001828103825260218152602001806107cf6021913960400191505060405180910390fd5b9392505050565b60006106c583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250600081836107955760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561075a578181015183820152602001610742565b50505050905090810190601f1680156107875780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816107a157fe5b049594505050505056fe696e73756666696369656e7420736f7572636520746f6b656e732070726f7669646564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a72315820b3b713377676e7194747a625b274e179d89a1e88d2ea5e20905542e2eecc7b9d64736f6c63430005110032", "linkReferences": {}, "deployedLinkReferences": {} }