ETH Price: $2,691.37 (+0.85%)

Token

 

Overview

Max Total Supply

0

Holders

36

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A

Other Info

0x6b8fbd9144e8343f190c73790e101829dda2c87e
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
BondFixedTermTeller

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 100000 runs

Other Settings:
default evmVersion
File 1 of 13 : BondFixedTermTeller.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.15;

import {ERC20} from "solmate/tokens/ERC20.sol";

import {BondBaseTeller, IBondAggregator, Authority} from "./bases/BondBaseTeller.sol";
import {IBondFixedTermTeller} from "./interfaces/IBondFixedTermTeller.sol";

import {TransferHelper} from "./lib/TransferHelper.sol";
import {FullMath} from "./lib/FullMath.sol";
import {ERC1155} from "./lib/ERC1155.sol";

/// @title Bond Fixed Term Teller
/// @notice Bond Fixed Term Teller Contract
/// @dev Bond Protocol is a permissionless system to create Olympus-style bond markets
///      for any token pair. The markets do not require maintenance and will manage
///      bond prices based on activity. Bond issuers create BondMarkets that pay out
///      a Payout Token in exchange for deposited Quote Tokens. Users can purchase
///      future-dated Payout Tokens with Quote Tokens at the current market price and
///      receive Bond Tokens to represent their position while their bond vests.
///      Once the Bond Tokens vest, they can redeem it for the Quote Tokens.
///
/// @dev The Bond Fixed Term Teller is an implementation of the
///      Bond Base Teller contract specific to handling user bond transactions
///      and tokenizing bond markets where purchases vest in a fixed amount of time
///      (rounded to the day) as ERC1155 tokens.
///
/// @author Oighty, Zeus, Potted Meat, indigo
contract BondFixedTermTeller is BondBaseTeller, IBondFixedTermTeller, ERC1155 {
    using TransferHelper for ERC20;
    using FullMath for uint256;

    /* ========== EVENTS ========== */
    event ERC1155BondTokenCreated(uint256 tokenId, ERC20 indexed underlying, uint48 indexed expiry);

    /* ========== STATE VARIABLES ========== */

    mapping(uint256 => TokenMetadata) public tokenMetadata; // metadata for bond tokens

    /* ========== CONSTRUCTOR ========== */
    constructor(
        address protocol_,
        IBondAggregator aggregator_,
        address guardian_,
        Authority authority_
    ) BondBaseTeller(protocol_, aggregator_, guardian_, authority_) {}

    /* ========== PURCHASE ========== */

    /// @notice             Handle payout to recipient
    /// @param recipient_   Address to receive payout
    /// @param payout_      Amount of payoutToken to be paid
    /// @param payoutToken_   Token to be paid out
    /// @param vesting_     Amount of time to vest from current timestamp
    /// @return expiry      Timestamp when the payout will vest
    function _handlePayout(
        address recipient_,
        uint256 payout_,
        ERC20 payoutToken_,
        uint48 vesting_
    ) internal override returns (uint48 expiry) {
        // If there is no vesting time, the deposit is treated as an instant swap.
        // otherwise, deposit info is stored and payout is available at a future timestamp.
        // instant swap is denoted by expiry == 0.
        //
        // bonds mature with a cliff at a set timestamp
        // prior to the expiry timestamp, no payout tokens are accessible to the user
        // after the expiry timestamp, the entire payout can be redeemed
        //
        // fixed-term bonds mature in a set amount of time from deposit
        // i.e. term = 1 week. when alice deposits on day 1, her bond
        // expires on day 8. when bob deposits on day 2, his bond expires day 9.
        if (vesting_ != 0) {
            // Normalizing fixed term vesting timestamps to the same time each day
            expiry = ((vesting_ + uint48(block.timestamp)) / uint48(1 days)) * uint48(1 days);

            // Fixed-term user payout information is handled in BondTeller.
            // Teller mints ERC-1155 bond tokens for user.
            uint256 tokenId = getTokenId(payoutToken_, expiry);

            // Create new bond token if it doesn't exist yet
            if (!tokenMetadata[tokenId].active) {
                _deploy(tokenId, payoutToken_, expiry);
            }

            // Mint bond token to recipient
            _mintToken(recipient_, tokenId, payout_);
        } else {
            // If no expiry, then transfer payout directly to user
            payoutToken_.safeTransfer(recipient_, payout_);
        }
    }

    /* ========== DEPOSIT/MINT ========== */

    /// @inheritdoc IBondFixedTermTeller
    function create(
        ERC20 underlying_,
        uint48 expiry_,
        uint256 amount_
    ) external override nonReentrant returns (uint256, uint256) {
        // Expiry is rounded to the nearest day at 0000 UTC (in seconds) since bond tokens
        // are only unique to a day, not a specific timestamp.
        uint48 expiry = uint48(expiry_ / 1 days) * 1 days;

        // Revert if expiry is in the past
        if (expiry < block.timestamp) revert Teller_InvalidParams();

        uint256 tokenId = getTokenId(underlying_, expiry);

        // Revert if no token exists, must call deploy first
        if (!tokenMetadata[tokenId].active) revert Teller_TokenDoesNotExist(underlying_, expiry);

        // Transfer in underlying
        // Check that amount received is not less than amount expected
        // Handles edge cases like fee-on-transfer tokens (which are not supported)
        uint256 oldBalance = underlying_.balanceOf(address(this));
        underlying_.safeTransferFrom(msg.sender, address(this), amount_);
        if (underlying_.balanceOf(address(this)) < oldBalance + amount_)
            revert Teller_UnsupportedToken();

        // If fee is greater than the create discount, then calculate the fee and store it
        // Otherwise, fee is zero.
        if (protocolFee > createFeeDiscount) {
            // Calculate fee amount
            uint256 feeAmount = amount_.mulDiv(protocolFee - createFeeDiscount, FEE_DECIMALS);
            rewards[_protocol][underlying_] += feeAmount;

            // Mint new bond tokens
            _mintToken(msg.sender, tokenId, amount_ - feeAmount);

            return (tokenId, amount_ - feeAmount);
        } else {
            // Mint new bond tokens
            _mintToken(msg.sender, tokenId, amount_);

            return (tokenId, amount_);
        }
    }

    /* ========== REDEEM ========== */

    function _redeem(uint256 tokenId_, uint256 amount_) internal {
        // Check that the tokenId is active
        if (!tokenMetadata[tokenId_].active) revert Teller_InvalidParams();

        // Cache token metadata
        TokenMetadata memory meta = tokenMetadata[tokenId_];

        // Check that the token has matured
        if (block.timestamp < meta.expiry) revert Teller_TokenNotMatured(meta.expiry);

        // Burn bond token and transfer underlying to sender
        _burnToken(msg.sender, tokenId_, amount_);
        meta.underlying.safeTransfer(msg.sender, amount_);
    }

    /// @inheritdoc IBondFixedTermTeller
    function redeem(uint256 tokenId_, uint256 amount_) public override nonReentrant {
        _redeem(tokenId_, amount_);
    }

    /// @inheritdoc IBondFixedTermTeller
    function batchRedeem(uint256[] calldata tokenIds_, uint256[] calldata amounts_)
        external
        override
        nonReentrant
    {
        uint256 len = tokenIds_.length;
        if (len != amounts_.length) revert Teller_InvalidParams();
        for (uint256 i; i < len; ++i) {
            _redeem(tokenIds_[i], amounts_[i]);
        }
    }

    /* ========== TOKENIZATION ========== */

    /// @inheritdoc IBondFixedTermTeller
    function deploy(ERC20 underlying_, uint48 expiry_)
        external
        override
        nonReentrant
        returns (uint256)
    {
        uint256 tokenId = getTokenId(underlying_, expiry_);
        // Only creates token if it does not exist
        if (!tokenMetadata[tokenId].active) {
            _deploy(tokenId, underlying_, expiry_);
        }
        return tokenId;
    }

    /// @notice             "Deploy" a new ERC1155 bond token and stores its ID
    /// @dev                ERC1155 tokens used for fixed term bonds
    /// @param tokenId_     Calculated ID of new bond token (from getTokenId)
    /// @param underlying_  Underlying token to be paid out when the bond token vests
    /// @param expiry_      Timestamp that the token will vest at, will be rounded to the nearest day
    function _deploy(
        uint256 tokenId_,
        ERC20 underlying_,
        uint48 expiry_
    ) internal {
        // Expiry is rounded to the nearest day at 0000 UTC (in seconds) since bond tokens
        // are only unique to a day, not a specific timestamp.
        uint48 expiry = uint48(expiry_ / 1 days) * 1 days;

        // Revert if expiry is in the past
        if (uint256(expiry) < block.timestamp) revert Teller_InvalidParams();

        // Store token metadata
        tokenMetadata[tokenId_] = TokenMetadata(
            true,
            underlying_,
            uint8(underlying_.decimals()),
            expiry,
            0
        );

        emit ERC1155BondTokenCreated(tokenId_, underlying_, expiry);
    }

    /// @notice             Mint bond token and update supply
    /// @param to_          Address to mint tokens to
    /// @param tokenId_     ID of bond token to mint
    /// @param amount_      Amount of bond tokens to mint
    function _mintToken(
        address to_,
        uint256 tokenId_,
        uint256 amount_
    ) internal {
        tokenMetadata[tokenId_].supply += amount_;
        _mint(to_, tokenId_, amount_, bytes(""));
    }

    /// @notice             Burn bond token and update supply
    /// @param from_        Address to burn tokens from
    /// @param tokenId_     ID of bond token to burn
    /// @param amount_      Amount of bond token to burn
    function _burnToken(
        address from_,
        uint256 tokenId_,
        uint256 amount_
    ) internal {
        tokenMetadata[tokenId_].supply -= amount_;
        _burn(from_, tokenId_, amount_);
    }

    /* ========== TOKEN NAMING ========== */

    /// @inheritdoc IBondFixedTermTeller
    function getTokenId(ERC20 underlying_, uint48 expiry_) public pure override returns (uint256) {
        // Expiry is divided by 1 day (in seconds) since bond tokens are only unique
        // to a day, not a specific timestamp.
        uint256 tokenId = uint256(
            keccak256(abi.encodePacked(underlying_, expiry_ / uint48(1 days)))
        );
        return tokenId;
    }

    /// @inheritdoc IBondFixedTermTeller
    function getTokenNameAndSymbol(uint256 tokenId_)
        external
        view
        override
        returns (string memory, string memory)
    {
        TokenMetadata memory meta = tokenMetadata[tokenId_];
        (string memory name, string memory symbol) = _getNameAndSymbol(
            meta.underlying,
            meta.expiry
        );
        return (name, symbol);
    }
}

File 2 of 13 : Auth.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Provides a flexible and updatable auth pattern which is completely separate from application logic.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/auth/Auth.sol)
/// @author Modified from Dappsys (https://github.com/dapphub/ds-auth/blob/master/src/auth.sol)
abstract contract Auth {
    event OwnerUpdated(address indexed user, address indexed newOwner);

    event AuthorityUpdated(address indexed user, Authority indexed newAuthority);

    address public owner;

    Authority public authority;

    constructor(address _owner, Authority _authority) {
        owner = _owner;
        authority = _authority;

        emit OwnerUpdated(msg.sender, _owner);
        emit AuthorityUpdated(msg.sender, _authority);
    }

    modifier requiresAuth() {
        require(isAuthorized(msg.sender, msg.sig), "UNAUTHORIZED");

        _;
    }

    function isAuthorized(address user, bytes4 functionSig) internal view virtual returns (bool) {
        Authority auth = authority; // Memoizing authority saves us a warm SLOAD, around 100 gas.

        // Checking if the caller is the owner only after calling the authority saves gas in most cases, but be
        // aware that this makes protected functions uncallable even to the owner if the authority is out of order.
        return (address(auth) != address(0) && auth.canCall(user, address(this), functionSig)) || user == owner;
    }

    function setAuthority(Authority newAuthority) public virtual {
        // We check if the caller is the owner first because we want to ensure they can
        // always swap out the authority even if it's reverting or using up a lot of gas.
        require(msg.sender == owner || authority.canCall(msg.sender, address(this), msg.sig));

        authority = newAuthority;

        emit AuthorityUpdated(msg.sender, newAuthority);
    }

    function setOwner(address newOwner) public virtual requiresAuth {
        owner = newOwner;

        emit OwnerUpdated(msg.sender, newOwner);
    }
}

/// @notice A generic interface for a contract which provides authorization data to an Auth instance.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/auth/Auth.sol)
/// @author Modified from Dappsys (https://github.com/dapphub/ds-auth/blob/master/src/auth.sol)
interface Authority {
    function canCall(
        address user,
        address target,
        bytes4 functionSig
    ) external view returns (bool);
}

