FTM Price: $0.569853 (-11.88%)
 

Overview

FTM Balance

Fantom LogoFantom LogoFantom Logo0 FTM

FTM Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Trade1032557322025-01-22 12:48:5322 hrs ago1737550133IN
0xcF55b660...062461DFC
0 FTM0.000370861.2300312
Trade1031340802025-01-20 20:00:182 days ago1737403218IN
0xcF55b660...062461DFC
0.10011464 FTM0.000413191.85901386
Trade1020414452025-01-06 7:53:2417 days ago1736150004IN
0xcF55b660...062461DFC
0 FTM0.000324721.36316419
Trade1020414122025-01-06 7:52:4817 days ago1736149968IN
0xcF55b660...062461DFC
0 FTM0.000354231.36276114
Trade997054902024-12-10 22:33:0343 days ago1733869983IN
0xcF55b660...062461DFC
0 FTM0.002423299.34978168
Trade991558602024-12-04 21:39:1549 days ago1733348355IN
0xcF55b660...062461DFC
0 FTM0.0025872511.37783045
Trade977885492024-11-20 3:24:3064 days ago1732073070IN
0xcF55b660...062461DFC
0 FTM0.001593625.31359211
Trade977523162024-11-19 18:05:4464 days ago1732039544IN
0xcF55b660...062461DFC
0 FTM0.002373495.91622441
Trade977522812024-11-19 18:05:0364 days ago1732039503IN
0xcF55b660...062461DFC
0 FTM0.003069655.72981245
Trade977521442024-11-19 18:02:2464 days ago1732039344IN
0xcF55b660...062461DFC
3 FTM0.001215445.73680098
Trade977520852024-11-19 18:01:2564 days ago1732039285IN
0xcF55b660...062461DFC
2 FTM0.001175985.74957793
Trade977520462024-11-19 18:00:3664 days ago1732039236IN
0xcF55b660...062461DFC
0.5 FTM0.00190159.29727459
Trade977519702024-11-19 17:59:1964 days ago1732039159IN
0xcF55b660...062461DFC
0.9 FTM0.001300935.86098692
Trade977506182024-11-19 17:33:5064 days ago1732037630IN
0xcF55b660...062461DFC
0 FTM0.003739655.90763394
Trade977504572024-11-19 17:30:4964 days ago1732037449IN
0xcF55b660...062461DFC
0 FTM0.003741965.91129281
Trade977504282024-11-19 17:30:1064 days ago1732037410IN
0xcF55b660...062461DFC
0 FTM0.003742715.91247588
Trade977504112024-11-19 17:29:3964 days ago1732037379IN
0xcF55b660...062461DFC
0 FTM0.003743845.91425337
Trade977503902024-11-19 17:29:1064 days ago1732037350IN
0xcF55b660...062461DFC
0 FTM0.003744515.91532102
Trade977503692024-11-19 17:28:4564 days ago1732037325IN
0xcF55b660...062461DFC
0 FTM0.003745155.91633096
Trade977503572024-11-19 17:28:2364 days ago1732037303IN
0xcF55b660...062461DFC
0 FTM0.003955865.91758328
Trade977502942024-11-19 17:27:1664 days ago1732037236IN
0xcF55b660...062461DFC
2 FTM0.002080275.9186567
Trade977502642024-11-19 17:26:3664 days ago1732037196IN
0xcF55b660...062461DFC
0.09 FTM0.001742395.92361406
Trade977501482024-11-19 17:24:3064 days ago1732037070IN
0xcF55b660...062461DFC
0.09 FTM0.002115995.78518906
Trade977500652024-11-19 17:22:4264 days ago1732036962IN
0xcF55b660...062461DFC
0.09 FTM0.00171385.82639816
Trade977500202024-11-19 17:21:5364 days ago1732036913IN
0xcF55b660...062461DFC
0.09 FTM0.001721815.85365025
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
1032557322025-01-22 12:48:5322 hrs ago1737550133
0xcF55b660...062461DFC
0.03297156 FTM
1032557322025-01-22 12:48:5322 hrs ago1737550133
0xcF55b660...062461DFC
0.00009921 FTM
1032557322025-01-22 12:48:5322 hrs ago1737550133
0xcF55b660...062461DFC
0.03307077 FTM
1031340802025-01-20 20:00:182 days ago1737403218
0xcF55b660...062461DFC
0.09981429 FTM
1031340802025-01-20 20:00:182 days ago1737403218
0xcF55b660...062461DFC
0.00030034 FTM
1020414452025-01-06 7:53:2417 days ago1736150004
0xcF55b660...062461DFC
0.00000001 FTM
1020414452025-01-06 7:53:2417 days ago1736150004
0xcF55b660...062461DFC
0 FTM
1020414452025-01-06 7:53:2417 days ago1736150004
0xcF55b660...062461DFC
0.00000001 FTM
1020414122025-01-06 7:52:4817 days ago1736149968
0xcF55b660...062461DFC
0.54592886 FTM
1020414122025-01-06 7:52:4817 days ago1736149968
0xcF55b660...062461DFC
0.00164271 FTM
1020414122025-01-06 7:52:4817 days ago1736149968
0xcF55b660...062461DFC
0.54757157 FTM
997054902024-12-10 22:33:0343 days ago1733869983
0xcF55b660...062461DFC
5.64458082 FTM
997054902024-12-10 22:33:0343 days ago1733869983
0xcF55b660...062461DFC
0.01698469 FTM
997054902024-12-10 22:33:0343 days ago1733869983
0xcF55b660...062461DFC
5.66156552 FTM
991558602024-12-04 21:39:1549 days ago1733348355
0xcF55b660...062461DFC
6.4638311 FTM
991558602024-12-04 21:39:1549 days ago1733348355
0xcF55b660...062461DFC
0.01944984 FTM
991558602024-12-04 21:39:1549 days ago1733348355
0xcF55b660...062461DFC
6.48328094 FTM
977521442024-11-19 18:02:2464 days ago1732039344
0xcF55b660...062461DFC
2.991 FTM
977521442024-11-19 18:02:2464 days ago1732039344
0xcF55b660...062461DFC
0.009 FTM
977520852024-11-19 18:01:2564 days ago1732039285
0xcF55b660...062461DFC
1.994 FTM
977520852024-11-19 18:01:2564 days ago1732039285
0xcF55b660...062461DFC
0.006 FTM
977520462024-11-19 18:00:3664 days ago1732039236
0xcF55b660...062461DFC
0.4985 FTM
977520462024-11-19 18:00:3664 days ago1732039236
0xcF55b660...062461DFC
0.0015 FTM
977519702024-11-19 17:59:1964 days ago1732039159
0xcF55b660...062461DFC
0.8973 FTM
977519702024-11-19 17:59:1964 days ago1732039159
0xcF55b660...062461DFC
0.0027 FTM
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
UxuyProtocol

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion
File 1 of 15 : UxuyProtocol.sol
//SPDX-License-Identifier: UXUY
pragma solidity ^0.8.11;

import "./interfaces/IProtocol.sol";
import "./interfaces/ISwap.sol";
import "./interfaces/IBridge.sol";
import "./libraries/Adminable.sol";
import "./libraries/CommonBase.sol";
import "./libraries/SafeNativeAsset.sol";
import "./libraries/SafeERC20.sol";

