Overview
ETH Balance
0 ETH
Eth Value
$0.00Token Holdings
More Info
Private Name Tags
ContractCreator
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
20614966 | 8 hrs ago | 0.30969 ETH | ||||
20614966 | 8 hrs ago | 0.30969 ETH | ||||
20608045 | 31 hrs ago | 0.004995 ETH | ||||
20608045 | 31 hrs ago | 0.004995 ETH | ||||
20607891 | 32 hrs ago | 0.0077922 ETH | ||||
20607891 | 32 hrs ago | 0.0077922 ETH | ||||
20598675 | 2 days ago | 0.11395593 ETH | ||||
20598675 | 2 days ago | 0.11395593 ETH | ||||
20581756 | 5 days ago | 1.0989 ETH | ||||
20581756 | 5 days ago | 1.0989 ETH | ||||
20581605 | 5 days ago | 1.0989 ETH | ||||
20581605 | 5 days ago | 1.0989 ETH | ||||
20576336 | 5 days ago | 0.00405587 ETH | ||||
20576336 | 5 days ago | 0.00405587 ETH | ||||
20575556 | 5 days ago | 0.00800786 ETH | ||||
20575556 | 5 days ago | 0.00800786 ETH | ||||
20568509 | 6 days ago | 0.61497014 ETH | ||||
20568509 | 6 days ago | 0.61497014 ETH | ||||
20565220 | 7 days ago | 0.00118372 ETH | ||||
20565220 | 7 days ago | 0.00118372 ETH | ||||
20551741 | 9 days ago | 0.02997 ETH | ||||
20551741 | 9 days ago | 0.02997 ETH | ||||
20547391 | 9 days ago | 0.999 ETH | ||||
20547391 | 9 days ago | 0.999 ETH | ||||
20541736 | 10 days ago | 0.07992 ETH |
Loading...
Loading
Contract Name:
Okx
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"; contract Okx is BaseSwap { using SafeERC20 for IERC20Ext; using Address for address; using SafeMath for uint256; address public router; address public okxTokenApprove; event UpdatedAggregationRouter(address router); event UpdatedOkxTokenApprove(address okxTokenApprove); constructor( address _admin, address _router, address _okxTokenApprove ) BaseSwap(_admin) { router = _router; okxTokenApprove = _okxTokenApprove; } function updateAggregationRouter(address _router) external onlyAdmin { router = _router; emit UpdatedAggregationRouter(router); } function updatedOkxTokenApprove(address _okxTokenApprove) external onlyAdmin { okxTokenApprove = _okxTokenApprove; emit UpdatedOkxTokenApprove(okxTokenApprove); } /// @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 getExpectedReturnWithImpact(GetExpectedReturnParams calldata params) external view override onlyProxyContract returns (uint256 destAmount, uint256 priceImpact) { require(false, "getExpectedReturn_notSupported"); } function getExpectedIn(GetExpectedInParams calldata params) external view override onlyProxyContract returns (uint256 srcAmount) { require(false, "getExpectedIn_notSupported"); } function getExpectedInWithImpact(GetExpectedInParams calldata params) external view override onlyProxyContract returns (uint256 srcAmount, uint256 priceImpact) { require(false, "getExpectedIn_notSupported"); } /// @dev swap token /// @notice /// Okx API will returns calls neccessary to build tx /// tx's calls will be passed by params.extraData function swap(SwapParams calldata params) external payable override onlyProxyContract returns (uint256 destAmount) { require(params.tradePath.length == 2, "Okx_invalidTradepath"); safeApproveAllowance(address(okxTokenApprove), IERC20Ext(params.tradePath[0])); IERC20Ext actualDest = IERC20Ext(params.tradePath[params.tradePath.length - 1]); uint256 destBalanceBefore = getBalance(actualDest, address(this)); bool etherIn = IERC20Ext(params.tradePath[0]) == ETH_TOKEN_ADDRESS; uint256 callValue = etherIn ? params.srcAmount : 0; (bool success, ) = router.call{value: callValue}(params.extraArgs); require(success, "Okx_invalidExtraArgs"); uint256 returnAmount = getBalance(actualDest, address(this)).sub(destBalanceBefore); return safeTransferTo(payable(params.recipient), actualDest, returnAmount); } function safeTransferTo( address payable to, IERC20Ext tokenErc, uint256 amount ) internal returns (uint256 amountTransferred) { if (tokenErc == ETH_TOKEN_ADDRESS) { (bool success, ) = to.call{value: amount}(""); require(success, "transfer failed"); amountTransferred = amount; } else { uint256 balanceBefore = tokenErc.balanceOf(to); tokenErc.safeTransfer(to, amount); amountTransferred = tokenErc.balanceOf(to).sub(balanceBefore); } } }
// 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); }
// 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"},{"internalType":"address","name":"_okxTokenApprove","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":false,"internalType":"address","name":"okxTokenApprove","type":"address"}],"name":"UpdatedOkxTokenApprove","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":"okxTokenApprove","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"address","name":"_okxTokenApprove","type":"address"}],"name":"updatedOkxTokenApprove","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
60806040523480156200001157600080fd5b5060405162001b8f38038062001b8f8339810160408190526200003491620000e3565b8280806001600160a01b0381166200007d576040805162461bcd60e51b8152602060048201526007602482015266061646d696e20360cc1b604482015290519081900360640190fd5b600080546001600160a01b03199081166001600160a01b03938416179091556004805482169683169690961790955560058054909516931692909217909255506200012c915050565b80516001600160a01b0381168114620000de57600080fd5b919050565b600080600060608486031215620000f8578283fd5b6200010384620000c6565b92506200011360208501620000c6565b91506200012360408501620000c6565b90509250925092565b611a53806200013c6000396000f3fe6080604052600436106101485760003560e01c806368aa6dd9116100c0578063ce56c45411610074578063ed55044311610059578063ed5504431461034e578063f851a44014610363578063f887ea40146103785761014f565b8063ce56c4541461030e578063e19b609d1461032e5761014f565b806377f50f97116100a557806377f50f97146102b95780637acc8678146102ce578063af9f8f0b146102ee5761014f565b806368aa6dd91461028657806375829def146102995761014f565b8063267822471161011757806343bea4b3116100fc57806343bea4b3146102265780634db1d03d1461024657806351bf1484146102665761014f565b806326782247146101f15780633ccdbb28146102065761014f565b806305a7270914610154578063137352461461018b57806316107a31146101ad578063249d39e9146101cf5761014f565b3661014f57005b600080fd5b34801561016057600080fd5b5061017461016f36600461168a565b61038d565b604051610182929190611907565b60405180910390f35b34801561019757600080fd5b506101ab6101a636600461162d565b6103dd565b005b3480156101b957600080fd5b506101c26104ab565b604051610182919061174f565b3480156101db57600080fd5b506101e46104ba565b60405161018291906118fe565b3480156101fd57600080fd5b506101c26104c0565b34801561021257600080fd5b506101ab610221366004611649565b6104cf565b34801561023257600080fd5b506101e461024136600461168a565b61057e565b34801561025257600080fd5b506101e461026136600461168a565b6105c3565b34801561027257600080fd5b506101ab61028136600461162d565b6105f0565b6101e46102943660046116bd565b610698565b3480156102a557600080fd5b506101ab6102b436600461162d565b6108b4565b3480156102c557600080fd5b506101ab6109b9565b3480156102da57600080fd5b506101ab6102e936600461162d565b610a8b565b3480156102fa57600080fd5b506101ab61030936600461162d565b610bd8565b34801561031a57600080fd5b506101ab61032936600461170d565b610c75565b34801561033a57600080fd5b5061017461034936600461168a565b610daf565b34801561035a57600080fd5b506101c2610dde565b34801561036f57600080fd5b506101c2610ded565b34801561038457600080fd5b506101c2610dfc565b60035460009081906001600160a01b031633146103c55760405162461bcd60e51b81526004016103bc906118c7565b60405180910390fd5b60405162461bcd60e51b81526004016103bc90611822565b6000546001600160a01b03163314610429576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b03811661044f5760405162461bcd60e51b81526004016103bc9061177d565b6003546040516001600160a01b038084169216907f7c5d026310440df4ec67ef47368cd26898f9dbec4b95934dbbc4a3d9d46c49a990600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6005546001600160a01b031681565b61271081565b6001546001600160a01b031681565b6000546001600160a01b0316331461051b576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b61052f6001600160a01b0384168284610e0b565b604080516001600160a01b0380861682526020820185905283168183015290517f72cb8a894ddb372ceec3d2a7648d86f17d5a15caae0e986c53109b8a9a9385e69181900360600190a1505050565b6003546000906001600160a01b031633146105ab5760405162461bcd60e51b81526004016103bc906118c7565b60405162461bcd60e51b81526004016103bc906117eb565b6003546000906001600160a01b031633146103c55760405162461bcd60e51b81526004016103bc906118c7565b6000546001600160a01b0316331461063c576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0383811691909117918290556040517faae83401f24c32e46a488371b9f1793f41c7f34857f96d091633a1919f7a428e9261068d92169061174f565b60405180910390a150565b6003546000906001600160a01b031633146106c55760405162461bcd60e51b81526004016103bc906118c7565b6106d26040830183611915565b90506002146106f35760405162461bcd60e51b81526004016103bc906117b4565b600554610735906001600160a01b03166107106040850185611915565b600081811061071b57fe5b9050602002016020810190610730919061162d565b610e77565b60006107446040840184611915565b60016107536040870187611915565b90500381811061075f57fe5b9050602002016020810190610774919061162d565b905060006107828230610f3e565b9050600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6107a86040870187611915565b60008181106107b357fe5b90506020020160208101906107c8919061162d565b6001600160a01b03161490506000816107e25760006107e5565b85355b6004549091506000906001600160a01b03168261080560c08a018a611963565b60405161081392919061173c565b60006040518083038185875af1925050503d8060008114610850576040519150601f19603f3d011682016040523d82523d6000602084013e610855565b606091505b50509050806108765760405162461bcd60e51b81526004016103bc90611859565b600061088c856108868830610f3e565b90610ff8565b90506108a86108a160808a0160608b0161162d565b8783611055565b98975050505050505050565b6000546001600160a01b03163314610900576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b03811661095b576040805162461bcd60e51b815260206004820152600b60248201527f6e65772061646d696e2030000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b03163314610a18576040805162461bcd60e51b815260206004820152600b60248201527f6e6f742070656e64696e67000000000000000000000000000000000000000000604482015290519081900360640190fd5b600154600054604080516001600160a01b03938416815292909116602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b03163314610ad7576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b038116610b32576040805162461bcd60e51b815260206004820152600760248201527f61646d696e203000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600054604080516001600160a01b038085168252909216602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610c24576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b600580546001600160a01b0319166001600160a01b0383811691909117918290556040517fbd67d1749eff58c7cd625166726c9b27e9548f580bcc307967af7a7d388cb5369261068d92169061174f565b6000546001600160a01b03163314610cc1576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6040516000906001600160a01b0383169084908381818185875af1925050503d8060008114610d0c576040519150601f19603f3d011682016040523d82523d6000602084013e610d11565b606091505b5050905080610d67576040805162461bcd60e51b815260206004820152600f60248201527f7769746864726177206661696c65640000000000000000000000000000000000604482015290519081900360640190fd5b604080518481526001600160a01b038416602082015281517fec47e7ed86c86774d1a72c19f35c639911393fe7c1a34031fdbd260890da90de929181900390910190a1505050565b60035460009081906001600160a01b031633146105ab5760405162461bcd60e51b81526004016103bc906118c7565b6003546001600160a01b031681565b6000546001600160a01b031681565b6004546001600160a01b031681565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b179052610e72908490611221565b505050565b6001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14801590610f1f5750604051636eb1769f60e11b81526001600160a01b0382169063dd62ed3e90610ecd9030908690600401611763565b60206040518083038186803b158015610ee557600080fd5b505afa158015610ef9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1d91906116f5565b155b15610f3a57610f3a6001600160a01b038216836000196112d2565b5050565b60006001600160a01b03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610f7657506001600160a01b03811631610ff2565b826001600160a01b03166370a08231836040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610fc357600080fd5b505afa158015610fd7573d6000803e3d6000fd5b505050506040513d6020811015610fed57600080fd5b505190505b92915050565b60008282111561104f576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006001600160a01b03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611101576000846001600160a01b0316836040516110959061174c565b60006040518083038185875af1925050503d80600081146110d2576040519150601f19603f3d011682016040523d82523d6000602084013e6110d7565b606091505b50509050806110f85760405162461bcd60e51b81526004016103bc90611890565b8291505061121a565b6040516370a0823160e01b81526000906001600160a01b038516906370a082319061113090889060040161174f565b60206040518083038186803b15801561114857600080fd5b505afa15801561115c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118091906116f5565b90506111966001600160a01b0385168685610e0b565b61121681856001600160a01b03166370a08231886040518263ffffffff1660e01b81526004016111c6919061174f565b60206040518083038186803b1580156111de57600080fd5b505afa1580156111f2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088691906116f5565b9150505b9392505050565b6000611276826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113fa9092919063ffffffff16565b805190915015610e725780806020019051602081101561129557600080fd5b5051610e725760405162461bcd60e51b815260040180806020018281038252602a8152602001806119e7602a913960400191505060405180910390fd5b801580611358575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b15801561132a57600080fd5b505afa15801561133e573d6000803e3d6000fd5b505050506040513d602081101561135457600080fd5b5051155b6113935760405162461bcd60e51b8152600401808060200182810382526036815260200180611a116036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663095ea7b360e01b179052610e72908490611221565b60606114098484600085611411565b949350505050565b6060824710156114525760405162461bcd60e51b81526004018080602001828103825260268152602001806119c16026913960400191505060405180910390fd5b61145b8561156c565b6114ac576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b602083106114ea5780518252601f1990920191602091820191016114cb565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461154c576040519150601f19603f3d011682016040523d82523d6000602084013e611551565b606091505b5091509150611561828286611572565b979650505050505050565b3b151590565b6060831561158157508161121a565b8251156115915782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156115db5781810151838201526020016115c3565b50505050905090810190601f1680156116085780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b600060808284031215611627578081fd5b50919050565b60006020828403121561163e578081fd5b813561121a816119a8565b60008060006060848603121561165d578182fd5b8335611668816119a8565b925060208401359150604084013561167f816119a8565b809150509250925092565b60006020828403121561169b578081fd5b813567ffffffffffffffff8111156116b1578182fd5b61140984828501611616565b6000602082840312156116ce578081fd5b813567ffffffffffffffff8111156116e4578182fd5b820160e0818503121561121a578182fd5b600060208284031215611706578081fd5b5051919050565b6000806040838503121561171f578182fd5b823591506020830135611731816119a8565b809150509250929050565b6000828483379101908152919050565b90565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b60208082526011908201527f696e76616c6964207377617020696d706c000000000000000000000000000000604082015260600190565b60208082526014908201527f4f6b785f696e76616c6964547261646570617468000000000000000000000000604082015260600190565b6020808252601e908201527f676574457870656374656452657475726e5f6e6f74537570706f727465640000604082015260600190565b6020808252601a908201527f6765744578706563746564496e5f6e6f74537570706f72746564000000000000604082015260600190565b60208082526014908201527f4f6b785f696e76616c6964457874726141726773000000000000000000000000604082015260600190565b6020808252600f908201527f7472616e73666572206661696c65640000000000000000000000000000000000604082015260600190565b6020808252600e908201527f6f6e6c79207377617020696d706c000000000000000000000000000000000000604082015260600190565b90815260200190565b918252602082015260400190565b6000808335601e1984360301811261192b578283fd5b83018035915067ffffffffffffffff821115611945578283fd5b602090810192508102360382131561195c57600080fd5b9250929050565b6000808335601e19843603018112611979578283fd5b83018035915067ffffffffffffffff821115611993578283fd5b60200191503681900382131561195c57600080fd5b6001600160a01b03811681146119bd57600080fd5b5056fe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a164736f6c6343000706000a0000000000000000000000005012c645ad7de348147fb9d99b6b8d8949748e170000000000000000000000003b3ae790df4f312e745d270119c6052904fb679000000000000000000000000040aa958dd87fc8305b97f2ba922cddca374bcd7f
Deployed Bytecode
0x6080604052600436106101485760003560e01c806368aa6dd9116100c0578063ce56c45411610074578063ed55044311610059578063ed5504431461034e578063f851a44014610363578063f887ea40146103785761014f565b8063ce56c4541461030e578063e19b609d1461032e5761014f565b806377f50f97116100a557806377f50f97146102b95780637acc8678146102ce578063af9f8f0b146102ee5761014f565b806368aa6dd91461028657806375829def146102995761014f565b8063267822471161011757806343bea4b3116100fc57806343bea4b3146102265780634db1d03d1461024657806351bf1484146102665761014f565b806326782247146101f15780633ccdbb28146102065761014f565b806305a7270914610154578063137352461461018b57806316107a31146101ad578063249d39e9146101cf5761014f565b3661014f57005b600080fd5b34801561016057600080fd5b5061017461016f36600461168a565b61038d565b604051610182929190611907565b60405180910390f35b34801561019757600080fd5b506101ab6101a636600461162d565b6103dd565b005b3480156101b957600080fd5b506101c26104ab565b604051610182919061174f565b3480156101db57600080fd5b506101e46104ba565b60405161018291906118fe565b3480156101fd57600080fd5b506101c26104c0565b34801561021257600080fd5b506101ab610221366004611649565b6104cf565b34801561023257600080fd5b506101e461024136600461168a565b61057e565b34801561025257600080fd5b506101e461026136600461168a565b6105c3565b34801561027257600080fd5b506101ab61028136600461162d565b6105f0565b6101e46102943660046116bd565b610698565b3480156102a557600080fd5b506101ab6102b436600461162d565b6108b4565b3480156102c557600080fd5b506101ab6109b9565b3480156102da57600080fd5b506101ab6102e936600461162d565b610a8b565b3480156102fa57600080fd5b506101ab61030936600461162d565b610bd8565b34801561031a57600080fd5b506101ab61032936600461170d565b610c75565b34801561033a57600080fd5b5061017461034936600461168a565b610daf565b34801561035a57600080fd5b506101c2610dde565b34801561036f57600080fd5b506101c2610ded565b34801561038457600080fd5b506101c2610dfc565b60035460009081906001600160a01b031633146103c55760405162461bcd60e51b81526004016103bc906118c7565b60405180910390fd5b60405162461bcd60e51b81526004016103bc90611822565b6000546001600160a01b03163314610429576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b03811661044f5760405162461bcd60e51b81526004016103bc9061177d565b6003546040516001600160a01b038084169216907f7c5d026310440df4ec67ef47368cd26898f9dbec4b95934dbbc4a3d9d46c49a990600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6005546001600160a01b031681565b61271081565b6001546001600160a01b031681565b6000546001600160a01b0316331461051b576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b61052f6001600160a01b0384168284610e0b565b604080516001600160a01b0380861682526020820185905283168183015290517f72cb8a894ddb372ceec3d2a7648d86f17d5a15caae0e986c53109b8a9a9385e69181900360600190a1505050565b6003546000906001600160a01b031633146105ab5760405162461bcd60e51b81526004016103bc906118c7565b60405162461bcd60e51b81526004016103bc906117eb565b6003546000906001600160a01b031633146103c55760405162461bcd60e51b81526004016103bc906118c7565b6000546001600160a01b0316331461063c576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0383811691909117918290556040517faae83401f24c32e46a488371b9f1793f41c7f34857f96d091633a1919f7a428e9261068d92169061174f565b60405180910390a150565b6003546000906001600160a01b031633146106c55760405162461bcd60e51b81526004016103bc906118c7565b6106d26040830183611915565b90506002146106f35760405162461bcd60e51b81526004016103bc906117b4565b600554610735906001600160a01b03166107106040850185611915565b600081811061071b57fe5b9050602002016020810190610730919061162d565b610e77565b60006107446040840184611915565b60016107536040870187611915565b90500381811061075f57fe5b9050602002016020810190610774919061162d565b905060006107828230610f3e565b9050600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6107a86040870187611915565b60008181106107b357fe5b90506020020160208101906107c8919061162d565b6001600160a01b03161490506000816107e25760006107e5565b85355b6004549091506000906001600160a01b03168261080560c08a018a611963565b60405161081392919061173c565b60006040518083038185875af1925050503d8060008114610850576040519150601f19603f3d011682016040523d82523d6000602084013e610855565b606091505b50509050806108765760405162461bcd60e51b81526004016103bc90611859565b600061088c856108868830610f3e565b90610ff8565b90506108a86108a160808a0160608b0161162d565b8783611055565b98975050505050505050565b6000546001600160a01b03163314610900576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b03811661095b576040805162461bcd60e51b815260206004820152600b60248201527f6e65772061646d696e2030000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b03163314610a18576040805162461bcd60e51b815260206004820152600b60248201527f6e6f742070656e64696e67000000000000000000000000000000000000000000604482015290519081900360640190fd5b600154600054604080516001600160a01b03938416815292909116602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b03163314610ad7576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b038116610b32576040805162461bcd60e51b815260206004820152600760248201527f61646d696e203000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600054604080516001600160a01b038085168252909216602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610c24576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b600580546001600160a01b0319166001600160a01b0383811691909117918290556040517fbd67d1749eff58c7cd625166726c9b27e9548f580bcc307967af7a7d388cb5369261068d92169061174f565b6000546001600160a01b03163314610cc1576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6040516000906001600160a01b0383169084908381818185875af1925050503d8060008114610d0c576040519150601f19603f3d011682016040523d82523d6000602084013e610d11565b606091505b5050905080610d67576040805162461bcd60e51b815260206004820152600f60248201527f7769746864726177206661696c65640000000000000000000000000000000000604482015290519081900360640190fd5b604080518481526001600160a01b038416602082015281517fec47e7ed86c86774d1a72c19f35c639911393fe7c1a34031fdbd260890da90de929181900390910190a1505050565b60035460009081906001600160a01b031633146105ab5760405162461bcd60e51b81526004016103bc906118c7565b6003546001600160a01b031681565b6000546001600160a01b031681565b6004546001600160a01b031681565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b179052610e72908490611221565b505050565b6001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14801590610f1f5750604051636eb1769f60e11b81526001600160a01b0382169063dd62ed3e90610ecd9030908690600401611763565b60206040518083038186803b158015610ee557600080fd5b505afa158015610ef9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1d91906116f5565b155b15610f3a57610f3a6001600160a01b038216836000196112d2565b5050565b60006001600160a01b03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610f7657506001600160a01b03811631610ff2565b826001600160a01b03166370a08231836040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610fc357600080fd5b505afa158015610fd7573d6000803e3d6000fd5b505050506040513d6020811015610fed57600080fd5b505190505b92915050565b60008282111561104f576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006001600160a01b03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611101576000846001600160a01b0316836040516110959061174c565b60006040518083038185875af1925050503d80600081146110d2576040519150601f19603f3d011682016040523d82523d6000602084013e6110d7565b606091505b50509050806110f85760405162461bcd60e51b81526004016103bc90611890565b8291505061121a565b6040516370a0823160e01b81526000906001600160a01b038516906370a082319061113090889060040161174f565b60206040518083038186803b15801561114857600080fd5b505afa15801561115c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118091906116f5565b90506111966001600160a01b0385168685610e0b565b61121681856001600160a01b03166370a08231886040518263ffffffff1660e01b81526004016111c6919061174f565b60206040518083038186803b1580156111de57600080fd5b505afa1580156111f2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088691906116f5565b9150505b9392505050565b6000611276826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113fa9092919063ffffffff16565b805190915015610e725780806020019051602081101561129557600080fd5b5051610e725760405162461bcd60e51b815260040180806020018281038252602a8152602001806119e7602a913960400191505060405180910390fd5b801580611358575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b15801561132a57600080fd5b505afa15801561133e573d6000803e3d6000fd5b505050506040513d602081101561135457600080fd5b5051155b6113935760405162461bcd60e51b8152600401808060200182810382526036815260200180611a116036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663095ea7b360e01b179052610e72908490611221565b60606114098484600085611411565b949350505050565b6060824710156114525760405162461bcd60e51b81526004018080602001828103825260268152602001806119c16026913960400191505060405180910390fd5b61145b8561156c565b6114ac576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b602083106114ea5780518252601f1990920191602091820191016114cb565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461154c576040519150601f19603f3d011682016040523d82523d6000602084013e611551565b606091505b5091509150611561828286611572565b979650505050505050565b3b151590565b6060831561158157508161121a565b8251156115915782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156115db5781810151838201526020016115c3565b50505050905090810190601f1680156116085780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b600060808284031215611627578081fd5b50919050565b60006020828403121561163e578081fd5b813561121a816119a8565b60008060006060848603121561165d578182fd5b8335611668816119a8565b925060208401359150604084013561167f816119a8565b809150509250925092565b60006020828403121561169b578081fd5b813567ffffffffffffffff8111156116b1578182fd5b61140984828501611616565b6000602082840312156116ce578081fd5b813567ffffffffffffffff8111156116e4578182fd5b820160e0818503121561121a578182fd5b600060208284031215611706578081fd5b5051919050565b6000806040838503121561171f578182fd5b823591506020830135611731816119a8565b809150509250929050565b6000828483379101908152919050565b90565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b60208082526011908201527f696e76616c6964207377617020696d706c000000000000000000000000000000604082015260600190565b60208082526014908201527f4f6b785f696e76616c6964547261646570617468000000000000000000000000604082015260600190565b6020808252601e908201527f676574457870656374656452657475726e5f6e6f74537570706f727465640000604082015260600190565b6020808252601a908201527f6765744578706563746564496e5f6e6f74537570706f72746564000000000000604082015260600190565b60208082526014908201527f4f6b785f696e76616c6964457874726141726773000000000000000000000000604082015260600190565b6020808252600f908201527f7472616e73666572206661696c65640000000000000000000000000000000000604082015260600190565b6020808252600e908201527f6f6e6c79207377617020696d706c000000000000000000000000000000000000604082015260600190565b90815260200190565b918252602082015260400190565b6000808335601e1984360301811261192b578283fd5b83018035915067ffffffffffffffff821115611945578283fd5b602090810192508102360382131561195c57600080fd5b9250929050565b6000808335601e19843603018112611979578283fd5b83018035915067ffffffffffffffff821115611993578283fd5b60200191503681900382131561195c57600080fd5b6001600160a01b03811681146119bd57600080fd5b5056fe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a164736f6c6343000706000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000005012c645ad7de348147fb9d99b6b8d8949748e170000000000000000000000003b3ae790df4f312e745d270119c6052904fb679000000000000000000000000040aa958dd87fc8305b97f2ba922cddca374bcd7f
-----Decoded View---------------
Arg [0] : _admin (address): 0x5012c645AD7De348147fB9d99b6b8D8949748e17
Arg [1] : _router (address): 0x3b3ae790Df4F312e745D270119c6052904FB6790
Arg [2] : _okxTokenApprove (address): 0x40aA958dd87FC8305b97f2BA922CDdCa374bcD7f
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000005012c645ad7de348147fb9d99b6b8d8949748e17
Arg [1] : 0000000000000000000000003b3ae790df4f312e745d270119c6052904fb6790
Arg [2] : 00000000000000000000000040aa958dd87fc8305b97f2ba922cddca374bcd7f
Loading...
Loading
Loading...
Loading
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.