ETH Price: $2,508.04 (-5.21%)

Contract

0xE30521fe7f3bEB6Ad556887b50739d6C7CA667E6
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00
Transaction Hash
Method
Block
From
To
0x61012060156549162022-10-01 17:52:59761 days ago1664646779IN
 Create: sfrxETH
0 ETH0.0170354710.17244319

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
sfrxETH

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 9 : sfrxETH.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.0;

// ====================================================================
// |     ______                   _______                             |
// |    / _____________ __  __   / ____(_____  ____ _____  ________   |
// |   / /_  / ___/ __ `| |/_/  / /_  / / __ \/ __ `/ __ \/ ___/ _ \  |
// |  / __/ / /  / /_/ _>  <   / __/ / / / / / /_/ / / / / /__/  __/  |
// | /_/   /_/   \__,_/_/|_|  /_/   /_/_/ /_/\__,_/_/ /_/\___/\___/   |
// |                                                                  |
// ====================================================================
// ============================== sfrxETH =============================
// ====================================================================
// Frax Finance: https://github.com/FraxFinance

// Primary Author(s)
// Jack Corddry: https://github.com/corddry
// Nader Ghazvini: https://github.com/amirnader-ghazvini 

// Reviewer(s) / Contributor(s)
// Sam Kazemian: https://github.com/samkazemian
// Dennett: https://github.com/denett
// Travis Moore: https://github.com/FortisFortuna
// Jamie Turley: https://github.com/jyturley

import { ERC20, ERC4626, xERC4626 } from "ERC4626/xERC4626.sol";
import "openzeppelin-contracts/contracts/security/ReentrancyGuard.sol";

/// @title Vault token for staked frxETH
/// @notice Is a vault that takes frxETH and gives you sfrxETH erc20 tokens
/** @dev Exchange rate between frxETH and sfrxETH floats, you can convert your sfrxETH for more frxETH over time.
    Exchange rate increases as the frax msig mints new frxETH corresponding to the staking yield and drops it into the vault (sfrxETH contract).
    There is a short time period, “cycles” which the exchange rate increases linearly over. This is to prevent gaming the exchange rate (MEV).
    The cycles are constant length, but calling syncRewards slightly into a would-be cycle keeps the same would-be endpoint (so cycle ends are every X seconds).
    Someone must call syncRewards, which queues any new frxETH in the contract to be added to the redeemable amount.
    sfrxETH adheres to ERC-4626 vault specs 
    Mint vs Deposit
    mint() - deposit targeting a specific number of sfrxETH out
    deposit() - deposit knowing a specific number of frxETH in */
