Contract 0x0697B0a2cBb1F947f51a9845b715E9eAb3f89B4F

 
Txn Hash
Method
Block
From
To
Value
0xe37ea04ec98270584c9451a77879718a783bd0f032ca0ee71120d3bf94a1a90eTransfer Ownersh...138621442021-12-23 15:09:42228 days 13 hrs ago0xafd0659e7993bd4d820f17a2bb2e79205feaf9b9 IN  0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f0 Ether0.00423796 88.78293051
0x9e1d6410ad88b5a7a2fa34b619da6868dd9d16c8a2e2e44de4a36f5b0dd6b1e70x61030060137788232021-12-10 17:46:44241 days 11 hrs ago0xafd0659e7993bd4d820f17a2bb2e79205feaf9b9 IN  Create: LidoTempusPool0 Ether0.57500116 112.55914041
[ Download CSV Export 
Latest 22 internal transactions
Parent Txn Hash Block From To Value
0x94debd80029090ed0a48b7ad74f4555f276486e112c94f820d3ca8cc6282fd11150456562022-06-29 15:29:2540 days 13 hrs ago 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f Lido: stETH Token0.00001 Ether
0x94debd80029090ed0a48b7ad74f4555f276486e112c94f820d3ca8cc6282fd11150456562022-06-29 15:29:2540 days 13 hrs ago 0xdb5fd0678eed82246b599da6bc36b56157e4bed8 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f0.00001 Ether
0x547f14e132d69237edb1e5f31ecd4a524215a8c0a27dab8de6f714124da36a78147872572022-05-16 16:17:3284 days 12 hrs ago 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f Lido: stETH Token0.001 Ether
0x547f14e132d69237edb1e5f31ecd4a524215a8c0a27dab8de6f714124da36a78147872572022-05-16 16:17:3284 days 12 hrs ago 0xdb5fd0678eed82246b599da6bc36b56157e4bed8 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f0.001 Ether
0x053a46d0863a6cdf63cda01aa30be975aaab410926f116160891a4c0f6fa7bb3140318272022-01-18 20:55:36202 days 8 hrs ago 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f Lido: stETH Token36 Ether
0x053a46d0863a6cdf63cda01aa30be975aaab410926f116160891a4c0f6fa7bb3140318272022-01-18 20:55:36202 days 8 hrs ago 0xdb5fd0678eed82246b599da6bc36b56157e4bed8 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f36 Ether
0xd77a4afe763dc8ffb4b56a70b0ba7cf81c36b09369daffe08ab7173a89b22f96139092612021-12-30 21:56:53221 days 7 hrs ago 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f Lido: stETH Token0.13 Ether
0xd77a4afe763dc8ffb4b56a70b0ba7cf81c36b09369daffe08ab7173a89b22f96139092612021-12-30 21:56:53221 days 7 hrs ago 0xdb5fd0678eed82246b599da6bc36b56157e4bed8 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f0.13 Ether
0x008e26c719f581c2a31af8b4d77b1d55c63184b3763e6a483d02de7cc3d8f8f6138132692021-12-16 1:32:02236 days 3 hrs ago 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f Lido: stETH Token0.20069918 Ether
0x008e26c719f581c2a31af8b4d77b1d55c63184b3763e6a483d02de7cc3d8f8f6138132692021-12-16 1:32:02236 days 3 hrs ago 0xdb5fd0678eed82246b599da6bc36b56157e4bed8 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f0.20069918 Ether
0x8d5d537931302aab9086ec84f9b091f96ae42de83ba14ff0c7816e19edeb2b11138038752021-12-14 14:39:06237 days 14 hrs ago 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f Lido: stETH Token0.1 Ether
0x8d5d537931302aab9086ec84f9b091f96ae42de83ba14ff0c7816e19edeb2b11138038752021-12-14 14:39:06237 days 14 hrs ago 0xdb5fd0678eed82246b599da6bc36b56157e4bed8 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f0.1 Ether
0xa8386b43704b9fe21856f2fe3615b55ed6731275c1ae651aad78cea0699d1820138038142021-12-14 14:26:17237 days 14 hrs ago 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f Lido: stETH Token0.2 Ether
0xa8386b43704b9fe21856f2fe3615b55ed6731275c1ae651aad78cea0699d1820138038142021-12-14 14:26:17237 days 14 hrs ago 0xdb5fd0678eed82246b599da6bc36b56157e4bed8 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f0.2 Ether
0x7dcb6d9d0f5fa32b0188ccce5fbd4df254eda3d0bfe1bec3eac0fd5120d794a1138035802021-12-14 13:32:29237 days 15 hrs ago 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f Lido: stETH Token7.2 Ether
0x7dcb6d9d0f5fa32b0188ccce5fbd4df254eda3d0bfe1bec3eac0fd5120d794a1138035802021-12-14 13:32:29237 days 15 hrs ago 0xdb5fd0678eed82246b599da6bc36b56157e4bed8 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f7.2 Ether
0x4035b8ab5abe6942cf9dd92d53c9129709ea1e2c7bf83e0dcdad30a33ff2df46137974742021-12-13 14:48:43238 days 14 hrs ago 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f Lido: stETH Token201 Ether
0x4035b8ab5abe6942cf9dd92d53c9129709ea1e2c7bf83e0dcdad30a33ff2df46137974742021-12-13 14:48:43238 days 14 hrs ago 0xdb5fd0678eed82246b599da6bc36b56157e4bed8 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f201 Ether
0x5cdda03191460866b48bff5e6c835bbebe7f9a80b0e626af9e06e3ec688fdc3b137971822021-12-13 13:44:12238 days 15 hrs ago 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f Lido: stETH Token1.1 Ether
0x5cdda03191460866b48bff5e6c835bbebe7f9a80b0e626af9e06e3ec688fdc3b137971822021-12-13 13:44:12238 days 15 hrs ago 0xdb5fd0678eed82246b599da6bc36b56157e4bed8 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f1.1 Ether
0x9e1d6410ad88b5a7a2fa34b619da6868dd9d16c8a2e2e44de4a36f5b0dd6b1e7137788232021-12-10 17:46:44241 days 11 hrs ago 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f  Contract Creation0 Ether
0x9e1d6410ad88b5a7a2fa34b619da6868dd9d16c8a2e2e44de4a36f5b0dd6b1e7137788232021-12-10 17:46:44241 days 11 hrs ago 0x0697b0a2cbb1f947f51a9845b715e9eab3f89b4f  Contract Creation0 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LidoTempusPool

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 100000 runs

Other Settings:
default evmVersion
File 1 of 22 : LidoTempusPool.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.10;

import "../TempusPool.sol";
import "../protocols/lido/ILido.sol";

contract LidoTempusPool is TempusPool {
    ILido internal immutable lido;
    bytes32 public constant override protocolName = "Lido";
    address private immutable referrer;

    constructor(
        ILido token,
        address controller,
        uint256 maturity,
        uint256 estYield,
        TokenData memory principalsData,
        TokenData memory yieldsData,
        FeesConfig memory maxFeeSetup,
        address referrerAddress
    )
        TempusPool(
            address(token),
            address(0),
            controller,
            maturity,
            token.getPooledEthByShares(1e18),
            1e18,
            estYield,
            principalsData,
            yieldsData,
            maxFeeSetup
        )
    {
        lido = token;
        referrer = referrerAddress;
    }

    function depositToUnderlying(uint256 amount) internal override returns (uint256) {
        // Enforced by the controller
        assert(msg.value == amount);

        uint256 preDepositBalance = IERC20(yieldBearingToken).balanceOf(address(this));
        lido.submit{value: msg.value}(referrer);

        uint256 mintedTokens = IERC20(yieldBearingToken).balanceOf(address(this)) - preDepositBalance;
        return mintedTokens;
    }

    function withdrawFromUnderlyingProtocol(uint256, address) internal pure override returns (uint256) {
        require(false, "LidoTempusPool.withdrawFromUnderlyingProtocol not supported");
        return 0;
    }

    /// @return Updated current Interest Rate as an 1e18 decimal
    function updateInterestRate() internal view override returns (uint256) {
        return lido.getPooledEthByShares(1e18);
    }

    /// @return Stored Interest Rate as an 1e18 decimal
    function currentInterestRate() public view override returns (uint256) {
        // NOTE: if totalShares() is 0, then rate is also 0,
        //       but this only happens right after deploy, so we ignore it
        return lido.getPooledEthByShares(1e18);
    }

    /// NOTE: Lido StETH is pegged 1:1 to ETH
    /// @return Asset Token amount
    function numAssetsPerYieldToken(uint yieldTokens, uint) public pure override returns (uint) {
        return yieldTokens;
    }

    /// NOTE: Lido StETH is pegged 1:1 to ETH
    /// @return YBT amount
    function numYieldTokensPerAsset(uint backingTokens, uint) public pure override returns (uint) {
        return backingTokens;
    }

    function interestRateToSharePrice(uint interestRate) internal pure override returns (uint) {
        return interestRate; // no conversion needed, praise ETH
    }
}

File 2 of 22 : TempusPool.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.10;

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import "./ITempusPool.sol";
import "./token/PrincipalShare.sol";
import "./token/YieldShare.sol";
import "./math/Fixed256xVar.sol";
import "./utils/Ownable.sol";
import "./utils/UntrustedERC20.sol";
import "./utils/Versioned.sol";

/// @dev helper struct to store name and symbol for the token
struct TokenData {
    string name;
    string symbol;
}

/// @author The tempus.finance team
/// @title Implementation of Tempus Pool
abstract contract TempusPool is ITempusPool, ReentrancyGuard, Ownable, Versioned {
    using SafeERC20 for IERC20;
    using UntrustedERC20 for IERC20;
    using Fixed256xVar for uint256;

    uint256 public constant override maximumNegativeYieldDuration = 7 days;

    address public immutable override yieldBearingToken;
    address public immutable override backingToken;

    uint256 public immutable override startTime;
    uint256 public immutable override maturityTime;
    uint256 public override exceptionalHaltTime = type(uint256).max;

    uint256 public immutable override initialInterestRate;
    uint256 public override maturityInterestRate;

    uint256 public immutable exchangeRateONE;
    uint256 public immutable yieldBearingONE;
    uint256 public immutable override backingTokenONE;

    IPoolShare public immutable override principalShare;
    IPoolShare public immutable override yieldShare;

    address public immutable override controller;

    uint256 private immutable initialEstimatedYield;

    FeesConfig private feesConfig;
    uint256 public immutable override maxDepositFee;
    uint256 public immutable override maxEarlyRedeemFee;
    uint256 public immutable override maxMatureRedeemFee;
    uint256 public override totalFees;

    /// Timestamp when the negative yield period was entered.
    uint256 private negativeYieldStartTime;

    /// Constructs Pool with underlying token, start and maturity date
    /// @param _yieldBearingToken Yield Bearing Token, such as cDAI or aUSDC
    /// @param _backingToken backing token (or zero address if ETH)
    /// @param ctrl The authorized TempusController of the pool
    /// @param maturity maturity time of this pool
    /// @param initInterestRate initial interest rate of the pool
    /// @param exchangeRateOne 1.0 expressed in exchange rate decimal precision
    /// @param estimatedFinalYield estimated yield for the whole lifetime of the pool
    /// @param principalsData Tempus Principals name and symbol
    /// @param yieldsData Tempus Yields name and symbol
    /// @param maxFeeSetup Maximum fee percentages that this pool can have,
    ///                    values in Yield Bearing Token precision
    constructor(
        address _yieldBearingToken,
        address _backingToken,
        address ctrl,
        uint256 maturity,
        uint256 initInterestRate,
        uint256 exchangeRateOne,
        uint256 estimatedFinalYield,
        TokenData memory principalsData,
        TokenData memory yieldsData,
        FeesConfig memory maxFeeSetup
    ) Versioned(1, 0, 0) {
        require(maturity > block.timestamp, "maturityTime is after startTime");
        require(ctrl != address(0), "controller can not be zero");
        require(initInterestRate > 0, "initInterestRate can not be zero");
        require(estimatedFinalYield > 0, "estimatedFinalYield can not be zero");
        require(_yieldBearingToken != address(0), "YBT can not be zero");

        yieldBearingToken = _yieldBearingToken;
        backingToken = _backingToken;
        controller = ctrl;
        startTime = block.timestamp;
        maturityTime = maturity;
        initialInterestRate = initInterestRate;
        exchangeRateONE = exchangeRateOne;
        yieldBearingONE = 10**ERC20(_yieldBearingToken).decimals();
        initialEstimatedYield = estimatedFinalYield;

        maxDepositFee = maxFeeSetup.depositPercent;
        maxEarlyRedeemFee = maxFeeSetup.earlyRedeemPercent;
        maxMatureRedeemFee = maxFeeSetup.matureRedeemPercent;

        uint8 backingDecimals = _backingToken != address(0) ? IERC20Metadata(_backingToken).decimals() : 18;
        backingTokenONE = 10**backingDecimals;
        principalShare = new PrincipalShare(this, principalsData.name, principalsData.symbol, backingDecimals);
        yieldShare = new YieldShare(this, yieldsData.name, yieldsData.symbol, backingDecimals);
    }

    modifier onlyController() {
        require(msg.sender == controller, "Only callable by TempusController");
        _;
    }

    function depositToUnderlying(uint256 backingAmount) internal virtual returns (uint256 mintedYieldTokenAmount);

    function withdrawFromUnderlyingProtocol(uint256 amount, address recipient)
        internal
        virtual
        returns (uint256 backingTokenAmount);

    function matured() public view override returns (bool) {
        return (block.timestamp >= maturityTime) || (block.timestamp >= exceptionalHaltTime);
    }

    function getFeesConfig() external view override returns (FeesConfig memory) {
        return feesConfig;
    }

    function setFeesConfig(FeesConfig calldata newFeesConfig) external override onlyOwner {
        require(newFeesConfig.depositPercent <= maxDepositFee, "Deposit fee percent > max");
        require(newFeesConfig.earlyRedeemPercent <= maxEarlyRedeemFee, "Early redeem fee percent > max");
        require(newFeesConfig.matureRedeemPercent <= maxMatureRedeemFee, "Mature redeem fee percent > max");
        feesConfig = newFeesConfig;
    }

    function transferFees(address recipient) external override nonReentrant onlyOwner {
        uint256 amount = totalFees;
        totalFees = 0;

        IERC20 token = IERC20(yieldBearingToken);
        token.safeTransfer(recipient, amount);
    }

    function onDepositBacking(uint256 backingTokenAmount, address recipient)
        external
        payable
        override
        onlyController
        returns (
            uint256 mintedShares,
            uint256 depositedYBT,
            uint256 fee,
            uint256 rate
        )
    {
        // Enforced by the controller.
        assert(backingTokenAmount > 0);

        depositedYBT = depositToUnderlying(backingTokenAmount);
        assert(depositedYBT > 0);

        (mintedShares, , fee, rate) = mintShares(depositedYBT, recipient);
    }

    function onDepositYieldBearing(uint256 yieldTokenAmount, address recipient)
        external
        override
        onlyController
        returns (
            uint256 mintedShares,
            uint256 depositedBT,
            uint256 fee,
            uint256 rate
        )
    {
        // Enforced by the controller.
        assert(yieldTokenAmount > 0);

        (mintedShares, depositedBT, fee, rate) = mintShares(yieldTokenAmount, recipient);
    }

    /// @param yieldTokenAmount YBT amount in YBT decimal precision
    /// @param recipient address to which shares will be minted
    function mintShares(uint256 yieldTokenAmount, address recipient)
        private
        returns (
            uint256 mintedShares,
            uint256 depositedBT,
            uint256 fee,
            uint256 rate
        )
    {
        rate = updateInterestRate();
        (bool hasMatured, bool hasNegativeYield) = validateInterestRate(rate);

        require(!hasMatured, "Maturity reached.");
        require(!hasNegativeYield, "Negative yield!");

        // Collect fees if they are set, reducing the number of tokens for the sender
        // thus leaving more YBT in the TempusPool than there are minted TPS/TYS
        uint256 tokenAmount = yieldTokenAmount;
        uint256 depositFees = feesConfig.depositPercent;
        if (depositFees != 0) {
            fee = tokenAmount.mulfV(depositFees, yieldBearingONE);
            tokenAmount -= fee;
            totalFees += fee;
        }

        // Issue appropriate shares
        depositedBT = numAssetsPerYieldToken(tokenAmount, rate);
        mintedShares = numSharesToMint(depositedBT, rate);

        PrincipalShare(address(principalShare)).mint(recipient, mintedShares);
        YieldShare(address(yieldShare)).mint(recipient, mintedShares);
    }

    function redeemToBacking(
        address from,
        uint256 principalAmount,
        uint256 yieldAmount,
        address recipient
    )
        external
        payable
        override
        onlyController
        returns (
            uint256 redeemedYieldTokens,
            uint256 redeemedBackingTokens,
            uint256 fee,
            uint256 rate
        )
    {
        (redeemedYieldTokens, fee, rate) = burnShares(from, principalAmount, yieldAmount);

        redeemedBackingTokens = withdrawFromUnderlyingProtocol(redeemedYieldTokens, recipient);
    }

    function redeem(
        address from,
        uint256 principalAmount,
        uint256 yieldAmount,
        address recipient
    )
        external
        override
        onlyController
        returns (
            uint256 redeemedYieldTokens,
            uint256 fee,
            uint256 rate
        )
    {
        (redeemedYieldTokens, fee, rate) = burnShares(from, principalAmount, yieldAmount);

        redeemedYieldTokens = IERC20(yieldBearingToken).untrustedTransfer(recipient, redeemedYieldTokens);
    }

    function finalize() public override {
        if (matured() && maturityInterestRate == 0) {
            maturityInterestRate = updateInterestRate();
        }
    }

    function burnShares(
        address from,
        uint256 principalAmount,
        uint256 yieldAmount
    )
        private
        returns (
            uint256 redeemedYieldTokens,
            uint256 fee,
            uint256 interestRate
        )
    {
        require(IERC20(address(principalShare)).balanceOf(from) >= principalAmount, "Insufficient principals.");
        require(IERC20(address(yieldShare)).balanceOf(from) >= yieldAmount, "Insufficient yields.");

        uint256 currentRate = updateInterestRate();
        (bool hasMatured, ) = validateInterestRate(currentRate);

        if (hasMatured) {
            finalize();
        } else {
            // Redeeming prior to maturity is only allowed in equal amounts.
            require(principalAmount == yieldAmount, "Inequal redemption not allowed before maturity.");
        }
        // Burn the appropriate shares
        PrincipalShare(address(principalShare)).burnFrom(from, principalAmount);
        YieldShare(address(yieldShare)).burnFrom(from, yieldAmount);

        (redeemedYieldTokens, , fee, interestRate) = getRedemptionAmounts(principalAmount, yieldAmount, currentRate);
        totalFees += fee;
    }

    function getRedemptionAmounts(
        uint256 principalAmount,
        uint256 yieldAmount,
        uint256 currentRate
    )
        private
        view
        returns (
            uint256 redeemableYieldTokens,
            uint256 redeemableBackingTokens,
            uint256 redeemFeeAmount,
            uint256 interestRate
        )
    {
        interestRate = effectiveRate(currentRate);

        if (interestRate < initialInterestRate) {
            redeemableBackingTokens = (principalAmount * interestRate) / initialInterestRate;
        } else {
            uint256 rateDiff = interestRate - initialInterestRate;
            // this is expressed in percent with exchangeRate precision
            uint256 yieldPercent = rateDiff.divfV(initialInterestRate, exchangeRateONE);
            uint256 redeemAmountFromYieldShares = yieldAmount.mulfV(yieldPercent, exchangeRateONE);

            redeemableBackingTokens = principalAmount + redeemAmountFromYieldShares;

            // after maturity, all additional yield is being collected as fee
            if (matured() && currentRate > interestRate) {
                uint256 additionalYieldRate = currentRate - interestRate;
                uint256 feeBackingAmount = yieldAmount.mulfV(
                    additionalYieldRate.mulfV(initialInterestRate, exchangeRateONE),
                    exchangeRateONE
                );
                redeemFeeAmount = numYieldTokensPerAsset(feeBackingAmount, currentRate);
            }
        }

        redeemableYieldTokens = numYieldTokensPerAsset(redeemableBackingTokens, currentRate);

        uint256 redeemFeePercent = matured() ? feesConfig.matureRedeemPercent : feesConfig.earlyRedeemPercent;
        if (redeemFeePercent != 0) {
            uint256 regularRedeemFee = redeemableYieldTokens.mulfV(redeemFeePercent, yieldBearingONE);
            redeemableYieldTokens -= regularRedeemFee;
            redeemFeeAmount += regularRedeemFee;

            redeemableBackingTokens = numAssetsPerYieldToken(redeemableYieldTokens, currentRate);
        }
    }

    function effectiveRate(uint256 currentRate) private view returns (uint256) {
        if (matured() && maturityInterestRate != 0) {
            return (currentRate < maturityInterestRate) ? currentRate : maturityInterestRate;
        } else {
            return currentRate;
        }
    }

    /// @dev Calculates current yield - since beginning of the pool
    /// @notice Includes principal, so in case of 5% yield it returns 1.05
    /// @param interestRate Current interest rate of the underlying protocol
    /// @return Current yield relative to 1, such as 1.05 (+5%) or 0.97 (-3%)
    function currentYield(uint256 interestRate) private view returns (uint256) {
        return effectiveRate(interestRate).divfV(initialInterestRate, exchangeRateONE);
    }

    function currentYield() private returns (uint256) {
        return currentYield(updateInterestRate());
    }

    function currentYieldStored() private view returns (uint256) {
        return currentYield(currentInterestRate());
    }

    function estimatedYield() private returns (uint256) {
        return estimatedYield(currentYield());
    }

    function estimatedYieldStored() private view returns (uint256) {
        return estimatedYield(currentYieldStored());
    }

    /// @dev Calculates estimated yield at maturity
    /// @notice Includes principal, so in case of 5% yield it returns 1.05
    /// @param yieldCurrent Current yield - since beginning of the pool
    /// @return Estimated yield at maturity relative to 1, such as 1.05 (+5%) or 0.97 (-3%)
    function estimatedYield(uint256 yieldCurrent) private view returns (uint256) {
        if (matured()) {
            return yieldCurrent;
        }
        uint256 currentTime = block.timestamp;
        uint256 timeToMaturity;
        uint256 poolDuration;
        unchecked {
            timeToMaturity = (maturityTime > currentTime) ? (maturityTime - currentTime) : 0;
            poolDuration = maturityTime - startTime;
        }
        uint256 timeLeft = timeToMaturity.divfV(poolDuration, exchangeRateONE);

        return yieldCurrent + timeLeft.mulfV(initialEstimatedYield, exchangeRateONE);
    }

    /// pricePerYield = currentYield * (estimatedYield - 1) / (estimatedYield)
    /// Return value decimal precision in backing token precision
    function pricePerYieldShare(uint256 currYield, uint256 estYield) private view returns (uint256) {
        uint one = exchangeRateONE;
        // in case we have estimate for negative yield
        if (estYield < one) {
            return uint256(0);
        }
        uint256 yieldPrice = (estYield - one).mulfV(currYield, one).divfV(estYield, one);
        return interestRateToSharePrice(yieldPrice);
    }

    /// pricePerPrincipal = currentYield / estimatedYield
    /// Return value decimal precision in backing token precision
    function pricePerPrincipalShare(uint256 currYield, uint256 estYield) private view returns (uint256) {
        // in case we have estimate for negative yield
        if (estYield < exchangeRateONE) {
            return interestRateToSharePrice(currYield);
        }
        uint256 principalPrice = currYield.divfV(estYield, exchangeRateONE);
        return interestRateToSharePrice(principalPrice);
    }

    function pricePerYieldShare() external override returns (uint256) {
        return pricePerYieldShare(currentYield(), estimatedYield());
    }

    function pricePerYieldShareStored() external view override returns (uint256) {
        return pricePerYieldShare(currentYieldStored(), estimatedYieldStored());
    }

    function pricePerPrincipalShare() external override returns (uint256) {
        return pricePerPrincipalShare(currentYield(), estimatedYield());
    }

    function pricePerPrincipalShareStored() external view override returns (uint256) {
        return pricePerPrincipalShare(currentYieldStored(), estimatedYieldStored());
    }

    function numSharesToMint(uint256 depositedBT, uint256 currentRate) private view returns (uint256) {
        return (depositedBT * initialInterestRate) / currentRate;
    }

    function estimatedMintedShares(uint256 amount, bool isBackingToken) external view override returns (uint256) {
        uint256 currentRate = currentInterestRate();
        uint256 depositedBT = isBackingToken ? amount : numAssetsPerYieldToken(amount, currentRate);
        return numSharesToMint(depositedBT, currentRate);
    }

    function estimatedRedeem(
        uint256 principals,
        uint256 yields,
        bool toBackingToken
    ) external view override returns (uint256) {
        uint256 currentRate = currentInterestRate();
        (uint256 yieldTokens, uint256 backingTokens, , ) = getRedemptionAmounts(principals, yields, currentRate);
        return toBackingToken ? backingTokens : yieldTokens;
    }

    /// @dev This updates the internal tracking of negative yield periods,
    ///      and returns the current status of maturity and interest rates.
    function validateInterestRate(uint256 rate) private returns (bool hasMatured, bool hasNegativeYield) {
        // Short circuit. No need for the below after maturity.
        if (matured()) {
            return (true, rate < initialInterestRate);
        }

        if (rate >= initialInterestRate) {
            // Reset period.
            negativeYieldStartTime = 0;
            return (false, false);
        }

        if (negativeYieldStartTime == 0) {
            // Entering a negative yield period.
            negativeYieldStartTime = block.timestamp;
            return (false, true);
        }

        if ((negativeYieldStartTime + maximumNegativeYieldDuration) <= block.timestamp) {
            // Already in a negative yield period, exceeding the duration.
            exceptionalHaltTime = block.timestamp;
            // It is considered matured now because exceptionalHaltTime is set.
            assert(matured());
            return (true, true);
        }

        // Already in negative yield period, but not for long enough.
        return (false, true);
    }

    /// @dev This updates the underlying pool's interest rate
    ///      It should be done first thing before deposit/redeem to avoid arbitrage
    /// @return Updated current Interest Rate, decimal precision depends on specific TempusPool implementation
    function updateInterestRate() internal virtual returns (uint256);

    /// @dev This returns the stored Interest Rate of the YBT (Yield Bearing Token) pool
    ///      it is safe to call this after updateInterestRate() was called
    /// @return Stored Interest Rate, decimal precision depends on specific TempusPool implementation
    function currentInterestRate() public view virtual override returns (uint256);

    function numYieldTokensPerAsset(uint backingTokens, uint interestRate) public view virtual override returns (uint);

    function numAssetsPerYieldToken(uint yieldTokens, uint interestRate) public view virtual override returns (uint);

    /// @return Converts an interest rate decimal into a Principal/Yield Share decimal
    function interestRateToSharePrice(uint interestRate) internal view virtual returns (uint);
}

File 3 of 22 : ILido.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.10;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";

interface ILido is IERC20, IERC20Metadata {
    /**
     * @notice Send funds to the pool with optional _referral parameter
     * @dev This function is alternative way to submit funds. Supports optional referral address.
     * @return Amount of StETH shares generated
     */
    function submit(address _referral) external payable returns (uint256);

    /**
     * @return the amount of shares that corresponds to `_ethAmount` protocol-controlled Ether.
     */
    function getSharesByPooledEth(uint256 _ethAmount) external view returns (uint256);

    /**
     * @return the amount of Ether that corresponds to `_sharesAmount` token shares.
     */
    function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);
}

