Sonic Blaze Testnet

Contract

0x50DB99fae799813f3e73b3CDE3E87a51037704BE

Overview

S Balance

Sonic Blaze LogoSonic Blaze LogoSonic Blaze Logo0 S

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Parent Transaction Hash Block From To
74545702024-12-27 12:38:496 days ago1735303129
0x50DB99fa...1037704BE
0 S
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xeF672607...3e049Ed4d
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
veNFTAPI

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 11 : veNFTAPI.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;


import '../libraries/Math.sol';
import '../interfaces/IBribeAPI.sol';
import '../interfaces/IERC20.sol';
import '../interfaces/IPair.sol';
import '../interfaces/IPairFactory.sol';
import '../interfaces/IVoter.sol';
import '../interfaces/IVotingEscrow.sol';
import '../interfaces/IRewardsDistributor.sol';

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

interface IPairAPI {
    struct PairInfo {
        // pair info
        address pair_address; 			// pair contract address
        uint decimals; 			        // pair decimals
        PoolType pooltype; 				// pair pool type 
        uint total_supply; 			    // pair tokens supply
    
        // token pair info
        address token0; 				// pair 1st token address
        string token0_symbol; 			// pair 1st token symbol
        uint token0_decimals; 		    // pair 1st token decimals
        uint reserve0; 			        // pair 1st token reserves (nr. of tokens in the contract)

        address token1; 				// pair 2nd token address
        string token1_symbol;           // pair 2nd token symbol
        uint token1_decimals;    		// pair 2nd token decimals
        uint reserve1; 			        // pair 2nd token reserves (nr. of tokens in the contract)

        // pairs gauge
        address gauge; 				    // pair gauge address
        uint gauge_total_supply; 		// pair staked tokens (less/eq than/to pair total supply)
        address fee; 				    // pair fees contract address
        address bribe; 				    // pair bribes contract address
        uint emissions; 			    // pair emissions (per second)
        address emissions_token; 		// pair emissions token address
        uint emissions_token_decimals; 	// pair emissions token decimals

    }
    
    enum PoolType {STABLE, VOLATILE, CL}
    function getPairSingle(address _pair) external view returns(PairInfo memory _PairInfo);
    function pair_factory() external view returns(address);
}