contract sfrxETH is xERC4626, ReentrancyGuard {

    modifier andSync {
        if (block.timestamp >= rewardsCycleEnd) { syncRewards(); } 
        _;
    }

    /* ========== CONSTRUCTOR ========== */
    constructor(ERC20 _underlying, uint32 _rewardsCycleLength)
        ERC4626(_underlying, "Staked Frax Ether", "sfrxETH")
        xERC4626(_rewardsCycleLength)
    {}

    /// @notice inlines syncRewards with deposits when able
    function deposit(uint256 assets, address receiver) public override andSync returns (uint256 shares) {
        return super.deposit(assets, receiver);
    }
    
    /// @notice inlines syncRewards with mints when able
    function mint(uint256 shares, address receiver) public override andSync returns (uint256 assets) {
        return super.mint(shares, receiver);
    }

    /// @notice inlines syncRewards with withdrawals when able
    function withdraw(
        uint256 assets,
        address receiver,
        address owner
    ) public override andSync returns (uint256 shares) {
        return super.withdraw(assets, receiver, owner);
    }

    /// @notice inlines syncRewards with redemptions when able
    function redeem(
        uint256 shares,
        address receiver,
        address owner
    ) public override andSync returns (uint256 assets) {
        return super.redeem(shares, receiver, owner);
    }

    /// @notice How much frxETH is 1E18 sfrxETH worth. Price is in ETH, not USD
    function pricePerShare() public view returns (uint256) {
        return convertToAssets(1e18);
    }

    /// @notice Approve and deposit() in one transaction
    function depositWithSignature(
        uint256 assets,
        address receiver,
        uint256 deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external nonReentrant returns (uint256 shares) {
        uint256 amount = approveMax ? type(uint256).max : assets;
        asset.permit(msg.sender, address(this), amount, deadline, v, r, s);
        return (deposit(assets, receiver));
    }

}

File 2 of 9 : xERC4626.sol
// SPDX-License-Identifier: MIT
// Rewards logic inspired by xERC20 (https://github.com/ZeframLou/playpen/blob/main/src/xERC20.sol)

pragma solidity ^0.8.0;

import "solmate/mixins/ERC4626.sol";
import "solmate/utils/SafeCastLib.sol";

import "./interfaces/IxERC4626.sol";

/** 
 @title  An xERC4626 Single Staking Contract
 @notice This contract allows users to autocompound rewards denominated in an underlying reward token. 
         It is fully compatible with [ERC4626](https://eips.ethereum.org/EIPS/eip-4626) allowing for DeFi composability.
         It maintains balances using internal accounting to prevent instantaneous changes in the exchange rate.
         NOTE: an exception is at contract creation, when a reward cycle begins before the first deposit. After the first deposit, exchange rate updates smoothly.

         Operates on "cycles" which distribute the rewards surplus over the internal balance to users linearly over the remainder of the cycle window.
*/
abstract contract xERC4626 is IxERC4626, ERC4626 {
    using SafeCastLib for *;

    /// @notice the maximum length of a rewards cycle
    uint32 public immutable rewardsCycleLength;

    /// @notice the effective start of the current cycle
    uint32 public lastSync;

    /// @notice the end of the current cycle. Will always be evenly divisible by `rewardsCycleLength`.
    uint32 public rewardsCycleEnd;

    /// @notice the amount of rewards distributed in a the most recent cycle.
    uint192 public lastRewardAmount;

    uint256 internal storedTotalAssets;

    constructor(uint32 _rewardsCycleLength) {
        rewardsCycleLength = _rewardsCycleLength;
        // seed initial rewardsCycleEnd
        rewardsCycleEnd = (block.timestamp.safeCastTo32() / rewardsCycleLength) * rewardsCycleLength;
    }

    /// @notice Compute the amount of tokens available to share holders.
    ///         Increases linearly during a reward distribution period from the sync call, not the cycle start.
    function totalAssets() public view override returns (uint256) {
        // cache global vars
        uint256 storedTotalAssets_ = storedTotalAssets;
        uint192 lastRewardAmount_ = lastRewardAmount;
        uint32 rewardsCycleEnd_ = rewardsCycleEnd;
        uint32 lastSync_ = lastSync;

        if (block.timestamp >= rewardsCycleEnd_) {
            // no rewards or rewards fully unlocked
            // entire reward amount is available
            return storedTotalAssets_ + lastRewardAmount_;
        }

        // rewards not fully unlocked
        // add unlocked rewards to stored total
        uint256 unlockedRewards = (lastRewardAmount_ * (block.timestamp - lastSync_)) / (rewardsCycleEnd_ - lastSync_);
        return storedTotalAssets_ + unlockedRewards;
    }

    // Update storedTotalAssets on withdraw/redeem
    function beforeWithdraw(uint256 amount, uint256 shares) internal virtual override {
        super.beforeWithdraw(amount, shares);
        storedTotalAssets -= amount;
    }

    // Update storedTotalAssets on deposit/mint
    function afterDeposit(uint256 amount, uint256 shares) internal virtual override {
        storedTotalAssets += amount;
        super.afterDeposit(amount, shares);
    }

    /// @notice Distributes rewards to xERC4626 holders.
    /// All surplus `asset` balance of the contract over the internal balance becomes queued for the next cycle.
    function syncRewards() public virtual {
        uint192 lastRewardAmount_ = lastRewardAmount;
        uint32 timestamp = block.timestamp.safeCastTo32();

        if (timestamp < rewardsCycleEnd) revert SyncError();

        uint256 storedTotalAssets_ = storedTotalAssets;
        uint256 nextRewards = asset.balanceOf(address(this)) - storedTotalAssets_ - lastRewardAmount_;

        storedTotalAssets = storedTotalAssets_ + lastRewardAmount_; // SSTORE

        uint32 end = ((timestamp + rewardsCycleLength) / rewardsCycleLength) * rewardsCycleLength;

        // Combined single SSTORE
        lastRewardAmount = nextRewards.safeCastTo192();
        lastSync = timestamp;
        rewardsCycleEnd = end;

        emit NewRewardsCycle(end, nextRewards);
    }
}

File 3 of 9 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

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

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

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

import {ERC20} from "../tokens/ERC20.sol";
import {SafeTransferLib} from "../utils/SafeTransferLib.sol";
import {FixedPointMathLib} from "../utils/FixedPointMathLib.sol";

/// @notice Minimal ERC4626 tokenized Vault implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/mixins/ERC4626.sol)
abstract contract ERC4626 is ERC20 {
    using SafeTransferLib for ERC20;
    using FixedPointMathLib for uint256;

    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event Deposit(address indexed caller, address indexed owner, uint256 assets, uint256 shares);

    event Withdraw(
        address indexed caller,
        address indexed receiver,
        address indexed owner,
        uint256 assets,
        uint256 shares
    );

    /*//////////////////////////////////////////////////////////////
                               IMMUTABLES
    //////////////////////////////////////////////////////////////*/

    ERC20 public immutable asset;

    constructor(
        ERC20 _asset,
        string memory _name,
        string memory _symbol
    ) ERC20(_name, _symbol, _asset.decimals()) {
        asset = _asset;
    }

    /*//////////////////////////////////////////////////////////////
                        DEPOSIT/WITHDRAWAL LOGIC
    //////////////////////////////////////////////////////////////*/

    function deposit(uint256 assets, address receiver) public virtual returns (uint256 shares) {
        // Check for rounding error since we round down in previewDeposit.
        require((shares = previewDeposit(assets)) != 0, "ZERO_SHARES");

        // Need to transfer before minting or ERC777s could reenter.
        asset.safeTransferFrom(msg.sender, address(this), assets);

        _mint(receiver, shares);

        emit Deposit(msg.sender, receiver, assets, shares);

        afterDeposit(assets, shares);
    }

    function mint(uint256 shares, address receiver) public virtual returns (uint256 assets) {
        assets = previewMint(shares); // No need to check for rounding error, previewMint rounds up.

        // Need to transfer before minting or ERC777s could reenter.
        asset.safeTransferFrom(msg.sender, address(this), assets);

        _mint(receiver, shares);

        emit Deposit(msg.sender, receiver, assets, shares);

        afterDeposit(assets, shares);
    }

    function withdraw(
        uint256 assets,
        address receiver,
        address owner
    ) public virtual returns (uint256 shares) {
        shares = previewWithdraw(assets); // No need to check for rounding error, previewWithdraw rounds up.

        if (msg.sender != owner) {
            uint256 allowed = allowance[owner][msg.sender]; // Saves gas for limited approvals.

            if (allowed != type(uint256).max) allowance[owner][msg.sender] = allowed - shares;
        }

        beforeWithdraw(assets, shares);

        _burn(owner, shares);

        emit Withdraw(msg.sender, receiver, owner, assets, shares);

        asset.safeTransfer(receiver, assets);
    }

    function redeem(
        uint256 shares,
        address receiver,
        address owner
    ) public virtual returns (uint256 assets) {
        if (msg.sender != owner) {
            uint256 allowed = allowance[owner][msg.sender]; // Saves gas for limited approvals.

            if (allowed != type(uint256).max) allowance[owner][msg.sender] = allowed - shares;
        }

        // Check for rounding error since we round down in previewRedeem.
        require((assets = previewRedeem(shares)) != 0, "ZERO_ASSETS");

        beforeWithdraw(assets, shares);

        _burn(owner, shares);

        emit Withdraw(msg.sender, receiver, owner, assets, shares);

        asset.safeTransfer(receiver, assets);
    }

    /*//////////////////////////////////////////////////////////////
                            ACCOUNTING LOGIC
    //////////////////////////////////////////////////////////////*/

    function totalAssets() public view virtual returns (uint256);

    function convertToShares(uint256 assets) public view virtual returns (uint256) {
        uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero.

        return supply == 0 ? assets : assets.mulDivDown(supply, totalAssets());
    }

    function convertToAssets(uint256 shares) public view virtual returns (uint256) {
        uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero.

        return supply == 0 ? shares : shares.mulDivDown(totalAssets(), supply);
    }

    function previewDeposit(uint256 assets) public view virtual returns (uint256) {
        return convertToShares(assets);
    }

    function previewMint(uint256 shares) public view virtual returns (uint256) {
        uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero.

        return supply == 0 ? shares : shares.mulDivUp(totalAssets(), supply);
    }

    function previewWithdraw(uint256 assets) public view virtual returns (uint256) {
        uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero.

        return supply == 0 ? assets : assets.mulDivUp(supply, totalAssets());
    }

    function previewRedeem(uint256 shares) public view virtual returns (uint256) {
        return convertToAssets(shares);
    }

    /*//////////////////////////////////////////////////////////////
                     DEPOSIT/WITHDRAWAL LIMIT LOGIC
    //////////////////////////////////////////////////////////////*/

    function maxDeposit(address) public view virtual returns (uint256) {
        return type(uint256).max;
    }

    function maxMint(address) public view virtual returns (uint256) {
        return type(uint256).max;
    }

    function maxWithdraw(address owner) public view virtual returns (uint256) {
        return convertToAssets(balanceOf[owner]);
    }

    function maxRedeem(address owner) public view virtual returns (uint256) {
        return balanceOf[owner];
    }

    /*//////////////////////////////////////////////////////////////
                          INTERNAL HOOKS LOGIC
    //////////////////////////////////////////////////////////////*/

    function beforeWithdraw(uint256 assets, uint256 shares) internal virtual {}

    function afterDeposit(uint256 assets, uint256 shares) internal virtual {}
}

File 5 of 9 : SafeCastLib.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Safe unsigned integer casting library that reverts on overflow.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeCastLib.sol)
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeCast.sol)
library SafeCastLib {
    function safeCastTo248(uint256 x) internal pure returns (uint248 y) {
        require(x < 1 << 248);

        y = uint248(x);
    }

    function safeCastTo224(uint256 x) internal pure returns (uint224 y) {
        require(x < 1 << 224);

        y = uint224(x);
    }

    function safeCastTo192(uint256 x) internal pure returns (uint192 y) {
        require(x < 1 << 192);

        y = uint192(x);
    }

    function safeCastTo160(uint256 x) internal pure returns (uint160 y) {
        require(x < 1 << 160);

        y = uint160(x);
    }

    function safeCastTo128(uint256 x) internal pure returns (uint128 y) {
        require(x < 1 << 128);

        y = uint128(x);
    }

    function safeCastTo96(uint256 x) internal pure returns (uint96 y) {
        require(x < 1 << 96);

        y = uint96(x);
    }

    function safeCastTo64(uint256 x) internal pure returns (uint64 y) {
        require(x < 1 << 64);

        y = uint64(x);
    }

    function safeCastTo32(uint256 x) internal pure returns (uint32 y) {
        require(x < 1 << 32);

        y = uint32(x);
    }

    function safeCastTo24(uint256 x) internal pure returns (uint24 y) {
        require(x < 1 << 24);

        y = uint24(x);
    }

    function safeCastTo16(uint256 x) internal pure returns (uint16 y) {
        require(x < 1 << 16);

        y = uint16(x);
    }

    function safeCastTo8(uint256 x) internal pure returns (uint8 y) {
        require(x < 1 << 8);

        y = uint8(x);
    }
}