File 4 of 22 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 5 of 22 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 6 of 22 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";

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

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

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

File 7 of 22 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

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

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 8 of 22 : ITempusPool.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.7.6 <0.9.0;
pragma abicoder v2;

import "./token/IPoolShare.sol";
import "./utils/IOwnable.sol";
import "./utils/IVersioned.sol";

/// Setting and transferring of fees are restricted to the owner.
interface ITempusFees is IOwnable {
    /// The fees are in terms of yield bearing token (YBT).
    struct FeesConfig {
        uint256 depositPercent;
        uint256 earlyRedeemPercent;
        uint256 matureRedeemPercent;
    }

    /// Returns the current fee configuration.
    function getFeesConfig() external view returns (FeesConfig memory);

    /// Replace the current fee configuration with a new one.
    /// By default all the fees are expected to be set to zero.
    /// @notice This function can only be called by the owner.
    function setFeesConfig(FeesConfig calldata newFeesConfig) external;

    /// @return Maximum possible fee percentage that can be set for deposit
    function maxDepositFee() external view returns (uint256);

    /// @return Maximum possible fee percentage that can be set for early redeem
    function maxEarlyRedeemFee() external view returns (uint256);

    /// @return Maximum possible fee percentage that can be set for mature redeem
    function maxMatureRedeemFee() external view returns (uint256);

