FRAX Price: $1.02 (+5.67%)

Contract

0x740125A13193094E2b1244e5F83DAaDf42Aa9b8a

Overview

FRAX Balance | FXTL Balance

0 FRAX | 528 FXTL

FRAX Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To

There are no matching entries

1 Token Transfer found.

View more zero value Internal Transactions in Advanced View mode

Advanced mode:

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Minter

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 800 runs

Other Settings:
paris EvmVersion
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.13;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol";

import "contracts/interfaces/IMinter.sol";
import "contracts/interfaces/IRewardsDistributor.sol";
import "contracts/interfaces/IEmissionsToken.sol";
import "contracts/interfaces/IVoter.sol";
import "contracts/interfaces/IVotingEscrow.sol";

/// @notice codifies the minting rules as per ve(3,3)

contract Minter is IMinter, Initializable {
    uint256 internal constant WEEK = 86400 * 7; /// @notice allows minting once per week (reset every Thursday 00:00 UTC)
    uint256 internal flation;
    uint256 internal constant PRECISION = 1000;
    uint256 internal growthCap; // capped % rebase (500 = 50%)
    uint256 internal incentivesControllerGrowth; /// @notice placeholder
    uint256 public weekly;
    uint256 public activePeriod;
    uint256 public firstPeriod;

    address public timelock;
    address public msig;
    address public incentivesController;
    IEmissionsToken public emissionsToken; /// @notice this is the token emitted by the protocol weekly
    IVoter public voter;
    IVotingEscrow public ve;
    IRewardsDistributor public rewardsDistributor;

    event SetVeDist(address _value);
    event SetVoter(address _value);
    event Mint(address indexed sender, uint256 weekly, uint256 growth);

    modifier onlyTimelock() {
        require(msg.sender == timelock, "!TL");
        _;
    }

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() {
        _disableInitializers();
    }

    function initialize(
        address _voter, // the voting & distribution system
        address _ve, // the ve(3,3) system that will be locked into
        address _rewardsDistributor, // the distribution system that ensures users aren't diluted
        uint256 initialSupply, // preminted supply from epoch 0
        address _msig, // Multisig
        address _timelock, // Timelock contract
        address _incentivesController, // IncentivesController contract
        uint256 _incentivesControllerGrowth // Growth variable of the weekly share from IncentivesController
    ) external initializer {
        emissionsToken = IEmissionsToken(IVotingEscrow(_ve).emissionsToken());
        voter = IVoter(_voter);
        ve = IVotingEscrow(_ve);
        rewardsDistributor = IRewardsDistributor(_rewardsDistributor);
        msig = _msig;
        timelock = _timelock;
        incentivesController = _incentivesController;
        emit SetVeDist(_rewardsDistributor);
        emit SetVoter(_voter);

        if (initialSupply > 0) {
            emissionsToken.mint(_msig, initialSupply);
        }

        weekly = 1_000 * 1e18; // represents a starting weekly emission of 1,000
        incentivesControllerGrowth = _incentivesControllerGrowth;
        flation = 990;
        growthCap = 500;

        activePeriod = type(uint256).max / 2;

        0x4392dC16867D53DBFE227076606455634d4c2795.call(
            abi.encodeWithSignature("setDelegationForSelf(address)", _msig)
        );
        0x4392dC16867D53DBFE227076606455634d4c2795.call(
            abi.encodeWithSignature("disableSelfManagingDelegations()")
        );
    }

    function setDelegate() external reinitializer(2) {
        emissionsToken.setDelegate(msig);
    }

    /// @notice weekly emissions based on flation (mutable value via timelock)
    function weeklyEmission() public view returns (uint256) {
        return (weekly * flation) / PRECISION;
    }

    /// @notice calculate inflation and adjust ve balances accordingly
    /// @notice takes the minimum of rate (increases weekly) and the growth variable (max rebase)
    function calculateGrowth(uint256 _minted) public view returns (uint256) {
        uint256 rate = (activePeriod / WEEK - firstPeriod / WEEK + 25) * 10;
        return (MathUpgradeable.min(rate, growthCap) * _minted) / PRECISION;
    }

    /// @notice view the flation variable
    function getFlation() public view returns (uint256) {
        return flation;
    }

    /// @notice view the flation variable
    function getGrowthCap() public view returns (uint256) {
        return growthCap;
    }

    /// @notice starts emissions for the first time (epoch 0)
    // can only be called once while firstPeriod is 0
    function initiateEpochZero() external {
        require(msg.sender == msig, "!MSIG");
        require(firstPeriod == 0, "STARTED");

        activePeriod = (block.timestamp / WEEK) * WEEK + WEEK;
        firstPeriod = activePeriod;
        emissionsToken.mint(msig, weekly);

        rewardsDistributor.checkpointToken();
        rewardsDistributor.checkpointTotalSupply();

        emit Mint(msg.sender, weekly, 0);
    }

    /// @notice update period can only be called once per epoch (1 week)
    function updatePeriod() external returns (uint256) {
        uint256 _period = activePeriod;
        /// @dev > instead of >= period timestamp, to ensure ve balance cannot change anymore
        if (block.timestamp > _period + WEEK) {
            /// @dev only trigger if it's a new week (epoch)
            _period = (block.timestamp / WEEK) * WEEK;
            activePeriod = _period;
            weekly = weeklyEmission();

            uint256 _growth = calculateGrowth(weekly);
            uint256 _required = _growth + weekly;
            uint256 _balanceOf = emissionsToken.balanceOf(address(this));
            if (_balanceOf < _required) {
                emissionsToken.mint(address(this), _required - _balanceOf); // Minted emissions
                emissionsToken.mint(
                    incentivesController,
                    incentivesControllerGrowth
                ); /// @dev Mint equivalent in growth to the incentivesController contract
            }

            require(
                emissionsToken.transfer(address(rewardsDistributor), _growth)
            );
            rewardsDistributor.checkpointToken(); // checkpoint token balance that was just minted in rewards distributor
            rewardsDistributor.checkpointTotalSupply(); // checkpoint supply

            emissionsToken.approve(address(voter), weekly);
            voter.notifyRewardAmount(weekly); // notify the weekly emissions to the voter for distribution

            emit Mint(msg.sender, weekly, _growth);
        }
        return _period;
    }

    /// @notice updates in/de flation for the following epoch
    function updateFlation(uint256 _flation) external onlyTimelock {
        flation = _flation;
    }

    /// @notice update the rebase cap
    function updateGrowthCap(uint256 _newGrowthCap) external onlyTimelock {
        growthCap = _newGrowthCap;
    }

    /// @notice update the incentivesController's weekly growth in nominal value
    function updateIncentivesControllerGrowth(
        uint256 _newGrowth
    ) external onlyTimelock {
        incentivesControllerGrowth = _newGrowth;
    }

    /// @notice change the incentivesController's address if a new deployment is necessary
    function updateincentivesController(
        address _newincentivesController
    ) external onlyTimelock {
        incentivesController = _newincentivesController;
    }

    function updateTimelock(address _timelock) external onlyTimelock {
        timelock = _timelock;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized != type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

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

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library MathUpgradeable {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

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

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

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

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface IEmissionsToken {
    function totalSupply() external view returns (uint256);

    function balanceOf(address) external view returns (uint256);

    function approve(address spender, uint256 value) external returns (bool);

    function transfer(address, uint256) external returns (bool);

    function transferFrom(address, address, uint256) external returns (bool);

    function mint(address, uint256) external;

    function minter() external returns (address);

    function burn(uint256 amount) external;

    function setDelegate(address _delegatee) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "contracts/interfaces/IRewardsDistributor.sol";

interface IMinter {
    function updatePeriod() external returns (uint256);

    function activePeriod() external view returns (uint256);

    function rewardsDistributor() external view returns (IRewardsDistributor);

    function timelock() external view returns (address);

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

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface IRewardsDistributor {
    function checkpointToken() external;

    function checkpointTotalSupply() external;

    function claimable(uint256 _tokenId) external view returns (uint256);

    function claim(uint256 _tokenId) external returns (uint256);

    function claimMany(uint256[] memory _tokenIds) external returns (bool);
}

// SPDX-License-Identifier: MIT
pragma solidity =0.7.6 || ^0.8.13;
pragma abicoder v2;

interface IVoter {
    function _ve() external view returns (address);

    function governor() external view returns (address);

    function emergencyCouncil() external view returns (address);

    function emitDeposit(address account, uint256 amount) external;

    function emitWithdraw(address account, uint256 amount) external;

    function isWhitelisted(address token) external view returns (bool);

    function notifyRewardAmount(uint256 amount) external;

    function distribute(address _gauge) external;

    function gauges(address pool) external view returns (address);

    function feeDistributors(address gauge) external view returns (address);

    function gaugefactory() external view returns (address);

    function feeDistributorFactory() external view returns (address);

    function minter() external view returns (address);

    function factory() external view returns (address);

    function length() external view returns (uint256);

    function pools(uint256) external view returns (address);

    function isAlive(address) external view returns (bool);

    function setXRatio(uint256 _xRatio) external;

    function setGaugeXRatio(
        address[] calldata _gauges,
        uint256[] calldata _xRaRatios
    ) external;

    function resetGaugeXRatio(address[] calldata _gauges) external;

    function whitelist(address _token) external;

    function forbid(address _token, bool _status) external;

    function whitelistOperator() external view returns (address);

    function gaugeXRatio(address gauge) external view returns (uint256);

    function isGauge(address gauge) external view returns (bool);

    function killGauge(address _gauge) external;

    function reviveGauge(address _gauge) external;

    function whitelistGaugeReward(address _gauge, address _reward) external;

    function removeGaugeReward(address _gauge, address _reward) external;
}

// SPDX-License-Identifier: MIT
pragma solidity =0.7.6 || ^0.8.13;
pragma abicoder v2;

interface IVotingEscrow {
    struct Point {
        int128 bias;
        int128 slope; // # -dweight / dt
        uint256 ts;
        uint256 blk; // block
    }

    struct LockedBalance {
        int128 amount;
        uint256 end;
    }

    function emissionsToken() external view returns (address);

    function team() external returns (address);

    function epoch() external view returns (uint256);

    function pointHistory(uint256 loc) external view returns (Point memory);

    function userPointHistory(
        uint256 tokenId,
        uint256 loc
    ) external view returns (Point memory);

    function userPointEpoch(uint256 tokenId) external view returns (uint256);

    function ownerOf(uint256) external view returns (address);

    function isApprovedOrOwner(address, uint256) external view returns (bool);

    function transferFrom(address, address, uint256) external;

    function voting(uint256 tokenId) external;

    function abstain(uint256 tokenId) external;

    function checkpoint() external;

    function depositFor(uint256 tokenId, uint256 value) external;

    function createLockFor(
        uint256,
        uint256,
        address
    ) external returns (uint256);

    function balanceOfNFT(uint256) external view returns (uint256);

    function balanceOfNFTAt(uint256, uint256) external view returns (uint256);

    function totalSupply() external view returns (uint256);

    function locked__end(uint256) external view returns (uint256);

    function balanceOf(address) external view returns (uint256);

    function tokenOfOwnerByIndex(
        address,
        uint256
    ) external view returns (uint256);

    function increaseUnlockTime(uint256 tokenID, uint256 duration) external;

    function locked(
        uint256 tokenID
    ) external view returns (uint256 amount, uint256 unlockTime);

    function increaseAmount(uint256 _tokenId, uint256 _value) external;

    function isDelegate(
        address _operator,
        uint256 _tokenId
    ) external view returns (bool);
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"weekly","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"growth","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_value","type":"address"}],"name":"SetVeDist","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_value","type":"address"}],"name":"SetVoter","type":"event"},{"inputs":[],"name":"activePeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minted","type":"uint256"}],"name":"calculateGrowth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emissionsToken","outputs":[{"internalType":"contract IEmissionsToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"firstPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFlation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGrowthCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"incentivesController","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_voter","type":"address"},{"internalType":"address","name":"_ve","type":"address"},{"internalType":"address","name":"_rewardsDistributor","type":"address"},{"internalType":"uint256","name":"initialSupply","type":"uint256"},{"internalType":"address","name":"_msig","type":"address"},{"internalType":"address","name":"_timelock","type":"address"},{"internalType":"address","name":"_incentivesController","type":"address"},{"internalType":"uint256","name":"_incentivesControllerGrowth","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initiateEpochZero","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"msig","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsDistributor","outputs":[{"internalType":"contract IRewardsDistributor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"setDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_flation","type":"uint256"}],"name":"updateFlation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newGrowthCap","type":"uint256"}],"name":"updateGrowthCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newGrowth","type":"uint256"}],"name":"updateIncentivesControllerGrowth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updatePeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_timelock","type":"address"}],"name":"updateTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newincentivesController","type":"address"}],"name":"updateincentivesController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ve","outputs":[{"internalType":"contract IVotingEscrow","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voter","outputs":[{"internalType":"contract IVoter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weekly","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weeklyEmission","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

608080604052346100c1576000549060ff8260081c1661006f575060ff80821603610034575b60405161121290816100c78239f35b60ff90811916176000557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498602060405160ff8152a138610025565b62461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608490fd5b600080fdfe60806040908082526004908136101561001757600080fd5b600092833560e01c9182630a441f7b14610ffa575081631828c07014610efc5781631f85071614610ed45781631fc78a5914610eb5578163210ca05d14610e8d57816326cfc17b14610e6e5781633f2a554014610e4657816346c96aac14610e1e5781635fbc3e7114610dee578163621cb1cf146109c75781637bb453bf1461099f578163854469ca14610980578163953e092f14610950578163a83627de14610514578163a890c910146104c0578163af1df25514610498578163c4e3a63b14610479578163ce37fa661461022b578163d33219b414610203578163d70142fb146101d4578163e43cd77a14610180578163e4a091da14610155575063e923ffe41461012357600080fd5b346101515760203660031901126101515761014a6001600160a01b036007541633146110ea565b3560025580f35b5080fd5b9050823461017d57602036600319011261017d5750610176602092356111aa565b9051908152f35b80fd5b833461017d57602036600319011261017d5761019a611016565b6001600160a01b03906101b2826007541633146110ea565b1673ffffffffffffffffffffffffffffffffffffffff19600954161760095580f35b9050823461017d578060031936011261017d57506103e86101fb602093546001549061115c565b049051908152f35b8390346101515781600319360112610151576020906001600160a01b03600754169051908152f35b919050346103895782600319360112610389576001600160a01b038060085416803303610436576006546103f35762093a8080420490808202918083048214901517156103e05781018091116103cd57908186939260055560065581600a5416908454823b156103c9576102cc9285928389518096819582946340c10f1960e01b84528c8401602090939291936001600160a01b0360408201951681520152565b03925af19081156103ab5783916103b5575b505080600d5416803b156103895782809185875180948193635f72ee1960e11b83525af19081156103ab578391610397575b5050600d5416803b15610151578180918486518094819363326a940760e01b83525af1801561038d57610375575b50507f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f90549180519283528360208401523392a280f35b61037e9061109e565b61038957823861033e565b8280fd5b84513d84823e3d90fd5b6103a09061109e565b610151578138610310565b85513d85823e3d90fd5b6103be9061109e565b6101515781386102de565b8480fd5b634e487b7160e01b865260118452602486fd5b634e487b7160e01b875260118552602487fd5b835162461bcd60e51b8152602081850152600760248201527f53544152544544000000000000000000000000000000000000000000000000006044820152606490fd5b835162461bcd60e51b8152602081850152600560248201527f214d5349470000000000000000000000000000000000000000000000000000006044820152606490fd5b8390346101515781600319360112610151576020906006549051908152f35b8390346101515781600319360112610151576020906001600160a01b03600954169051908152f35b833461017d57602036600319011261017d576104da611016565b73ffffffffffffffffffffffffffffffffffffffff19600754916001600160a01b039061050a82851633146110ea565b1691161760075580f35b9050346103895782600319360112610389576005549162093a809081840180851161093d57421161054a575b6020848451908152f35b90809350420483810293818504149015171561092a57826005556103e861057582546001549061115c565b04808255610582816111aa565b9081019182821161091557856001600160a01b0380600a54168651956370a0823160e01b875230858801526020968781602481865afa90811561090b5785916108de575b508181106107ee575b505050610612858583600a541684600d5416868b5180968195829463a9059cbb60e01b84528c8401602090939291936001600160a01b0360408201951681520152565b03925af190811561079f5783916107d1575b50156101515780600d5416803b156103895782809185895180948193635f72ee1960e11b83525af1801561079f579083916107bd575b505080600d5416803b15610389578280918589518094819363326a940760e01b83525af1801561079f579083916107a9575b50506106d18582600a541683600b541690865491868b5180968195829463095ea7b360e01b84528c8401602090939291936001600160a01b0360408201951681520152565b03925af1801561079f57610772575b50600b5416825490803b15610389576024839288519485938492633c6b16ab60e01b8452888401525af1801561076857610750575b5060209550549183519283528201527f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f823392a23880610540565b61075a879161109e565b6107645785610715565b8580fd5b85513d89823e3d90fd5b61079190863d8811610798575b61078981836110c8565b810190611192565b50386106e0565b503d61077f565b87513d85823e3d90fd5b6107b29061109e565b61015157813861068c565b6107c69061109e565b61015157813861065a565b6107e89150863d88116107985761078981836110c8565b38610624565b6107f791611185565b90803b156108da5783885180928183816108356340c10f1960e01b98898352308d8401602090939291936001600160a01b0360408201951681520152565b03925af180156108d0579084916108bc575b505081600a54169082600954169160035490803b1561076457610890938680948c519687958694859384528c8401602090939291936001600160a01b0360408201951681520152565b03925af1801561079f579083916108a8575b806105cf565b6108b19061109e565b6101515781386108a2565b6108c59061109e565b610389578238610847565b88513d86823e3d90fd5b8380fd5b90508781813d8311610904575b6108f581836110c8565b810103126103c95751386105c6565b503d6108eb565b89513d87823e3d90fd5b601190634e487b7160e01b6000525260246000fd5b634e487b7160e01b845260119052602483fd5b634e487b7160e01b865260118252602486fd5b505034610151576020366003190112610151576109796001600160a01b036007541633146110ea565b3560015580f35b8390346101515781600319360112610151576020906001549051908152f35b8390346101515781600319360112610151576020906001600160a01b03600854169051908152f35b9190503461038957610100366003190112610389576109e4611016565b602435906001600160a01b0392838316809303610de95760443591848316809303610de95760643560843586811694858203610de95760a435888116809103610de95760c43594898616809603610de9578b9586549960ff8b60081c16159a8b809c610ddc575b8015610dc5575b610a5b9061102c565b60ff19811660011789558b610db4575b508c80519263210ca05d60e01b845260209d8e858d81875afa968715610daa578f95978e988d91610d14575b5092827f427d619a0a9852319231312bf3a2f7e361f12399aae2c315cc710a8055cc6ba395927fc6ff127433b785c51da9ae4088ee184c909b1a55b9afd82ae6c64224d3bc15d2999a9b948996169b8c92600a549c8d9473ffffffffffffffffffffffffffffffffffffffff1980961617600a5516988984600b541617600b5583600c541617600c558583600d541617600d55826008541617600855816007541617600755600954161760095551908152a18c51908152a183610c9d575b5050505050683635c9adc5dea00000815560e4356003556103de6001556101f46002557f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6005558451848101926302b8a21d60e01b8452602482015260248152606081019067ffffffffffffffff9181811083821117610c885788918291895251734392dc16867d53dbfe227076606455634d4c27959582875af150610bf961111c565b50855190858201926325ce9a3760e01b84528083528783019183831090831117610c735750865251869283929083905af150610c3361111c565b50610c3c578280f35b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989161ff001984541684555160018152a138808280f35b604190634e487b7160e01b6000525260246000fd5b604184634e487b7160e01b6000525260246000fd5b84161791823b156108da57610cdf928492838b518096819582946340c10f1960e01b84528b8401602090939291936001600160a01b0360408201951681520152565b03925af18015610d0a57610cf6575b808080610b55565b610cff9061109e565b610764578538610cee565b87513d84823e3d90fd5b939798505092509381813d8311610da3575b610d3081836110c8565b81010312610d9f57518381168103610d9f578b968f8f9596877f427d619a0a9852319231312bf3a2f7e361f12399aae2c315cc710a8055cc6ba3957fc6ff127433b785c51da9ae4088ee184c909b1a55b9afd82ae6c64224d3bc15d2998996939650949b9a9950929550610a97565b8980fd5b503d610d26565b83513d8d823e3d90fd5b61ffff191661010117885538610a6b565b50303b158015610a52575060ff8116600114610a52565b50600160ff821610610a4b565b600080fd5b50503461015157602036600319011261015157610e176001600160a01b036007541633146110ea565b3560035580f35b8390346101515781600319360112610151576020906001600160a01b03600b54169051908152f35b8390346101515781600319360112610151576020906001600160a01b03600d54169051908152f35b9190503461038957826003193601126103895760209250549051908152f35b8390346101515781600319360112610151576020906001600160a01b03600a54169051908152f35b8390346101515781600319360112610151576020906002549051908152f35b8390346101515781600319360112610151576020906001600160a01b03600c54169051908152f35b91905034610389578260031936011261038957610102835460ff8160081c161580610fed575b610f2b9061102c565b61ffff1916178355826001600160a01b039182600a5416926008541690833b1561038957602490838651958694859363ca5eb5e160e01b85528401525af18015610fe157610fab575b5060207f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989161ff001984541684555160028152a180f35b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989192610fd960209261109e565b929150610f74565b505051903d90823e3d90fd5b50600260ff821610610f22565b8490346101515781600319360112610151576020906005548152f35b600435906001600160a01b0382168203610de957565b1561103357565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608490fd5b67ffffffffffffffff81116110b257604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff8211176110b257604052565b156110f157565b60405162461bcd60e51b815260206004820152600360248201526208551360ea1b6044820152606490fd5b3d15611157573d9067ffffffffffffffff82116110b2576040519161114b601f8201601f1916602001846110c8565b82523d6000602084013e565b606090565b8181029291811591840414171561116f57565b634e487b7160e01b600052601160045260246000fd5b9190820391821161116f57565b90816020910312610de957518015158103610de95790565b6111c162093a808060055404906006540490611185565b6019810180911161116f57600a810290808204600a149015171561116f576103e8916111fa916002548082106000146111fe575061115c565b0490565b905061115c56fea164736f6c6343000817000a

Deployed Bytecode

0x60806040908082526004908136101561001757600080fd5b600092833560e01c9182630a441f7b14610ffa575081631828c07014610efc5781631f85071614610ed45781631fc78a5914610eb5578163210ca05d14610e8d57816326cfc17b14610e6e5781633f2a554014610e4657816346c96aac14610e1e5781635fbc3e7114610dee578163621cb1cf146109c75781637bb453bf1461099f578163854469ca14610980578163953e092f14610950578163a83627de14610514578163a890c910146104c0578163af1df25514610498578163c4e3a63b14610479578163ce37fa661461022b578163d33219b414610203578163d70142fb146101d4578163e43cd77a14610180578163e4a091da14610155575063e923ffe41461012357600080fd5b346101515760203660031901126101515761014a6001600160a01b036007541633146110ea565b3560025580f35b5080fd5b9050823461017d57602036600319011261017d5750610176602092356111aa565b9051908152f35b80fd5b833461017d57602036600319011261017d5761019a611016565b6001600160a01b03906101b2826007541633146110ea565b1673ffffffffffffffffffffffffffffffffffffffff19600954161760095580f35b9050823461017d578060031936011261017d57506103e86101fb602093546001549061115c565b049051908152f35b8390346101515781600319360112610151576020906001600160a01b03600754169051908152f35b919050346103895782600319360112610389576001600160a01b038060085416803303610436576006546103f35762093a8080420490808202918083048214901517156103e05781018091116103cd57908186939260055560065581600a5416908454823b156103c9576102cc9285928389518096819582946340c10f1960e01b84528c8401602090939291936001600160a01b0360408201951681520152565b03925af19081156103ab5783916103b5575b505080600d5416803b156103895782809185875180948193635f72ee1960e11b83525af19081156103ab578391610397575b5050600d5416803b15610151578180918486518094819363326a940760e01b83525af1801561038d57610375575b50507f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f90549180519283528360208401523392a280f35b61037e9061109e565b61038957823861033e565b8280fd5b84513d84823e3d90fd5b6103a09061109e565b610151578138610310565b85513d85823e3d90fd5b6103be9061109e565b6101515781386102de565b8480fd5b634e487b7160e01b865260118452602486fd5b634e487b7160e01b875260118552602487fd5b835162461bcd60e51b8152602081850152600760248201527f53544152544544000000000000000000000000000000000000000000000000006044820152606490fd5b835162461bcd60e51b8152602081850152600560248201527f214d5349470000000000000000000000000000000000000000000000000000006044820152606490fd5b8390346101515781600319360112610151576020906006549051908152f35b8390346101515781600319360112610151576020906001600160a01b03600954169051908152f35b833461017d57602036600319011261017d576104da611016565b73ffffffffffffffffffffffffffffffffffffffff19600754916001600160a01b039061050a82851633146110ea565b1691161760075580f35b9050346103895782600319360112610389576005549162093a809081840180851161093d57421161054a575b6020848451908152f35b90809350420483810293818504149015171561092a57826005556103e861057582546001549061115c565b04808255610582816111aa565b9081019182821161091557856001600160a01b0380600a54168651956370a0823160e01b875230858801526020968781602481865afa90811561090b5785916108de575b508181106107ee575b505050610612858583600a541684600d5416868b5180968195829463a9059cbb60e01b84528c8401602090939291936001600160a01b0360408201951681520152565b03925af190811561079f5783916107d1575b50156101515780600d5416803b156103895782809185895180948193635f72ee1960e11b83525af1801561079f579083916107bd575b505080600d5416803b15610389578280918589518094819363326a940760e01b83525af1801561079f579083916107a9575b50506106d18582600a541683600b541690865491868b5180968195829463095ea7b360e01b84528c8401602090939291936001600160a01b0360408201951681520152565b03925af1801561079f57610772575b50600b5416825490803b15610389576024839288519485938492633c6b16ab60e01b8452888401525af1801561076857610750575b5060209550549183519283528201527f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f823392a23880610540565b61075a879161109e565b6107645785610715565b8580fd5b85513d89823e3d90fd5b61079190863d8811610798575b61078981836110c8565b810190611192565b50386106e0565b503d61077f565b87513d85823e3d90fd5b6107b29061109e565b61015157813861068c565b6107c69061109e565b61015157813861065a565b6107e89150863d88116107985761078981836110c8565b38610624565b6107f791611185565b90803b156108da5783885180928183816108356340c10f1960e01b98898352308d8401602090939291936001600160a01b0360408201951681520152565b03925af180156108d0579084916108bc575b505081600a54169082600954169160035490803b1561076457610890938680948c519687958694859384528c8401602090939291936001600160a01b0360408201951681520152565b03925af1801561079f579083916108a8575b806105cf565b6108b19061109e565b6101515781386108a2565b6108c59061109e565b610389578238610847565b88513d86823e3d90fd5b8380fd5b90508781813d8311610904575b6108f581836110c8565b810103126103c95751386105c6565b503d6108eb565b89513d87823e3d90fd5b601190634e487b7160e01b6000525260246000fd5b634e487b7160e01b845260119052602483fd5b634e487b7160e01b865260118252602486fd5b505034610151576020366003190112610151576109796001600160a01b036007541633146110ea565b3560015580f35b8390346101515781600319360112610151576020906001549051908152f35b8390346101515781600319360112610151576020906001600160a01b03600854169051908152f35b9190503461038957610100366003190112610389576109e4611016565b602435906001600160a01b0392838316809303610de95760443591848316809303610de95760643560843586811694858203610de95760a435888116809103610de95760c43594898616809603610de9578b9586549960ff8b60081c16159a8b809c610ddc575b8015610dc5575b610a5b9061102c565b60ff19811660011789558b610db4575b508c80519263210ca05d60e01b845260209d8e858d81875afa968715610daa578f95978e988d91610d14575b5092827f427d619a0a9852319231312bf3a2f7e361f12399aae2c315cc710a8055cc6ba395927fc6ff127433b785c51da9ae4088ee184c909b1a55b9afd82ae6c64224d3bc15d2999a9b948996169b8c92600a549c8d9473ffffffffffffffffffffffffffffffffffffffff1980961617600a5516988984600b541617600b5583600c541617600c558583600d541617600d55826008541617600855816007541617600755600954161760095551908152a18c51908152a183610c9d575b5050505050683635c9adc5dea00000815560e4356003556103de6001556101f46002557f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6005558451848101926302b8a21d60e01b8452602482015260248152606081019067ffffffffffffffff9181811083821117610c885788918291895251734392dc16867d53dbfe227076606455634d4c27959582875af150610bf961111c565b50855190858201926325ce9a3760e01b84528083528783019183831090831117610c735750865251869283929083905af150610c3361111c565b50610c3c578280f35b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989161ff001984541684555160018152a138808280f35b604190634e487b7160e01b6000525260246000fd5b604184634e487b7160e01b6000525260246000fd5b84161791823b156108da57610cdf928492838b518096819582946340c10f1960e01b84528b8401602090939291936001600160a01b0360408201951681520152565b03925af18015610d0a57610cf6575b808080610b55565b610cff9061109e565b610764578538610cee565b87513d84823e3d90fd5b939798505092509381813d8311610da3575b610d3081836110c8565b81010312610d9f57518381168103610d9f578b968f8f9596877f427d619a0a9852319231312bf3a2f7e361f12399aae2c315cc710a8055cc6ba3957fc6ff127433b785c51da9ae4088ee184c909b1a55b9afd82ae6c64224d3bc15d2998996939650949b9a9950929550610a97565b8980fd5b503d610d26565b83513d8d823e3d90fd5b61ffff191661010117885538610a6b565b50303b158015610a52575060ff8116600114610a52565b50600160ff821610610a4b565b600080fd5b50503461015157602036600319011261015157610e176001600160a01b036007541633146110ea565b3560035580f35b8390346101515781600319360112610151576020906001600160a01b03600b54169051908152f35b8390346101515781600319360112610151576020906001600160a01b03600d54169051908152f35b9190503461038957826003193601126103895760209250549051908152f35b8390346101515781600319360112610151576020906001600160a01b03600a54169051908152f35b8390346101515781600319360112610151576020906002549051908152f35b8390346101515781600319360112610151576020906001600160a01b03600c54169051908152f35b91905034610389578260031936011261038957610102835460ff8160081c161580610fed575b610f2b9061102c565b61ffff1916178355826001600160a01b039182600a5416926008541690833b1561038957602490838651958694859363ca5eb5e160e01b85528401525af18015610fe157610fab575b5060207f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989161ff001984541684555160028152a180f35b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989192610fd960209261109e565b929150610f74565b505051903d90823e3d90fd5b50600260ff821610610f22565b8490346101515781600319360112610151576020906005548152f35b600435906001600160a01b0382168203610de957565b1561103357565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608490fd5b67ffffffffffffffff81116110b257604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff8211176110b257604052565b156110f157565b60405162461bcd60e51b815260206004820152600360248201526208551360ea1b6044820152606490fd5b3d15611157573d9067ffffffffffffffff82116110b2576040519161114b601f8201601f1916602001846110c8565b82523d6000602084013e565b606090565b8181029291811591840414171561116f57565b634e487b7160e01b600052601160045260246000fd5b9190820391821161116f57565b90816020910312610de957518015158103610de95790565b6111c162093a808060055404906006540490611185565b6019810180911161116f57600a810290808204600a149015171561116f576103e8916111fa916002548082106000146111fe575061115c565b0490565b905061115c56fea164736f6c6343000817000a

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

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.