File 6 of 9 : IxERC4626.sol
// SPDX-License-Identifier: MIT
// Rewards logic inspired by xERC20 (https://github.com/ZeframLou/playpen/blob/main/src/xERC20.sol)

pragma solidity ^0.8.0;

import "solmate/mixins/ERC4626.sol";
import "solmate/utils/SafeCastLib.sol";

/** 
 @title  An xERC4626 Single Staking Contract Interface
 @notice This contract allows users to autocompound rewards denominated in an underlying reward token. 
         It is fully compatible with [ERC4626](https://eips.ethereum.org/EIPS/eip-4626) allowing for DeFi composability.
         It maintains balances using internal accounting to prevent instantaneous changes in the exchange rate.
         NOTE: an exception is at contract creation, when a reward cycle begins before the first deposit. After the first deposit, exchange rate updates smoothly.

         Operates on "cycles" which distribute the rewards surplus over the internal balance to users linearly over the remainder of the cycle window.
*/
interface IxERC4626 {
    /*////////////////////////////////////////////////////////
                        Custom Errors
    ////////////////////////////////////////////////////////*/

    /// @dev thrown when syncing before cycle ends.
    error SyncError();

    /*////////////////////////////////////////////////////////
                            Events
    ////////////////////////////////////////////////////////*/

    /// @dev emit every time a new rewards cycle starts
    event NewRewardsCycle(uint32 indexed cycleEnd, uint256 rewardAmount);

    /*////////////////////////////////////////////////////////
                        View Methods
    ////////////////////////////////////////////////////////*/

    /// @notice the maximum length of a rewards cycle
    function rewardsCycleLength() external view returns (uint32);

    /// @notice the effective start of the current cycle
    /// NOTE: This will likely be after `rewardsCycleEnd - rewardsCycleLength` as this is set as block.timestamp of the last `syncRewards` call.
    function lastSync() external view returns (uint32);

    /// @notice the end of the current cycle. Will always be evenly divisible by `rewardsCycleLength`.
    function rewardsCycleEnd() external view returns (uint32);

    /// @notice the amount of rewards distributed in a the most recent cycle
    function lastRewardAmount() external view returns (uint192);

    /*////////////////////////////////////////////////////////
                    State Changing Methods
    ////////////////////////////////////////////////////////*/

    /// @notice Distributes rewards to xERC4626 holders.
    /// All surplus `asset` balance of the contract over the internal balance becomes queued for the next cycle.
    function syncRewards() external;
}

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

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

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

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

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

    string public name;

    string public symbol;

    uint8 public immutable decimals;

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

    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;

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

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

    uint256 internal immutable INITIAL_CHAIN_ID;

    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;

    mapping(address => uint256) public nonces;

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

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

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

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

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

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

        return true;
    }

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

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

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

        return true;
    }

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

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

        balanceOf[from] -= amount;

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

        emit Transfer(from, to, amount);

        return true;
    }

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

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

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

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

            allowance[recoveredAddress][spender] = value;
        }

        emit Approval(owner, spender, value);
    }

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

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

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

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

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

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

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

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

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

File 8 of 9 : SafeTransferLib.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

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

/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.
/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.
library SafeTransferLib {
    /*//////////////////////////////////////////////////////////////
                             ETH OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferETH(address to, uint256 amount) internal {
        bool success;

        assembly {
            // Transfer the ETH and store if it succeeded or not.
            success := call(gas(), to, amount, 0, 0, 0, 0)
        }

        require(success, "ETH_TRANSFER_FAILED");
    }

    /*//////////////////////////////////////////////////////////////
                            ERC20 OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferFrom(
        ERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        bool success;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), from) // Append the "from" argument.
            mstore(add(freeMemoryPointer, 36), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)
            )
        }

        require(success, "TRANSFER_FROM_FAILED");
    }

    function safeTransfer(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "TRANSFER_FAILED");
    }

    function safeApprove(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "APPROVE_FAILED");
    }
}

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

