ETH Price: $3,166.76 (+3.48%)

Contract

0x31691Fd2Cf50c777943b213836C342327f0DAB9b
 

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Swap Recolor Sen...1190517972024-04-21 12:26:1119 mins ago1713702371IN
0x31691Fd2...27f0DAB9b
0.00011197 ETH0.000003320.00782941
Swap Recolor Sen...1190517732024-04-21 12:25:2319 mins ago1713702323IN
0x31691Fd2...27f0DAB9b
0.00011197 ETH0.00000330.00759052
Swap Recolor Sen...1190516482024-04-21 12:21:1323 mins ago1713702073IN
0x31691Fd2...27f0DAB9b
0.00011197 ETH0.000003280.00766054
Swap Recolor Sen...1190514802024-04-21 12:15:3729 mins ago1713701737IN
0x31691Fd2...27f0DAB9b
0.00016799 ETH0.000003170.00753162
Swap Recolor Sen...1190514782024-04-21 12:15:3329 mins ago1713701733IN
0x31691Fd2...27f0DAB9b
0.00016799 ETH0.000003170.00753162
Swap Recolor Sen...1190514762024-04-21 12:15:2929 mins ago1713701729IN
0x31691Fd2...27f0DAB9b
0.00016799 ETH0.000003170.00753162
Swap Recolor Sen...1190513572024-04-21 12:11:3133 mins ago1713701491IN
0x31691Fd2...27f0DAB9b
0.00020872 ETH0.000003160.00745694
Swap Recolor Sen...1190508032024-04-21 11:53:0352 mins ago1713700383IN
0x31691Fd2...27f0DAB9b
0.0001107 ETH0.00000320.00760006
Swap Recolor Sen...1190500122024-04-21 11:26:411 hr ago1713698801IN
0x31691Fd2...27f0DAB9b
0.00016799 ETH0.00000330.007836
Swap Recolor Sen...1190500112024-04-21 11:26:391 hr ago1713698799IN
0x31691Fd2...27f0DAB9b
0.00016799 ETH0.00000330.007836
Swap Recolor Sen...1190500092024-04-21 11:26:351 hr ago1713698795IN
0x31691Fd2...27f0DAB9b
0.00016799 ETH0.000003420.00808907
Swap Recolor Sen...1190498642024-04-21 11:21:451 hr ago1713698505IN
0x31691Fd2...27f0DAB9b
0.00011017 ETH0.000003170.00775781
Swap Recolor Sen...1190493432024-04-21 11:04:231 hr ago1713697463IN
0x31691Fd2...27f0DAB9b
0.00011197 ETH0.000045790.1067201
Swap Recolor Sen...1190483802024-04-21 10:32:172 hrs ago1713695537IN
0x31691Fd2...27f0DAB9b
0.00020872 ETH0.000003490.00837459
Swap Recolor Sen...1190480212024-04-21 10:20:192 hrs ago1713694819IN
0x31691Fd2...27f0DAB9b
0.00011197 ETH0.000004360.01028522
Swap Recolor Sen...1190479252024-04-21 10:17:072 hrs ago1713694627IN
0x31691Fd2...27f0DAB9b
0.00011197 ETH0.000004070.0095972
Swap Recolor Sen...1190476282024-04-21 10:07:132 hrs ago1713694033IN
0x31691Fd2...27f0DAB9b
0.00011117 ETH0.00000350.00831602
Swap Recolor Sen...1190475132024-04-21 10:03:232 hrs ago1713693803IN
0x31691Fd2...27f0DAB9b
0.0001354 ETH0.000003270.00767655
Swap Recolor Sen...1190474452024-04-21 10:01:072 hrs ago1713693667IN
0x31691Fd2...27f0DAB9b
0.00016799 ETH0.000003170.0075358
Swap Recolor Sen...1190474412024-04-21 10:00:592 hrs ago1713693659IN
0x31691Fd2...27f0DAB9b
0.00016799 ETH0.000003170.0075358
Swap Recolor Sen...1190474372024-04-21 10:00:512 hrs ago1713693651IN
0x31691Fd2...27f0DAB9b
0.00016799 ETH0.000003170.0075358
Swap Recolor Sen...1190463352024-04-21 9:24:073 hrs ago1713691447IN
0x31691Fd2...27f0DAB9b
0.00011197 ETH0.000003320.00786859
Swap Recolor Sen...1190458272024-04-21 9:07:113 hrs ago1713690431IN
0x31691Fd2...27f0DAB9b
0.00011787 ETH0.000003250.00779975
Swap Recolor Sen...1190458112024-04-21 9:06:393 hrs ago1713690399IN
0x31691Fd2...27f0DAB9b
0.00016799 ETH0.000003350.0079431
Swap Recolor Sen...1190458102024-04-21 9:06:373 hrs ago1713690397IN
0x31691Fd2...27f0DAB9b
0.00016799 ETH0.000003310.00786655
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Txn Hash Block From To Value
1190517972024-04-21 12:26:1119 mins ago1713702371
0x31691Fd2...27f0DAB9b
0.00011197 ETH
1190517732024-04-21 12:25:2319 mins ago1713702323
0x31691Fd2...27f0DAB9b
0.00011197 ETH
1190516482024-04-21 12:21:1323 mins ago1713702073
0x31691Fd2...27f0DAB9b
0.00011197 ETH
1190514802024-04-21 12:15:3729 mins ago1713701737
0x31691Fd2...27f0DAB9b
0.00016799 ETH
1190514782024-04-21 12:15:3329 mins ago1713701733
0x31691Fd2...27f0DAB9b
0.00016799 ETH
1190514762024-04-21 12:15:2929 mins ago1713701729
0x31691Fd2...27f0DAB9b
0.00016799 ETH
1190513572024-04-21 12:11:3133 mins ago1713701491
0x31691Fd2...27f0DAB9b
0.00020872 ETH
1190508032024-04-21 11:53:0352 mins ago1713700383
0x31691Fd2...27f0DAB9b
0.0001107 ETH
1190500122024-04-21 11:26:411 hr ago1713698801
0x31691Fd2...27f0DAB9b
0.00016799 ETH
1190500112024-04-21 11:26:391 hr ago1713698799
0x31691Fd2...27f0DAB9b
0.00016799 ETH
1190500092024-04-21 11:26:351 hr ago1713698795
0x31691Fd2...27f0DAB9b
0.00016799 ETH
1190498642024-04-21 11:21:451 hr ago1713698505
0x31691Fd2...27f0DAB9b
0.00011017 ETH
1190493432024-04-21 11:04:231 hr ago1713697463
0x31691Fd2...27f0DAB9b
0.00011197 ETH
1190483802024-04-21 10:32:172 hrs ago1713695537
0x31691Fd2...27f0DAB9b
0.00020872 ETH
1190480212024-04-21 10:20:192 hrs ago1713694819
0x31691Fd2...27f0DAB9b
0.00011197 ETH
1190479252024-04-21 10:17:072 hrs ago1713694627
0x31691Fd2...27f0DAB9b
0.00011197 ETH
1190476282024-04-21 10:07:132 hrs ago1713694033
0x31691Fd2...27f0DAB9b
0.00011117 ETH
1190475132024-04-21 10:03:232 hrs ago1713693803
0x31691Fd2...27f0DAB9b
0.0001354 ETH
1190474452024-04-21 10:01:072 hrs ago1713693667
0x31691Fd2...27f0DAB9b
0.00016799 ETH
1190474412024-04-21 10:00:592 hrs ago1713693659
0x31691Fd2...27f0DAB9b
0.00016799 ETH
1190474372024-04-21 10:00:512 hrs ago1713693651
0x31691Fd2...27f0DAB9b
0.00016799 ETH
1190463352024-04-21 9:24:073 hrs ago1713691447
0x31691Fd2...27f0DAB9b
0.00011197 ETH
1190458272024-04-21 9:07:113 hrs ago1713690431
0x31691Fd2...27f0DAB9b
0.00011787 ETH
1190458112024-04-21 9:06:393 hrs ago1713690399
0x31691Fd2...27f0DAB9b
0.00016799 ETH
1190458102024-04-21 9:06:373 hrs ago1713690397
0x31691Fd2...27f0DAB9b
0.00016799 ETH
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BridgeRecolor

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 5000 runs