contract veNFTAPI is Initializable {

    struct pairVotes {
        address pair;
        uint256 weight;
    }

    struct veNFT {
        uint8 decimals;
        
        bool voted;
        uint256 attachments;

        uint256 id;
        uint128 amount;
        uint256 voting_amount;
        uint256 rebase_amount;
        uint256 lockEnd;
        uint256 vote_ts;
        pairVotes[] votes;        
        
        address account;

        address token;
        string tokenSymbol;
        uint256 tokenDecimals;
    }

    struct Reward {
        
        uint8 decimals;
        uint256 amount;
        address token;
    }
   
    uint256 constant public MAX_RESULTS = 1000;
    uint256 constant public MAX_PAIRS = 30;

    IVoter public voter;
    address public underlyingToken;
    

    IVotingEscrow public ve;
    IRewardsDistributor public rewardDisitributor;

    address public pairAPI;
    IPairFactory public pairFactory;
    

    address public owner;
    event Owner(address oldOwner, address newOwner);

    struct AllPairRewards {
        Reward[] rewards;
    }
    constructor() {}

    function initialize(address _voter, address _rewarddistro, address _pairApi) initializer public {

        owner = msg.sender;

        pairAPI = _pairApi;
        voter = IVoter(_voter);
        rewardDisitributor = IRewardsDistributor(_rewarddistro);

        require(rewardDisitributor.voting_escrow() == voter._ve(), 've!=ve');
        
        ve = IVotingEscrow( rewardDisitributor.voting_escrow() );
        underlyingToken = IVotingEscrow(ve).token();

        pairFactory = IPairFactory(voter.factory());

    }



    function getAllNFT(uint256 _amounts, uint256 _offset) external view returns(veNFT[] memory _veNFT){

        require(_amounts <= MAX_RESULTS, 'too many nfts');
        _veNFT = new veNFT[](_amounts);

        uint i = _offset;
        address _owner;

        for(i; i < _offset + _amounts; i++){
            _owner = ve.ownerOf(i);
            // if id_i has owner read data
            if(_owner != address(0)){
                _veNFT[i-_offset] = _getNFTFromId(i, _owner);
            }
        }
    }

    function getNFTFromId(uint256 id) external view returns(veNFT memory){
        return _getNFTFromId(id,ve.ownerOf(id));
    }

    function getNFTFromAddress(address _user) external view returns(veNFT[] memory venft){

        uint256 i=0;
        uint256 _id;
        uint256 totNFTs = ve.balanceOf(_user);

        venft = new veNFT[](totNFTs);

        for(i; i < totNFTs; i++){
            _id = ve.tokenOfOwnerByIndex(_user, i);
            if(_id != 0){
                venft[i] = _getNFTFromId(_id, _user);
            }
        }
    }

    function getRebaseRewards(uint256[] calldata tokenIds) external view returns(uint256[] memory rebases) {
        uint256 len = tokenIds.length;
        rebases = new uint256[](len);
        for(uint256 i; i < len; ++i) {
            rebases[i] = rewardDisitributor.claimable(tokenIds[i]);
        }
    }

    function _getNFTFromId(uint256 id, address _owner) internal view returns(veNFT memory venft){

        if(_owner == address(0)){
            return venft;
        }

        uint _totalPoolVotes = voter.poolVoteLength(id);
        pairVotes[] memory votes = new pairVotes[](_totalPoolVotes);

        IVotingEscrow.LockedBalance memory _lockedBalance;
        _lockedBalance = ve.locked(id);

        uint k;
        uint256 _poolWeight;
        address _votedPair;

        for(k = 0; k < _totalPoolVotes; k++){

            _votedPair = voter.poolVote(id, k);
            if(_votedPair == address(0)){
                break;
            }
            _poolWeight = voter.votes(id, _votedPair);
            votes[k].pair = _votedPair;
            votes[k].weight = _poolWeight;
        }

        venft.id = id;
        venft.account = _owner;
        venft.decimals = ve.decimals();
        venft.amount = uint128(_lockedBalance.amount);
        venft.voting_amount = ve.balanceOfNFT(id);
        venft.rebase_amount = rewardDisitributor.claimable(id);
        venft.lockEnd = _lockedBalance.end;
        venft.vote_ts = voter.lastVoted(id);
        venft.votes = votes;
        venft.token = ve.token();
        venft.tokenSymbol =  IERC20( ve.token() ).symbol();
        venft.tokenDecimals = IERC20( ve.token() ).decimals();
        venft.voted = ve.voted(id);
        venft.attachments = ve.attachments(id);
      
    }

    // used only for sAMM and vAMM    
    function allPairRewards(uint256 _amount, uint256 _offset, uint256 id) external view returns(AllPairRewards[] memory rewards){
        
        rewards = new AllPairRewards[](MAX_PAIRS);

        uint256 totalPairs = pairFactory.allPairsLength();
        
        uint i = _offset;
        address _pair;
        for(i; i < _offset + _amount; i++){
            if(i >= totalPairs){
                break;
            }
            _pair = pairFactory.allPairs(i);
            rewards[i].rewards = _pairReward(_pair, id, address(0));
        }
    }

    function singlePairRewardId(uint256 id, address _pair) external view returns(Reward[] memory _reward){
        return _pairReward(_pair, id, address(0));
    }

    function singlePairRewardAddress(address user, address _pair) external view returns(Reward[] memory _reward){
        return _pairReward(_pair, 0, user);
    }


    function _pairReward(address _pair, uint256 id, address user) internal view returns(Reward[] memory _reward){

        if(_pair == address(0)){
            return _reward;
        }

        
        IPairAPI.PairInfo memory _pairApi = IPairAPI(pairAPI).getPairSingle(_pair);
               
        address externalBribe = _pairApi.bribe;
        
        uint256 totBribeTokens = (externalBribe == address(0)) ? 0 : IBribeAPI(externalBribe).rewardsListLength();
        
        uint bribeAmount;
        bool exists = false;
        _reward = new Reward[](2+totBribeTokens);

        address _gauge = (voter.gauges(_pair));
        
        if(_gauge == address(0)){
            return new Reward[](0); 
        }
       
        {
        address t0 = _pairApi.token0;
        address t1 = _pairApi.token1;
        uint256 _feeToken0 = 0;
        uint256 _feeToken1 = 0;
        if(user == address(0)){
            _feeToken0 = IBribeAPI(_pairApi.fee).earned(id, t0);
            _feeToken1 = IBribeAPI(_pairApi.fee).earned(id, t1);
        } 
        else if(id == 0){
            _feeToken0 = IBribeAPI(_pairApi.fee).earned(user, t0);
            _feeToken1 = IBribeAPI(_pairApi.fee).earned(user, t1);
        }
        else {
            return _reward;
        }
        
        if(_feeToken0 > 0){
            _reward[0] = Reward({
                amount: _feeToken0,
                token: t0,
                decimals: IERC20(t0).decimals()
            });
            exists = true;
        }

        
        if(_feeToken1 > 0){
            _reward[1] = Reward({
                amount: _feeToken1,
                token: t1,
                decimals: IERC20(t1).decimals()
            });
            exists = true;
        }
        }

        uint k = 0;
        address _token;      
        if(externalBribe != address(0)) {
            for(k; k < totBribeTokens; k++){
                _token = IBribeAPI(externalBribe).rewardTokens(k);
                bribeAmount = user == address(0) ? IBribeAPI(externalBribe).earned(id, _token) : IBribeAPI(externalBribe).earned(user,_token);
                if(bribeAmount > 0) {
                    _reward[2+k] = Reward({
                        amount: bribeAmount,
                        token: _token,
                        decimals: IERC20(_token).decimals()
                    });
                    if(!exists) exists = true;
                }
            }  
        }   

        if(!exists) return new Reward[](0);

    }
    



    function setOwner(address _owner) external {
        require(msg.sender == owner, 'not owner');
        require(_owner != address(0), 'zeroAddr');
        owner = _owner;
        emit Owner(msg.sender, _owner);
    }

    
    function setVoter(address _voter) external  {
        require(msg.sender == owner);

        voter = IVoter(_voter);
    }


    function setRewardDistro(address _rewarddistro) external {
        require(msg.sender == owner);
        
        rewardDisitributor = IRewardsDistributor(_rewarddistro);
        require(rewardDisitributor.voting_escrow() == voter._ve(), 've!=ve');

        ve = IVotingEscrow( rewardDisitributor.voting_escrow() );
        underlyingToken = IVotingEscrow(ve).token();
    }
    
    function setPairAPI(address _pairApi) external {
        require(msg.sender == owner);
        
        pairAPI = _pairApi;
    }


    function setPairFactory(address _pairFactory) external {
        require(msg.sender == owner);  
        pairFactory = IPairFactory(_pairFactory);
    }

}