    /// Accumulated fees available for withdrawal.
    function totalFees() external view returns (uint256);

    /// Transfers accumulated Yield Bearing Token (YBT) fees
    /// from this pool contract to `recipient`.
    /// @param recipient Address which will receive the specified amount of YBT
    /// @notice This function can only be called by the owner.
    function transferFees(address recipient) external;
}

/// All state changing operations are restricted to the controller.
interface ITempusPool is ITempusFees, IVersioned {
    /// @return The name of underlying protocol, for example "Aave" for Aave protocol
    function protocolName() external view returns (bytes32);

    /// This token will be used as a token that user can deposit to mint same amounts
    /// of principal and interest shares.
    /// @return The underlying yield bearing token.
    function yieldBearingToken() external view returns (address);

    /// This is the address of the actual backing asset token
    /// in the case of ETH, this address will be 0
    /// @return Address of the Backing Token
    function backingToken() external view returns (address);

    /// @return uint256 value of one backing token, in case of 18 decimals 1e18
    function backingTokenONE() external view returns (uint256);

    /// @return This TempusPool's Tempus Principal Share (TPS)
    function principalShare() external view returns (IPoolShare);

    /// @return This TempusPool's Tempus Yield Share (TYS)
    function yieldShare() external view returns (IPoolShare);

    /// @return The TempusController address that is authorized to perform restricted actions
    function controller() external view returns (address);

    /// @return Start time of the pool.
    function startTime() external view returns (uint256);

    /// @return Maturity time of the pool.
    function maturityTime() external view returns (uint256);

    /// @return Time of exceptional halting of the pool.
    /// In case the pool is still in operation, this must return type(uint256).max.
    function exceptionalHaltTime() external view returns (uint256);

    /// @return The maximum allowed time (in seconds) to pass with negative yield.
    function maximumNegativeYieldDuration() external view returns (uint256);

    /// @return True if maturity has been reached and the pool was finalized.
    ///         This also includes the case when maturity was triggered due to
    ///         exceptional conditions (negative yield periods).
    function matured() external view returns (bool);

    /// Finalizes the pool. This can only happen on or after `maturityTime`.
    /// Once finalized depositing is not possible anymore, and the behaviour
    /// redemption will change.
    ///
    /// Can be called by anyone and can be called multiple times.
    function finalize() external;

    /// Yield bearing tokens deposit hook.
    /// @notice Deposit will fail if maturity has been reached.
    /// @notice This function can only be called by TempusController
    /// @notice This function assumes funds were already transferred to the TempusPool from the TempusController
    /// @param yieldTokenAmount Amount of yield bearing tokens to deposit in YieldToken decimal precision
    /// @param recipient Address which will receive Tempus Principal Shares (TPS) and Tempus Yield Shares (TYS)
    /// @return mintedShares Amount of TPS and TYS minted to `recipient`
    /// @return depositedBT The YBT value deposited, denominated as Backing Tokens
    /// @return fee The fee which was deducted (in terms of YBT)
    /// @return rate The interest rate at the time of the deposit
    function onDepositYieldBearing(uint256 yieldTokenAmount, address recipient)
        external
        returns (
            uint256 mintedShares,
            uint256 depositedBT,
            uint256 fee,
            uint256 rate
        );

    /// Backing tokens deposit hook.
    /// @notice Deposit will fail if maturity has been reached.
    /// @notice This function can only be called by TempusController
    /// @notice This function assumes funds were already transferred to the TempusPool from the TempusController
    /// @param backingTokenAmount amount of Backing Tokens to be deposited to underlying protocol in BackingToken decimal precision
    /// @param recipient Address which will receive Tempus Principal Shares (TPS) and Tempus Yield Shares (TYS)
    /// @return mintedShares Amount of TPS and TYS minted to `recipient`
    /// @return depositedYBT The BT value deposited, denominated as Yield Bearing Tokens
    /// @return fee The fee which was deducted (in terms of YBT)
    /// @return rate The interest rate at the time of the deposit
    function onDepositBacking(uint256 backingTokenAmount, address recipient)
        external
        payable
        returns (
            uint256 mintedShares,
            uint256 depositedYBT,
            uint256 fee,
            uint256 rate
        );