Other Settings:
paris EvmVersion, None license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 19 : BridgeRecolor.sol
// SPDX-License-Identifier: LZBL-1.1
// Copyright 2023 LayerZero Labs Ltd.
// You may obtain a copy of the License at
// https://github.com/LayerZero-Labs/license/blob/main/LICENSE-LZBL-1.1

pragma solidity 0.8.19;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "../mm/interfaces/IToUSDVLp.sol";

import "./SwapRecolor.sol";

// 1/ this contract swaps X stable coin to USDV and send it to recolorHelper
// 2/ then use the recolorHelper to send out the usdv
// 3/ it assert the color to be bridge color
contract BridgeRecolor is SwapRecolor, Ownable {
    using SafeERC20 for IERC20;

    uint8 internal constant USDV_DECIMALS = 6;

    IToUSDVLp public lp;
    uint32 public color; // the target color for recoloring
    uint16 public userRewardBps = 9; // 9 bps reward to user
    uint16 public toleranceBps = 10;

    constructor(address _lp, uint32 _color, address _recolorHelper, address _usdv) SwapRecolor(_recolorHelper, _usdv) {
        lp = IToUSDVLp(_lp);
        color = _color;
    }

    // owner sets lp address
    function setLpAddress(address _lp) external onlyOwner {
        lp = IToUSDVLp(_lp);
    }

    function setUserRewardBps(uint16 _userRewardBps) external onlyOwner {
        userRewardBps = _userRewardBps;
    }

    function setColor(uint32 _color) external onlyOwner {
        color = _color;
    }

    function setToleranceBps(uint16 _toleranceBps) external onlyOwner {
        toleranceBps = _toleranceBps;
    }

    function withdrawUSDV(address _to, uint _amount) external onlyOwner {
        usdv.safeTransfer(_to, _amount);
    }

    /// @dev only can recolor to the color set by the owner
    function swapRecolorTransfer(
        SwapParam calldata _swapParam,
        address _receiver,
        uint32 /*_toColor*/
    ) public override returns (uint usdvOut) {
        usdvOut = super.swapRecolorTransfer(_swapParam, _receiver, color);
    }

    /// @dev only can recolor to the color set by the owner
    function swapRecolorSend(
        SwapParam calldata _swapParam,
        uint32 /*_toColor*/,
        IOFT.SendParam memory _param, // need to change the amountLD
        bytes calldata _extraOptions,
        MessagingFee calldata _msgFee,
        address payable _refundAddress,
        bytes calldata _composeMsg
    ) public payable override returns (uint usdvOut, MessagingReceipt memory msgReceipt) {
        (usdvOut, msgReceipt) = super.swapRecolorSend(
            _swapParam,
            color,
            _param,
            _extraOptions,
            _msgFee,
            _refundAddress,
            _composeMsg
        );
    }

    function _swap(SwapParam calldata _param) internal override returns (uint usdvOut) {
        // approve the lp to spend the token
        IERC20(_param._fromToken).forceApprove(address(lp), _param._fromTokenAmount);
        uint beforeUSDVBalance = usdv.balanceOf(address(this));
        uint usdvSwapped = lp.swapToUSDV(_param._fromToken, _param._fromTokenAmount, _param._minUSDVOut, address(this));

        // cross-check with balance to make sure that lp is behaving as expected
        uint afterUSDVBalance = usdv.balanceOf(address(this));
        require(afterUSDVBalance - beforeUSDVBalance == usdvSwapped, "BridgeRecolor: swap amount too low");

        usdvOut = _getUSDVOut(_param._fromToken, _param._fromTokenAmount);
        require(afterUSDVBalance >= usdvOut, "BridgeRecolor: not enough usdv");
        if (usdvOut > usdvSwapped) {
            require(usdvOut - usdvSwapped <= (usdvOut * toleranceBps) / 10000, "BridgeRecolor: exceeds tolerance");
        }
        // slippage assertion
        require(usdvOut >= _param._minUSDVOut, "BridgeRecolor: swap amount too low");
    }

    // view function for supported tokens of the lp
    function getSupportedTokens() external view returns (address[] memory tokens) {
        return lp.getSupportedTokens();
    }

    // view function for estimating output
    function getUSDVOut(address _fromToken, uint _fromTokenAmount) external view returns (uint usdvOut) {
        usdvOut = _getUSDVOut(_fromToken, _fromTokenAmount);
        uint usdvFromLp = lp.getUSDVOut(_fromToken, _fromTokenAmount);
        require(usdv.balanceOf(address(this)) + usdvFromLp >= usdvOut, "BridgeRecolor: not enough usdv");
        if (usdvOut > usdvFromLp) {
            require(usdvOut - usdvFromLp <= (usdvOut * toleranceBps) / 10000, "BridgeRecolor: exceeds tolerance");
        }
    }

    function getUSDVOutVerbose(
        address _fromToken,
        uint _fromTokenAmount
    ) external view returns (uint usdvOut, uint fee, uint reward) {
        uint8 tokenDecimals = IERC20Metadata(_fromToken).decimals();
        require(tokenDecimals >= USDV_DECIMALS, "BridgeRecolor: token decimals must >= 6");
        uint usdvRequested = _fromTokenAmount / (10 ** (tokenDecimals - USDV_DECIMALS));

        fee = 0;
        reward = (usdvRequested * userRewardBps) / 10000;
        usdvOut = usdvRequested + reward;

        uint usdvFromLp = lp.getUSDVOut(_fromToken, _fromTokenAmount);
        require(usdv.balanceOf(address(this)) + usdvFromLp >= usdvOut, "BridgeRecolor: not enough usdv");
        if (usdvOut > usdvFromLp) {
            require(usdvOut - usdvFromLp <= (usdvOut * toleranceBps) / 10000, "BridgeRecolor: exceeds tolerance");
        }
    }

    function _getUSDVOut(address _fromToken, uint _fromTokenAmount) internal view returns (uint usdvOut) {
        uint8 tokenDecimals = IERC20Metadata(_fromToken).decimals();
        require(tokenDecimals >= USDV_DECIMALS, "BridgeRecolor: token decimals must >= 6");
        uint usdvRequested = _fromTokenAmount / (10 ** (tokenDecimals - USDV_DECIMALS));
        usdvOut = usdvRequested + (usdvRequested * userRewardBps) / 10000;
    }
}

File 2 of 19 : IOFT.sol
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;

import {MessagingFee, MessagingReceipt} from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol";

// @dev unable to inherit ERC20 because the OFTAdapter needs to use this interface as well
interface IOFT {
    struct SendParam {
        bytes32 to;
        uint amountLD;
        uint minAmountLD;
        uint32 dstEid;
    }

    error LDMinusSD();
    error AmountSlippage(uint _amountLDSend, uint256 _minAmountLD);

    event SetInspector(address _inspector);
    event SendOFT(bytes32 indexed _guid, address indexed _fromAddress, uint _amountLD, bytes _composeMsg);
    event ReceiveOFT(bytes32 indexed _guid, address indexed _toAddress, uint _amountLD);

    function token() external view returns (address);

    function quoteSendFee(
        SendParam calldata _send,
        bytes calldata _options,
        bool _useLZToken,
        bytes calldata _composeMsg
    ) external view returns (uint nativeFee, uint lzTokenFee);

    function send(
        SendParam calldata _send,
        bytes calldata _options,
        MessagingFee calldata _msgFee,
        address payable _refundAddress,
        bytes calldata _composeMsg
    ) external payable returns (MessagingReceipt memory);
}

File 3 of 19 : MessagingStructs.sol
// SPDX-License-Identifier: BUSL-1.1

pragma solidity >=0.8.0;

struct PacketForQuote {
    address sender;
    uint32 dstEid;
    bytes message;
}

struct Packet {
    uint64 nonce;
    uint32 srcEid;
    address sender;
    uint32 dstEid;
    bytes32 receiver;
    bytes32 guid;
    bytes message;
}

struct Origin {
    uint32 srcEid;
    bytes32 sender;
    uint64 nonce;
}