contract UxuyProtocol is IProtocol, Adminable, CommonBase {
    using SafeNativeAsset for address;
    using SafeERC20 for IERC20;

    struct TradeState {
        address tokenIn;
        address tokenOut;
        int feeTokenIndex;
        address feeToken;
        uint256 feeAmount;
        uint256 feeShareAmount;
        uint256 extraFeeAmount;
        address nextRecipient;
    }

    // zero address
    address internal constant NULL_ADDRESS = address(0);

    // fee rate denominator
    uint256 private constant FEE_DENOMINATOR = 1e6;

    // maximum allowed fee rate
    uint256 private constant MAX_FEE_RATE = 1e5;

    // maximum allowed extra fee ratio
    uint256 private constant MAX_EXTRA_FEE_RATIO = 2;

    // swap contract
    ISwap private _swapContract;

    // bridge contract
    IBridge private _bridgeContract;

    // total fee rate in 1/FEE_DENOMINATOR
    uint256 private _feeRate;

    // fee share rate in 1/FEE_DENOMINATOR
    uint256 private _feeShareRate;

    // recipient address to receive fee in main tokens
    address private _mainFeeRecipient;

    // recipient address to receive fee in other tokens
    address private _altFeeRecipient;

    // free of charge accounts
    mapping(address => bool) private _focAccounts;

    // main tokens for fee charging
    mapping(address => bool) private _mainFeeTokens;

    // @dev Emitted when relying contract is updated
    event ContractChanged(address swap, address bridge);

    // @dev Emitted when fee recipient is updated
    event FeeRecipientChanged(address main, address alt);

    // @dev Emitted when FOC account is updated
    event FOCAccountChanged(address account, bool foc);

    // @dev Emitted when fee token is updated
    event FeeTokenChanged(address token, bool main);

    // @param swapContract_ the Swap contract address
    // @param bridgeContract_ the Bridge contract address
    // @param feeRate_ the total fee rate
    // @param feeShareRate_ the fee share rate
    // @param mainFeeRecipient_ the account to receive fee in main tokens
    // @param altFeeRecipient_ the account to receive fee in other tokens
    constructor(
        address swapContract_,
        address bridgeContract_,
        uint256 feeRate_,
        uint256 feeShareRate_,
        address mainFeeRecipient_,
        address altFeeRecipient_
    ) {
        _setContract(swapContract_, bridgeContract_);
        _setFeeRate(feeRate_, feeShareRate_);
        _setFeeRecipient(mainFeeRecipient_, altFeeRecipient_);
    }

    function swapContract() external view override returns (address) {
        return address(_swapContract);
    }

    function bridgeContract() external view override returns (address) {
        return address(_bridgeContract);
    }

    function feeDenominator() external pure returns (uint256) {
        return FEE_DENOMINATOR;
    }

    function feeRate() external view returns (uint256) {
        return _feeRate;
    }

    function feeShareRate() external view returns (uint256) {
        return _feeShareRate;
    }

    // @dev check if the account is free of charge
    function isFOCAccount(address account) external view returns (bool) {
        return _focAccounts[account];
    }

    // @dev changes the swap and bridge contract addresses
    function setContract(address swapContract_, address bridgeContract_) external onlyAdmin {
        _setContract(swapContract_, bridgeContract_);
    }

    // @dev changes the fee rate
    function setFeeRate(uint256 feeRate_, uint256 feeShareRate_) external onlyAdmin {
        _setFeeRate(feeRate_, feeShareRate_);
    }

    // @dev changes the fee recipients
    function setFeeRecipient(address main, address alt) external onlyAdmin {
        _setFeeRecipient(main, alt);
    }

    // @dev updates free of charge accounts
    function updateFOCAccounts(address[] calldata accounts, bool foc) external onlyAdmin {
        for (uint256 i = 0; i < accounts.length; i++) {
            if (foc) {
                _focAccounts[accounts[i]] = true;
            } else {
                delete _focAccounts[accounts[i]];
            }
            emit FOCAccountChanged(accounts[i], foc);
        }
    }

    // @dev changes the token accept status
    function updateFeeTokens(address[] calldata tokens, bool main) external onlyAdmin {
        for (uint256 i = 0; i < tokens.length; i++) {
            if (main) {
                _mainFeeTokens[tokens[i]] = true;
            } else {
                delete _mainFeeTokens[tokens[i]];
            }
            emit FeeTokenChanged(tokens[i], main);
        }
    }

    function trade(
        TradeParams calldata params
    )
        external
        payable
        whenNotPaused
        noDelegateCall
        nonReentrant
        checkDeadline(params.deadline)
        returns (uint256 amountOut, uint256 bridgeTxnID)
    {
        TradeState memory state;
        if (params.swaps.length > 0) {
            for (uint256 i = 0; i < params.swaps.length; i++) {
                require(
                    params.swaps[i].provider != NULL_ADDRESS,
                    "UP: invalid swap provider"
                );
            }
            state.tokenIn = params.swaps[0].path[0];
            state.nextRecipient = params.swaps[0].provider;
            if (params.bridge.provider != NULL_ADDRESS) {
                require(
                    _tokenOut(params.swaps[params.swaps.length - 1].path) == params.bridge.tokenIn,
                    "UP: swap and bridge token mismatch"
                );
            }
        } else {
            state.tokenIn = params.bridge.tokenIn;
            state.nextRecipient = params.bridge.provider;
        }
        if (params.bridge.provider == NULL_ADDRESS) {
            state.tokenOut = _tokenOut(params.swaps[params.swaps.length - 1].path);
        } else {
            require(
                params.bridge.provider != NULL_ADDRESS,
                "UP: invalid bridge provider"
            );
            state.tokenOut = params.bridge.tokenOut;
        }
        if (state.tokenIn.isNativeAsset()) {
            require(msg.value >= params.amountIn, "UP: not enough ETH in transaction");
            amountOut = msg.value;
        } else {
            require(
                IERC20(state.tokenIn).balanceOf(_msgSender()) >= params.amountIn,
                "UP: sender token balance is not enough"
            );
            require(
                IERC20(state.tokenIn).allowance(_msgSender(), address(this)) >= params.amountIn,
                "UP: token allowance is not enough"
            );
            amountOut = params.amountIn;
        }
        if (params.extraFeeAmountIn > 0) {
            require(amountOut >= params.extraFeeAmountIn * MAX_EXTRA_FEE_RATIO, "UP: extra fee exceeds limit");
            state.extraFeeAmount = _payExtraFee(state.tokenIn, params.extraFeeAmountIn, params.extraFeeSwaps);
            amountOut -= params.extraFeeAmountIn;
        }
        state.feeTokenIndex = _findFeeToken(params.swaps);
        state.feeToken = NULL_ADDRESS;
        state.feeAmount = 0;
        state.feeShareAmount = 0;
        if (state.feeTokenIndex == 0) {
            state.feeToken = state.tokenIn;
            (amountOut, state.feeAmount, state.feeShareAmount) = _payFee(
                state.tokenIn.isNativeAsset() ? address(this) : _msgSender(),
                state.feeToken,
                amountOut,
                params.feeShareRecipient
            );
        }
        if (state.tokenIn.isNativeAsset()) {
            state.nextRecipient.safeTransfer(amountOut);
        } else {
            uint256 balanceBefore = IERC20(state.tokenIn).balanceOf(state.nextRecipient);
            IERC20(state.tokenIn).safeTransferFrom(_msgSender(), state.nextRecipient, amountOut);
            amountOut = IERC20(state.tokenIn).balanceOf(state.nextRecipient) - balanceBefore;
        }
        for (uint256 i = 0; i < params.swaps.length; i++) {
            SwapParams calldata swap = params.swaps[i];
            if (i + 1 < params.swaps.length) {
                state.nextRecipient = params.swaps[i + 1].provider;
            } else if (params.bridge.provider != NULL_ADDRESS) {
                state.nextRecipient = params.bridge.provider;
            } else {
                state.nextRecipient = params.recipient;
            }
            amountOut = _swapContract.swap(
                ISwap.SwapParams({
                    provider: swap.provider,
                    router: swap.router,
                    path: swap.path,
                    amountIn: amountOut,
                    minAmountOut: swap.minAmountOut,
                    recipient: (state.feeTokenIndex == int(i + 1)) ? address(this) : state.nextRecipient,
                    data: swap.data
                })
            );
            if (state.feeTokenIndex == int(i + 1)) {
                state.feeToken = _tokenOut(swap.path);
                (amountOut, state.feeAmount, state.feeShareAmount) = _payFee(
                    address(this),
                    state.feeToken,
                    amountOut,
                    params.feeShareRecipient
                );
                require(amountOut >= swap.minAmountOut, "UP: amount less than minimum");
                uint256 balanceBefore = 0;
                if (!state.feeToken.isNativeAsset()) {
                    balanceBefore = IERC20(state.feeToken).balanceOf(state.nextRecipient);
                }
                _safeTransfer(address(this), state.feeToken, amountOut, state.nextRecipient);
                if (!state.feeToken.isNativeAsset()) {
                    // handle token with supporting fee on transfer
                    amountOut = IERC20(state.feeToken).balanceOf(state.nextRecipient) - balanceBefore;
                }
            }
        }
        bridgeTxnID = 0;
        if (params.bridge.provider != NULL_ADDRESS) {
            BridgeParams calldata bridge = params.bridge;
            (amountOut, bridgeTxnID) = _bridgeContract.bridge(
                IBridge.BridgeParams({
                    provider: bridge.provider,
                    router: bridge.router,
                    tokenIn: bridge.tokenIn,
                    chainIDOut: bridge.chainIDOut,
                    tokenOut: bridge.tokenOut,
                    amountIn: amountOut,
                    minAmountOut: bridge.minAmountOut,
                    recipient: params.recipient,
                    data: bridge.data
                })
            );
        }
        emit Traded(
            _msgSender(),
            params.orderId,
            params.recipient,
            params.feeShareRecipient,
            state.tokenIn,
            params.amountIn,
            params.bridge.chainIDOut,
            state.tokenOut,
            amountOut,
            bridgeTxnID,
            state.feeToken,
            state.feeAmount,
            state.feeShareAmount,
            state.extraFeeAmount
        );
    }

    function _setContract(address swapContract_, address bridgeContract_) internal {
        require(swapContract_ != NULL_ADDRESS && bridgeContract_ != NULL_ADDRESS, "UP: invalid contract address");
        _swapContract = ISwap(swapContract_);
        _bridgeContract = IBridge(bridgeContract_);
        emit ContractChanged(swapContract_, bridgeContract_);
    }

    function _setFeeRate(uint256 feeRate_, uint256 feeShareRate_) internal {
        require(feeRate_ <= MAX_FEE_RATE, "UP: fee rate exceeds limit");
        require(feeRate_ >= feeShareRate_, "UP: fee share rate is less than total fee rate");
        _feeRate = feeRate_;
        _feeShareRate = feeShareRate_;
        emit FeeRateChanged(_feeRate, _feeShareRate);
    }

    function _setFeeRecipient(address main, address alt) internal {
        require(main != NULL_ADDRESS && alt != NULL_ADDRESS, "UP: fee recipient is null");
        _mainFeeRecipient = main;
        _altFeeRecipient = alt;
        emit FeeRecipientChanged(_mainFeeRecipient, _altFeeRecipient);
    }

    // @dev find token to pay fee.
    // @return feeTokenIndex the index of token to pay fee:
    //         feeTokenIndex < 0: no need to pay fee;
    //         feeTokenIndex == 0: use first input token;
    //         feeTokenIndex > 0: use the output token of the swapList[feeTokenIndex-1].
    function _findFeeToken(SwapParams[] calldata swaps) internal view returns (int) {
        if (!_needPayFee()) {
            return -1;
        }
        if (swaps.length == 0) {
            return 0;
        }
        address tokenIn = swaps[0].path[0];
        if (tokenIn.isNativeAsset() || _mainFeeTokens[tokenIn]) {
            return 0;
        }
        for (uint256 i = 0; i < swaps.length; i++) {
            address tokenOut = swaps[i].path[swaps[i].path.length - 1];
            if (tokenOut.isNativeAsset() || _mainFeeTokens[tokenOut]) {
                return int(i + 1);
            }
        }
        return 0;
    }

    function _payExtraFee(
        address tokenIn,
        uint256 amountIn,
        SwapParams[] calldata swaps
    ) internal returns (uint256 extraFeeAmount) {
        address nextRecipient;
        if (swaps.length == 0) {
            nextRecipient = _msgSender();
        } else {
            nextRecipient = swaps[0].provider;
        }
        if (tokenIn.isNativeAsset()) {
            nextRecipient.safeTransfer(amountIn);
        } else {
            if (nextRecipient != _msgSender()) {
                uint256 balanceBefore = IERC20(tokenIn).balanceOf(nextRecipient);
                IERC20(tokenIn).safeTransferFrom(_msgSender(), nextRecipient, amountIn);
                amountIn = IERC20(tokenIn).balanceOf(nextRecipient) - balanceBefore;
            }
        }
        for (uint256 i = 0; i < swaps.length; i++) {
            SwapParams calldata swap = swaps[i];
            if (i + 1 < swaps.length) {
                nextRecipient = swaps[i + 1].provider;
            } else {
                nextRecipient = _msgSender();
            }
            amountIn = _swapContract.swap(
                ISwap.SwapParams({
                    provider: swap.provider,
                    router: swap.router,
                    path: swap.path,
                    amountIn: amountIn,
                    minAmountOut: swap.minAmountOut,
                    recipient: nextRecipient,
                    data: swap.data
                })
            );
        }
        return amountIn;
    }

    function _payFee(
        address sender,
        address token,
        uint256 amount,
        address feeShareRecipient
    ) internal returns (uint256 amountLeft, uint256 feeAmount, uint256 feeShareAmount) {
        if (!_needPayFee()) {
            return (amount, 0, 0);
        }
        feeAmount = (amount * _feeRate) / FEE_DENOMINATOR;
        require(feeAmount > 0, "UP: fee amount is 0");
        feeShareAmount = 0;
        uint256 feeLeftAmount = feeAmount;
        if (feeShareRecipient != NULL_ADDRESS) {
            feeShareAmount = (amount * _feeShareRate) / FEE_DENOMINATOR;
            require(feeShareAmount > 0, "UP: fee share amount is 0");
            _safeTransfer(sender, token, feeShareAmount, feeShareRecipient);
            feeLeftAmount -= feeShareAmount;
        }
        address feeRecipient = (token.isNativeAsset() || _mainFeeTokens[token]) ? _mainFeeRecipient : _altFeeRecipient;
        _safeTransfer(sender, token, feeLeftAmount, feeRecipient);
        return (amount - feeAmount, feeAmount, feeShareAmount);
    }

    function _needPayFee() internal view returns (bool) {
        return
            _feeRate > 0 &&
            !_focAccounts[_msgSender()] &&
            _msgSender() != _mainFeeRecipient &&
            _msgSender() != _altFeeRecipient;
    }

    function _safeTransfer(address sender, address token, uint256 amount, address recipient) internal {
        if (token.isNativeAsset()) {
            recipient.safeTransfer(amount);
        } else if (sender == address(this)) {
            _safeTransferERC20(IERC20(token), recipient, amount);
        } else {
            IERC20(token).safeTransferFrom(sender, recipient, amount);
        }
    }

    function _tokenOut(address[] calldata path) internal pure returns (address) {
        return path[path.length - 1];
    }
}

File 2 of 15 : SafeNativeAsset.sol
//SPDX-License-Identifier: UXUY
pragma solidity ^0.8.11;