File 3 of 13 : ERC20.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
    /*///////////////////////////////////////////////////////////////
                                  EVENTS
    //////////////////////////////////////////////////////////////*/

    event Transfer(address indexed from, address indexed to, uint256 amount);

    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /*///////////////////////////////////////////////////////////////
                             METADATA STORAGE
    //////////////////////////////////////////////////////////////*/

    string public name;

    string public symbol;

    uint8 public immutable decimals;

    /*///////////////////////////////////////////////////////////////
                              ERC20 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;

    mapping(address => mapping(address => uint256)) public allowance;

    /*///////////////////////////////////////////////////////////////
                             EIP-2612 STORAGE
    //////////////////////////////////////////////////////////////*/

    bytes32 public constant PERMIT_TYPEHASH =
        keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");

    uint256 internal immutable INITIAL_CHAIN_ID;

    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;

    mapping(address => uint256) public nonces;

    /*///////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _decimals
    ) {
        name = _name;
        symbol = _symbol;
        decimals = _decimals;

        INITIAL_CHAIN_ID = block.chainid;
        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
    }

    /*///////////////////////////////////////////////////////////////
                              ERC20 LOGIC
    //////////////////////////////////////////////////////////////*/

    function approve(address spender, uint256 amount) public virtual returns (bool) {
        allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);

        return true;
    }

    function transfer(address to, uint256 amount) public virtual returns (bool) {
        balanceOf[msg.sender] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(msg.sender, to, amount);

        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual returns (bool) {
        uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.

        if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;

        balanceOf[from] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(from, to, amount);

        return true;
    }

    /*///////////////////////////////////////////////////////////////
                              EIP-2612 LOGIC
    //////////////////////////////////////////////////////////////*/

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual {
        require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");

        // Unchecked because the only math done is incrementing
        // the owner's nonce which cannot realistically overflow.
        unchecked {
            bytes32 digest = keccak256(
                abi.encodePacked(
                    "\x19\x01",
                    DOMAIN_SEPARATOR(),
                    keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
                )
            );

            address recoveredAddress = ecrecover(digest, v, r, s);

            require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");

            allowance[recoveredAddress][spender] = value;
        }

        emit Approval(owner, spender, value);
    }

    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
        return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
    }

    function computeDomainSeparator() internal view virtual returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                    keccak256(bytes(name)),
                    keccak256("1"),
                    block.chainid,
                    address(this)
                )
            );
    }

    /*///////////////////////////////////////////////////////////////
                       INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(address to, uint256 amount) internal virtual {
        totalSupply += amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(address(0), to, amount);
    }

    function _burn(address from, uint256 amount) internal virtual {
        balanceOf[from] -= amount;

        // Cannot underflow because a user's balance
        // will never be larger than the total supply.
        unchecked {
            totalSupply -= amount;
        }

        emit Transfer(from, address(0), amount);
    }
}

File 4 of 13 : ReentrancyGuard.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Gas optimized reentrancy protection for smart contracts.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/ReentrancyGuard.sol)
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol)
abstract contract ReentrancyGuard {
    uint256 private locked = 1;

    modifier nonReentrant() {
        require(locked == 1, "REENTRANCY");

        locked = 2;

        _;

        locked = 1;
    }
}

File 5 of 13 : BondBaseTeller.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.15;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ReentrancyGuard} from "solmate/utils/ReentrancyGuard.sol";
import {Auth, Authority} from "solmate/auth/Auth.sol";

import {IBondTeller} from "../interfaces/IBondTeller.sol";
import {IBondCallback} from "../interfaces/IBondCallback.sol";
import {IBondAggregator} from "../interfaces/IBondAggregator.sol";
import {IBondAuctioneer} from "../interfaces/IBondAuctioneer.sol";

import {TransferHelper} from "../lib/TransferHelper.sol";
import {FullMath} from "../lib/FullMath.sol";

/// @title Bond Teller
/// @notice Bond Teller Base Contract
/// @dev Bond Protocol is a permissionless system to create Olympus-style bond markets
///      for any token pair. The markets do not require maintenance and will manage
///      bond prices based on activity. Bond issuers create BondMarkets that pay out
///      a Payout Token in exchange for deposited Quote Tokens. Users can purchase
///      future-dated Payout Tokens with Quote Tokens at the current market price and
///      receive Bond Tokens to represent their position while their bond vests.
///      Once the Bond Tokens vest, they can redeem it for the Quote Tokens.
///
/// @dev The Teller contract handles all interactions with end users and manages tokens
///      issued to represent bond positions. Users purchase bonds by depositing Quote Tokens
///      and receive a Bond Token (token type is implementation-specific) that represents
///      their payout and the designated expiry. Once a bond vests, Investors can redeem their
///      Bond Tokens for the underlying Payout Token. A Teller requires one or more Auctioneer
///      contracts to be deployed to provide markets for users to purchase bonds from.
///
/// @author Oighty, Zeus, Potted Meat, indigo
abstract contract BondBaseTeller is IBondTeller, Auth, ReentrancyGuard {
    using TransferHelper for ERC20;
    using FullMath for uint256;

    /* ========== ERRORS ========== */

    error Teller_InvalidCallback();
    error Teller_TokenNotMatured(uint48 maturesOn);
    error Teller_NotAuthorized();
    error Teller_TokenDoesNotExist(ERC20 underlying, uint48 expiry);
    error Teller_UnsupportedToken();
    error Teller_InvalidParams();

    /* ========== EVENTS ========== */
    event Bonded(uint256 indexed id, address indexed referrer, uint256 amount, uint256 payout);

    /* ========== STATE VARIABLES ========== */

    /// @notice Fee paid to a front end operator in basis points (3 decimals). Set by the referrer, must be less than or equal to 5% (5e3).
    /// @dev There are some situations where the fees may round down to zero if quantity of baseToken
    ///      is < 1e5 wei (can happen with big price differences on small decimal tokens). This is purely
    ///      a theoretical edge case, as the bond amount would not be practical.
    mapping(address => uint48) public referrerFees;

    /// @notice Fee paid to protocol in basis points (3 decimal places).
    uint48 public protocolFee;

    /// @notice 'Create' function fee discount in basis points (3 decimal places). Amount standard fee is reduced by for partners who just want to use the 'create' function to issue bond tokens.
    uint48 public createFeeDiscount;

    uint48 public constant FEE_DECIMALS = 1e5; // one percent equals 1000.

    /// @notice Fees earned by an address, by token
    mapping(address => mapping(ERC20 => uint256)) public rewards;

    // Address the protocol receives fees at
    address internal immutable _protocol;

    // BondAggregator contract with utility functions
    IBondAggregator internal immutable _aggregator;

    constructor(
        address protocol_,
        IBondAggregator aggregator_,
        address guardian_,
        Authority authority_
    ) Auth(guardian_, authority_) {
        _protocol = protocol_;
        _aggregator = aggregator_;

        // Explicitly setting these values to zero to document
        protocolFee = 0;
        createFeeDiscount = 0;
    }

    /// @inheritdoc IBondTeller
    function setReferrerFee(uint48 fee_) external override nonReentrant {
        if (fee_ > 5e3) revert Teller_InvalidParams();
        referrerFees[msg.sender] = fee_;
    }

    /// @inheritdoc IBondTeller
    function setProtocolFee(uint48 fee_) external override requiresAuth {
        if (fee_ > 5e3) revert Teller_InvalidParams();
        protocolFee = fee_;
    }

    /// @inheritdoc IBondTeller
    function setCreateFeeDiscount(uint48 discount_) external override requiresAuth {
        if (discount_ > protocolFee) revert Teller_InvalidParams();
        createFeeDiscount = discount_;
    }

    /// @inheritdoc IBondTeller
    function claimFees(ERC20[] memory tokens_, address to_) external override nonReentrant {
        uint256 len = tokens_.length;
        for (uint256 i; i < len; ++i) {
            ERC20 token = tokens_[i];
            uint256 send = rewards[msg.sender][token];

            if (send != 0) {
                rewards[msg.sender][token] = 0;
                token.safeTransfer(to_, send);
            }
        }
    }

    /// @inheritdoc IBondTeller
    function getFee(address referrer_) external view returns (uint48) {
        return protocolFee + referrerFees[referrer_];
    }

    /* ========== USER FUNCTIONS ========== */

    /// @inheritdoc IBondTeller
    function purchase(
        address recipient_,
        address referrer_,
        uint256 id_,
        uint256 amount_,
        uint256 minAmountOut_
    ) external virtual nonReentrant returns (uint256, uint48) {
        ERC20 payoutToken;
        ERC20 quoteToken;
        uint48 vesting;
        uint256 payout;

        // Calculate fees for purchase
        // 1. Calculate referrer fee
        // 2. Calculate protocol fee as the total expected fee amount minus the referrer fee
        //    to avoid issues with rounding from separate fee calculations
        uint256 toReferrer = amount_.mulDiv(referrerFees[referrer_], FEE_DECIMALS);
        uint256 toProtocol = amount_.mulDiv(protocolFee + referrerFees[referrer_], FEE_DECIMALS) -
            toReferrer;

        {
            IBondAuctioneer auctioneer = _aggregator.getAuctioneer(id_);
            address owner;
            (owner, , payoutToken, quoteToken, vesting, ) = auctioneer.getMarketInfoForPurchase(
                id_
            );

            // Auctioneer handles bond pricing, capacity, and duration
            uint256 amountLessFee = amount_ - toReferrer - toProtocol;
            payout = auctioneer.purchaseBond(id_, amountLessFee, minAmountOut_);
        }

        // Allocate fees to protocol and referrer
        rewards[referrer_][quoteToken] += toReferrer;
        rewards[_protocol][quoteToken] += toProtocol;

        // Transfer quote tokens from sender and ensure enough payout tokens are available
        _handleTransfers(id_, amount_, payout, toReferrer + toProtocol);

        // Handle payout to user (either transfer tokens if instant swap or issue bond token)
        uint48 expiry = _handlePayout(recipient_, payout, payoutToken, vesting);

        emit Bonded(id_, referrer_, amount_, payout);

        return (payout, expiry);
    }

    /// @notice     Handles transfer of funds from user and market owner/callback
    function _handleTransfers(
        uint256 id_,
        uint256 amount_,
        uint256 payout_,
        uint256 feePaid_
    ) internal {
        // Get info from auctioneer
        (address owner, address callbackAddr, ERC20 payoutToken, ERC20 quoteToken, , ) = _aggregator
            .getAuctioneer(id_)
            .getMarketInfoForPurchase(id_);

        // Calculate amount net of fees
        uint256 amountLessFee = amount_ - feePaid_;

        // Have to transfer to teller first since fee is in quote token
        // Check balance before and after to ensure full amount received, revert if not
        // Handles edge cases like fee-on-transfer tokens (which are not supported)
        uint256 quoteBalance = quoteToken.balanceOf(address(this));
        quoteToken.safeTransferFrom(msg.sender, address(this), amount_);
        if (quoteToken.balanceOf(address(this)) < quoteBalance + amount_)
            revert Teller_UnsupportedToken();

        // If callback address supplied, transfer tokens from teller to callback, then execute callback function,
        // and ensure proper amount of tokens transferred in.
        if (callbackAddr != address(0)) {
            // Send quote token to callback (transferred in first to allow use during callback)
            quoteToken.safeTransfer(callbackAddr, amountLessFee);

            // Call the callback function to receive payout tokens for payout
            uint256 payoutBalance = payoutToken.balanceOf(address(this));
            IBondCallback(callbackAddr).callback(id_, amountLessFee, payout_);

            // Check to ensure that the callback sent the requested amount of payout tokens back to the teller
            if (payoutToken.balanceOf(address(this)) < (payoutBalance + payout_))
                revert Teller_InvalidCallback();
        } else {
            // If no callback is provided, transfer tokens from market owner to this contract
            // for payout.
            // Check balance before and after to ensure full amount received, revert if not
            // Handles edge cases like fee-on-transfer tokens (which are not supported)
            uint256 payoutBalance = payoutToken.balanceOf(address(this));
            payoutToken.safeTransferFrom(owner, address(this), payout_);
            if (payoutToken.balanceOf(address(this)) < (payoutBalance + payout_))
                revert Teller_UnsupportedToken();

            quoteToken.safeTransfer(owner, amountLessFee);
        }
    }

    /// @notice             Handle payout to recipient
    /// @dev                Implementation-agnostic. Must be implemented in contracts that
    ///                     extend this base since it is called by purchase.
    /// @param recipient_   Address to receive payout
    /// @param payout_      Amount of payoutToken to be paid
    /// @param underlying_   Token to be paid out
    /// @param vesting_     Time parameter for when the payout is available, could be a
    ///                     timestamp or duration depending on the implementation
    /// @return expiry      Timestamp when the payout will vest
    function _handlePayout(
        address recipient_,
        uint256 payout_,
        ERC20 underlying_,
        uint48 vesting_
    ) internal virtual returns (uint48 expiry);

    /// @notice             Derive name and symbol of token for market
    /// @param underlying_   Underlying token to be paid out when the Bond Token vests
    /// @param expiry_      Timestamp that the Bond Token vests at
    /// @return name        Bond token name, format is "Token YYYY-MM-DD"
    /// @return symbol      Bond token symbol, format is "TKN-YYYYMMDD"
    function _getNameAndSymbol(ERC20 underlying_, uint256 expiry_)
        internal
        view
        returns (string memory name, string memory symbol)
    {
        // Convert a number of days into a human-readable date, courtesy of BokkyPooBah.
        // Source: https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary/blob/master/contracts/BokkyPooBahsDateTimeLibrary.sol

        uint256 year;
        uint256 month;
        uint256 day;
        {
            int256 __days = int256(expiry_ / 1 days);

            int256 num1 = __days + 68569 + 2440588; // 2440588 = OFFSET19700101
            int256 num2 = (4 * num1) / 146097;
            num1 = num1 - (146097 * num2 + 3) / 4;
            int256 _year = (4000 * (num1 + 1)) / 1461001;
            num1 = num1 - (1461 * _year) / 4 + 31;
            int256 _month = (80 * num1) / 2447;
            int256 _day = num1 - (2447 * _month) / 80;
            num1 = _month / 11;
            _month = _month + 2 - 12 * num1;
            _year = 100 * (num2 - 49) + _year + num1;

            year = uint256(_year);
            month = uint256(_month);
            day = uint256(_day);
        }

        string memory yearStr = _uint2str(year % 10000);
        string memory monthStr = month < 10
            ? string(abi.encodePacked("0", _uint2str(month)))
            : _uint2str(month);
        string memory dayStr = day < 10
            ? string(abi.encodePacked("0", _uint2str(day)))
            : _uint2str(day);

        // Construct name/symbol strings.
        name = string(
            abi.encodePacked(underlying_.name(), " ", yearStr, "-", monthStr, "-", dayStr)
        );
        symbol = string(abi.encodePacked(underlying_.symbol(), "-", yearStr, monthStr, dayStr));
    }

    // Some fancy math to convert a uint into a string, courtesy of Provable Things.
    // Updated to work with solc 0.8.0.
    // https://github.com/provable-things/ethereum-api/blob/master/provableAPI_0.6.sol
    function _uint2str(uint256 _i) internal pure returns (string memory) {
        if (_i == 0) {
            return "0";
        }
        uint256 j = _i;
        uint256 len;
        while (j != 0) {
            len++;
            j /= 10;
        }
        bytes memory bstr = new bytes(len);
        uint256 k = len;
        while (_i != 0) {
            k = k - 1;
            uint8 temp = (48 + uint8(_i - (_i / 10) * 10));
            bytes1 b1 = bytes1(temp);
            bstr[k] = b1;
            _i /= 10;
        }
        return string(bstr);
    }
}

File 6 of 13 : IBondAggregator.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.0;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {IBondAuctioneer} from "../interfaces/IBondAuctioneer.sol";
import {IBondTeller} from "../interfaces/IBondTeller.sol";

interface IBondAggregator {
    /// @notice             Register a auctioneer with the aggregator
    /// @notice             Only Guardian
    /// @param auctioneer_  Address of the Auctioneer to register
    /// @dev                A auctioneer must be registered with an aggregator to create markets
    function registerAuctioneer(IBondAuctioneer auctioneer_) external;

    /// @notice             Register a new market with the aggregator
    /// @notice             Only registered depositories
    /// @param payoutToken_ Token to be paid out by the market
    /// @param quoteToken_  Token to be accepted by the market
    /// @param marketId     ID of the market being created
    function registerMarket(ERC20 payoutToken_, ERC20 quoteToken_)
        external
        returns (uint256 marketId);

    /// @notice     Get the auctioneer for the provided market ID
    /// @param id_  ID of Market
    function getAuctioneer(uint256 id_) external view returns (IBondAuctioneer);

    /// @notice             Calculate current market price of payout token in quote tokens
    /// @dev                Accounts for debt and control variable decay since last deposit (vs _marketPrice())
    /// @param id_          ID of market
    /// @return             Price for market (see the specific auctioneer for units)
    //
    // if price is below minimum price, minimum price is returned
    // this is enforced on deposits by manipulating total debt (see _decay())
    function marketPrice(uint256 id_) external view returns (uint256);

    /// @notice             Scale value to use when converting between quote token and payout token amounts with marketPrice()
    /// @param id_          ID of market
    /// @return             Scaling factor for market in configured decimals
    function marketScale(uint256 id_) external view returns (uint256);