File 4 of 19 : ILayerZeroEndpointV2.sol
// SPDX-License-Identifier: BUSL-1.1

pragma solidity >=0.8.0;

import "./IMessageLibManager.sol";
import "./IMessagingComposer.sol";
import "./IMessagingChannel.sol";
import "./IMessagingContext.sol";
import {Origin} from "../MessagingStructs.sol";

struct MessagingParams {
    uint32 dstEid;
    bytes32 receiver;
    bytes message;
    bytes options;
}

struct MessagingReceipt {
    bytes32 guid;
    uint64 nonce;
    MessagingFee fee;
}

struct MessagingFee {
    uint nativeFee;
    uint lzTokenFee;
}

interface ILayerZeroEndpointV2 is IMessageLibManager, IMessagingComposer, IMessagingChannel, IMessagingContext {
    event PacketSent(bytes encodedPayload, bytes options, address sendLibrary);

    event PacketDelivered(Origin origin, address receiver, bytes32 payloadHash);

    event PacketReceived(Origin origin, address receiver);

    event LzReceiveFailed(Origin origin, address receiver, bytes reason);

    event LayerZeroTokenSet(address token);

    function quote(
        address _sender,
        uint32 _dstEid,
        bytes calldata _message,
        bool _payInLzToken,
        bytes calldata _options
    ) external view returns (MessagingFee memory);

    function send(
        MessagingParams calldata _params,
        uint _lzTokenFee,
        address payable _refundAddress
    ) external payable returns (MessagingReceipt memory);

    function sendWithAlt(
        MessagingParams calldata _params,
        uint _lzTokenFee,
        uint _altTokenFee
    ) external returns (MessagingReceipt memory);

    function deliver(Origin calldata _origin, address _receiver, bytes32 _payloadHash) external;

    function deliverable(Origin calldata _origin, address _receiveLib, address _receiver) external view returns (bool);

    function lzReceive(
        Origin calldata _origin,
        address _receiver,
        bytes32 _guid,
        bytes calldata _message,
        bytes calldata _extraData
    ) external payable returns (bool, bytes memory);

    // oapp can burn messages partially by calling this function with its own business logic if messages are delivered in order
    function clear(Origin calldata _origin, bytes32 _guid, bytes calldata _message) external;

    function setLayerZeroToken(address _layerZeroToken) external;

    function layerZeroToken() external view returns (address);

    function altFeeToken() external view returns (address);
}

File 5 of 19 : IMessageLibManager.sol
// SPDX-License-Identifier: BUSL-1.1

pragma solidity >=0.8.0;

struct SetConfigParam {
    uint32 configType;
    bytes config;
}

interface IMessageLibManager {
    struct Timeout {
        address lib;
        uint expiry;
    }

    event LibraryRegistered(address newLib);
    event DefaultSendLibrarySet(uint32 eid, address newLib);
    event DefaultReceiveLibrarySet(uint32 eid, address oldLib, address newLib);
    event DefaultReceiveLibraryTimeoutSet(uint32 eid, address oldLib, uint expiry);
    event SendLibrarySet(address sender, uint32 eid, address newLib);
    event ReceiveLibrarySet(address receiver, uint32 eid, address oldLib, address newLib);
    event ReceiveLibraryTimoutSet(address receiver, uint32 eid, address oldLib, uint timeout);

    function registerLibrary(address _lib) external;

    function isRegisteredLibrary(address _lib) external view returns (bool);

    function getRegisteredLibraries() external view returns (address[] memory);

    function setDefaultSendLibrary(uint32 _eid, address _newLib) external;

    function defaultSendLibrary(uint32 _eid) external view returns (address);

    function setDefaultReceiveLibrary(uint32 _eid, address _newLib, uint _timeout) external;

    function defaultReceiveLibrary(uint32 _eid) external view returns (address);

    function setDefaultReceiveLibraryTimeout(uint32 _eid, address _lib, uint _expiry) external;

    function defaultReceiveLibraryTimeout(uint32 _eid) external view returns (address lib, uint expiry);

    function defaultConfig(address _lib, uint32 _eid, uint32 _configType) external view returns (bytes memory);

    function isSupportedEid(uint32 _eid) external view returns (bool);

    /// ------------------- OApp interfaces -------------------
    function setSendLibrary(uint32 _eid, address _newLib) external;

    function getSendLibrary(address _sender, uint32 _eid) external view returns (address lib);

    function isDefaultSendLibrary(address _sender, uint32 _eid) external view returns (bool);

    function setReceiveLibrary(uint32 _eid, address _newLib, uint _gracePeriod) external;

    function getReceiveLibrary(address _receiver, uint32 _eid) external view returns (address lib, bool isDefault);

    function setReceiveLibraryTimeout(uint32 _eid, address _lib, uint _gracePeriod) external;

    function receiveLibraryTimeout(address _receiver, uint32 _eid) external view returns (address lib, uint expiry);

    function setConfig(address _lib, uint32 _eid, SetConfigParam[] calldata _params) external;

    function getConfig(
        address _oapp,
        address _lib,
        uint32 _eid,
        uint32 _configType
    ) external view returns (bytes memory config, bool isDefault);

    function snapshotConfig(address _lib, uint32[] calldata _eids) external;

    function resetConfig(address _lib, uint32[] calldata _eids) external;
}

File 6 of 19 : IMessagingChannel.sol
// SPDX-License-Identifier: BUSL-1.1

pragma solidity >=0.8.0;

interface IMessagingChannel {
    event InboundNonceSkipped(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce);

    function eid() external view returns (uint32);

    // this is an emergency function if a message can not be delivered for some reasons
    // required to provide _nextNonce to avoid race condition
    function skip(uint32 _srcEid, bytes32 _sender, uint64 _nonce) external;

    function nextGuid(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (bytes32);

    function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);

    function outboundNonce(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (uint64);

    function inboundPayloadHash(
        address _receiver,
        uint32 _srcEid,
        bytes32 _sender,
        uint64 _nonce
    ) external view returns (bytes32);

    function hasPayloadHash(
        address _receiver,
        uint32 _srcEid,
        bytes32 _sender,
        uint64 _nonce
    ) external view returns (bool);
}

File 7 of 19 : IMessagingComposer.sol
// SPDX-License-Identifier: BUSL-1.1

pragma solidity >=0.8.0;

interface IMessagingComposer {
    event ComposedMessageDelivered(address receiver, address composer, bytes32 guid, bytes message);
    event ComposedMessageReceived(address receiver, address composer, bytes32 guid);
    event LzComposeFailed(address receiver, address composer, bytes32 guid, bytes reason);

    function deliverComposedMessage(address _composer, bytes32 _guid, bytes calldata _message) external;

    function lzCompose(
        address _receiver,
        address _composer,
        bytes32 _guid,
        bytes calldata _message,
        bytes calldata _extraData
    ) external payable returns (bool, bytes memory);
}

File 8 of 19 : IMessagingContext.sol
// SPDX-License-Identifier: BUSL-1.1

pragma solidity >=0.8.0;

interface IMessagingContext {
    function isSendingMessage() external view returns (bool);