library SafeNativeAsset {
    // native asset address
    address internal constant NATIVE_ASSET = address(0);

    function nativeAsset() internal pure returns (address) {
        return NATIVE_ASSET;
    }

    function isNativeAsset(address addr) internal pure returns (bool) {
        return addr == NATIVE_ASSET;
    }

    function safeTransfer(address recipient, uint256 amount) internal {
        require(recipient != address(0), "SafeNativeAsset: transfer to the zero address");
        (bool success, ) = recipient.call{value: amount}(new bytes(0));
        require(success, "SafeNativeAsset: safe transfer native assets failed");
    }
}

File 3 of 15 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)
// Modified by UXUY

pragma solidity ^0.8.0;

import "../interfaces/tokens/IERC20.sol";
import "./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 Address for address;

    address internal constant TRON_USDT_ADDRESS = address(0xa614f803B6FD780986A42c78Ec9c7f77e6DeD13C);

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        require(to != address(0), "SafeERC20: transfer to the zero address");
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferTron(IERC20 token, address to, uint256 value) internal {
        require(to != address(0), "SafeERC20: transfer to the zero address");
        if (address(token) == TRON_USDT_ADDRESS) {
            // For USDT on Tron, transfer method always returns false, so _callOptionalReturn can not be used.
            token.transfer(to, value);
        } else {
            _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
        }
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        require(to != address(0), "SafeERC20: transfer to the zero address");
        _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'
        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 safeApproveToMax(IERC20 token, address spender, uint256 value) internal {
        uint256 allowance = token.allowance(address(this), spender);
        if (allowance >= value) {
            return;
        }
        // For ERC-20 that has safe approve check, set approval to 0 before approve to max
        if (allowance > 0) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
        }
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, type(uint256).max));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _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
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 4 of 15 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

File 5 of 15 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "./Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 6 of 15 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "./Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 7 of 15 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 8 of 15 : CommonBase.sol
//SPDX-License-Identifier: UXUY
pragma solidity ^0.8.11;

import "./Ownable.sol";
import "./Pausable.sol";
import "./CallerControl.sol";
import "./SafeNativeAsset.sol";
import "./SafeERC20.sol";
import "./ReentrancyGuard.sol";

contract CommonBase is Ownable, Pausable, CallerControl, ReentrancyGuard {
    using SafeNativeAsset for address;
    using SafeERC20 for IERC20;

    uint256 internal constant TRON_CHAIN_ID = 0x2b6653dc;

    // The original address of this contract
    address private immutable _original;

    // ERC20 safeTransfer function pointer
    function(IERC20, address, uint256) internal _safeTransferERC20;

    // @dev Emitted when native assets (token=address(0)) or tokens are withdrawn by owner.
    event Withdrawn(address indexed token, address indexed to, uint256 amount);

    constructor() {
        _original = address(this);
        if (block.chainid == TRON_CHAIN_ID) {
            _safeTransferERC20 = SafeERC20.safeTransferTron;
        } else {
            _safeTransferERC20 = SafeERC20.safeTransfer;
        }
    }

    // @dev prevents delegatecall into the modified method
    modifier noDelegateCall() {
        _checkNotDelegateCall();
        _;
    }

    // @dev check whether deadline is reached
    modifier checkDeadline(uint256 deadline) {
        require(deadline == 0 || block.timestamp <= deadline, "CommonBase: transaction too old");
        _;
    }

    // @dev fallback function to receive native assets
    receive() external payable {}

    // @dev pause stops contract from doing any swap
    function pause() external onlyOwner {
        _pause();
    }

    // @dev resumes contract to do swap
    function unpause() external onlyOwner {
        _unpause();
    }

    // @dev withdraw eth to recipient
    function withdrawNativeAsset(uint256 amount, address recipient) external onlyOwner {
        recipient.safeTransfer(amount);
        emit Withdrawn(address(0), recipient, amount);
    }

    // @dev withdraw token to owner account
    function withdrawToken(address token, uint256 amount, address recipient) external onlyOwner {
        _safeTransferERC20(IERC20(token), recipient, amount);
        emit Withdrawn(token, recipient, amount);
    }

    // @dev update caller allowed status
    function updateAllowedCaller(address caller, bool allowed) external onlyOwner {
        _updateAllowedCaller(caller, allowed);
    }

    // @dev ensure not a delegatecall
    function _checkNotDelegateCall() private view {
        require(address(this) == _original, "CommonBase: delegate call not allowed");
    }
}

File 9 of 15 : CallerControl.sol
//SPDX-License-Identifier: UXUY
pragma solidity ^0.8.11;

import "./Context.sol";

abstract contract CallerControl is Context {
    mapping(address => bool) private _allowedCallers;

    // @dev Emitted when allowed caller is changed.
    event AllowedCallerChanged(address indexed caller, bool allowed);

    // @dev modifier to check if message sender is allowed caller
    modifier onlyAllowedCaller() {
        require(_allowedCallers[_msgSender()], "CallerControl: msgSender is not allowed to call");
        _;
    }

    function _updateAllowedCaller(address caller, bool allowed) internal {
        if (allowed) {
            _allowedCallers[caller] = true;
        } else {
            delete _allowedCallers[caller];
        }
        emit AllowedCallerChanged(caller, allowed);
    }
}

File 10 of 15 : Adminable.sol
//SPDX-License-Identifier: UXUY
pragma solidity ^0.8.0;

import "./Context.sol";

