ETH Price: $1,791.77 (+10.07%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw218331462025-02-12 21:39:3569 days ago1739396375IN
0x28901CF8...01E8FDd87
0 ETH0.000226361.33609057
Withdraw218114442025-02-09 20:48:3572 days ago1739134115IN
0x28901CF8...01E8FDd87
0 ETH0.000278171.52741639
Withdraw218113942025-02-09 20:38:3572 days ago1739133515IN
0x28901CF8...01E8FDd87
0 ETH0.000274341.50636956
Withdraw218113532025-02-09 20:30:2372 days ago1739133023IN
0x28901CF8...01E8FDd87
0 ETH0.001156781.51694495
Withdraw213317012024-12-04 21:03:59139 days ago1733346239IN
0x28901CF8...01E8FDd87
0 ETH0.0383549768.9406132
Withdraw210695552024-10-29 6:38:47176 days ago1730183927IN
0x28901CF8...01E8FDd87
0 ETH0.002585099.82627001
Withdraw209821192024-10-17 1:51:59188 days ago1729129919IN
0x28901CF8...01E8FDd87
0 ETH0.003895569.40098405
Withdraw208669042024-09-30 23:57:11204 days ago1727740631IN
0x28901CF8...01E8FDd87
0 ETH0.002590517.52197492
Withdraw207483532024-09-14 10:48:59220 days ago1726310939IN
0x28901CF8...01E8FDd87
0 ETH0.001714781.56297841
Withdraw201261592024-06-19 13:43:35307 days ago1718804615IN
0x28901CF8...01E8FDd87
0 ETH0.002507613.56026599
Withdraw201261582024-06-19 13:43:23307 days ago1718804603IN
0x28901CF8...01E8FDd87
0 ETH0.0024828912.85843546
Withdraw200945582024-06-15 3:35:47312 days ago1718422547IN
0x28901CF8...01E8FDd87
0 ETH0.001038744.94181843
Withdraw200945312024-06-15 3:29:59312 days ago1718422199IN
0x28901CF8...01E8FDd87
0 ETH0.001257153.81773486
Withdraw199873152024-05-31 4:05:35327 days ago1717128335IN
0x28901CF8...01E8FDd87
0 ETH0.002070147.86889764
Withdraw199619272024-05-27 14:53:11330 days ago1716821591IN
0x28901CF8...01E8FDd87
0 ETH0.0044974323.75535277
Withdraw199591962024-05-27 5:43:35331 days ago1716788615IN
0x28901CF8...01E8FDd87
0 ETH0.002379389.04435167
Withdraw198818932024-05-16 10:18:47341 days ago1715854727IN
0x28901CF8...01E8FDd87
0 ETH0.002970768.48388921
Withdraw198121302024-05-06 16:07:47351 days ago1715011667IN
0x28901CF8...01E8FDd87
0 ETH0.0039397811.37374675
Withdraw196871452024-04-19 4:35:47369 days ago1713501347IN
0x28901CF8...01E8FDd87
0 ETH0.0019234910.40160944
Withdraw196870422024-04-19 4:14:47369 days ago1713500087IN
0x28901CF8...01E8FDd87
0 ETH0.0031132211.4453389
Withdraw196355992024-04-11 23:17:35376 days ago1712877455IN
0x28901CF8...01E8FDd87
0 ETH0.0031002511.78445144
Withdraw196054592024-04-07 18:00:11380 days ago1712512811IN
0x28901CF8...01E8FDd87
0 ETH0.007739322.34254348
Withdraw195049772024-03-24 14:25:11394 days ago1711290311IN
0x28901CF8...01E8FDd87
0 ETH0.0050238523.90093654
Withdraw195015252024-03-24 2:44:11395 days ago1711248251IN
0x28901CF8...01E8FDd87
0 ETH0.0031035416.1
Withdraw195015252024-03-24 2:44:11395 days ago1711248251IN
0x28901CF8...01E8FDd87
0 ETH0.0032246816.7
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
VotingEscrow

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 6 : VotingEscrow.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

/**
@title Voting Escrow
@author Curve Finance
@license MIT
@notice Votes have a weight depending on time, so that users are
        committed to the future of (whatever they are voting for)
@dev Vote weight decays linearly over time. Lock time cannot be
     more than `MAXTIME` (1 year).

# Voting escrow to have time-weighted votes
# Votes have a weight depending on time, so that users are committed
# to the future of (whatever they are voting for).
# The weight in this implementation is linear, and lock cannot be more than maxtime:
# w ^
# 1 +        /
#   |      /
#   |    /
#   |  /
#   |/
# 0 +--------+------> time
#       maxtime (1 year?)
*/

import {ReentrancyGuard} from "../lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol";
import {SafeERC20, IERC20} from "../lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";

/// @notice This interface defines the functions required for the underlying token.
interface IPermissionedMintableERC20 {
    /// @notice Checks the permission status of an address as a Minter.
    /// @param account The address for which the Minter permission status is being checked.
    /// @return A boolean value indicating whether the address is a Minter.
    function minters(address account) external view returns (bool);

    /// @notice Mints new tokens and assigns them to the specified address.
    /// @param to The address to which the newly minted tokens will be assigned.
    /// @param amount The amount of tokens to mint and assign to the `to` address.
    function mint(address to, uint256 amount) external;
}

struct Point {
    int128 bias;
    int128 slope; // # -dweight / dt
    uint ts;
    uint blk; // block
}
/* We cannot really do block numbers per se b/c slope is per time, not per block
 * and per block could be fairly bad b/c Ethereum changes blocktimes.
 * What we can do is to extrapolate ***At functions */

struct LockedBalance {
    int128 amount;
    uint end;
}

contract VotingEscrow is ReentrancyGuard {
    using SafeERC20 for IERC20;

    enum DepositType {
        DEPOSIT_FOR_TYPE,
        CREATE_LOCK_TYPE,
        INCREASE_LOCK_AMOUNT,
        INCREASE_UNLOCK_TIME
    }

    event Deposit(
        address indexed provider,
        uint value,
        uint indexed locktime,
        DepositType deposit_type,
        uint ts
    );
    event Withdraw(address indexed provider, uint value, uint ts);
    event Supply(uint prevSupply, uint supply);

    uint internal constant WEEK = 1 weeks;
    uint public constant MAXTIME = 365 * 86400;
    int128 internal constant iMAXTIME = 365 * 86400;
    uint internal constant MULTIPLIER = 1 ether;

    uint public constant MINTIME = 2 weeks;
    address public immutable token;
    uint public supply;

    mapping(address => LockedBalance) public locked;

    uint public epoch;
    mapping(uint => Point) public point_history; // epoch -> unsigned point
    mapping(address => Point[1000000000]) public user_point_history; // user -> Point[user_epoch]
    mapping(address => uint) public user_point_epoch;
    mapping(uint => int128) public slope_changes; // time -> signed slope change

    string public constant name = "Vote-escrowed OX";
    string public constant symbol = "veOX";
    uint8 public constant decimals = 18;

    /// @notice This modifier restricts access to minter-specific functions to
    ///         addresses that have been granted Minter permission in the underlying
    //          token contract.
    /// @dev It verifies that the `msg.sender` has the Minter permission before
    ///      allowing access to the function.
    modifier onlyMinters() {
        require(
            IPermissionedMintableERC20(token).minters(msg.sender),
            "Sender is not a minter"
        );
        _;
    }

    /// @notice Contract constructor
    /// @param token_addr `ERC20CRV` token address
    constructor(address token_addr) {
        token = token_addr;
        point_history[0].blk = block.number;
        point_history[0].ts = block.timestamp;
    }

    /// @notice Get the most recently recorded rate of voting power decrease for `_addr`
    /// @param addr Address of the user wallet
    /// @return Value of the slope
    function get_last_user_slope(address addr) external view returns (int128) {
        uint uepoch = user_point_epoch[addr];
        return user_point_history[addr][uepoch].slope;
    }

    /// @notice Get the timestamp for checkpoint `_idx` for `_addr`
    /// @param _addr User wallet address
    /// @param _idx User epoch number
    /// @return Epoch time of the checkpoint
    function user_point_history__ts(
        address _addr,
        uint _idx
    ) external view returns (uint) {
        return user_point_history[_addr][_idx].ts;
    }

    /// @notice Get timestamp when `_addr`'s lock finishes
    /// @param _addr User wallet address
    /// @return Epoch time of the lock end
    function locked__end(address _addr) external view returns (uint) {
        return locked[_addr].end;
    }

    /// @notice Record global and per-user data to checkpoint
    /// @param _addr User's wallet address. No user checkpoint if 0x0
    /// @param old_locked Pevious locked amount / end lock time for the user
    /// @param new_locked New locked amount / end lock time for the user
    function _checkpoint(
        address _addr,
        LockedBalance memory old_locked,
        LockedBalance memory new_locked
    ) internal {
        Point memory u_old;
        Point memory u_new;
        int128 old_dslope = 0;
        int128 new_dslope = 0;
        uint _epoch = epoch;

        if (_addr != address(0x0)) {
            // Calculate slopes and biases
            // Kept at zero when they have to
            if (old_locked.end > block.timestamp && old_locked.amount > 0) {
                u_old.slope = old_locked.amount / iMAXTIME;
                u_old.bias =
                    u_old.slope *
                    int128(int(old_locked.end - block.timestamp));
            }
            if (new_locked.end > block.timestamp && new_locked.amount > 0) {
                u_new.slope = new_locked.amount / iMAXTIME;
                u_new.bias =
                    u_new.slope *
                    int128(int(new_locked.end - block.timestamp));
            }

            // Read values of scheduled changes in the slope
            // old_locked.end can be in the past and in the future
            // new_locked.end can ONLY by in the FUTURE unless everything expired: than zeros
            old_dslope = slope_changes[old_locked.end];
            if (new_locked.end != 0) {
                if (new_locked.end == old_locked.end) {
                    new_dslope = old_dslope;
                } else {
                    new_dslope = slope_changes[new_locked.end];
                }
            }
        }

        Point memory last_point = Point({
            bias: 0,
            slope: 0,
            ts: block.timestamp,
            blk: block.number
        });
        if (_epoch > 0) {
            last_point = point_history[_epoch];
        }
        uint last_checkpoint = last_point.ts;
        // initial_last_point is used for extrapolation to calculate block number
        // (approximately, for *At methods) and save them
        // as we cannot figure that out exactly from inside the contract

        uint initial_last_point_ts = last_point.ts;
        uint initial_last_point_blk = last_point.blk;

        uint block_slope = 0; // dblock/dt
        if (block.timestamp > last_point.ts) {
            block_slope =
                (MULTIPLIER * (block.number - last_point.blk)) /
                (block.timestamp - last_point.ts);
        }
        // If last point is already recorded in this block, slope=0
        // But that's ok b/c we know the block in such case

        // Go over weeks to fill history and calculate what the current point is
        uint t_i = (last_checkpoint / WEEK) * WEEK;
        for (uint i = 0; i < 255; ++i) {
            // Hopefully it won't happen that this won't get used in 5 years!
            // If it does, users will be able to withdraw but vote weight will be broken
            t_i += WEEK;
            int128 d_slope = 0;
            if (t_i > block.timestamp) {
                t_i = block.timestamp;
            } else {
                d_slope = slope_changes[t_i];
            }
            last_point.bias -=
                last_point.slope *
                int128(int(t_i - last_checkpoint));
            last_point.slope += d_slope;
            if (last_point.bias < 0) {
                // This can happen
                last_point.bias = 0;
            }
            if (last_point.slope < 0) {
                // This cannot happen - just in case
                last_point.slope = 0;
            }
            last_checkpoint = t_i;
            last_point.ts = t_i;
            last_point.blk =
                initial_last_point_blk +
                (block_slope * (t_i - initial_last_point_ts)) /
                MULTIPLIER;

            _epoch += 1;
            if (t_i == block.timestamp) {
                last_point.blk = block.number;
                break;
            } else {
                point_history[_epoch] = last_point;
            }
        }

        epoch = _epoch;
        // Now point_history is filled until t=now

        if (_addr != address(0x0)) {
            // If last point was in this block, the slope change has been applied already
            // But in such case we have 0 slope(s)
            last_point.slope += (u_new.slope - u_old.slope);
            last_point.bias += (u_new.bias - u_old.bias);
            if (last_point.slope < 0) {
                last_point.slope = 0;
            }
            if (last_point.bias < 0) {
                last_point.bias = 0;
            }
        }

        // Record the changed point into history
        point_history[_epoch] = last_point;

        if (_addr != address(0x0)) {
            // Schedule the slope changes (slope is going down)
            // We subtract new_user_slope from [new_locked.end]
            // and add old_user_slope to [old_locked.end]
            if (old_locked.end > block.timestamp) {
                // old_dslope was <something> - u_old.slope, so we cancel that
                old_dslope += u_old.slope;
                if (new_locked.end == old_locked.end) {
                    old_dslope -= u_new.slope; // It was a new deposit, not extension
                }
                slope_changes[old_locked.end] = old_dslope;
            }

            if (new_locked.end > block.timestamp) {
                if (new_locked.end > old_locked.end) {
                    new_dslope -= u_new.slope; // old slope disappeared at this point
                    slope_changes[new_locked.end] = new_dslope;
                }
                // else: we recorded it already in old_dslope
            }
            // Now handle user history
            address addr = _addr;
            uint user_epoch = user_point_epoch[addr] + 1;

            user_point_epoch[addr] = user_epoch;
            u_new.ts = block.timestamp;
            u_new.blk = block.number;
            user_point_history[addr][user_epoch] = u_new;
        }
    }

    /// @notice Deposit and lock tokens for a user
    /// @param _addr User's wallet address
    /// @param _value Amount to deposit
    /// @param unlock_time New time when to unlock the tokens, or 0 if unchanged
    /// @param locked_balance Previous locked amount / timestamp
    /// @param deposit_type The type of deposit
    function _deposit_for(
        address _addr,
        uint _value,
        uint unlock_time,
        LockedBalance memory locked_balance,
        DepositType deposit_type
    ) internal {
        LockedBalance memory _locked = locked_balance;
        uint supply_before = supply;

        supply = supply_before + _value;
        LockedBalance memory old_locked;
        (old_locked.amount, old_locked.end) = (_locked.amount, _locked.end);
        // Adding to existing lock, or if a lock is expired - creating a new one
        _locked.amount += int128(int(_value));
        if (unlock_time != 0) {
            _locked.end = unlock_time;
        }
        locked[_addr] = _locked;

        // Possibilities:
        // Both old_locked.end could be current or expired (>/< block.timestamp)
        // value == 0 (extend lock) or value > 0 (add to lock or extend lock)
        // _locked.end > block.timestamp (always)
        _checkpoint(_addr, old_locked, _locked);

        if (_value != 0) {
            IERC20(token).safeTransferFrom(_addr, address(this), _value);
        }

        emit Deposit(_addr, _value, _locked.end, deposit_type, block.timestamp);
        emit Supply(supply_before, supply_before + _value);
    }

    /// @notice Mint new tokens, then deposit and lock for a user
    /// @dev This contract must be a minter in the underlying token contract
    /// @param _addr User's wallet address
    /// @param _value Amount to deposit
    /// @param unlock_time New time when to unlock the tokens, or 0 if unchanged
    /// @param locked_balance Previous locked amount / timestamp
    /// @param deposit_type The type of deposit
    function _deposit_for_as_minter(
        address _addr,
        uint _value,
        uint unlock_time,
        LockedBalance memory locked_balance,
        DepositType deposit_type
    ) internal {
        LockedBalance memory _locked = locked_balance;
        uint supply_before = supply;

        supply = supply_before + _value;
        LockedBalance memory old_locked;
        (old_locked.amount, old_locked.end) = (_locked.amount, _locked.end);
        // Adding to existing lock, or if a lock is expired - creating a new one
        _locked.amount += int128(int(_value));
        if (unlock_time != 0) {
            _locked.end = unlock_time;
        }
        locked[_addr] = _locked;

        // Possibilities:
        // Both old_locked.end could be current or expired (>/< block.timestamp)
        // value == 0 (extend lock) or value > 0 (add to lock or extend lock)
        // _locked.end > block.timestamp (always)
        _checkpoint(_addr, old_locked, _locked);

        if (_value != 0) {
            IPermissionedMintableERC20(token).mint(address(this), _value);
        }

        emit Deposit(_addr, _value, _locked.end, deposit_type, block.timestamp);
        emit Supply(supply_before, supply_before + _value);
    }

    /// @notice Record global data to checkpoint
    function checkpoint() external {
        _checkpoint(address(0x0), LockedBalance(0, 0), LockedBalance(0, 0));
    }

    /// @notice Deposit `_value` tokens for `_addr` and add to the lock
    /// @dev Anyone (even a smart contract) can deposit for someone else, but
    ///      cannot extend their locktime and deposit for a brand new user
    /// @param _addr User's wallet address
    /// @param _value Amount to add to user's lock
    function deposit_for(address _addr, uint _value) external nonReentrant {
        LockedBalance memory _locked = locked[_addr];

        require(_value > 0); // dev: need non-zero value
        require(_locked.amount > 0, "No existing lock found");
        require(
            _locked.end > block.timestamp,
            "Cannot add to expired lock. Withdraw"
        );
        _deposit_for(_addr, _value, 0, _locked, DepositType.DEPOSIT_FOR_TYPE);
    }

    /// @notice Deposit `_value` tokens for `msg.sender` and lock until `_unlock_time`
    /// @param _value Amount to deposit
    /// @param _unlock_time Epoch time when tokens unlock, rounded down to whole weeks
    function _create_lock(uint _value, uint _unlock_time) internal {
        require(_value > 0); // dev: need non-zero value

        LockedBalance memory _locked = locked[msg.sender];
        require(_locked.amount == 0, "Withdraw old tokens first");

        uint unlock_time = (_unlock_time / WEEK) * WEEK; // Locktime is rounded down to weeks
        require(
            unlock_time >= block.timestamp + MINTIME,
            "Voting lock must be at least 2 weeks"
        );
        require(
            unlock_time <= block.timestamp + MAXTIME,
            "Voting lock can be 1 year max"
        );

        _deposit_for(
            msg.sender,
            _value,
            unlock_time,
            _locked,
            DepositType.CREATE_LOCK_TYPE
        );
    }

    /// @notice External function for _create_lock
    /// @param _value Amount to deposit
    /// @param _unlock_time Epoch time when tokens unlock, rounded down to whole weeks
    function create_lock(uint _value, uint _unlock_time) external nonReentrant {
        _create_lock(_value, _unlock_time);
    }

    /// @notice Mint `_value` tokens, deposit for `_addr` and lock until `_unlock_time`
    /// @param _addr User's wallet address
    /// @param _value Amount to deposit
    /// @param _unlock_time Epoch time when tokens unlock, rounded down to whole weeks
    function _create_lock_as_minter(
        address _addr,
        uint _value,
        uint _unlock_time
    ) internal {
        require(_value > 0); // dev: need non-zero value

        LockedBalance memory _locked = locked[_addr];
        require(_locked.amount == 0, "Withdraw old tokens first");

        uint unlock_time = (_unlock_time / WEEK) * WEEK; // Locktime is rounded down to weeks
        require(
            unlock_time >= block.timestamp + MINTIME,
            "Voting lock must be at least 2 weeks"
        );
        require(
            unlock_time <= block.timestamp + MAXTIME,
            "Voting lock can be 1 year max"
        );

        _deposit_for_as_minter(
            _addr,
            _value,
            unlock_time,
            _locked,
            DepositType.CREATE_LOCK_TYPE
        );
    }

    /// @notice External function for _create_lock_as_minter
    /// @dev This contract must be a minter in the underlying token contract
    /// @param _addr User's wallet address
    /// @param _value Amount to deposit
    /// @param _unlock_time Epoch time when tokens unlock, rounded down to whole weeks
    function create_lock_as_minter(
        address _addr,
        uint _value,
        uint _unlock_time
    ) external nonReentrant onlyMinters {
        _create_lock_as_minter(_addr, _value, _unlock_time);
    }

    /// @notice Deposit `_value` additional tokens for `msg.sender` without modifying the unlock time
    /// @param _value Amount of tokens to deposit and add to the lock
    function increase_amount(uint _value) external nonReentrant {
        _increase_amount(_value);
    }

    function _increase_amount(uint _value) internal {
        LockedBalance memory _locked = locked[msg.sender];

        require(_value > 0); // dev: need non-zero value
        require(_locked.amount > 0, "No existing lock found");
        require(
            _locked.end > block.timestamp,
            "Cannot add to expired lock. Withdraw"
        );

        _deposit_for(
            msg.sender,
            _value,
            0,
            _locked,
            DepositType.INCREASE_LOCK_AMOUNT
        );
    }

    /// @notice Extend the unlock time for `msg.sender` to `_unlock_time`
    /// @param _unlock_time New epoch time for unlocking
    function increase_unlock_time(uint _unlock_time) external nonReentrant {
        _increase_unlock_time(_unlock_time);
    }

    function _increase_unlock_time(uint _unlock_time) internal {
        LockedBalance memory _locked = locked[msg.sender];
        uint unlock_time = (_unlock_time / WEEK) * WEEK; // Locktime is rounded down to weeks

        require(_locked.end > block.timestamp, "Lock expired");
        require(_locked.amount > 0, "Nothing is locked");
        require(unlock_time > _locked.end, "Can only increase lock duration");
        require(
            unlock_time <= block.timestamp + MAXTIME,
            "Voting lock can be 1 year max"
        );

        _deposit_for(
            msg.sender,
            0,
            unlock_time,
            _locked,
            DepositType.INCREASE_UNLOCK_TIME
        );
    }

    /// @notice Withdraw all tokens for `msg.sender`
    /// @dev Only possible if the lock has expired
    function _withdraw() internal {
        LockedBalance memory _locked = locked[msg.sender];
        uint value = uint(int(_locked.amount));

        locked[msg.sender] = LockedBalance(0, 0);
        uint supply_before = supply;
        supply = supply_before - value;

        // old_locked can have either expired <= timestamp or zero end
        // _locked has only 0 end
        // Both can have >= 0 amount
        _checkpoint(msg.sender, _locked, LockedBalance(0, 0));

        IERC20(token).safeTransfer(msg.sender, value);

        emit Withdraw(msg.sender, value, block.timestamp);
        emit Supply(supply_before, supply_before - value);
    }

    function withdraw() external nonReentrant {
        _withdraw();
    }

    // The following ERC20/minime-compatible methods are not real balanceOf and supply!
    // They measure the weights for the purpose of voting, so they don't represent
    // real coins.

    /// @notice Binary search to estimate timestamp for block number
    /// @param _block Block to find
    /// @param max_epoch Don't go beyond this epoch
    /// @return Approximate timestamp for block
    function _find_block_epoch(
        uint _block,
        uint max_epoch
    ) internal view returns (uint) {
        // Binary search
        uint _min = 0;
        uint _max = max_epoch;
        for (uint i = 0; i < 128; ++i) {
            // Will be always enough for 128-bit numbers
            if (_min >= _max) {
                break;
            }
            uint _mid = (_min + _max + 1) / 2;
            if (point_history[_mid].blk <= _block) {
                _min = _mid;
            } else {
                _max = _mid - 1;
            }
        }
        return _min;
    }

    /// @notice Get the current voting power for `msg.sender`
    /// @dev Adheres to the ERC20 `balanceOf` interface for Aragon compatibility
    /// @param addr User wallet address
    /// @param _t Epoch time to return voting power at
    /// @return User voting power
    function _balanceOf(address addr, uint _t) internal view returns (uint) {
        uint _epoch = user_point_epoch[addr];
        if (_epoch == 0) {
            return 0;
        } else {
            Point memory last_point = user_point_history[addr][_epoch];
            last_point.bias -=
                last_point.slope *
                int128(int(_t) - int(last_point.ts));
            if (last_point.bias < 0) {
                last_point.bias = 0;
            }
            return uint(int(last_point.bias));
        }
    }

    function balanceOfAtT(address addr, uint _t) external view returns (uint) {
        return _balanceOf(addr, _t);
    }

    function balanceOf(address addr) external view returns (uint) {
        return _balanceOf(addr, block.timestamp);
    }

    /// @notice Measure voting power of `addr` at block height `_block`
    /// @dev Adheres to MiniMe `balanceOfAt` interface: https://github.com/Giveth/minime
    /// @param addr User's wallet address
    /// @param _block Block to calculate the voting power at
    /// @return Voting power
    function balanceOfAt(
        address addr,
        uint _block
    ) external view returns (uint) {
        // Copying and pasting totalSupply code because Vyper cannot pass by
        // reference yet
        require(_block <= block.number);

        // Binary search
        uint _min = 0;
        uint _max = user_point_epoch[addr];
        for (uint i = 0; i < 128; ++i) {
            // Will be always enough for 128-bit numbers
            if (_min >= _max) {
                break;
            }
            uint _mid = (_min + _max + 1) / 2;
            if (user_point_history[addr][_mid].blk <= _block) {
                _min = _mid;
            } else {
                _max = _mid - 1;
            }
        }

        Point memory upoint = user_point_history[addr][_min];

        uint max_epoch = epoch;
        uint _epoch = _find_block_epoch(_block, max_epoch);
        Point memory point_0 = point_history[_epoch];
        uint d_block = 0;
        uint d_t = 0;
        if (_epoch < max_epoch) {
            Point memory point_1 = point_history[_epoch + 1];
            d_block = point_1.blk - point_0.blk;
            d_t = point_1.ts - point_0.ts;
        } else {
            d_block = block.number - point_0.blk;
            d_t = block.timestamp - point_0.ts;
        }
        uint block_time = point_0.ts;
        if (d_block != 0) {
            block_time += (d_t * (_block - point_0.blk)) / d_block;
        }

        upoint.bias -= upoint.slope * int128(int(block_time - upoint.ts));
        if (upoint.bias >= 0) {
            return uint(uint128(upoint.bias));
        } else {
            return 0;
        }
    }

    /// @notice Calculate total voting power at some point in the past
    /// @param point The point (bias/slope) to start search from
    /// @param t Time to calculate the total voting power at
    /// @return Total voting power at that time
    function _supply_at(
        Point memory point,
        uint t
    ) internal view returns (uint) {
        Point memory last_point = point;
        uint t_i = (last_point.ts / WEEK) * WEEK;
        for (uint i = 0; i < 255; ++i) {
            t_i += WEEK;
            int128 d_slope = 0;
            if (t_i > t) {
                t_i = t;
            } else {
                d_slope = slope_changes[t_i];
            }
            last_point.bias -=
                last_point.slope *
                int128(int(t_i - last_point.ts));
            if (t_i == t) {
                break;
            }
            last_point.slope += d_slope;
            last_point.ts = t_i;
        }

        if (last_point.bias < 0) {
            last_point.bias = 0;
        }
        return uint(uint128(last_point.bias));
    }

    /// @notice Calculate total voting power
    /// @dev Adheres to the ERC20 `totalSupply` interface for Aragon compatibility
    /// @return Total voting power
    function _totalSupply(uint t) internal view returns (uint) {
        uint _epoch = epoch;
        Point memory last_point = point_history[_epoch];
        return _supply_at(last_point, t);
    }

    function totalSupplyAtT(uint t) external view returns (uint) {
        return _totalSupply(t);
    }

    function totalSupply() external view returns (uint) {
        return _totalSupply(block.timestamp);
    }

    /// @notice Calculate total voting power at some point in the past
    /// @param _block Block to calculate the total voting power at
    /// @return Total voting power at `_block`
    function totalSupplyAt(uint _block) external view returns (uint) {
        require(_block <= block.number);
        uint _epoch = epoch;
        uint target_epoch = _find_block_epoch(_block, _epoch);

        Point memory point = point_history[target_epoch];
        uint dt = 0;
        if (target_epoch < _epoch) {
            Point memory point_next = point_history[target_epoch + 1];
            if (point.blk != point_next.blk) {
                dt =
                    ((_block - point.blk) * (point_next.ts - point.ts)) /
                    (point_next.blk - point.blk);
            }
        } else {
            if (point.blk != block.number) {
                dt =
                    ((_block - point.blk) * (block.timestamp - point.ts)) /
                    (block.number - point.blk);
            }
        }
        // Now dt contains info on how far are we beyond point
        return _supply_at(point, point.ts + dt);
    }
}

File 2 of 6 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

File 3 of 6 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

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

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to
     * 0 before setting it to a non-zero value.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

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

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

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

File 4 of 6 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

File 5 of 6 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 6 of 6 : Address.sol
// 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 Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * 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);
        }
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"token_addr","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"provider","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"locktime","type":"uint256"},{"indexed":false,"internalType":"enum VotingEscrow.DepositType","name":"deposit_type","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"ts","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"prevSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"supply","type":"uint256"}],"name":"Supply","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"provider","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ts","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"MAXTIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"_block","type":"uint256"}],"name":"balanceOfAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"_t","type":"uint256"}],"name":"balanceOfAtT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"checkpoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"uint256","name":"_unlock_time","type":"uint256"}],"name":"create_lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"uint256","name":"_unlock_time","type":"uint256"}],"name":"create_lock_as_minter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"deposit_for","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"epoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"get_last_user_slope","outputs":[{"internalType":"int128","name":"","type":"int128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"increase_amount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_unlock_time","type":"uint256"}],"name":"increase_unlock_time","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"locked","outputs":[{"internalType":"int128","name":"amount","type":"int128"},{"internalType":"uint256","name":"end","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"locked__end","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"point_history","outputs":[{"internalType":"int128","name":"bias","type":"int128"},{"internalType":"int128","name":"slope","type":"int128"},{"internalType":"uint256","name":"ts","type":"uint256"},{"internalType":"uint256","name":"blk","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"slope_changes","outputs":[{"internalType":"int128","name":"","type":"int128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"supply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_block","type":"uint256"}],"name":"totalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"t","type":"uint256"}],"name":"totalSupplyAtT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"user_point_epoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"user_point_history","outputs":[{"internalType":"int128","name":"bias","type":"int128"},{"internalType":"int128","name":"slope","type":"int128"},{"internalType":"uint256","name":"ts","type":"uint256"},{"internalType":"uint256","name":"blk","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"},{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"user_point_history__ts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a06040523480156200001157600080fd5b50604051620026cc380380620026cc83398101604081905262000034916200009c565b600160009081556001600160a01b0390911660805280526004602052437f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ee55427f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ed55620000ce565b600060208284031215620000af57600080fd5b81516001600160a01b0381168114620000c757600080fd5b9392505050565b6080516125c662000106600039600081816104cd0152818161052401528181610f9d015281816111020152611e7a01526125c66000f3fe608060405234801561001057600080fd5b50600436106101cf5760003560e01c80637116c60c11610104578063c2c4c5c1116100a2578063da020a1811610071578063da020a1814610497578063ee00ef3a146104aa578063eff7a612146104b5578063fc0c546a146104c857600080fd5b8063c2c4c5c1146103f6578063cbf9fe5f146103fe578063d07b705f14610446578063d1febfb91461045957600080fd5b8063900cf0cf116100de578063900cf0cf1461038b57806395d89b4114610394578063981b24d0146103b7578063adc63589146103ca57600080fd5b80637116c60c1461032f57806371197484146103425780637c74a1741461037857600080fd5b80633a46273e116101715780634ee2cd7e1161014b5780634ee2cd7e146102ec5780635b51c308146102ff57806365fc38731461030957806370a082311461031c57600080fd5b80633a46273e146102be5780633ccfd60b146102d15780634957677c146102d957600080fd5b80630a4345a8116101ad5780630a4345a81461024c57806318160ddd1461026157806328d09d4714610269578063313ce567146102a457600080fd5b8063010ae757146101d4578063047fc9aa1461020757806306fdde0314610210575b600080fd5b6101f46101e23660046121cf565b60066020526000908152604090205481565b6040519081526020015b60405180910390f35b6101f460015481565b61023f6040518060400160405280601081526020016f0acdee8ca5acae6c6e4deeecac8409eb60831b81525081565b6040516101fe919061220e565b61025f61025a366004612241565b610507565b005b6101f46105fb565b61027c610277366004612274565b61060b565b60408051600f95860b81529390940b60208401529282015260608101919091526080016101fe565b6102ac601281565b60405160ff90911681526020016101fe565b61025f6102cc366004612274565b610652565b61025f610728565b61025f6102e736600461229e565b610744565b6101f46102fa366004612274565b610762565b6101f46212750081565b61025f6103173660046122b7565b610a53565b6101f461032a3660046121cf565b610a6f565b6101f461033d36600461229e565b610a7b565b61036561035036600461229e565b600760205260009081526040902054600f0b81565b604051600f9190910b81526020016101fe565b6103656103863660046121cf565b610a86565b6101f460035481565b61023f604051806040016040528060048152602001630ecca9eb60e31b81525081565b6101f46103c536600461229e565b610ad3565b6101f46103d83660046121cf565b6001600160a01b031660009081526002602052604090206001015490565b61025f610c72565b61042c61040c3660046121cf565b60026020526000908152604090208054600190910154600f9190910b9082565b60408051600f9390930b83526020830191909152016101fe565b6101f4610454366004612274565b610cb0565b61027c61046736600461229e565b600460205260009081526040902080546001820154600290920154600f82810b93600160801b909304900b919084565b6101f46104a5366004612274565b610cc3565b6101f46301e1338081565b61025f6104c336600461229e565b610cff565b6104ef7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101fe565b61050f610d10565b604051633d1bb33160e21b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063f46eccc490602401602060405180830381865afa158015610573573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059791906122d9565b6105e15760405162461bcd60e51b815260206004820152601660248201527529b2b73232b91034b9903737ba10309036b4b73a32b960511b60448201526064015b60405180910390fd5b6105ec838383610d69565b6105f66001600055565b505050565b600061060642610e82565b905090565b600560205281600052604060002081633b9aca00811061062a57600080fd5b6003020180546001820154600290920154600f82810b9550600160801b90920490910b925084565b61065a610d10565b6001600160a01b03821660009081526002602090815260409182902082518084019093528054600f0b835260010154908201528161069757600080fd5b60008160000151600f0b136106e75760405162461bcd60e51b8152602060048201526016602482015275139bc8195e1a5cdd1a5b99c81b1bd8dac8199bdd5b9960521b60448201526064016105d8565b4281602001511161070a5760405162461bcd60e51b81526004016105d8906122fb565b61071983836000846000610ee2565b506107246001600055565b5050565b610730610d10565b61073861105d565b6107426001600055565b565b61074c610d10565b610755816111ac565b61075f6001600055565b50565b60004382111561077157600080fd5b6001600160a01b038316600090815260066020526040812054815b6080811015610825578183101561082557600060026107ab8486612355565b6107b6906001612355565b6107c0919061237e565b6001600160a01b0388166000908152600560205260409020909150869082633b9aca0081106107f1576107f1612392565b60030201600201541161080657809350610814565b6108116001826123a8565b92505b5061081e816123bb565b905061078c565b506001600160a01b038516600090815260056020526040812083633b9aca00811061085257610852612392565b604080516080810182526003928302939093018054600f81810b8652600160801b909104900b60208501526001810154918401919091526002015460608301525490915060006108a28783611262565b600081815260046020908152604080832081516080810183528154600f81810b8352600160801b909104900b938101939093526001810154918301919091526002015460608201529192508084841015610981576000600481610906876001612355565b8152602080820192909252604090810160002081516080810183528154600f81810b8352600160801b909104900b9381019390935260018101549183019190915260020154606080830182905286015191925061096391906123a8565b92508360400151816040015161097991906123a8565b9150506109a5565b606083015161099090436123a8565b91508260400151426109a291906123a8565b90505b604083015182156109e2578284606001518c6109c191906123a8565b6109cb90846123d4565b6109d5919061237e565b6109df9082612355565b90505b60408701516109f190826123a8565b8760200151610a0091906123eb565b87518890610a0f90839061240b565b600f90810b90915288516000910b129050610a3f57505093516001600160801b03169650610a4d95505050505050565b600099505050505050505050505b92915050565b610a5b610d10565b610a6582826112e8565b6107246001600055565b6000610a4d82426113f7565b6000610a4d82610e82565b6001600160a01b0381166000908152600660209081526040808320546005909252822081633b9aca008110610abd57610abd612392565b6003020154600160801b9004600f0b9392505050565b600043821115610ae257600080fd5b6003546000610af18483611262565b600081815260046020908152604080832081516080810183528154600f81810b8352600160801b909104900b9381019390935260018101549183019190915260020154606082015291925083831015610c00576000600481610b54866001612355565b8152602080820192909252604090810160002081516080810183528154600f81810b8352600160801b909104900b9381019390935260018101549183019190915260020154606080830182905285015191925014610bfa5782606001518160600151610bc091906123a8565b83604001518260400151610bd491906123a8565b6060850151610be3908a6123a8565b610bed91906123d4565b610bf7919061237e565b91505b50610c4f565b43826060015114610c4f576060820151610c1a90436123a8565b6040830151610c2990426123a8565b6060840151610c3890896123a8565b610c4291906123d4565b610c4c919061237e565b90505b610c6882828460400151610c639190612355565b6114e6565b9695505050505050565b610742600060405180604001604052806000600f0b8152602001600081525060405180604001604052806000600f0b815260200160008152506115e7565b6000610cbc83836113f7565b9392505050565b6001600160a01b038216600090815260056020526040812082633b9aca008110610cef57610cef612392565b6003020160010154905092915050565b610d07610d10565b61075581611c4d565b600260005403610d625760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d8565b6002600055565b60008211610d7657600080fd5b6001600160a01b03831660009081526002602090815260409182902082518084019093528054600f0b8084526001909101549183019190915215610df85760405162461bcd60e51b815260206004820152601960248201527815da5d1a191c985dc81bdb19081d1bdad95b9cc8199a5c9cdd603a1b60448201526064016105d8565b600062093a80610e08818561237e565b610e1291906123d4565b9050610e216212750042612355565b811015610e405760405162461bcd60e51b81526004016105d890612438565b610e4e6301e1338042612355565b811115610e6d5760405162461bcd60e51b81526004016105d89061247c565b610e7b858583856001611db0565b5050505050565b600354600081815260046020908152604080832081516080810183528154600f81810b8352600160801b909104900b93810193909352600181015491830191909152600201546060820152909190610eda81856114e6565b949350505050565b6001548290610ef18682612355565b6001556040805180820190915260008082526020820152825160208085015190830152600f0b8152825187908490610f2a9083906124b3565b600f0b9052508515610f3e57602083018690525b6001600160a01b0388166000908152600260209081526040909120845181546001600160801b0319166001600160801b0390911617815590840151600190910155610f8a8882856115e7565b8615610fc557610fc56001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001689308a611f20565b8260200151886001600160a01b03167fbe9cf0e939c614fad640a623a53ba0a807c8cb503c4c4c8dacabe27b86ff2dd5898742604051611007939291906124e0565b60405180910390a37f5e2aa66efd74cce82b21852e317e5490d9ecc9e6bb953ae24d90851258cc2f5c8261103b8982612355565b6040805192835260208301919091520160405180910390a15050505050505050565b336000818152600260208181526040808420815180830183528154600f81900b808352600180850180548589015286518088019097528987528688018a81529a9099529690955292516001600160801b03166001600160801b03199093169290921790559351909255546110d182826123a8565b60015560408051808201909152600080825260208201526110f590339085906115e7565b6111296001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163384611f8b565b6040805183815242602082015233917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568910160405180910390a27f5e2aa66efd74cce82b21852e317e5490d9ecc9e6bb953ae24d90851258cc2f5c8161118f84826123a8565b6040805192835260208301919091520160405180910390a1505050565b3360009081526002602090815260409182902082518084019093528054600f0b83526001015490820152816111e057600080fd5b60008160000151600f0b136112305760405162461bcd60e51b8152602060048201526016602482015275139bc8195e1a5cdd1a5b99c81b1bd8dac8199bdd5b9960521b60448201526064016105d8565b428160200151116112535760405162461bcd60e51b81526004016105d8906122fb565b61072433836000846002610ee2565b60008082815b60808110156112de57818310156112de57600060026112878486612355565b611292906001612355565b61129c919061237e565b60008181526004602052604090206002015490915087106112bf578093506112cd565b6112ca6001826123a8565b92505b506112d7816123bb565b9050611268565b5090949350505050565b600082116112f557600080fd5b3360009081526002602090815260409182902082518084019093528054600f0b808452600190910154918301919091521561136e5760405162461bcd60e51b815260206004820152601960248201527815da5d1a191c985dc81bdb19081d1bdad95b9cc8199a5c9cdd603a1b60448201526064016105d8565b600062093a8061137e818561237e565b61138891906123d4565b90506113976212750042612355565b8110156113b65760405162461bcd60e51b81526004016105d890612438565b6113c46301e1338042612355565b8111156113e35760405162461bcd60e51b81526004016105d89061247c565b6113f1338583856001610ee2565b50505050565b6001600160a01b038216600090815260066020526040812054808203611421576000915050610a4d565b6001600160a01b038416600090815260056020526040812082633b9aca00811061144d5761144d612392565b60408051608081018252600392909202929092018054600f81810b8452600160801b909104900b6020830152600181015492820183905260020154606082015291506114999085612516565b81602001516114a891906123eb565b815182906114b790839061240b565b600f90810b90915282516000910b121590506114d257600081525b51600f0b9150610a4d9050565b5092915050565b600080839050600062093a80808360400151611502919061237e565b61150c91906123d4565b905060005b60ff8110156115bf5761152762093a8083612355565b915060008583111561153b5785925061154f565b50600082815260076020526040902054600f0b5b604084015161155e90846123a8565b846020015161156d91906123eb565b8451859061157c90839061240b565b600f0b90525085830361158f57506115bf565b80846020018181516115a191906124b3565b600f0b90525050604083018290526115b8816123bb565b9050611511565b5060008260000151600f0b12156115d557600082525b50516001600160801b03169392505050565b60408051608081018252600080825260208201819052918101829052606081019190915260408051608081018252600080825260208201819052918101829052606081019190915260035460009081906001600160a01b0388161561175b57428760200151118015611660575060008760000151600f0b135b156116a5578651611676906301e1338090612536565b600f0b6020808701919091528701516116909042906123a8565b856020015161169f91906123eb565b600f0b85525b4286602001511180156116bf575060008660000151600f0b135b156117045785516116d5906301e1338090612536565b600f0b6020808601919091528601516116ef9042906123a8565b84602001516116fe91906123eb565b600f0b84525b602080880151600090815260078252604090205490870151600f9190910b93501561175b5786602001518660200151036117405782915061175b565b602080870151600090815260079091526040902054600f0b91505b6040805160808101825260008082526020820152429181019190915243606082015281156117d0575060008181526004602090815260409182902082516080810184528154600f81810b8352600160801b909104900b9281019290925260018101549282019290925260029091015460608201525b6040810151606082015181906000428310156118235760408501516117f590426123a8565b606086015161180490436123a8565b61181690670de0b6b3a76400006123d4565b611820919061237e565b90505b600062093a80611833818761237e565b61183d91906123d4565b905060005b60ff8110156119ad5761185862093a8083612355565b915060004283111561186c57429250611880565b50600082815260076020526040902054600f0b5b61188a87846123a8565b886020015161189991906123eb565b885189906118a890839061240b565b600f0b9052506020880180518291906118c29083906124b3565b600f90810b90915289516000910b121590506118dd57600088525b60008860200151600f0b12156118f557600060208901525b604088018390529195508591670de0b6b3a764000061191487856123a8565b61191e90866123d4565b611928919061237e565b6119329086612355565b606089015261194260018a612355565b985042830361195757504360608801526119ad565b6000898152600460209081526040918290208a51918b01516001600160801b03908116600160801b0292169190911781559089015160018201556060890151600290910155506119a6816123bb565b9050611842565b5060038790556001600160a01b038e1615611a40578a602001518a602001516119d6919061240b565b866020018181516119e791906124b3565b600f0b9052508a518a516119fb919061240b565b86518790611a0a9083906124b3565b600f90810b90915260208801516000910b12159050611a2b57600060208701525b60008660000151600f0b1215611a4057600086525b6000878152600460209081526040918290208851918901516001600160801b03908116600160801b02921691909117815590870151600182015560608701516002909101556001600160a01b038e1615611c3d57428d602001511115611b005760208b0151611aaf908a6124b3565b98508c602001518c6020015103611ad25760208a0151611acf908a61240b565b98505b60208d810151600090815260079091526040902080546001600160801b0319166001600160801b038b161790555b428c602001511115611b5b578c602001518c602001511115611b5b5760208a0151611b2b908961240b565b60208d810151600090815260079091526040902080546001600160801b0319166001600160801b03831617905597505b6001600160a01b038e166000908152600660205260408120548f9190611b82906001612355565b90508060066000846001600160a01b03166001600160a01b0316815260200190815260200160002081905550428c6040018181525050438c60600181815250508b60056000846001600160a01b03166001600160a01b0316815260200190815260200160002082633b9aca008110611bfc57611bfc612392565b825160208401516001600160801b03908116600160801b02911617600391909102919091019081556040820151600182015560609091015160029091015550505b5050505050505050505050505050565b33600090815260026020908152604080832081518083019092528054600f0b825260010154918101919091529062093a80611c88818561237e565b611c9291906123d4565b905042826020015111611cd65760405162461bcd60e51b815260206004820152600c60248201526b131bd8dac8195e1c1a5c995960a21b60448201526064016105d8565b60008260000151600f0b13611d215760405162461bcd60e51b8152602060048201526011602482015270139bdd1a1a5b99c81a5cc81b1bd8dad959607a1b60448201526064016105d8565b81602001518111611d745760405162461bcd60e51b815260206004820152601f60248201527f43616e206f6e6c7920696e637265617365206c6f636b206475726174696f6e0060448201526064016105d8565b611d826301e1338042612355565b811115611da15760405162461bcd60e51b81526004016105d89061247c565b6105f633600083856003610ee2565b6001548290611dbf8682612355565b6001556040805180820190915260008082526020820152825160208085015190830152600f0b8152825187908490611df89083906124b3565b600f0b9052508515611e0c57602083018690525b6001600160a01b0388166000908152600260209081526040909120845181546001600160801b0319166001600160801b0390911617815590840151600190910155611e588882856115e7565b8615610fc5576040516340c10f1960e01b8152306004820152602481018890527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906340c10f1990604401600060405180830381600087803b158015611ec657600080fd5b505af1158015611eda573d6000803e3d6000fd5b505050508260200151886001600160a01b03167fbe9cf0e939c614fad640a623a53ba0a807c8cb503c4c4c8dacabe27b86ff2dd5898742604051611007939291906124e0565b6040516001600160a01b03808516602483015283166044820152606481018290526113f19085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611fbb565b6040516001600160a01b0383166024820152604481018290526105f690849063a9059cbb60e01b90606401611f54565b6000612010826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166120909092919063ffffffff16565b905080516000148061203157508080602001905181019061203191906122d9565b6105f65760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105d8565b6060610eda848460008585600080866001600160a01b031685876040516120b79190612574565b60006040518083038185875af1925050503d80600081146120f4576040519150601f19603f3d011682016040523d82523d6000602084013e6120f9565b606091505b509150915061210a87838387612115565b979650505050505050565b6060831561218457825160000361217d576001600160a01b0385163b61217d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105d8565b5081610eda565b610eda83838151156121995781518083602001fd5b8060405162461bcd60e51b81526004016105d8919061220e565b80356001600160a01b03811681146121ca57600080fd5b919050565b6000602082840312156121e157600080fd5b610cbc826121b3565b60005b838110156122055781810151838201526020016121ed565b50506000910152565b602081526000825180602084015261222d8160408501602087016121ea565b601f01601f19169190910160400192915050565b60008060006060848603121561225657600080fd5b61225f846121b3565b95602085013595506040909401359392505050565b6000806040838503121561228757600080fd5b612290836121b3565b946020939093013593505050565b6000602082840312156122b057600080fd5b5035919050565b600080604083850312156122ca57600080fd5b50508035926020909101359150565b6000602082840312156122eb57600080fd5b81518015158114610cbc57600080fd5b60208082526024908201527f43616e6e6f742061646420746f2065787069726564206c6f636b2e20576974686040820152636472617760e01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b80820180821115610a4d57610a4d61233f565b634e487b7160e01b600052601260045260246000fd5b60008261238d5761238d612368565b500490565b634e487b7160e01b600052603260045260246000fd5b81810381811115610a4d57610a4d61233f565b6000600182016123cd576123cd61233f565b5060010190565b8082028115828204841417610a4d57610a4d61233f565b600082600f0b82600f0b0280600f0b91508082146114df576114df61233f565b600f82810b9082900b0360016001607f1b0319811260016001607f1b0382131715610a4d57610a4d61233f565b60208082526024908201527f566f74696e67206c6f636b206d757374206265206174206c656173742032207760408201526365656b7360e01b606082015260800190565b6020808252601d908201527f566f74696e67206c6f636b2063616e20626520312079656172206d6178000000604082015260600190565b600f81810b9083900b0160016001607f1b03811360016001607f1b031982121715610a4d57610a4d61233f565b838152606081016004841061250557634e487b7160e01b600052602160045260246000fd5b602082019390935260400152919050565b81810360008312801583831316838312821617156114df576114df61233f565b600081600f0b83600f0b8061254d5761254d612368565b60016001607f1b031982146000198214161561256b5761256b61233f565b90059392505050565b600082516125868184602087016121ea565b919091019291505056fea264697066735822122079608050279bc2b79dc4310e2c149db653045b9a70a581263476c8293ba786e264736f6c6343000813003300000000000000000000000078a0a62fba6fb21a83fe8a3433d44c73a4017a6f

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c80637116c60c11610104578063c2c4c5c1116100a2578063da020a1811610071578063da020a1814610497578063ee00ef3a146104aa578063eff7a612146104b5578063fc0c546a146104c857600080fd5b8063c2c4c5c1146103f6578063cbf9fe5f146103fe578063d07b705f14610446578063d1febfb91461045957600080fd5b8063900cf0cf116100de578063900cf0cf1461038b57806395d89b4114610394578063981b24d0146103b7578063adc63589146103ca57600080fd5b80637116c60c1461032f57806371197484146103425780637c74a1741461037857600080fd5b80633a46273e116101715780634ee2cd7e1161014b5780634ee2cd7e146102ec5780635b51c308146102ff57806365fc38731461030957806370a082311461031c57600080fd5b80633a46273e146102be5780633ccfd60b146102d15780634957677c146102d957600080fd5b80630a4345a8116101ad5780630a4345a81461024c57806318160ddd1461026157806328d09d4714610269578063313ce567146102a457600080fd5b8063010ae757146101d4578063047fc9aa1461020757806306fdde0314610210575b600080fd5b6101f46101e23660046121cf565b60066020526000908152604090205481565b6040519081526020015b60405180910390f35b6101f460015481565b61023f6040518060400160405280601081526020016f0acdee8ca5acae6c6e4deeecac8409eb60831b81525081565b6040516101fe919061220e565b61025f61025a366004612241565b610507565b005b6101f46105fb565b61027c610277366004612274565b61060b565b60408051600f95860b81529390940b60208401529282015260608101919091526080016101fe565b6102ac601281565b60405160ff90911681526020016101fe565b61025f6102cc366004612274565b610652565b61025f610728565b61025f6102e736600461229e565b610744565b6101f46102fa366004612274565b610762565b6101f46212750081565b61025f6103173660046122b7565b610a53565b6101f461032a3660046121cf565b610a6f565b6101f461033d36600461229e565b610a7b565b61036561035036600461229e565b600760205260009081526040902054600f0b81565b604051600f9190910b81526020016101fe565b6103656103863660046121cf565b610a86565b6101f460035481565b61023f604051806040016040528060048152602001630ecca9eb60e31b81525081565b6101f46103c536600461229e565b610ad3565b6101f46103d83660046121cf565b6001600160a01b031660009081526002602052604090206001015490565b61025f610c72565b61042c61040c3660046121cf565b60026020526000908152604090208054600190910154600f9190910b9082565b60408051600f9390930b83526020830191909152016101fe565b6101f4610454366004612274565b610cb0565b61027c61046736600461229e565b600460205260009081526040902080546001820154600290920154600f82810b93600160801b909304900b919084565b6101f46104a5366004612274565b610cc3565b6101f46301e1338081565b61025f6104c336600461229e565b610cff565b6104ef7f00000000000000000000000078a0a62fba6fb21a83fe8a3433d44c73a4017a6f81565b6040516001600160a01b0390911681526020016101fe565b61050f610d10565b604051633d1bb33160e21b81523360048201527f00000000000000000000000078a0a62fba6fb21a83fe8a3433d44c73a4017a6f6001600160a01b03169063f46eccc490602401602060405180830381865afa158015610573573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059791906122d9565b6105e15760405162461bcd60e51b815260206004820152601660248201527529b2b73232b91034b9903737ba10309036b4b73a32b960511b60448201526064015b60405180910390fd5b6105ec838383610d69565b6105f66001600055565b505050565b600061060642610e82565b905090565b600560205281600052604060002081633b9aca00811061062a57600080fd5b6003020180546001820154600290920154600f82810b9550600160801b90920490910b925084565b61065a610d10565b6001600160a01b03821660009081526002602090815260409182902082518084019093528054600f0b835260010154908201528161069757600080fd5b60008160000151600f0b136106e75760405162461bcd60e51b8152602060048201526016602482015275139bc8195e1a5cdd1a5b99c81b1bd8dac8199bdd5b9960521b60448201526064016105d8565b4281602001511161070a5760405162461bcd60e51b81526004016105d8906122fb565b61071983836000846000610ee2565b506107246001600055565b5050565b610730610d10565b61073861105d565b6107426001600055565b565b61074c610d10565b610755816111ac565b61075f6001600055565b50565b60004382111561077157600080fd5b6001600160a01b038316600090815260066020526040812054815b6080811015610825578183101561082557600060026107ab8486612355565b6107b6906001612355565b6107c0919061237e565b6001600160a01b0388166000908152600560205260409020909150869082633b9aca0081106107f1576107f1612392565b60030201600201541161080657809350610814565b6108116001826123a8565b92505b5061081e816123bb565b905061078c565b506001600160a01b038516600090815260056020526040812083633b9aca00811061085257610852612392565b604080516080810182526003928302939093018054600f81810b8652600160801b909104900b60208501526001810154918401919091526002015460608301525490915060006108a28783611262565b600081815260046020908152604080832081516080810183528154600f81810b8352600160801b909104900b938101939093526001810154918301919091526002015460608201529192508084841015610981576000600481610906876001612355565b8152602080820192909252604090810160002081516080810183528154600f81810b8352600160801b909104900b9381019390935260018101549183019190915260020154606080830182905286015191925061096391906123a8565b92508360400151816040015161097991906123a8565b9150506109a5565b606083015161099090436123a8565b91508260400151426109a291906123a8565b90505b604083015182156109e2578284606001518c6109c191906123a8565b6109cb90846123d4565b6109d5919061237e565b6109df9082612355565b90505b60408701516109f190826123a8565b8760200151610a0091906123eb565b87518890610a0f90839061240b565b600f90810b90915288516000910b129050610a3f57505093516001600160801b03169650610a4d95505050505050565b600099505050505050505050505b92915050565b610a5b610d10565b610a6582826112e8565b6107246001600055565b6000610a4d82426113f7565b6000610a4d82610e82565b6001600160a01b0381166000908152600660209081526040808320546005909252822081633b9aca008110610abd57610abd612392565b6003020154600160801b9004600f0b9392505050565b600043821115610ae257600080fd5b6003546000610af18483611262565b600081815260046020908152604080832081516080810183528154600f81810b8352600160801b909104900b9381019390935260018101549183019190915260020154606082015291925083831015610c00576000600481610b54866001612355565b8152602080820192909252604090810160002081516080810183528154600f81810b8352600160801b909104900b9381019390935260018101549183019190915260020154606080830182905285015191925014610bfa5782606001518160600151610bc091906123a8565b83604001518260400151610bd491906123a8565b6060850151610be3908a6123a8565b610bed91906123d4565b610bf7919061237e565b91505b50610c4f565b43826060015114610c4f576060820151610c1a90436123a8565b6040830151610c2990426123a8565b6060840151610c3890896123a8565b610c4291906123d4565b610c4c919061237e565b90505b610c6882828460400151610c639190612355565b6114e6565b9695505050505050565b610742600060405180604001604052806000600f0b8152602001600081525060405180604001604052806000600f0b815260200160008152506115e7565b6000610cbc83836113f7565b9392505050565b6001600160a01b038216600090815260056020526040812082633b9aca008110610cef57610cef612392565b6003020160010154905092915050565b610d07610d10565b61075581611c4d565b600260005403610d625760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d8565b6002600055565b60008211610d7657600080fd5b6001600160a01b03831660009081526002602090815260409182902082518084019093528054600f0b8084526001909101549183019190915215610df85760405162461bcd60e51b815260206004820152601960248201527815da5d1a191c985dc81bdb19081d1bdad95b9cc8199a5c9cdd603a1b60448201526064016105d8565b600062093a80610e08818561237e565b610e1291906123d4565b9050610e216212750042612355565b811015610e405760405162461bcd60e51b81526004016105d890612438565b610e4e6301e1338042612355565b811115610e6d5760405162461bcd60e51b81526004016105d89061247c565b610e7b858583856001611db0565b5050505050565b600354600081815260046020908152604080832081516080810183528154600f81810b8352600160801b909104900b93810193909352600181015491830191909152600201546060820152909190610eda81856114e6565b949350505050565b6001548290610ef18682612355565b6001556040805180820190915260008082526020820152825160208085015190830152600f0b8152825187908490610f2a9083906124b3565b600f0b9052508515610f3e57602083018690525b6001600160a01b0388166000908152600260209081526040909120845181546001600160801b0319166001600160801b0390911617815590840151600190910155610f8a8882856115e7565b8615610fc557610fc56001600160a01b037f00000000000000000000000078a0a62fba6fb21a83fe8a3433d44c73a4017a6f1689308a611f20565b8260200151886001600160a01b03167fbe9cf0e939c614fad640a623a53ba0a807c8cb503c4c4c8dacabe27b86ff2dd5898742604051611007939291906124e0565b60405180910390a37f5e2aa66efd74cce82b21852e317e5490d9ecc9e6bb953ae24d90851258cc2f5c8261103b8982612355565b6040805192835260208301919091520160405180910390a15050505050505050565b336000818152600260208181526040808420815180830183528154600f81900b808352600180850180548589015286518088019097528987528688018a81529a9099529690955292516001600160801b03166001600160801b03199093169290921790559351909255546110d182826123a8565b60015560408051808201909152600080825260208201526110f590339085906115e7565b6111296001600160a01b037f00000000000000000000000078a0a62fba6fb21a83fe8a3433d44c73a4017a6f163384611f8b565b6040805183815242602082015233917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568910160405180910390a27f5e2aa66efd74cce82b21852e317e5490d9ecc9e6bb953ae24d90851258cc2f5c8161118f84826123a8565b6040805192835260208301919091520160405180910390a1505050565b3360009081526002602090815260409182902082518084019093528054600f0b83526001015490820152816111e057600080fd5b60008160000151600f0b136112305760405162461bcd60e51b8152602060048201526016602482015275139bc8195e1a5cdd1a5b99c81b1bd8dac8199bdd5b9960521b60448201526064016105d8565b428160200151116112535760405162461bcd60e51b81526004016105d8906122fb565b61072433836000846002610ee2565b60008082815b60808110156112de57818310156112de57600060026112878486612355565b611292906001612355565b61129c919061237e565b60008181526004602052604090206002015490915087106112bf578093506112cd565b6112ca6001826123a8565b92505b506112d7816123bb565b9050611268565b5090949350505050565b600082116112f557600080fd5b3360009081526002602090815260409182902082518084019093528054600f0b808452600190910154918301919091521561136e5760405162461bcd60e51b815260206004820152601960248201527815da5d1a191c985dc81bdb19081d1bdad95b9cc8199a5c9cdd603a1b60448201526064016105d8565b600062093a8061137e818561237e565b61138891906123d4565b90506113976212750042612355565b8110156113b65760405162461bcd60e51b81526004016105d890612438565b6113c46301e1338042612355565b8111156113e35760405162461bcd60e51b81526004016105d89061247c565b6113f1338583856001610ee2565b50505050565b6001600160a01b038216600090815260066020526040812054808203611421576000915050610a4d565b6001600160a01b038416600090815260056020526040812082633b9aca00811061144d5761144d612392565b60408051608081018252600392909202929092018054600f81810b8452600160801b909104900b6020830152600181015492820183905260020154606082015291506114999085612516565b81602001516114a891906123eb565b815182906114b790839061240b565b600f90810b90915282516000910b121590506114d257600081525b51600f0b9150610a4d9050565b5092915050565b600080839050600062093a80808360400151611502919061237e565b61150c91906123d4565b905060005b60ff8110156115bf5761152762093a8083612355565b915060008583111561153b5785925061154f565b50600082815260076020526040902054600f0b5b604084015161155e90846123a8565b846020015161156d91906123eb565b8451859061157c90839061240b565b600f0b90525085830361158f57506115bf565b80846020018181516115a191906124b3565b600f0b90525050604083018290526115b8816123bb565b9050611511565b5060008260000151600f0b12156115d557600082525b50516001600160801b03169392505050565b60408051608081018252600080825260208201819052918101829052606081019190915260408051608081018252600080825260208201819052918101829052606081019190915260035460009081906001600160a01b0388161561175b57428760200151118015611660575060008760000151600f0b135b156116a5578651611676906301e1338090612536565b600f0b6020808701919091528701516116909042906123a8565b856020015161169f91906123eb565b600f0b85525b4286602001511180156116bf575060008660000151600f0b135b156117045785516116d5906301e1338090612536565b600f0b6020808601919091528601516116ef9042906123a8565b84602001516116fe91906123eb565b600f0b84525b602080880151600090815260078252604090205490870151600f9190910b93501561175b5786602001518660200151036117405782915061175b565b602080870151600090815260079091526040902054600f0b91505b6040805160808101825260008082526020820152429181019190915243606082015281156117d0575060008181526004602090815260409182902082516080810184528154600f81810b8352600160801b909104900b9281019290925260018101549282019290925260029091015460608201525b6040810151606082015181906000428310156118235760408501516117f590426123a8565b606086015161180490436123a8565b61181690670de0b6b3a76400006123d4565b611820919061237e565b90505b600062093a80611833818761237e565b61183d91906123d4565b905060005b60ff8110156119ad5761185862093a8083612355565b915060004283111561186c57429250611880565b50600082815260076020526040902054600f0b5b61188a87846123a8565b886020015161189991906123eb565b885189906118a890839061240b565b600f0b9052506020880180518291906118c29083906124b3565b600f90810b90915289516000910b121590506118dd57600088525b60008860200151600f0b12156118f557600060208901525b604088018390529195508591670de0b6b3a764000061191487856123a8565b61191e90866123d4565b611928919061237e565b6119329086612355565b606089015261194260018a612355565b985042830361195757504360608801526119ad565b6000898152600460209081526040918290208a51918b01516001600160801b03908116600160801b0292169190911781559089015160018201556060890151600290910155506119a6816123bb565b9050611842565b5060038790556001600160a01b038e1615611a40578a602001518a602001516119d6919061240b565b866020018181516119e791906124b3565b600f0b9052508a518a516119fb919061240b565b86518790611a0a9083906124b3565b600f90810b90915260208801516000910b12159050611a2b57600060208701525b60008660000151600f0b1215611a4057600086525b6000878152600460209081526040918290208851918901516001600160801b03908116600160801b02921691909117815590870151600182015560608701516002909101556001600160a01b038e1615611c3d57428d602001511115611b005760208b0151611aaf908a6124b3565b98508c602001518c6020015103611ad25760208a0151611acf908a61240b565b98505b60208d810151600090815260079091526040902080546001600160801b0319166001600160801b038b161790555b428c602001511115611b5b578c602001518c602001511115611b5b5760208a0151611b2b908961240b565b60208d810151600090815260079091526040902080546001600160801b0319166001600160801b03831617905597505b6001600160a01b038e166000908152600660205260408120548f9190611b82906001612355565b90508060066000846001600160a01b03166001600160a01b0316815260200190815260200160002081905550428c6040018181525050438c60600181815250508b60056000846001600160a01b03166001600160a01b0316815260200190815260200160002082633b9aca008110611bfc57611bfc612392565b825160208401516001600160801b03908116600160801b02911617600391909102919091019081556040820151600182015560609091015160029091015550505b5050505050505050505050505050565b33600090815260026020908152604080832081518083019092528054600f0b825260010154918101919091529062093a80611c88818561237e565b611c9291906123d4565b905042826020015111611cd65760405162461bcd60e51b815260206004820152600c60248201526b131bd8dac8195e1c1a5c995960a21b60448201526064016105d8565b60008260000151600f0b13611d215760405162461bcd60e51b8152602060048201526011602482015270139bdd1a1a5b99c81a5cc81b1bd8dad959607a1b60448201526064016105d8565b81602001518111611d745760405162461bcd60e51b815260206004820152601f60248201527f43616e206f6e6c7920696e637265617365206c6f636b206475726174696f6e0060448201526064016105d8565b611d826301e1338042612355565b811115611da15760405162461bcd60e51b81526004016105d89061247c565b6105f633600083856003610ee2565b6001548290611dbf8682612355565b6001556040805180820190915260008082526020820152825160208085015190830152600f0b8152825187908490611df89083906124b3565b600f0b9052508515611e0c57602083018690525b6001600160a01b0388166000908152600260209081526040909120845181546001600160801b0319166001600160801b0390911617815590840151600190910155611e588882856115e7565b8615610fc5576040516340c10f1960e01b8152306004820152602481018890527f00000000000000000000000078a0a62fba6fb21a83fe8a3433d44c73a4017a6f6001600160a01b0316906340c10f1990604401600060405180830381600087803b158015611ec657600080fd5b505af1158015611eda573d6000803e3d6000fd5b505050508260200151886001600160a01b03167fbe9cf0e939c614fad640a623a53ba0a807c8cb503c4c4c8dacabe27b86ff2dd5898742604051611007939291906124e0565b6040516001600160a01b03808516602483015283166044820152606481018290526113f19085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611fbb565b6040516001600160a01b0383166024820152604481018290526105f690849063a9059cbb60e01b90606401611f54565b6000612010826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166120909092919063ffffffff16565b905080516000148061203157508080602001905181019061203191906122d9565b6105f65760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105d8565b6060610eda848460008585600080866001600160a01b031685876040516120b79190612574565b60006040518083038185875af1925050503d80600081146120f4576040519150601f19603f3d011682016040523d82523d6000602084013e6120f9565b606091505b509150915061210a87838387612115565b979650505050505050565b6060831561218457825160000361217d576001600160a01b0385163b61217d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105d8565b5081610eda565b610eda83838151156121995781518083602001fd5b8060405162461bcd60e51b81526004016105d8919061220e565b80356001600160a01b03811681146121ca57600080fd5b919050565b6000602082840312156121e157600080fd5b610cbc826121b3565b60005b838110156122055781810151838201526020016121ed565b50506000910152565b602081526000825180602084015261222d8160408501602087016121ea565b601f01601f19169190910160400192915050565b60008060006060848603121561225657600080fd5b61225f846121b3565b95602085013595506040909401359392505050565b6000806040838503121561228757600080fd5b612290836121b3565b946020939093013593505050565b6000602082840312156122b057600080fd5b5035919050565b600080604083850312156122ca57600080fd5b50508035926020909101359150565b6000602082840312156122eb57600080fd5b81518015158114610cbc57600080fd5b60208082526024908201527f43616e6e6f742061646420746f2065787069726564206c6f636b2e20576974686040820152636472617760e01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b80820180821115610a4d57610a4d61233f565b634e487b7160e01b600052601260045260246000fd5b60008261238d5761238d612368565b500490565b634e487b7160e01b600052603260045260246000fd5b81810381811115610a4d57610a4d61233f565b6000600182016123cd576123cd61233f565b5060010190565b8082028115828204841417610a4d57610a4d61233f565b600082600f0b82600f0b0280600f0b91508082146114df576114df61233f565b600f82810b9082900b0360016001607f1b0319811260016001607f1b0382131715610a4d57610a4d61233f565b60208082526024908201527f566f74696e67206c6f636b206d757374206265206174206c656173742032207760408201526365656b7360e01b606082015260800190565b6020808252601d908201527f566f74696e67206c6f636b2063616e20626520312079656172206d6178000000604082015260600190565b600f81810b9083900b0160016001607f1b03811360016001607f1b031982121715610a4d57610a4d61233f565b838152606081016004841061250557634e487b7160e01b600052602160045260246000fd5b602082019390935260400152919050565b81810360008312801583831316838312821617156114df576114df61233f565b600081600f0b83600f0b8061254d5761254d612368565b60016001607f1b031982146000198214161561256b5761256b61233f565b90059392505050565b600082516125868184602087016121ea565b919091019291505056fea264697066735822122079608050279bc2b79dc4310e2c149db653045b9a70a581263476c8293ba786e264736f6c63430008130033

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

00000000000000000000000078a0a62fba6fb21a83fe8a3433d44c73a4017a6f

-----Decoded View---------------
Arg [0] : token_addr (address): 0x78a0A62Fba6Fb21A83FE8a3433d44C73a4017A6f

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000078a0a62fba6fb21a83fe8a3433d44c73a4017a6f


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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