    /// @notice             Payout due for amount of quote tokens
    /// @dev                Accounts for debt and control variable decay so it is up to date
    /// @param amount_      Amount of quote tokens to spend
    /// @param id_          ID of market
    /// @param referrer_    Address of referrer, used to get fees to calculate accurate payout amount.
    ///                     Inputting the zero address will take into account just the protocol fee.
    /// @return             amount of payout tokens to be paid
    function payoutFor(
        uint256 amount_,
        uint256 id_,
        address referrer_
    ) external view returns (uint256);

    /// @notice             Returns maximum amount of quote token accepted by the market
    /// @param id_          ID of market
    /// @param referrer_    Address of referrer, used to get fees to calculate accurate payout amount.
    ///                     Inputting the zero address will take into account just the protocol fee.
    function maxAmountAccepted(uint256 id_, address referrer_) external view returns (uint256);

    /// @notice             Does market send payout immediately
    /// @param id_          Market ID to search for
    function isInstantSwap(uint256 id_) external view returns (bool);

    /// @notice             Is a given market accepting deposits
    /// @param id_          ID of market
    function isLive(uint256 id_) external view returns (bool);

    /// @notice             Returns array of active market IDs within a range
    /// @dev                Should be used if length exceeds max to query entire array
    function liveMarketsBetween(uint256 firstIndex_, uint256 lastIndex_)
        external
        view
        returns (uint256[] memory);

    /// @notice             Returns an array of all active market IDs for a given quote token
    /// @param token_       Address of token to query by
    /// @param isPayout_    If true, search by payout token, else search for quote token
    function liveMarketsFor(address token_, bool isPayout_)
        external
        view
        returns (uint256[] memory);

    /// @notice             Returns an array of all active market IDs for a given owner
    /// @param owner_       Address of owner to query by
    /// @param firstIndex_  Market ID to start at
    /// @param lastIndex_   Market ID to end at (non-inclusive)
    function liveMarketsBy(
        address owner_,
        uint256 firstIndex_,
        uint256 lastIndex_
    ) external view returns (uint256[] memory);

    /// @notice             Returns an array of all active market IDs for a given payout and quote token
    /// @param payout_      Address of payout token
    /// @param quote_       Address of quote token
    function marketsFor(address payout_, address quote_) external view returns (uint256[] memory);

    /// @notice                 Returns the market ID with the highest current payoutToken payout for depositing quoteToken
    /// @param payout_          Address of payout token
    /// @param quote_           Address of quote token
    /// @param amountIn_        Amount of quote tokens to deposit
    /// @param minAmountOut_    Minimum amount of payout tokens to receive as payout
    /// @param maxExpiry_       Latest acceptable vesting timestamp for bond
    ///                         Inputting the zero address will take into account just the protocol fee.
    function findMarketFor(
        address payout_,
        address quote_,
        uint256 amountIn_,
        uint256 minAmountOut_,
        uint256 maxExpiry_
    ) external view returns (uint256 id);

    /// @notice             Returns the Teller that services the market ID
    function getTeller(uint256 id_) external view returns (IBondTeller);

    /// @notice             Returns current capacity of a market
    function currentCapacity(uint256 id_) external view returns (uint256);
}

File 7 of 13 : IBondAuctioneer.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.0;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {IBondTeller} from "../interfaces/IBondTeller.sol";
import {IBondAggregator} from "../interfaces/IBondAggregator.sol";

interface IBondAuctioneer {
    /// @notice                 Creates a new bond market
    /// @param params_          Configuration data needed for market creation, encoded in a bytes array
    /// @dev                    See specific auctioneer implementations for details on encoding the parameters.
    /// @return id              ID of new bond market
    function createMarket(bytes memory params_) external returns (uint256);

    /// @notice                 Disable existing bond market
    /// @notice                 Must be market owner
    /// @param id_              ID of market to close
    function closeMarket(uint256 id_) external;

    /// @notice                 Exchange quote tokens for a bond in a specified market
    /// @notice                 Must be teller
    /// @param id_              ID of the Market the bond is being purchased from
    /// @param amount_          Amount to deposit in exchange for bond (after fee has been deducted)
    /// @param minAmountOut_    Minimum acceptable amount of bond to receive. Prevents frontrunning
    /// @return payout          Amount of payout token to be received from the bond
    function purchaseBond(
        uint256 id_,
        uint256 amount_,
        uint256 minAmountOut_
    ) external returns (uint256 payout);

    /// @notice                         Set market intervals to different values than the defaults
    /// @notice                         Must be market owner
    /// @dev                            Changing the intervals could cause markets to behave in unexpected way
    ///                                 tuneInterval should be greater than tuneAdjustmentDelay
    /// @param id_                      Market ID
    /// @param intervals_               Array of intervals (3)
    ///                                 1. Tune interval - Frequency of tuning
    ///                                 2. Tune adjustment delay - Time to implement downward tuning adjustments
    ///                                 3. Debt decay interval - Interval over which debt should decay completely
    function setIntervals(uint256 id_, uint32[3] calldata intervals_) external;

    /// @notice                      Designate a new owner of a market
    /// @notice                      Must be market owner
    /// @dev                         Doesn't change permissions until newOwner calls pullOwnership
    /// @param id_                   Market ID
    /// @param newOwner_             New address to give ownership to
    function pushOwnership(uint256 id_, address newOwner_) external;

    /// @notice                      Accept ownership of a market
    /// @notice                      Must be market newOwner
    /// @dev                         The existing owner must call pushOwnership prior to the newOwner calling this function
    /// @param id_                   Market ID
    function pullOwnership(uint256 id_) external;

    /// @notice             Set the auctioneer defaults
    /// @notice             Must be policy
    /// @param defaults_    Array of default values
    ///                     1. Tune interval - amount of time between tuning adjustments
    ///                     2. Tune adjustment delay - amount of time to apply downward tuning adjustments
    ///                     3. Minimum debt decay interval - minimum amount of time to let debt decay to zero
    ///                     4. Minimum deposit interval - minimum amount of time to wait between deposits
    ///                     5. Minimum market duration - minimum amount of time a market can be created for
    ///                     6. Minimum debt buffer - the minimum amount of debt over the initial debt to trigger a market shutdown
    /// @dev                The defaults set here are important to avoid edge cases in market behavior, e.g. a very short market reacts doesn't tune well
    /// @dev                Only applies to new markets that are created after the change
    function setDefaults(uint32[6] memory defaults_) external;

    /// @notice             Change the status of the auctioneer to allow creation of new markets
    /// @dev                Setting to false and allowing active markets to end will sunset the auctioneer
    /// @param status_      Allow market creation (true) : Disallow market creation (false)
    function setAllowNewMarkets(bool status_) external;

    /// @notice             Change whether a market creator is allowed to use a callback address in their markets or not
    /// @notice             Must be guardian
    /// @dev                Callback is believed to be safe, but a whitelist is implemented to prevent abuse
    /// @param creator_     Address of market creator
    /// @param status_      Allow callback (true) : Disallow callback (false)
    function setCallbackAuthStatus(address creator_, bool status_) external;

    /* ========== VIEW FUNCTIONS ========== */

    /// @notice                 Provides information for the Teller to execute purchases on a Market
    /// @param id_              Market ID
    /// @return owner           Address of the market owner (tokens transferred from this address if no callback)
    /// @return callbackAddr    Address of the callback contract to get tokens for payouts
    /// @return payoutToken     Payout Token (token paid out) for the Market
    /// @return quoteToken      Quote Token (token received) for the Market
    /// @return vesting         Timestamp or duration for vesting, implementation-dependent
    /// @return maxPayout       Maximum amount of payout tokens you can purchase in one transaction
    function getMarketInfoForPurchase(uint256 id_)
        external
        view
        returns (
            address owner,
            address callbackAddr,
            ERC20 payoutToken,
            ERC20 quoteToken,
            uint48 vesting,
            uint256 maxPayout
        );

    /// @notice             Calculate current market price of payout token in quote tokens
    /// @param id_          ID of market
    /// @return             Price for market in configured decimals
    //
    // if price is below minimum price, minimum price is returned
    function marketPrice(uint256 id_) external view returns (uint256);

    /// @notice             Scale value to use when converting between quote token and payout token amounts with marketPrice()
    /// @param id_          ID of market
    /// @return             Scaling factor for market in configured decimals
    function marketScale(uint256 id_) external view returns (uint256);

    /// @notice             Payout due for amount of quote tokens
    /// @dev                Accounts for debt and control variable decay so it is up to date
    /// @param amount_      Amount of quote tokens to spend
    /// @param id_          ID of market
    /// @param referrer_    Address of referrer, used to get fees to calculate accurate payout amount.
    ///                     Inputting the zero address will take into account just the protocol fee.
    /// @return             amount of payout tokens to be paid
    function payoutFor(
        uint256 amount_,
        uint256 id_,
        address referrer_
    ) external view returns (uint256);

    /// @notice             Returns maximum amount of quote token accepted by the market
    /// @param id_          ID of market
    /// @param referrer_    Address of referrer, used to get fees to calculate accurate payout amount.
    ///                     Inputting the zero address will take into account just the protocol fee.
    function maxAmountAccepted(uint256 id_, address referrer_) external view returns (uint256);

    /// @notice             Does market send payout immediately
    /// @param id_          Market ID to search for
    function isInstantSwap(uint256 id_) external view returns (bool);

    /// @notice             Is a given market accepting deposits
    /// @param id_          ID of market
    function isLive(uint256 id_) external view returns (bool);

    /// @notice             Returns the address of the market owner
    /// @param id_          ID of market
    function ownerOf(uint256 id_) external view returns (address);

    /// @notice             Returns the Teller that services the Auctioneer
    function getTeller() external view returns (IBondTeller);

    /// @notice             Returns the Aggregator that services the Auctioneer
    function getAggregator() external view returns (IBondAggregator);

    /// @notice             Returns current capacity of a market
    function currentCapacity(uint256 id_) external view returns (uint256);
}

File 8 of 13 : IBondCallback.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.0;

import {ERC20} from "solmate/tokens/ERC20.sol";

interface IBondCallback {
    /// @notice                 Send payout tokens to Teller while allowing market owners to perform custom logic on received or paid out tokens
    /// @notice                 Market ID on Teller must be whitelisted
    /// @param id_              ID of the market
    /// @param inputAmount_     Amount of quote tokens bonded to the market
    /// @param outputAmount_    Amount of payout tokens to be paid out to the market
    /// @dev Must transfer the output amount of payout tokens back to the Teller
    /// @dev Should check that the quote tokens have been transferred to the contract in the _callback function
    function callback(
        uint256 id_,
        uint256 inputAmount_,
        uint256 outputAmount_
    ) external;

    /// @notice         Returns the number of quote tokens received and payout tokens paid out for a market
    /// @param id_      ID of the market
    /// @return in_     Amount of quote tokens bonded to the market
    /// @return out_    Amount of payout tokens paid out to the market
    function amountsForMarket(uint256 id_) external view returns (uint256 in_, uint256 out_);

    /// @notice         Whitelist a teller and market ID combination
    /// @notice         Must be callback owner
    /// @param teller_  Address of the Teller contract which serves the market
    /// @param id_      ID of the market
    function whitelist(address teller_, uint256 id_) external;

    /// @notice Remove a market ID on a teller from the whitelist
    /// @dev    Shutdown function in case there's an issue with the teller
    /// @param  teller_ Address of the Teller contract which serves the market
    /// @param  id_     ID of the market to remove from whitelist
    function blacklist(address teller_, uint256 id_) external;

    /// @notice         Withdraw tokens from the callback and update balances
    /// @notice         Only callback owner
    /// @param to_      Address of the recipient
    /// @param token_   Address of the token to withdraw
    /// @param amount_  Amount of tokens to withdraw
    function withdraw(
        address to_,
        ERC20 token_,
        uint256 amount_
    ) external;

    /// @notice         Deposit tokens to the callback and update balances
    /// @notice         Only callback owner
    /// @param token_   Address of the token to deposit
    /// @param amount_  Amount of tokens to deposit
    function deposit(ERC20 token_, uint256 amount_) external;
}

File 9 of 13 : IBondFixedTermTeller.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.0;

import {ERC20} from "solmate/tokens/ERC20.sol";

interface IBondFixedTermTeller {
    // Info for bond token
    struct TokenMetadata {
        bool active;
        ERC20 underlying;
        uint8 decimals;
        uint48 expiry;
        uint256 supply;
    }

    /// @notice              Deposit an ERC20 token and mint a future-dated ERC1155 bond token
    /// @param underlying_   ERC20 token redeemable when the bond token vests
    /// @param expiry_       Timestamp at which the bond token can be redeemed for the underlying token
    /// @param amount_       Amount of underlying tokens to deposit
    /// @return              ID of the ERC1155 bond token received
    /// @return              Amount of the ERC1155 bond token received
    function create(
        ERC20 underlying_,
        uint48 expiry_,
        uint256 amount_
    ) external returns (uint256, uint256);

    /// @notice             "Deploy" a new ERC1155 bond token for an (underlying, expiry) pair and return its token ID
    /// @dev                ERC1155 used for fixed-term
    /// @dev                If a bond token exists for the (underlying, expiry) pair, it returns that token ID
    /// @param underlying_  ERC20 token redeemable when the bond token vests
    /// @param expiry_      Timestamp at which the bond token can be redeemed for the underlying token
    /// @return             ID of the ERC1155 bond token being created
    function deploy(ERC20 underlying_, uint48 expiry_) external returns (uint256);

    /// @notice          Redeem a fixed-term bond token for the underlying token (bond token must have matured)
    /// @param tokenId_  ID of the bond token to redeem
    /// @param amount_   Amount of bond token to redeem
    function redeem(uint256 tokenId_, uint256 amount_) external;

    /// @notice          Redeem multiple fixed-term bond tokens for the underlying tokens (bond tokens must have matured)
    /// @param tokenIds_ Array of bond token ids
    /// @param amounts_  Array of amounts of bond tokens to redeem
    function batchRedeem(uint256[] memory tokenIds_, uint256[] memory amounts_) external;

    /// @notice             Get token ID from token and expiry
    /// @param payoutToken_ Payout token of bond
    /// @param expiry_      Expiry of the bond
    /// @return             ID of the bond token
    function getTokenId(ERC20 payoutToken_, uint48 expiry_) external pure returns (uint256);

    /// @notice             Get the token name and symbol for a bond token
    /// @param tokenId_     ID of the bond token
    /// @return name        Bond token name
    /// @return symbol      Bond token symbol
    function getTokenNameAndSymbol(uint256 tokenId_)
        external
        view
        returns (string memory, string memory);
}

File 10 of 13 : IBondTeller.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.0;

import {ERC20} from "solmate/tokens/ERC20.sol";