/// @notice Arithmetic library with operations for fixed-point numbers.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/FixedPointMathLib.sol)
/// @author Inspired by USM (https://github.com/usmfum/USM/blob/master/contracts/WadMath.sol)
library FixedPointMathLib {
    /*//////////////////////////////////////////////////////////////
                    SIMPLIFIED FIXED POINT OPERATIONS
    //////////////////////////////////////////////////////////////*/

    uint256 internal constant WAD = 1e18; // The scalar of ETH and most ERC20s.

    function mulWadDown(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivDown(x, y, WAD); // Equivalent to (x * y) / WAD rounded down.
    }

    function mulWadUp(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivUp(x, y, WAD); // Equivalent to (x * y) / WAD rounded up.
    }

    function divWadDown(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivDown(x, WAD, y); // Equivalent to (x * WAD) / y rounded down.
    }

    function divWadUp(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivUp(x, WAD, y); // Equivalent to (x * WAD) / y rounded up.
    }

    /*//////////////////////////////////////////////////////////////
                    LOW LEVEL FIXED POINT OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function mulDivDown(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 z) {
        assembly {
            // Store x * y in z for now.
            z := mul(x, y)

            // Equivalent to require(denominator != 0 && (x == 0 || (x * y) / x == y))
            if iszero(and(iszero(iszero(denominator)), or(iszero(x), eq(div(z, x), y)))) {
                revert(0, 0)
            }

            // Divide z by the denominator.
            z := div(z, denominator)
        }
    }

    function mulDivUp(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 z) {
        assembly {
            // Store x * y in z for now.
            z := mul(x, y)

            // Equivalent to require(denominator != 0 && (x == 0 || (x * y) / x == y))
            if iszero(and(iszero(iszero(denominator)), or(iszero(x), eq(div(z, x), y)))) {
                revert(0, 0)
            }

            // First, divide z - 1 by the denominator and add 1.
            // We allow z - 1 to underflow if z is 0, because we multiply the
            // end result by 0 if z is zero, ensuring we return 0 if z is zero.
            z := mul(iszero(iszero(z)), add(div(sub(z, 1), denominator), 1))
        }
    }

    function rpow(
        uint256 x,
        uint256 n,
        uint256 scalar
    ) internal pure returns (uint256 z) {
        assembly {
            switch x
            case 0 {
                switch n
                case 0 {
                    // 0 ** 0 = 1
                    z := scalar
                }
                default {
                    // 0 ** n = 0
                    z := 0
                }
            }
            default {
                switch mod(n, 2)
                case 0 {
                    // If n is even, store scalar in z for now.
                    z := scalar
                }
                default {
                    // If n is odd, store x in z for now.
                    z := x
                }

                // Shifting right by 1 is like dividing by 2.
                let half := shr(1, scalar)

                for {
                    // Shift n right by 1 before looping to halve it.
                    n := shr(1, n)
                } n {
                    // Shift n right by 1 each iteration to halve it.
                    n := shr(1, n)
                } {
                    // Revert immediately if x ** 2 would overflow.
                    // Equivalent to iszero(eq(div(xx, x), x)) here.
                    if shr(128, x) {
                        revert(0, 0)
                    }

                    // Store x squared.
                    let xx := mul(x, x)

                    // Round to the nearest number.
                    let xxRound := add(xx, half)

                    // Revert if xx + half overflowed.
                    if lt(xxRound, xx) {
                        revert(0, 0)
                    }

                    // Set x to scaled xxRound.
                    x := div(xxRound, scalar)

                    // If n is even:
                    if mod(n, 2) {
                        // Compute z * x.
                        let zx := mul(z, x)

                        // If z * x overflowed:
                        if iszero(eq(div(zx, x), z)) {
                            // Revert if x is non-zero.
                            if iszero(iszero(x)) {
                                revert(0, 0)
                            }
                        }

                        // Round to the nearest number.
                        let zxRound := add(zx, half)

                        // Revert if zx + half overflowed.
                        if lt(zxRound, zx) {
                            revert(0, 0)
                        }

                        // Return properly scaled zxRound.
                        z := div(zxRound, scalar)
                    }
                }
            }
        }
    }

    /*//////////////////////////////////////////////////////////////
                        GENERAL NUMBER UTILITIES
    //////////////////////////////////////////////////////////////*/

    function sqrt(uint256 x) internal pure returns (uint256 z) {
        assembly {
            let y := x // We start y at x, which will help us make our initial estimate.

            z := 181 // The "correct" value is 1, but this saves a multiplication later.

            // This segment is to get a reasonable initial estimate for the Babylonian method. With a bad
            // start, the correct # of bits increases ~linearly each iteration instead of ~quadratically.

            // We check y >= 2^(k + 8) but shift right by k bits
            // each branch to ensure that if x >= 256, then y >= 256.
            if iszero(lt(y, 0x10000000000000000000000000000000000)) {
                y := shr(128, y)
                z := shl(64, z)
            }
            if iszero(lt(y, 0x1000000000000000000)) {
                y := shr(64, y)
                z := shl(32, z)
            }
            if iszero(lt(y, 0x10000000000)) {
                y := shr(32, y)
                z := shl(16, z)
            }
            if iszero(lt(y, 0x1000000)) {
                y := shr(16, y)
                z := shl(8, z)
            }

            // Goal was to get z*z*y within a small factor of x. More iterations could
            // get y in a tighter range. Currently, we will have y in [256, 256*2^16).
            // We ensured y >= 256 so that the relative difference between y and y+1 is small.
            // That's not possible if x < 256 but we can just verify those cases exhaustively.

            // Now, z*z*y <= x < z*z*(y+1), and y <= 2^(16+8), and either y >= 256, or x < 256.
            // Correctness can be checked exhaustively for x < 256, so we assume y >= 256.
            // Then z*sqrt(y) is within sqrt(257)/sqrt(256) of sqrt(x), or about 20bps.

            // For s in the range [1/256, 256], the estimate f(s) = (181/1024) * (s+1) is in the range
            // (1/2.84 * sqrt(s), 2.84 * sqrt(s)), with largest error when s = 1 and when s = 256 or 1/256.

            // Since y is in [256, 256*2^16), let a = y/65536, so that a is in [1/256, 256). Then we can estimate
            // sqrt(y) using sqrt(65536) * 181/1024 * (a + 1) = 181/4 * (y + 65536)/65536 = 181 * (y + 65536)/2^18.

            // There is no overflow risk here since y < 2^136 after the first branch above.
            z := shr(18, mul(z, add(y, 65536))) // A mul() is saved from starting z at 181.

            // Given the worst case multiplicative error of 2.84 above, 7 iterations should be enough.
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))

            // If x+1 is a perfect square, the Babylonian method cycles between
            // floor(sqrt(x)) and ceil(sqrt(x)). This statement ensures we return floor.
            // See: https://en.wikipedia.org/wiki/Integer_square_root#Using_only_integer_division
            // Since the ceil is rare, we save gas on the assignment and repeat division in the rare case.
            // If you don't care whether the floor or ceil square root is returned, you can remove this statement.
            z := sub(z, lt(div(x, z), z))
        }
    }

    function unsafeMod(uint256 x, uint256 y) internal pure returns (uint256 z) {
        assembly {
            // Mod x by y. Note this will return
            // 0 instead of reverting if y is zero.
            z := mod(x, y)
        }
    }

    function unsafeDiv(uint256 x, uint256 y) internal pure returns (uint256 r) {
        assembly {
            // Divide x by y. Note this will return
            // 0 instead of reverting if y is zero.
            r := div(x, y)
        }
    }

    function unsafeDivUp(uint256 x, uint256 y) internal pure returns (uint256 z) {
        assembly {
            // Add 1 to x * y if x % y > 0. Note this will
            // return 0 instead of reverting if y is zero.
            z := add(gt(mod(x, y), 0), div(x, y))
        }
    }
}