    /// Redeems yield bearing tokens from this TempusPool
    ///      msg.sender will receive the YBT
    ///      NOTE #1 Before maturity, principalAmount must equal to yieldAmount.
    ///      NOTE #2 This function can only be called by TempusController
    /// @param from Address to redeem its Tempus Shares
    /// @param principalAmount Amount of Tempus Principal Shares (TPS) to redeem for YBT in PrincipalShare decimal precision
    /// @param yieldAmount Amount of Tempus Yield Shares (TYS) to redeem for YBT in YieldShare decimal precision
    /// @param recipient Address to which redeemed YBT will be sent
    /// @return redeemableYieldTokens Amount of Yield Bearing Tokens redeemed to `recipient`
    /// @return fee The fee which was deducted (in terms of YBT)
    /// @return rate The interest rate at the time of the redemption
    function redeem(
        address from,
        uint256 principalAmount,
        uint256 yieldAmount,
        address recipient
    )
        external
        returns (
            uint256 redeemableYieldTokens,
            uint256 fee,
            uint256 rate
        );

    /// Redeems TPS+TYS held by msg.sender into backing tokens
    ///      `msg.sender` must approve TPS and TYS amounts to this TempusPool.
    ///      `msg.sender` will receive the backing tokens
    ///      NOTE #1 Before maturity, principalAmount must equal to yieldAmount.
    ///      NOTE #2 This function can only be called by TempusController
    /// @param from Address to redeem its Tempus Shares
    /// @param principalAmount Amount of Tempus Principal Shares (TPS) to redeem in PrincipalShare decimal precision
    /// @param yieldAmount Amount of Tempus Yield Shares (TYS) to redeem in YieldShare decimal precision
    /// @param recipient Address to which redeemed BT will be sent
    /// @return redeemableYieldTokens Amount of Backing Tokens redeemed to `recipient`, denominated in YBT
    /// @return redeemableBackingTokens Amount of Backing Tokens redeemed to `recipient`
    /// @return fee The fee which was deducted (in terms of YBT)
    /// @return rate The interest rate at the time of the redemption
    function redeemToBacking(
        address from,
        uint256 principalAmount,
        uint256 yieldAmount,
        address recipient
    )
        external
        payable
        returns (
            uint256 redeemableYieldTokens,
            uint256 redeemableBackingTokens,
            uint256 fee,
            uint256 rate
        );

    /// Gets the estimated amount of Principals and Yields after a successful deposit
    /// @param amount Amount of BackingTokens or YieldBearingTokens that would be deposited
    /// @param isBackingToken If true, @param amount is in BackingTokens, otherwise YieldBearingTokens
    /// @return Amount of Principals (TPS) and Yields (TYS) in Principal/YieldShare decimal precision
    ///         TPS and TYS are minted in 1:1 ratio, hence a single return value.
    function estimatedMintedShares(uint256 amount, bool isBackingToken) external view returns (uint256);

    /// Gets the estimated amount of YieldBearingTokens or BackingTokens received when calling `redeemXXX()` functions
    /// @param principals Amount of Principals (TPS) in PrincipalShare decimal precision
    /// @param yields Amount of Yields (TYS) in YieldShare decimal precision
    /// @param toBackingToken If true, redeem amount is estimated in BackingTokens instead of YieldBearingTokens
    /// @return Amount of YieldBearingTokens or BackingTokens in YBT/BT decimal precision
    function estimatedRedeem(
        uint256 principals,
        uint256 yields,
        bool toBackingToken
    ) external view returns (uint256);

    /// @dev This returns the stored Interest Rate of the YBT (Yield Bearing Token) pool
    ///      it is safe to call this after updateInterestRate() was called
    /// @return Stored Interest Rate, decimal precision depends on specific TempusPool implementation
    function currentInterestRate() external view returns (uint256);

    /// @return Initial interest rate of the underlying pool,
    ///         decimal precision depends on specific TempusPool implementation
    function initialInterestRate() external view returns (uint256);

    /// @return Interest rate at maturity of the underlying pool (or 0 if maturity not reached yet)
    ///         decimal precision depends on specific TempusPool implementation
    function maturityInterestRate() external view returns (uint256);

    /// @return Rate of one Tempus Yield Share expressed in Asset Tokens
    function pricePerYieldShare() external returns (uint256);

    /// @return Rate of one Tempus Principal Share expressed in Asset Tokens
    function pricePerPrincipalShare() external returns (uint256);

    /// Calculated with stored interest rates
    /// @return Rate of one Tempus Yield Share expressed in Asset Tokens,
    function pricePerYieldShareStored() external view returns (uint256);

    /// Calculated with stored interest rates
    /// @return Rate of one Tempus Principal Share expressed in Asset Tokens
    function pricePerPrincipalShareStored() external view returns (uint256);

    /// @dev This returns actual Backing Token amount for amount of YBT (Yield Bearing Tokens)
    ///      For example, in case of Aave and Lido the result is 1:1,
    ///      and for compound is `yieldTokens * currentInterestRate`
    /// @param yieldTokens Amount of YBT in YBT decimal precision
    /// @param interestRate The current interest rate
    /// @return Amount of Backing Tokens for specified @param yieldTokens
    function numAssetsPerYieldToken(uint yieldTokens, uint interestRate) external view returns (uint);

    /// @dev This returns amount of YBT (Yield Bearing Tokens) that can be converted
    ///      from @param backingTokens Backing Tokens
    /// @param backingTokens Amount of Backing Tokens in BT decimal precision
    /// @param interestRate The current interest rate
    /// @return Amount of YBT for specified @param backingTokens
    function numYieldTokensPerAsset(uint backingTokens, uint interestRate) external view returns (uint);
}

File 9 of 22 : PrincipalShare.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.10;

import "./PoolShare.sol";

/// @dev Token representing the principal shares of a pool.
contract PrincipalShare is PoolShare {
    constructor(
        ITempusPool _pool,
        string memory name,
        string memory symbol,
        uint8 decimals
    ) PoolShare(ShareKind.Principal, _pool, name, symbol, decimals) {}

    // solhint-disable-previous-line no-empty-blocks

    function getPricePerFullShare() external override returns (uint256) {
        return pool.pricePerPrincipalShare();
    }

    function getPricePerFullShareStored() external view override returns (uint256) {
        return pool.pricePerPrincipalShareStored();
    }
}

File 10 of 22 : YieldShare.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.10;

import "./PoolShare.sol";

/// @dev Token representing the yield shares of a pool.
contract YieldShare is PoolShare {
    constructor(
        ITempusPool _pool,
        string memory name,
        string memory symbol,
        uint8 decimals
    ) PoolShare(ShareKind.Yield, _pool, name, symbol, decimals) {}

    // solhint-disable-previous-line no-empty-blocks

    function getPricePerFullShare() external override returns (uint256) {
        return pool.pricePerYieldShare();
    }

    function getPricePerFullShareStored() external view override returns (uint256) {
        return pool.pricePerYieldShareStored();
    }
}

File 11 of 22 : Fixed256xVar.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

/// @dev Fixed Point decimal math utils for variable decimal point precision
///      on 256-bit wide numbers
library Fixed256xVar {
    /// @dev Multiplies two variable precision fixed point decimal numbers
    /// @param one 1.0 expressed in the base precision of `a` and `b`
    /// @return result = a * b
    function mulfV(
        uint256 a,
        uint256 b,
        uint256 one
    ) internal pure returns (uint256) {
        // result is always truncated
        return (a * b) / one;
    }

    /// @dev Divides two variable precision fixed point decimal numbers
    /// @param one 1.0 expressed in the base precision of `a` and `b`
    /// @return result = a / b
    function divfV(
        uint256 a,
        uint256 b,
        uint256 one
    ) internal pure returns (uint256) {
        // result is always truncated
        return (a * one) / b;
    }
}

File 12 of 22 : Ownable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

import "./IOwnable.sol";

/// Implements Ownable with a two step transfer of ownership
abstract contract Ownable is IOwnable {
    address private _owner;
    address private _proposedOwner;

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _setOwner(msg.sender);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == msg.sender, "Ownable: caller is not the owner");
        _;
    }

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

    /**
     * @dev Accepts ownership of the contract by a proposed account.
     * Can only be called by the proposed owner.
     */
    function acceptOwnership() public virtual override {
        require(msg.sender == _proposedOwner, "Ownable: Only proposed owner can accept ownership");
        _setOwner(_proposedOwner);
        _proposedOwner = address(0);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 13 of 22 : UntrustedERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

/// @title UntrustedERC20
/// @dev Wrappers around ERC20 transfer operators that return the actual amount
/// transferred. This means they are usable with tokens, which charge a fee or royalty on transfer.
library UntrustedERC20 {
    using SafeERC20 for IERC20;

    /// Transfer tokens to a recipient.
    /// @param token The ERC20 token.
    /// @param to The recipient.
    /// @param value The requested amount.
    /// @return The actual amount of tokens transferred.
    function untrustedTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal returns (uint256) {
        uint256 startBalance = token.balanceOf(to);
        token.safeTransfer(to, value);
        return token.balanceOf(to) - startBalance;
    }

    /// Transfer tokens to a recipient.
    /// @param token The ERC20 token.
    /// @param from The sender.
    /// @param to The recipient.
    /// @param value The requested amount.
    /// @return The actual amount of tokens transferred.
    function untrustedTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal returns (uint256) {
        uint256 startBalance = token.balanceOf(to);
        token.safeTransferFrom(from, to, value);
        return token.balanceOf(to) - startBalance;
    }
}

File 14 of 22 : Versioned.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.6 <0.9.0;

import "./IVersioned.sol";

/// Implements versioning
abstract contract Versioned is IVersioned {
    uint16 private immutable _major;
    uint16 private immutable _minor;
    uint16 private immutable _patch;

    constructor(
        uint16 major,
        uint16 minor,
        uint16 patch
    ) {
        _major = major;
        _minor = minor;
        _patch = patch;
    }

    function version() external view returns (Version memory) {
        return Version(_major, _minor, _patch);
    }
}

File 15 of 22 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) private pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 16 of 22 : IPoolShare.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.7.6 <0.9.0;

import "../ITempusPool.sol";

/// Interface of Tokens representing the principal or yield shares of a pool.
interface IPoolShare {
    enum ShareKind {
        Principal,
        Yield
    }

    /// @return The kind of the share.
    function kind() external view returns (ShareKind);

    /// @return The pool this share is part of.
    function pool() external view returns (ITempusPool);

    /// @dev Price per single share expressed in Backing Tokens of the underlying pool.
    ///      This is for the purpose of TempusAMM api support.
    ///      Example: exchanging Tempus Yield Share to DAI
    /// @return 1e18 decimal conversion rate per share
    function getPricePerFullShare() external returns (uint256);

    /// @return 1e18 decimal stored conversion rate per share
    function getPricePerFullShareStored() external view returns (uint256);
}

File 17 of 22 : IOwnable.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.6 <0.9.0;