interface IBondTeller {
    /// @notice                 Exchange quote tokens for a bond in a specified market
    /// @param recipient_       Address of recipient of bond. Allows deposits for other addresses
    /// @param referrer_        Address of referrer who will receive referral fee. For frontends to fill.
    ///                         Direct calls can use the zero address for no referrer fee.
    /// @param id_              ID of the Market the bond is being purchased from
    /// @param amount_          Amount to deposit in exchange for bond
    /// @param minAmountOut_    Minimum acceptable amount of bond to receive. Prevents frontrunning
    /// @return                 Amount of payout token to be received from the bond
    /// @return                 Timestamp at which the bond token can be redeemed for the underlying token
    function purchase(
        address recipient_,
        address referrer_,
        uint256 id_,
        uint256 amount_,
        uint256 minAmountOut_
    ) external returns (uint256, uint48);

    /// @notice          Get current fee charged by the teller based on the combined protocol and referrer fee
    /// @param referrer_ Address of the referrer
    /// @return          Fee in basis points (3 decimal places)
    function getFee(address referrer_) external view returns (uint48);

    /// @notice         Set protocol fee
    /// @notice         Must be guardian
    /// @param fee_     Protocol fee in basis points (3 decimal places)
    function setProtocolFee(uint48 fee_) external;

    /// @notice          Set the discount for creating bond tokens from the base protocol fee
    /// @dev             The discount is subtracted from the protocol fee to determine the fee
    ///                  when using create() to mint bond tokens without using an Auctioneer
    /// @param discount_ Create Fee Discount in basis points (3 decimal places)
    function setCreateFeeDiscount(uint48 discount_) external;

    /// @notice         Set your fee as a referrer to the protocol
    /// @notice         Fee is set for sending address
    /// @param fee_     Referrer fee in basis points (3 decimal places)
    function setReferrerFee(uint48 fee_) external;

    /// @notice         Claim fees accrued by sender in the input tokens and sends them to the provided address
    /// @param tokens_  Array of tokens to claim fees for
    /// @param to_      Address to send fees to
    function claimFees(ERC20[] memory tokens_, address to_) external;
}