Settings
{
  "remappings": [
    "ERC4626/=lib/ERC4626/src/",
    "ds-test/=lib/solmate/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "solmate/=lib/solmate/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract ERC20","name":"_underlying","type":"address"},{"internalType":"uint32","name":"_rewardsCycleLength","type":"uint32"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"SyncError","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"cycleEnd","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"rewardAmount","type":"uint256"}],"name":"NewRewardsCycle","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"asset","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"convertToAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"convertToShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"approveMax","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"depositWithSignature","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastRewardAmount","outputs":[{"internalType":"uint192","name":"","type":"uint192"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastSync","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pricePerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardsCycleEnd","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsCycleLength","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"syncRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

6101206040523480156200001257600080fd5b50604051620020f8380380620020f8833981016040819052620000359162000257565b80826040518060400160405280601181526020017029ba30b5b2b210233930bc1022ba3432b960791b815250604051806040016040528060078152602001660e6cce4f08aa8960cb1b8152508181846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000c2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000e89190620002a9565b6000620000f684826200037a565b5060016200010583826200037a565b5060ff81166080524660a0526200011b620001a3565b60c052505050506001600160a01b039190911660e0525063ffffffff81166101008190528062000157426200023f602090811b62000f5317901c565b62000163919062000446565b6200016f919062000478565b6006805463ffffffff929092166401000000000263ffffffff60201b19909216919091179055505060016008555062000531565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051620001d79190620004b3565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b600064010000000082106200025357600080fd5b5090565b600080604083850312156200026b57600080fd5b82516001600160a01b03811681146200028357600080fd5b602084015190925063ffffffff811681146200029e57600080fd5b809150509250929050565b600060208284031215620002bc57600080fd5b815160ff81168114620002ce57600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200030057607f821691505b6020821081036200032157634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200037557600081815260208120601f850160051c81016020861015620003505750805b601f850160051c820191505b8181101562000371578281556001016200035c565b5050505b505050565b81516001600160401b03811115620003965762000396620002d5565b620003ae81620003a78454620002eb565b8462000327565b602080601f831160018114620003e65760008415620003cd5750858301515b600019600386901b1c1916600185901b17855562000371565b600085815260208120601f198616915b828110156200041757888601518255948401946001909101908401620003f6565b5085821015620004365787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600063ffffffff808416806200046c57634e487b7160e01b600052601260045260246000fd5b92169190910492915050565b600063ffffffff80831681851681830481118215151615620004aa57634e487b7160e01b600052601160045260246000fd5b02949350505050565b6000808354620004c381620002eb565b60018281168015620004de5760018114620004f45762000525565b60ff198416875282151583028701945062000525565b8760005260208060002060005b858110156200051c5781548a82015290840190820162000501565b50505082870194505b50929695505050505050565b60805160a05160c05160e05161010051611b51620005a76000396000818161039001526109e50152600081816102f10152818161094201528181610b07015281816110a8015281816111af0152818161131801526114640152600061086d01526000610838015260006102b00152611b516000f3fe608060405234801561001057600080fd5b50600436106102115760003560e01c806375e077c311610125578063bafedcaa116100ad578063d505accf1161007c578063d505accf146104d6578063d905777e146104e9578063dd62ed3e14610512578063e7ff69f11461053d578063ef8b30f71461055457600080fd5b8063bafedcaa1461047e578063c63d75b61461032b578063c6e6f592146104b0578063ce96cb77146104c357600080fd5b806399530b06116100f457806399530b061461042a578063a9059cbb14610432578063b3d7f6b914610445578063b460af9414610458578063ba0876521461046b57600080fd5b806375e077c3146103dc5780637ecebe00146103ef57806394bf804d1461040f57806395d89b411461042257600080fd5b80633644e515116101a85780636917516b116101775780636917516b146103535780636e553f65146103785780636fcf5e5f1461038b57806370a08231146103b257806372c0c211146103d257600080fd5b80633644e515146102e457806338d52e0f146102ec578063402d267d1461032b5780634cdad5061461034057600080fd5b80630a28a477116101e45780630a28a4771461027c57806318160ddd1461028f57806323b872dd14610298578063313ce567146102ab57600080fd5b806301e1d1141461021657806306fdde031461023157806307a2d13a14610246578063095ea7b314610259575b600080fd5b61021e610567565b6040519081526020015b60405180910390f35b61023961060c565b604051610228919061168e565b61021e6102543660046116dc565b61069a565b61026c610267366004611711565b6106c7565b6040519015158152602001610228565b61021e61028a3660046116dc565b610734565b61021e60025481565b61026c6102a636600461173b565b610754565b6102d27f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff9091168152602001610228565b61021e610834565b6103137f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610228565b61021e610339366004611777565b5060001990565b61021e61034e3660046116dc565b61088f565b6006546103639063ffffffff1681565b60405163ffffffff9091168152602001610228565b61021e610386366004611792565b61089a565b6103637f000000000000000000000000000000000000000000000000000000000000000081565b61021e6103c0366004611777565b60036020526000908152604090205481565b6103da6108c5565b005b61021e6103ea3660046117cf565b610aa9565b61021e6103fd366004611777565b60056020526000908152604090205481565b61021e61041d366004611792565b610b8d565b610239610bb8565b61021e610bc5565b61026c610440366004611711565b610bd8565b61021e6104533660046116dc565b610c3e565b61021e610466366004611840565b610c5d565b61021e610479366004611840565b610c91565b60065461049890600160401b90046001600160c01b031681565b6040516001600160c01b039091168152602001610228565b61021e6104be3660046116dc565b610cbd565b61021e6104d1366004611777565b610cdd565b6103da6104e436600461187c565b610cff565b61021e6104f7366004611777565b6001600160a01b031660009081526003602052604090205490565b61021e6105203660046118ca565b600460209081526000928352604080842090915290825290205481565b60065461036390600160201b900463ffffffff1681565b61021e6105623660046116dc565b610f48565b600754600654600091906001600160c01b03600160401b8204169063ffffffff600160201b8204811691164282116105b5576105ac6001600160c01b0384168561190a565b94505050505090565b60006105c1828461191d565b63ffffffff168263ffffffff16426105d99190611941565b6105ec906001600160c01b038716611954565b6105f69190611989565b9050610602818661190a565b9550505050505090565b600080546106199061199d565b80601f01602080910402602001604051908101604052809291908181526020018280546106459061199d565b80156106925780601f1061066757610100808354040283529160200191610692565b820191906000526020600020905b81548152906001019060200180831161067557829003601f168201915b505050505081565b60025460009080156106be576106b96106b1610567565b849083610f69565b6106c0565b825b9392505050565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906107229086815260200190565b60405180910390a35060015b92915050565b60025460009080156106be576106b98161074c610567565b859190610f88565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146107b05761078b8382611941565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b038516600090815260036020526040812080548592906107d8908490611941565b90915550506001600160a01b0380851660008181526003602052604090819020805487019055519091871690600080516020611afc833981519152906108219087815260200190565b60405180910390a3506001949350505050565b60007f0000000000000000000000000000000000000000000000000000000000000000461461086a57610865610fb6565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b600061072e8261069a565b600654600090600160201b900463ffffffff1642106108bb576108bb6108c5565b6106c08383611050565b600654600160401b90046001600160c01b031660006108e342610f53565b60065490915063ffffffff600160201b9091048116908216101561091a5760405163127d33e760e21b815260040160405180910390fd5b6007546040516370a0823160e01b81523060048201526000906001600160c01b0385169083907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610991573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b591906119d7565b6109bf9190611941565b6109c99190611941565b90506109de6001600160c01b0385168361190a565b60075560007f000000000000000000000000000000000000000000000000000000000000000080610a0f81876119f0565b610a199190611a0d565b610a239190611a30565b9050610a2e8261112a565b63ffffffff828116600160201b81026001600160c01b0393909316600160401b0267ffffffffffffffff191691871691909117919091176006556040517f2fa39aac60d1c94cda4ab0e86ae9c0ffab5b926e5b827a4ccba1d9b5b2ef596e90610a9a9085815260200190565b60405180910390a25050505050565b6000610ab361113c565b600085610ac05788610ac4565b6000195b60405163d505accf60e01b8152336004820152306024820152604481018290526064810189905260ff8716608482015260a4810186905260c481018590529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d505accf9060e401600060405180830381600087803b158015610b5357600080fd5b505af1158015610b67573d6000803e3d6000fd5b50505050610b75898961089a565b915050610b826001600855565b979650505050505050565b600654600090600160201b900463ffffffff164210610bae57610bae6108c5565b6106c08383611195565b600180546106199061199d565b6000610865670de0b6b3a764000061069a565b33600090815260036020526040812080548391908390610bf9908490611941565b90915550506001600160a01b03831660008181526003602052604090819020805485019055513390600080516020611afc833981519152906107229086815260200190565b60025460009080156106be576106b9610c55610567565b849083610f88565b600654600090600160201b900463ffffffff164210610c7e57610c7e6108c5565b610c89848484611231565b949350505050565b600654600090600160201b900463ffffffff164210610cb257610cb26108c5565b610c8984848461133f565b60025460009080156106be576106b981610cd5610567565b859190610f69565b6001600160a01b03811660009081526003602052604081205461072e9061069a565b42841015610d545760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b60006001610d60610834565b6001600160a01b038a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa158015610e6c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590610ea25750876001600160a01b0316816001600160a01b0316145b610edf5760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a4a3a722a960911b6044820152606401610d4b565b6001600160a01b0390811660009081526004602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b600061072e82610cbd565b6000600160201b8210610f6557600080fd5b5090565b828202811515841585830485141716610f8157600080fd5b0492915050565b828202811515841585830485141716610fa057600080fd5b6001826001830304018115150290509392505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051610fe89190611a5c565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b600061105b83610f48565b90508060000361109b5760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f53484152455360a81b6044820152606401610d4b565b6110d06001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308661148b565b6110da8282611515565b60408051848152602081018390526001600160a01b0384169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a361072e838261156f565b6000600160c01b8210610f6557600080fd5b60026008540361118e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d4b565b6002600855565b60006111a083610c3e565b90506111d76001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308461148b565b6111e18284611515565b60408051828152602081018590526001600160a01b0384169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a361072e818461156f565b600061123c84610734565b9050336001600160a01b038316146112ac576001600160a01b038216600090815260046020908152604080832033845290915290205460001981146112aa576112858282611941565b6001600160a01b03841660009081526004602090815260408083203384529091529020555b505b6112b68482611593565b6112c082826115ae565b60408051858152602081018390526001600160a01b03808516929086169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a46106c06001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168486611610565b6000336001600160a01b038316146113af576001600160a01b038216600090815260046020908152604080832033845290915290205460001981146113ad576113888582611941565b6001600160a01b03841660009081526004602090815260408083203384529091529020555b505b6113b88461088f565b9050806000036113f85760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f41535345545360a81b6044820152606401610d4b565b6114028185611593565b61140c82856115ae565b60408051828152602081018690526001600160a01b03808516929086169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a46106c06001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168483611610565b60006040516323b872dd60e01b81528460048201528360248201528260448201526020600060648360008a5af13d15601f3d116001600051141617169150508061150e5760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b6044820152606401610d4b565b5050505050565b8060026000828254611527919061190a565b90915550506001600160a01b038216600081815260036020908152604080832080548601905551848152600080516020611afc83398151915291015b60405180910390a35050565b8160076000828254611581919061190a565b9091555061158f9050828282565b5050565b81600760008282546115a59190611941565b90915550505050565b6001600160a01b038216600090815260036020526040812080548392906115d6908490611941565b90915550506002805482900390556040518181526000906001600160a01b03841690600080516020611afc83398151915290602001611563565b600060405163a9059cbb60e01b8152836004820152826024820152602060006044836000895af13d15601f3d11600160005114161716915050806116885760405162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b6044820152606401610d4b565b50505050565b600060208083528351808285015260005b818110156116bb5785810183015185820160400152820161169f565b506000604082860101526040601f19601f8301168501019250505092915050565b6000602082840312156116ee57600080fd5b5035919050565b80356001600160a01b038116811461170c57600080fd5b919050565b6000806040838503121561172457600080fd5b61172d836116f5565b946020939093013593505050565b60008060006060848603121561175057600080fd5b611759846116f5565b9250611767602085016116f5565b9150604084013590509250925092565b60006020828403121561178957600080fd5b6106c0826116f5565b600080604083850312156117a557600080fd5b823591506117b5602084016116f5565b90509250929050565b803560ff8116811461170c57600080fd5b600080600080600080600060e0888a0312156117ea57600080fd5b873596506117fa602089016116f5565b9550604088013594506060880135801515811461181657600080fd5b9350611824608089016117be565b925060a0880135915060c0880135905092959891949750929550565b60008060006060848603121561185557600080fd5b83359250611865602085016116f5565b9150611873604085016116f5565b90509250925092565b600080600080600080600060e0888a03121561189757600080fd5b6118a0886116f5565b96506118ae602089016116f5565b95506040880135945060608801359350611824608089016117be565b600080604083850312156118dd57600080fd5b6118e6836116f5565b91506117b5602084016116f5565b634e487b7160e01b600052601160045260246000fd5b8082018082111561072e5761072e6118f4565b63ffffffff82811682821603908082111561193a5761193a6118f4565b5092915050565b8181038181111561072e5761072e6118f4565b600081600019048311821515161561196e5761196e6118f4565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261199857611998611973565b500490565b600181811c908216806119b157607f821691505b6020821081036119d157634e487b7160e01b600052602260045260246000fd5b50919050565b6000602082840312156119e957600080fd5b5051919050565b63ffffffff81811683821601908082111561193a5761193a6118f4565b600063ffffffff80841680611a2457611a24611973565b92169190910492915050565b600063ffffffff80831681851681830481118215151615611a5357611a536118f4565b02949350505050565b600080835481600182811c915080831680611a7857607f831692505b60208084108203611a9757634e487b7160e01b86526022600452602486fd5b818015611aab5760018114611ac057611aed565b60ff1986168952841515850289019650611aed565b60008a81526020902060005b86811015611ae55781548b820152908501908301611acc565b505084890196505b50949897505050505050505056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220f4164c08863140c451e05f5dc4daadab6767ba15d7bd450f9bc3d34a1042704664736f6c634300081000330000000000000000000000002c37fb628b35dfdfd515d41b0caae11b542773c300000000000000000000000000000000000000000000000000000000000003e8

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102115760003560e01c806375e077c311610125578063bafedcaa116100ad578063d505accf1161007c578063d505accf146104d6578063d905777e146104e9578063dd62ed3e14610512578063e7ff69f11461053d578063ef8b30f71461055457600080fd5b8063bafedcaa1461047e578063c63d75b61461032b578063c6e6f592146104b0578063ce96cb77146104c357600080fd5b806399530b06116100f457806399530b061461042a578063a9059cbb14610432578063b3d7f6b914610445578063b460af9414610458578063ba0876521461046b57600080fd5b806375e077c3146103dc5780637ecebe00146103ef57806394bf804d1461040f57806395d89b411461042257600080fd5b80633644e515116101a85780636917516b116101775780636917516b146103535780636e553f65146103785780636fcf5e5f1461038b57806370a08231146103b257806372c0c211146103d257600080fd5b80633644e515146102e457806338d52e0f146102ec578063402d267d1461032b5780634cdad5061461034057600080fd5b80630a28a477116101e45780630a28a4771461027c57806318160ddd1461028f57806323b872dd14610298578063313ce567146102ab57600080fd5b806301e1d1141461021657806306fdde031461023157806307a2d13a14610246578063095ea7b314610259575b600080fd5b61021e610567565b6040519081526020015b60405180910390f35b61023961060c565b604051610228919061168e565b61021e6102543660046116dc565b61069a565b61026c610267366004611711565b6106c7565b6040519015158152602001610228565b61021e61028a3660046116dc565b610734565b61021e60025481565b61026c6102a636600461173b565b610754565b6102d27f000000000000000000000000000000000000000000000000000000000000001281565b60405160ff9091168152602001610228565b61021e610834565b6103137f0000000000000000000000002c37fb628b35dfdfd515d41b0caae11b542773c381565b6040516001600160a01b039091168152602001610228565b61021e610339366004611777565b5060001990565b61021e61034e3660046116dc565b61088f565b6006546103639063ffffffff1681565b60405163ffffffff9091168152602001610228565b61021e610386366004611792565b61089a565b6103637f00000000000000000000000000000000000000000000000000000000000003e881565b61021e6103c0366004611777565b60036020526000908152604090205481565b6103da6108c5565b005b61021e6103ea3660046117cf565b610aa9565b61021e6103fd366004611777565b60056020526000908152604090205481565b61021e61041d366004611792565b610b8d565b610239610bb8565b61021e610bc5565b61026c610440366004611711565b610bd8565b61021e6104533660046116dc565b610c3e565b61021e610466366004611840565b610c5d565b61021e610479366004611840565b610c91565b60065461049890600160401b90046001600160c01b031681565b6040516001600160c01b039091168152602001610228565b61021e6104be3660046116dc565b610cbd565b61021e6104d1366004611777565b610cdd565b6103da6104e436600461187c565b610cff565b61021e6104f7366004611777565b6001600160a01b031660009081526003602052604090205490565b61021e6105203660046118ca565b600460209081526000928352604080842090915290825290205481565b60065461036390600160201b900463ffffffff1681565b61021e6105623660046116dc565b610f48565b600754600654600091906001600160c01b03600160401b8204169063ffffffff600160201b8204811691164282116105b5576105ac6001600160c01b0384168561190a565b94505050505090565b60006105c1828461191d565b63ffffffff168263ffffffff16426105d99190611941565b6105ec906001600160c01b038716611954565b6105f69190611989565b9050610602818661190a565b9550505050505090565b600080546106199061199d565b80601f01602080910402602001604051908101604052809291908181526020018280546106459061199d565b80156106925780601f1061066757610100808354040283529160200191610692565b820191906000526020600020905b81548152906001019060200180831161067557829003601f168201915b505050505081565b60025460009080156106be576106b96106b1610567565b849083610f69565b6106c0565b825b9392505050565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906107229086815260200190565b60405180910390a35060015b92915050565b60025460009080156106be576106b98161074c610567565b859190610f88565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146107b05761078b8382611941565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b038516600090815260036020526040812080548592906107d8908490611941565b90915550506001600160a01b0380851660008181526003602052604090819020805487019055519091871690600080516020611afc833981519152906108219087815260200190565b60405180910390a3506001949350505050565b60007f0000000000000000000000000000000000000000000000000000000000000001461461086a57610865610fb6565b905090565b507f60562c7e4a40b15a5f364a3ba48d07169dfe3280f45f233ad1828addc50e136c90565b600061072e8261069a565b600654600090600160201b900463ffffffff1642106108bb576108bb6108c5565b6106c08383611050565b600654600160401b90046001600160c01b031660006108e342610f53565b60065490915063ffffffff600160201b9091048116908216101561091a5760405163127d33e760e21b815260040160405180910390fd5b6007546040516370a0823160e01b81523060048201526000906001600160c01b0385169083907f0000000000000000000000002c37fb628b35dfdfd515d41b0caae11b542773c36001600160a01b0316906370a0823190602401602060405180830381865afa158015610991573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b591906119d7565b6109bf9190611941565b6109c99190611941565b90506109de6001600160c01b0385168361190a565b60075560007f00000000000000000000000000000000000000000000000000000000000003e880610a0f81876119f0565b610a199190611a0d565b610a239190611a30565b9050610a2e8261112a565b63ffffffff828116600160201b81026001600160c01b0393909316600160401b0267ffffffffffffffff191691871691909117919091176006556040517f2fa39aac60d1c94cda4ab0e86ae9c0ffab5b926e5b827a4ccba1d9b5b2ef596e90610a9a9085815260200190565b60405180910390a25050505050565b6000610ab361113c565b600085610ac05788610ac4565b6000195b60405163d505accf60e01b8152336004820152306024820152604481018290526064810189905260ff8716608482015260a4810186905260c481018590529091507f0000000000000000000000002c37fb628b35dfdfd515d41b0caae11b542773c36001600160a01b03169063d505accf9060e401600060405180830381600087803b158015610b5357600080fd5b505af1158015610b67573d6000803e3d6000fd5b50505050610b75898961089a565b915050610b826001600855565b979650505050505050565b600654600090600160201b900463ffffffff164210610bae57610bae6108c5565b6106c08383611195565b600180546106199061199d565b6000610865670de0b6b3a764000061069a565b33600090815260036020526040812080548391908390610bf9908490611941565b90915550506001600160a01b03831660008181526003602052604090819020805485019055513390600080516020611afc833981519152906107229086815260200190565b60025460009080156106be576106b9610c55610567565b849083610f88565b600654600090600160201b900463ffffffff164210610c7e57610c7e6108c5565b610c89848484611231565b949350505050565b600654600090600160201b900463ffffffff164210610cb257610cb26108c5565b610c8984848461133f565b60025460009080156106be576106b981610cd5610567565b859190610f69565b6001600160a01b03811660009081526003602052604081205461072e9061069a565b42841015610d545760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b60006001610d60610834565b6001600160a01b038a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa158015610e6c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590610ea25750876001600160a01b0316816001600160a01b0316145b610edf5760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a4a3a722a960911b6044820152606401610d4b565b6001600160a01b0390811660009081526004602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b600061072e82610cbd565b6000600160201b8210610f6557600080fd5b5090565b828202811515841585830485141716610f8157600080fd5b0492915050565b828202811515841585830485141716610fa057600080fd5b6001826001830304018115150290509392505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051610fe89190611a5c565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b600061105b83610f48565b90508060000361109b5760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f53484152455360a81b6044820152606401610d4b565b6110d06001600160a01b037f0000000000000000000000002c37fb628b35dfdfd515d41b0caae11b542773c31633308661148b565b6110da8282611515565b60408051848152602081018390526001600160a01b0384169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a361072e838261156f565b6000600160c01b8210610f6557600080fd5b60026008540361118e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d4b565b6002600855565b60006111a083610c3e565b90506111d76001600160a01b037f0000000000000000000000002c37fb628b35dfdfd515d41b0caae11b542773c31633308461148b565b6111e18284611515565b60408051828152602081018590526001600160a01b0384169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a361072e818461156f565b600061123c84610734565b9050336001600160a01b038316146112ac576001600160a01b038216600090815260046020908152604080832033845290915290205460001981146112aa576112858282611941565b6001600160a01b03841660009081526004602090815260408083203384529091529020555b505b6112b68482611593565b6112c082826115ae565b60408051858152602081018390526001600160a01b03808516929086169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a46106c06001600160a01b037f0000000000000000000000002c37fb628b35dfdfd515d41b0caae11b542773c3168486611610565b6000336001600160a01b038316146113af576001600160a01b038216600090815260046020908152604080832033845290915290205460001981146113ad576113888582611941565b6001600160a01b03841660009081526004602090815260408083203384529091529020555b505b6113b88461088f565b9050806000036113f85760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f41535345545360a81b6044820152606401610d4b565b6114028185611593565b61140c82856115ae565b60408051828152602081018690526001600160a01b03808516929086169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a46106c06001600160a01b037f0000000000000000000000002c37fb628b35dfdfd515d41b0caae11b542773c3168483611610565b60006040516323b872dd60e01b81528460048201528360248201528260448201526020600060648360008a5af13d15601f3d116001600051141617169150508061150e5760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b6044820152606401610d4b565b5050505050565b8060026000828254611527919061190a565b90915550506001600160a01b038216600081815260036020908152604080832080548601905551848152600080516020611afc83398151915291015b60405180910390a35050565b8160076000828254611581919061190a565b9091555061158f9050828282565b5050565b81600760008282546115a59190611941565b90915550505050565b6001600160a01b038216600090815260036020526040812080548392906115d6908490611941565b90915550506002805482900390556040518181526000906001600160a01b03841690600080516020611afc83398151915290602001611563565b600060405163a9059cbb60e01b8152836004820152826024820152602060006044836000895af13d15601f3d11600160005114161716915050806116885760405162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b6044820152606401610d4b565b50505050565b600060208083528351808285015260005b818110156116bb5785810183015185820160400152820161169f565b506000604082860101526040601f19601f8301168501019250505092915050565b6000602082840312156116ee57600080fd5b5035919050565b80356001600160a01b038116811461170c57600080fd5b919050565b6000806040838503121561172457600080fd5b61172d836116f5565b946020939093013593505050565b60008060006060848603121561175057600080fd5b611759846116f5565b9250611767602085016116f5565b9150604084013590509250925092565b60006020828403121561178957600080fd5b6106c0826116f5565b600080604083850312156117a557600080fd5b823591506117b5602084016116f5565b90509250929050565b803560ff8116811461170c57600080fd5b600080600080600080600060e0888a0312156117ea57600080fd5b873596506117fa602089016116f5565b9550604088013594506060880135801515811461181657600080fd5b9350611824608089016117be565b925060a0880135915060c0880135905092959891949750929550565b60008060006060848603121561185557600080fd5b83359250611865602085016116f5565b9150611873604085016116f5565b90509250925092565b600080600080600080600060e0888a03121561189757600080fd5b6118a0886116f5565b96506118ae602089016116f5565b95506040880135945060608801359350611824608089016117be565b600080604083850312156118dd57600080fd5b6118e6836116f5565b91506117b5602084016116f5565b634e487b7160e01b600052601160045260246000fd5b8082018082111561072e5761072e6118f4565b63ffffffff82811682821603908082111561193a5761193a6118f4565b5092915050565b8181038181111561072e5761072e6118f4565b600081600019048311821515161561196e5761196e6118f4565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261199857611998611973565b500490565b600181811c908216806119b157607f821691505b6020821081036119d157634e487b7160e01b600052602260045260246000fd5b50919050565b6000602082840312156119e957600080fd5b5051919050565b63ffffffff81811683821601908082111561193a5761193a6118f4565b600063ffffffff80841680611a2457611a24611973565b92169190910492915050565b600063ffffffff80831681851681830481118215151615611a5357611a536118f4565b02949350505050565b600080835481600182811c915080831680611a7857607f831692505b60208084108203611a9757634e487b7160e01b86526022600452602486fd5b818015611aab5760018114611ac057611aed565b60ff1986168952841515850289019650611aed565b60008a81526020902060005b86811015611ae55781548b820152908501908301611acc565b505084890196505b50949897505050505050505056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220f4164c08863140c451e05f5dc4daadab6767ba15d7bd450f9bc3d34a1042704664736f6c63430008100033

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

0000000000000000000000002c37fb628b35dfdfd515d41b0caae11b542773c300000000000000000000000000000000000000000000000000000000000003e8

-----Decoded View---------------
Arg [0] : _underlying (address): 0x2C37fb628b35dfdFD515d41B0cAAe11B542773C3
Arg [1] : _rewardsCycleLength (uint32): 1000

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000002c37fb628b35dfdfd515d41b0caae11b542773c3
Arg [1] : 00000000000000000000000000000000000000000000000000000000000003e8


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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