    function getSendContext() external view returns (uint32, address);
}

File 9 of 19 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/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. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling 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 10 of 19 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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 11 of 19 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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 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 12 of 19 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

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

File 13 of 19 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 14 of 19 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        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));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    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");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }

    /**
     * @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).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // 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 cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

File 15 of 19 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [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://consensys.net/diligence/blog/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.8.0/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 16 of 19 : 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 17 of 19 : IToUSDVLp.sol
// SPDX-License-Identifier: LZBL-1.1
// Copyright 2023 LayerZero Labs Ltd.
// You may obtain a copy of the License at
// https://github.com/LayerZero-Labs/license/blob/main/LICENSE-LZBL-1.1

pragma solidity ^0.8.0;

// lp contract for converting other stable coins to USDV
interface IToUSDVLp {
    function getSupportedTokens() external view returns (address[] memory tokens);

    function swapToUSDV(
        address _fromToken,
        uint _fromTokenAmount,
        uint64 _minUSDVOut,
        address _receiver
    ) external returns (uint usdvOut);

    function getUSDVOut(address _fromToken, uint _fromTokenAmount) external view returns (uint usdvOut);

    function getUSDVOutVerbose(
        address _fromToken,
        uint _fromTokenAmount
    ) external view returns (uint requestedOut, uint rewardOut);
}

File 18 of 19 : SwapRecolor.sol
// SPDX-License-Identifier: LZBL-1.1
// Copyright 2023 LayerZero Labs Ltd.
// You may obtain a copy of the License at
// https://github.com/LayerZero-Labs/license/blob/main/LICENSE-LZBL-1.1

pragma solidity ^0.8.0;

import "./interfaces/IRecolorHelper.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

// this contract is generic for partner to perform stable coin swap into USDV and use recolorHelper to send out
// example 1: deploy as a generic help built on recolor helper for any protocols to swap into the provided color
// example 2: inherited by a specific protocol and only swap into the preconfigured color by asserting the toColor == myColor
abstract contract SwapRecolor is ReentrancyGuard {
    using SafeERC20 for IERC20;

    struct SwapParam {
        address _fromToken;
        uint _fromTokenAmount;
        uint64 _minUSDVOut;
    }

    IRecolorHelper public immutable recolorHelper;
    IERC20 public immutable usdv;

    constructor(address _recolorHelper, address _usdv) {
        recolorHelper = IRecolorHelper(_recolorHelper);
        usdv = IERC20(_usdv);
    }

    /// @dev do swap and then transfer out with color through recolorHelper
    function swapRecolorTransfer(
        SwapParam calldata _swapParam,
        address _receiver,
        uint32 _toColor
    ) public virtual nonReentrant returns (uint usdvOut) {
        // get the token from msg.sender
        IERC20(_swapParam._fromToken).safeTransferFrom(msg.sender, address(this), _swapParam._fromTokenAmount);
        // do the swap and send the token to recolorHelper
        usdvOut = _swap(_swapParam);
        // send out through recolorHelper
        usdv.approve(address(recolorHelper), usdvOut);
        recolorHelper.approvedTransferWithColor(_receiver, usdvOut, _toColor);
    }

    /// @dev do swap and then transfer out with color through recolorHelper
    function swapRecolorSend(
        SwapParam calldata _swapParam,
        uint32 _toColor,
        IOFT.SendParam memory _param, // need to change the amountLD
        bytes calldata _extraOptions,
        MessagingFee calldata _msgFee,
        address payable _refundAddress,
        bytes calldata _composeMsg
    ) public payable virtual nonReentrant returns (uint usdvOut, MessagingReceipt memory msgReceipt) {
        // get the token from msg.sender
        IERC20(_swapParam._fromToken).safeTransferFrom(msg.sender, address(this), _swapParam._fromTokenAmount);
        // do the swap and send the token to recolorHelper
        usdvOut = _swap(_swapParam);
        // override this with the swap output
        _param.amountLD = usdvOut;
        // send out through recolorHelper
        usdv.approve(address(recolorHelper), usdvOut);
        msgReceipt = recolorHelper.approvedSendWithColor{value: msg.value}(
            _param,
            _toColor,
            _extraOptions,
            _msgFee,
            _refundAddress,
            _composeMsg
        );
    }

    // can override this function on different chains to connect to different dex
    function _swap(SwapParam calldata _param) internal virtual returns (uint usdvOut);
}

File 19 of 19 : IRecolorHelper.sol
// SPDX-License-Identifier: LZBL-1.1
// Copyright 2023 LayerZero Labs Ltd.
// You may obtain a copy of the License at
// https://github.com/LayerZero-Labs/license/blob/main/LICENSE-LZBL-1.1

pragma solidity ^0.8.0;

import "@layerzerolabs/lz-evm-oapp-v2/contracts/standards/oft/interfaces/IOFT.sol";

interface IRecolorHelper {
    /// ------ local transfer function -----

    /// @dev send USDV into this account and then ATOMICALLY transfer out with color
    function transferWithColor(address _receiver, uint256 _amount, uint32 _toColor) external;

    /// @dev it requires the caller to approve this contract to spend their USDV
    function approvedTransferWithColor(address _receiver, uint256 _amount, uint32 _toColor) external;

    /// ------ crosschain transfer function transfer function -----

    /// @dev send USDV into this account and then ATOMICALLY send across-chain
    function sendWithColor(
        IOFT.SendParam calldata _param,
        uint32 _toColor,
        bytes calldata _extraOptions,
        MessagingFee calldata _msgFee,
        address payable _refundAddress,
        bytes calldata _composeMsg
    ) external payable returns (MessagingReceipt memory);

    /// @dev it requires the caller to approve this contract to spend their USDV
    function approvedSendWithColor(
        IOFT.SendParam calldata _param,
        uint32 _toColor,
        bytes calldata _extraOptions,
        MessagingFee calldata _msgFee,
        address payable _refundAddress,
        bytes calldata _composeMsg
    ) external payable returns (MessagingReceipt memory);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_lp","type":"address"},{"internalType":"uint32","name":"_color","type":"uint32"},{"internalType":"address","name":"_recolorHelper","type":"address"},{"internalType":"address","name":"_usdv","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"color","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSupportedTokens","outputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_fromToken","type":"address"},{"internalType":"uint256","name":"_fromTokenAmount","type":"uint256"}],"name":"getUSDVOut","outputs":[{"internalType":"uint256","name":"usdvOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_fromToken","type":"address"},{"internalType":"uint256","name":"_fromTokenAmount","type":"uint256"}],"name":"getUSDVOutVerbose","outputs":[{"internalType":"uint256","name":"usdvOut","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"reward","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lp","outputs":[{"internalType":"contract IToUSDVLp","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"recolorHelper","outputs":[{"internalType":"contract IRecolorHelper","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_color","type":"uint32"}],"name":"setColor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_lp","type":"address"}],"name":"setLpAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_toleranceBps","type":"uint16"}],"name":"setToleranceBps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_userRewardBps","type":"uint16"}],"name":"setUserRewardBps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"_fromToken","type":"address"},{"internalType":"uint256","name":"_fromTokenAmount","type":"uint256"},{"internalType":"uint64","name":"_minUSDVOut","type":"uint64"}],"internalType":"struct SwapRecolor.SwapParam","name":"_swapParam","type":"tuple"},{"internalType":"uint32","name":"","type":"uint32"},{"components":[{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"uint256","name":"minAmountLD","type":"uint256"},{"internalType":"uint32","name":"dstEid","type":"uint32"}],"internalType":"struct IOFT.SendParam","name":"_param","type":"tuple"},{"internalType":"bytes","name":"_extraOptions","type":"bytes"},{"components":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"lzTokenFee","type":"uint256"}],"internalType":"struct MessagingFee","name":"_msgFee","type":"tuple"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"internalType":"bytes","name":"_composeMsg","type":"bytes"}],"name":"swapRecolorSend","outputs":[{"internalType":"uint256","name":"usdvOut","type":"uint256"},{"components":[{"internalType":"bytes32","name":"guid","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"},{"components":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"lzTokenFee","type":"uint256"}],"internalType":"struct MessagingFee","name":"fee","type":"tuple"}],"internalType":"struct MessagingReceipt","name":"msgReceipt","type":"tuple"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"_fromToken","type":"address"},{"internalType":"uint256","name":"_fromTokenAmount","type":"uint256"},{"internalType":"uint64","name":"_minUSDVOut","type":"uint64"}],"internalType":"struct SwapRecolor.SwapParam","name":"_swapParam","type":"tuple"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint32","name":"","type":"uint32"}],"name":"swapRecolorTransfer","outputs":[{"internalType":"uint256","name":"usdvOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toleranceBps","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"usdv","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"userRewardBps","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawUSDV","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c06040526002805463ffffffff60c01b1916620a000960c01b1790553480156200002957600080fd5b5060405162002859380380620028598339810160408190526200004c9162000116565b60016000556001600160a01b03828116608052811660a0526200006f33620000a7565b50506002805463ffffffff909216600160a01b026001600160c01b03199092166001600160a01b03909316929092171790556200017d565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b03811681146200011157600080fd5b919050565b600080600080608085870312156200012d57600080fd5b6200013885620000f9565b9350602085015163ffffffff811681146200015257600080fd5b92506200016260408601620000f9565b91506200017260608601620000f9565b905092959194509250565b60805160a051612669620001f0600039600081816102d601528181610588015281816107fd01528181610a6101528181611132015281816112ff0152818161162401526117ab01526000818161043201528181611100015281816111d2015281816112cd01526113ba01526126696000f3fe6080604052600436106101445760003560e01c80638da5cb5b116100c0578063cf08fed511610074578063ed6e769f11610059578063ed6e769f14610420578063f2fde38b14610454578063ff3710191461047457600080fd5b8063cf08fed5146103b4578063d3c7c2c7146103fe57600080fd5b8063b1c76d29116100a5578063b1c76d29146102f8578063c38130c114610348578063cd64f6fb1461036857600080fd5b80638da5cb5b146102a65780639420069c146102c457600080fd5b80636f5e021211610117578063715018a6116100fc578063715018a614610236578063736191d11461024b5780638a979f491461028657600080fd5b80636f5e0212146101f6578063714e1aa91461021657600080fd5b80631848a61014610149578063313c06a01461017c57806358a3ee7c146101b45780635f6588a9146101d6575b600080fd5b34801561015557600080fd5b50610169610164366004611db0565b6104ab565b6040519081526020015b60405180910390f35b34801561018857600080fd5b5060025461019c906001600160a01b031681565b6040516001600160a01b039091168152602001610173565b3480156101c057600080fd5b506101d46101cf366004611df5565b6106f4565b005b3480156101e257600080fd5b506101d46101f1366004611e10565b61074b565b34801561020257600080fd5b506101d4610211366004611e34565b6107a6565b34801561022257600080fd5b506101d4610231366004611db0565b6107e8565b34801561024257600080fd5b506101d4610828565b34801561025757600080fd5b5061026b610266366004611db0565b61083c565b60408051938452602084019290925290820152606001610173565b34801561029257600080fd5b506101d46102a1366004611e10565b610bcb565b3480156102b257600080fd5b506001546001600160a01b031661019c565b3480156102d057600080fd5b5061019c7f000000000000000000000000000000000000000000000000000000000000000081565b61030b610306366004611f58565b610c24565b6040805192835281516020808501919091528083015167ffffffffffffffff1684830152910151805160608401520151608082015260a001610173565b34801561035457600080fd5b50610169610363366004612081565b610c73565b34801561037457600080fd5b506002546103a1907a010000000000000000000000000000000000000000000000000000900461ffff1681565b60405161ffff9091168152602001610173565b3480156103c057600080fd5b506002546103e99074010000000000000000000000000000000000000000900463ffffffff1681565b60405163ffffffff9091168152602001610173565b34801561040a57600080fd5b50610413610c9a565b60405161017391906120c7565b34801561042c57600080fd5b5061019c7f000000000000000000000000000000000000000000000000000000000000000081565b34801561046057600080fd5b506101d461046f366004611e34565b610d2a565b34801561048057600080fd5b506002546103a1907801000000000000000000000000000000000000000000000000900461ffff1681565b60006104b78383610dba565b6002546040517f1848a6100000000000000000000000000000000000000000000000000000000081526001600160a01b0386811660048301526024820186905292935060009290911690631848a61090604401602060405180830381865afa158015610527573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054b9190612114565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152909150829082906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa1580156105cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f39190612114565b6105fd919061215c565b10156106505760405162461bcd60e51b815260206004820152601e60248201527f4272696467655265636f6c6f723a206e6f7420656e6f7567682075736476000060448201526064015b60405180910390fd5b808211156106ed576002546127109061068b907a010000000000000000000000000000000000000000000000000000900461ffff168461216f565b6106959190612186565b61069f82846121c1565b11156106ed5760405162461bcd60e51b815260206004820181905260248201527f4272696467655265636f6c6f723a206578636565647320746f6c6572616e63656044820152606401610647565b5092915050565b6106fc610f0e565b6002805463ffffffff90921674010000000000000000000000000000000000000000027fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b610753610f0e565b6002805461ffff9092167a010000000000000000000000000000000000000000000000000000027fffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffff909216919091179055565b6107ae610f0e565b600280547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6107f0610f0e565b6108246001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168383610f68565b5050565b610830610f0e565b61083a6000611016565b565b600080600080856001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610880573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a491906121d4565b9050600660ff821610156109205760405162461bcd60e51b815260206004820152602760248201527f4272696467655265636f6c6f723a20746f6b656e20646563696d616c73206d7560448201527f7374203e3d2036000000000000000000000000000000000000000000000000006064820152608401610647565b600061092d6006836121f7565b61093890600a612330565b6109429087612186565b600254600095509091506127109061097a907801000000000000000000000000000000000000000000000000900461ffff168361216f565b6109849190612186565b9250610990838261215c565b6002546040517f1848a6100000000000000000000000000000000000000000000000000000000081526001600160a01b038a81166004830152602482018a905292975060009290911690631848a61090604401602060405180830381865afa158015610a00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a249190612114565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152909150869082906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610aa8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610acc9190612114565b610ad6919061215c565b1015610b245760405162461bcd60e51b815260206004820152601e60248201527f4272696467655265636f6c6f723a206e6f7420656e6f756768207573647600006044820152606401610647565b80861115610bc15760025461271090610b5f907a010000000000000000000000000000000000000000000000000000900461ffff168861216f565b610b699190612186565b610b7382886121c1565b1115610bc15760405162461bcd60e51b815260206004820181905260248201527f4272696467655265636f6c6f723a206578636565647320746f6c6572616e63656044820152606401610647565b5050509250925092565b610bd3610f0e565b6002805461ffff9092167801000000000000000000000000000000000000000000000000027fffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffff909216919091179055565b6000610c2e611d53565b600254610c61908c9074010000000000000000000000000000000000000000900463ffffffff168b8b8b8b8b8b8b611080565b909c909b509950505050505050505050565b6000610c928484600260149054906101000a900463ffffffff16611274565b949350505050565b600254604080517fd3c7c2c700000000000000000000000000000000000000000000000000000000815290516060926001600160a01b03169163d3c7c2c79160048083019260009291908290030181865afa158015610cfd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d25919081019061233f565b905090565b610d32610f0e565b6001600160a01b038116610dae5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610647565b610db781611016565b50565b600080836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1f91906121d4565b9050600660ff82161015610e9b5760405162461bcd60e51b815260206004820152602760248201527f4272696467655265636f6c6f723a20746f6b656e20646563696d616c73206d7560448201527f7374203e3d2036000000000000000000000000000000000000000000000000006064820152608401610647565b6000610ea86006836121f7565b610eb390600a612330565b610ebd9085612186565b60025490915061271090610ef1907801000000000000000000000000000000000000000000000000900461ffff168361216f565b610efb9190612186565b610f05908261215c565b95945050505050565b6001546001600160a01b0316331461083a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610647565b6040516001600160a01b0383166024820152604481018290526110119084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611427565b505050565b600180546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600061108a611d53565b61109261150f565b6110c033308d602001358e60000160208101906110af9190611e34565b6001600160a01b0316929190611568565b6110c98b6115bf565b60208a018190526040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018390529193507f00000000000000000000000000000000000000000000000000000000000000009091169063095ea7b3906044016020604051808303816000875af115801561117d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a191906123f1565b506040517f37156e0d0000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906337156e0d903490611217908d908f908e908e908e908e908e908e9060040161243e565b60806040518083038185885af1158015611235573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061125a91906124e6565b90506112666001600055565b995099975050505050505050565b600061127e61150f565b6112943330602087018035906110af9089611e34565b61129d846115bf565b6040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018390529192507f00000000000000000000000000000000000000000000000000000000000000009091169063095ea7b3906044016020604051808303816000875af115801561134a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136e91906123f1565b506040517fc5a55dcb0000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301526024820183905263ffffffff841660448301527f0000000000000000000000000000000000000000000000000000000000000000169063c5a55dcb90606401600060405180830381600087803b1580156113fe57600080fd5b505af1158015611412573d6000803e3d6000fd5b505050506114206001600055565b9392505050565b600061147c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a369092919063ffffffff16565b905080516000148061149d57508080602001905181019061149d91906123f1565b6110115760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610647565b6002600054036115615760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610647565b6002600055565b6040516001600160a01b03808516602483015283166044820152606481018290526115b99085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401610fad565b50505050565b6002546000906115f3906001600160a01b0316602084018035906115e39086611e34565b6001600160a01b03169190611a45565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611673573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116979190612114565b6002549091506000906001600160a01b03166356dde2c96116bb6020870187611e34565b60208701356116d06060890160408a016125a3565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b039093166004840152602483019190915267ffffffffffffffff1660448201523060648201526084016020604051808303816000875af115801561174b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176f9190612114565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa1580156117f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118169190612114565b90508161182384836121c1565b146118965760405162461bcd60e51b815260206004820152602260248201527f4272696467655265636f6c6f723a207377617020616d6f756e7420746f6f206c60448201527f6f770000000000000000000000000000000000000000000000000000000000006064820152608401610647565b6118b06118a66020870187611e34565b8660200135610dba565b9350838110156119025760405162461bcd60e51b815260206004820152601e60248201527f4272696467655265636f6c6f723a206e6f7420656e6f756768207573647600006044820152606401610647565b8184111561199f576002546127109061193d907a010000000000000000000000000000000000000000000000000000900461ffff168661216f565b6119479190612186565b61195183866121c1565b111561199f5760405162461bcd60e51b815260206004820181905260248201527f4272696467655265636f6c6f723a206578636565647320746f6c6572616e63656044820152606401610647565b6119af60608601604087016125a3565b67ffffffffffffffff16841015611a2e5760405162461bcd60e51b815260206004820152602260248201527f4272696467655265636f6c6f723a207377617020616d6f756e7420746f6f206c60448201527f6f770000000000000000000000000000000000000000000000000000000000006064820152608401610647565b505050919050565b6060610c928484600085611b1b565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052611ac48482611c0d565b6115b9576040516001600160a01b038416602482015260006044820152611b119085907f095ea7b30000000000000000000000000000000000000000000000000000000090606401610fad565b6115b98482611427565b606082471015611b935760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610647565b600080866001600160a01b03168587604051611baf91906125e4565b60006040518083038185875af1925050503d8060008114611bec576040519150601f19603f3d011682016040523d82523d6000602084013e611bf1565b606091505b5091509150611c0287838387611cb5565b979650505050505050565b6000806000846001600160a01b031684604051611c2a91906125e4565b6000604051808303816000865af19150503d8060008114611c67576040519150601f19603f3d011682016040523d82523d6000602084013e611c6c565b606091505b5091509150818015611c96575080511580611c96575080806020019051810190611c9691906123f1565b8015610f0557506001600160a01b0385163b1515610f05565b92915050565b60608315611d24578251600003611d1d576001600160a01b0385163b611d1d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610647565b5081610c92565b610c928383815115611d395781518083602001fd5b8060405162461bcd60e51b81526004016106479190612600565b604051806060016040528060008019168152602001600067ffffffffffffffff168152602001611d96604051806040016040528060008152602001600081525090565b905290565b6001600160a01b0381168114610db757600080fd5b60008060408385031215611dc357600080fd5b8235611dce81611d9b565b946020939093013593505050565b803563ffffffff81168114611df057600080fd5b919050565b600060208284031215611e0757600080fd5b61142082611ddc565b600060208284031215611e2257600080fd5b813561ffff8116811461142057600080fd5b600060208284031215611e4657600080fd5b813561142081611d9b565b600060608284031215611e6357600080fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715611ebb57611ebb611e69565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611eea57611eea611e69565b604052919050565b60008083601f840112611f0457600080fd5b50813567ffffffffffffffff811115611f1c57600080fd5b602083019150836020828501011115611f3457600080fd5b9250929050565b600060408284031215611e6357600080fd5b8035611df081611d9b565b6000806000806000806000806000898b036101a0811215611f7857600080fd5b611f828c8c611e51565b9950611f9060608c01611ddc565b985060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8082011215611fc257600080fd5b50611fcb611e98565b60808b0135815260a08b0135602082015260c08b01356040820152611ff260e08c01611ddc565b606082015296506101008a013567ffffffffffffffff8082111561201557600080fd5b6120218d838e01611ef2565b90985096508691506120378d6101208e01611f3b565b95506120466101608d01611f4d565b94506101808c013591508082111561205d57600080fd5b5061206a8c828d01611ef2565b915080935050809150509295985092959850929598565b600080600060a0848603121561209657600080fd5b6120a08585611e51565b925060608401356120b081611d9b565b91506120be60808501611ddc565b90509250925092565b6020808252825182820181905260009190848201906040850190845b818110156121085783516001600160a01b0316835292840192918401916001016120e3565b50909695505050505050565b60006020828403121561212657600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115611caf57611caf61212d565b8082028115828204841417611caf57611caf61212d565b6000826121bc577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b81810381811115611caf57611caf61212d565b6000602082840312156121e657600080fd5b815160ff8116811461142057600080fd5b60ff8281168282160390811115611caf57611caf61212d565b600181815b8085111561226957817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561224f5761224f61212d565b8085161561225c57918102915b93841c9390800290612215565b509250929050565b60008261228057506001611caf565b8161228d57506000611caf565b81600181146122a357600281146122ad576122c9565b6001915050611caf565b60ff8411156122be576122be61212d565b50506001821b611caf565b5060208310610133831016604e8410600b84101617156122ec575081810a611caf565b6122f68383612210565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156123285761232861212d565b029392505050565b600061142060ff841683612271565b6000602080838503121561235257600080fd5b825167ffffffffffffffff8082111561236a57600080fd5b818501915085601f83011261237e57600080fd5b81518181111561239057612390611e69565b8060051b91506123a1848301611ec1565b81815291830184019184810190888411156123bb57600080fd5b938501935b838510156123e557845192506123d583611d9b565b82825293850193908501906123c0565b98975050505050505050565b60006020828403121561240357600080fd5b8151801515811461142057600080fd5b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b60006101408a51835260208b0151602084015260408b0151604084015260608b015163ffffffff8082166060860152808c16608086015250508060a084015261248a818401898b612413565b873560c0850152602088013560e08501526001600160a01b03871661010085015290508281036101208401526124c1818587612413565b9b9a5050505050505050505050565b67ffffffffffffffff81168114610db757600080fd5b600081830360808112156124f957600080fd5b604080516060810167ffffffffffffffff828210818311171561251e5761251e611e69565b90835285518252602086015190612534826124d0565b816020840152837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08601121561256957600080fd5b835194508385019150848210818311171561258657612586611e69565b508252848201518352606090940151602083015283015250919050565b6000602082840312156125b557600080fd5b8135611420816124d0565b60005b838110156125db5781810151838201526020016125c3565b50506000910152565b600082516125f68184602087016125c0565b9190910192915050565b602081526000825180602084015261261f8160408501602087016125c0565b601f01601f1916919091016040019291505056fea26469706673582212208b25383d8620e546132a9360b1fd8afb4de4fc1beeec6df1f3ecbaf8d8dd1c6f64736f6c634300081300330000000000000000000000005ccfd72da5bd694cb6cd2919987ced474f8e3fb300000000000000000000000000000000000000000000000000000000000000030000000000000000000000007f9a873cb57af892e229b8ee445dde9372539fce000000000000000000000000323665443cef804a3b5206103304bd4872ea4253

Deployed Bytecode

0x6080604052600436106101445760003560e01c80638da5cb5b116100c0578063cf08fed511610074578063ed6e769f11610059578063ed6e769f14610420578063f2fde38b14610454578063ff3710191461047457600080fd5b8063cf08fed5146103b4578063d3c7c2c7146103fe57600080fd5b8063b1c76d29116100a5578063b1c76d29146102f8578063c38130c114610348578063cd64f6fb1461036857600080fd5b80638da5cb5b146102a65780639420069c146102c457600080fd5b80636f5e021211610117578063715018a6116100fc578063715018a614610236578063736191d11461024b5780638a979f491461028657600080fd5b80636f5e0212146101f6578063714e1aa91461021657600080fd5b80631848a61014610149578063313c06a01461017c57806358a3ee7c146101b45780635f6588a9146101d6575b600080fd5b34801561015557600080fd5b50610169610164366004611db0565b6104ab565b6040519081526020015b60405180910390f35b34801561018857600080fd5b5060025461019c906001600160a01b031681565b6040516001600160a01b039091168152602001610173565b3480156101c057600080fd5b506101d46101cf366004611df5565b6106f4565b005b3480156101e257600080fd5b506101d46101f1366004611e10565b61074b565b34801561020257600080fd5b506101d4610211366004611e34565b6107a6565b34801561022257600080fd5b506101d4610231366004611db0565b6107e8565b34801561024257600080fd5b506101d4610828565b34801561025757600080fd5b5061026b610266366004611db0565b61083c565b60408051938452602084019290925290820152606001610173565b34801561029257600080fd5b506101d46102a1366004611e10565b610bcb565b3480156102b257600080fd5b506001546001600160a01b031661019c565b3480156102d057600080fd5b5061019c7f000000000000000000000000323665443cef804a3b5206103304bd4872ea425381565b61030b610306366004611f58565b610c24565b6040805192835281516020808501919091528083015167ffffffffffffffff1684830152910151805160608401520151608082015260a001610173565b34801561035457600080fd5b50610169610363366004612081565b610c73565b34801561037457600080fd5b506002546103a1907a010000000000000000000000000000000000000000000000000000900461ffff1681565b60405161ffff9091168152602001610173565b3480156103c057600080fd5b506002546103e99074010000000000000000000000000000000000000000900463ffffffff1681565b60405163ffffffff9091168152602001610173565b34801561040a57600080fd5b50610413610c9a565b60405161017391906120c7565b34801561042c57600080fd5b5061019c7f0000000000000000000000007f9a873cb57af892e229b8ee445dde9372539fce81565b34801561046057600080fd5b506101d461046f366004611e34565b610d2a565b34801561048057600080fd5b506002546103a1907801000000000000000000000000000000000000000000000000900461ffff1681565b60006104b78383610dba565b6002546040517f1848a6100000000000000000000000000000000000000000000000000000000081526001600160a01b0386811660048301526024820186905292935060009290911690631848a61090604401602060405180830381865afa158015610527573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054b9190612114565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152909150829082906001600160a01b037f000000000000000000000000323665443cef804a3b5206103304bd4872ea425316906370a0823190602401602060405180830381865afa1580156105cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f39190612114565b6105fd919061215c565b10156106505760405162461bcd60e51b815260206004820152601e60248201527f4272696467655265636f6c6f723a206e6f7420656e6f7567682075736476000060448201526064015b60405180910390fd5b808211156106ed576002546127109061068b907a010000000000000000000000000000000000000000000000000000900461ffff168461216f565b6106959190612186565b61069f82846121c1565b11156106ed5760405162461bcd60e51b815260206004820181905260248201527f4272696467655265636f6c6f723a206578636565647320746f6c6572616e63656044820152606401610647565b5092915050565b6106fc610f0e565b6002805463ffffffff90921674010000000000000000000000000000000000000000027fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b610753610f0e565b6002805461ffff9092167a010000000000000000000000000000000000000000000000000000027fffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffff909216919091179055565b6107ae610f0e565b600280547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6107f0610f0e565b6108246001600160a01b037f000000000000000000000000323665443cef804a3b5206103304bd4872ea4253168383610f68565b5050565b610830610f0e565b61083a6000611016565b565b600080600080856001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610880573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a491906121d4565b9050600660ff821610156109205760405162461bcd60e51b815260206004820152602760248201527f4272696467655265636f6c6f723a20746f6b656e20646563696d616c73206d7560448201527f7374203e3d2036000000000000000000000000000000000000000000000000006064820152608401610647565b600061092d6006836121f7565b61093890600a612330565b6109429087612186565b600254600095509091506127109061097a907801000000000000000000000000000000000000000000000000900461ffff168361216f565b6109849190612186565b9250610990838261215c565b6002546040517f1848a6100000000000000000000000000000000000000000000000000000000081526001600160a01b038a81166004830152602482018a905292975060009290911690631848a61090604401602060405180830381865afa158015610a00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a249190612114565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152909150869082906001600160a01b037f000000000000000000000000323665443cef804a3b5206103304bd4872ea425316906370a0823190602401602060405180830381865afa158015610aa8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610acc9190612114565b610ad6919061215c565b1015610b245760405162461bcd60e51b815260206004820152601e60248201527f4272696467655265636f6c6f723a206e6f7420656e6f756768207573647600006044820152606401610647565b80861115610bc15760025461271090610b5f907a010000000000000000000000000000000000000000000000000000900461ffff168861216f565b610b699190612186565b610b7382886121c1565b1115610bc15760405162461bcd60e51b815260206004820181905260248201527f4272696467655265636f6c6f723a206578636565647320746f6c6572616e63656044820152606401610647565b5050509250925092565b610bd3610f0e565b6002805461ffff9092167801000000000000000000000000000000000000000000000000027fffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffff909216919091179055565b6000610c2e611d53565b600254610c61908c9074010000000000000000000000000000000000000000900463ffffffff168b8b8b8b8b8b8b611080565b909c909b509950505050505050505050565b6000610c928484600260149054906101000a900463ffffffff16611274565b949350505050565b600254604080517fd3c7c2c700000000000000000000000000000000000000000000000000000000815290516060926001600160a01b03169163d3c7c2c79160048083019260009291908290030181865afa158015610cfd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d25919081019061233f565b905090565b610d32610f0e565b6001600160a01b038116610dae5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610647565b610db781611016565b50565b600080836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1f91906121d4565b9050600660ff82161015610e9b5760405162461bcd60e51b815260206004820152602760248201527f4272696467655265636f6c6f723a20746f6b656e20646563696d616c73206d7560448201527f7374203e3d2036000000000000000000000000000000000000000000000000006064820152608401610647565b6000610ea86006836121f7565b610eb390600a612330565b610ebd9085612186565b60025490915061271090610ef1907801000000000000000000000000000000000000000000000000900461ffff168361216f565b610efb9190612186565b610f05908261215c565b95945050505050565b6001546001600160a01b0316331461083a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610647565b6040516001600160a01b0383166024820152604481018290526110119084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611427565b505050565b600180546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600061108a611d53565b61109261150f565b6110c033308d602001358e60000160208101906110af9190611e34565b6001600160a01b0316929190611568565b6110c98b6115bf565b60208a018190526040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000007f9a873cb57af892e229b8ee445dde9372539fce81166004830152602482018390529193507f000000000000000000000000323665443cef804a3b5206103304bd4872ea42539091169063095ea7b3906044016020604051808303816000875af115801561117d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a191906123f1565b506040517f37156e0d0000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000007f9a873cb57af892e229b8ee445dde9372539fce16906337156e0d903490611217908d908f908e908e908e908e908e908e9060040161243e565b60806040518083038185885af1158015611235573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061125a91906124e6565b90506112666001600055565b995099975050505050505050565b600061127e61150f565b6112943330602087018035906110af9089611e34565b61129d846115bf565b6040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000007f9a873cb57af892e229b8ee445dde9372539fce81166004830152602482018390529192507f000000000000000000000000323665443cef804a3b5206103304bd4872ea42539091169063095ea7b3906044016020604051808303816000875af115801561134a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136e91906123f1565b506040517fc5a55dcb0000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301526024820183905263ffffffff841660448301527f0000000000000000000000007f9a873cb57af892e229b8ee445dde9372539fce169063c5a55dcb90606401600060405180830381600087803b1580156113fe57600080fd5b505af1158015611412573d6000803e3d6000fd5b505050506114206001600055565b9392505050565b600061147c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a369092919063ffffffff16565b905080516000148061149d57508080602001905181019061149d91906123f1565b6110115760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610647565b6002600054036115615760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610647565b6002600055565b6040516001600160a01b03808516602483015283166044820152606481018290526115b99085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401610fad565b50505050565b6002546000906115f3906001600160a01b0316602084018035906115e39086611e34565b6001600160a01b03169190611a45565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000323665443cef804a3b5206103304bd4872ea42536001600160a01b0316906370a0823190602401602060405180830381865afa158015611673573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116979190612114565b6002549091506000906001600160a01b03166356dde2c96116bb6020870187611e34565b60208701356116d06060890160408a016125a3565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b039093166004840152602483019190915267ffffffffffffffff1660448201523060648201526084016020604051808303816000875af115801561174b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176f9190612114565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091506000906001600160a01b037f000000000000000000000000323665443cef804a3b5206103304bd4872ea425316906370a0823190602401602060405180830381865afa1580156117f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118169190612114565b90508161182384836121c1565b146118965760405162461bcd60e51b815260206004820152602260248201527f4272696467655265636f6c6f723a207377617020616d6f756e7420746f6f206c60448201527f6f770000000000000000000000000000000000000000000000000000000000006064820152608401610647565b6118b06118a66020870187611e34565b8660200135610dba565b9350838110156119025760405162461bcd60e51b815260206004820152601e60248201527f4272696467655265636f6c6f723a206e6f7420656e6f756768207573647600006044820152606401610647565b8184111561199f576002546127109061193d907a010000000000000000000000000000000000000000000000000000900461ffff168661216f565b6119479190612186565b61195183866121c1565b111561199f5760405162461bcd60e51b815260206004820181905260248201527f4272696467655265636f6c6f723a206578636565647320746f6c6572616e63656044820152606401610647565b6119af60608601604087016125a3565b67ffffffffffffffff16841015611a2e5760405162461bcd60e51b815260206004820152602260248201527f4272696467655265636f6c6f723a207377617020616d6f756e7420746f6f206c60448201527f6f770000000000000000000000000000000000000000000000000000000000006064820152608401610647565b505050919050565b6060610c928484600085611b1b565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052611ac48482611c0d565b6115b9576040516001600160a01b038416602482015260006044820152611b119085907f095ea7b30000000000000000000000000000000000000000000000000000000090606401610fad565b6115b98482611427565b606082471015611b935760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610647565b600080866001600160a01b03168587604051611baf91906125e4565b60006040518083038185875af1925050503d8060008114611bec576040519150601f19603f3d011682016040523d82523d6000602084013e611bf1565b606091505b5091509150611c0287838387611cb5565b979650505050505050565b6000806000846001600160a01b031684604051611c2a91906125e4565b6000604051808303816000865af19150503d8060008114611c67576040519150601f19603f3d011682016040523d82523d6000602084013e611c6c565b606091505b5091509150818015611c96575080511580611c96575080806020019051810190611c9691906123f1565b8015610f0557506001600160a01b0385163b1515610f05565b92915050565b60608315611d24578251600003611d1d576001600160a01b0385163b611d1d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610647565b5081610c92565b610c928383815115611d395781518083602001fd5b8060405162461bcd60e51b81526004016106479190612600565b604051806060016040528060008019168152602001600067ffffffffffffffff168152602001611d96604051806040016040528060008152602001600081525090565b905290565b6001600160a01b0381168114610db757600080fd5b60008060408385031215611dc357600080fd5b8235611dce81611d9b565b946020939093013593505050565b803563ffffffff81168114611df057600080fd5b919050565b600060208284031215611e0757600080fd5b61142082611ddc565b600060208284031215611e2257600080fd5b813561ffff8116811461142057600080fd5b600060208284031215611e4657600080fd5b813561142081611d9b565b600060608284031215611e6357600080fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715611ebb57611ebb611e69565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611eea57611eea611e69565b604052919050565b60008083601f840112611f0457600080fd5b50813567ffffffffffffffff811115611f1c57600080fd5b602083019150836020828501011115611f3457600080fd5b9250929050565b600060408284031215611e6357600080fd5b8035611df081611d9b565b6000806000806000806000806000898b036101a0811215611f7857600080fd5b611f828c8c611e51565b9950611f9060608c01611ddc565b985060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8082011215611fc257600080fd5b50611fcb611e98565b60808b0135815260a08b0135602082015260c08b01356040820152611ff260e08c01611ddc565b606082015296506101008a013567ffffffffffffffff8082111561201557600080fd5b6120218d838e01611ef2565b90985096508691506120378d6101208e01611f3b565b95506120466101608d01611f4d565b94506101808c013591508082111561205d57600080fd5b5061206a8c828d01611ef2565b915080935050809150509295985092959850929598565b600080600060a0848603121561209657600080fd5b6120a08585611e51565b925060608401356120b081611d9b565b91506120be60808501611ddc565b90509250925092565b6020808252825182820181905260009190848201906040850190845b818110156121085783516001600160a01b0316835292840192918401916001016120e3565b50909695505050505050565b60006020828403121561212657600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115611caf57611caf61212d565b8082028115828204841417611caf57611caf61212d565b6000826121bc577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b81810381811115611caf57611caf61212d565b6000602082840312156121e657600080fd5b815160ff8116811461142057600080fd5b60ff8281168282160390811115611caf57611caf61212d565b600181815b8085111561226957817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561224f5761224f61212d565b8085161561225c57918102915b93841c9390800290612215565b509250929050565b60008261228057506001611caf565b8161228d57506000611caf565b81600181146122a357600281146122ad576122c9565b6001915050611caf565b60ff8411156122be576122be61212d565b50506001821b611caf565b5060208310610133831016604e8410600b84101617156122ec575081810a611caf565b6122f68383612210565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156123285761232861212d565b029392505050565b600061142060ff841683612271565b6000602080838503121561235257600080fd5b825167ffffffffffffffff8082111561236a57600080fd5b818501915085601f83011261237e57600080fd5b81518181111561239057612390611e69565b8060051b91506123a1848301611ec1565b81815291830184019184810190888411156123bb57600080fd5b938501935b838510156123e557845192506123d583611d9b565b82825293850193908501906123c0565b98975050505050505050565b60006020828403121561240357600080fd5b8151801515811461142057600080fd5b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b60006101408a51835260208b0151602084015260408b0151604084015260608b015163ffffffff8082166060860152808c16608086015250508060a084015261248a818401898b612413565b873560c0850152602088013560e08501526001600160a01b03871661010085015290508281036101208401526124c1818587612413565b9b9a5050505050505050505050565b67ffffffffffffffff81168114610db757600080fd5b600081830360808112156124f957600080fd5b604080516060810167ffffffffffffffff828210818311171561251e5761251e611e69565b90835285518252602086015190612534826124d0565b816020840152837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08601121561256957600080fd5b835194508385019150848210818311171561258657612586611e69565b508252848201518352606090940151602083015283015250919050565b6000602082840312156125b557600080fd5b8135611420816124d0565b60005b838110156125db5781810151838201526020016125c3565b50506000910152565b600082516125f68184602087016125c0565b9190910192915050565b602081526000825180602084015261261f8160408501602087016125c0565b601f01601f1916919091016040019291505056fea26469706673582212208b25383d8620e546132a9360b1fd8afb4de4fc1beeec6df1f3ecbaf8d8dd1c6f64736f6c63430008130033

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

0000000000000000000000005ccfd72da5bd694cb6cd2919987ced474f8e3fb300000000000000000000000000000000000000000000000000000000000000030000000000000000000000007f9a873cb57af892e229b8ee445dde9372539fce000000000000000000000000323665443cef804a3b5206103304bd4872ea4253

-----Decoded View---------------
Arg [0] : _lp (address): 0x5cCFd72da5bd694CB6CD2919987Ced474F8E3Fb3
Arg [1] : _color (uint32): 3
Arg [2] : _recolorHelper (address): 0x7F9A873cB57AF892e229b8EE445dde9372539fce
Arg [3] : _usdv (address): 0x323665443CEf804A3b5206103304BD4872EA4253

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000005ccfd72da5bd694cb6cd2919987ced474f8e3fb3
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [2] : 0000000000000000000000007f9a873cb57af892e229b8ee445dde9372539fce
Arg [3] : 000000000000000000000000323665443cef804a3b5206103304bd4872ea4253


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

Validator Index Block Amount
View All Withdrawals

Txn 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.