/// Implements Ownable with a two step transfer of ownership
interface IOwnable {
    /**
     * @dev Change of ownership proposed.
     * @param currentOwner The current owner.
     * @param proposedOwner The proposed owner.
     */
    event OwnershipProposed(address indexed currentOwner, address indexed proposedOwner);

    /**
     * @dev Ownership transferred.
     * @param previousOwner The previous owner.
     * @param newOwner The new owner.
     */
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() external view returns (address);

    /**
     * @dev Proposes a transfer of ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) external;

    /**
     * @dev Accepts ownership of the contract by a proposed account.
     * Can only be called by the proposed owner.
     */
    function acceptOwnership() external;
}

File 18 of 22 : IVersioned.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.6 <0.9.0;
pragma abicoder v2;

/// Implements versioning
interface IVersioned {
    struct Version {
        uint16 major;
        uint16 minor;
        uint16 patch;
    }

    /// @return The version of the contract.
    function version() external view returns (Version memory);
}

File 19 of 22 : PoolShare.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.10;

import "./ERC20OwnerMintableToken.sol";
import "../ITempusPool.sol";

/// Token representing the principal or yield shares of a pool.
abstract contract PoolShare is IPoolShare, ERC20OwnerMintableToken {
    /// The kind of the share.
    ShareKind public immutable override kind;

    /// The pool this share is part of.
    ITempusPool public immutable override pool;

    uint8 internal immutable tokenDecimals;

    constructor(
        ShareKind _kind,
        ITempusPool _pool,
        string memory name,
        string memory symbol,
        uint8 _decimals
    ) ERC20OwnerMintableToken(name, symbol) {
        kind = _kind;
        pool = _pool;
        tokenDecimals = _decimals;
    }

    function decimals() public view virtual override returns (uint8) {
        return tokenDecimals;
    }
}

File 20 of 22 : ERC20OwnerMintableToken.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

/// This is a simplified implementation, but compatible with
/// OpenZeppelin's ERC20Mintable and ERC20Burnable extensions.
contract ERC20OwnerMintableToken is ERC20 {
    /// The manager who is allowed to mint and burn.
    address public immutable manager;

    constructor(string memory name, string memory symbol) ERC20(name, symbol) {
        manager = msg.sender;
    }

    /// Creates `amount` new tokens for `to`.
    /// @param account Recipient address to mint tokens to
    /// @param amount Number of tokens to mint
    function mint(address account, uint256 amount) external {
        require(msg.sender == manager, "mint: only manager can mint");
        _mint(account, amount);
    }

    /// Destroys `amount` tokens from the caller.
    /// @param amount Number of tokens to burn.
    function burn(uint256 amount) external {
        require(msg.sender == manager, "burn: only manager can burn");
        _burn(manager, amount);
    }

    /// Destroys `amount` tokens from `account`.
    /// @param account Source address to burn tokens from
    /// @param amount Number of tokens to burn
    function burnFrom(address account, uint256 amount) external {
        require(msg.sender == manager, "burn: only manager can burn");
        _burn(account, amount);
    }
}

File 21 of 22 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 22 of 22 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 100000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract ILido","name":"token","type":"address"},{"internalType":"address","name":"controller","type":"address"},{"internalType":"uint256","name":"maturity","type":"uint256"},{"internalType":"uint256","name":"estYield","type":"uint256"},{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"internalType":"struct TokenData","name":"principalsData","type":"tuple"},{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"internalType":"struct TokenData","name":"yieldsData","type":"tuple"},{"components":[{"internalType":"uint256","name":"depositPercent","type":"uint256"},{"internalType":"uint256","name":"earlyRedeemPercent","type":"uint256"},{"internalType":"uint256","name":"matureRedeemPercent","type":"uint256"}],"internalType":"struct ITempusFees.FeesConfig","name":"maxFeeSetup","type":"tuple"},{"internalType":"address","name":"referrerAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"currentOwner","type":"address"},{"indexed":true,"internalType":"address","name":"proposedOwner","type":"address"}],"name":"OwnershipProposed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"backingToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"backingTokenONE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentInterestRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"isBackingToken","type":"bool"}],"name":"estimatedMintedShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"principals","type":"uint256"},{"internalType":"uint256","name":"yields","type":"uint256"},{"internalType":"bool","name":"toBackingToken","type":"bool"}],"name":"estimatedRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exceptionalHaltTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exchangeRateONE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"finalize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getFeesConfig","outputs":[{"components":[{"internalType":"uint256","name":"depositPercent","type":"uint256"},{"internalType":"uint256","name":"earlyRedeemPercent","type":"uint256"},{"internalType":"uint256","name":"matureRedeemPercent","type":"uint256"}],"internalType":"struct ITempusFees.FeesConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialInterestRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"matured","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maturityInterestRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maturityTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxDepositFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxEarlyRedeemFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMatureRedeemFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maximumNegativeYieldDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"yieldTokens","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"numAssetsPerYieldToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"backingTokens","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"numYieldTokensPerAsset","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"backingTokenAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"onDepositBacking","outputs":[{"internalType":"uint256","name":"mintedShares","type":"uint256"},{"internalType":"uint256","name":"depositedYBT","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"rate","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"yieldTokenAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"onDepositYieldBearing","outputs":[{"internalType":"uint256","name":"mintedShares","type":"uint256"},{"internalType":"uint256","name":"depositedBT","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"rate","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pricePerPrincipalShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pricePerPrincipalShareStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pricePerYieldShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pricePerYieldShareStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"principalShare","outputs":[{"internalType":"contract IPoolShare","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolName","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"principalAmount","type":"uint256"},{"internalType":"uint256","name":"yieldAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"redeemedYieldTokens","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"rate","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"principalAmount","type":"uint256"},{"internalType":"uint256","name":"yieldAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"redeemToBacking","outputs":[{"internalType":"uint256","name":"redeemedYieldTokens","type":"uint256"},{"internalType":"uint256","name":"redeemedBackingTokens","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"rate","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"depositPercent","type":"uint256"},{"internalType":"uint256","name":"earlyRedeemPercent","type":"uint256"},{"internalType":"uint256","name":"matureRedeemPercent","type":"uint256"}],"internalType":"struct ITempusFees.FeesConfig","name":"newFeesConfig","type":"tuple"}],"name":"setFeesConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"transferFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"components":[{"internalType":"uint16","name":"major","type":"uint16"},{"internalType":"uint16","name":"minor","type":"uint16"},{"internalType":"uint16","name":"patch","type":"uint16"}],"internalType":"struct IVersioned.Version","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"yieldBearingONE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"yieldBearingToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"yieldShare","outputs":[{"internalType":"contract IPoolShare","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