File 2 of 11 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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]
 * ```
 * 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 Internal function that returns the initialized version. Returns `_initialized`
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Internal function that returns the initialized version. Returns `_initializing`
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 3 of 11 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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
     * ====
     *
     * [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://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return 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 Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

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

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

File 4 of 11 : IBribeAPI.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

interface IBribeAPI {

    struct Reward {
        uint256 periodFinish;
        uint256 rewardsPerEpoch;
        uint256 lastUpdateTime; 
    }
    function rewardData(address _token, uint256 ts) external view returns(Reward memory _Reward);
    function _deposit(uint amount, uint tokenId) external;
    function _withdraw(uint amount, uint tokenId) external;
    function getRewardForOwner(uint tokenId, address[] memory tokens) external;
    function notifyRewardAmount(address token, uint amount) external;
    function left(address token) external view returns (uint);
    function rewardsListLength() external view returns (uint);
    function supplyNumCheckpoints() external view returns (uint);
    //function getEpochStart(uint timestamp) external pure returns (uint);
    function getEpochStart() external pure returns (uint);
    function getNextEpochStart() external pure returns (uint);
    function getPriorSupplyIndex(uint timestamp) external view returns (uint);
    function rewardTokens(uint index) external view returns (address);
    function rewardsPerEpoch(address token,uint ts) external view returns (uint);
    function supplyCheckpoints(uint _index) external view returns(uint timestamp, uint supplyd);
    function earned(uint tokenId, address token) external view returns (uint);
    function earned(address user, address token) external view returns (uint);
    function firstBribeTimestamp() external view returns(uint);
    function totalSupplyAt(uint256 _timestamp) external view returns (uint256);
    function balanceOfAt(uint256 tokenId, uint256 _timestamp) external view returns (uint256);
    function balanceOfOwnerAt(address _owner, uint256 _timestamp) external view returns (uint256);


}

File 5 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

interface IERC20 {
    function totalSupply() external view returns (uint256);
    function transfer(address recipient, uint amount) external returns (bool);
    function decimals() external view returns (uint8);
    function symbol() external view returns (string memory);
    function balanceOf(address) external view returns (uint);
    function transferFrom(address sender, address recipient, uint amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint);
    function approve(address spender, uint value) external returns (bool);

    event Transfer(address indexed from, address indexed to, uint value);
    event Approval(address indexed owner, address indexed spender, uint value);
}

File 6 of 11 : IPair.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

interface IPair {
    function metadata() external view returns (uint dec0, uint dec1, uint r0, uint r1, bool st, address t0, address t1);
    function claimFees() external returns (uint, uint);
    function tokens() external view returns (address, address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function transferFrom(address src, address dst, uint amount) external returns (bool);
    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function burn(address to) external returns (uint amount0, uint amount1);
    function mint(address to) external returns (uint liquidity);
    function getReserves() external view returns (uint _reserve0, uint _reserve1, uint _blockTimestampLast);
    function getAmountOut(uint, address) external view returns (uint);

    function name() external view returns(string memory);
    function symbol() external view returns(string memory);
    function totalSupply() external view returns (uint);
    function decimals() external view returns (uint8);

    function claimable0(address _user) external view returns (uint);
    function claimable1(address _user) external view returns (uint);

    function isStable() external view returns(bool);


}

File 7 of 11 : IPairFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

interface IPairFactory {
    function allPairsLength() external view returns (uint);
    function isPair(address pair) external view returns (bool);
    function allPairs(uint index) external view returns (address);
    function stakingFeeHandler() external view returns (address);
    function dibs() external view returns (address);
    function MAX_TREASURY_FEE() external view returns (uint256);
    function stakingNFTFee() external view returns (uint256);
    function isPaused() external view returns (bool);
    function pairCodeHash() external pure returns (bytes32);
    function getPair(address tokenA, address token, bool stable) external view returns (address);
    function createPair(address tokenA, address tokenB, bool stable) external returns (address pair);
    function getInitializable() external view returns (address, address, bool);
    function getFee(bool _stable) external view returns(uint256);
}

File 8 of 11 : IRewardsDistributor.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

interface IRewardsDistributor {
    function checkpoint_token() external;
    function voting_escrow() external view returns(address);
    function checkpoint_total_supply() external;
    function claimable(uint _tokenId) external view returns (uint);
}

File 9 of 11 : IVoter.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

interface IVoter {
    function _ve() external view returns (address);
    function gauges(address _pair) external view returns (address);
    function isGauge(address _gauge) external view returns (bool);
    function poolForGauge(address _gauge) external view returns (address);
    function factory() external view returns (address);
    function minter() external view returns(address);
    function isWhitelisted(address token) external view returns (bool);
    function notifyRewardAmount(uint amount) external;
    function distributeAll() external;
    function distributeFees(address[] memory _gauges) external;

    function internal_bribes(address _gauge) external view returns (address);
    function external_bribes(address _gauge) external view returns (address);

    function usedWeights(uint id) external view returns(uint);
    function lastVoted(uint id) external view returns(uint);
    function poolVote(uint id, uint _index) external view returns(address _pair);
    function votes(uint id, address _pool) external view returns(uint votes);
    function poolVoteLength(uint tokenId) external view returns(uint);
    
}

File 10 of 11 : IVotingEscrow.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

interface IVotingEscrow {

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

    struct LockedBalance {
        int128 amount;
        uint start;
        uint end;
    }

    function create_lock_for(uint _value, uint _lock_duration, address _to) external returns (uint);

    function locked(uint id) external view returns(LockedBalance memory);
    function tokenOfOwnerByIndex(address _owner, uint _tokenIndex) external view returns (uint);

    function token() external view returns (address);
    function team() external returns (address);
    function epoch() external view returns (uint);
    function point_history(uint loc) external view returns (Point memory);
    function user_point_history(uint tokenId, uint loc) external view returns (Point memory);
    function user_point_epoch(uint tokenId) external view returns (uint);

    function ownerOf(uint) external view returns (address);
    function isApprovedOrOwner(address, uint) external view returns (bool);
    function transferFrom(address, address, uint) external;

    function voted(uint) external view returns (bool);
    function attachments(uint) external view returns (uint);
    function voting(uint tokenId) external;
    function abstain(uint tokenId) external;
    function attach(uint tokenId) external;
    function detach(uint tokenId) external;

    function checkpoint() external;
    function deposit_for(uint tokenId, uint value) external;

    function balanceOfAtNFT(uint _tokenId, uint _block) external view returns (uint);
    function balanceOfNFT(uint _id) external view returns (uint);
    function balanceOf(address _owner) external view returns (uint);
    function totalSupply() external view returns (uint);
    function supply() external view returns (uint);


    function decimals() external view returns(uint8);
}

File 11 of 11 : Math.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

library Math {
    function max(uint a, uint b) internal pure returns (uint) {
        return a >= b ? a : b;
    }
    function min(uint a, uint b) internal pure returns (uint) {
        return a < b ? a : b;
    }
    function sqrt(uint y) internal pure returns (uint z) {
        if (y > 3) {
            z = y;
            uint x = y / 2 + 1;
            while (x < z) {
                z = x;
                x = (y / x + x) / 2;
            }
        } else if (y != 0) {
            z = 1;
        }
    }
    function cbrt(uint256 n) internal pure returns (uint256) { unchecked {
        uint256 x = 0;
        for (uint256 y = 1 << 255; y > 0; y >>= 3) {
            x <<= 1;
            uint256 z = 3 * x * (x + 1) + 1;
            if (n / y >= z) {
                n -= y * z;
                x += 1;
            }
        }
        return x;
    }}
}

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

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"Owner","type":"event"},{"inputs":[],"name":"MAX_PAIRS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_RESULTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_offset","type":"uint256"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"allPairRewards","outputs":[{"components":[{"components":[{"internalType":"uint8","name":"decimals","type":"uint8"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"token","type":"address"}],"internalType":"struct veNFTAPI.Reward[]","name":"rewards","type":"tuple[]"}],"internalType":"struct veNFTAPI.AllPairRewards[]","name":"rewards","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amounts","type":"uint256"},{"internalType":"uint256","name":"_offset","type":"uint256"}],"name":"getAllNFT","outputs":[{"components":[{"internalType":"uint8","name":"decimals","type":"uint8"},{"internalType":"bool","name":"voted","type":"bool"},{"internalType":"uint256","name":"attachments","type":"uint256"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint256","name":"voting_amount","type":"uint256"},{"internalType":"uint256","name":"rebase_amount","type":"uint256"},{"internalType":"uint256","name":"lockEnd","type":"uint256"},{"internalType":"uint256","name":"vote_ts","type":"uint256"},{"components":[{"internalType":"address","name":"pair","type":"address"},{"internalType":"uint256","name":"weight","type":"uint256"}],"internalType":"struct veNFTAPI.pairVotes[]","name":"votes","type":"tuple[]"},{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"string","name":"tokenSymbol","type":"string"},{"internalType":"uint256","name":"tokenDecimals","type":"uint256"}],"internalType":"struct veNFTAPI.veNFT[]","name":"_veNFT","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getNFTFromAddress","outputs":[{"components":[{"internalType":"uint8","name":"decimals","type":"uint8"},{"internalType":"bool","name":"voted","type":"bool"},{"internalType":"uint256","name":"attachments","type":"uint256"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint256","name":"voting_amount","type":"uint256"},{"internalType":"uint256","name":"rebase_amount","type":"uint256"},{"internalType":"uint256","name":"lockEnd","type":"uint256"},{"internalType":"uint256","name":"vote_ts","type":"uint256"},{"components":[{"internalType":"address","name":"pair","type":"address"},{"internalType":"uint256","name":"weight","type":"uint256"}],"internalType":"struct veNFTAPI.pairVotes[]","name":"votes","type":"tuple[]"},{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"string","name":"tokenSymbol","type":"string"},{"internalType":"uint256","name":"tokenDecimals","type":"uint256"}],"internalType":"struct veNFTAPI.veNFT[]","name":"venft","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getNFTFromId","outputs":[{"components":[{"internalType":"uint8","name":"decimals","type":"uint8"},{"internalType":"bool","name":"voted","type":"bool"},{"internalType":"uint256","name":"attachments","type":"uint256"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint256","name":"voting_amount","type":"uint256"},{"internalType":"uint256","name":"rebase_amount","type":"uint256"},{"internalType":"uint256","name":"lockEnd","type":"uint256"},{"internalType":"uint256","name":"vote_ts","type":"uint256"},{"components":[{"internalType":"address","name":"pair","type":"address"},{"internalType":"uint256","name":"weight","type":"uint256"}],"internalType":"struct veNFTAPI.pairVotes[]","name":"votes","type":"tuple[]"},{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"string","name":"tokenSymbol","type":"string"},{"internalType":"uint256","name":"tokenDecimals","type":"uint256"}],"internalType":"struct veNFTAPI.veNFT","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"getRebaseRewards","outputs":[{"internalType":"uint256[]","name":"rebases","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_voter","type":"address"},{"internalType":"address","name":"_rewarddistro","type":"address"},{"internalType":"address","name":"_pairApi","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pairAPI","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pairFactory","outputs":[{"internalType":"contract IPairFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardDisitributor","outputs":[{"internalType":"contract IRewardsDistributor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pairApi","type":"address"}],"name":"setPairAPI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pairFactory","type":"address"}],"name":"setPairFactory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rewarddistro","type":"address"}],"name":"setRewardDistro","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_voter","type":"address"}],"name":"setVoter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"_pair","type":"address"}],"name":"singlePairRewardAddress","outputs":[{"components":[{"internalType":"uint8","name":"decimals","type":"uint8"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"token","type":"address"}],"internalType":"struct veNFTAPI.Reward[]","name":"_reward","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"_pair","type":"address"}],"name":"singlePairRewardId","outputs":[{"components":[{"internalType":"uint8","name":"decimals","type":"uint8"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"token","type":"address"}],"internalType":"struct veNFTAPI.Reward[]","name":"_reward","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"underlyingToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101425760003560e01c80635e558e90116100b8578063b7d5df901161007c578063b7d5df90146102d6578063c0c53b8b146102e9578063d432419d146102fc578063d5ecfe631461030f578063dca0815914610322578063e14f870d1461033557600080fd5b80635e558e90146102685780637964bac9146102885780638da5cb5b1461029b578063996cf233146102ae578063ad95468f146102b657600080fd5b80632495a5991161010a5780632495a599146101d65780632af6e3be146101e957806346c96aac146102095780634bc2a657146102225780635113beb114610235578063581545d71461025557600080fd5b80630c8067361461014757806313af40351461016357806314287d921461017857806315d05356146101985780631f850716146101c3575b600080fd5b6101506103e881565b6040519081526020015b60405180910390f35b6101766101713660046122fb565b610348565b005b61018b610186366004612318565b61042f565b60405161015a919061238d565b6003546101ab906001600160a01b031681565b6040516001600160a01b03909116815260200161015a565b6002546101ab906001600160a01b031681565b6001546101ab906001600160a01b031681565b6101fc6101f73660046122fb565b610540565b60405161015a919061256e565b6000546101ab906201000090046001600160a01b031681565b6101766102303660046122fb565b6106d5565b6102486102433660046125d0565b610716565b60405161015a919061265b565b61024861026336600461266e565b61072d565b61027b610276366004612693565b61073b565b60405161015a91906126ac565b6101766102963660046122fb565b6107bb565b6006546101ab906001600160a01b031681565b610150601e81565b6102c96102c43660046126bf565b6107f4565b60405161015a91906126eb565b6004546101ab906001600160a01b031681565b6101766102f7366004612748565b61097e565b6101fc61030a366004612793565b610da5565b61017661031d3660046122fb565b610f14565b6101766103303660046122fb565b61118e565b6005546101ab906001600160a01b031681565b6006546001600160a01b031633146103935760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b60448201526064015b60405180910390fd5b6001600160a01b0381166103d45760405162461bcd60e51b81526020600482015260086024820152673d32b937a0b2323960c11b604482015260640161038a565b600680546001600160a01b0319166001600160a01b0383169081179091556040805133815260208101929092527fc53ee02035d465398c0648e0bca1462281006a266ec38c7192bce1c24e0b64a3910160405180910390a150565b6060818067ffffffffffffffff81111561044b5761044b6127b5565b604051908082528060200260200182016040528015610474578160200160208202803683370190505b50915060005b81811015610538576003546001600160a01b031663d1d58b258686848181106104a5576104a56127cb565b905060200201356040518263ffffffff1660e01b81526004016104ca91815260200190565b602060405180830381865afa1580156104e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050b91906127e1565b83828151811061051d5761051d6127cb565b602090810291909101015261053181612810565b905061047a565b505092915050565b6002546040516370a0823160e01b81526001600160a01b0383811660048301526060926000928392839216906370a0823190602401602060405180830381865afa158015610592573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b691906127e1565b90508067ffffffffffffffff8111156105d1576105d16127b5565b60405190808252806020026020018201604052801561060a57816020015b6105f7612254565b8152602001906001900390816105ef5790505b5093505b808310156106cd57600254604051632f745c5960e01b81526001600160a01b0387811660048301526024820186905290911690632f745c5990604401602060405180830381865afa158015610667573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068b91906127e1565b915081156106bb5761069d82866111c7565b8484815181106106af576106af6127cb565b60200260200101819052505b826106c581612810565b93505061060e565b505050919050565b6006546001600160a01b031633146106ec57600080fd5b600080546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b6060610724826000856119e6565b90505b92915050565b6060610724828460006119e6565b610743612254565b6002546040516331a9108f60e11b8152600481018490526107279184916001600160a01b0390911690636352211e90602401602060405180830381865afa158015610792573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b69190612839565b6111c7565b6006546001600160a01b031633146107d257600080fd5b600580546001600160a01b0319166001600160a01b0392909216919091179055565b60408051601e8082526103e08201909252606091816020015b60408051602081019091526060815281526020019060019003908161080d5790505090506000600560009054906101000a90046001600160a01b03166001600160a01b031663574f2ba36040518163ffffffff1660e01b8152600401602060405180830381865afa158015610886573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108aa91906127e1565b90508360005b6108ba8787612856565b821015610974578282101561097457600554604051631e3dd18b60e01b8152600481018490526001600160a01b0390911690631e3dd18b90602401602060405180830381865afa158015610912573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109369190612839565b9050610944818660006119e6565b848381518110610956576109566127cb565b6020908102919091010151528161096c81612810565b9250506108b0565b5050509392505050565b600054610100900460ff161580801561099e5750600054600160ff909116105b806109b85750303b1580156109b8575060005460ff166001145b610a1b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161038a565b6000805460ff191660011790558015610a3e576000805461ff0019166101001790555b60068054336001600160a01b0319918216179091556004805482166001600160a01b038581169190911782556000805462010000600160b01b0319166201000089841681029190911791829055600380549095168884161790945560408051638dd598fb60e01b815290519490910490911692638dd598fb928281019260209291908290030181865afa158015610ad9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afd9190612839565b6001600160a01b0316600360009054906101000a90046001600160a01b03166001600160a01b031663dfe050316040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7d9190612839565b6001600160a01b031614610bbc5760405162461bcd60e51b81526020600482015260066024820152657665213d766560d01b604482015260640161038a565b600360009054906101000a90046001600160a01b03166001600160a01b031663dfe050316040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c339190612839565b600280546001600160a01b0319166001600160a01b0392909216918217905560408051637e062a3560e11b8152905163fc0c546a916004808201926020929091908290030181865afa158015610c8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb19190612839565b600180546001600160a01b0319166001600160a01b039283161790556000546040805163c45a015560e01b81529051620100009092049092169163c45a01559160048083019260209291908290030181865afa158015610d15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d399190612839565b600580546001600160a01b0319166001600160a01b03929092169190911790558015610d9f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b60606103e8831115610de95760405162461bcd60e51b815260206004820152600d60248201526c746f6f206d616e79206e66747360981b604482015260640161038a565b8267ffffffffffffffff811115610e0257610e026127b5565b604051908082528060200260200182016040528015610e3b57816020015b610e28612254565b815260200190600190039081610e205790505b5090508160005b610e4c8585612856565b821015610538576002546040516331a9108f60e11b8152600481018490526001600160a01b0390911690636352211e90602401602060405180830381865afa158015610e9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec09190612839565b90506001600160a01b03811615610f0257610edb82826111c7565b83610ee6868561286e565b81518110610ef657610ef66127cb565b60200260200101819052505b81610f0c81612810565b925050610e42565b6006546001600160a01b03163314610f2b57600080fd5b600380546001600160a01b0319166001600160a01b038381169190911790915560005460408051638dd598fb60e01b815290516201000090920490921691638dd598fb9160048083019260209291908290030181865afa158015610f93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb79190612839565b6001600160a01b0316600360009054906101000a90046001600160a01b03166001600160a01b031663dfe050316040518163ffffffff1660e01b8152600401602060405180830381865afa158015611013573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110379190612839565b6001600160a01b0316146110765760405162461bcd60e51b81526020600482015260066024820152657665213d766560d01b604482015260640161038a565b600360009054906101000a90046001600160a01b03166001600160a01b031663dfe050316040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ed9190612839565b600280546001600160a01b0319166001600160a01b0392909216918217905560408051637e062a3560e11b8152905163fc0c546a916004808201926020929091908290030181865afa158015611147573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116b9190612839565b600180546001600160a01b0319166001600160a01b039290921691909117905550565b6006546001600160a01b031633146111a557600080fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6111cf612254565b6001600160a01b038216156107275760008054604051633223f3ed60e11b815260048101869052620100009091046001600160a01b031690636447e7da90602401602060405180830381865afa15801561122d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125191906127e1565b905060008167ffffffffffffffff81111561126e5761126e6127b5565b6040519080825280602002602001820160405280156112b357816020015b604080518082019091526000808252602082015281526020019060019003908161128c5790505b5090506112dd60405180606001604052806000600f0b815260200160008152602001600081525090565b600254604051635a2d1e0760e11b8152600481018890526001600160a01b039091169063b45a3c0e90602401606060405180830381865afa158015611326573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061134a91906128af565b9050600080805b858310156114cb5760005460405163a86a366d60e01b8152600481018b905260248101859052620100009091046001600160a01b03169063a86a366d90604401602060405180830381865afa1580156113ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d29190612839565b90506001600160a01b038116156114cb5760005460405163348c952d60e21b8152600481018b90526001600160a01b038381166024830152620100009092049091169063d23254b490604401602060405180830381865afa15801561143b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061145f91906127e1565b915080858481518110611474576114746127cb565b6020026020010151600001906001600160a01b031690816001600160a01b031681525050818584815181106114ab576114ab6127cb565b6020908102919091018101510152826114c381612810565b935050611351565b606087018990526001600160a01b038089166101408901526002546040805163313ce56760e01b81529051919092169163313ce5679160048083019260209291908290030181865afa158015611525573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115499190612918565b60ff16875283516001600160801b031660808801526002546040516339f890b560e21b8152600481018b90526001600160a01b039091169063e7e242d490602401602060405180830381865afa1580156115a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115cb91906127e1565b60a088015260035460405163d1d58b2560e01b8152600481018b90526001600160a01b039091169063d1d58b2590602401602060405180830381865afa158015611619573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163d91906127e1565b60c088015260408481015160e0890152600054905163079aca5f60e51b8152600481018b9052620100009091046001600160a01b03169063f3594be090602401602060405180830381865afa15801561169a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116be91906127e1565b610100880152610120870185905260025460408051637e062a3560e11b815290516001600160a01b039092169163fc0c546a916004808201926020929091908290030181865afa158015611716573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173a9190612839565b6001600160a01b0390811661016089015260025460408051637e062a3560e11b81529051919092169163fc0c546a9160048083019260209291908290030181865afa15801561178d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b19190612839565b6001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa1580156117ee573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261181691908101906129c3565b61018088015260025460408051637e062a3560e11b815290516001600160a01b039092169163fc0c546a916004808201926020929091908290030181865afa158015611866573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188a9190612839565b6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118eb9190612918565b60ff166101a0880152600254604051638fbb38ff60e01b8152600481018b90526001600160a01b0390911690638fbb38ff90602401602060405180830381865afa15801561193d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119619190612a00565b15156020880152600254604051630d6a203360e01b8152600481018b90526001600160a01b0390911690630d6a203390602401602060405180830381865afa1580156119b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d591906127e1565b604088015250505050505092915050565b60606001600160a01b0384161561224d57600480546040516309b1aef760e41b81526001600160a01b038781169382019390935260009290911690639b1aef7090602401600060405180830381865afa158015611a47573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611a6f9190810190612a31565b6101e081015190915060006001600160a01b03821615611af057816001600160a01b031663e68863966040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ac7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aeb91906127e1565b611af3565b60005b9050600080611b03836002612856565b67ffffffffffffffff811115611b1b57611b1b6127b5565b604051908082528060200260200182016040528015611b6657816020015b6040805160608101825260008082526020808301829052928201528252600019909201910181611b395790505b506000805460405163b9a09fd560e01b81526001600160a01b038d81166004830152939950919262010000909104169063b9a09fd590602401602060405180830381865afa158015611bbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611be09190612839565b90506001600160a01b038116611c41576040805160008082526020820190925290611c33565b6040805160608101825260008082526020808301829052928201528252600019909201910181611c065790505b50965050505050505061224d565b60808601516101008701516000806001600160a01b038c16611d64576101c08a01516040516338e7023f60e21b8152600481018f90526001600160a01b0386811660248301529091169063e39c08fc90604401602060405180830381865afa158015611cb1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cd591906127e1565b9150896101c001516001600160a01b031663e39c08fc8e856040518363ffffffff1660e01b8152600401611d1c9291909182526001600160a01b0316602082015260400190565b602060405180830381865afa158015611d39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d5d91906127e1565b9050611e33565b8c600003611e24576101c08a015160405163211dc32d60e01b81526001600160a01b038e8116600483015286811660248301529091169063211dc32d90604401602060405180830381865afa158015611dc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de591906127e1565b6101c08b015160405163211dc32d60e01b81526001600160a01b038f81166004830152868116602483015292945091169063211dc32d90604401611d1c565b5050505050505050505061224d565b8115611ee4576040518060600160405280856001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea69190612918565b60ff168152602001838152602001856001600160a01b03168152508b600081518110611ed457611ed46127cb565b6020026020010181905250600195505b8015611f95576040518060600160405280846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f579190612918565b60ff168152602001828152602001846001600160a01b03168152508b600181518110611f8557611f856127cb565b6020026020010181905250600195505b5060009250829150506001600160a01b038716156121ec575b858210156121ec57604051637bb7bed160e01b8152600481018390526001600160a01b03881690637bb7bed190602401602060405180830381865afa158015611ffb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201f9190612839565b90506001600160a01b038a16156120a75760405163211dc32d60e01b81526001600160a01b038b81166004830152828116602483015288169063211dc32d90604401602060405180830381865afa15801561207e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a291906127e1565b612118565b6040516338e7023f60e21b8152600481018c90526001600160a01b03828116602483015288169063e39c08fc90604401602060405180830381865afa1580156120f4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061211891906127e1565b945084156121da576040518060600160405280826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015612169573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218d9190612918565b60ff168152602081018790526001600160a01b038316604090910152896121b5846002612856565b815181106121c5576121c56127cb565b6020026020010181905250836121da57600193505b816121e481612810565b925050611fae565b83612244576040805160008082526020820190925290612234565b60408051606081018252600080825260208083018290529282015282526000199092019101816122075790505b509850505050505050505061224d565b50505050505050505b9392505050565b604051806101c00160405280600060ff168152602001600015158152602001600081526020016000815260200160006001600160801b03168152602001600081526020016000815260200160008152602001600081526020016060815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160608152602001600081525090565b6001600160a01b03811681146122f857600080fd5b50565b60006020828403121561230d57600080fd5b813561224d816122e3565b6000806020838503121561232b57600080fd5b823567ffffffffffffffff8082111561234357600080fd5b818501915085601f83011261235757600080fd5b81358181111561236657600080fd5b8660208260051b850101111561237b57600080fd5b60209290920196919550909350505050565b6020808252825182820181905260009190848201906040850190845b818110156123c5578351835292840192918401916001016123a9565b50909695505050505050565b600081518084526020808501945080840160005b8381101561241557815180516001600160a01b0316885283015183880152604090960195908201906001016123e5565b509495945050505050565b60005b8381101561243b578181015183820152602001612423565b83811115610d9f5750506000910152565b60008151808452612464816020860160208601612420565b601f01601f19169290920160200192915050565b805160ff16825260006101c06020830151612497602086018215159052565b50604083015160408501526060830151606085015260808301516124c660808601826001600160801b03169052565b5060a083015160a085015260c083015160c085015260e083015160e0850152610100808401518186015250610120808401518282870152612509838701826123d1565b9250505061014080840151612528828701826001600160a01b03169052565b5050610160838101516001600160a01b0316908501526101808084015185830382870152612556838261244c565b6101a095860151969095019590955250919392505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156125c357603f198886030184526125b1858351612478565b94509285019290850190600101612595565b5092979650505050505050565b600080604083850312156125e357600080fd5b82356125ee816122e3565b915060208301356125fe816122e3565b809150509250929050565b600081518084526020808501945080840160005b83811015612415578151805160ff16885283810151848901526040908101516001600160a01b0316908801526060909601959082019060010161261d565b6020815260006107246020830184612609565b6000806040838503121561268157600080fd5b8235915060208301356125fe816122e3565b6000602082840312156126a557600080fd5b5035919050565b6020815260006107246020830184612478565b6000806000606084860312156126d457600080fd5b505081359360208301359350604090920135919050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156125c357878503603f1901845281515186865261273587870182612609565b9550509285019290850190600101612712565b60008060006060848603121561275d57600080fd5b8335612768816122e3565b92506020840135612778816122e3565b91506040840135612788816122e3565b809150509250925092565b600080604083850312156127a657600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000602082840312156127f357600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600060018201612822576128226127fa565b5060010190565b8051612834816122e3565b919050565b60006020828403121561284b57600080fd5b815161224d816122e3565b60008219821115612869576128696127fa565b500190565b600082821015612880576128806127fa565b500390565b604051610260810167ffffffffffffffff811182821017156128a9576128a96127b5565b60405290565b6000606082840312156128c157600080fd5b6040516060810181811067ffffffffffffffff821117156128e4576128e46127b5565b6040528251600f81900b81146128f957600080fd5b8152602083810151908201526040928301519281019290925250919050565b60006020828403121561292a57600080fd5b815160ff8116811461224d57600080fd5b600082601f83011261294c57600080fd5b815167ffffffffffffffff80821115612967576129676127b5565b604051601f8301601f19908116603f0116810190828211818310171561298f5761298f6127b5565b816040528381528660208588010111156129a857600080fd5b6129b9846020830160208901612420565b9695505050505050565b6000602082840312156129d557600080fd5b815167ffffffffffffffff8111156129ec57600080fd5b6129f88482850161293b565b949350505050565b600060208284031215612a1257600080fd5b8151801515811461224d57600080fd5b80516003811061283457600080fd5b600060208284031215612a4357600080fd5b815167ffffffffffffffff80821115612a5b57600080fd5b908301906102608286031215612a7057600080fd5b612a78612885565b612a8183612829565b815260208301516020820152612a9960408401612a22565b604082015260608301516060820152612ab460808401612829565b608082015260a083015182811115612acb57600080fd5b612ad78782860161293b565b60a08301525060c083015160c082015260e083015160e0820152610100612aff818501612829565b908201526101208381015183811115612b1757600080fd5b612b238882870161293b565b9183019190915250610140838101519082015261016080840151908201526101809150612b51828401612829565b828201526101a0915081830151828201526101c09150612b72828401612829565b828201526101e09150612b86828401612829565b82820152610200915081830151828201526102209150612ba7828401612829565b918101919091526102409182015191810191909152939250505056fea26469706673582212201532badfba40f0677932f00256f174f54a90e79a650bdd8ae5cb6d1e2256d29964736f6c634300080d0033

Block Transaction 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
[ 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.