abstract contract Adminable is Context {
    address private _admin;

    event AdminTransferred(address indexed previousAdmin, address indexed newAdmin);

    /**
     * @dev Initializes the contract setting the deployer as the initial admin.
     */
    constructor() {
        _transferAdmin(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the admin.
     */
    modifier onlyAdmin() {
        _checkAdmin();
        _;
    }

    /**
     * @dev Returns the address of the current admin.
     */
    function admin() public view virtual returns (address) {
        return _admin;
    }

    /**
     * @dev Throws if the sender is not the admin.
     */
    function _checkAdmin() internal view virtual {
        require(admin() == _msgSender(), "Adminable: caller is not the admin");
    }

    /**
     * @dev Leaves the contract without admin. It will not be possible to call
     * `onlyAdmin` functions anymore. Can only be called by the current admin.
     *
     * NOTE: Renouncing admin will leave the contract without an admin,
     * thereby removing any functionality that is only available to the admin.
     */
    function renounceAdmin() public virtual onlyAdmin {
        _transferAdmin(address(0));
    }

    /**
     * @dev Transfers admin of the contract to a new account (`newAdmin`).
     * Can only be called by the current admin.
     */
    function transferAdmin(address newAdmin) public virtual onlyAdmin {
        require(newAdmin != address(0), "Adminable: new admin is the zero address");
        _transferAdmin(newAdmin);
    }

    /**
     * @dev Transfers admin of the contract to a new account (`newAdmin`).
     * Internal function without access restriction.
     */
    function _transferAdmin(address newAdmin) internal virtual {
        address oldAdmin = _admin;
        _admin = newAdmin;
        emit AdminTransferred(oldAdmin, newAdmin);
    }
}

File 11 of 15 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 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");

        (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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 12 of 15 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @dev Returns the number of decimals the token uses.
     */
    function decimals() external view returns (uint8);

    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool);
}

File 13 of 15 : ISwap.sol
//SPDX-License-Identifier: UXUY
pragma solidity ^0.8.11;

interface ISwap {
    struct SwapParams {
        address provider;
        address router;
        address[] path;
        uint256 amountIn;
        uint256 minAmountOut;
        address recipient;
        bytes data;
    }

    // @dev calls swap adapter to fulfill the exchange
    // @return amountOut the amount of tokens transferred out, guarantee amountOut >= params.minAmountOut
    function swap(SwapParams calldata params) external returns (uint256 amountOut);
}

File 14 of 15 : IProtocol.sol
//SPDX-License-Identifier: UXUY
pragma solidity ^0.8.11;

interface IProtocol {
    struct SwapParams {
        address provider;
        address router;
        address[] path;
        uint256 minAmountOut;
        bytes data;
    }

    struct BridgeParams {
        address provider;
        address router;
        address tokenIn;
        uint256 chainIDOut;
        address tokenOut;
        uint256 minAmountOut;
        bytes data;
    }

    struct TradeParams {
        uint256 amountIn;
        SwapParams[] swaps;
        BridgeParams bridge;
        address recipient;
        address feeShareRecipient;
        uint256 extraFeeAmountIn; // Extra fee deducted to pay the gas fee
        SwapParams[] extraFeeSwaps;
        uint256 deadline;
        uint256 orderId;
    }

    // @dev Emitted when fee rate is updated
    event FeeRateChanged(uint256 feeRate, uint256 feeShareRate);

    // @dev Emitted when trade is executed
    event Traded(
        address indexed sender,
        uint256 orderId,
        address indexed recipient,
        address indexed feeShareRecipient,
        address tokenIn,
        uint256 amountIn,
        uint256 chainIDOut,
        address tokenOut,
        uint256 amountOut,
        uint256 bridgeTxnID,
        address feeToken,
        uint256 amountFee,
        uint256 amountFeeShare,
        uint256 amountExtraFee
    );

    // @dev gets the swap contract
    function swapContract() external view returns (address);

    // @dev gets the bridge contract
    function bridgeContract() external view returns (address);

    // @dev gets the fee denominator
    function feeDenominator() external pure returns (uint256);

    // @dev gets the total fee rate
    function feeRate() external view returns (uint256);

    // @dev gets the fee share rate
    function feeShareRate() external view returns (uint256);

    // @dev trade between tokens
    function trade(TradeParams calldata params) external payable returns (uint256 amountOut, uint256 bridgeTxnID);
}

File 15 of 15 : IBridge.sol
//SPDX-License-Identifier: UXUY
pragma solidity ^0.8.11;

interface IBridge {
    struct BridgeParams {
        address provider;
        address router;
        address tokenIn;
        uint256 chainIDOut;
        address tokenOut;
        uint256 amountIn;
        uint256 minAmountOut;
        address recipient;
        bytes data;
    }

    // @dev checks if the bridge adapter supports swap between different tokens.
    function supportSwap(address provider) external view returns (bool);

    // @dev calls bridge adapter to fulfill the exchange.
    // @return amountOut the amount of tokens transferred out, may be 0.
    // @return txnID the transaction id of the bridge, may be 0.
    function bridge(BridgeParams calldata params) external returns (uint256 amountOut, uint256 txnID);
}

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 1000
  },
  "evmVersion": "paris",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"swapContract_","type":"address"},{"internalType":"address","name":"bridgeContract_","type":"address"},{"internalType":"uint256","name":"feeRate_","type":"uint256"},{"internalType":"uint256","name":"feeShareRate_","type":"uint256"},{"internalType":"address","name":"mainFeeRecipient_","type":"address"},{"internalType":"address","name":"altFeeRecipient_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"bool","name":"allowed","type":"bool"}],"name":"AllowedCallerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"swap","type":"address"},{"indexed":false,"internalType":"address","name":"bridge","type":"address"}],"name":"ContractChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bool","name":"foc","type":"bool"}],"name":"FOCAccountChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"feeRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feeShareRate","type":"uint256"}],"name":"FeeRateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"main","type":"address"},{"indexed":false,"internalType":"address","name":"alt","type":"address"}],"name":"FeeRecipientChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"bool","name":"main","type":"bool"}],"name":"FeeTokenChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"orderId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":true,"internalType":"address","name":"feeShareRecipient","type":"address"},{"indexed":false,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"chainIDOut","type":"uint256"},{"indexed":false,"internalType":"address","name":"tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountOut","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bridgeTxnID","type":"uint256"},{"indexed":false,"internalType":"address","name":"feeToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountFeeShare","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountExtraFee","type":"uint256"}],"name":"Traded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bridgeContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeDenominator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"feeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeShareRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isFOCAccount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"swapContract_","type":"address"},{"internalType":"address","name":"bridgeContract_","type":"address"}],"name":"setContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"feeRate_","type":"uint256"},{"internalType":"uint256","name":"feeShareRate_","type":"uint256"}],"name":"setFeeRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"main","type":"address"},{"internalType":"address","name":"alt","type":"address"}],"name":"setFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"components":[{"internalType":"address","name":"provider","type":"address"},{"internalType":"address","name":"router","type":"address"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct IProtocol.SwapParams[]","name":"swaps","type":"tuple[]"},{"components":[{"internalType":"address","name":"provider","type":"address"},{"internalType":"address","name":"router","type":"address"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"chainIDOut","type":"uint256"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct IProtocol.BridgeParams","name":"bridge","type":"tuple"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"feeShareRecipient","type":"address"},{"internalType":"uint256","name":"extraFeeAmountIn","type":"uint256"},{"components":[{"internalType":"address","name":"provider","type":"address"},{"internalType":"address","name":"router","type":"address"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct IProtocol.SwapParams[]","name":"extraFeeSwaps","type":"tuple[]"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"orderId","type":"uint256"}],"internalType":"struct IProtocol.TradeParams","name":"params","type":"tuple"}],"name":"trade","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"bridgeTxnID","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"transferAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"bool","name":"allowed","type":"bool"}],"name":"updateAllowedCaller","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"bool","name":"foc","type":"bool"}],"name":"updateFOCAccounts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"bool","name":"main","type":"bool"}],"name":"updateFeeTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"withdrawNativeAsset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a06040523480156200001157600080fd5b50604051620040623803806200406283398101604081905262000034916200089d565b6200003f33620000ee565b6200004a336200013e565b6001805460ff60a01b1916815560035530608052632b6653db1946016200009757600480546001600160401b0319166200019060201b62001ad9176001600160401b0316179055620000be565b600480546001600160401b031916620002ea60201b62001c5f176001600160401b03161790555b620000ca868662000341565b620000d6848462000435565b620000e2828262000534565b505050505050620009b0565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec69190a35050565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216620001eb5760405162461bcd60e51b81526020600482015260276024820152600080516020620040428339815191526044820152666164647265737360c81b60648201526084015b60405180910390fd5b73a614f803b6fd780986a42c78ec9c7f77e6ded13b196001600160a01b038416016200028d5760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af115801562000261573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200028791906200090c565b50505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663a9059cbb60e01b17909152620002e59185916200060b16565b505050565b6001600160a01b0382166200028d5760405162461bcd60e51b81526020600482015260276024820152600080516020620040428339815191526044820152666164647265737360c81b6064820152608401620001e2565b6001600160a01b038216158015906200036257506001600160a01b03811615155b620003b05760405162461bcd60e51b815260206004820152601c60248201527f55503a20696e76616c696420636f6e74726163742061646472657373000000006044820152606401620001e2565b60048054600160401b600160e01b031916680100000000000000006001600160a01b0385811691820292909217909255600580546001600160a01b03191691841691821790556040805192835260208301919091527fa960d3f7fe3af73a9dff7876fd364455b0232e66d0e46334ae724e96f8953c5091015b60405180910390a15050565b620186a08211156200048a5760405162461bcd60e51b815260206004820152601a60248201527f55503a2066656520726174652065786365656473206c696d69740000000000006044820152606401620001e2565b80821015620004f35760405162461bcd60e51b815260206004820152602e60248201527f55503a206665652073686172652072617465206973206c657373207468616e2060448201526d746f74616c20666565207261746560901b6064820152608401620001e2565b6006829055600781905560408051838152602081018390527fb9ffe02e89fee6f5544ee152a08c2cafbc3a4a89a66737ef42115dcd508aea10910162000429565b6001600160a01b038216158015906200055557506001600160a01b03811615155b620005a35760405162461bcd60e51b815260206004820152601960248201527f55503a2066656520726563697069656e74206973206e756c6c000000000000006044820152606401620001e2565b600880546001600160a01b038481166001600160a01b03199283168117909355600980549185169190921681179091556040805192835260208301919091527f0bc21fe5c3ab742ff1d15b5c4477ffbacf1167e618228078fa625edebe7f331d910162000429565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908201526000906200065a906001600160a01b038516908490620006dc565b805190915015620002e557808060200190518101906200067b91906200090c565b620002e55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401620001e2565b6060620006ed8484600085620006f5565b949350505050565b606082471015620007585760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401620001e2565b600080866001600160a01b031685876040516200077691906200095d565b60006040518083038185875af1925050503d8060008114620007b5576040519150601f19603f3d011682016040523d82523d6000602084013e620007ba565b606091505b509092509050620007ce87838387620007d9565b979650505050505050565b606083156200084d57825160000362000845576001600160a01b0385163b620008455760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401620001e2565b5081620006ed565b620006ed8383815115620008645781518083602001fd5b8060405162461bcd60e51b8152600401620001e291906200097b565b80516001600160a01b03811681146200089857600080fd5b919050565b60008060008060008060c08789031215620008b757600080fd5b620008c28762000880565b9550620008d26020880162000880565b94506040870151935060608701519250620008f06080880162000880565b91506200090060a0880162000880565b90509295509295509295565b6000602082840312156200091f57600080fd5b815180151581146200093057600080fd5b9392505050565b60005b83811015620009545781810151838201526020016200093a565b50506000910152565b600082516200097181846020870162000937565b9190910192915050565b60208152600082518060208401526200099c81604085016020870162000937565b601f01601f19169190910160400192915050565b608051613676620009cc600039600061224301526136766000f3fe60806040526004361061018f5760003560e01c80638456cb59116100d65780639bb749eb1161007f578063f2d2a75111610059578063f2d2a75114610446578063f2fde38b14610466578063f851a4401461048657600080fd5b80639bb749eb146103f3578063cd59658314610413578063deabc1431461043157600080fd5b80638ea83031116100b05780638ea830311461039457806393cb6f08146103be578063978bbdb9146103de57600080fd5b80638456cb59146103385780638bad0c0a1461034d5780638da5cb5b1461036257600080fd5b80633f4ba83a116101385780635d3c6d6b116101125780635d3c6d6b146102ca578063715018a61461030357806375829def1461031857600080fd5b80633f4ba83a146102625780635103aafa146102775780635c975abb1461029f57600080fd5b8063270401cb11610169578063270401cb146102025780632bf6e0a5146102225780633ccdbb281461024257600080fd5b8063087e7e361461019b578063180b0d7e146101bd5780631bf36f8e146101e257600080fd5b3661019657005b600080fd5b3480156101a757600080fd5b506101bb6101b6366004613099565b6104a4565b005b3480156101c957600080fd5b50620f42405b6040519081526020015b60405180910390f35b3480156101ee57600080fd5b506101bb6101fd3660046130d0565b6104ba565b34801561020e57600080fd5b506101bb61021d3660046130fc565b61051a565b34801561022e57600080fd5b506101bb61023d3660046130fc565b61052c565b34801561024e57600080fd5b506101bb61025d366004613126565b61053e565b34801561026e57600080fd5b506101bb6105b4565b61028a610285366004613162565b6105c6565b604080519283526020830191909152016101d9565b3480156102ab57600080fd5b50600154600160a01b900460ff165b60405190151581526020016101d9565b3480156102d657600080fd5b506102ba6102e53660046131a5565b6001600160a01b03166000908152600a602052604090205460ff1690565b34801561030f57600080fd5b506101bb6116f8565b34801561032457600080fd5b506101bb6103333660046131a5565b61170a565b34801561034457600080fd5b506101bb61179a565b34801561035957600080fd5b506101bb6117aa565b34801561036e57600080fd5b506001546001600160a01b03165b6040516001600160a01b0390911681526020016101d9565b3480156103a057600080fd5b506004546801000000000000000090046001600160a01b031661037c565b3480156103ca57600080fd5b506101bb6103d93660046131c0565b6117bc565b3480156103ea57600080fd5b506006546101cf565b3480156103ff57600080fd5b506101bb61040e3660046131c0565b6118fe565b34801561041f57600080fd5b506005546001600160a01b031661037c565b34801561043d57600080fd5b506007546101cf565b34801561045257600080fd5b506101bb610461366004613246565b611a3a565b34801561047257600080fd5b506101bb6104813660046131a5565b611a4c565b34801561049257600080fd5b506000546001600160a01b031661037c565b6104ac611cc5565b6104b68282611d1f565b5050565b6104c2611cc5565b6104d56001600160a01b03821683611db7565b6040518281526001600160a01b038216906000907fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb9060200160405180910390a35050565b610522611f16565b6104b68282611f96565b610534611f16565b6104b6828261207e565b610546611cc5565b600454610562908490839085908015613067021763ffffffff16565b806001600160a01b0316836001600160a01b03167fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb846040516105a791815260200190565b60405180910390a3505050565b6105bc611cc5565b6105c4612189565b565b6000806105d16121de565b6105d9612238565b6105e16122d6565b60e08301358015806105f35750804211155b6106445760405162461bcd60e51b815260206004820152601f60248201527f436f6d6d6f6e426173653a207472616e73616374696f6e20746f6f206f6c640060448201526064015b60405180910390fd5b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915260006106946020870187613268565b905011156109495760005b6106ac6020870187613268565b905081101561075c5760006106c46020880188613268565b838181106106d4576106d46132b9565b90506020028101906106e691906132cf565b6106f49060208101906131a5565b6001600160a01b03160361074a5760405162461bcd60e51b815260206004820152601960248201527f55503a20696e76616c696420737761702070726f766964657200000000000000604482015260640161063b565b8061075481613305565b91505061069f565b5061076a6020860186613268565b600081811061077b5761077b6132b9565b905060200281019061078d91906132cf565b61079b906040810190613268565b60008181106107ac576107ac6132b9565b90506020020160208101906107c191906131a5565b6001600160a01b031681526107d96020860186613268565b60008181106107ea576107ea6132b9565b90506020028101906107fc91906132cf565b61080a9060208101906131a5565b6001600160a01b031660e08201526000610827604087018761331e565b6108359060208101906131a5565b6001600160a01b03161461094457610850604086018661331e565b6108619060608101906040016131a5565b6001600160a01b03166108c861087a6020880188613268565b600161088960208b018b613268565b610894929150613334565b8181106108a3576108a36132b9565b90506020028101906108b591906132cf565b6108c3906040810190613268565b61232f565b6001600160a01b0316146109445760405162461bcd60e51b815260206004820152602260248201527f55503a207377617020616e642062726964676520746f6b656e206d69736d617460448201527f6368000000000000000000000000000000000000000000000000000000000000606482015260840161063b565b61099c565b610956604086018661331e565b6109679060608101906040016131a5565b6001600160a01b0316815261097f604086018661331e565b61098d9060208101906131a5565b6001600160a01b031660e08201525b60006109ab604087018761331e565b6109b99060208101906131a5565b6001600160a01b0316036109f9576109e66109d76020870187613268565b600161088960208a018a613268565b6001600160a01b03166020820152610a99565b6000610a08604087018761331e565b610a169060208101906131a5565b6001600160a01b031603610a6c5760405162461bcd60e51b815260206004820152601b60248201527f55503a20696e76616c6964206272696467652070726f76696465720000000000604482015260640161063b565b610a79604086018661331e565b610a8a9060a08101906080016131a5565b6001600160a01b031660208201525b80516001600160a01b0316610b27578435341015610b1f5760405162461bcd60e51b815260206004820152602160248201527f55503a206e6f7420656e6f7567682045544820696e207472616e73616374696f60448201527f6e00000000000000000000000000000000000000000000000000000000000000606482015260840161063b565b349350610d12565b80518535906001600160a01b03166370a08231336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610b7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba39190613347565b1015610c175760405162461bcd60e51b815260206004820152602660248201527f55503a2073656e64657220746f6b656e2062616c616e6365206973206e6f742060448201527f656e6f7567680000000000000000000000000000000000000000000000000000606482015260840161063b565b80518535906001600160a01b031663dd62ed3e336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604401602060405180830381865afa158015610c75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c999190613347565b1015610d0d5760405162461bcd60e51b815260206004820152602160248201527f55503a20746f6b656e20616c6c6f77616e6365206973206e6f7420656e6f756760448201527f6800000000000000000000000000000000000000000000000000000000000000606482015260840161063b565b843593505b60a085013515610dad57610d2b600260a0870135613360565b841015610d7a5760405162461bcd60e51b815260206004820152601b60248201527f55503a206578747261206665652065786365656473206c696d69740000000000604482015260640161063b565b8051610d979060a0870135610d9260c0890189613268565b61236b565b60c0820152610daa60a086013585613334565b93505b610dc2610dbd6020870187613268565b61270c565b604082018190526000606083018190526080830181905260a0830181905203610e305780516001600160a01b031660608201819052610e239015610e065733610e08565b305b606083015186610e1e60a08a0160808b016131a5565b6128d8565b60a0840152608083015293505b80516001600160a01b0316610e5c5760e0810151610e57906001600160a01b031685611db7565b610f73565b805160e08201516040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa158015610eae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed29190613347565b9050610ef03360e084015184516001600160a01b0316919088612a78565b815160e08301516040516370a0823160e01b81526001600160a01b039182166004820152839291909116906370a0823190602401602060405180830381865afa158015610f41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f659190613347565b610f6f9190613334565b9450505b60005b610f836020870187613268565b905081101561141d5736610f9a6020880188613268565b83818110610faa57610faa6132b9565b9050602002810190610fbc91906132cf565b9050610fcb6020880188613268565b9050610fd8836001613377565b101561103857610feb6020880188613268565b610ff6846001613377565b818110611005576110056132b9565b905060200281019061101791906132cf565b6110259060208101906131a5565b6001600160a01b031660e084015261108f565b6000611047604089018961331e565b6110559060208101906131a5565b6001600160a01b03161461107057611017604088018861331e565b61108060808801606089016131a5565b6001600160a01b031660e08401525b6004546040805160e08101909152680100000000000000009091046001600160a01b03169063863b1bb690806110c860208601866131a5565b6001600160a01b031681526020018460200160208101906110e991906131a5565b6001600160a01b031681526020016111046040860186613268565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250602081018a9052606080860135604083015201611156866001613377565b87604001511461116a578660e0015161116c565b305b6001600160a01b03168152602001611187608086018661338a565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509152506040516001600160e01b031960e084901b1681526111de9190600401613421565b6020604051808303816000875af11580156111fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112219190613347565b955061122e826001613377565b83604001510361140a576112486108c36040830183613268565b6001600160a01b03166060840181905261126f90309088610e1e60a08c0160808d016131a5565b60a08601526080850152955060608101358610156112cf5760405162461bcd60e51b815260206004820152601c60248201527f55503a20616d6f756e74206c657373207468616e206d696e696d756d00000000604482015260640161063b565b60608301516000906001600160a01b03161561135c57606084015160e08501516040516370a0823160e01b81526001600160a01b0391821660048201529116906370a0823190602401602060405180830381865afa158015611335573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113599190613347565b90505b611370308560600151898760e00151612b2f565b60608401516001600160a01b03161561140857606084015160e08501516040516370a0823160e01b81526001600160a01b039182166004820152839291909116906370a0823190602401602060405180830381865afa1580156113d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fb9190613347565b6114059190613334565b96505b505b508061141581613305565b915050610f76565b506000925082611430604087018761331e565b61143e9060208101906131a5565b6001600160a01b0316146115dd573661145a604087018761331e565b6005546040805161012081019091529192506001600160a01b0316906387814438908061148a60208601866131a5565b6001600160a01b031681526020018460200160208101906114ab91906131a5565b6001600160a01b031681526020016114c960608601604087016131a5565b6001600160a01b03168152606085013560208201526040016114f160a08601608087016131a5565b6001600160a01b031681526020018881526020018460a00135815260200189606001602081019061152291906131a5565b6001600160a01b0316815260200161153d60c086018661338a565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509152506040516001600160e01b031960e084901b16815261159491906004016134e7565b60408051808303816000875af11580156115b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d691906135a2565b9095509350505b6115ed60a08601608087016131a5565b6001600160a01b031661160660808701606088016131a5565b82516001600160a01b03919091169033907ffad3e93c5edf363a6a7db9e8df2679b14559c44e44a66a163359056050ab806f906101008a0135908a3561164f60408d018d61331e565b6060013588602001518c8c8b606001518c608001518d60a001518e60c001516040516116df9b9a999897969594939291909a8b526001600160a01b03998a1660208c015260408b019890985260608a0196909652938716608089015260a088019290925260c087015290931660e08501526101008401929092526101208301919091526101408201526101600190565b60405180910390a450506116f36001600355565b915091565b611700611cc5565b6105c46000612b96565b611712611f16565b6001600160a01b03811661178e5760405162461bcd60e51b815260206004820152602860248201527f41646d696e61626c653a206e65772061646d696e20697320746865207a65726f60448201527f2061646472657373000000000000000000000000000000000000000000000000606482015260840161063b565b61179781612bf5565b50565b6117a2611cc5565b6105c4612c52565b6117b2611f16565b6105c46000612bf5565b6117c4611f16565b60005b828110156118f857811561182f576001600b60008686858181106117ed576117ed6132b9565b905060200201602081019061180291906131a5565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905561187c565b600b6000858584818110611845576118456132b9565b905060200201602081019061185a91906131a5565b6001600160a01b031681526020810191909152604001600020805460ff191690555b7f842f5c76f4de7e226a4fe6449aaa3bf6acb19355e084107a9c90084b062f05788484838181106118af576118af6132b9565b90506020020160208101906118c491906131a5565b604080516001600160a01b03909216825284151560208301520160405180910390a1806118f081613305565b9150506117c7565b50505050565b611906611f16565b60005b828110156118f8578115611971576001600a600086868581811061192f5761192f6132b9565b905060200201602081019061194491906131a5565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790556119be565b600a6000858584818110611987576119876132b9565b905060200201602081019061199c91906131a5565b6001600160a01b031681526020810191909152604001600020805460ff191690555b7f254870e241695fd757faecd3bd3e3cd6010c2eacc60f119493253a56c75472778484838181106119f1576119f16132b9565b9050602002016020810190611a0691906131a5565b604080516001600160a01b03909216825284151560208301520160405180910390a180611a3281613305565b915050611909565b611a42611f16565b6104b68282612c95565b611a54611cc5565b6001600160a01b038116611ad05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161063b565b61179781612b96565b6001600160a01b038216611b3f5760405162461bcd60e51b815260206004820152602760248201527f5361666545524332303a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b606482015260840161063b565b7fffffffffffffffffffffffff59eb07fc490287f6795bd3871363808819212ec46001600160a01b03841601611be25760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015611bbe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f891906135c6565b6040516001600160a01b038316602482015260448101829052611c5a90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b031990931692909217909152612d9e565b505050565b6001600160a01b038216611be25760405162461bcd60e51b815260206004820152602760248201527f5361666545524332303a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b606482015260840161063b565b6001546001600160a01b031633146105c45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161063b565b8015611d4d576001600160a01b0382166000908152600260205260409020805460ff19166001179055611d6e565b6001600160a01b0382166000908152600260205260409020805460ff191690555b816001600160a01b03167f880be60bcc12281afa6ddd91d1d316535e12070fe042d26fa8acdf5a0a6116b882604051611dab911515815260200190565b60405180910390a25050565b6001600160a01b038216611e335760405162461bcd60e51b815260206004820152602d60248201527f536166654e617469766541737365743a207472616e7366657220746f2074686560448201527f207a65726f206164647265737300000000000000000000000000000000000000606482015260840161063b565b604080516000808252602082019092526001600160a01b038416908390604051611e5d91906135e3565b60006040518083038185875af1925050503d8060008114611e9a576040519150601f19603f3d011682016040523d82523d6000602084013e611e9f565b606091505b5050905080611c5a5760405162461bcd60e51b815260206004820152603360248201527f536166654e617469766541737365743a2073616665207472616e73666572206e60448201527f617469766520617373657473206661696c656400000000000000000000000000606482015260840161063b565b6000546001600160a01b031633146105c45760405162461bcd60e51b815260206004820152602260248201527f41646d696e61626c653a2063616c6c6572206973206e6f74207468652061646d60448201527f696e000000000000000000000000000000000000000000000000000000000000606482015260840161063b565b6001600160a01b03821615801590611fb657506001600160a01b03811615155b6120025760405162461bcd60e51b815260206004820152601960248201527f55503a2066656520726563697069656e74206973206e756c6c00000000000000604482015260640161063b565b600880546001600160a01b0384811673ffffffffffffffffffffffffffffffffffffffff199283168117909355600980549185169190921681179091556040805192835260208301919091527f0bc21fe5c3ab742ff1d15b5c4477ffbacf1167e618228078fa625edebe7f331d91015b60405180910390a15050565b6001600160a01b0382161580159061209e57506001600160a01b03811615155b6120ea5760405162461bcd60e51b815260206004820152601c60248201527f55503a20696e76616c696420636f6e7472616374206164647265737300000000604482015260640161063b565b600480547fffffffff0000000000000000000000000000000000000000ffffffffffffffff16680100000000000000006001600160a01b03858116918202929092179092556005805473ffffffffffffffffffffffffffffffffffffffff191691841691821790556040805192835260208301919091527fa960d3f7fe3af73a9dff7876fd364455b0232e66d0e46334ae724e96f8953c509101612072565b612191612e83565b6001805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600154600160a01b900460ff16156105c45760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161063b565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105c45760405162461bcd60e51b815260206004820152602560248201527f436f6d6d6f6e426173653a2064656c65676174652063616c6c206e6f7420616c60448201527f6c6f776564000000000000000000000000000000000000000000000000000000606482015260840161063b565b6002600354036123285760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161063b565b6002600355565b6000828261233e600182613334565b81811061234d5761234d6132b9565b905060200201602081019061236291906131a5565b90505b92915050565b60008082810361237c5750336123b2565b8383600081811061238f5761238f6132b9565b90506020028101906123a191906132cf565b6123af9060208101906131a5565b90505b6001600160a01b0386166123d8576123d36001600160a01b03821686611db7565b6124e8565b6001600160a01b03811633146124e8576040516370a0823160e01b81526001600160a01b038281166004830152600091908816906370a0823190602401602060405180830381865afa158015612432573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124569190613347565b905061246d6001600160a01b038816338489612a78565b6040516370a0823160e01b81526001600160a01b0383811660048301528291908916906370a0823190602401602060405180830381865afa1580156124b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124da9190613347565b6124e49190613334565b9550505b60005b838110156126fe5736858583818110612506576125066132b9565b905060200281019061251891906132cf565b905084612526836001613377565b101561256f578585612539846001613377565b818110612548576125486132b9565b905060200281019061255a91906132cf565b6125689060208101906131a5565b9250612573565b3392505b6004546040805160e08101909152680100000000000000009091046001600160a01b03169063863b1bb690806125ac60208601866131a5565b6001600160a01b031681526020018460200160208101906125cd91906131a5565b6001600160a01b031681526020016125e86040860186613268565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250602081018b905260608086013560408301526001600160a01b0388169082015260809081019061264e9086018661338a565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509152506040516001600160e01b031960e084901b1681526126a59190600401613421565b6020604051808303816000875af11580156126c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126e89190613347565b96505080806126f690613305565b9150506124eb565b50849150505b949350505050565b6000612716612edc565b6127235750600019612365565b600082900361273457506000612365565b600083836000818110612749576127496132b9565b905060200281019061275b91906132cf565b612769906040810190613268565b600081811061277a5761277a6132b9565b905060200201602081019061278f91906131a5565b90506001600160a01b03811615806127bf57506001600160a01b0381166000908152600b602052604090205460ff165b156127ce576000915050612365565b60005b838110156128cd5760008585838181106127ed576127ed6132b9565b90506020028101906127ff91906132cf565b61280d906040810190613268565b6001888886818110612821576128216132b9565b905060200281019061283391906132cf565b612841906040810190613268565b61284c929150613334565b81811061285b5761285b6132b9565b905060200201602081019061287091906131a5565b90506001600160a01b03811615806128a057506001600160a01b0381166000908152600b602052604090205460ff165b156128ba576128b0826001613377565b9350505050612365565b50806128c581613305565b9150506127d1565b506000949350505050565b60008060006128e5612edc565b6128f757508391506000905080612a6e565b620f4240600654866129099190613360565b61291391906135f5565b9150600082116129655760405162461bcd60e51b815260206004820152601360248201527f55503a2066656520616d6f756e74206973203000000000000000000000000000604482015260640161063b565b506000816001600160a01b038516156129ff57620f42406007548761298a9190613360565b61299491906135f5565b9150600082116129e65760405162461bcd60e51b815260206004820152601960248201527f55503a2066656520736861726520616d6f756e74206973203000000000000000604482015260640161063b565b6129f288888488612b2f565b6129fc8282613334565b90505b60006001600160a01b0388161580612a2f57506001600160a01b0388166000908152600b602052604090205460ff165b612a44576009546001600160a01b0316612a51565b6008546001600160a01b03165b9050612a5f89898484612b2f565b612a698488613334565b945050505b9450945094915050565b6001600160a01b038216612ade5760405162461bcd60e51b815260206004820152602760248201527f5361666545524332303a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b606482015260840161063b565b6040516001600160a01b03808516602483015283166044820152606481018290526118f89085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611c0e565b6001600160a01b038316612b5557612b506001600160a01b03821683611db7565b6118f8565b306001600160a01b03851603612b8157600454612b50908490839085908015613067021763ffffffff16565b6118f86001600160a01b038416858385612a78565b600180546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec69190a35050565b612c5a6121de565b6001805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586121c13390565b620186a0821115612ce85760405162461bcd60e51b815260206004820152601a60248201527f55503a2066656520726174652065786365656473206c696d6974000000000000604482015260640161063b565b80821015612d5e5760405162461bcd60e51b815260206004820152602e60248201527f55503a206665652073686172652072617465206973206c657373207468616e2060448201527f746f74616c206665652072617465000000000000000000000000000000000000606482015260840161063b565b6006829055600781905560408051838152602081018390527fb9ffe02e89fee6f5544ee152a08c2cafbc3a4a89a66737ef42115dcd508aea109101612072565b6000612df3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612f449092919063ffffffff16565b805190915015611c5a5780806020019051810190612e1191906135c6565b611c5a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161063b565b600154600160a01b900460ff166105c45760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161063b565b600080600654118015612eff5750336000908152600a602052604090205460ff16155b8015612f1f57506008546001600160a01b0316336001600160a01b031614155b8015612f3f57506009546001600160a01b0316336001600160a01b031614155b905090565b6060612704848460008585600080866001600160a01b03168587604051612f6b91906135e3565b60006040518083038185875af1925050503d8060008114612fa8576040519150601f19603f3d011682016040523d82523d6000602084013e612fad565b606091505b5091509150612fbe87838387612fc9565b979650505050505050565b60608315613038578251600003613031576001600160a01b0385163b6130315760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161063b565b5081612704565b612704838381511561304d5781518083602001fd5b8060405162461bcd60e51b815260040161063b9190613617565b6105c461362a565b80356001600160a01b038116811461308657600080fd5b919050565b801515811461179757600080fd5b600080604083850312156130ac57600080fd5b6130b58361306f565b915060208301356130c58161308b565b809150509250929050565b600080604083850312156130e357600080fd5b823591506130f36020840161306f565b90509250929050565b6000806040838503121561310f57600080fd5b6131188361306f565b91506130f36020840161306f565b60008060006060848603121561313b57600080fd5b6131448461306f565b9250602084013591506131596040850161306f565b90509250925092565b60006020828403121561317457600080fd5b813567ffffffffffffffff81111561318b57600080fd5b8201610120818503121561319e57600080fd5b9392505050565b6000602082840312156131b757600080fd5b6123628261306f565b6000806000604084860312156131d557600080fd5b833567ffffffffffffffff808211156131ed57600080fd5b818601915086601f83011261320157600080fd5b81358181111561321057600080fd5b8760208260051b850101111561322557600080fd5b6020928301955093505084013561323b8161308b565b809150509250925092565b6000806040838503121561325957600080fd5b50508035926020909101359150565b6000808335601e1984360301811261327f57600080fd5b83018035915067ffffffffffffffff82111561329a57600080fd5b6020019150600581901b36038213156132b257600080fd5b9250929050565b634e487b7160e01b600052603260045260246000fd5b60008235609e198336030181126132e557600080fd5b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b600060018201613317576133176132ef565b5060010190565b6000823560de198336030181126132e557600080fd5b81810381811115612365576123656132ef565b60006020828403121561335957600080fd5b5051919050565b8082028115828204841417612365576123656132ef565b80820180821115612365576123656132ef565b6000808335601e198436030181126133a157600080fd5b83018035915067ffffffffffffffff8211156133bc57600080fd5b6020019150368190038213156132b257600080fd5b60005b838110156133ec5781810151838201526020016133d4565b50506000910152565b6000815180845261340d8160208601602086016133d1565b601f01601f19169290920160200192915050565b6000602080835261010083016001600160a01b0380865116838601528083870151166040860152604086015160e06060870152828151808552610120880191508583019450600092505b8083101561348d5784518416825293850193600192909201919085019061346b565b5060608801516080880152608088015160a088015260a088015194506134be60c08801866001600160a01b03169052565b60c0880151878203601f190160e089015294506134db81866133f5565b98975050505050505050565b602081526135016020820183516001600160a01b03169052565b6000602083015161351d60408401826001600160a01b03169052565b5060408301516001600160a01b03811660608401525060608301516080830152608083015161355760a08401826001600160a01b03169052565b5060a083015160c083015260c083015160e083015260e0830151610100613588818501836001600160a01b03169052565b8401516101208481015290506127046101408401826133f5565b600080604083850312156135b557600080fd5b505080516020909101519092909150565b6000602082840312156135d857600080fd5b815161319e8161308b565b600082516132e58184602087016133d1565b60008261361257634e487b7160e01b600052601260045260246000fd5b500490565b60208152600061236260208301846133f5565b634e487b7160e01b600052605160045260246000fdfea26469706673582212207498a31fd81f3dbe89cb9a22ea52fae50cf5ae9617839821e6be6d2cf2be022564736f6c634300081300335361666545524332303a207472616e7366657220746f20746865207a65726f200000000000000000000000008818f58784b4cda3150ca887abd0c45bbb26b4df0000000000000000000000002df4a9076fe14b00309635ea68f301be2e0afc6e0000000000000000000000000000000000000000000000000000000000000bb800000000000000000000000000000000000000000000000000000000000004b0000000000000000000000000f04f1dc6fa5e2ccbefc5e4eb9ec694653442f45e000000000000000000000000f04f1dc6fa5e2ccbefc5e4eb9ec694653442f45e

