Source Code
Overview
ETH Balance
0 ETH
Token Holdings
More Info
ContractCreator
Multichain Info
N/A
Latest 25 from a total of 105,650 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Deposit ETH | 5181914 | 226 days ago | IN | 0.001 ETH | 0.00030695 | ||||
Deposit ETH | 5181914 | 226 days ago | IN | 0.001 ETH | 0.00030695 | ||||
Deposit ETH | 5181914 | 226 days ago | IN | 0.001 ETH | 0.00030814 | ||||
Deposit ETH | 5181913 | 226 days ago | IN | 0.001 ETH | 0.0018581 | ||||
Deposit ETH | 5181913 | 226 days ago | IN | 0.001 ETH | 0.0018581 | ||||
Deposit ETH | 5181913 | 226 days ago | IN | 0.001 ETH | 0.00030193 | ||||
Deposit | 4710785 | 299 days ago | IN | 0 ETH | 0.00037572 | ||||
Swap | 4613481 | 315 days ago | IN | 0 ETH | 0.00015723 | ||||
Deposit | 4613461 | 315 days ago | IN | 0 ETH | 0.0003604 | ||||
Deposit | 4608199 | 315 days ago | IN | 0 ETH | 0.00041191 | ||||
Deposit | 4608084 | 315 days ago | IN | 0 ETH | 0.00039668 | ||||
Swap | 4608068 | 315 days ago | IN | 0 ETH | 0.00023822 | ||||
Deposit ETH | 4608051 | 315 days ago | IN | 0.05 ETH | 0.00071852 | ||||
Swap | 4607894 | 315 days ago | IN | 0 ETH | 0.00016285 | ||||
Deposit | 4607886 | 315 days ago | IN | 0 ETH | 0.0003984 | ||||
Deposit | 4607216 | 315 days ago | IN | 0 ETH | 0.00034983 | ||||
Deposit | 4607199 | 315 days ago | IN | 0 ETH | 0.00021909 | ||||
Deposit ETH | 4607184 | 315 days ago | IN | 10.9 ETH | 0.00021996 | ||||
Swap | 4607177 | 315 days ago | IN | 0 ETH | 0.00012164 | ||||
Withdraw ETH | 4607157 | 315 days ago | IN | 0 ETH | 0.00011587 | ||||
Withdraw ETH | 4607149 | 315 days ago | IN | 0 ETH | 0.00012223 | ||||
Swap ETH Out | 4603505 | 316 days ago | IN | 0 ETH | 0.00018823 | ||||
Deposit | 4603433 | 316 days ago | IN | 0 ETH | 0.00037097 | ||||
Deposit | 4603392 | 316 days ago | IN | 0 ETH | 0.00035945 | ||||
Deposit | 4602004 | 316 days ago | IN | 0 ETH | 0.00036754 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
5181914 | 226 days ago | 0.001 ETH | ||||
5181914 | 226 days ago | 0.001 ETH | ||||
5181914 | 226 days ago | 0.001 ETH | ||||
5181913 | 226 days ago | 0.001 ETH | ||||
5181913 | 226 days ago | 0.001 ETH | ||||
5181913 | 226 days ago | 0.001 ETH | ||||
4608051 | 315 days ago | 0.05 ETH | ||||
4607184 | 315 days ago | 10.9 ETH | ||||
4607157 | 315 days ago | 10.92052192 ETH | ||||
4607157 | 315 days ago | 10.92052192 ETH | ||||
4603505 | 316 days ago | 0.00101568 ETH | ||||
4603505 | 316 days ago | 0.00101568 ETH | ||||
4601940 | 316 days ago | 5.22860801 ETH | ||||
4600414 | 316 days ago | 1 ETH | ||||
4599329 | 317 days ago | 14.9 ETH | ||||
4599320 | 317 days ago | 13.90067422 ETH | ||||
4599320 | 317 days ago | 13.90067422 ETH | ||||
4591715 | 318 days ago | 11.3 ETH | ||||
4591708 | 318 days ago | 10.3034457 ETH | ||||
4591708 | 318 days ago | 10.3034457 ETH | ||||
4591079 | 318 days ago | 0.2 ETH | ||||
4587784 | 318 days ago | 0.01 ETH | ||||
4587778 | 318 days ago | 0.02 ETH | ||||
4586391 | 318 days ago | 0.001 ETH | ||||
4585577 | 319 days ago | 4 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xF517FB0c...e3d7857cC The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
DysonRouter
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity 0.8.17; // SPDX-License-Identifier: AGPL-3.0 import "interfaces/IDysonPair.sol"; import "interfaces/IWETH.sol"; import "interfaces/IDysonFactory.sol"; import "./SqrtMath.sol"; import "./TransferHelper.sol"; /// @title Router contract for all DysonPair contracts /// @notice Users are expected to swap, deposit and withdraw via this contract /// @dev IMPORTANT: Fund stuck or send to this contract is free for grab as `pair` param /// in each swap functions is passed in and not validated so everyone can implement their /// own `pair` contract and transfer the fund away. contract DysonRouter { using SqrtMath for *; using TransferHelper for address; uint private constant MAX_FEE_RATIO = 2**64; address public immutable WETH; address public immutable DYSON_FACTORY; bytes32 public immutable CODE_HASH; address public owner; event TransferOwnership(address newOwner); constructor(address _WETH, address _owner, address _factory) { require(_owner != address(0), "OWNER_CANNOT_BE_ZERO"); require(_WETH != address(0), "INVALID_WETH"); WETH = _WETH; owner = _owner; DYSON_FACTORY = _factory; CODE_HASH = IDysonFactory(DYSON_FACTORY).getInitCodeHash(); } modifier onlyOwner() { require(msg.sender == owner, "FORBIDDEN"); _; } // returns sorted token addresses, used to handle return values from pairs sorted in this order function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, 'IDENTICAL_ADDRESSES'); (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'ZERO_ADDRESS'); } // calculates the CREATE2 address for a pair without making any external calls function pairFor(address factory, bytes32 initCodeHash, address tokenA, address tokenB, uint id) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address(uint160(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1, id)), //salt initCodeHash ))))); } function transferOwnership(address _owner) external onlyOwner { require(_owner != address(0), "OWNER_CANNOT_BE_ZERO"); owner = _owner; emit TransferOwnership(_owner); } /// @notice Allow another address to transfer token from this contract /// @param tokenAddress Address of token to approve /// @param contractAddress Address to grant allowance /// @param enable True to enable allowance. False otherwise. function rely(address tokenAddress, address contractAddress, bool enable) onlyOwner external { tokenAddress.safeApprove(contractAddress, enable ? type(uint).max : 0); } /// @notice rescue token stucked in this contract /// @param tokenAddress Address of token to be rescued /// @param to Address that will receive token /// @param amount Amount of token to be rescued function rescueERC20(address tokenAddress, address to, uint256 amount) onlyOwner external { tokenAddress.safeTransfer(to, amount); } /// @notice This contract can only receive ETH coming from WETH contract, /// i.e., when it withdraws from WETH receive() external payable { require(msg.sender == WETH); } /// @notice Swap tokenIn for tokenOut /// @param tokenIn Address of spent token /// @param tokenOut Address of received token /// @param index Number of pair instance /// @param to Address that will receive tokenOut /// @param input Amount of tokenIn to swap /// @param minOutput Minimum of tokenOut expected to receive /// @return output Amount of tokenOut received function swap(address tokenIn, address tokenOut, uint index, address to, uint input, uint minOutput) external returns (uint output) { address pair = pairFor(DYSON_FACTORY, CODE_HASH, tokenIn, tokenOut, index); (address token0,) = sortTokens(tokenIn, tokenOut); tokenIn.safeTransferFrom(msg.sender, address(this), input); if(tokenIn == token0) output = IDysonPair(pair).swap0in(to, input, minOutput); else output = IDysonPair(pair).swap1in(to, input, minOutput); } /// @notice Swap ETH for tokenOut /// @param tokenOut Address of received token /// @param index Number of pair instance /// @param to Address that will receive tokenOut /// @param minOutput Minimum of token1 expected to receive /// @return output Amount of tokenOut received function swapETHIn(address tokenOut, uint index, address to, uint minOutput) external payable returns (uint output) { address pair = pairFor(DYSON_FACTORY, CODE_HASH, tokenOut, WETH, index); (address token0,) = sortTokens(WETH, tokenOut); IWETH(WETH).deposit{value: msg.value}(); if(WETH == token0) output = IDysonPair(pair).swap0in(to, msg.value, minOutput); else output = IDysonPair(pair).swap1in(to, msg.value, minOutput); } /// @notice Swap tokenIn for ETH /// @param tokenIn Address of spent token /// @param index Number of pair instance /// @param to Address that will receive ETH /// @param input Amount of tokenIn to swap /// @param minOutput Minimum of ETH expected to receive /// @return output Amount of ETH received function swapETHOut(address tokenIn, uint index, address to, uint input, uint minOutput) external returns (uint output) { address pair = pairFor(DYSON_FACTORY, CODE_HASH, tokenIn, WETH, index); (address token0,) = sortTokens(WETH, tokenIn); tokenIn.safeTransferFrom(msg.sender, address(this), input); if(WETH == token0) output = IDysonPair(pair).swap1in(address(this), input, minOutput); else output = IDysonPair(pair).swap0in(address(this), input, minOutput); IWETH(WETH).withdraw(output); to.safeTransferETH(output); } /// @notice Deposit tokenIn /// @param tokenIn Address of spent token /// @param tokenOut Address of received token /// @param index Number of pair instance /// @param to Address that will receive DysonPair note /// @param input Amount of tokenIn to deposit /// @param minOutput Minimum amount of tokenOut expected to receive if the swap is perfromed /// @param time Lock time /// @return output Amount of tokenOut received if the swap is performed function deposit(address tokenIn, address tokenOut, uint index, address to, uint input, uint minOutput, uint time) external returns (uint output) { address pair = pairFor(DYSON_FACTORY, CODE_HASH, tokenIn, tokenOut, index); (address token0,) = sortTokens(tokenIn, tokenOut); tokenIn.safeTransferFrom(msg.sender, address(this), input); if(tokenIn == token0) output = IDysonPair(pair).deposit0(to, input, minOutput, time); else output = IDysonPair(pair).deposit1(to, input, minOutput, time); } /// @notice Deposit ETH /// @param tokenOut Address of received token /// @param index Number of pair instance /// @param to Address that will receive DysonPair note /// @param minOutput Minimum amount of tokenOut expected to receive if the swap is perfromed /// @param time Lock time /// @return output Amount of tokenOut received if the swap is performed function depositETH(address tokenOut, uint index, address to, uint minOutput, uint time) external payable returns (uint output) { address pair = pairFor(DYSON_FACTORY, CODE_HASH, tokenOut, WETH, index); (address token0,) = sortTokens(WETH, tokenOut); IWETH(WETH).deposit{value: msg.value}(); if(WETH == token0) output = IDysonPair(pair).deposit0(to, msg.value, minOutput, time); else output = IDysonPair(pair).deposit1(to, msg.value, minOutput, time); } /// @notice Withdrw DysonPair note. /// User who signs the withdraw signature must be the one who calls this function /// @param pair `Pair` contract address /// @param index Index of the note to withdraw /// @param to Address that will receive either token0 or token1 /// @param deadline Deadline when the withdraw signature expires /// @param sig Withdraw signature /// @return token0Amt Amount of token0 withdrawn /// @return token1Amt Amount of token1 withdrawn function withdraw(address pair, uint index, address to, uint deadline, bytes calldata sig) external returns (uint token0Amt, uint token1Amt) { return IDysonPair(pair).withdrawWithSig(msg.sender, index, to, deadline, sig); } /// @notice Withdrw DysonPair note and if either token0 or token1 withdrawn is WETH, withdraw from WETH and send ETH to receiver. /// User who signs the withdraw signature must be the one who calls this function /// @param pair `Pair` contract address /// @param index Index of the note to withdraw /// @param to Address that will receive either token0 or token1 /// @param deadline Deadline when the withdraw signature expires /// @param sig Withdraw signature /// @return token0Amt Amount of token0 withdrawn /// @return token1Amt Amount of token1 withdrawn function withdrawETH(address pair, uint index, address to, uint deadline, bytes calldata sig) external returns (uint token0Amt, uint token1Amt) { (token0Amt, token1Amt) = IDysonPair(pair).withdrawWithSig(msg.sender, index, address(this), deadline, sig); address token0 = IDysonPair(pair).token0(); address token = token0Amt > 0 ? token0 : IDysonPair(pair).token1(); uint amount = token0Amt > 0 ? token0Amt : token1Amt; if (token == WETH) { IWETH(WETH).withdraw(amount); to.safeTransferETH(amount); } else { token.safeTransfer(to, amount); } } /// @notice Calculate the price of token1 in token0 /// Formula: /// amount1 = amount0 * reserve1 * sqrt(1-fee0) / reserve0 / sqrt(1-fee1) /// which can be transformed to: /// amount1 = sqrt( amount0**2 * (1-fee0) / (1-fee1) ) * reserve1 / reserve0 /// @param pair `Pair` contract address /// @param token0Amt Amount of token0 /// @return token1Amt Amount of token1 function fairPrice(address pair, uint token0Amt) external view returns (uint token1Amt) { (uint reserve0, uint reserve1) = IDysonPair(pair).getReserves(); (uint64 _fee0, uint64 _fee1) = IDysonPair(pair).getFeeRatio(); return (token0Amt**2 * (MAX_FEE_RATIO - _fee0) / (MAX_FEE_RATIO - _fee1)).sqrt() * reserve1 / reserve0; } }
pragma solidity >=0.8.0; // SPDX-License-Identifier: MIT interface IDysonPair { function token0() external view returns (address); function token1() external view returns (address); function getFeeRatio() external view returns(uint64, uint64); function getReserves() external view returns (uint reserve0, uint reserve1); function deposit0(address to, uint input, uint minOutput, uint time) external returns (uint output); function deposit1(address to, uint input, uint minOutput, uint time) external returns (uint output); function swap0in(address to, uint input, uint minOutput) external returns (uint output); function swap1in(address to, uint input, uint minOutput) external returns (uint output); function withdraw(uint index) external returns (uint token0Amt, uint token1Amt); function withdrawWithSig(address from, uint index, address to, uint deadline, bytes calldata sig) external returns (uint token0Amt, uint token1Amt); }
pragma solidity >=0.8.0; // SPDX-License-Identifier: MIT import "interfaces/IERC20.sol"; interface IWETH is IERC20 { function deposit() external payable; function withdraw(uint) external; }
pragma solidity >=0.8.0; // SPDX-License-Identifier: MIT interface IDysonFactory { function controller() external returns (address); function getInitCodeHash() external view returns (bytes32); }
pragma solidity 0.8.17; // SPDX-License-Identifier: AGPL-3.0 //https://github.com/Gaussian-Process/solidity-sqrt/blob/main/src/FixedPointMathLib.sol library SqrtMath { function sqrt(uint256 x) internal pure returns (uint256 z) { assembly { // This segment is to get a reasonable initial estimate for the Babylonian method. // If the initial estimate is bad, the number of correct bits increases ~linearly // each iteration instead of ~quadratically. // The idea is to get z*z*y within a small factor of x. // More iterations here gets y in a tighter range. Currently, we will have // y in [256, 256*2^16). We ensure y>= 256 so that the relative difference // between y and y+1 is small. If x < 256 this is not possible, but those cases // are easy enough to verify exhaustively. z := 181 // The 'correct' value is 1, but this saves a multiply later let y := x // Note that we check y>= 2^(k + 8) but shift right by k bits each branch, // this is to ensure that if x >= 256, then y >= 256. if iszero(lt(y, 0x10000000000000000000000000000000000)) { y := shr(128, y) z := shl(64, z) } if iszero(lt(y, 0x1000000000000000000)) { y := shr(64, y) z := shl(32, z) } if iszero(lt(y, 0x10000000000)) { y := shr(32, y) z := shl(16, z) } if iszero(lt(y, 0x1000000)) { y := shr(16, y) z := shl(8, z) } // Now, z*z*y <= x < z*z*(y+1), and y <= 2^(16+8), // and either y >= 256, or x < 256. // Correctness can be checked exhaustively for x < 256, so we assume y >= 256. // Then z*sqrt(y) is within sqrt(257)/sqrt(256) of x, or about 20bps. // The estimate sqrt(x) = (181/1024) * (x+1) is off by a factor of ~2.83 both when x=1 // and when x = 256 or 1/256. In the worst case, this needs seven Babylonian iterations. z := shr(18, mul(z, add(y, 65536))) // A multiply is saved from the initial z := 181 // Run the Babylonian method seven times. This should be enough given initial estimate. // Possibly with a quadratic/cubic polynomial above we could get 4-6. z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) // See https://en.wikipedia.org/wiki/Integer_square_root#Using_only_integer_division. // If x+1 is a perfect square, the Babylonian method cycles between // floor(sqrt(x)) and ceil(sqrt(x)). This check ensures we return floor. // The solmate implementation assigns zRoundDown := div(x, z) first, but // since this case is rare, we choose to save gas on the assignment and // repeat division in the rare case. // If you don't care whether floor or ceil is returned, you can skip this. if lt(div(x, z), z) { z := div(x, z) } } } }
pragma solidity 0.8.17; // SPDX-License-Identifier: AGPL-3.0 library TransferHelper { function safeApprove(address token, address to, uint value) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED'); } function safeTransfer(address token, address to, uint value) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED'); } function safeTransferFrom(address token, address from, address to, uint value) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED'); } function safeTransferETH(address to, uint value) internal { (bool success,) = to.call{value:value}(new bytes(0)); require(success, 'TransferHelper: ETH_TRANSFER_FAILED'); } }
pragma solidity >=0.8.0; // SPDX-License-Identifier: MIT interface IERC20 { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); }
{ "remappings": [ "@openzeppelin/=lib/openzeppelin-contracts/", "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "interfaces/=src/interfaces/", "openzeppelin-contracts/=lib/openzeppelin-contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
[{"inputs":[{"internalType":"address","name":"_WETH","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_factory","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"TransferOwnership","type":"event"},{"inputs":[],"name":"CODE_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DYSON_FACTORY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"input","type":"uint256"},{"internalType":"uint256","name":"minOutput","type":"uint256"},{"internalType":"uint256","name":"time","type":"uint256"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"output","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"minOutput","type":"uint256"},{"internalType":"uint256","name":"time","type":"uint256"}],"name":"depositETH","outputs":[{"internalType":"uint256","name":"output","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"pair","type":"address"},{"internalType":"uint256","name":"token0Amt","type":"uint256"}],"name":"fairPrice","outputs":[{"internalType":"uint256","name":"token1Amt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"bool","name":"enable","type":"bool"}],"name":"rely","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"rescueERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"input","type":"uint256"},{"internalType":"uint256","name":"minOutput","type":"uint256"}],"name":"swap","outputs":[{"internalType":"uint256","name":"output","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"minOutput","type":"uint256"}],"name":"swapETHIn","outputs":[{"internalType":"uint256","name":"output","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"input","type":"uint256"},{"internalType":"uint256","name":"minOutput","type":"uint256"}],"name":"swapETHOut","outputs":[{"internalType":"uint256","name":"output","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pair","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes","name":"sig","type":"bytes"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"token0Amt","type":"uint256"},{"internalType":"uint256","name":"token1Amt","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pair","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes","name":"sig","type":"bytes"}],"name":"withdrawETH","outputs":[{"internalType":"uint256","name":"token0Amt","type":"uint256"},{"internalType":"uint256","name":"token1Amt","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Deployed Bytecode
0x6080604052600436106100ec5760003560e01c80638f8710511161008a578063c58b6a1011610059578063c58b6a10146102fc578063d29f14091461031c578063f2fde38b1461033c578063fecc1b9f1461035c57600080fd5b80638f8710511461025357806395becdcb14610288578063ad5c4648146102a8578063b2118a8d146102dc57600080fd5b8063429d9b1d116100c6578063429d9b1d146101b45780637129b640146102005780638865305b146102205780638da5cb5b1461023357600080fd5b80630cd19cbe1461012d5780630dff11651461016057806312713bd21461019457600080fd5b3661012857336001600160a01b037f0000000000000000000000007b79995e5f793a07bc00c21412e50ecae098e7f9161461012657600080fd5b005b600080fd5b34801561013957600080fd5b5061014d6101483660046119af565b61036f565b6040519081526020015b60405180910390f35b34801561016c57600080fd5b5061014d7fa18eb59976abf9c8f4bdab2ba68bdedc92ecb512bc8499c93a3d0103406a14e681565b3480156101a057600080fd5b5061014d6101af366004611a01565b6105e7565b3480156101c057600080fd5b506101e87f000000000000000000000000c8d4ba102232ec1a5d28243f679a91fb4e0f7f3a81565b6040516001600160a01b039091168152602001610157565b34801561020c57600080fd5b5061014d61021b366004611a2d565b610734565b61014d61022e3660046119af565b6108bf565b34801561023f57600080fd5b506000546101e8906001600160a01b031681565b34801561025f57600080fd5b5061027361026e366004611a92565b610b0a565b60408051928352602083019190915201610157565b34801561029457600080fd5b506102736102a3366004611a92565b610d68565b3480156102b457600080fd5b506101e87f0000000000000000000000007b79995e5f793a07bc00c21412e50ecae098e7f981565b3480156102e857600080fd5b506101266102f7366004611b3c565b610df2565b34801561030857600080fd5b50610126610317366004611b8b565b610e3e565b34801561032857600080fd5b5061014d610337366004611bd6565b610e8d565b34801561034857600080fd5b50610126610357366004611c44565b61101d565b61014d61036a366004611c68565b6110e8565b6000806103df7f000000000000000000000000c8d4ba102232ec1a5d28243f679a91fb4e0f7f3a7fa18eb59976abf9c8f4bdab2ba68bdedc92ecb512bc8499c93a3d0103406a14e6897f0000000000000000000000007b79995e5f793a07bc00c21412e50ecae098e7f98a611330565b9050600061040d7f0000000000000000000000007b79995e5f793a07bc00c21412e50ecae098e7f9896113f6565b5090506104256001600160a01b0389163330886114c4565b806001600160a01b03167f0000000000000000000000007b79995e5f793a07bc00c21412e50ecae098e7f96001600160a01b0316036104d8576040516353d56bf560e01b81526001600160a01b038316906353d56bf59061048e90309089908990600401611cb0565b6020604051808303816000875af11580156104ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d19190611cd1565b925061054e565b60405163a9d9db4d60e01b81526001600160a01b0383169063a9d9db4d9061050890309089908990600401611cb0565b6020604051808303816000875af1158015610527573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054b9190611cd1565b92505b604051632e1a7d4d60e01b8152600481018490527f0000000000000000000000007b79995e5f793a07bc00c21412e50ecae098e7f96001600160a01b031690632e1a7d4d90602401600060405180830381600087803b1580156105b057600080fd5b505af11580156105c4573d6000803e3d6000fd5b506105dc925050506001600160a01b038716846115f4565b505095945050505050565b6000806000846001600160a01b0316630902f1ac6040518163ffffffff1660e01b81526004016040805180830381865afa158015610629573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064d9190611cea565b91509150600080866001600160a01b03166359362b886040518163ffffffff1660e01b81526004016040805180830381865afa158015610691573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b59190611d26565b909250905083836107136106d767ffffffffffffffff8516600160401b611d6f565b6106ef67ffffffffffffffff8716600160401b611d6f565b6106fa60028c611e66565b6107049190611e75565b61070e9190611e8c565b6116bd565b61071d9190611e75565b6107279190611e8c565b9450505050505b92915050565b6000806107847f000000000000000000000000c8d4ba102232ec1a5d28243f679a91fb4e0f7f3a7fa18eb59976abf9c8f4bdab2ba68bdedc92ecb512bc8499c93a3d0103406a14e68a8a8a611330565b9050600061079289896113f6565b5090506107aa6001600160a01b038a163330886114c4565b806001600160a01b0316896001600160a01b03160361083d5760405163a9d9db4d60e01b81526001600160a01b0383169063a9d9db4d906107f390899089908990600401611cb0565b6020604051808303816000875af1158015610812573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108369190611cd1565b92506108b3565b6040516353d56bf560e01b81526001600160a01b038316906353d56bf59061086d90899089908990600401611cb0565b6020604051808303816000875af115801561088c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b09190611cd1565b92505b50509695505050505050565b60008061092f7f000000000000000000000000c8d4ba102232ec1a5d28243f679a91fb4e0f7f3a7fa18eb59976abf9c8f4bdab2ba68bdedc92ecb512bc8499c93a3d0103406a14e6897f0000000000000000000000007b79995e5f793a07bc00c21412e50ecae098e7f98a611330565b9050600061095d7f0000000000000000000000007b79995e5f793a07bc00c21412e50ecae098e7f9896113f6565b5090507f0000000000000000000000007b79995e5f793a07bc00c21412e50ecae098e7f96001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156109bb57600080fd5b505af11580156109cf573d6000803e3d6000fd5b5050505050806001600160a01b03167f0000000000000000000000007b79995e5f793a07bc00c21412e50ecae098e7f96001600160a01b031603610a8957604051633851850760e21b81526001600160a01b0383169063e146141c90610a3f90899034908a908a90600401611eae565b6020604051808303816000875af1158015610a5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a829190611cd1565b92506105dc565b60405163186b30c760e11b81526001600160a01b038316906330d6618e90610abb90899034908a908a90600401611eae565b6020604051808303816000875af1158015610ada573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afe9190611cd1565b98975050505050505050565b600080876001600160a01b03166329077db63389308989896040518763ffffffff1660e01b8152600401610b4396959493929190611ed4565b60408051808303816000875af1158015610b61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b859190611cea565b80925081935050506000886001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf19190611f30565b90506000808411610c6357896001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5e9190611f30565b610c65565b815b90506000808511610c765783610c78565b845b90507f0000000000000000000000007b79995e5f793a07bc00c21412e50ecae098e7f96001600160a01b0316826001600160a01b031603610d4657604051632e1a7d4d60e01b8152600481018290527f0000000000000000000000007b79995e5f793a07bc00c21412e50ecae098e7f96001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015610d1557600080fd5b505af1158015610d29573d6000803e3d6000fd5b50610d41925050506001600160a01b038a16826115f4565b610d5a565b610d5a6001600160a01b0383168a83611768565b505050965096945050505050565b600080876001600160a01b03166329077db63389898989896040518763ffffffff1660e01b8152600401610da196959493929190611ed4565b60408051808303816000875af1158015610dbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de39190611cea565b91509150965096945050505050565b6000546001600160a01b03163314610e255760405162461bcd60e51b8152600401610e1c90611f4d565b60405180910390fd5b610e396001600160a01b0384168383611768565b505050565b6000546001600160a01b03163314610e685760405162461bcd60e51b8152600401610e1c90611f4d565b610e398282610e78576000610e7c565b6000195b6001600160a01b0386169190611883565b600080610edd7f000000000000000000000000c8d4ba102232ec1a5d28243f679a91fb4e0f7f3a7fa18eb59976abf9c8f4bdab2ba68bdedc92ecb512bc8499c93a3d0103406a14e68b8b8b611330565b90506000610eeb8a8a6113f6565b509050610f036001600160a01b038b163330896114c4565b806001600160a01b03168a6001600160a01b031603610f9857604051633851850760e21b81526001600160a01b0383169063e146141c90610f4e908a908a908a908a90600401611eae565b6020604051808303816000875af1158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190611cd1565b9250611010565b60405163186b30c760e11b81526001600160a01b038316906330d6618e90610fca908a908a908a908a90600401611eae565b6020604051808303816000875af1158015610fe9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100d9190611cd1565b92505b5050979650505050505050565b6000546001600160a01b031633146110475760405162461bcd60e51b8152600401610e1c90611f4d565b6001600160a01b0381166110945760405162461bcd60e51b81526020600482015260146024820152734f574e45525f43414e4e4f545f42455f5a45524f60601b6044820152606401610e1c565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527fcfaaa26691e16e66e73290fc725eee1a6b4e0e693a1640484937aac25ffb55a49060200160405180910390a150565b6000806111587f000000000000000000000000c8d4ba102232ec1a5d28243f679a91fb4e0f7f3a7fa18eb59976abf9c8f4bdab2ba68bdedc92ecb512bc8499c93a3d0103406a14e6887f0000000000000000000000007b79995e5f793a07bc00c21412e50ecae098e7f989611330565b905060006111867f0000000000000000000000007b79995e5f793a07bc00c21412e50ecae098e7f9886113f6565b5090507f0000000000000000000000007b79995e5f793a07bc00c21412e50ecae098e7f96001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156111e457600080fd5b505af11580156111f8573d6000803e3d6000fd5b5050505050806001600160a01b03167f0000000000000000000000007b79995e5f793a07bc00c21412e50ecae098e7f96001600160a01b0316036112b05760405163a9d9db4d60e01b81526001600160a01b0383169063a9d9db4d9061126690889034908990600401611cb0565b6020604051808303816000875af1158015611285573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a99190611cd1565b9250611326565b6040516353d56bf560e01b81526001600160a01b038316906353d56bf5906112e090889034908990600401611cb0565b6020604051808303816000875af11580156112ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113239190611cd1565b92505b5050949350505050565b600080600061133f86866113f6565b6040516bffffffffffffffffffffffff19606084811b8216602084015283901b166034820152604881018790529193509150889060680160405160208183030381529060405280519060200120886040516020016113d2939291906001600160f81b0319815260609390931b6bffffffffffffffffffffffff191660018401526015830191909152603582015260550190565b60408051601f19818403018152919052805160209091012098975050505050505050565b600080826001600160a01b0316846001600160a01b0316036114505760405162461bcd60e51b81526020600482015260136024820152724944454e544943414c5f41444452455353455360681b6044820152606401610e1c565b826001600160a01b0316846001600160a01b031610611470578284611473565b83835b90925090506001600160a01b0382166114bd5760405162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b6044820152606401610e1c565b9250929050565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916115289190611f70565b6000604051808303816000865af19150503d8060008114611565576040519150601f19603f3d011682016040523d82523d6000602084013e61156a565b606091505b50915091508180156115945750805115806115945750808060200190518101906115949190611f9f565b6115ec5760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f46416044820152631253115160e21b6064820152608401610e1c565b505050505050565b604080516000808252602082019092526001600160a01b03841690839060405161161e9190611f70565b60006040518083038185875af1925050503d806000811461165b576040519150601f19603f3d011682016040523d82523d6000602084013e611660565b606091505b5050905080610e395760405162461bcd60e51b815260206004820152602360248201527f5472616e7366657248656c7065723a204554485f5452414e534645525f46414960448201526213115160ea1b6064820152608401610e1c565b60b581600160881b81106116d65760409190911b9060801c5b690100000000000000000081106116f25760209190911b9060401c5b65010000000000811061170a5760109190911b9060201c5b630100000081106117205760089190911b9060101c5b62010000010260121c80820401600190811c80830401811c80830401811c80830401811c80830401811c80830401811c80830401901c8082048111156117635781045b919050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916117c49190611f70565b6000604051808303816000865af19150503d8060008114611801576040519150601f19603f3d011682016040523d82523d6000602084013e611806565b606091505b50915091508180156118305750805115806118305750808060200190518101906118309190611f9f565b61187c5760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c4544006044820152606401610e1c565b5050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b17905291516000928392908716916118df9190611f70565b6000604051808303816000865af19150503d806000811461191c576040519150601f19603f3d011682016040523d82523d6000602084013e611921565b606091505b509150915081801561194b57508051158061194b57508080602001905181019061194b9190611f9f565b61187c5760405162461bcd60e51b815260206004820152601e60248201527f5472616e7366657248656c7065723a20415050524f56455f4641494c454400006044820152606401610e1c565b6001600160a01b03811681146119ac57600080fd5b50565b600080600080600060a086880312156119c757600080fd5b85356119d281611997565b94506020860135935060408601356119e981611997565b94979396509394606081013594506080013592915050565b60008060408385031215611a1457600080fd5b8235611a1f81611997565b946020939093013593505050565b60008060008060008060c08789031215611a4657600080fd5b8635611a5181611997565b95506020870135611a6181611997565b9450604087013593506060870135611a7881611997565b9598949750929560808101359460a0909101359350915050565b60008060008060008060a08789031215611aab57600080fd5b8635611ab681611997565b9550602087013594506040870135611acd81611997565b935060608701359250608087013567ffffffffffffffff80821115611af157600080fd5b818901915089601f830112611b0557600080fd5b813581811115611b1457600080fd5b8a6020828501011115611b2657600080fd5b6020830194508093505050509295509295509295565b600080600060608486031215611b5157600080fd5b8335611b5c81611997565b92506020840135611b6c81611997565b929592945050506040919091013590565b80151581146119ac57600080fd5b600080600060608486031215611ba057600080fd5b8335611bab81611997565b92506020840135611bbb81611997565b91506040840135611bcb81611b7d565b809150509250925092565b600080600080600080600060e0888a031215611bf157600080fd5b8735611bfc81611997565b96506020880135611c0c81611997565b9550604088013594506060880135611c2381611997565b9699959850939660808101359560a0820135955060c0909101359350915050565b600060208284031215611c5657600080fd5b8135611c6181611997565b9392505050565b60008060008060808587031215611c7e57600080fd5b8435611c8981611997565b9350602085013592506040850135611ca081611997565b9396929550929360600135925050565b6001600160a01b039390931683526020830191909152604082015260600190565b600060208284031215611ce357600080fd5b5051919050565b60008060408385031215611cfd57600080fd5b505080516020909101519092909150565b805167ffffffffffffffff8116811461176357600080fd5b60008060408385031215611d3957600080fd5b611d4283611d0e565b9150611d5060208401611d0e565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561072e5761072e611d59565b600181815b80851115611dbd578160001904821115611da357611da3611d59565b80851615611db057918102915b93841c9390800290611d87565b509250929050565b600082611dd45750600161072e565b81611de15750600061072e565b8160018114611df75760028114611e0157611e1d565b600191505061072e565b60ff841115611e1257611e12611d59565b50506001821b61072e565b5060208310610133831016604e8410600b8410161715611e40575081810a61072e565b611e4a8383611d82565b8060001904821115611e5e57611e5e611d59565b029392505050565b6000611c6160ff841683611dc5565b808202811582820484141761072e5761072e611d59565b600082611ea957634e487b7160e01b600052601260045260246000fd5b500490565b6001600160a01b0394909416845260208401929092526040830152606082015260800190565b6001600160a01b03878116825260208201879052851660408201526060810184905260a06080820181905281018290526000828460c0840137600060c0848401015260c0601f19601f8501168301019050979650505050505050565b600060208284031215611f4257600080fd5b8151611c6181611997565b6020808252600990820152682327a92124a22222a760b91b604082015260600190565b6000825160005b81811015611f915760208186018101518583015201611f77565b506000920191825250919050565b600060208284031215611fb157600080fd5b8151611c6181611b7d56fea26469706673582212209f438668d7be021522042cedfc1227fc12642f87d82ba99c0e2094f401cebda864736f6c63430008110033
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.