File 11 of 13 : ERC1155.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Minimalist and gas efficient standard ERC1155 implementation.
/// @dev    Removed `uri()` function. Unnecessary for our use case.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC1155.sol)
abstract contract ERC1155 {
    /*///////////////////////////////////////////////////////////////
                                EVENTS
    //////////////////////////////////////////////////////////////*/

    event TransferSingle(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256 id,
        uint256 amount
    );

    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] amounts
    );

    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    // event URI(string value, uint256 indexed id);

    /*///////////////////////////////////////////////////////////////
                            ERC1155 STORAGE
    //////////////////////////////////////////////////////////////*/

    mapping(address => mapping(uint256 => uint256)) public balanceOf;

    mapping(address => mapping(address => bool)) public isApprovedForAll;

    /*///////////////////////////////////////////////////////////////
                             ERC1155 LOGIC
    //////////////////////////////////////////////////////////////*/

    function setApprovalForAll(address operator, bool approved) public virtual {
        isApprovedForAll[msg.sender][operator] = approved;

        emit ApprovalForAll(msg.sender, operator, approved);
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public virtual {
        require(msg.sender == from || isApprovedForAll[from][msg.sender], "NOT_AUTHORIZED");

        balanceOf[from][id] -= amount;
        balanceOf[to][id] += amount;

        emit TransferSingle(msg.sender, from, to, id, amount);

        require(
            to.code.length == 0
                ? to != address(0)
                : ERC1155TokenReceiver(to).onERC1155Received(msg.sender, from, id, amount, data) ==
                    ERC1155TokenReceiver.onERC1155Received.selector,
            "UNSAFE_RECIPIENT"
        );
    }

    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual {
        uint256 idsLength = ids.length; // Saves MLOADs.

        require(idsLength == amounts.length, "LENGTH_MISMATCH");

        require(msg.sender == from || isApprovedForAll[from][msg.sender], "NOT_AUTHORIZED");

        // Storing these outside the loop saves ~15 gas per iteration.
        uint256 id;
        uint256 amount;

        for (uint256 i = 0; i < idsLength; ) {
            id = ids[i];
            amount = amounts[i];

            balanceOf[from][id] -= amount;
            balanceOf[to][id] += amount;

            // An array can't have a total length
            // larger than the max uint256 value.
            unchecked {
                ++i;
            }
        }

        emit TransferBatch(msg.sender, from, to, ids, amounts);

        require(
            to.code.length == 0
                ? to != address(0)
                : ERC1155TokenReceiver(to).onERC1155BatchReceived(
                    msg.sender,
                    from,
                    ids,
                    amounts,
                    data
                ) == ERC1155TokenReceiver.onERC1155BatchReceived.selector,
            "UNSAFE_RECIPIENT"
        );
    }

    function balanceOfBatch(address[] memory owners, uint256[] memory ids)
        public
        view
        virtual
        returns (uint256[] memory balances)
    {
        uint256 ownersLength = owners.length; // Saves MLOADs.

        require(ownersLength == ids.length, "LENGTH_MISMATCH");

        balances = new uint256[](ownersLength);

        // Unchecked because the only math done is incrementing
        // the array index counter which cannot possibly overflow.
        unchecked {
            for (uint256 i = 0; i < ownersLength; ++i) {
                balances[i] = balanceOf[owners[i]][ids[i]];
            }
        }
    }

    /*///////////////////////////////////////////////////////////////
                              ERC165 LOGIC
    //////////////////////////////////////////////////////////////*/

    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return
            interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165
            interfaceId == 0xd9b67a26 || // ERC165 Interface ID for ERC1155
            interfaceId == 0x0e89341c; // ERC165 Interface ID for ERC1155MetadataURI
    }

    /*///////////////////////////////////////////////////////////////
                        INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal {
        balanceOf[to][id] += amount;

        emit TransferSingle(msg.sender, address(0), to, id, amount);

        require(
            to.code.length == 0
                ? to != address(0)
                : ERC1155TokenReceiver(to).onERC1155Received(
                    msg.sender,
                    address(0),
                    id,
                    amount,
                    data
                ) == ERC1155TokenReceiver.onERC1155Received.selector,
            "UNSAFE_RECIPIENT"
        );
    }

    function _batchMint(
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal {
        uint256 idsLength = ids.length; // Saves MLOADs.

        require(idsLength == amounts.length, "LENGTH_MISMATCH");

        for (uint256 i = 0; i < idsLength; ) {
            balanceOf[to][ids[i]] += amounts[i];

            // An array can't have a total length
            // larger than the max uint256 value.
            unchecked {
                ++i;
            }
        }

        emit TransferBatch(msg.sender, address(0), to, ids, amounts);

        require(
            to.code.length == 0
                ? to != address(0)
                : ERC1155TokenReceiver(to).onERC1155BatchReceived(
                    msg.sender,
                    address(0),
                    ids,
                    amounts,
                    data
                ) == ERC1155TokenReceiver.onERC1155BatchReceived.selector,
            "UNSAFE_RECIPIENT"
        );
    }

    function _batchBurn(
        address from,
        uint256[] memory ids,
        uint256[] memory amounts
    ) internal {
        uint256 idsLength = ids.length; // Saves MLOADs.

        require(idsLength == amounts.length, "LENGTH_MISMATCH");

        for (uint256 i = 0; i < idsLength; ) {
            balanceOf[from][ids[i]] -= amounts[i];

            // An array can't have a total length
            // larger than the max uint256 value.
            unchecked {
                ++i;
            }
        }

        emit TransferBatch(msg.sender, from, address(0), ids, amounts);
    }

    function _burn(
        address from,
        uint256 id,
        uint256 amount
    ) internal {
        balanceOf[from][id] -= amount;

        emit TransferSingle(msg.sender, from, address(0), id, amount);
    }
}

/// @notice A generic interface for a contract which properly accepts ERC1155 tokens.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC1155.sol)
interface ERC1155TokenReceiver {
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external returns (bytes4);

    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external returns (bytes4);
}

File 12 of 13 : FullMath.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

/// @title Contains 512-bit math functions
/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision
/// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits
library FullMath {
    /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
    /// @param a The multiplicand
    /// @param b The multiplier
    /// @param denominator The divisor
    /// @return result The 256-bit result
    /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv
    function mulDiv(
        uint256 a,
        uint256 b,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = a * b
            // Compute the product mod 2**256 and mod 2**256 - 1
            // then use the Chinese Remainder Theorem to reconstruct
            // the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2**256 + prod0
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(a, b, not(0))
                prod0 := mul(a, b)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division
            if (prod1 == 0) {
                require(denominator > 0);
                assembly {
                    result := div(prod0, denominator)
                }
                return result;
            }

            // Make sure the result is less than 2**256.
            // Also prevents denominator == 0
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0]
            // Compute remainder using mulmod
            uint256 remainder;
            assembly {
                remainder := mulmod(a, b, denominator)
            }
            // Subtract 256 bit number from 512 bit number
            assembly {
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator
            // Compute largest power of two divisor of denominator.
            // Always >= 1.
            uint256 twos = (type(uint256).max - denominator + 1) & denominator;
            // Divide denominator by power of two
            assembly {
                denominator := div(denominator, twos)
            }

            // Divide [prod1 prod0] by the factors of two
            assembly {
                prod0 := div(prod0, twos)
            }
            // Shift in bits from prod1 into prod0. For this we need
            // to flip `twos` such that it is 2**256 / twos.
            // If twos is zero, then it becomes one
            assembly {
                twos := add(div(sub(0, twos), twos), 1)
            }
            prod0 |= prod1 * twos;

            // Invert denominator mod 2**256
            // Now that denominator is an odd number, it has an inverse
            // modulo 2**256 such that denominator * inv = 1 mod 2**256.
            // Compute the inverse by starting with a seed that is correct
            // correct for four bits. That is, denominator * inv = 1 mod 2**4
            uint256 inv = (3 * denominator) ^ 2;
            // Now use Newton-Raphson iteration to improve the precision.
            // Thanks to Hensel's lifting lemma, this also works in modular
            // arithmetic, doubling the correct bits in each step.
            inv *= 2 - denominator * inv; // inverse mod 2**8
            inv *= 2 - denominator * inv; // inverse mod 2**16
            inv *= 2 - denominator * inv; // inverse mod 2**32
            inv *= 2 - denominator * inv; // inverse mod 2**64
            inv *= 2 - denominator * inv; // inverse mod 2**128
            inv *= 2 - denominator * inv; // inverse mod 2**256

            // Because the division is now exact we can divide by multiplying
            // with the modular inverse of denominator. This will give us the
            // correct result modulo 2**256. Since the precoditions guarantee
            // that the outcome is less than 2**256, this is the final result.
            // We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inv;
            return result;
        }
    }

    /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
    /// @param a The multiplicand
    /// @param b The multiplier
    /// @param denominator The divisor
    /// @return result The 256-bit result
    function mulDivUp(
        uint256 a,
        uint256 b,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        result = mulDiv(a, b, denominator);
        unchecked {
            if (mulmod(a, b, denominator) > 0) {
                require(result < type(uint256).max);
                result++;
            }
        }
    }
}

File 13 of 13 : TransferHelper.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

import {ERC20} from "solmate/tokens/ERC20.sol";

/// @notice Safe ERC20 and ETH transfer library that safely handles missing return values.
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v3-periphery/blob/main/contracts/libraries/TransferHelper.sol)
/// @author Taken from Solmate.
library TransferHelper {
    function safeTransferFrom(
        ERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        (bool success, bytes memory data) = address(token).call(
            abi.encodeWithSelector(ERC20.transferFrom.selector, from, to, amount)
        );

        require(
            success &&
                (data.length == 0 || abi.decode(data, (bool))) &&
                address(token).code.length > 0,
            "TRANSFER_FROM_FAILED"
        );
    }

    function safeTransfer(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        (bool success, bytes memory data) = address(token).call(
            abi.encodeWithSelector(ERC20.transfer.selector, to, amount)
        );

        require(
            success &&
                (data.length == 0 || abi.decode(data, (bool))) &&
                address(token).code.length > 0,
            "TRANSFER_FAILED"
        );
    }

    // function safeApprove(
    //     ERC20 token,
    //     address to,
    //     uint256 amount
    // ) internal {
    //     (bool success, bytes memory data) = address(token).call(
    //         abi.encodeWithSelector(ERC20.approve.selector, to, amount)
    //     );

    //     require(success && (data.length == 0 || abi.decode(data, (bool))), "APPROVE_FAILED");
    // }

    // function safeTransferETH(address to, uint256 amount) internal {
    //     (bool success, ) = to.call{value: amount}(new bytes(0));

    //     require(success, "ETH_TRANSFER_FAILED");
    // }
}

Settings
{
  "remappings": [
    "clones-with-immutable-args/=lib/clones-with-immutable-args/src/",
    "clones/=lib/clones-with-immutable-args/src/",
    "ds-test/=lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "hardhat/=node_modules/hardhat/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin/=lib/openzeppelin-contracts/contracts/",
    "solidity-code-metrics/=node_modules/solidity-code-metrics/",
    "solmate/=lib/solmate/src/",
    "weird-erc20/=lib/solmate/lib/weird-erc20/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 100000
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"protocol_","type":"address"},{"internalType":"contract IBondAggregator","name":"aggregator_","type":"address"},{"internalType":"address","name":"guardian_","type":"address"},{"internalType":"contract Authority","name":"authority_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Teller_InvalidCallback","type":"error"},{"inputs":[],"name":"Teller_InvalidParams","type":"error"},{"inputs":[],"name":"Teller_NotAuthorized","type":"error"},{"inputs":[{"internalType":"contract ERC20","name":"underlying","type":"address"},{"internalType":"uint48","name":"expiry","type":"uint48"}],"name":"Teller_TokenDoesNotExist","type":"error"},{"inputs":[{"internalType":"uint48","name":"maturesOn","type":"uint48"}],"name":"Teller_TokenNotMatured","type":"error"},{"inputs":[],"name":"Teller_UnsupportedToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"contract Authority","name":"newAuthority","type":"address"}],"name":"AuthorityUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"referrer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"}],"name":"Bonded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"contract ERC20","name":"underlying","type":"address"},{"indexed":true,"internalType":"uint48","name":"expiry","type":"uint48"}],"name":"ERC1155BondTokenCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferSingle","type":"event"},{"inputs":[],"name":"FEE_DECIMALS","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"authority","outputs":[{"internalType":"contract Authority","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"owners","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"balances","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds_","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts_","type":"uint256[]"}],"name":"batchRedeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20[]","name":"tokens_","type":"address[]"},{"internalType":"address","name":"to_","type":"address"}],"name":"claimFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"underlying_","type":"address"},{"internalType":"uint48","name":"expiry_","type":"uint48"},{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"create","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"createFeeDiscount","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"underlying_","type":"address"},{"internalType":"uint48","name":"expiry_","type":"uint48"}],"name":"deploy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"referrer_","type":"address"}],"name":"getFee","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"underlying_","type":"address"},{"internalType":"uint48","name":"expiry_","type":"uint48"}],"name":"getTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"getTokenNameAndSymbol","outputs":[{"internalType":"string","name":"","type":"string"},{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFee","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient_","type":"address"},{"internalType":"address","name":"referrer_","type":"address"},{"internalType":"uint256","name":"id_","type":"uint256"},{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"uint256","name":"minAmountOut_","type":"uint256"}],"name":"purchase","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"referrerFees","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"contract ERC20","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract Authority","name":"newAuthority","type":"address"}],"name":"setAuthority","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint48","name":"discount_","type":"uint48"}],"name":"setCreateFeeDiscount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint48","name":"fee_","type":"uint48"}],"name":"setProtocolFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint48","name":"fee_","type":"uint48"}],"name":"setReferrerFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenMetadata","outputs":[{"internalType":"bool","name":"active","type":"bool"},{"internalType":"contract ERC20","name":"underlying","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"},{"internalType":"uint48","name":"expiry","type":"uint48"},{"internalType":"uint256","name":"supply","type":"uint256"}],"stateMutability":"view","type":"function"}]

60c060405260016002553480156200001657600080fd5b5060405162004ddb38038062004ddb83398101604081905262000039916200011e565b600080546001600160a01b03199081166001600160a01b0385811691821784556001805490931690851617909155604051869286928692869284928492909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a36040516001600160a01b0382169033907fa3396fd7f6e0a21b50e5089d2da70d5ac0a3bbbd1f617a93f134b7638998019890600090a35050506001600160a01b03928316608052501660a0525050600480546001600160601b031916905550620001869050565b6001600160a01b03811681146200011b57600080fd5b50565b600080600080608085870312156200013557600080fd5b8451620001428162000105565b6020860151909450620001558162000105565b6040860151909350620001688162000105565b60608601519092506200017b8162000105565b939692955090935050565b60805160a051614c21620001ba600039600081816111a20152612a540152600081816114060152611d920152614c216000f3fe608060405234801561001057600080fd5b50600436106101ce5760003560e01c80638da5cb5b11610104578063bf7e214f116100a2578063e70b9e2711610071578063e70b9e2714610566578063e985e9c514610591578063e9dc30f3146105bf578063f242432a146105d257600080fd5b8063bf7e214f14610501578063c23135dd14610521578063c6e38a4b14610549578063ccf288c61461055c57600080fd5b8063b0e21e8a116100de578063b0e21e8a146104a1578063b1e55529146104b3578063b7314ef9146104c6578063b88c9148146104ee57600080fd5b80638da5cb5b14610436578063925932771461047b578063a22cb4651461048e57600080fd5b806335312c85116101715780636de5b4cd1161014b5780636de5b4cd146103ce5780637a9e5e4b146103fd5780637cbc237314610410578063816909271461042357600080fd5b806335312c85146102b55780634e1273f4146102d65780636914db60146102f657600080fd5b80630d4dfc21116101ad5780630d4dfc211461026757806313af40351461027c5780632eb2c2d61461028f5780632f6fa94e146102a257600080fd5b8062fdd58e146101d357806301ffc9a71461021157806306692a3714610234575b600080fd5b6101fe6101e1366004613bbb565b600660209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b61022461021f366004613c15565b6105e5565b6040519015158152602001610208565b600454610250906601000000000000900465ffffffffffff1681565b60405165ffffffffffff9091168152602001610208565b61027a610275366004613c46565b6106ca565b005b61027a61028a366004613c63565b6107ce565b61027a61029d366004613e24565b6108d2565b61027a6102b0366004613ed2565b610cdd565b6102c86102c3366004613f7e565b610e10565b60405161020892919061400d565b6102e96102e436600461403b565b610eca565b6040516102089190614138565b610380610304366004613f7e565b6008602052600090815260409020805460019091015460ff80831692610100810473ffffffffffffffffffffffffffffffffffffffff1692750100000000000000000000000000000000000000000082049092169176010000000000000000000000000000000000000000000090910465ffffffffffff169085565b60408051951515865273ffffffffffffffffffffffffffffffffffffffff909416602086015260ff9092169284019290925265ffffffffffff9091166060830152608082015260a001610208565b6103e16103dc36600461414b565b61103a565b6040805192835265ffffffffffff909116602083015201610208565b61027a61040b366004613c63565b6114f1565b61027a61041e36600461419c565b61164e565b61027a610431366004613c46565b6116d1565b6000546104569073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610208565b6101fe6104893660046141be565b6117f0565b61027a61049c366004614205565b6118a5565b6004546102509065ffffffffffff1681565b61027a6104c1366004613c46565b61193c565b6104d96104d4366004614233565b611a4d565b60408051928352602083019190915201610208565b6102506104fc366004613c63565b611e3d565b6001546104569073ffffffffffffffffffffffffffffffffffffffff1681565b61025061052f366004613c63565b60036020526000908152604090205465ffffffffffff1681565b6101fe6105573660046141be565b611e7b565b610250620186a081565b6101fe610574366004614274565b600560209081526000928352604080842090915290825290205481565b61022461059f366004614274565b600760209081526000928352604080842090915290825290205460ff1681565b61027a6105cd3660046142ee565b611f29565b61027a6105e036600461435a565b612035565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316148061067857507fd9b67a26000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b806106c457507f0e89341c000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60025460011461073b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e43590000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6002805561138865ffffffffffff82161115610783576040517fe94b8f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260036020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000001665ffffffffffff929092169190911790556001600255565b6107fc336000357fffffffff000000000000000000000000000000000000000000000000000000001661233c565b610862576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152606401610732565b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b82518251811461093e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f4c454e4754485f4d49534d4154434800000000000000000000000000000000006044820152606401610732565b3373ffffffffffffffffffffffffffffffffffffffff87161480610992575073ffffffffffffffffffffffffffffffffffffffff8616600090815260076020908152604080832033845290915290205460ff165b6109f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4e4f545f415554484f52495a45440000000000000000000000000000000000006044820152606401610732565b60008060005b83811015610af057868181518110610a1857610a186143c3565b60200260200101519250858181518110610a3457610a346143c3565b6020026020010151915081600660008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008581526020019081526020016000206000828254610a9e9190614421565b909155505073ffffffffffffffffffffffffffffffffffffffff8816600090815260066020908152604080832086845290915281208054849290610ae3908490614438565b90915550506001016109fe565b508673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8989604051610b67929190614450565b60405180910390a473ffffffffffffffffffffffffffffffffffffffff87163b15610c53576040517fbc197c81000000000000000000000000000000000000000000000000000000008082529073ffffffffffffffffffffffffffffffffffffffff89169063bc197c8190610be89033908d908c908c908c90600401614475565b6020604051808303816000875af1158015610c07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2b91906144e0565b7fffffffff000000000000000000000000000000000000000000000000000000001614610c6d565b73ffffffffffffffffffffffffffffffffffffffff871615155b610cd3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f554e534146455f524543495049454e54000000000000000000000000000000006044820152606401610732565b5050505050505050565b600254600114610d49576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e4359000000000000000000000000000000000000000000006044820152606401610732565b60028055815160005b81811015610e05576000848281518110610d6e57610d6e6143c3565b60209081029190910181015133600090815260058352604080822073ffffffffffffffffffffffffffffffffffffffff8416835290935291909120549091508015610df25733600090815260056020908152604080832073ffffffffffffffffffffffffffffffffffffffff86168085529252822091909155610df290868361244d565b505080610dfe906144fd565b9050610d52565b505060016002555050565b6000818152600860209081526040808320815160a081018352815460ff80821615158352610100820473ffffffffffffffffffffffffffffffffffffffff1695830186905275010000000000000000000000000000000000000000008204169382019390935276010000000000000000000000000000000000000000000090920465ffffffffffff16606080840182905260019092015460808401529093849390918291610ebd916125d9565b9097909650945050505050565b81518151606091908114610f3a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f4c454e4754485f4d49534d4154434800000000000000000000000000000000006044820152606401610732565b8067ffffffffffffffff811115610f5357610f53613c80565b604051908082528060200260200182016040528015610f7c578160200160208202803683370190505b50915060005b818110156110325760066000868381518110610fa057610fa06143c3565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858381518110610ff657610ff66143c3565b602002602001015181526020019081526020016000205483828151811061101f5761101f6143c3565b6020908102919091010152600101610f82565b505092915050565b6000806002546001146110a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e4359000000000000000000000000000000000000000000006044820152606401610732565b6002805573ffffffffffffffffffffffffffffffffffffffff861660009081526003602052604081205481908190819081906110f2908a9065ffffffffffff16620186a061297a565b73ffffffffffffffffffffffffffffffffffffffff8c166000908152600360205260408120546004549293509091839161114e9161113b9165ffffffffffff9081169116614535565b8c9065ffffffffffff16620186a061297a565b6111589190614421565b6040517f52047942000000000000000000000000000000000000000000000000000000008152600481018d905290915060009073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690635204794290602401602060405180830381865afa1580156111e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120d919061455f565b6040517facc5570c000000000000000000000000000000000000000000000000000000008152600481018e905290915060009073ffffffffffffffffffffffffffffffffffffffff83169063acc5570c9060240160c060405180830381865afa15801561127e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a2919061457c565b50919b509950975090915060009050836112bc868f614421565b6112c69190614421565b90508273ffffffffffffffffffffffffffffffffffffffff1663e007fa978f838f6040518463ffffffff1660e01b8152600401611316939291909283526020830191909152604082015260600190565b6020604051808303816000875af1158015611335573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135991906145f9565b955050505081600560008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546113ea9190614438565b909155505073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000008116600090815260056020908152604080832093891683529290529081208054839290611453908490614438565b9091555061146e90508b8b856114698587614438565b612a4c565b600061147c8e8589886130f4565b90508c73ffffffffffffffffffffffffffffffffffffffff168c7f3ae5efadaccde413bdfcb3a4626babecd844c502ee4c2c9b340f28cd9d5527328d876040516114d0929190918252602082015260400190565b60405180910390a36001600255929d929c50919a5050505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314806115d457506001546040517fb70096130000000000000000000000000000000000000000000000000000000081523360048201523060248201526000357fffffffff0000000000000000000000000000000000000000000000000000000016604482015273ffffffffffffffffffffffffffffffffffffffff9091169063b700961390606401602060405180830381865afa1580156115b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d49190614612565b6115dd57600080fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831690811790915560405133907fa3396fd7f6e0a21b50e5089d2da70d5ac0a3bbbd1f617a93f134b7638998019890600090a350565b6002546001146116ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e4359000000000000000000000000000000000000000000006044820152606401610732565b600280556116c8828261318b565b50506001600255565b6116ff336000357fffffffff000000000000000000000000000000000000000000000000000000001661233c565b611765576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152606401610732565b60045465ffffffffffff90811690821611156117ad576040517fe94b8f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805465ffffffffffff9092166601000000000000027fffffffffffffffffffffffffffffffffffffffff000000000000ffffffffffff909216919091179055565b60008083611801620151808561465e565b60405160200161186792919060609290921b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016825260d01b7fffffffffffff0000000000000000000000000000000000000000000000000000166014820152601a0190565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00181529190528051602090910120949350505050565b33600081815260076020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61196a336000357fffffffff000000000000000000000000000000000000000000000000000000001661233c565b6119d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152606401610732565b6113888165ffffffffffff161115611a14576040517fe94b8f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600480547fffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000001665ffffffffffff92909216919091179055565b600080600254600114611abc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e4359000000000000000000000000000000000000000000006044820152606401610732565b600280556000611acf620151808661465e565b611adc9062015180614683565b9050428165ffffffffffff161015611b20576040517fe94b8f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611b2c87836117f0565b60008181526008602052604090205490915060ff16611b9d576040517fcb66c9db00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8816600482015265ffffffffffff83166024820152604401610732565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8916906370a0823190602401602060405180830381865afa158015611c0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c2e91906145f9565b9050611c5273ffffffffffffffffffffffffffffffffffffffff89163330896132f1565b611c5c8682614438565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8a16906370a0823190602401602060405180830381865afa158015611cc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cea91906145f9565b1015611d22576040517fd354452400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60045465ffffffffffff66010000000000008204811691161115611e1657600454600090611d7b90611d689065ffffffffffff66010000000000008204811691166146b1565b889065ffffffffffff16620186a061297a565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166000908152600560209081526040808320938e16835292905290812080549293508392909190611de4908490614438565b90915550611dfe90503384611df9848b614421565b61348d565b82611e098289614421565b9550955050505050611e2e565b611e2133838861348d565b509250839150611e2e9050565b60016002559094909350915050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600360205260408120546004546106c49165ffffffffffff9081169116614535565b6000600254600114611ee9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e4359000000000000000000000000000000000000000000006044820152606401610732565b600280556000611ef984846117f0565b60008181526008602052604090205490915060ff16611f1d57611f1d8185856134d0565b60016002559392505050565b600254600114611f95576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e4359000000000000000000000000000000000000000000006044820152606401610732565b6002805582818114611fd3576040517fe94b8f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8181101561202857612018868683818110611ff357611ff36143c3565b9050602002013585858481811061200c5761200c6143c3565b9050602002013561318b565b612021816144fd565b9050611fd6565b5050600160025550505050565b3373ffffffffffffffffffffffffffffffffffffffff86161480612089575073ffffffffffffffffffffffffffffffffffffffff8516600090815260076020908152604080832033845290915290205460ff165b6120ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4e4f545f415554484f52495a45440000000000000000000000000000000000006044820152606401610732565b73ffffffffffffffffffffffffffffffffffffffff851660009081526006602090815260408083208684529091528120805484929061212f908490614421565b909155505073ffffffffffffffffffffffffffffffffffffffff8416600090815260066020908152604080832086845290915281208054849290612174908490614438565b9091555050604080518481526020810184905273ffffffffffffffffffffffffffffffffffffffff808716929088169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a473ffffffffffffffffffffffffffffffffffffffff84163b156122b5576040517ff23a6e61000000000000000000000000000000000000000000000000000000008082529073ffffffffffffffffffffffffffffffffffffffff86169063f23a6e619061224a9033908a908990899089906004016146d8565b6020604051808303816000875af1158015612269573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061228d91906144e0565b7fffffffff0000000000000000000000000000000000000000000000000000000016146122cf565b73ffffffffffffffffffffffffffffffffffffffff841615155b612335576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f554e534146455f524543495049454e54000000000000000000000000000000006044820152606401610732565b5050505050565b60015460009073ffffffffffffffffffffffffffffffffffffffff16801580159061242057506040517fb700961300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301523060248301527fffffffff000000000000000000000000000000000000000000000000000000008516604483015282169063b700961390606401602060405180830381865afa1580156123fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124209190614612565b80612445575060005473ffffffffffffffffffffffffffffffffffffffff8581169116145b949350505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905291516000928392908716916124e49190614728565b6000604051808303816000865af19150503d8060008114612521576040519150601f19603f3d011682016040523d82523d6000602084013e612526565b606091505b50915091508180156125505750805115806125505750808060200190518101906125509190614612565b8015612573575060008573ffffffffffffffffffffffffffffffffffffffff163b115b612335576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5452414e534645525f4641494c454400000000000000000000000000000000006044820152606401610732565b60608060008080806125ee6201518088614744565b905060006125ff8262010bd9614758565b61260c9062253d8c614758565b9050600062023ab161261f8360046147cc565b6126299190614888565b9050600461263a8262023ab16147cc565b612645906003614758565b61264f9190614888565b61265990836148f0565b9150600062164b0961266c846001614758565b61267890610fa06147cc565b6126829190614888565b90506004612692826105b56147cc565b61269c9190614888565b6126a690846148f0565b6126b190601f614758565b9250600061098f6126c38560506147cc565b6126cd9190614888565b9050600060506126df8361098f6147cc565b6126e99190614888565b6126f390866148f0565b9050612700600b83614888565b945061270d85600c6147cc565b612718836002614758565b61272291906148f0565b915084836127316031876148f0565b61273c9060646147cc565b6127469190614758565b6127509190614758565b985090965094506000935061277592506127709150612710905086614964565b61374e565b90506000600a841061278f5761278a8461374e565b6127b8565b6127988461374e565b6040516020016127a89190614978565b6040516020818303038152906040525b90506000600a84106127d2576127cd8461374e565b6127fb565b6127db8461374e565b6040516020016127eb9190614978565b6040516020818303038152906040525b90508973ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa158015612848573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261288e91908101906149bd565b8383836040516020016128a49493929190614a2b565b60405160208183030381529060405297508973ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015612900573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261294691908101906149bd565b83838360405160200161295c9493929190614ae0565b60405160208183030381529060405296505050505050509250929050565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff858709858702925082811083820303915050806000036129d157600084116129c657600080fd5b508290049050612a45565b8084116129dd57600080fd5b600084868809851960019081018716968790049682860381900495909211909303600082900391909104909201919091029190911760038402600290811880860282030280860282030280860282030280860282030280860282030280860290910302029150505b9392505050565b6000806000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166352047942896040518263ffffffff1660e01b8152600401612aad91815260200190565b602060405180830381865afa158015612aca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aee919061455f565b73ffffffffffffffffffffffffffffffffffffffff1663acc5570c896040518263ffffffff1660e01b8152600401612b2891815260200190565b60c060405180830381865afa158015612b45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b69919061457c565b5050935093509350935060008588612b819190614421565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290915060009073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015612bf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c1591906145f9565b9050612c3973ffffffffffffffffffffffffffffffffffffffff841633308c6132f1565b612c438982614438565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8516906370a0823190602401602060405180830381865afa158015612cad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cd191906145f9565b1015612d09576040517fd354452400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff851615612f4057612d4673ffffffffffffffffffffffffffffffffffffffff8416868461244d565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa158015612db3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dd791906145f9565b6040517f4b9de77c000000000000000000000000000000000000000000000000000000008152600481018d905260248101859052604481018b905290915073ffffffffffffffffffffffffffffffffffffffff871690634b9de77c90606401600060405180830381600087803b158015612e5057600080fd5b505af1158015612e64573d6000803e3d6000fd5b505050508881612e749190614438565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8716906370a0823190602401602060405180830381865afa158015612ede573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f0291906145f9565b1015612f3a576040517fe2a575ba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506130e8565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa158015612fad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fd191906145f9565b9050612ff573ffffffffffffffffffffffffffffffffffffffff861688308c6132f1565b612fff8982614438565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8716906370a0823190602401602060405180830381865afa158015613069573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061308d91906145f9565b10156130c5576040517fd354452400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6130e673ffffffffffffffffffffffffffffffffffffffff8516888561244d565b505b50505050505050505050565b600065ffffffffffff82161561316a5762015180806131134285614535565b61311d919061465e565b6131279190614683565b9050600061313584836117f0565b60008181526008602052604090205490915060ff16613159576131598185846134d0565b61316486828761348d565b50612445565b61244573ffffffffffffffffffffffffffffffffffffffff8416868661244d565b60008281526008602052604090205460ff166131d3576040517fe94b8f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260086020908152604091829020825160a081018452815460ff80821615158352610100820473ffffffffffffffffffffffffffffffffffffffff1694830194909452750100000000000000000000000000000000000000000081049093169381019390935276010000000000000000000000000000000000000000000090910465ffffffffffff166060830181905260019091015460808301524210156132bb5760608101516040517f4fb1e97300000000000000000000000000000000000000000000000000000000815265ffffffffffff9091166004820152602401610732565b6132c63384846138ae565b60208101516132ec9073ffffffffffffffffffffffffffffffffffffffff16338461244d565b505050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017905291516000928392908816916133909190614728565b6000604051808303816000865af19150503d80600081146133cd576040519150601f19603f3d011682016040523d82523d6000602084013e6133d2565b606091505b50915091508180156133fc5750805115806133fc5750808060200190518101906133fc9190614612565b801561341f575060008673ffffffffffffffffffffffffffffffffffffffff163b115b613485576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5452414e534645525f46524f4d5f4641494c45440000000000000000000000006044820152606401610732565b505050505050565b600082815260086020526040812060010180548392906134ae908490614438565b925050819055506132ec838383604051806020016040528060008152506138e0565b60006134df620151808361465e565b6134ec9062015180614683565b9050428165ffffffffffff161015613530576040517fe94b8f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040518060a001604052806001151581526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156135ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135cf9190614b66565b60ff908116825265ffffffffffff8481166020808501829052600060409586018190528a81526008825285902086518154888401518989015160608b0151909716760100000000000000000000000000000000000000000000027fffffffff000000000000ffffffffffffffffffffffffffffffffffffffffffff97909816750100000000000000000000000000000000000000000002969096167fffffffff00000000000000ffffffffffffffffffffffffffffffffffffffffff73ffffffffffffffffffffffffffffffffffffffff978816610100027fffffffffffffffffffffff0000000000000000000000000000000000000000ff941515949094167fffffffffffffffffffffff0000000000000000000000000000000000000000009093169290921792909217161794909417845560809095015160019093019290925591518781529092918616917fd5a20d99fad8d4fec2eae3eb7d21c0bebeaecce7cf87b698ddba05071e7bde27910160405180910390a350505050565b60608160000361379157505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156137bb57806137a5816144fd565b91506137b49050600a83614744565b9150613795565b60008167ffffffffffffffff8111156137d6576137d6613c80565b6040519080825280601f01601f191660200182016040528015613800576020820181803683370190505b509050815b85156138a557613816600182614421565b90506000613825600a88614744565b61383090600a614b89565b61383a9088614421565b613845906030614bc6565b905060008160f81b905080848481518110613862576138626143c3565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061389c600a89614744565b97505050613805565b50949350505050565b600082815260086020526040812060010180548392906138cf908490614421565b909155506132ec9050838383613ae6565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260066020908152604080832086845290915281208054849290613920908490614438565b9091555050604080518481526020810184905273ffffffffffffffffffffffffffffffffffffffff86169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a473ffffffffffffffffffffffffffffffffffffffff84163b15613a60576040517ff23a6e61000000000000000000000000000000000000000000000000000000008082529073ffffffffffffffffffffffffffffffffffffffff86169063f23a6e61906139f59033906000908990899089906004016146d8565b6020604051808303816000875af1158015613a14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a3891906144e0565b7fffffffff000000000000000000000000000000000000000000000000000000001614613a7a565b73ffffffffffffffffffffffffffffffffffffffff841615155b613ae0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f554e534146455f524543495049454e54000000000000000000000000000000006044820152606401610732565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260066020908152604080832085845290915281208054839290613b26908490614421565b9091555050604080518381526020810183905260009173ffffffffffffffffffffffffffffffffffffffff86169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4505050565b73ffffffffffffffffffffffffffffffffffffffff81168114613ba857600080fd5b50565b8035613bb681613b86565b919050565b60008060408385031215613bce57600080fd5b8235613bd981613b86565b946020939093013593505050565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114613ba857600080fd5b600060208284031215613c2757600080fd5b8135612a4581613be7565b65ffffffffffff81168114613ba857600080fd5b600060208284031215613c5857600080fd5b8135612a4581613c32565b600060208284031215613c7557600080fd5b8135612a4581613b86565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613cf657613cf6613c80565b604052919050565b600067ffffffffffffffff821115613d1857613d18613c80565b5060051b60200190565b600082601f830112613d3357600080fd5b81356020613d48613d4383613cfe565b613caf565b82815260059290921b84018101918181019086841115613d6757600080fd5b8286015b84811015613d825780358352918301918301613d6b565b509695505050505050565b600067ffffffffffffffff821115613da757613da7613c80565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f830112613de457600080fd5b8135613df2613d4382613d8d565b818152846020838601011115613e0757600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215613e3c57600080fd5b8535613e4781613b86565b94506020860135613e5781613b86565b9350604086013567ffffffffffffffff80821115613e7457600080fd5b613e8089838a01613d22565b94506060880135915080821115613e9657600080fd5b613ea289838a01613d22565b93506080880135915080821115613eb857600080fd5b50613ec588828901613dd3565b9150509295509295909350565b60008060408385031215613ee557600080fd5b823567ffffffffffffffff811115613efc57600080fd5b8301601f81018513613f0d57600080fd5b80356020613f1d613d4383613cfe565b82815260059290921b83018101918181019088841115613f3c57600080fd5b938201935b83851015613f63578435613f5481613b86565b82529382019390820190613f41565b9550613f729050868201613bab565b93505050509250929050565b600060208284031215613f9057600080fd5b5035919050565b60005b83811015613fb2578181015183820152602001613f9a565b83811115613ae05750506000910152565b60008151808452613fdb816020860160208601613f97565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6040815260006140206040830185613fc3565b82810360208401526140328185613fc3565b95945050505050565b6000806040838503121561404e57600080fd5b823567ffffffffffffffff8082111561406657600080fd5b818501915085601f83011261407a57600080fd5b8135602061408a613d4383613cfe565b82815260059290921b840181019181810190898411156140a957600080fd5b948201945b838610156140d05785356140c181613b86565b825294820194908201906140ae565b965050860135925050808211156140e657600080fd5b506140f385828601613d22565b9150509250929050565b600081518084526020808501945080840160005b8381101561412d57815187529582019590820190600101614111565b509495945050505050565b602081526000612a4560208301846140fd565b600080600080600060a0868803121561416357600080fd5b853561416e81613b86565b9450602086013561417e81613b86565b94979496505050506040830135926060810135926080909101359150565b600080604083850312156141af57600080fd5b50508035926020909101359150565b600080604083850312156141d157600080fd5b82356141dc81613b86565b915060208301356141ec81613c32565b809150509250929050565b8015158114613ba857600080fd5b6000806040838503121561421857600080fd5b823561422381613b86565b915060208301356141ec816141f7565b60008060006060848603121561424857600080fd5b833561425381613b86565b9250602084013561426381613c32565b929592945050506040919091013590565b6000806040838503121561428757600080fd5b823561429281613b86565b915060208301356141ec81613b86565b60008083601f8401126142b457600080fd5b50813567ffffffffffffffff8111156142cc57600080fd5b6020830191508360208260051b85010111156142e757600080fd5b9250929050565b6000806000806040858703121561430457600080fd5b843567ffffffffffffffff8082111561431c57600080fd5b614328888389016142a2565b9096509450602087013591508082111561434157600080fd5b5061434e878288016142a2565b95989497509550505050565b600080600080600060a0868803121561437257600080fd5b853561437d81613b86565b9450602086013561438d81613b86565b93506040860135925060608601359150608086013567ffffffffffffffff8111156143b757600080fd5b613ec588828901613dd3565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015614433576144336143f2565b500390565b6000821982111561444b5761444b6143f2565b500190565b60408152600061446360408301856140fd565b828103602084015261403281856140fd565b600073ffffffffffffffffffffffffffffffffffffffff808816835280871660208401525060a060408301526144ae60a08301866140fd565b82810360608401526144c081866140fd565b905082810360808401526144d48185613fc3565b98975050505050505050565b6000602082840312156144f257600080fd5b8151612a4581613be7565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361452e5761452e6143f2565b5060010190565b600065ffffffffffff808316818516808303821115614556576145566143f2565b01949350505050565b60006020828403121561457157600080fd5b8151612a4581613b86565b60008060008060008060c0878903121561459557600080fd5b86516145a081613b86565b60208801519096506145b181613b86565b60408801519095506145c281613b86565b60608801519094506145d381613b86565b60808801519093506145e481613c32565b8092505060a087015190509295509295509295565b60006020828403121561460b57600080fd5b5051919050565b60006020828403121561462457600080fd5b8151612a45816141f7565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600065ffffffffffff808416806146775761467761462f565b92169190910492915050565b600065ffffffffffff808316818516818304811182151516156146a8576146a86143f2565b02949350505050565b600065ffffffffffff838116908316818110156146d0576146d06143f2565b039392505050565b600073ffffffffffffffffffffffffffffffffffffffff808816835280871660208401525084604083015283606083015260a0608083015261471d60a0830184613fc3565b979650505050505050565b6000825161473a818460208701613f97565b9190910192915050565b6000826147535761475361462f565b500490565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03841381151615614792576147926143f2565b827f80000000000000000000000000000000000000000000000000000000000000000384128116156147c6576147c66143f2565b50500190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60008413600084138583048511828216161561480d5761480d6143f2565b7f80000000000000000000000000000000000000000000000000000000000000006000871286820588128184161615614848576148486143f2565b60008712925087820587128484161615614864576148646143f2565b8785058712818416161561487a5761487a6143f2565b505050929093029392505050565b6000826148975761489761462f565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f8000000000000000000000000000000000000000000000000000000000000000831416156148eb576148eb6143f2565b500590565b6000808312837f80000000000000000000000000000000000000000000000000000000000000000183128115161561492a5761492a6143f2565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01831381161561495e5761495e6143f2565b50500390565b6000826149735761497361462f565b500690565b7f30000000000000000000000000000000000000000000000000000000000000008152600082516149b0816001850160208701613f97565b9190910160010192915050565b6000602082840312156149cf57600080fd5b815167ffffffffffffffff8111156149e657600080fd5b8201601f810184136149f757600080fd5b8051614a05613d4382613d8d565b818152856020838501011115614a1a57600080fd5b614032826020830160208601613f97565b60008551614a3d818460208a01613f97565b7f20000000000000000000000000000000000000000000000000000000000000009083019081528551614a77816001840160208a01613f97565b8082019150507f2d000000000000000000000000000000000000000000000000000000000000008060018301528551614ab7816002850160208a01613f97565b60029201918201528351614ad2816003840160208801613f97565b016003019695505050505050565b60008551614af2818460208a01613f97565b7f2d000000000000000000000000000000000000000000000000000000000000009083019081528551614b2c816001840160208a01613f97565b8551910190614b42816001840160208901613f97565b8451910190614b58816001840160208801613f97565b016001019695505050505050565b600060208284031215614b7857600080fd5b815160ff81168114612a4557600080fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614bc157614bc16143f2565b500290565b600060ff821660ff84168060ff03821115614be357614be36143f2565b01939250505056fea2646970667358221220564ca62e6b07d83bdeae6fd91597793929ddf3715f299e9c35de81f37c545f6464736f6c634300080f0033000000000000000000000000007bd11fca0daaeadd455b51826f9a015f2f0969000000000000000000000000007a66a2a13415db3613c1a4dd1c942a285902d1000000000000000000000000007bd11fca0daaeadd455b51826f9a015f2f0969000000000000000000000000007a0f48a4e3d74ab4234adf9ea9eb32f87b4b14

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101ce5760003560e01c80638da5cb5b11610104578063bf7e214f116100a2578063e70b9e2711610071578063e70b9e2714610566578063e985e9c514610591578063e9dc30f3146105bf578063f242432a146105d257600080fd5b8063bf7e214f14610501578063c23135dd14610521578063c6e38a4b14610549578063ccf288c61461055c57600080fd5b8063b0e21e8a116100de578063b0e21e8a146104a1578063b1e55529146104b3578063b7314ef9146104c6578063b88c9148146104ee57600080fd5b80638da5cb5b14610436578063925932771461047b578063a22cb4651461048e57600080fd5b806335312c85116101715780636de5b4cd1161014b5780636de5b4cd146103ce5780637a9e5e4b146103fd5780637cbc237314610410578063816909271461042357600080fd5b806335312c85146102b55780634e1273f4146102d65780636914db60146102f657600080fd5b80630d4dfc21116101ad5780630d4dfc211461026757806313af40351461027c5780632eb2c2d61461028f5780632f6fa94e146102a257600080fd5b8062fdd58e146101d357806301ffc9a71461021157806306692a3714610234575b600080fd5b6101fe6101e1366004613bbb565b600660209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b61022461021f366004613c15565b6105e5565b6040519015158152602001610208565b600454610250906601000000000000900465ffffffffffff1681565b60405165ffffffffffff9091168152602001610208565b61027a610275366004613c46565b6106ca565b005b61027a61028a366004613c63565b6107ce565b61027a61029d366004613e24565b6108d2565b61027a6102b0366004613ed2565b610cdd565b6102c86102c3366004613f7e565b610e10565b60405161020892919061400d565b6102e96102e436600461403b565b610eca565b6040516102089190614138565b610380610304366004613f7e565b6008602052600090815260409020805460019091015460ff80831692610100810473ffffffffffffffffffffffffffffffffffffffff1692750100000000000000000000000000000000000000000082049092169176010000000000000000000000000000000000000000000090910465ffffffffffff169085565b60408051951515865273ffffffffffffffffffffffffffffffffffffffff909416602086015260ff9092169284019290925265ffffffffffff9091166060830152608082015260a001610208565b6103e16103dc36600461414b565b61103a565b6040805192835265ffffffffffff909116602083015201610208565b61027a61040b366004613c63565b6114f1565b61027a61041e36600461419c565b61164e565b61027a610431366004613c46565b6116d1565b6000546104569073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610208565b6101fe6104893660046141be565b6117f0565b61027a61049c366004614205565b6118a5565b6004546102509065ffffffffffff1681565b61027a6104c1366004613c46565b61193c565b6104d96104d4366004614233565b611a4d565b60408051928352602083019190915201610208565b6102506104fc366004613c63565b611e3d565b6001546104569073ffffffffffffffffffffffffffffffffffffffff1681565b61025061052f366004613c63565b60036020526000908152604090205465ffffffffffff1681565b6101fe6105573660046141be565b611e7b565b610250620186a081565b6101fe610574366004614274565b600560209081526000928352604080842090915290825290205481565b61022461059f366004614274565b600760209081526000928352604080842090915290825290205460ff1681565b61027a6105cd3660046142ee565b611f29565b61027a6105e036600461435a565b612035565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316148061067857507fd9b67a26000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b806106c457507f0e89341c000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60025460011461073b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e43590000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6002805561138865ffffffffffff82161115610783576040517fe94b8f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260036020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000001665ffffffffffff929092169190911790556001600255565b6107fc336000357fffffffff000000000000000000000000000000000000000000000000000000001661233c565b610862576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152606401610732565b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b82518251811461093e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f4c454e4754485f4d49534d4154434800000000000000000000000000000000006044820152606401610732565b3373ffffffffffffffffffffffffffffffffffffffff87161480610992575073ffffffffffffffffffffffffffffffffffffffff8616600090815260076020908152604080832033845290915290205460ff165b6109f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4e4f545f415554484f52495a45440000000000000000000000000000000000006044820152606401610732565b60008060005b83811015610af057868181518110610a1857610a186143c3565b60200260200101519250858181518110610a3457610a346143c3565b6020026020010151915081600660008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008581526020019081526020016000206000828254610a9e9190614421565b909155505073ffffffffffffffffffffffffffffffffffffffff8816600090815260066020908152604080832086845290915281208054849290610ae3908490614438565b90915550506001016109fe565b508673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8989604051610b67929190614450565b60405180910390a473ffffffffffffffffffffffffffffffffffffffff87163b15610c53576040517fbc197c81000000000000000000000000000000000000000000000000000000008082529073ffffffffffffffffffffffffffffffffffffffff89169063bc197c8190610be89033908d908c908c908c90600401614475565b6020604051808303816000875af1158015610c07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2b91906144e0565b7fffffffff000000000000000000000000000000000000000000000000000000001614610c6d565b73ffffffffffffffffffffffffffffffffffffffff871615155b610cd3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f554e534146455f524543495049454e54000000000000000000000000000000006044820152606401610732565b5050505050505050565b600254600114610d49576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e4359000000000000000000000000000000000000000000006044820152606401610732565b60028055815160005b81811015610e05576000848281518110610d6e57610d6e6143c3565b60209081029190910181015133600090815260058352604080822073ffffffffffffffffffffffffffffffffffffffff8416835290935291909120549091508015610df25733600090815260056020908152604080832073ffffffffffffffffffffffffffffffffffffffff86168085529252822091909155610df290868361244d565b505080610dfe906144fd565b9050610d52565b505060016002555050565b6000818152600860209081526040808320815160a081018352815460ff80821615158352610100820473ffffffffffffffffffffffffffffffffffffffff1695830186905275010000000000000000000000000000000000000000008204169382019390935276010000000000000000000000000000000000000000000090920465ffffffffffff16606080840182905260019092015460808401529093849390918291610ebd916125d9565b9097909650945050505050565b81518151606091908114610f3a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f4c454e4754485f4d49534d4154434800000000000000000000000000000000006044820152606401610732565b8067ffffffffffffffff811115610f5357610f53613c80565b604051908082528060200260200182016040528015610f7c578160200160208202803683370190505b50915060005b818110156110325760066000868381518110610fa057610fa06143c3565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858381518110610ff657610ff66143c3565b602002602001015181526020019081526020016000205483828151811061101f5761101f6143c3565b6020908102919091010152600101610f82565b505092915050565b6000806002546001146110a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e4359000000000000000000000000000000000000000000006044820152606401610732565b6002805573ffffffffffffffffffffffffffffffffffffffff861660009081526003602052604081205481908190819081906110f2908a9065ffffffffffff16620186a061297a565b73ffffffffffffffffffffffffffffffffffffffff8c166000908152600360205260408120546004549293509091839161114e9161113b9165ffffffffffff9081169116614535565b8c9065ffffffffffff16620186a061297a565b6111589190614421565b6040517f52047942000000000000000000000000000000000000000000000000000000008152600481018d905290915060009073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000007a66a2a13415db3613c1a4dd1c942a285902d11690635204794290602401602060405180830381865afa1580156111e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120d919061455f565b6040517facc5570c000000000000000000000000000000000000000000000000000000008152600481018e905290915060009073ffffffffffffffffffffffffffffffffffffffff83169063acc5570c9060240160c060405180830381865afa15801561127e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a2919061457c565b50919b509950975090915060009050836112bc868f614421565b6112c69190614421565b90508273ffffffffffffffffffffffffffffffffffffffff1663e007fa978f838f6040518463ffffffff1660e01b8152600401611316939291909283526020830191909152604082015260600190565b6020604051808303816000875af1158015611335573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135991906145f9565b955050505081600560008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546113ea9190614438565b909155505073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000007bd11fca0daaeadd455b51826f9a015f2f09698116600090815260056020908152604080832093891683529290529081208054839290611453908490614438565b9091555061146e90508b8b856114698587614438565b612a4c565b600061147c8e8589886130f4565b90508c73ffffffffffffffffffffffffffffffffffffffff168c7f3ae5efadaccde413bdfcb3a4626babecd844c502ee4c2c9b340f28cd9d5527328d876040516114d0929190918252602082015260400190565b60405180910390a36001600255929d929c50919a5050505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314806115d457506001546040517fb70096130000000000000000000000000000000000000000000000000000000081523360048201523060248201526000357fffffffff0000000000000000000000000000000000000000000000000000000016604482015273ffffffffffffffffffffffffffffffffffffffff9091169063b700961390606401602060405180830381865afa1580156115b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d49190614612565b6115dd57600080fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831690811790915560405133907fa3396fd7f6e0a21b50e5089d2da70d5ac0a3bbbd1f617a93f134b7638998019890600090a350565b6002546001146116ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e4359000000000000000000000000000000000000000000006044820152606401610732565b600280556116c8828261318b565b50506001600255565b6116ff336000357fffffffff000000000000000000000000000000000000000000000000000000001661233c565b611765576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152606401610732565b60045465ffffffffffff90811690821611156117ad576040517fe94b8f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805465ffffffffffff9092166601000000000000027fffffffffffffffffffffffffffffffffffffffff000000000000ffffffffffff909216919091179055565b60008083611801620151808561465e565b60405160200161186792919060609290921b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016825260d01b7fffffffffffff0000000000000000000000000000000000000000000000000000166014820152601a0190565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00181529190528051602090910120949350505050565b33600081815260076020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61196a336000357fffffffff000000000000000000000000000000000000000000000000000000001661233c565b6119d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152606401610732565b6113888165ffffffffffff161115611a14576040517fe94b8f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600480547fffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000001665ffffffffffff92909216919091179055565b600080600254600114611abc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e4359000000000000000000000000000000000000000000006044820152606401610732565b600280556000611acf620151808661465e565b611adc9062015180614683565b9050428165ffffffffffff161015611b20576040517fe94b8f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611b2c87836117f0565b60008181526008602052604090205490915060ff16611b9d576040517fcb66c9db00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8816600482015265ffffffffffff83166024820152604401610732565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8916906370a0823190602401602060405180830381865afa158015611c0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c2e91906145f9565b9050611c5273ffffffffffffffffffffffffffffffffffffffff89163330896132f1565b611c5c8682614438565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8a16906370a0823190602401602060405180830381865afa158015611cc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cea91906145f9565b1015611d22576040517fd354452400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60045465ffffffffffff66010000000000008204811691161115611e1657600454600090611d7b90611d689065ffffffffffff66010000000000008204811691166146b1565b889065ffffffffffff16620186a061297a565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000007bd11fca0daaeadd455b51826f9a015f2f096981166000908152600560209081526040808320938e16835292905290812080549293508392909190611de4908490614438565b90915550611dfe90503384611df9848b614421565b61348d565b82611e098289614421565b9550955050505050611e2e565b611e2133838861348d565b509250839150611e2e9050565b60016002559094909350915050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600360205260408120546004546106c49165ffffffffffff9081169116614535565b6000600254600114611ee9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e4359000000000000000000000000000000000000000000006044820152606401610732565b600280556000611ef984846117f0565b60008181526008602052604090205490915060ff16611f1d57611f1d8185856134d0565b60016002559392505050565b600254600114611f95576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e4359000000000000000000000000000000000000000000006044820152606401610732565b6002805582818114611fd3576040517fe94b8f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8181101561202857612018868683818110611ff357611ff36143c3565b9050602002013585858481811061200c5761200c6143c3565b9050602002013561318b565b612021816144fd565b9050611fd6565b5050600160025550505050565b3373ffffffffffffffffffffffffffffffffffffffff86161480612089575073ffffffffffffffffffffffffffffffffffffffff8516600090815260076020908152604080832033845290915290205460ff165b6120ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4e4f545f415554484f52495a45440000000000000000000000000000000000006044820152606401610732565b73ffffffffffffffffffffffffffffffffffffffff851660009081526006602090815260408083208684529091528120805484929061212f908490614421565b909155505073ffffffffffffffffffffffffffffffffffffffff8416600090815260066020908152604080832086845290915281208054849290612174908490614438565b9091555050604080518481526020810184905273ffffffffffffffffffffffffffffffffffffffff808716929088169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a473ffffffffffffffffffffffffffffffffffffffff84163b156122b5576040517ff23a6e61000000000000000000000000000000000000000000000000000000008082529073ffffffffffffffffffffffffffffffffffffffff86169063f23a6e619061224a9033908a908990899089906004016146d8565b6020604051808303816000875af1158015612269573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061228d91906144e0565b7fffffffff0000000000000000000000000000000000000000000000000000000016146122cf565b73ffffffffffffffffffffffffffffffffffffffff841615155b612335576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f554e534146455f524543495049454e54000000000000000000000000000000006044820152606401610732565b5050505050565b60015460009073ffffffffffffffffffffffffffffffffffffffff16801580159061242057506040517fb700961300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301523060248301527fffffffff000000000000000000000000000000000000000000000000000000008516604483015282169063b700961390606401602060405180830381865afa1580156123fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124209190614612565b80612445575060005473ffffffffffffffffffffffffffffffffffffffff8581169116145b949350505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905291516000928392908716916124e49190614728565b6000604051808303816000865af19150503d8060008114612521576040519150601f19603f3d011682016040523d82523d6000602084013e612526565b606091505b50915091508180156125505750805115806125505750808060200190518101906125509190614612565b8015612573575060008573ffffffffffffffffffffffffffffffffffffffff163b115b612335576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5452414e534645525f4641494c454400000000000000000000000000000000006044820152606401610732565b60608060008080806125ee6201518088614744565b905060006125ff8262010bd9614758565b61260c9062253d8c614758565b9050600062023ab161261f8360046147cc565b6126299190614888565b9050600461263a8262023ab16147cc565b612645906003614758565b61264f9190614888565b61265990836148f0565b9150600062164b0961266c846001614758565b61267890610fa06147cc565b6126829190614888565b90506004612692826105b56147cc565b61269c9190614888565b6126a690846148f0565b6126b190601f614758565b9250600061098f6126c38560506147cc565b6126cd9190614888565b9050600060506126df8361098f6147cc565b6126e99190614888565b6126f390866148f0565b9050612700600b83614888565b945061270d85600c6147cc565b612718836002614758565b61272291906148f0565b915084836127316031876148f0565b61273c9060646147cc565b6127469190614758565b6127509190614758565b985090965094506000935061277592506127709150612710905086614964565b61374e565b90506000600a841061278f5761278a8461374e565b6127b8565b6127988461374e565b6040516020016127a89190614978565b6040516020818303038152906040525b90506000600a84106127d2576127cd8461374e565b6127fb565b6127db8461374e565b6040516020016127eb9190614978565b6040516020818303038152906040525b90508973ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa158015612848573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261288e91908101906149bd565b8383836040516020016128a49493929190614a2b565b60405160208183030381529060405297508973ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015612900573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261294691908101906149bd565b83838360405160200161295c9493929190614ae0565b60405160208183030381529060405296505050505050509250929050565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff858709858702925082811083820303915050806000036129d157600084116129c657600080fd5b508290049050612a45565b8084116129dd57600080fd5b600084868809851960019081018716968790049682860381900495909211909303600082900391909104909201919091029190911760038402600290811880860282030280860282030280860282030280860282030280860282030280860290910302029150505b9392505050565b6000806000807f000000000000000000000000007a66a2a13415db3613c1a4dd1c942a285902d173ffffffffffffffffffffffffffffffffffffffff166352047942896040518263ffffffff1660e01b8152600401612aad91815260200190565b602060405180830381865afa158015612aca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aee919061455f565b73ffffffffffffffffffffffffffffffffffffffff1663acc5570c896040518263ffffffff1660e01b8152600401612b2891815260200190565b60c060405180830381865afa158015612b45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b69919061457c565b5050935093509350935060008588612b819190614421565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290915060009073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015612bf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c1591906145f9565b9050612c3973ffffffffffffffffffffffffffffffffffffffff841633308c6132f1565b612c438982614438565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8516906370a0823190602401602060405180830381865afa158015612cad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cd191906145f9565b1015612d09576040517fd354452400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff851615612f4057612d4673ffffffffffffffffffffffffffffffffffffffff8416868461244d565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa158015612db3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dd791906145f9565b6040517f4b9de77c000000000000000000000000000000000000000000000000000000008152600481018d905260248101859052604481018b905290915073ffffffffffffffffffffffffffffffffffffffff871690634b9de77c90606401600060405180830381600087803b158015612e5057600080fd5b505af1158015612e64573d6000803e3d6000fd5b505050508881612e749190614438565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8716906370a0823190602401602060405180830381865afa158015612ede573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f0291906145f9565b1015612f3a576040517fe2a575ba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506130e8565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa158015612fad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fd191906145f9565b9050612ff573ffffffffffffffffffffffffffffffffffffffff861688308c6132f1565b612fff8982614438565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8716906370a0823190602401602060405180830381865afa158015613069573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061308d91906145f9565b10156130c5576040517fd354452400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6130e673ffffffffffffffffffffffffffffffffffffffff8516888561244d565b505b50505050505050505050565b600065ffffffffffff82161561316a5762015180806131134285614535565b61311d919061465e565b6131279190614683565b9050600061313584836117f0565b60008181526008602052604090205490915060ff16613159576131598185846134d0565b61316486828761348d565b50612445565b61244573ffffffffffffffffffffffffffffffffffffffff8416868661244d565b60008281526008602052604090205460ff166131d3576040517fe94b8f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260086020908152604091829020825160a081018452815460ff80821615158352610100820473ffffffffffffffffffffffffffffffffffffffff1694830194909452750100000000000000000000000000000000000000000081049093169381019390935276010000000000000000000000000000000000000000000090910465ffffffffffff166060830181905260019091015460808301524210156132bb5760608101516040517f4fb1e97300000000000000000000000000000000000000000000000000000000815265ffffffffffff9091166004820152602401610732565b6132c63384846138ae565b60208101516132ec9073ffffffffffffffffffffffffffffffffffffffff16338461244d565b505050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017905291516000928392908816916133909190614728565b6000604051808303816000865af19150503d80600081146133cd576040519150601f19603f3d011682016040523d82523d6000602084013e6133d2565b606091505b50915091508180156133fc5750805115806133fc5750808060200190518101906133fc9190614612565b801561341f575060008673ffffffffffffffffffffffffffffffffffffffff163b115b613485576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5452414e534645525f46524f4d5f4641494c45440000000000000000000000006044820152606401610732565b505050505050565b600082815260086020526040812060010180548392906134ae908490614438565b925050819055506132ec838383604051806020016040528060008152506138e0565b60006134df620151808361465e565b6134ec9062015180614683565b9050428165ffffffffffff161015613530576040517fe94b8f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040518060a001604052806001151581526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156135ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135cf9190614b66565b60ff908116825265ffffffffffff8481166020808501829052600060409586018190528a81526008825285902086518154888401518989015160608b0151909716760100000000000000000000000000000000000000000000027fffffffff000000000000ffffffffffffffffffffffffffffffffffffffffffff97909816750100000000000000000000000000000000000000000002969096167fffffffff00000000000000ffffffffffffffffffffffffffffffffffffffffff73ffffffffffffffffffffffffffffffffffffffff978816610100027fffffffffffffffffffffff0000000000000000000000000000000000000000ff941515949094167fffffffffffffffffffffff0000000000000000000000000000000000000000009093169290921792909217161794909417845560809095015160019093019290925591518781529092918616917fd5a20d99fad8d4fec2eae3eb7d21c0bebeaecce7cf87b698ddba05071e7bde27910160405180910390a350505050565b60608160000361379157505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156137bb57806137a5816144fd565b91506137b49050600a83614744565b9150613795565b60008167ffffffffffffffff8111156137d6576137d6613c80565b6040519080825280601f01601f191660200182016040528015613800576020820181803683370190505b509050815b85156138a557613816600182614421565b90506000613825600a88614744565b61383090600a614b89565b61383a9088614421565b613845906030614bc6565b905060008160f81b905080848481518110613862576138626143c3565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061389c600a89614744565b97505050613805565b50949350505050565b600082815260086020526040812060010180548392906138cf908490614421565b909155506132ec9050838383613ae6565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260066020908152604080832086845290915281208054849290613920908490614438565b9091555050604080518481526020810184905273ffffffffffffffffffffffffffffffffffffffff86169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a473ffffffffffffffffffffffffffffffffffffffff84163b15613a60576040517ff23a6e61000000000000000000000000000000000000000000000000000000008082529073ffffffffffffffffffffffffffffffffffffffff86169063f23a6e61906139f59033906000908990899089906004016146d8565b6020604051808303816000875af1158015613a14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a3891906144e0565b7fffffffff000000000000000000000000000000000000000000000000000000001614613a7a565b73ffffffffffffffffffffffffffffffffffffffff841615155b613ae0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f554e534146455f524543495049454e54000000000000000000000000000000006044820152606401610732565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260066020908152604080832085845290915281208054839290613b26908490614421565b9091555050604080518381526020810183905260009173ffffffffffffffffffffffffffffffffffffffff86169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4505050565b73ffffffffffffffffffffffffffffffffffffffff81168114613ba857600080fd5b50565b8035613bb681613b86565b919050565b60008060408385031215613bce57600080fd5b8235613bd981613b86565b946020939093013593505050565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114613ba857600080fd5b600060208284031215613c2757600080fd5b8135612a4581613be7565b65ffffffffffff81168114613ba857600080fd5b600060208284031215613c5857600080fd5b8135612a4581613c32565b600060208284031215613c7557600080fd5b8135612a4581613b86565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613cf657613cf6613c80565b604052919050565b600067ffffffffffffffff821115613d1857613d18613c80565b5060051b60200190565b600082601f830112613d3357600080fd5b81356020613d48613d4383613cfe565b613caf565b82815260059290921b84018101918181019086841115613d6757600080fd5b8286015b84811015613d825780358352918301918301613d6b565b509695505050505050565b600067ffffffffffffffff821115613da757613da7613c80565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f830112613de457600080fd5b8135613df2613d4382613d8d565b818152846020838601011115613e0757600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215613e3c57600080fd5b8535613e4781613b86565b94506020860135613e5781613b86565b9350604086013567ffffffffffffffff80821115613e7457600080fd5b613e8089838a01613d22565b94506060880135915080821115613e9657600080fd5b613ea289838a01613d22565b93506080880135915080821115613eb857600080fd5b50613ec588828901613dd3565b9150509295509295909350565b60008060408385031215613ee557600080fd5b823567ffffffffffffffff811115613efc57600080fd5b8301601f81018513613f0d57600080fd5b80356020613f1d613d4383613cfe565b82815260059290921b83018101918181019088841115613f3c57600080fd5b938201935b83851015613f63578435613f5481613b86565b82529382019390820190613f41565b9550613f729050868201613bab565b93505050509250929050565b600060208284031215613f9057600080fd5b5035919050565b60005b83811015613fb2578181015183820152602001613f9a565b83811115613ae05750506000910152565b60008151808452613fdb816020860160208601613f97565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6040815260006140206040830185613fc3565b82810360208401526140328185613fc3565b95945050505050565b6000806040838503121561404e57600080fd5b823567ffffffffffffffff8082111561406657600080fd5b818501915085601f83011261407a57600080fd5b8135602061408a613d4383613cfe565b82815260059290921b840181019181810190898411156140a957600080fd5b948201945b838610156140d05785356140c181613b86565b825294820194908201906140ae565b965050860135925050808211156140e657600080fd5b506140f385828601613d22565b9150509250929050565b600081518084526020808501945080840160005b8381101561412d57815187529582019590820190600101614111565b509495945050505050565b602081526000612a4560208301846140fd565b600080600080600060a0868803121561416357600080fd5b853561416e81613b86565b9450602086013561417e81613b86565b94979496505050506040830135926060810135926080909101359150565b600080604083850312156141af57600080fd5b50508035926020909101359150565b600080604083850312156141d157600080fd5b82356141dc81613b86565b915060208301356141ec81613c32565b809150509250929050565b8015158114613ba857600080fd5b6000806040838503121561421857600080fd5b823561422381613b86565b915060208301356141ec816141f7565b60008060006060848603121561424857600080fd5b833561425381613b86565b9250602084013561426381613c32565b929592945050506040919091013590565b6000806040838503121561428757600080fd5b823561429281613b86565b915060208301356141ec81613b86565b60008083601f8401126142b457600080fd5b50813567ffffffffffffffff8111156142cc57600080fd5b6020830191508360208260051b85010111156142e757600080fd5b9250929050565b6000806000806040858703121561430457600080fd5b843567ffffffffffffffff8082111561431c57600080fd5b614328888389016142a2565b9096509450602087013591508082111561434157600080fd5b5061434e878288016142a2565b95989497509550505050565b600080600080600060a0868803121561437257600080fd5b853561437d81613b86565b9450602086013561438d81613b86565b93506040860135925060608601359150608086013567ffffffffffffffff8111156143b757600080fd5b613ec588828901613dd3565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015614433576144336143f2565b500390565b6000821982111561444b5761444b6143f2565b500190565b60408152600061446360408301856140fd565b828103602084015261403281856140fd565b600073ffffffffffffffffffffffffffffffffffffffff808816835280871660208401525060a060408301526144ae60a08301866140fd565b82810360608401526144c081866140fd565b905082810360808401526144d48185613fc3565b98975050505050505050565b6000602082840312156144f257600080fd5b8151612a4581613be7565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361452e5761452e6143f2565b5060010190565b600065ffffffffffff808316818516808303821115614556576145566143f2565b01949350505050565b60006020828403121561457157600080fd5b8151612a4581613b86565b60008060008060008060c0878903121561459557600080fd5b86516145a081613b86565b60208801519096506145b181613b86565b60408801519095506145c281613b86565b60608801519094506145d381613b86565b60808801519093506145e481613c32565b8092505060a087015190509295509295509295565b60006020828403121561460b57600080fd5b5051919050565b60006020828403121561462457600080fd5b8151612a45816141f7565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600065ffffffffffff808416806146775761467761462f565b92169190910492915050565b600065ffffffffffff808316818516818304811182151516156146a8576146a86143f2565b02949350505050565b600065ffffffffffff838116908316818110156146d0576146d06143f2565b039392505050565b600073ffffffffffffffffffffffffffffffffffffffff808816835280871660208401525084604083015283606083015260a0608083015261471d60a0830184613fc3565b979650505050505050565b6000825161473a818460208701613f97565b9190910192915050565b6000826147535761475361462f565b500490565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03841381151615614792576147926143f2565b827f80000000000000000000000000000000000000000000000000000000000000000384128116156147c6576147c66143f2565b50500190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60008413600084138583048511828216161561480d5761480d6143f2565b7f80000000000000000000000000000000000000000000000000000000000000006000871286820588128184161615614848576148486143f2565b60008712925087820587128484161615614864576148646143f2565b8785058712818416161561487a5761487a6143f2565b505050929093029392505050565b6000826148975761489761462f565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f8000000000000000000000000000000000000000000000000000000000000000831416156148eb576148eb6143f2565b500590565b6000808312837f80000000000000000000000000000000000000000000000000000000000000000183128115161561492a5761492a6143f2565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01831381161561495e5761495e6143f2565b50500390565b6000826149735761497361462f565b500690565b7f30000000000000000000000000000000000000000000000000000000000000008152600082516149b0816001850160208701613f97565b9190910160010192915050565b6000602082840312156149cf57600080fd5b815167ffffffffffffffff8111156149e657600080fd5b8201601f810184136149f757600080fd5b8051614a05613d4382613d8d565b818152856020838501011115614a1a57600080fd5b614032826020830160208601613f97565b60008551614a3d818460208a01613f97565b7f20000000000000000000000000000000000000000000000000000000000000009083019081528551614a77816001840160208a01613f97565b8082019150507f2d000000000000000000000000000000000000000000000000000000000000008060018301528551614ab7816002850160208a01613f97565b60029201918201528351614ad2816003840160208801613f97565b016003019695505050505050565b60008551614af2818460208a01613f97565b7f2d000000000000000000000000000000000000000000000000000000000000009083019081528551614b2c816001840160208a01613f97565b8551910190614b42816001840160208901613f97565b8451910190614b58816001840160208801613f97565b016001019695505050505050565b600060208284031215614b7857600080fd5b815160ff81168114612a4557600080fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614bc157614bc16143f2565b500290565b600060ff821660ff84168060ff03821115614be357614be36143f2565b01939250505056fea2646970667358221220564ca62e6b07d83bdeae6fd91597793929ddf3715f299e9c35de81f37c545f6464736f6c634300080f0033

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

000000000000000000000000007bd11fca0daaeadd455b51826f9a015f2f0969000000000000000000000000007a66a2a13415db3613c1a4dd1c942a285902d1000000000000000000000000007bd11fca0daaeadd455b51826f9a015f2f0969000000000000000000000000007a0f48a4e3d74ab4234adf9ea9eb32f87b4b14

-----Decoded View---------------
Arg [0] : protocol_ (address): 0x007BD11FCa0dAaeaDD455b51826F9a015f2f0969
Arg [1] : aggregator_ (address): 0x007A66A2a13415DB3613C1a4dd1C942A285902d1
Arg [2] : guardian_ (address): 0x007BD11FCa0dAaeaDD455b51826F9a015f2f0969
Arg [3] : authority_ (address): 0x007A0F48A4e3d74Ab4234adf9eA9EB32f87b4b14

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000007bd11fca0daaeadd455b51826f9a015f2f0969
Arg [1] : 000000000000000000000000007a66a2a13415db3613c1a4dd1c942a285902d1
Arg [2] : 000000000000000000000000007bd11fca0daaeadd455b51826f9a015f2f0969
Arg [3] : 000000000000000000000000007a0f48a4e3d74ab4234adf9ea9eb32f87b4b14


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.