Deployed Bytecode

0x60806040526004361061018f5760003560e01c80638456cb59116100d65780639bb749eb1161007f578063f2d2a75111610059578063f2d2a75114610446578063f2fde38b14610466578063f851a4401461048657600080fd5b80639bb749eb146103f3578063cd59658314610413578063deabc1431461043157600080fd5b80638ea83031116100b05780638ea830311461039457806393cb6f08146103be578063978bbdb9146103de57600080fd5b80638456cb59146103385780638bad0c0a1461034d5780638da5cb5b1461036257600080fd5b80633f4ba83a116101385780635d3c6d6b116101125780635d3c6d6b146102ca578063715018a61461030357806375829def1461031857600080fd5b80633f4ba83a146102625780635103aafa146102775780635c975abb1461029f57600080fd5b8063270401cb11610169578063270401cb146102025780632bf6e0a5146102225780633ccdbb281461024257600080fd5b8063087e7e361461019b578063180b0d7e146101bd5780631bf36f8e146101e257600080fd5b3661019657005b600080fd5b3480156101a757600080fd5b506101bb6101b6366004613099565b6104a4565b005b3480156101c957600080fd5b50620f42405b6040519081526020015b60405180910390f35b3480156101ee57600080fd5b506101bb6101fd3660046130d0565b6104ba565b34801561020e57600080fd5b506101bb61021d3660046130fc565b61051a565b34801561022e57600080fd5b506101bb61023d3660046130fc565b61052c565b34801561024e57600080fd5b506101bb61025d366004613126565b61053e565b34801561026e57600080fd5b506101bb6105b4565b61028a610285366004613162565b6105c6565b604080519283526020830191909152016101d9565b3480156102ab57600080fd5b50600154600160a01b900460ff165b60405190151581526020016101d9565b3480156102d657600080fd5b506102ba6102e53660046131a5565b6001600160a01b03166000908152600a602052604090205460ff1690565b34801561030f57600080fd5b506101bb6116f8565b34801561032457600080fd5b506101bb6103333660046131a5565b61170a565b34801561034457600080fd5b506101bb61179a565b34801561035957600080fd5b506101bb6117aa565b34801561036e57600080fd5b506001546001600160a01b03165b6040516001600160a01b0390911681526020016101d9565b3480156103a057600080fd5b506004546801000000000000000090046001600160a01b031661037c565b3480156103ca57600080fd5b506101bb6103d93660046131c0565b6117bc565b3480156103ea57600080fd5b506006546101cf565b3480156103ff57600080fd5b506101bb61040e3660046131c0565b6118fe565b34801561041f57600080fd5b506005546001600160a01b031661037c565b34801561043d57600080fd5b506007546101cf565b34801561045257600080fd5b506101bb610461366004613246565b611a3a565b34801561047257600080fd5b506101bb6104813660046131a5565b611a4c565b34801561049257600080fd5b506000546001600160a01b031661037c565b6104ac611cc5565b6104b68282611d1f565b5050565b6104c2611cc5565b6104d56001600160a01b03821683611db7565b6040518281526001600160a01b038216906000907fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb9060200160405180910390a35050565b610522611f16565b6104b68282611f96565b610534611f16565b6104b6828261207e565b610546611cc5565b600454610562908490839085908015613067021763ffffffff16565b806001600160a01b0316836001600160a01b03167fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb846040516105a791815260200190565b60405180910390a3505050565b6105bc611cc5565b6105c4612189565b565b6000806105d16121de565b6105d9612238565b6105e16122d6565b60e08301358015806105f35750804211155b6106445760405162461bcd60e51b815260206004820152601f60248201527f436f6d6d6f6e426173653a207472616e73616374696f6e20746f6f206f6c640060448201526064015b60405180910390fd5b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915260006106946020870187613268565b905011156109495760005b6106ac6020870187613268565b905081101561075c5760006106c46020880188613268565b838181106106d4576106d46132b9565b90506020028101906106e691906132cf565b6106f49060208101906131a5565b6001600160a01b03160361074a5760405162461bcd60e51b815260206004820152601960248201527f55503a20696e76616c696420737761702070726f766964657200000000000000604482015260640161063b565b8061075481613305565b91505061069f565b5061076a6020860186613268565b600081811061077b5761077b6132b9565b905060200281019061078d91906132cf565b61079b906040810190613268565b60008181106107ac576107ac6132b9565b90506020020160208101906107c191906131a5565b6001600160a01b031681526107d96020860186613268565b60008181106107ea576107ea6132b9565b90506020028101906107fc91906132cf565b61080a9060208101906131a5565b6001600160a01b031660e08201526000610827604087018761331e565b6108359060208101906131a5565b6001600160a01b03161461094457610850604086018661331e565b6108619060608101906040016131a5565b6001600160a01b03166108c861087a6020880188613268565b600161088960208b018b613268565b610894929150613334565b8181106108a3576108a36132b9565b90506020028101906108b591906132cf565b6108c3906040810190613268565b61232f565b6001600160a01b0316146109445760405162461bcd60e51b815260206004820152602260248201527f55503a207377617020616e642062726964676520746f6b656e206d69736d617460448201527f6368000000000000000000000000000000000000000000000000000000000000606482015260840161063b565b61099c565b610956604086018661331e565b6109679060608101906040016131a5565b6001600160a01b0316815261097f604086018661331e565b61098d9060208101906131a5565b6001600160a01b031660e08201525b60006109ab604087018761331e565b6109b99060208101906131a5565b6001600160a01b0316036109f9576109e66109d76020870187613268565b600161088960208a018a613268565b6001600160a01b03166020820152610a99565b6000610a08604087018761331e565b610a169060208101906131a5565b6001600160a01b031603610a6c5760405162461bcd60e51b815260206004820152601b60248201527f55503a20696e76616c6964206272696467652070726f76696465720000000000604482015260640161063b565b610a79604086018661331e565b610a8a9060a08101906080016131a5565b6001600160a01b031660208201525b80516001600160a01b0316610b27578435341015610b1f5760405162461bcd60e51b815260206004820152602160248201527f55503a206e6f7420656e6f7567682045544820696e207472616e73616374696f60448201527f6e00000000000000000000000000000000000000000000000000000000000000606482015260840161063b565b349350610d12565b80518535906001600160a01b03166370a08231336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610b7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba39190613347565b1015610c175760405162461bcd60e51b815260206004820152602660248201527f55503a2073656e64657220746f6b656e2062616c616e6365206973206e6f742060448201527f656e6f7567680000000000000000000000000000000000000000000000000000606482015260840161063b565b80518535906001600160a01b031663dd62ed3e336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604401602060405180830381865afa158015610c75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c999190613347565b1015610d0d5760405162461bcd60e51b815260206004820152602160248201527f55503a20746f6b656e20616c6c6f77616e6365206973206e6f7420656e6f756760448201527f6800000000000000000000000000000000000000000000000000000000000000606482015260840161063b565b843593505b60a085013515610dad57610d2b600260a0870135613360565b841015610d7a5760405162461bcd60e51b815260206004820152601b60248201527f55503a206578747261206665652065786365656473206c696d69740000000000604482015260640161063b565b8051610d979060a0870135610d9260c0890189613268565b61236b565b60c0820152610daa60a086013585613334565b93505b610dc2610dbd6020870187613268565b61270c565b604082018190526000606083018190526080830181905260a0830181905203610e305780516001600160a01b031660608201819052610e239015610e065733610e08565b305b606083015186610e1e60a08a0160808b016131a5565b6128d8565b60a0840152608083015293505b80516001600160a01b0316610e5c5760e0810151610e57906001600160a01b031685611db7565b610f73565b805160e08201516040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa158015610eae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed29190613347565b9050610ef03360e084015184516001600160a01b0316919088612a78565b815160e08301516040516370a0823160e01b81526001600160a01b039182166004820152839291909116906370a0823190602401602060405180830381865afa158015610f41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f659190613347565b610f6f9190613334565b9450505b60005b610f836020870187613268565b905081101561141d5736610f9a6020880188613268565b83818110610faa57610faa6132b9565b9050602002810190610fbc91906132cf565b9050610fcb6020880188613268565b9050610fd8836001613377565b101561103857610feb6020880188613268565b610ff6846001613377565b818110611005576110056132b9565b905060200281019061101791906132cf565b6110259060208101906131a5565b6001600160a01b031660e084015261108f565b6000611047604089018961331e565b6110559060208101906131a5565b6001600160a01b03161461107057611017604088018861331e565b61108060808801606089016131a5565b6001600160a01b031660e08401525b6004546040805160e08101909152680100000000000000009091046001600160a01b03169063863b1bb690806110c860208601866131a5565b6001600160a01b031681526020018460200160208101906110e991906131a5565b6001600160a01b031681526020016111046040860186613268565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250602081018a9052606080860135604083015201611156866001613377565b87604001511461116a578660e0015161116c565b305b6001600160a01b03168152602001611187608086018661338a565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509152506040516001600160e01b031960e084901b1681526111de9190600401613421565b6020604051808303816000875af11580156111fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112219190613347565b955061122e826001613377565b83604001510361140a576112486108c36040830183613268565b6001600160a01b03166060840181905261126f90309088610e1e60a08c0160808d016131a5565b60a08601526080850152955060608101358610156112cf5760405162461bcd60e51b815260206004820152601c60248201527f55503a20616d6f756e74206c657373207468616e206d696e696d756d00000000604482015260640161063b565b60608301516000906001600160a01b03161561135c57606084015160e08501516040516370a0823160e01b81526001600160a01b0391821660048201529116906370a0823190602401602060405180830381865afa158015611335573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113599190613347565b90505b611370308560600151898760e00151612b2f565b60608401516001600160a01b03161561140857606084015160e08501516040516370a0823160e01b81526001600160a01b039182166004820152839291909116906370a0823190602401602060405180830381865afa1580156113d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fb9190613347565b6114059190613334565b96505b505b508061141581613305565b915050610f76565b506000925082611430604087018761331e565b61143e9060208101906131a5565b6001600160a01b0316146115dd573661145a604087018761331e565b6005546040805161012081019091529192506001600160a01b0316906387814438908061148a60208601866131a5565b6001600160a01b031681526020018460200160208101906114ab91906131a5565b6001600160a01b031681526020016114c960608601604087016131a5565b6001600160a01b03168152606085013560208201526040016114f160a08601608087016131a5565b6001600160a01b031681526020018881526020018460a00135815260200189606001602081019061152291906131a5565b6001600160a01b0316815260200161153d60c086018661338a565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509152506040516001600160e01b031960e084901b16815261159491906004016134e7565b60408051808303816000875af11580156115b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d691906135a2565b9095509350505b6115ed60a08601608087016131a5565b6001600160a01b031661160660808701606088016131a5565b82516001600160a01b03919091169033907ffad3e93c5edf363a6a7db9e8df2679b14559c44e44a66a163359056050ab806f906101008a0135908a3561164f60408d018d61331e565b6060013588602001518c8c8b606001518c608001518d60a001518e60c001516040516116df9b9a999897969594939291909a8b526001600160a01b03998a1660208c015260408b019890985260608a0196909652938716608089015260a088019290925260c087015290931660e08501526101008401929092526101208301919091526101408201526101600190565b60405180910390a450506116f36001600355565b915091565b611700611cc5565b6105c46000612b96565b611712611f16565b6001600160a01b03811661178e5760405162461bcd60e51b815260206004820152602860248201527f41646d696e61626c653a206e65772061646d696e20697320746865207a65726f60448201527f2061646472657373000000000000000000000000000000000000000000000000606482015260840161063b565b61179781612bf5565b50565b6117a2611cc5565b6105c4612c52565b6117b2611f16565b6105c46000612bf5565b6117c4611f16565b60005b828110156118f857811561182f576001600b60008686858181106117ed576117ed6132b9565b905060200201602081019061180291906131a5565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905561187c565b600b6000858584818110611845576118456132b9565b905060200201602081019061185a91906131a5565b6001600160a01b031681526020810191909152604001600020805460ff191690555b7f842f5c76f4de7e226a4fe6449aaa3bf6acb19355e084107a9c90084b062f05788484838181106118af576118af6132b9565b90506020020160208101906118c491906131a5565b604080516001600160a01b03909216825284151560208301520160405180910390a1806118f081613305565b9150506117c7565b50505050565b611906611f16565b60005b828110156118f8578115611971576001600a600086868581811061192f5761192f6132b9565b905060200201602081019061194491906131a5565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790556119be565b600a6000858584818110611987576119876132b9565b905060200201602081019061199c91906131a5565b6001600160a01b031681526020810191909152604001600020805460ff191690555b7f254870e241695fd757faecd3bd3e3cd6010c2eacc60f119493253a56c75472778484838181106119f1576119f16132b9565b9050602002016020810190611a0691906131a5565b604080516001600160a01b03909216825284151560208301520160405180910390a180611a3281613305565b915050611909565b611a42611f16565b6104b68282612c95565b611a54611cc5565b6001600160a01b038116611ad05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161063b565b61179781612b96565b6001600160a01b038216611b3f5760405162461bcd60e51b815260206004820152602760248201527f5361666545524332303a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b606482015260840161063b565b7fffffffffffffffffffffffff59eb07fc490287f6795bd3871363808819212ec46001600160a01b03841601611be25760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015611bbe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f891906135c6565b6040516001600160a01b038316602482015260448101829052611c5a90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b031990931692909217909152612d9e565b505050565b6001600160a01b038216611be25760405162461bcd60e51b815260206004820152602760248201527f5361666545524332303a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b606482015260840161063b565b6001546001600160a01b031633146105c45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161063b565b8015611d4d576001600160a01b0382166000908152600260205260409020805460ff19166001179055611d6e565b6001600160a01b0382166000908152600260205260409020805460ff191690555b816001600160a01b03167f880be60bcc12281afa6ddd91d1d316535e12070fe042d26fa8acdf5a0a6116b882604051611dab911515815260200190565b60405180910390a25050565b6001600160a01b038216611e335760405162461bcd60e51b815260206004820152602d60248201527f536166654e617469766541737365743a207472616e7366657220746f2074686560448201527f207a65726f206164647265737300000000000000000000000000000000000000606482015260840161063b565b604080516000808252602082019092526001600160a01b038416908390604051611e5d91906135e3565b60006040518083038185875af1925050503d8060008114611e9a576040519150601f19603f3d011682016040523d82523d6000602084013e611e9f565b606091505b5050905080611c5a5760405162461bcd60e51b815260206004820152603360248201527f536166654e617469766541737365743a2073616665207472616e73666572206e60448201527f617469766520617373657473206661696c656400000000000000000000000000606482015260840161063b565b6000546001600160a01b031633146105c45760405162461bcd60e51b815260206004820152602260248201527f41646d696e61626c653a2063616c6c6572206973206e6f74207468652061646d60448201527f696e000000000000000000000000000000000000000000000000000000000000606482015260840161063b565b6001600160a01b03821615801590611fb657506001600160a01b03811615155b6120025760405162461bcd60e51b815260206004820152601960248201527f55503a2066656520726563697069656e74206973206e756c6c00000000000000604482015260640161063b565b600880546001600160a01b0384811673ffffffffffffffffffffffffffffffffffffffff199283168117909355600980549185169190921681179091556040805192835260208301919091527f0bc21fe5c3ab742ff1d15b5c4477ffbacf1167e618228078fa625edebe7f331d91015b60405180910390a15050565b6001600160a01b0382161580159061209e57506001600160a01b03811615155b6120ea5760405162461bcd60e51b815260206004820152601c60248201527f55503a20696e76616c696420636f6e7472616374206164647265737300000000604482015260640161063b565b600480547fffffffff0000000000000000000000000000000000000000ffffffffffffffff16680100000000000000006001600160a01b03858116918202929092179092556005805473ffffffffffffffffffffffffffffffffffffffff191691841691821790556040805192835260208301919091527fa960d3f7fe3af73a9dff7876fd364455b0232e66d0e46334ae724e96f8953c509101612072565b612191612e83565b6001805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600154600160a01b900460ff16156105c45760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161063b565b306001600160a01b037f000000000000000000000000cf55b66034c64dd441ddb8abbd8693b062461dfc16146105c45760405162461bcd60e51b815260206004820152602560248201527f436f6d6d6f6e426173653a2064656c65676174652063616c6c206e6f7420616c60448201527f6c6f776564000000000000000000000000000000000000000000000000000000606482015260840161063b565b6002600354036123285760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161063b565b6002600355565b6000828261233e600182613334565b81811061234d5761234d6132b9565b905060200201602081019061236291906131a5565b90505b92915050565b60008082810361237c5750336123b2565b8383600081811061238f5761238f6132b9565b90506020028101906123a191906132cf565b6123af9060208101906131a5565b90505b6001600160a01b0386166123d8576123d36001600160a01b03821686611db7565b6124e8565b6001600160a01b03811633146124e8576040516370a0823160e01b81526001600160a01b038281166004830152600091908816906370a0823190602401602060405180830381865afa158015612432573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124569190613347565b905061246d6001600160a01b038816338489612a78565b6040516370a0823160e01b81526001600160a01b0383811660048301528291908916906370a0823190602401602060405180830381865afa1580156124b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124da9190613347565b6124e49190613334565b9550505b60005b838110156126fe5736858583818110612506576125066132b9565b905060200281019061251891906132cf565b905084612526836001613377565b101561256f578585612539846001613377565b818110612548576125486132b9565b905060200281019061255a91906132cf565b6125689060208101906131a5565b9250612573565b3392505b6004546040805160e08101909152680100000000000000009091046001600160a01b03169063863b1bb690806125ac60208601866131a5565b6001600160a01b031681526020018460200160208101906125cd91906131a5565b6001600160a01b031681526020016125e86040860186613268565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250602081018b905260608086013560408301526001600160a01b0388169082015260809081019061264e9086018661338a565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509152506040516001600160e01b031960e084901b1681526126a59190600401613421565b6020604051808303816000875af11580156126c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126e89190613347565b96505080806126f690613305565b9150506124eb565b50849150505b949350505050565b6000612716612edc565b6127235750600019612365565b600082900361273457506000612365565b600083836000818110612749576127496132b9565b905060200281019061275b91906132cf565b612769906040810190613268565b600081811061277a5761277a6132b9565b905060200201602081019061278f91906131a5565b90506001600160a01b03811615806127bf57506001600160a01b0381166000908152600b602052604090205460ff165b156127ce576000915050612365565b60005b838110156128cd5760008585838181106127ed576127ed6132b9565b90506020028101906127ff91906132cf565b61280d906040810190613268565b6001888886818110612821576128216132b9565b905060200281019061283391906132cf565b612841906040810190613268565b61284c929150613334565b81811061285b5761285b6132b9565b905060200201602081019061287091906131a5565b90506001600160a01b03811615806128a057506001600160a01b0381166000908152600b602052604090205460ff165b156128ba576128b0826001613377565b9350505050612365565b50806128c581613305565b9150506127d1565b506000949350505050565b60008060006128e5612edc565b6128f757508391506000905080612a6e565b620f4240600654866129099190613360565b61291391906135f5565b9150600082116129655760405162461bcd60e51b815260206004820152601360248201527f55503a2066656520616d6f756e74206973203000000000000000000000000000604482015260640161063b565b506000816001600160a01b038516156129ff57620f42406007548761298a9190613360565b61299491906135f5565b9150600082116129e65760405162461bcd60e51b815260206004820152601960248201527f55503a2066656520736861726520616d6f756e74206973203000000000000000604482015260640161063b565b6129f288888488612b2f565b6129fc8282613334565b90505b60006001600160a01b0388161580612a2f57506001600160a01b0388166000908152600b602052604090205460ff165b612a44576009546001600160a01b0316612a51565b6008546001600160a01b03165b9050612a5f89898484612b2f565b612a698488613334565b945050505b9450945094915050565b6001600160a01b038216612ade5760405162461bcd60e51b815260206004820152602760248201527f5361666545524332303a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b606482015260840161063b565b6040516001600160a01b03808516602483015283166044820152606481018290526118f89085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611c0e565b6001600160a01b038316612b5557612b506001600160a01b03821683611db7565b6118f8565b306001600160a01b03851603612b8157600454612b50908490839085908015613067021763ffffffff16565b6118f86001600160a01b038416858385612a78565b600180546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec69190a35050565b612c5a6121de565b6001805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586121c13390565b620186a0821115612ce85760405162461bcd60e51b815260206004820152601a60248201527f55503a2066656520726174652065786365656473206c696d6974000000000000604482015260640161063b565b80821015612d5e5760405162461bcd60e51b815260206004820152602e60248201527f55503a206665652073686172652072617465206973206c657373207468616e2060448201527f746f74616c206665652072617465000000000000000000000000000000000000606482015260840161063b565b6006829055600781905560408051838152602081018390527fb9ffe02e89fee6f5544ee152a08c2cafbc3a4a89a66737ef42115dcd508aea109101612072565b6000612df3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612f449092919063ffffffff16565b805190915015611c5a5780806020019051810190612e1191906135c6565b611c5a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161063b565b600154600160a01b900460ff166105c45760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161063b565b600080600654118015612eff5750336000908152600a602052604090205460ff16155b8015612f1f57506008546001600160a01b0316336001600160a01b031614155b8015612f3f57506009546001600160a01b0316336001600160a01b031614155b905090565b6060612704848460008585600080866001600160a01b03168587604051612f6b91906135e3565b60006040518083038185875af1925050503d8060008114612fa8576040519150601f19603f3d011682016040523d82523d6000602084013e612fad565b606091505b5091509150612fbe87838387612fc9565b979650505050505050565b60608315613038578251600003613031576001600160a01b0385163b6130315760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161063b565b5081612704565b612704838381511561304d5781518083602001fd5b8060405162461bcd60e51b815260040161063b9190613617565b6105c461362a565b80356001600160a01b038116811461308657600080fd5b919050565b801515811461179757600080fd5b600080604083850312156130ac57600080fd5b6130b58361306f565b915060208301356130c58161308b565b809150509250929050565b600080604083850312156130e357600080fd5b823591506130f36020840161306f565b90509250929050565b6000806040838503121561310f57600080fd5b6131188361306f565b91506130f36020840161306f565b60008060006060848603121561313b57600080fd5b6131448461306f565b9250602084013591506131596040850161306f565b90509250925092565b60006020828403121561317457600080fd5b813567ffffffffffffffff81111561318b57600080fd5b8201610120818503121561319e57600080fd5b9392505050565b6000602082840312156131b757600080fd5b6123628261306f565b6000806000604084860312156131d557600080fd5b833567ffffffffffffffff808211156131ed57600080fd5b818601915086601f83011261320157600080fd5b81358181111561321057600080fd5b8760208260051b850101111561322557600080fd5b6020928301955093505084013561323b8161308b565b809150509250925092565b6000806040838503121561325957600080fd5b50508035926020909101359150565b6000808335601e1984360301811261327f57600080fd5b83018035915067ffffffffffffffff82111561329a57600080fd5b6020019150600581901b36038213156132b257600080fd5b9250929050565b634e487b7160e01b600052603260045260246000fd5b60008235609e198336030181126132e557600080fd5b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b600060018201613317576133176132ef565b5060010190565b6000823560de198336030181126132e557600080fd5b81810381811115612365576123656132ef565b60006020828403121561335957600080fd5b5051919050565b8082028115828204841417612365576123656132ef565b80820180821115612365576123656132ef565b6000808335601e198436030181126133a157600080fd5b83018035915067ffffffffffffffff8211156133bc57600080fd5b6020019150368190038213156132b257600080fd5b60005b838110156133ec5781810151838201526020016133d4565b50506000910152565b6000815180845261340d8160208601602086016133d1565b601f01601f19169290920160200192915050565b6000602080835261010083016001600160a01b0380865116838601528083870151166040860152604086015160e06060870152828151808552610120880191508583019450600092505b8083101561348d5784518416825293850193600192909201919085019061346b565b5060608801516080880152608088015160a088015260a088015194506134be60c08801866001600160a01b03169052565b60c0880151878203601f190160e089015294506134db81866133f5565b98975050505050505050565b602081526135016020820183516001600160a01b03169052565b6000602083015161351d60408401826001600160a01b03169052565b5060408301516001600160a01b03811660608401525060608301516080830152608083015161355760a08401826001600160a01b03169052565b5060a083015160c083015260c083015160e083015260e0830151610100613588818501836001600160a01b03169052565b8401516101208481015290506127046101408401826133f5565b600080604083850312156135b557600080fd5b505080516020909101519092909150565b6000602082840312156135d857600080fd5b815161319e8161308b565b600082516132e58184602087016133d1565b60008261361257634e487b7160e01b600052601260045260246000fd5b500490565b60208152600061236260208301846133f5565b634e487b7160e01b600052605160045260246000fdfea26469706673582212207498a31fd81f3dbe89cb9a22ea52fae50cf5ae9617839821e6be6d2cf2be022564736f6c63430008130033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000008818f58784b4cda3150ca887abd0c45bbb26b4df0000000000000000000000002df4a9076fe14b00309635ea68f301be2e0afc6e0000000000000000000000000000000000000000000000000000000000000bb800000000000000000000000000000000000000000000000000000000000004b0000000000000000000000000f04f1dc6fa5e2ccbefc5e4eb9ec694653442f45e000000000000000000000000f04f1dc6fa5e2ccbefc5e4eb9ec694653442f45e

-----Decoded View---------------
Arg [0] : swapContract_ (address): 0x8818F58784b4cDa3150cA887abD0c45bBb26B4Df
Arg [1] : bridgeContract_ (address): 0x2dF4a9076Fe14B00309635eA68F301bE2e0AFC6E
Arg [2] : feeRate_ (uint256): 3000
Arg [3] : feeShareRate_ (uint256): 1200
Arg [4] : mainFeeRecipient_ (address): 0xF04f1DC6Fa5E2ccBEFc5E4EB9ec694653442f45e
Arg [5] : altFeeRecipient_ (address): 0xF04f1DC6Fa5E2ccBEFc5E4EB9ec694653442f45e

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000008818f58784b4cda3150ca887abd0c45bbb26b4df
Arg [1] : 0000000000000000000000002df4a9076fe14b00309635ea68f301be2e0afc6e
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000bb8
Arg [3] : 00000000000000000000000000000000000000000000000000000000000004b0
Arg [4] : 000000000000000000000000f04f1dc6fa5e2ccbefc5e4eb9ec694653442f45e
Arg [5] : 000000000000000000000000f04f1dc6fa5e2ccbefc5e4eb9ec694653442f45e


Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.