6103006040526000196003553480156200001857600080fd5b50604051620069ab380380620069ab8339810160408190526200003b916200073c565b87600088888b6001600160a01b0316637a28fb88670de0b6b3a76400006040518263ffffffff1660e01b81526004016200007791815260200190565b602060405180830381865afa15801562000095573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000bb919062000839565b670de0b6b3a76400008a8a8a8a60016000806001600081905550620000e6336200050b60201b60201c565b61ffff92831660805290821660a0521660c0524287116200014e5760405162461bcd60e51b815260206004820152601f60248201527f6d6174757269747954696d6520697320616674657220737461727454696d650060448201526064015b60405180910390fd5b6001600160a01b038816620001a65760405162461bcd60e51b815260206004820152601a60248201527f636f6e74726f6c6c65722063616e206e6f74206265207a65726f000000000000604482015260640162000145565b60008611620001f85760405162461bcd60e51b815260206004820181905260248201527f696e6974496e746572657374526174652063616e206e6f74206265207a65726f604482015260640162000145565b60008411620002565760405162461bcd60e51b815260206004820152602360248201527f657374696d6174656446696e616c5969656c642063616e206e6f74206265207a60448201526265726f60e81b606482015260840162000145565b6001600160a01b038a16620002ae5760405162461bcd60e51b815260206004820152601360248201527f5942542063616e206e6f74206265207a65726f00000000000000000000000000604482015260640162000145565b6001600160a01b03808b1660e08190528a8216610100529089166102205242610120526101408890526101608790526101808690526040805163313ce56760e01b8152905163313ce567916004808201926020929091908290030181865afa1580156200031f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000345919062000853565b6200035290600a62000994565b6101a05261024084905280516102605260208101516102805260408101516102a05260006001600160a01b038a166200038d576012620003f2565b896001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015620003cc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003f2919062000853565b90506200040181600a62000994565b6101c0528351602085015160405130929190849062000420906200055d565b6200042f9493929190620009d3565b604051809103906000f0801580156200044c573d6000803e3d6000fd5b506001600160a01b03166101e0528251602084015160405130929190849062000475906200056b565b620004849493929190620009d3565b604051809103906000f080158015620004a1573d6000803e3d6000fd5b506001600160a01b0316610200816001600160a01b0316815250505050505050505050505050876001600160a01b03166102c0816001600160a01b031681525050806001600160a01b03166102e0816001600160a01b031681525050505050505050505062000a22565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6117488062003b1b83390190565b611748806200526383390190565b6001600160a01b03811681146200058f57600080fd5b50565b80516200059f8162000579565b919050565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715620005df57620005df620005a4565b60405290565b60005b8381101562000602578181015183820152602001620005e8565b8381111562000612576000848401525b50505050565b600082601f8301126200062a57600080fd5b81516001600160401b0380821115620006475762000647620005a4565b604051601f8301601f19908116603f01168101908282118183101715620006725762000672620005a4565b816040528381528660208588010111156200068c57600080fd5b6200069f846020830160208901620005e5565b9695505050505050565b600060408284031215620006bc57600080fd5b604080519081016001600160401b038082118383101715620006e257620006e2620005a4565b816040528293508451915080821115620006fb57600080fd5b620007098683870162000618565b835260208501519150808211156200072057600080fd5b506200072f8582860162000618565b6020830152505092915050565b600080600080600080600080888a036101408112156200075b57600080fd5b8951620007688162000579565b60208b01519099506200077b8162000579565b60408b015160608c015160808d0151929a5090985096506001600160401b0380821115620007a857600080fd5b620007b68d838e01620006a9565b965060a08c0151915080821115620007cd57600080fd5b50620007dc8c828d01620006a9565b945050606060bf1982011215620007f257600080fd5b50620007fd620005ba565b60c08a0151815260e08a015160208201526101008a0151604082015291506200082a6101208a0162000592565b90509295985092959890939650565b6000602082840312156200084c57600080fd5b5051919050565b6000602082840312156200086657600080fd5b815160ff811681146200087857600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b600181815b80851115620008d6578160001904821115620008ba57620008ba6200087f565b80851615620008c857918102915b93841c93908002906200089a565b509250929050565b600082620008ef575060016200098e565b81620008fe575060006200098e565b8160018114620009175760028114620009225762000942565b60019150506200098e565b60ff8411156200093657620009366200087f565b50506001821b6200098e565b5060208310610133831016604e8410600b841016171562000967575081810a6200098e565b62000973838362000895565b80600019048211156200098a576200098a6200087f565b0290505b92915050565b60006200087860ff841683620008de565b60008151808452620009bf816020860160208601620005e5565b601f01601f19169290920160200192915050565b6001600160a01b0385168152608060208201819052600090620009f990830186620009a5565b828103604084015262000a0d8186620009a5565b91505060ff8316606083015295945050505050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c0516102e051612edb62000c406000396000611e0d0152600081816115c50152611e380152600081816108ac015261108101526000818161031d0152610ff30152600081816107ed0152610f680152600061279201526000818161096a015281816109dc01528181610b5a01528181610df301526112fe0152600081816108580152818161183b01528181611abe01526121c00152600081816103f30152818161172101528181611a180152612118015260006103660152600081816104d00152818161206901526126080152600081816106b10152818161166d015281816116a301528181611cb1015281816124bd015281816124ec0152818161257001528181612598015281816126860152818161276601526127b301526000818161074e015281816123c2015281816124040152818161242c0152818161246d0152818161249c0152818161254f0152818161266501528181612818015261284101526000818161056401528181610af1015281816126c7015281816126f6015261273d0152600081816106e5015261271c0152600061049c01526000818161039a01528181610aba01528181610d8c01528181611d500152611ef201526000610614015260006105ea015260006105c00152612edb6000f3fe6080604052600436106102c65760003560e01c8063757881fd11610179578063af693417116100d6578063e567e8691161008a578063f2fde38b11610064578063f2fde38b14610938578063f77c479114610958578063ff4c7e311461098c57600080fd5b8063e567e869146108ce578063e8a8cf6514610902578063e9c5ce281461092257600080fd5b8063c56c7a85116100bb578063c56c7a8514610846578063ca9d2d551461087a578063e34c4b6a1461089a57600080fd5b8063af6934171461080f578063b468d2441461033f57600080fd5b80638a425ea91161012d578063960c691711610112578063960c6917146107705780639d27d5fc146107bb578063a8d1dbfb146107db57600080fd5b80638a425ea9146107705780638da5cb5b1461079057600080fd5b806378ec24ee1161015e57806378ec24ee1461070757806379ba5097146107275780638088e1211461073c57600080fd5b8063757881fd1461069f57806378e97925146106d357600080fd5b806347e621b7116102275780634e289bdf116101db57806354fd4d50116101c057806354fd4d501461058657806363dc4ef51461066c5780636c8d4fa11461068c57600080fd5b80634e289bdf1461053c5780634e8bfdaa1461055257600080fd5b80634b009e061161020c5780634b009e06146104f25780634bb278f3146105255780634e18f3241461047557600080fd5b806347e621b71461048a57806349d088c3146104be57600080fd5b80632d81f8381161027e57806343bcfab61161026357806343bcfab614610415578063454c87b3146104505780634570452a1461047557600080fd5b80632d81f8381461038857806335083643146103e157600080fd5b80632208ebbd116102af5780632208ebbd1461030b5780632675323d1461033f5780632b532a971461035457600080fd5b806313114a9d146102cb5780631f796f7f146102f4575b600080fd5b3480156102d757600080fd5b506102e160085481565b6040519081526020015b60405180910390f35b34801561030057600080fd5b506102e162093a8081565b34801561031757600080fd5b506102e17f000000000000000000000000000000000000000000000000000000000000000081565b34801561034b57600080fd5b506102e16109a1565b34801561036057600080fd5b506102e17f000000000000000000000000000000000000000000000000000000000000000081565b34801561039457600080fd5b506103bc7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102eb565b3480156103ed57600080fd5b506103bc7f000000000000000000000000000000000000000000000000000000000000000081565b34801561042157600080fd5b50610435610430366004612b8c565b6109c0565b604080519384526020840192909252908201526060016102eb565b34801561045c57600080fd5b50610465610aed565b60405190151581526020016102eb565b34801561048157600080fd5b506102e1610b23565b34801561049657600080fd5b506103bc7f000000000000000000000000000000000000000000000000000000000000000081565b3480156104ca57600080fd5b506102e17f000000000000000000000000000000000000000000000000000000000000000081565b610505610500366004612bd2565b610b3d565b6040805194855260208501939093529183015260608201526080016102eb565b34801561053157600080fd5b5061053a610c4b565b005b34801561054857600080fd5b506102e160035481565b34801561055e57600080fd5b506102e17f000000000000000000000000000000000000000000000000000000000000000081565b34801561059257600080fd5b5061063f604080516060810182526000808252602082018190529181019190915260405180606001604052807f000000000000000000000000000000000000000000000000000000000000000061ffff1681526020017f000000000000000000000000000000000000000000000000000000000000000061ffff1681526020017f000000000000000000000000000000000000000000000000000000000000000061ffff16815250905090565b60408051825161ffff908116825260208085015182169083015292820151909216908201526060016102eb565b34801561067857600080fd5b5061053a610687366004612bfe565b610c72565b61050561069a366004612b8c565b610dd6565b3480156106ab57600080fd5b506102e17f000000000000000000000000000000000000000000000000000000000000000081565b3480156106df57600080fd5b506102e17f000000000000000000000000000000000000000000000000000000000000000081565b34801561071357600080fd5b5061053a610722366004612c19565b610ec9565b34801561073357600080fd5b5061053a611128565b34801561074857600080fd5b506102e17f000000000000000000000000000000000000000000000000000000000000000081565b34801561077c57600080fd5b506102e161078b366004612c31565b61121b565b34801561079c57600080fd5b5060015473ffffffffffffffffffffffffffffffffffffffff166103bc565b3480156107c757600080fd5b506102e16107d6366004612c64565b611223565b3480156107e757600080fd5b506102e17f000000000000000000000000000000000000000000000000000000000000000081565b34801561081b57600080fd5b5061082461125d565b60408051825181526020808401519082015291810151908201526060016102eb565b34801561085257600080fd5b506103bc7f000000000000000000000000000000000000000000000000000000000000000081565b34801561088657600080fd5b506102e1610895366004612c94565b6112a6565b3480156108a657600080fd5b506102e17f000000000000000000000000000000000000000000000000000000000000000081565b3480156108da57600080fd5b506102e17f4c69646f0000000000000000000000000000000000000000000000000000000081565b34801561090e57600080fd5b5061050561091d366004612bd2565b6112e1565b34801561092e57600080fd5b506102e160045481565b34801561094457600080fd5b5061053a610953366004612bfe565b6113d5565b34801561096457600080fd5b506103bc7f000000000000000000000000000000000000000000000000000000000000000081565b34801561099857600080fd5b506102e161158c565b60006109bb6109ae611645565b6109b6611657565b611669565b905090565b600080803373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610a8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4f6e6c792063616c6c61626c652062792054656d707573436f6e74726f6c6c6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610a998787876116d3565b91945092509050610ae173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168585611b58565b92509450945094915050565b60007f0000000000000000000000000000000000000000000000000000000000000000421015806109bb57505060035442101590565b60006109bb610b30611645565b610b38611657565b611cad565b60008080803373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610c07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4f6e6c792063616c6c61626c652062792054656d707573436f6e74726f6c6c6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610a85565b60008611610c1757610c17612ccd565b610c2086611d0e565b925060008311610c3257610c32612ccd565b610c3c8386611f67565b92999598509650909450505050565b610c53610aed565b8015610c5f5750600454155b15610c7057610c6c61158c565b6004555b565b60026000541415610cdf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a85565b600260005533610d0460015473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614610d81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a85565b6008805460009091557f0000000000000000000000000000000000000000000000000000000000000000610dcc73ffffffffffffffffffffffffffffffffffffffff8216848461222b565b5050600160005550565b60008080803373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610ea0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4f6e6c792063616c6c61626c652062792054656d707573436f6e74726f6c6c6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610a85565b610eab8888886116d3565b91955092509050610ebc84866122b8565b9250945094509450949050565b33610ee960015473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614610f66576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a85565b7f000000000000000000000000000000000000000000000000000000000000000081351115610ff1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4465706f736974206665652070657263656e74203e206d6178000000000000006044820152606401610a85565b7f00000000000000000000000000000000000000000000000000000000000000008160200135111561107f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4561726c792072656465656d206665652070657263656e74203e206d617800006044820152606401610a85565b7f00000000000000000000000000000000000000000000000000000000000000008160400135111561110d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4d61747572652072656465656d206665652070657263656e74203e206d6178006044820152606401610a85565b8035600555602081013560065560400135600755565b505050565b60025473ffffffffffffffffffffffffffffffffffffffff1633146111cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4f776e61626c653a204f6e6c792070726f706f736564206f776e65722063616e60448201527f20616363657074206f776e6572736869700000000000000000000000000000006064820152608401610a85565b6002546111f19073ffffffffffffffffffffffffffffffffffffffff16612343565b600280547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b815b92915050565b60008061122e61158c565b905060008361124657611241858361121b565b611248565b845b905061125481836123ba565b95945050505050565b61128160405180606001604052806000815260200160008152602001600081525090565b5060408051606081018252600554815260065460208201526007549181019190915290565b6000806112b161158c565b90506000806112c18787856123f1565b505091509150846112d257816112d4565b805b93505050505b9392505050565b60008080803373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146113ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4f6e6c792063616c6c61626c652062792054656d707573436f6e74726f6c6c6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610a85565b600086116113bb576113bb612ccd565b6113c58686611f67565b9299919850965090945092505050565b336113f560015473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614611472576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a85565b73ffffffffffffffffffffffffffffffffffffffff8116611515576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610a85565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217909255600154604051919216907fb51454ce8c7f26becd312a46c4815553887f2ec876a0b8dc813b87f62edf6f8090600090a350565b6040517f7a28fb88000000000000000000000000000000000000000000000000000000008152670de0b6b3a764000060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690637a28fb8890602401602060405180830381865afa158015611621573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109bb9190612cfc565b60006109bb61165261158c565b61265e565b60006109bb611664611645565b6126ae565b60007f000000000000000000000000000000000000000000000000000000000000000082101561169a57508161121d565b60006116c784847f00000000000000000000000000000000000000000000000000000000000000006127eb565b9050805b949350505050565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301526000918291829186917f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015611768573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178c9190612cfc565b10156117f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e73756666696369656e74207072696e636970616c732e00000000000000006044820152606401610a85565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff878116600483015285917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015611884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a89190612cfc565b1015611910576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f496e73756666696369656e74207969656c64732e0000000000000000000000006044820152606401610a85565b600061191a61158c565b9050600061192782612802565b509050801561193d57611938610c4b565b6119cc565b8587146119cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f496e657175616c20726564656d7074696f6e206e6f7420616c6c6f776564206260448201527f65666f7265206d617475726974792e00000000000000000000000000000000006064820152608401610a85565b6040517f79cc679000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8981166004830152602482018990527f000000000000000000000000000000000000000000000000000000000000000016906379cc679090604401600060405180830381600087803b158015611a5c57600080fd5b505af1158015611a70573d6000803e3d6000fd5b50506040517f79cc679000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b81166004830152602482018a90527f00000000000000000000000000000000000000000000000000000000000000001692506379cc67909150604401600060405180830381600087803b158015611b0457600080fd5b505af1158015611b18573d6000803e3d6000fd5b50505050611b278787846123f1565b6008805494995091975095508692909150600090611b46908490612d44565b92505081905550505093509350939050565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015260009182918616906370a0823190602401602060405180830381865afa158015611bc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bed9190612cfc565b9050611c1073ffffffffffffffffffffffffffffffffffffffff8616858561222b565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301528291908716906370a0823190602401602060405180830381865afa158015611c7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ca39190612cfc565b6112549190612d5c565b60007f000000000000000000000000000000000000000000000000000000000000000080831015611ce257600091505061121d565b6000611d068483611cff8882611cf88186612d5c565b91906128d1565b91906127eb565b905080611254565b6000813414611d1f57611d1f612ccd565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015611dac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd09190612cfc565b6040517fa1903eab00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811660048301529192507f00000000000000000000000000000000000000000000000000000000000000009091169063a1903eab90349060240160206040518083038185885af1158015611e84573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611ea99190612cfc565b506040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600090829073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015611f39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5d9190612cfc565b6116cb9190612d5c565b600080600080611f7561158c565b9050600080611f8383612802565b915091508115611fef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4d6174757269747920726561636865642e0000000000000000000000000000006044820152606401610a85565b8015612057576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f4e65676174697665207969656c642100000000000000000000000000000000006044820152606401610a85565b600554889080156120b35761208d82827f00000000000000000000000000000000000000000000000000000000000000006128d1565b95506120998683612d5c565b915085600860008282546120ad9190612d44565b90915550505b6120bd828661121b565b96506120c987866123ba565b6040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b81166004830152602482018390529199507f0000000000000000000000000000000000000000000000000000000000000000909116906340c10f1990604401600060405180830381600087803b15801561215e57600080fd5b505af1158015612172573d6000803e3d6000fd5b50506040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8c81166004830152602482018c90527f00000000000000000000000000000000000000000000000000000000000000001692506340c10f199150604401600060405180830381600087803b15801561220657600080fd5b505af115801561221a573d6000803e3d6000fd5b505050505050505092959194509250565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526111239084906128de565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603b60248201527f4c69646f54656d707573506f6f6c2e776974686472617746726f6d556e64657260448201527f6c79696e6750726f746f636f6c206e6f7420737570706f7274656400000000006064820152600090608401610a85565b6001805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000816123e77f000000000000000000000000000000000000000000000000000000000000000085612d73565b6112da9190612db0565b600080600080612400856129ea565b90507f0000000000000000000000000000000000000000000000000000000000000000811015612466577f00000000000000000000000000000000000000000000000000000000000000006124558289612d73565b61245f9190612db0565b92506125d1565b60006124927f000000000000000000000000000000000000000000000000000000000000000083612d5c565b905060006124e1827f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006127eb565b9050600061251089837f00000000000000000000000000000000000000000000000000000000000000006128d1565b905061251c818b612d44565b9550612526610aed565b801561253157508388115b156125cd576000612542858a612d5c565b905060006125bc612594837f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006128d1565b8c907f00000000000000000000000000000000000000000000000000000000000000006128d1565b90506125c8818b61121b565b965050505b5050505b6125db838661121b565b935060006125e7610aed565b6125f3576006546125f7565b6007545b9050801561265457600061262c86837f00000000000000000000000000000000000000000000000000000000000000006128d1565b90506126388187612d5c565b95506126448185612d44565b9350612650868861121b565b9450505b5093509350935093565b600061121d7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611cff856129ea565b60006126b8610aed565b156126c1575090565b426000807f000000000000000000000000000000000000000000000000000000000000000083106126f3576000612717565b827f0000000000000000000000000000000000000000000000000000000000000000035b9150507f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000003600061278a83837f00000000000000000000000000000000000000000000000000000000000000006127eb565b90506127d7817f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006128d1565b6127e19087612d44565b9695505050505050565b6000826127f88386612d73565b6116cb9190612db0565b60008061280d610aed565b1561283f57506001927f0000000000000000000000000000000000000000000000000000000000000000909210919050565b7f000000000000000000000000000000000000000000000000000000000000000083106128755750506000600981905591829150565b60095461288b5750504260095550600090600190565b4262093a8060095461289d9190612d44565b116128c557426003556128ae610aed565b6128ba576128ba612ccd565b506001928392509050565b50600092600192509050565b6000816127f88486612d73565b6000612940826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612a1c9092919063ffffffff16565b805190915015611123578080602001905181019061295e9190612deb565b611123576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610a85565b60006129f4610aed565b8015612a01575060045415155b1561121b57600454821061121b5760045461121d565b919050565b60606116cb848460008585843b612a8f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a85565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051612ab89190612e38565b60006040518083038185875af1925050503d8060008114612af5576040519150601f19603f3d011682016040523d82523d6000602084013e612afa565b606091505b5091509150612b0a828286612b15565b979650505050505050565b60608315612b245750816112da565b825115612b345782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a859190612e54565b803573ffffffffffffffffffffffffffffffffffffffff81168114612a1757600080fd5b60008060008060808587031215612ba257600080fd5b612bab85612b68565b93506020850135925060408501359150612bc760608601612b68565b905092959194509250565b60008060408385031215612be557600080fd5b82359150612bf560208401612b68565b90509250929050565b600060208284031215612c1057600080fd5b6112da82612b68565b600060608284031215612c2b57600080fd5b50919050565b60008060408385031215612c4457600080fd5b50508035926020909101359150565b8015158114612c6157600080fd5b50565b60008060408385031215612c7757600080fd5b823591506020830135612c8981612c53565b809150509250929050565b600080600060608486031215612ca957600080fd5b83359250602084013591506040840135612cc281612c53565b809150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600060208284031215612d0e57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115612d5757612d57612d15565b500190565b600082821015612d6e57612d6e612d15565b500390565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612dab57612dab612d15565b500290565b600082612de6577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600060208284031215612dfd57600080fd5b81516112da81612c53565b60005b83811015612e23578181015183820152602001612e0b565b83811115612e32576000848401525b50505050565b60008251612e4a818460208701612e08565b9190910192915050565b6020815260008251806020840152612e73816040850160208701612e08565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea2646970667358221220f7363e89d5ec0c441e6f563541f071418ace51b7590a7e10a236e159f59e6d0664736f6c634300080a00336101006040523480156200001257600080fd5b50604051620017483803806200174883398101604081905262000035916200023b565b60008484848482828181816003908051906020019062000057929190620000c8565b5080516200006d906004906020840190620000c8565b505033608052508691505060018111156200008c576200008c620002df565b60a0816001811115620000a357620000a3620002df565b9052506001600160a01b0390931660c052505060ff1660e05250620003329350505050565b828054620000d690620002f5565b90600052602060002090601f016020900481019282620000fa576000855562000145565b82601f106200011557805160ff191683800117855562000145565b8280016001018555821562000145579182015b828111156200014557825182559160200191906001019062000128565b506200015392915062000157565b5090565b5b8082111562000153576000815560010162000158565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200019657600080fd5b81516001600160401b0380821115620001b357620001b36200016e565b604051601f8301601f19908116603f01168101908282118183101715620001de57620001de6200016e565b81604052838152602092508683858801011115620001fb57600080fd5b600091505b838210156200021f578582018301518183018401529082019062000200565b83821115620002315760008385830101525b9695505050505050565b600080600080608085870312156200025257600080fd5b84516001600160a01b03811681146200026a57600080fd5b60208601519094506001600160401b03808211156200028857600080fd5b620002968883890162000184565b94506040870151915080821115620002ad57600080fd5b50620002bc8782880162000184565b925050606085015160ff81168114620002d457600080fd5b939692955090935050565b634e487b7160e01b600052602160045260246000fd5b600181811c908216806200030a57607f821691505b602082108114156200032c57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e0516113b26200039660003960006102430152600081816101d0015281816106f501526108360152600061015b0152600081816102ad015281816105900152818161063d015281816106c901526107a101526113b26000f3fe608060405234801561001057600080fd5b50600436106101515760003560e01c806342966c68116100cd578063946731d011610081578063a457c2d711610066578063a457c2d714610330578063a9059cbb14610343578063dd62ed3e1461035657600080fd5b8063946731d01461032057806395d89b411461032857600080fd5b806370a08231116100b257806370a08231146102cf57806377c7b8fc1461030557806379cc67901461030d57600080fd5b806342966c6814610295578063481c6a75146102a857600080fd5b806318160ddd11610124578063313ce56711610109578063313ce5671461023c578063395093511461026d57806340c10f191461028057600080fd5b806318160ddd1461021757806323b872dd1461022957600080fd5b806304baa00b1461015657806306fdde0314610193578063095ea7b3146101a857806316f0115b146101cb575b600080fd5b61017d7f000000000000000000000000000000000000000000000000000000000000000081565b60405161018a9190611100565b60405180910390f35b61019b61039c565b60405161018a9190611141565b6101bb6101b63660046111dd565b61042e565b604051901515815260200161018a565b6101f27f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161018a565b6002545b60405190815260200161018a565b6101bb610237366004611207565b610444565b60405160ff7f000000000000000000000000000000000000000000000000000000000000000016815260200161018a565b6101bb61027b3660046111dd565b61052f565b61029361028e3660046111dd565b610578565b005b6102936102a3366004611243565b610625565b6101f27f000000000000000000000000000000000000000000000000000000000000000081565b61021b6102dd36600461125c565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b61021b6106f1565b61029361031b3660046111dd565b610789565b61021b610832565b61019b61089f565b6101bb61033e3660046111dd565b6108ae565b6101bb6103513660046111dd565b610986565b61021b61036436600461127e565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b6060600380546103ab906112b1565b80601f01602080910402602001604051908101604052809291908181526020018280546103d7906112b1565b80156104245780601f106103f957610100808354040283529160200191610424565b820191906000526020600020905b81548152906001019060200180831161040757829003601f168201915b5050505050905090565b600061043b338484610993565b50600192915050565b6000610451848484610b47565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020908152604080832033845290915290205482811015610517576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e636500000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6105248533858403610993565b506001949350505050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909161043b918590610573908690611334565b610993565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610617576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f6d696e743a206f6e6c79206d616e616765722063616e206d696e740000000000604482015260640161050e565b6106218282610dfb565b5050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146106c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f6275726e3a206f6e6c79206d616e616765722063616e206275726e0000000000604482015260640161050e565b6106ee7f000000000000000000000000000000000000000000000000000000000000000082610f1b565b50565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663b468d2446040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610760573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610784919061134c565b905090565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610828576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f6275726e3a206f6e6c79206d616e616765722063616e206275726e0000000000604482015260640161050e565b6106218282610f1b565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632675323d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610760573d6000803e3d6000fd5b6060600480546103ab906112b1565b33600090815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff861684529091528120548281101561096f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f000000000000000000000000000000000000000000000000000000606482015260840161050e565b61097c3385858403610993565b5060019392505050565b600061043b338484610b47565b73ffffffffffffffffffffffffffffffffffffffff8316610a35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161050e565b73ffffffffffffffffffffffffffffffffffffffff8216610ad8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161050e565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316610bea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161050e565b73ffffffffffffffffffffffffffffffffffffffff8216610c8d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161050e565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015610d43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e63650000000000000000000000000000000000000000000000000000606482015260840161050e565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220858503905591851681529081208054849290610d87908490611334565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610ded91815260200190565b60405180910390a350505050565b73ffffffffffffffffffffffffffffffffffffffff8216610e78576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161050e565b8060026000828254610e8a9190611334565b909155505073ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604081208054839290610ec4908490611334565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff8216610fbe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161050e565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090205481811015611074576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f6365000000000000000000000000000000000000000000000000000000000000606482015260840161050e565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604081208383039055600280548492906110b0908490611365565b909155505060405182815260009073ffffffffffffffffffffffffffffffffffffffff8516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610b3a565b602081016002831061113b577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b600060208083528351808285015260005b8181101561116e57858101830151858201604001528201611152565b81811115611180576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b803573ffffffffffffffffffffffffffffffffffffffff811681146111d857600080fd5b919050565b600080604083850312156111f057600080fd5b6111f9836111b4565b946020939093013593505050565b60008060006060848603121561121c57600080fd5b611225846111b4565b9250611233602085016111b4565b9150604084013590509250925092565b60006020828403121561125557600080fd5b5035919050565b60006020828403121561126e57600080fd5b611277826111b4565b9392505050565b6000806040838503121561129157600080fd5b61129a836111b4565b91506112a8602084016111b4565b90509250929050565b600181811c908216806112c557607f821691505b602082108114156112ff577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561134757611347611305565b500190565b60006020828403121561135e57600080fd5b5051919050565b60008282101561137757611377611305565b50039056fea2646970667358221220b7a03230f80c3fafa9373dbb2e1476b6b8e912e89fc622f9efca1bdb101b7f0d64736f6c634300080a00336101006040523480156200001257600080fd5b50604051620017483803806200174883398101604081905262000035916200023b565b60018484848482828181816003908051906020019062000057929190620000c8565b5080516200006d906004906020840190620000c8565b505033608052508691505060018111156200008c576200008c620002df565b60a0816001811115620000a357620000a3620002df565b9052506001600160a01b0390931660c052505060ff1660e05250620003329350505050565b828054620000d690620002f5565b90600052602060002090601f016020900481019282620000fa576000855562000145565b82601f106200011557805160ff191683800117855562000145565b8280016001018555821562000145579182015b828111156200014557825182559160200191906001019062000128565b506200015392915062000157565b5090565b5b8082111562000153576000815560010162000158565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200019657600080fd5b81516001600160401b0380821115620001b357620001b36200016e565b604051601f8301601f19908116603f01168101908282118183101715620001de57620001de6200016e565b81604052838152602092508683858801011115620001fb57600080fd5b600091505b838210156200021f578582018301518183018401529082019062000200565b83821115620002315760008385830101525b9695505050505050565b600080600080608085870312156200025257600080fd5b84516001600160a01b03811681146200026a57600080fd5b60208601519094506001600160401b03808211156200028857600080fd5b620002968883890162000184565b94506040870151915080821115620002ad57600080fd5b50620002bc8782880162000184565b925050606085015160ff81168114620002d457600080fd5b939692955090935050565b634e487b7160e01b600052602160045260246000fd5b600181811c908216806200030a57607f821691505b602082108114156200032c57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e0516113b26200039660003960006102430152600081816101d0015281816106f501526108360152600061015b0152600081816102ad015281816105900152818161063d015281816106c901526107a101526113b26000f3fe608060405234801561001057600080fd5b50600436106101515760003560e01c806342966c68116100cd578063946731d011610081578063a457c2d711610066578063a457c2d714610330578063a9059cbb14610343578063dd62ed3e1461035657600080fd5b8063946731d01461032057806395d89b411461032857600080fd5b806370a08231116100b257806370a08231146102cf57806377c7b8fc1461030557806379cc67901461030d57600080fd5b806342966c6814610295578063481c6a75146102a857600080fd5b806318160ddd11610124578063313ce56711610109578063313ce5671461023c578063395093511461026d57806340c10f191461028057600080fd5b806318160ddd1461021757806323b872dd1461022957600080fd5b806304baa00b1461015657806306fdde0314610193578063095ea7b3146101a857806316f0115b146101cb575b600080fd5b61017d7f000000000000000000000000000000000000000000000000000000000000000081565b60405161018a9190611100565b60405180910390f35b61019b61039c565b60405161018a9190611141565b6101bb6101b63660046111dd565b61042e565b604051901515815260200161018a565b6101f27f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161018a565b6002545b60405190815260200161018a565b6101bb610237366004611207565b610444565b60405160ff7f000000000000000000000000000000000000000000000000000000000000000016815260200161018a565b6101bb61027b3660046111dd565b61052f565b61029361028e3660046111dd565b610578565b005b6102936102a3366004611243565b610625565b6101f27f000000000000000000000000000000000000000000000000000000000000000081565b61021b6102dd36600461125c565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b61021b6106f1565b61029361031b3660046111dd565b610789565b61021b610832565b61019b61089f565b6101bb61033e3660046111dd565b6108ae565b6101bb6103513660046111dd565b610986565b61021b61036436600461127e565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b6060600380546103ab906112b1565b80601f01602080910402602001604051908101604052809291908181526020018280546103d7906112b1565b80156104245780601f106103f957610100808354040283529160200191610424565b820191906000526020600020905b81548152906001019060200180831161040757829003601f168201915b5050505050905090565b600061043b338484610993565b50600192915050565b6000610451848484610b47565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020908152604080832033845290915290205482811015610517576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e636500000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6105248533858403610993565b506001949350505050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909161043b918590610573908690611334565b610993565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610617576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f6d696e743a206f6e6c79206d616e616765722063616e206d696e740000000000604482015260640161050e565b6106218282610dfb565b5050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146106c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f6275726e3a206f6e6c79206d616e616765722063616e206275726e0000000000604482015260640161050e565b6106ee7f000000000000000000000000000000000000000000000000000000000000000082610f1b565b50565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16634e18f3246040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610760573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610784919061134c565b905090565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610828576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f6275726e3a206f6e6c79206d616e616765722063616e206275726e0000000000604482015260640161050e565b6106218282610f1b565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16634570452a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610760573d6000803e3d6000fd5b6060600480546103ab906112b1565b33600090815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff861684529091528120548281101561096f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f000000000000000000000000000000000000000000000000000000606482015260840161050e565b61097c3385858403610993565b5060019392505050565b600061043b338484610b47565b73ffffffffffffffffffffffffffffffffffffffff8316610a35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161050e565b73ffffffffffffffffffffffffffffffffffffffff8216610ad8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161050e565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316610bea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161050e565b73ffffffffffffffffffffffffffffffffffffffff8216610c8d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161050e565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015610d43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e63650000000000000000000000000000000000000000000000000000606482015260840161050e565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220858503905591851681529081208054849290610d87908490611334565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610ded91815260200190565b60405180910390a350505050565b73ffffffffffffffffffffffffffffffffffffffff8216610e78576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161050e565b8060026000828254610e8a9190611334565b909155505073ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604081208054839290610ec4908490611334565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff8216610fbe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161050e565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090205481811015611074576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f6365000000000000000000000000000000000000000000000000000000000000606482015260840161050e565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604081208383039055600280548492906110b0908490611365565b909155505060405182815260009073ffffffffffffffffffffffffffffffffffffffff8516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610b3a565b602081016002831061113b577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b600060208083528351808285015260005b8181101561116e57858101830151858201604001528201611152565b81811115611180576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b803573ffffffffffffffffffffffffffffffffffffffff811681146111d857600080fd5b919050565b600080604083850312156111f057600080fd5b6111f9836111b4565b946020939093013593505050565b60008060006060848603121561121c57600080fd5b611225846111b4565b9250611233602085016111b4565b9150604084013590509250925092565b60006020828403121561125557600080fd5b5035919050565b60006020828403121561126e57600080fd5b611277826111b4565b9392505050565b6000806040838503121561129157600080fd5b61129a836111b4565b91506112a8602084016111b4565b90509250929050565b600181811c908216806112c557607f821691505b602082108114156112ff577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561134757611347611305565b500190565b60006020828403121561135e57600080fd5b5051919050565b60008282101561137757611377611305565b50039056fea2646970667358221220f41432f7511c2c3dc088bd74818046440fa590329fa23a007e79942f9dc1198e64736f6c634300080a0033000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe84000000000000000000000000db5fd0678eed82246b599da6bc36b56157e4bed800000000000000000000000000000000000000000000000000000000630e34000000000000000000000000000000000000000000000000000077090e58c585a000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000102afcf24d4c1db4639df9e255391f9e09aaa08700000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001d5450532d4c69646f207374616b6564204554482d33302d372d3230323200000000000000000000000000000000000000000000000000000000000000000000135450532d73744554482d33302d372d323032320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001d5459532d4c69646f207374616b6564204554482d33302d372d3230323200000000000000000000000000000000000000000000000000000000000000000000135459532d73744554482d33302d372d3230323200000000000000000000000000

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

