More Info
Private Name Tags
ContractCreator
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
20654572 | 41 hrs ago | 0.055944 ETH | ||||
20654572 | 41 hrs ago | 0.055944 ETH | ||||
20634940 | 4 days ago | 0.04995 ETH | ||||
20634940 | 4 days ago | 0.04995 ETH | ||||
20612214 | 7 days ago | 0.047952 ETH | ||||
20612214 | 7 days ago | 0.047952 ETH | ||||
20442103 | 31 days ago | 0.0999 ETH | ||||
20442103 | 31 days ago | 0.0999 ETH | ||||
20002504 | 92 days ago | 0.01998 ETH | ||||
20002504 | 92 days ago | 0.01998 ETH | ||||
19879624 | 109 days ago | 0.1998 ETH | ||||
19879624 | 109 days ago | 0.1998 ETH | ||||
19788036 | 122 days ago | 1.998 ETH | ||||
19788036 | 122 days ago | 1.998 ETH | ||||
19772228 | 124 days ago | 0.999 ETH | ||||
19772228 | 124 days ago | 0.999 ETH | ||||
19600870 | 148 days ago | 9.99 ETH | ||||
19600870 | 148 days ago | 9.99 ETH | ||||
19084670 | 221 days ago | 0.06 ETH | ||||
19084670 | 221 days ago | 0.06 ETH | ||||
18781907 | 263 days ago | 0.4448371 ETH | ||||
18781907 | 263 days ago | 0.4448371 ETH | ||||
18348298 | 324 days ago | 0.005778 ETH | ||||
18348298 | 324 days ago | 0.005778 ETH | ||||
18182913 | 347 days ago | 0.004 ETH |
Loading...
Loading
Contract Name:
KyberSwapV3
Compiler Version
v0.7.6+commit.7338295f
Optimization Enabled:
Yes with 780 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; pragma experimental ABIEncoderV2; import "./BaseSwap.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@kyber.network/utils-sc/contracts/IERC20Ext.sol"; import "../libraries/BytesLib.sol"; contract KyberSwapV3 is BaseSwap { using SafeERC20 for IERC20Ext; using Address for address; using BytesLib for bytes; using SafeMath for uint256; address public router; constructor(address _admin, address _router) BaseSwap(_admin) { router = _router; } event UpdatedAggregationRouter(address router); function updateAggregationRouter(address _router) external onlyAdmin { router = _router; emit UpdatedAggregationRouter(router); } /// @dev get expected return and conversion rate if using a Uni router function getExpectedReturn(GetExpectedReturnParams calldata params) external view override onlyProxyContract returns (uint256 destAmount) { require(false, "getExpectedReturn_notSupported"); } function getExpectedIn(GetExpectedInParams calldata params) external view override onlyProxyContract returns (uint256 srcAmount) { require(false, "getExpectedIn_notSupported"); } /// @dev get expected return and conversion rate if using a Uni router function getExpectedReturnWithImpact(GetExpectedReturnParams calldata params) external view override onlyProxyContract returns (uint256 destAmount, uint256 priceImpact) { require(false, "getExpectedReturnWithImpact_notSupported"); } function getExpectedInWithImpact(GetExpectedInParams calldata params) external view override onlyProxyContract returns (uint256 srcAmount, uint256 priceImpact) { require(false, "getExpectedInWithImpact_notSupported"); } function swap(SwapParams calldata params) external payable override onlyProxyContract returns (uint256 destAmount) { safeApproveAllowance(address(router), IERC20Ext(params.tradePath[0])); bytes memory encodedSwapData = params.extraArgs; uint256 tradeLen = params.tradePath.length; IERC20Ext actualSrc = IERC20Ext(params.tradePath[0]); IERC20Ext actualDest = IERC20Ext(params.tradePath[tradeLen - 1]); uint256 destBalanceBefore = getBalance(actualDest, params.recipient); bool etherIn = IERC20Ext(actualSrc) == ETH_TOKEN_ADDRESS; uint256 callValue = etherIn ? params.srcAmount : 0; (bool success, bytes memory returnDestAmount) = payable(router).call{value: callValue}( encodedSwapData ); require(success, "swapByKyberSwapV3: failed"); destAmount = decodeSwapResponse(returnDestAmount); } function decodeSwapResponse(bytes memory data) internal pure returns (uint256 decodedResponse) { decodedResponse = abi.decode(data, (uint256)); } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; pragma abicoder v2; import "@kyber.network/utils-sc/contracts/Withdrawable.sol"; import "@kyber.network/utils-sc/contracts/Utils.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./ISwap.sol"; abstract contract BaseSwap is ISwap, Withdrawable, Utils { using SafeERC20 for IERC20Ext; using SafeMath for uint256; uint256 internal constant MAX_AMOUNT = type(uint256).max; address public proxyContract; event UpdatedproxyContract(address indexed _oldProxyImpl, address indexed _newProxyImpl); modifier onlyProxyContract() { require(msg.sender == proxyContract, "only swap impl"); _; } constructor(address _admin) Withdrawable(_admin) {} receive() external payable {} function updateProxyContract(address _proxyContract) external onlyAdmin { require(_proxyContract != address(0), "invalid swap impl"); emit UpdatedproxyContract(proxyContract, _proxyContract); proxyContract = _proxyContract; } // Swap contracts don't keep funds. It's safe to set the max allowance function safeApproveAllowance(address spender, IERC20Ext token) internal { if (token != ETH_TOKEN_ADDRESS && token.allowance(address(this), spender) == 0) { token.safeApprove(spender, MAX_ALLOWANCE); } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./IERC20.sol"; import "../../math/SafeMath.sol"; import "../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /** * @dev Interface extending ERC20 standard to include decimals() as * it is optional in the OpenZeppelin IERC20 interface. */ interface IERC20Ext is IERC20 { /** * @dev This function is required as Kyber requires to interact * with token.decimals() with many of its operations. */ function decimals() external view returns (uint8 digits); }
pragma solidity 0.7.6; library BytesLib { function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) { require(_start + 20 >= _start, "toAddress_overflow"); require(_bytes.length >= _start + 20, "toAddress_outOfBounds"); address tempAddress; assembly { tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000) } return tempAddress; } function toUint24(bytes memory _bytes, uint256 _start) internal pure returns (uint24) { require(_start + 3 >= _start, "toUint24_overflow"); require(_bytes.length >= _start + 3, "toUint24_outOfBounds"); uint24 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x3), _start)) } return tempUint; } function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) { require(_start + 32 >= _start, "toUint256_overflow"); require(_bytes.length >= _start + 32, "toUint256_outOfBounds"); uint256 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x20), _start)) } return tempUint; } }
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./IERC20Ext.sol"; import "./PermissionAdmin.sol"; abstract contract Withdrawable is PermissionAdmin { using SafeERC20 for IERC20Ext; event TokenWithdraw(IERC20Ext token, uint256 amount, address sendTo); event EtherWithdraw(uint256 amount, address sendTo); constructor(address _admin) PermissionAdmin(_admin) {} /** * @dev Withdraw all IERC20Ext compatible tokens * @param token IERC20Ext The address of the token contract */ function withdrawToken( IERC20Ext token, uint256 amount, address sendTo ) external onlyAdmin { token.safeTransfer(sendTo, amount); emit TokenWithdraw(token, amount, sendTo); } /** * @dev Withdraw Ethers */ function withdrawEther(uint256 amount, address payable sendTo) external onlyAdmin { (bool success, ) = sendTo.call{value: amount}(""); require(success, "withdraw failed"); emit EtherWithdraw(amount, sendTo); } }
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import "./IERC20Ext.sol"; /** * @title Kyber utility file * mostly shared constants and rate calculation helpers * inherited by most of kyber contracts. * previous utils implementations are for previous solidity versions. */ abstract contract Utils { // Declared constants below to be used in tandem with // getDecimalsConstant(), for gas optimization purposes // which return decimals from a constant list of popular // tokens. IERC20Ext internal constant ETH_TOKEN_ADDRESS = IERC20Ext( 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE ); IERC20Ext internal constant USDT_TOKEN_ADDRESS = IERC20Ext( 0xdAC17F958D2ee523a2206206994597C13D831ec7 ); IERC20Ext internal constant DAI_TOKEN_ADDRESS = IERC20Ext( 0x6B175474E89094C44Da98b954EedeAC495271d0F ); IERC20Ext internal constant USDC_TOKEN_ADDRESS = IERC20Ext( 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 ); IERC20Ext internal constant WBTC_TOKEN_ADDRESS = IERC20Ext( 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599 ); IERC20Ext internal constant KNC_TOKEN_ADDRESS = IERC20Ext( 0xdd974D5C2e2928deA5F71b9825b8b646686BD200 ); uint256 public constant BPS = 10000; // Basic Price Steps. 1 step = 0.01% uint256 internal constant PRECISION = (10**18); uint256 internal constant MAX_QTY = (10**28); // 10B tokens uint256 internal constant MAX_RATE = (PRECISION * 10**7); // up to 10M tokens per eth uint256 internal constant MAX_DECIMALS = 18; uint256 internal constant ETH_DECIMALS = 18; uint256 internal constant MAX_ALLOWANCE = uint256(-1); // token.approve inifinite mapping(IERC20Ext => uint256) internal decimals; /// @dev Sets the decimals of a token to storage if not already set, and returns /// the decimals value of the token. Prefer using this function over /// getDecimals(), to avoid forgetting to set decimals in local storage. /// @param token The token type /// @return tokenDecimals The decimals of the token function getSetDecimals(IERC20Ext token) internal returns (uint256 tokenDecimals) { tokenDecimals = getDecimalsConstant(token); if (tokenDecimals > 0) return tokenDecimals; tokenDecimals = decimals[token]; if (tokenDecimals == 0) { tokenDecimals = token.decimals(); decimals[token] = tokenDecimals; } } /// @dev Get the balance of a user /// @param token The token type /// @param user The user's address /// @return The balance function getBalance(IERC20Ext token, address user) internal view returns (uint256) { if (token == ETH_TOKEN_ADDRESS) { return user.balance; } else { return token.balanceOf(user); } } /// @dev Get the decimals of a token, read from the constant list, storage, /// or from token.decimals(). Prefer using getSetDecimals when possible. /// @param token The token type /// @return tokenDecimals The decimals of the token function getDecimals(IERC20Ext token) internal view returns (uint256 tokenDecimals) { // return token decimals if has constant value tokenDecimals = getDecimalsConstant(token); if (tokenDecimals > 0) return tokenDecimals; // handle case where token decimals is not a declared decimal constant tokenDecimals = decimals[token]; // moreover, very possible that old tokens have decimals 0 // these tokens will just have higher gas fees. return (tokenDecimals > 0) ? tokenDecimals : token.decimals(); } function calcDestAmount( IERC20Ext src, IERC20Ext dest, uint256 srcAmount, uint256 rate ) internal view returns (uint256) { return calcDstQty(srcAmount, getDecimals(src), getDecimals(dest), rate); } function calcSrcAmount( IERC20Ext src, IERC20Ext dest, uint256 destAmount, uint256 rate ) internal view returns (uint256) { return calcSrcQty(destAmount, getDecimals(src), getDecimals(dest), rate); } function calcDstQty( uint256 srcQty, uint256 srcDecimals, uint256 dstDecimals, uint256 rate ) internal pure returns (uint256) { require(srcQty <= MAX_QTY, "srcQty > MAX_QTY"); require(rate <= MAX_RATE, "rate > MAX_RATE"); if (dstDecimals >= srcDecimals) { require((dstDecimals - srcDecimals) <= MAX_DECIMALS, "dst - src > MAX_DECIMALS"); return (srcQty * rate * (10**(dstDecimals - srcDecimals))) / PRECISION; } else { require((srcDecimals - dstDecimals) <= MAX_DECIMALS, "src - dst > MAX_DECIMALS"); return (srcQty * rate) / (PRECISION * (10**(srcDecimals - dstDecimals))); } } function calcSrcQty( uint256 dstQty, uint256 srcDecimals, uint256 dstDecimals, uint256 rate ) internal pure returns (uint256) { require(dstQty <= MAX_QTY, "dstQty > MAX_QTY"); require(rate <= MAX_RATE, "rate > MAX_RATE"); //source quantity is rounded up. to avoid dest quantity being too low. uint256 numerator; uint256 denominator; if (srcDecimals >= dstDecimals) { require((srcDecimals - dstDecimals) <= MAX_DECIMALS, "src - dst > MAX_DECIMALS"); numerator = (PRECISION * dstQty * (10**(srcDecimals - dstDecimals))); denominator = rate; } else { require((dstDecimals - srcDecimals) <= MAX_DECIMALS, "dst - src > MAX_DECIMALS"); numerator = (PRECISION * dstQty); denominator = (rate * (10**(dstDecimals - srcDecimals))); } return (numerator + denominator - 1) / denominator; //avoid rounding down errors } function calcRateFromQty( uint256 srcAmount, uint256 destAmount, uint256 srcDecimals, uint256 dstDecimals ) internal pure returns (uint256) { require(srcAmount <= MAX_QTY, "srcAmount > MAX_QTY"); require(destAmount <= MAX_QTY, "destAmount > MAX_QTY"); if (dstDecimals >= srcDecimals) { require((dstDecimals - srcDecimals) <= MAX_DECIMALS, "dst - src > MAX_DECIMALS"); return ((destAmount * PRECISION) / ((10**(dstDecimals - srcDecimals)) * srcAmount)); } else { require((srcDecimals - dstDecimals) <= MAX_DECIMALS, "src - dst > MAX_DECIMALS"); return ((destAmount * PRECISION * (10**(srcDecimals - dstDecimals))) / srcAmount); } } /// @dev save storage access by declaring token decimal constants /// @param token The token type /// @return token decimals function getDecimalsConstant(IERC20Ext token) internal pure returns (uint256) { if (token == ETH_TOKEN_ADDRESS) { return ETH_DECIMALS; } else if (token == USDT_TOKEN_ADDRESS) { return 6; } else if (token == DAI_TOKEN_ADDRESS) { return 18; } else if (token == USDC_TOKEN_ADDRESS) { return 6; } else if (token == WBTC_TOKEN_ADDRESS) { return 8; } else if (token == KNC_TOKEN_ADDRESS) { return 18; } else { return 0; } } function minOf(uint256 x, uint256 y) internal pure returns (uint256) { return x > y ? y : x; } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; pragma abicoder v2; interface ISwap { struct GetExpectedReturnParams { uint256 srcAmount; address[] tradePath; uint256 feeBps; bytes extraArgs; } function getExpectedReturn(GetExpectedReturnParams calldata params) external view returns (uint256 destAmount); function getExpectedReturnWithImpact(GetExpectedReturnParams calldata params) external view returns (uint256 destAmount, uint256 priceImpact); struct GetExpectedInParams { uint256 destAmount; address[] tradePath; uint256 feeBps; bytes extraArgs; } function getExpectedIn(GetExpectedInParams calldata params) external view returns (uint256 srcAmount); function getExpectedInWithImpact(GetExpectedInParams calldata params) external view returns (uint256 srcAmount, uint256 priceImpact); struct SwapParams { uint256 srcAmount; uint256 minDestAmount; address[] tradePath; address recipient; uint256 feeBps; address payable feeReceiver; bytes extraArgs; } function swap(SwapParams calldata params) external payable returns (uint256 destAmount); }
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; abstract contract PermissionAdmin { address public admin; address public pendingAdmin; event AdminClaimed(address newAdmin, address previousAdmin); event TransferAdminPending(address pendingAdmin); constructor(address _admin) { require(_admin != address(0), "admin 0"); admin = _admin; } modifier onlyAdmin() { require(msg.sender == admin, "only admin"); _; } /** * @dev Allows the current admin to set the pendingAdmin address. * @param newAdmin The address to transfer ownership to. */ function transferAdmin(address newAdmin) public onlyAdmin { require(newAdmin != address(0), "new admin 0"); emit TransferAdminPending(newAdmin); pendingAdmin = newAdmin; } /** * @dev Allows the current admin to set the admin in one tx. Useful initial deployment. * @param newAdmin The address to transfer ownership to. */ function transferAdminQuickly(address newAdmin) public onlyAdmin { require(newAdmin != address(0), "admin 0"); emit TransferAdminPending(newAdmin); emit AdminClaimed(newAdmin, admin); admin = newAdmin; } /** * @dev Allows the pendingAdmin address to finalize the change admin process. */ function claimAdmin() public { require(pendingAdmin == msg.sender, "not pending"); emit AdminClaimed(pendingAdmin, admin); admin = pendingAdmin; pendingAdmin = address(0); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
{ "optimizer": { "enabled": true, "runs": 780 }, "metadata": { "bytecodeHash": "none" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_admin","type":"address"},{"internalType":"address","name":"_router","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"}],"name":"AdminClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"sendTo","type":"address"}],"name":"EtherWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IERC20Ext","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"sendTo","type":"address"}],"name":"TokenWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"pendingAdmin","type":"address"}],"name":"TransferAdminPending","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"router","type":"address"}],"name":"UpdatedAggregationRouter","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_oldProxyImpl","type":"address"},{"indexed":true,"internalType":"address","name":"_newProxyImpl","type":"address"}],"name":"UpdatedproxyContract","type":"event"},{"inputs":[],"name":"BPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"destAmount","type":"uint256"},{"internalType":"address[]","name":"tradePath","type":"address[]"},{"internalType":"uint256","name":"feeBps","type":"uint256"},{"internalType":"bytes","name":"extraArgs","type":"bytes"}],"internalType":"struct ISwap.GetExpectedInParams","name":"params","type":"tuple"}],"name":"getExpectedIn","outputs":[{"internalType":"uint256","name":"srcAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"destAmount","type":"uint256"},{"internalType":"address[]","name":"tradePath","type":"address[]"},{"internalType":"uint256","name":"feeBps","type":"uint256"},{"internalType":"bytes","name":"extraArgs","type":"bytes"}],"internalType":"struct ISwap.GetExpectedInParams","name":"params","type":"tuple"}],"name":"getExpectedInWithImpact","outputs":[{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"priceImpact","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"address[]","name":"tradePath","type":"address[]"},{"internalType":"uint256","name":"feeBps","type":"uint256"},{"internalType":"bytes","name":"extraArgs","type":"bytes"}],"internalType":"struct ISwap.GetExpectedReturnParams","name":"params","type":"tuple"}],"name":"getExpectedReturn","outputs":[{"internalType":"uint256","name":"destAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"address[]","name":"tradePath","type":"address[]"},{"internalType":"uint256","name":"feeBps","type":"uint256"},{"internalType":"bytes","name":"extraArgs","type":"bytes"}],"internalType":"struct ISwap.GetExpectedReturnParams","name":"params","type":"tuple"}],"name":"getExpectedReturnWithImpact","outputs":[{"internalType":"uint256","name":"destAmount","type":"uint256"},{"internalType":"uint256","name":"priceImpact","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxyContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"minDestAmount","type":"uint256"},{"internalType":"address[]","name":"tradePath","type":"address[]"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"feeBps","type":"uint256"},{"internalType":"address payable","name":"feeReceiver","type":"address"},{"internalType":"bytes","name":"extraArgs","type":"bytes"}],"internalType":"struct ISwap.SwapParams","name":"params","type":"tuple"}],"name":"swap","outputs":[{"internalType":"uint256","name":"destAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"transferAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"transferAdminQuickly","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_router","type":"address"}],"name":"updateAggregationRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_proxyContract","type":"address"}],"name":"updateProxyContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address payable","name":"sendTo","type":"address"}],"name":"withdrawEther","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20Ext","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"sendTo","type":"address"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040523480156200001157600080fd5b50604051620018d4380380620018d48339810160408190526200003491620000d4565b8180806001600160a01b0381166200007d576040805162461bcd60e51b8152602060048201526007602482015266061646d696e20360cc1b604482015290519081900360640190fd5b600080546001600160a01b039283166001600160a01b0319918216179091556004805495909216941693909317909255506200010b915050565b80516001600160a01b0381168114620000cf57600080fd5b919050565b60008060408385031215620000e7578182fd5b620000f283620000b7565b91506200010260208401620000b7565b90509250929050565b6117b9806200011b6000396000f3fe6080604052600436106101125760003560e01c806368aa6dd9116100a5578063ce56c45411610074578063ed55044311610059578063ed550443146102e3578063f851a440146102f8578063f887ea401461030d57610119565b8063ce56c454146102a3578063e19b609d146102c357610119565b806368aa6dd91461023b57806375829def1461024e57806377f50f971461026e5780637acc86781461028357610119565b80633ccdbb28116100e15780633ccdbb28146101bb57806343bea4b3146101db5780634db1d03d146101fb57806351bf14841461021b57610119565b806305a727091461011e5780631373524614610155578063249d39e914610177578063267822471461019957610119565b3661011957005b600080fd5b34801561012a57600080fd5b5061013e61013936600461138f565b610322565b60405161014c92919061166d565b60405180910390f35b34801561016157600080fd5b50610175610170366004611332565b610372565b005b34801561018357600080fd5b5061018c610440565b60405161014c9190611664565b3480156101a557600080fd5b506101ae610446565b60405161014c9190611482565b3480156101c757600080fd5b506101756101d636600461134e565b610455565b3480156101e757600080fd5b5061018c6101f636600461138f565b610504565b34801561020757600080fd5b5061018c61021636600461138f565b610549565b34801561022757600080fd5b50610175610236366004611332565b61058e565b61018c6102493660046113ca565b610636565b34801561025a57600080fd5b50610175610269366004611332565b61084f565b34801561027a57600080fd5b50610175610954565b34801561028f57600080fd5b5061017561029e366004611332565b610a26565b3480156102af57600080fd5b506101756102be36600461141a565b610b73565b3480156102cf57600080fd5b5061013e6102de36600461138f565b610cad565b3480156102ef57600080fd5b506101ae610cf4565b34801561030457600080fd5b506101ae610d03565b34801561031957600080fd5b506101ae610d12565b60035460009081906001600160a01b0316331461035a5760405162461bcd60e51b81526004016103519061162d565b60405180910390fd5b60405162461bcd60e51b8152600401610351906115e9565b6000546001600160a01b031633146103be576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b0381166103e45760405162461bcd60e51b8152600401610351906114b0565b6003546040516001600160a01b038084169216907f7c5d026310440df4ec67ef47368cd26898f9dbec4b95934dbbc4a3d9d46c49a990600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b61271081565b6001546001600160a01b031681565b6000546001600160a01b031633146104a1576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6104b56001600160a01b0384168284610d21565b604080516001600160a01b0380861682526020820185905283168183015290517f72cb8a894ddb372ceec3d2a7648d86f17d5a15caae0e986c53109b8a9a9385e69181900360600190a1505050565b6003546000906001600160a01b031633146105315760405162461bcd60e51b81526004016103519061162d565b60405162461bcd60e51b81526004016103519061157b565b6003546000906001600160a01b031633146105765760405162461bcd60e51b81526004016103519061162d565b60405162461bcd60e51b8152600401610351906115b2565b6000546001600160a01b031633146105da576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0383811691909117918290556040517faae83401f24c32e46a488371b9f1793f41c7f34857f96d091633a1919f7a428e9261062b921690611482565b60405180910390a150565b6003546000906001600160a01b031633146106635760405162461bcd60e51b81526004016103519061162d565b6004546106a5906001600160a01b0316610680604085018561167b565b600081811061068b57fe5b90506020020160208101906106a09190611332565b610d8d565b60006106b460c08401846116c9565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509394506106f892505050604085018561167b565b91506000905061070b604086018661167b565b600081811061071657fe5b905060200201602081019061072b9190611332565b9050600061073c604087018761167b565b6001850381811061074957fe5b905060200201602081019061075e9190611332565b9050600061077b8261077660808a0160608b01611332565b610e54565b90506001600160a01b03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146000816107ab5760006107ae565b88355b60045460405191925060009182916001600160a01b03169084906107d3908c90611449565b60006040518083038185875af1925050503d8060008114610810576040519150601f19603f3d011682016040523d82523d6000602084013e610815565b606091505b5091509150816108375760405162461bcd60e51b815260040161035190611544565b61084081610f0e565b9b9a5050505050505050505050565b6000546001600160a01b0316331461089b576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b0381166108f6576040805162461bcd60e51b815260206004820152600b60248201527f6e65772061646d696e2030000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031633146109b3576040805162461bcd60e51b815260206004820152600b60248201527f6e6f742070656e64696e67000000000000000000000000000000000000000000604482015290519081900360640190fd5b600154600054604080516001600160a01b03938416815292909116602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b03163314610a72576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b038116610acd576040805162461bcd60e51b815260206004820152600760248201527f61646d696e203000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600054604080516001600160a01b038085168252909216602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610bbf576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6040516000906001600160a01b0383169084908381818185875af1925050503d8060008114610c0a576040519150601f19603f3d011682016040523d82523d6000602084013e610c0f565b606091505b5050905080610c65576040805162461bcd60e51b815260206004820152600f60248201527f7769746864726177206661696c65640000000000000000000000000000000000604482015290519081900360640190fd5b604080518481526001600160a01b038416602082015281517fec47e7ed86c86774d1a72c19f35c639911393fe7c1a34031fdbd260890da90de929181900390910190a1505050565b60035460009081906001600160a01b03163314610cdc5760405162461bcd60e51b81526004016103519061162d565b60405162461bcd60e51b8152600401610351906114e7565b6003546001600160a01b031681565b6000546001600160a01b031681565b6004546001600160a01b031681565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b179052610d88908490610f24565b505050565b6001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14801590610e355750604051636eb1769f60e11b81526001600160a01b0382169063dd62ed3e90610de39030908690600401611496565b60206040518083038186803b158015610dfb57600080fd5b505afa158015610e0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e339190611402565b155b15610e5057610e506001600160a01b03821683600019610fd5565b5050565b60006001600160a01b03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610e8c57506001600160a01b03811631610f08565b826001600160a01b03166370a08231836040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610ed957600080fd5b505afa158015610eed573d6000803e3d6000fd5b505050506040513d6020811015610f0357600080fd5b505190505b92915050565b600081806020019051810190610f089190611402565b6000610f79826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166110fd9092919063ffffffff16565b805190915015610d8857808060200190516020811015610f9857600080fd5b5051610d885760405162461bcd60e51b815260040180806020018281038252602a81526020018061174d602a913960400191505060405180910390fd5b80158061105b575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b15801561102d57600080fd5b505afa158015611041573d6000803e3d6000fd5b505050506040513d602081101561105757600080fd5b5051155b6110965760405162461bcd60e51b81526004018080602001828103825260368152602001806117776036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663095ea7b360e01b179052610d88908490610f24565b606061110c8484600085611116565b90505b9392505050565b6060824710156111575760405162461bcd60e51b81526004018080602001828103825260268152602001806117276026913960400191505060405180910390fd5b61116085611271565b6111b1576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b602083106111ef5780518252601f1990920191602091820191016111d0565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611251576040519150601f19603f3d011682016040523d82523d6000602084013e611256565b606091505b5091509150611266828286611277565b979650505050505050565b3b151590565b6060831561128657508161110f565b8251156112965782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156112e05781810151838201526020016112c8565b50505050905090810190601f16801561130d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b60006080828403121561132c578081fd5b50919050565b600060208284031215611343578081fd5b813561110f8161170e565b600080600060608486031215611362578182fd5b833561136d8161170e565b92506020840135915060408401356113848161170e565b809150509250925092565b6000602082840312156113a0578081fd5b813567ffffffffffffffff8111156113b6578182fd5b6113c28482850161131b565b949350505050565b6000602082840312156113db578081fd5b813567ffffffffffffffff8111156113f1578182fd5b820160e0818503121561110f578182fd5b600060208284031215611413578081fd5b5051919050565b6000806040838503121561142c578182fd5b82359150602083013561143e8161170e565b809150509250929050565b60008251815b81811015611469576020818601810151858301520161144f565b818111156114775782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b60208082526011908201527f696e76616c6964207377617020696d706c000000000000000000000000000000604082015260600190565b60208082526028908201527f676574457870656374656452657475726e57697468496d706163745f6e6f745360408201527f7570706f72746564000000000000000000000000000000000000000000000000606082015260800190565b60208082526019908201527f7377617042794b796265725377617056333a206661696c656400000000000000604082015260600190565b6020808252601e908201527f676574457870656374656452657475726e5f6e6f74537570706f727465640000604082015260600190565b6020808252601a908201527f6765744578706563746564496e5f6e6f74537570706f72746564000000000000604082015260600190565b60208082526024908201527f6765744578706563746564496e57697468496d706163745f6e6f74537570706f6040820152631c9d195960e21b606082015260800190565b6020808252600e908201527f6f6e6c79207377617020696d706c000000000000000000000000000000000000604082015260600190565b90815260200190565b918252602082015260400190565b6000808335601e19843603018112611691578283fd5b83018035915067ffffffffffffffff8211156116ab578283fd5b60209081019250810236038213156116c257600080fd5b9250929050565b6000808335601e198436030181126116df578283fd5b83018035915067ffffffffffffffff8211156116f9578283fd5b6020019150368190038213156116c257600080fd5b6001600160a01b038116811461172357600080fd5b5056fe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a164736f6c6343000706000a000000000000000000000000320849ec0adffcd6fb0212b59a2ec936cdef5fca000000000000000000000000617dee16b86534a5d792a4d7a62fb491b544111e
Deployed Bytecode
0x6080604052600436106101125760003560e01c806368aa6dd9116100a5578063ce56c45411610074578063ed55044311610059578063ed550443146102e3578063f851a440146102f8578063f887ea401461030d57610119565b8063ce56c454146102a3578063e19b609d146102c357610119565b806368aa6dd91461023b57806375829def1461024e57806377f50f971461026e5780637acc86781461028357610119565b80633ccdbb28116100e15780633ccdbb28146101bb57806343bea4b3146101db5780634db1d03d146101fb57806351bf14841461021b57610119565b806305a727091461011e5780631373524614610155578063249d39e914610177578063267822471461019957610119565b3661011957005b600080fd5b34801561012a57600080fd5b5061013e61013936600461138f565b610322565b60405161014c92919061166d565b60405180910390f35b34801561016157600080fd5b50610175610170366004611332565b610372565b005b34801561018357600080fd5b5061018c610440565b60405161014c9190611664565b3480156101a557600080fd5b506101ae610446565b60405161014c9190611482565b3480156101c757600080fd5b506101756101d636600461134e565b610455565b3480156101e757600080fd5b5061018c6101f636600461138f565b610504565b34801561020757600080fd5b5061018c61021636600461138f565b610549565b34801561022757600080fd5b50610175610236366004611332565b61058e565b61018c6102493660046113ca565b610636565b34801561025a57600080fd5b50610175610269366004611332565b61084f565b34801561027a57600080fd5b50610175610954565b34801561028f57600080fd5b5061017561029e366004611332565b610a26565b3480156102af57600080fd5b506101756102be36600461141a565b610b73565b3480156102cf57600080fd5b5061013e6102de36600461138f565b610cad565b3480156102ef57600080fd5b506101ae610cf4565b34801561030457600080fd5b506101ae610d03565b34801561031957600080fd5b506101ae610d12565b60035460009081906001600160a01b0316331461035a5760405162461bcd60e51b81526004016103519061162d565b60405180910390fd5b60405162461bcd60e51b8152600401610351906115e9565b6000546001600160a01b031633146103be576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b0381166103e45760405162461bcd60e51b8152600401610351906114b0565b6003546040516001600160a01b038084169216907f7c5d026310440df4ec67ef47368cd26898f9dbec4b95934dbbc4a3d9d46c49a990600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b61271081565b6001546001600160a01b031681565b6000546001600160a01b031633146104a1576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6104b56001600160a01b0384168284610d21565b604080516001600160a01b0380861682526020820185905283168183015290517f72cb8a894ddb372ceec3d2a7648d86f17d5a15caae0e986c53109b8a9a9385e69181900360600190a1505050565b6003546000906001600160a01b031633146105315760405162461bcd60e51b81526004016103519061162d565b60405162461bcd60e51b81526004016103519061157b565b6003546000906001600160a01b031633146105765760405162461bcd60e51b81526004016103519061162d565b60405162461bcd60e51b8152600401610351906115b2565b6000546001600160a01b031633146105da576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0383811691909117918290556040517faae83401f24c32e46a488371b9f1793f41c7f34857f96d091633a1919f7a428e9261062b921690611482565b60405180910390a150565b6003546000906001600160a01b031633146106635760405162461bcd60e51b81526004016103519061162d565b6004546106a5906001600160a01b0316610680604085018561167b565b600081811061068b57fe5b90506020020160208101906106a09190611332565b610d8d565b60006106b460c08401846116c9565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509394506106f892505050604085018561167b565b91506000905061070b604086018661167b565b600081811061071657fe5b905060200201602081019061072b9190611332565b9050600061073c604087018761167b565b6001850381811061074957fe5b905060200201602081019061075e9190611332565b9050600061077b8261077660808a0160608b01611332565b610e54565b90506001600160a01b03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146000816107ab5760006107ae565b88355b60045460405191925060009182916001600160a01b03169084906107d3908c90611449565b60006040518083038185875af1925050503d8060008114610810576040519150601f19603f3d011682016040523d82523d6000602084013e610815565b606091505b5091509150816108375760405162461bcd60e51b815260040161035190611544565b61084081610f0e565b9b9a5050505050505050505050565b6000546001600160a01b0316331461089b576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b0381166108f6576040805162461bcd60e51b815260206004820152600b60248201527f6e65772061646d696e2030000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031633146109b3576040805162461bcd60e51b815260206004820152600b60248201527f6e6f742070656e64696e67000000000000000000000000000000000000000000604482015290519081900360640190fd5b600154600054604080516001600160a01b03938416815292909116602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b03163314610a72576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b038116610acd576040805162461bcd60e51b815260206004820152600760248201527f61646d696e203000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600054604080516001600160a01b038085168252909216602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610bbf576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6040516000906001600160a01b0383169084908381818185875af1925050503d8060008114610c0a576040519150601f19603f3d011682016040523d82523d6000602084013e610c0f565b606091505b5050905080610c65576040805162461bcd60e51b815260206004820152600f60248201527f7769746864726177206661696c65640000000000000000000000000000000000604482015290519081900360640190fd5b604080518481526001600160a01b038416602082015281517fec47e7ed86c86774d1a72c19f35c639911393fe7c1a34031fdbd260890da90de929181900390910190a1505050565b60035460009081906001600160a01b03163314610cdc5760405162461bcd60e51b81526004016103519061162d565b60405162461bcd60e51b8152600401610351906114e7565b6003546001600160a01b031681565b6000546001600160a01b031681565b6004546001600160a01b031681565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b179052610d88908490610f24565b505050565b6001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14801590610e355750604051636eb1769f60e11b81526001600160a01b0382169063dd62ed3e90610de39030908690600401611496565b60206040518083038186803b158015610dfb57600080fd5b505afa158015610e0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e339190611402565b155b15610e5057610e506001600160a01b03821683600019610fd5565b5050565b60006001600160a01b03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610e8c57506001600160a01b03811631610f08565b826001600160a01b03166370a08231836040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610ed957600080fd5b505afa158015610eed573d6000803e3d6000fd5b505050506040513d6020811015610f0357600080fd5b505190505b92915050565b600081806020019051810190610f089190611402565b6000610f79826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166110fd9092919063ffffffff16565b805190915015610d8857808060200190516020811015610f9857600080fd5b5051610d885760405162461bcd60e51b815260040180806020018281038252602a81526020018061174d602a913960400191505060405180910390fd5b80158061105b575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b15801561102d57600080fd5b505afa158015611041573d6000803e3d6000fd5b505050506040513d602081101561105757600080fd5b5051155b6110965760405162461bcd60e51b81526004018080602001828103825260368152602001806117776036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663095ea7b360e01b179052610d88908490610f24565b606061110c8484600085611116565b90505b9392505050565b6060824710156111575760405162461bcd60e51b81526004018080602001828103825260268152602001806117276026913960400191505060405180910390fd5b61116085611271565b6111b1576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b602083106111ef5780518252601f1990920191602091820191016111d0565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611251576040519150601f19603f3d011682016040523d82523d6000602084013e611256565b606091505b5091509150611266828286611277565b979650505050505050565b3b151590565b6060831561128657508161110f565b8251156112965782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156112e05781810151838201526020016112c8565b50505050905090810190601f16801561130d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b60006080828403121561132c578081fd5b50919050565b600060208284031215611343578081fd5b813561110f8161170e565b600080600060608486031215611362578182fd5b833561136d8161170e565b92506020840135915060408401356113848161170e565b809150509250925092565b6000602082840312156113a0578081fd5b813567ffffffffffffffff8111156113b6578182fd5b6113c28482850161131b565b949350505050565b6000602082840312156113db578081fd5b813567ffffffffffffffff8111156113f1578182fd5b820160e0818503121561110f578182fd5b600060208284031215611413578081fd5b5051919050565b6000806040838503121561142c578182fd5b82359150602083013561143e8161170e565b809150509250929050565b60008251815b81811015611469576020818601810151858301520161144f565b818111156114775782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b60208082526011908201527f696e76616c6964207377617020696d706c000000000000000000000000000000604082015260600190565b60208082526028908201527f676574457870656374656452657475726e57697468496d706163745f6e6f745360408201527f7570706f72746564000000000000000000000000000000000000000000000000606082015260800190565b60208082526019908201527f7377617042794b796265725377617056333a206661696c656400000000000000604082015260600190565b6020808252601e908201527f676574457870656374656452657475726e5f6e6f74537570706f727465640000604082015260600190565b6020808252601a908201527f6765744578706563746564496e5f6e6f74537570706f72746564000000000000604082015260600190565b60208082526024908201527f6765744578706563746564496e57697468496d706163745f6e6f74537570706f6040820152631c9d195960e21b606082015260800190565b6020808252600e908201527f6f6e6c79207377617020696d706c000000000000000000000000000000000000604082015260600190565b90815260200190565b918252602082015260400190565b6000808335601e19843603018112611691578283fd5b83018035915067ffffffffffffffff8211156116ab578283fd5b60209081019250810236038213156116c257600080fd5b9250929050565b6000808335601e198436030181126116df578283fd5b83018035915067ffffffffffffffff8211156116f9578283fd5b6020019150368190038213156116c257600080fd5b6001600160a01b038116811461172357600080fd5b5056fe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a164736f6c6343000706000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000320849ec0adffcd6fb0212b59a2ec936cdef5fca000000000000000000000000617dee16b86534a5d792a4d7a62fb491b544111e
-----Decoded View---------------
Arg [0] : _admin (address): 0x320849EC0aDffCd6fb0212B59a2EC936cdEF5fCa
Arg [1] : _router (address): 0x617Dee16B86534a5d792A4d7A62FB491B544111E
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000320849ec0adffcd6fb0212b59a2ec936cdef5fca
Arg [1] : 000000000000000000000000617dee16b86534a5d792a4d7a62fb491b544111e
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.