000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe84000000000000000000000000db5fd0678eed82246b599da6bc36b56157e4bed800000000000000000000000000000000000000000000000000000000630e34000000000000000000000000000000000000000000000000000077090e58c585a000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000102afcf24d4c1db4639df9e255391f9e09aaa08700000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001d5450532d4c69646f207374616b6564204554482d33302d372d3230323200000000000000000000000000000000000000000000000000000000000000000000135450532d73744554482d33302d372d323032320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001d5459532d4c69646f207374616b6564204554482d33302d372d3230323200000000000000000000000000000000000000000000000000000000000000000000135459532d73744554482d33302d372d3230323200000000000000000000000000

-----Decoded View---------------
Arg [0] : token (address): 0xae7ab96520de3a18e5e111b5eaab095312d7fe84
Arg [1] : controller (address): 0xdb5fd0678eed82246b599da6bc36b56157e4bed8
Arg [2] : maturity (uint256): 1661875200
Arg [3] : estYield (uint256): 33505479452100000
Arg [4] : principalsData (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
Arg [5] : yieldsData (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
Arg [6] : maxFeeSetup (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
Arg [7] : referrerAddress (address): 0x102afcf24d4c1db4639df9e255391f9e09aaa087

-----Encoded View---------------
22 Constructor Arguments found :
Arg [0] : 000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe84
Arg [1] : 000000000000000000000000db5fd0678eed82246b599da6bc36b56157e4bed8
Arg [2] : 00000000000000000000000000000000000000000000000000000000630e3400
Arg [3] : 0000000000000000000000000000000000000000000000000077090e58c585a0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000200
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [9] : 000000000000000000000000102afcf24d4c1db4639df9e255391f9e09aaa087
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [12] : 000000000000000000000000000000000000000000000000000000000000001d
Arg [13] : 5450532d4c69646f207374616b6564204554482d33302d372d32303232000000
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000013
Arg [15] : 5450532d73744554482d33302d372d3230323200000000000000000000000000
Arg [16] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [17] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [18] : 000000000000000000000000000000000000000000000000000000000000001d
Arg [19] : 5459532d4c69646f207374616b6564204554482d33302d372d32303232000000
Arg [20] : 0000000000000000000000000000000000000000000000000000000000000013
Arg [21] : 5459532d73744554482d33302d372d3230323200000000000000000000000000


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.