Address io1x4jz2uzw4r6zcera53zcz522qz8m9anmrl4ctn

Contract Overview

Balance:
0 IOTX

IOTX Value:
$ 0

Token:
Txn Hash
Block
From
To
Value [Txn Fee]
11956fabe5d600dd20d0a309a2251a898b3e5c7d774932d49798c4bb1a223ede 29164185 2024-03-27 14:11:20 +0000 UTC one month ago io1kl3hxmp0n57jrn8xnfgf4h26ja2laj2ksd6jz3  IN    Contract: RewardsDistributor 0 IOTX 0.021171
437d95f2c4b2d79c5151fde73ad7ce2a49915893e82cde4bd7852dee34be72e2 29164181 2024-03-27 14:11:00 +0000 UTC one month ago io1kl3hxmp0n57jrn8xnfgf4h26ja2laj2ksd6jz3  IN    Contract: RewardsDistributor 0 IOTX 0.021172
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RewardsDistributor

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 6: contracts/interfaces/IVoter.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

interface IVoter {
    function _ve() external view returns (address);
    function governor() external view returns (address);
    function gauges(address _pair) external view returns (address);
    function factory() external view returns (address);
    function minter() external view returns(address);
    function emergencyCouncil() external view returns (address);
    function attachTokenToGauge(uint _tokenId, address account) external;
    function detachTokenFromGauge(uint _tokenId, address account) external;
    function emitDeposit(uint _tokenId, address account, uint amount) external;
    function emitWithdraw(uint _tokenId, address account, uint amount) external;
    function isWhitelisted(address token) external view returns (bool);
    function notifyRewardAmount(uint amount) external;
    function distribute(address _gauge) external;
    function distributeAll() external;
    function distributeFees(address[] memory _gauges) external;

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

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

File 2 of 6: contracts/interfaces/IVotingEscrow.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

interface IVotingEscrow {

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

    struct LockedBalance {
        int128 amount;
        uint end;
    }

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

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

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

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

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

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

    function balanceOfNFT(uint _id) external view returns (uint);
    function balanceOf(address _owner) external view returns (uint);
    function totalSupply() external view returns (uint);
    function supply() external view returns (uint);


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

File 3 of 6: contracts/libraries/Math.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

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

File 4 of 6: contracts/RewardsDistributor.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.13;

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

/*

@title Curve Fee Distribution modified for ve(3,3) emissions
@author Curve Finance, andrecronje
@license MIT

*/

contract RewardsDistributor is IRewardsDistributor {

    event CheckpointToken(
        uint time,
        uint tokens
    );

    event Claimed(
        uint tokenId,
        uint amount,
        uint claim_epoch,
        uint max_epoch
    );

    uint constant WEEK = 7 * 86400;

    uint internal NonVoterPenalty = 750; // 75% 
    uint internal constant PRECISION = 1000;


    uint public start_time;
    uint public time_cursor;
    mapping(uint => uint) public time_cursor_of;
    mapping(uint => uint) public user_epoch_of;

    uint public last_token_time;
    uint[1000000000000000] public tokens_per_week;
    uint public token_last_balance;
    uint[1000000000000000] public ve_supply;

    address public owner;
    address public voting_escrow;
    address public token;
    address public voter;
    address public depositor;

    constructor(address _voting_escrow) {
        uint _t = block.timestamp / WEEK * WEEK;
        voter = msg.sender;
        start_time = _t;
        last_token_time = _t;
        time_cursor = _t;
        address _token = IVotingEscrow(_voting_escrow).token();
        token = _token;
        voting_escrow = _voting_escrow;
        depositor = msg.sender; //0x86069feb223ee303085a1a505892c9d4bdbee996
        owner = msg.sender;
        require(IERC20(_token).approve(_voting_escrow, type(uint).max));
    }

    function timestamp() external view returns (uint) {
        return block.timestamp / WEEK * WEEK;
    }

    function _checkpoint_token() internal {
        uint token_balance = IERC20(token).balanceOf(address(this));
        uint to_distribute = token_balance - token_last_balance;
        token_last_balance = token_balance;

        uint t = last_token_time;
        uint since_last = block.timestamp - t;
        last_token_time = block.timestamp;
        uint this_week = t / WEEK * WEEK;
        uint next_week = 0;

        for (uint i = 0; i < 20; i++) {
            next_week = this_week + WEEK;
            if (block.timestamp < next_week) {
                if (since_last == 0 && block.timestamp == t) {
                    tokens_per_week[this_week] += to_distribute;
                } else {
                    tokens_per_week[this_week] += to_distribute * (block.timestamp - t) / since_last;
                }
                break;
            } else {
                if (since_last == 0 && next_week == t) {
                    tokens_per_week[this_week] += to_distribute;
                } else {
                    tokens_per_week[this_week] += to_distribute * (next_week - t) / since_last;
                }
            }
            t = next_week;
            this_week = next_week;
        }
        emit CheckpointToken(block.timestamp, to_distribute);
    }

    function checkpoint_token() external {
        assert(msg.sender == depositor);
        _checkpoint_token();
    }

    function _find_timestamp_epoch(address ve, uint _timestamp) internal view returns (uint) {
        uint _min = 0;
        uint _max = IVotingEscrow(ve).epoch();
        for (uint i = 0; i < 128; i++) {
            if (_min >= _max) break;
            uint _mid = (_min + _max + 2) / 2;
            IVotingEscrow.Point memory pt = IVotingEscrow(ve).point_history(_mid);
            if (pt.ts <= _timestamp) {
                _min = _mid;
            } else {
                _max = _mid - 1;
            }
        }
        return _min;
    }

    function _find_timestamp_user_epoch(address ve, uint tokenId, uint _timestamp, uint max_user_epoch) internal view returns (uint) {
        uint _min = 0;
        uint _max = max_user_epoch;
        for (uint i = 0; i < 128; i++) {
            if (_min >= _max) break;
            uint _mid = (_min + _max + 2) / 2;
            IVotingEscrow.Point memory pt = IVotingEscrow(ve).user_point_history(tokenId, _mid);
            if (pt.ts <= _timestamp) {
                _min = _mid;
            } else {
                _max = _mid -1;
            }
        }
        return _min;
    }

    function ve_for_at(uint _tokenId, uint _timestamp) external view returns (uint) {
        address ve = voting_escrow;
        uint max_user_epoch = IVotingEscrow(ve).user_point_epoch(_tokenId);
        uint epoch = _find_timestamp_user_epoch(ve, _tokenId, _timestamp, max_user_epoch);
        IVotingEscrow.Point memory pt = IVotingEscrow(ve).user_point_history(_tokenId, epoch);
        return Math.max(uint(int256(pt.bias - pt.slope * (int128(int256(_timestamp - pt.ts))))), 0);
    }

    function _checkpoint_total_supply() internal {
        address ve = voting_escrow;
        uint t = time_cursor;
        uint rounded_timestamp = block.timestamp / WEEK * WEEK;
        IVotingEscrow(ve).checkpoint();

        for (uint i = 0; i < 20; i++) {
            if (t > rounded_timestamp) {
                break;
            } else {
                uint epoch = _find_timestamp_epoch(ve, t);
                IVotingEscrow.Point memory pt = IVotingEscrow(ve).point_history(epoch);
                int128 dt = 0;
                if (t > pt.ts) {
                    dt = int128(int256(t - pt.ts));
                }
                ve_supply[t] = Math.max(uint(int256(pt.bias - pt.slope * dt)), 0);
            }
            t += WEEK;
        }
        time_cursor = t;
    }

    function checkpoint_total_supply() external {
        _checkpoint_total_supply();
    }

    function _claim(uint _tokenId, address ve, uint _last_token_time) internal returns (uint) {
        uint user_epoch = 0;
        uint to_distribute = 0;

        uint max_user_epoch = IVotingEscrow(ve).user_point_epoch(_tokenId);
        uint _start_time = start_time;

        if (max_user_epoch == 0) return 0;

        uint week_cursor = time_cursor_of[_tokenId];
        if (week_cursor == 0) {
            user_epoch = _find_timestamp_user_epoch(ve, _tokenId, _start_time, max_user_epoch);
        } else {
            user_epoch = user_epoch_of[_tokenId];
        }

        if (user_epoch == 0) user_epoch = 1;

        IVotingEscrow.Point memory user_point = IVotingEscrow(ve).user_point_history(_tokenId, user_epoch);

        if (week_cursor == 0) week_cursor = (user_point.ts + WEEK - 1) / WEEK * WEEK;
        if (week_cursor >= last_token_time) return 0;
        if (week_cursor < _start_time) week_cursor = _start_time;

        IVotingEscrow.Point memory old_user_point;

        for (uint i = 0; i < 50; i++) {
            if (week_cursor >= _last_token_time) break;

            if (week_cursor >= user_point.ts && user_epoch <= max_user_epoch) {
                user_epoch += 1;
                old_user_point = user_point;
                if (user_epoch > max_user_epoch) {
                    user_point = IVotingEscrow.Point(0,0,0,0);
                } else {
                    user_point = IVotingEscrow(ve).user_point_history(_tokenId, user_epoch);
                }
            } else {
                int128 dt = int128(int256(week_cursor - old_user_point.ts));
                uint balance_of = Math.max(uint(int256(old_user_point.bias - dt * old_user_point.slope)), 0);
                if (balance_of == 0 && user_epoch > max_user_epoch) break;
                if (balance_of != 0) {
                    to_distribute += balance_of * tokens_per_week[week_cursor] / ve_supply[week_cursor];
                }
                week_cursor += WEEK;
            }
        }

        user_epoch = Math.min(max_user_epoch, user_epoch - 1);
        user_epoch_of[_tokenId] = user_epoch;
        time_cursor_of[_tokenId] = week_cursor;

        emit Claimed(_tokenId, to_distribute, user_epoch, max_user_epoch);

        return to_distribute;
    }

    function _claimable(uint _tokenId, address ve, uint _last_token_time) internal view returns (uint) {
        uint user_epoch = 0;
        uint to_distribute = 0;

        uint max_user_epoch = IVotingEscrow(ve).user_point_epoch(_tokenId);
        uint _start_time = start_time;

        if (max_user_epoch == 0) return 0;

        uint week_cursor = time_cursor_of[_tokenId];
        if (week_cursor == 0) {
            user_epoch = _find_timestamp_user_epoch(ve, _tokenId, _start_time, max_user_epoch);
        } else {
            user_epoch = user_epoch_of[_tokenId];
        }

        if (user_epoch == 0) user_epoch = 1;

        IVotingEscrow.Point memory user_point = IVotingEscrow(ve).user_point_history(_tokenId, user_epoch);

        if (week_cursor == 0) week_cursor = (user_point.ts + WEEK - 1) / WEEK * WEEK;
        if (week_cursor >= last_token_time) return 0;
        if (week_cursor < _start_time) week_cursor = _start_time;

        IVotingEscrow.Point memory old_user_point;

        for (uint i = 0; i < 50; i++) {
            if (week_cursor >= _last_token_time) break;

            if (week_cursor >= user_point.ts && user_epoch <= max_user_epoch) {
                user_epoch += 1;
                old_user_point = user_point;
                if (user_epoch > max_user_epoch) {
                    user_point = IVotingEscrow.Point(0,0,0,0);
                } else {
                    user_point = IVotingEscrow(ve).user_point_history(_tokenId, user_epoch);
                }
            } else {
                int128 dt = int128(int256(week_cursor - old_user_point.ts));
                uint balance_of = Math.max(uint(int256(old_user_point.bias - dt * old_user_point.slope)), 0);
                if (balance_of == 0 && user_epoch > max_user_epoch) break;
                if (balance_of != 0) {
                    to_distribute += balance_of * tokens_per_week[week_cursor] / ve_supply[week_cursor];
                }
                week_cursor += WEEK;
            }
        }

        return to_distribute;
    }

    function claimable(uint _tokenId) external view returns (uint) {
        uint _last_token_time = last_token_time / WEEK * WEEK;
        uint amount = _claimable(_tokenId, voting_escrow, _last_token_time);
        uint claimAmount;
        uint week_cursor = IVoter(voter).lastVoted(_tokenId);
        bool hasVoted = false;
        uint votePeriod = time_cursor - (2 * WEEK);
        if (week_cursor >= votePeriod) {
            hasVoted = true;
        }

        if (amount != 0) {
            if (hasVoted) {
                claimAmount = amount; // 100% of the reward for voters
            } else {
                claimAmount = amount * NonVoterPenalty / PRECISION; // Reduced reward for non-voters
            }
        }
        return claimAmount;
    }


    function claim(uint _tokenId) external returns (uint) {
        if (block.timestamp >= time_cursor) _checkpoint_total_supply();
        uint _last_token_time = last_token_time;
        _last_token_time = _last_token_time / WEEK * WEEK;
        uint amount = _claim(_tokenId, voting_escrow, _last_token_time);
        uint claimAmount;
        uint week_cursor = IVoter(voter).lastVoted(_tokenId);
        bool hasVoted = false;
        uint votePeriod = time_cursor - (2 * WEEK);
        if(week_cursor >= votePeriod){
             hasVoted = true;
        }
        
        if (amount != 0) {
            if (hasVoted) {
                claimAmount = amount; // 100% of the reward
            } else {
                claimAmount = amount * NonVoterPenalty / PRECISION;
            }
            // if locked.end then send directly
            IVotingEscrow.LockedBalance memory _locked = IVotingEscrow(voting_escrow).locked(_tokenId);
            if(_locked.end < block.timestamp){
                address _nftOwner = IVotingEscrow(voting_escrow).ownerOf(_tokenId);
                IERC20(token).transfer(_nftOwner, claimAmount);
            } else {
                IVotingEscrow(voting_escrow).deposit_for(_tokenId, claimAmount);
            }
            token_last_balance -= claimAmount;
        }
        return claimAmount;
    }

    function claim_many(uint[] memory _tokenIds) external returns (bool) {
        if (block.timestamp >= time_cursor) _checkpoint_total_supply();
        uint _last_token_time = last_token_time;
        _last_token_time = _last_token_time / WEEK * WEEK;
        address _voting_escrow = voting_escrow;
        uint total = 0;

        for (uint i = 0; i < _tokenIds.length; i++) {
            uint _tokenId = _tokenIds[i];
            if (_tokenId == 0) break;
            uint amount = _claim(_tokenId, _voting_escrow, _last_token_time);
            uint claimAmount;
            uint week_cursor = IVoter(voter).lastVoted(_tokenId);
            bool hasVoted = false;
            uint votePeriod = time_cursor - (2 * WEEK);
            if(week_cursor >= votePeriod){
                hasVoted = true;
            }
            if (amount != 0) {
                if (hasVoted) {
                    claimAmount = amount; // 100% of the reward
                } else {
                    claimAmount = amount * NonVoterPenalty / PRECISION; 
                }
                // if locked.end then send directly
                IVotingEscrow.LockedBalance memory _locked = IVotingEscrow(_voting_escrow).locked(_tokenId);
                if(_locked.end < block.timestamp){
                    address _nftOwner = IVotingEscrow(_voting_escrow).ownerOf(_tokenId);
                    IERC20(token).transfer(_nftOwner, claimAmount);
                } else {
                    IVotingEscrow(_voting_escrow).deposit_for(_tokenId, claimAmount);
                }
                total += claimAmount;
            }
        }
        if (total != 0) {
            token_last_balance -= total;
        }

        return true;
    }

    function setDepositor(address _depositor) external {
        require(msg.sender == owner);
        depositor = _depositor;
    }
    function setVoterPenalty(uint _Penalty) external {
        require(msg.sender == owner);
        require(_Penalty <= PRECISION, "rate too high");
        NonVoterPenalty = _Penalty;
    }
    function setVoter(address _voter) external {
        require(msg.sender == owner);
        voter = _voter;
    }
    function setOwner(address _owner) external {
        require(msg.sender == owner);
        owner = _owner;
    }

    function withdrawERC20(address _token) external {
        require(msg.sender == owner);
        require(_token != address(0));
        uint256 _balance = IERC20(_token).balanceOf(address(this));
        IERC20(_token).transfer(msg.sender, _balance);
    }


}


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

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

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

File 6 of 6: contracts/interfaces/IRewardsDistributor.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_voting_escrow","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokens","type":"uint256"}],"name":"CheckpointToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"claim_epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"max_epoch","type":"uint256"}],"name":"Claimed","type":"event"},{"inputs":[],"name":"checkpoint_token","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"checkpoint_total_supply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"claim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"claim_many","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"claimable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"last_token_time","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_depositor","type":"address"}],"name":"setDepositor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_voter","type":"address"}],"name":"setVoter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_Penalty","type":"uint256"}],"name":"setVoterPenalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"start_time","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"time_cursor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"time_cursor_of","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token_last_balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokens_per_week","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"user_epoch_of","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"ve_for_at","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"ve_supply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voting_escrow","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Contract Creation Code

608060405234801561001057600080fd5b50600436106101735760003560e01c8063834ee417116100de578063d1d58b2511610097578063edf5999711610071578063edf5999714610333578063f2c098b714610346578063f4f3b20014610359578063fc0c546a1461036c57600080fd5b8063d1d58b25146102f4578063d4dafba814610307578063dfe050311461031a57600080fd5b8063834ee417146102965780638da5cb5b1461029f578063b21ed502146102b8578063b80777ea146102c0578063c7c4ff46146102c8578063cbe2a1fb146102e157600080fd5b806346c96aac1161013057806346c96aac1461020e578063486d25fe1461023f5780634bc2a6571461025f57806368809889146102725780637f58e8f814610285578063811a40fe1461028e57600080fd5b8063127dcbd31461017857806313af40351461019457806316aea5c0146101a95780631f1db043146101c957806322b04bfc146101ec578063379607f5146101fb575b600080fd5b61018160025481565b6040519081526020015b60405180910390f35b6101a76101a2366004611dd1565b610385565b005b6101816101b7366004611dee565b60046020526000908152604090205481565b6101dc6101d7366004611e4e565b6103ca565b604051901515815260200161018b565b61018166038d7ea4c680065481565b610181610209366004611dee565b610750565b66071afd498d000a54610227906001600160a01b031681565b6040516001600160a01b03909116815260200161018b565b61018161024d366004611dee565b60036020526000908152604090205481565b6101a761026d366004611dd1565b610a8d565b610181610280366004611ee8565b610ad2565b61018160055481565b6101a7610c15565b61018160015481565b66071afd498d000754610227906001600160a01b031681565b6101a7610c3f565b610181610c47565b66071afd498d000b54610227906001600160a01b031681565b6101a76102ef366004611dee565b610c66565b610181610302366004611dee565b610cce565b610181610315366004611dee565b610df3565b66071afd498d000854610227906001600160a01b031681565b610181610341366004611dee565b610e16565b6101a7610354366004611dd1565b610e2c565b6101a7610367366004611dd1565b610e71565b66071afd498d000954610227906001600160a01b031681565b66071afd498d0007546001600160a01b031633146103a257600080fd5b66071afd498d000780546001600160a01b0319166001600160a01b0392909216919091179055565b600060025442106103dd576103dd610f85565b60055462093a806103ee8183611f20565b6103f89190611f42565b66071afd498d0008549091506001600160a01b03166000805b855181101561072057600086828151811061042e5761042e611f61565b60200260200101519050806000036104465750610720565b6000610453828688611128565b66071afd498d000a5460405163079aca5f60e51b81526004810185905291925060009182916001600160a01b03169063f3594be090602401602060405180830381865afa1580156104a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104cc9190611f77565b90506000806104df62093a806002611f42565b6002546104ec9190611f90565b90508083106104fa57600191505b841561070757811561050e5784935061052c565b6103e86000548661051f9190611f42565b6105299190611f20565b93505b604051635a2d1e0760e11b8152600481018790526000906001600160a01b038b169063b45a3c0e906024016040805180830381865afa158015610573573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105979190611fbe565b90504281602001511015610697576040516331a9108f60e11b8152600481018890526000906001600160a01b038c1690636352211e90602401602060405180830381865afa1580156105ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106119190612015565b66071afd498d00095460405163a9059cbb60e01b81526001600160a01b038084166004830152602482018a905292935091169063a9059cbb906044016020604051808303816000875af115801561066c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106909190612032565b50506106f9565b604051631dd33fc560e31b815260048101889052602481018690526001600160a01b038b169063ee99fe2890604401600060405180830381600087803b1580156106e057600080fd5b505af11580156106f4573d6000803e3d6000fd5b505050505b610703858a612054565b9850505b50505050505080806107189061206c565b915050610411565b508015610745578066038d7ea4c68006600082825461073f9190611f90565b90915550505b506001949350505050565b6000600254421061076357610763610f85565b60055462093a806107748183611f20565b61077e9190611f42565b66071afd498d0008549091506000906107a29085906001600160a01b031684611128565b66071afd498d000a5460405163079aca5f60e51b81526004810187905291925060009182916001600160a01b03169063f3594be090602401602060405180830381865afa1580156107f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081b9190611f77565b905060008061082e62093a806002611f42565b60025461083b9190611f90565b905080831061084957600191505b8415610a8157811561085d5784935061087b565b6103e86000548661086e9190611f42565b6108789190611f20565b93505b66071afd498d000854604051635a2d1e0760e11b8152600481018a90526000916001600160a01b03169063b45a3c0e906024016040805180830381865afa1580156108ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ee9190611fbe565b905042816020015110156109f65766071afd498d0008546040516331a9108f60e11b8152600481018b90526000916001600160a01b031690636352211e90602401602060405180830381865afa15801561094c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109709190612015565b66071afd498d00095460405163a9059cbb60e01b81526001600160a01b038084166004830152602482018a905292935091169063a9059cbb906044016020604051808303816000875af11580156109cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ef9190612032565b5050610a62565b66071afd498d000854604051631dd33fc560e31b8152600481018b9052602481018790526001600160a01b039091169063ee99fe2890604401600060405180830381600087803b158015610a4957600080fd5b505af1158015610a5d573d6000803e3d6000fd5b505050505b8466038d7ea4c680066000828254610a7a9190611f90565b9091555050505b50919695505050505050565b66071afd498d0007546001600160a01b03163314610aaa57600080fd5b66071afd498d000a80546001600160a01b0319166001600160a01b0392909216919091179055565b66071afd498d00085460405163391044d760e21b8152600481018490526000916001600160a01b0316908290829063e441135c90602401602060405180830381865afa158015610b26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4a9190611f77565b90506000610b5a8387878561154f565b6040516309bb79ed60e11b815260048101889052602481018290529091506000906001600160a01b03851690631376f3da90604401608060405180830381865afa158015610bac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd09190612085565b9050610c0a816040015187610be59190611f90565b8260200151610bf491906120f7565b8251610c009190612195565b600f0b6000611643565b979650505050505050565b66071afd498d000b546001600160a01b03163314610c3557610c356121e5565b610c3d61165a565b565b610c3d610f85565b600062093a80610c578142611f20565b610c619190611f42565b905090565b66071afd498d0007546001600160a01b03163314610c8357600080fd5b6103e8811115610cc95760405162461bcd60e51b815260206004820152600d60248201526c0e4c2e8ca40e8dede40d0d2ced609b1b604482015260640160405180910390fd5b600055565b60008062093a8080600554610ce39190611f20565b610ced9190611f42565b66071afd498d000854909150600090610d119085906001600160a01b0316846118b7565b66071afd498d000a5460405163079aca5f60e51b81526004810187905291925060009182916001600160a01b03169063f3594be090602401602060405180830381865afa158015610d66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8a9190611f77565b9050600080610d9d62093a806002611f42565b600254610daa9190611f90565b9050808310610db857600191505b8415610a81578115610dcc57849350610a81565b6103e860005486610ddd9190611f42565b610de79190611f20565b98975050505050505050565b66038d7ea4c680078166038d7ea4c680008110610e0f57600080fd5b0154905081565b60068166038d7ea4c680008110610e0f57600080fd5b66071afd498d0007546001600160a01b03163314610e4957600080fd5b66071afd498d000b80546001600160a01b0319166001600160a01b0392909216919091179055565b66071afd498d0007546001600160a01b03163314610e8e57600080fd5b6001600160a01b038116610ea157600080fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610ee8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0c9190611f77565b60405163a9059cbb60e01b8152336004820152602481018290529091506001600160a01b0383169063a9059cbb906044016020604051808303816000875af1158015610f5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f809190612032565b505050565b66071afd498d0008546002546001600160a01b0390911690600062093a80610fad8142611f20565b610fb79190611f42565b9050826001600160a01b031663c2c4c5c16040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610ff457600080fd5b505af1158015611008573d6000803e3d6000fd5b5050505060005b60148110156111205781831161112057600061102b8585611c55565b60405163d1febfb960e01b8152600481018290529091506000906001600160a01b0387169063d1febfb990602401608060405180830381865afa158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612085565b9050600081604001518611156110bc5760408201516110b99087611f90565b90505b6110db8183602001516110cf91906120f7565b8351610c009190612195565b66038d7ea4c680078766038d7ea4c6800081106110fa576110fa611f61565b015550505061110c62093a8084612054565b9250806111188161206c565b91505061100f565b505060025550565b60405163391044d760e21b8152600481018490526000908190819081906001600160a01b0387169063e441135c90602401602060405180830381865afa158015611176573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119a9190611f77565b60015490915060008290036111b6576000945050505050611548565b600088815260036020526040812054908190036111e0576111d9888a848661154f565b94506111f2565b60008981526004602052604090205494505b846000036111ff57600194505b6040516309bb79ed60e11b8152600481018a9052602481018690526000906001600160a01b038a1690631376f3da90604401608060405180830381865afa15801561124e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112729190612085565b9050816000036112b75762093a8080600162093a8084604001516112969190612054565b6112a09190611f90565b6112aa9190611f20565b6112b49190611f42565b91505b60055482106112cf5760009650505050505050611548565b828210156112db578291505b6040805160808101825260008082526020820181905291810182905260608101829052905b60328110156114c257898410156114c257826040015184101580156113255750858811155b156113eb57611335600189612054565b9750829150858811156113745760405180608001604052806000600f0b81526020016000600f0b815260200160008152602001600081525092506114b0565b6040516309bb79ed60e11b8152600481018d9052602481018990526001600160a01b038c1690631376f3da90604401608060405180830381865afa1580156113c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e49190612085565b92506114b0565b60008260400151856113fd9190611f90565b9050600061142084602001518361141491906120f7565b8551610c009190612195565b90508015801561142f5750878a115b1561143b5750506114c2565b801561149e5766038d7ea4c680078666038d7ea4c68000811061146057611460611f61565b015460068766038d7ea4c68000811061147b5761147b611f61565b01546114879083611f42565b6114919190611f20565b61149b908a612054565b98505b6114ab62093a8087612054565b955050505b806114ba8161206c565b915050611300565b506114d7856114d260018a611f90565b611daa565b60008c8152600460209081526040808320849055600382529182902086905581518e8152908101899052908101829052606081018790529097507fcae2990aa9af8eb1c64713b7eddb3a80bf18e49a94a13fe0d0002b5d61d58f009060800160405180910390a15093955050505050505b9392505050565b60008082815b6080811015611637578183101561163757600060026115748486612054565b61157f906002612054565b6115899190611f20565b6040516309bb79ed60e11b8152600481018a9052602481018290529091506000906001600160a01b038b1690631376f3da90604401608060405180830381865afa1580156115db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ff9190612085565b90508781604001511161161457819450611622565b61161f600183611f90565b93505b5050808061162f9061206c565b915050611555565b50909695505050505050565b6000818310156116535781611548565b5090919050565b66071afd498d0009546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156116a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116cd9190611f77565b9050600066038d7ea4c6800654826116e59190611f90565b66038d7ea4c6800683905560055490915060006117028242611f90565b426005559050600062093a806117188185611f20565b6117229190611f42565b90506000805b60148110156118755761173e62093a8084612054565b9150814210156117c7578315801561175557508442145b1561178f578560068466038d7ea4c68000811061177457611774611f61565b0160008282546117849190612054565b909155506118759050565b8361179a8642611f90565b6117a49088611f42565b6117ae9190611f20565b60068466038d7ea4c68000811061177457611774611f61565b831580156117d457508482145b1561180e578560068466038d7ea4c6800081106117f3576117f3611f61565b0160008282546118039190612054565b9091555061185c9050565b836118198684611f90565b6118239088611f42565b61182d9190611f20565b60068466038d7ea4c68000811061184657611846611f61565b0160008282546118569190612054565b90915550505b819450819250808061186d9061206c565b915050611728565b5060408051428152602081018790527fce749457b74e10f393f2c6b1ce4261b78791376db5a3f501477a809f03f500d6910160405180910390a1505050505050565b60405163391044d760e21b8152600481018490526000908190819081906001600160a01b0387169063e441135c90602401602060405180830381865afa158015611905573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119299190611f77565b6001549091506000829003611945576000945050505050611548565b6000888152600360205260408120549081900361196f57611968888a848661154f565b9450611981565b60008981526004602052604090205494505b8460000361198e57600194505b6040516309bb79ed60e11b8152600481018a9052602481018690526000906001600160a01b038a1690631376f3da90604401608060405180830381865afa1580156119dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a019190612085565b905081600003611a465762093a8080600162093a808460400151611a259190612054565b611a2f9190611f90565b611a399190611f20565b611a439190611f42565b91505b6005548210611a5e5760009650505050505050611548565b82821015611a6a578291505b6040805160808101825260008082526020820181905291810182905260608101829052905b6032811015611c455789841015611c455782604001518410158015611ab45750858811155b15611b7a57611ac4600189612054565b975082915085881115611b035760405180608001604052806000600f0b81526020016000600f0b81526020016000815260200160008152509250611c33565b6040516309bb79ed60e11b8152600481018d9052602481018990526001600160a01b038c1690631376f3da90604401608060405180830381865afa158015611b4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b739190612085565b9250611c33565b6000826040015185611b8c9190611f90565b90506000611ba384602001518361141491906120f7565b905080158015611bb25750878a115b15611bbe575050611c45565b8015611c215766038d7ea4c680078666038d7ea4c680008110611be357611be3611f61565b015460068766038d7ea4c680008110611bfe57611bfe611f61565b0154611c0a9083611f42565b611c149190611f20565b611c1e908a612054565b98505b611c2e62093a8087612054565b955050505b80611c3d8161206c565b915050611a8f565b50949a9950505050505050505050565b600080600090506000846001600160a01b031663900cf0cf6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cc09190611f77565b905060005b6080811015611da05781831015611da05760006002611ce48486612054565b611cef906002612054565b611cf99190611f20565b60405163d1febfb960e01b8152600481018290529091506000906001600160a01b0389169063d1febfb990602401608060405180830381865afa158015611d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d689190612085565b905086816040015111611d7d57819450611d8b565b611d88600183611f90565b93505b50508080611d989061206c565b915050611cc5565b5090949350505050565b60008183106116535781611548565b6001600160a01b0381168114611dce57600080fd5b50565b600060208284031215611de357600080fd5b813561154881611db9565b600060208284031215611e0057600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611e4657611e46611e07565b604052919050565b60006020808385031215611e6157600080fd5b823567ffffffffffffffff80821115611e7957600080fd5b818501915085601f830112611e8d57600080fd5b813581811115611e9f57611e9f611e07565b8060051b9150611eb0848301611e1d565b8181529183018401918481019088841115611eca57600080fd5b938501935b83851015610de757843582529385019390850190611ecf565b60008060408385031215611efb57600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b600082611f3d57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f5c57611f5c611f0a565b500290565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611f8957600080fd5b5051919050565b600082821015611fa257611fa2611f0a565b500390565b8051600f81900b8114611fb957600080fd5b919050565b600060408284031215611fd057600080fd5b6040516040810181811067ffffffffffffffff82111715611ff357611ff3611e07565b604052611fff83611fa7565b8152602083015160208201528091505092915050565b60006020828403121561202757600080fd5b815161154881611db9565b60006020828403121561204457600080fd5b8151801515811461154857600080fd5b6000821982111561206757612067611f0a565b500190565b60006001820161207e5761207e611f0a565b5060010190565b60006080828403121561209757600080fd5b6040516080810181811067ffffffffffffffff821117156120ba576120ba611e07565b6040526120c683611fa7565b81526120d460208401611fa7565b602082015260408301516040820152606083015160608201528091505092915050565b600081600f0b83600f0b60016001607f1b0360008213600084138383048511828216161561212757612127611f0a565b6f7fffffffffffffffffffffffffffffff19600085128281168783058712161561215357612153611f0a565b6000871292508582058712848416161561216f5761216f611f0a565b8585058712818416161561218557612185611f0a565b5050509290910295945050505050565b600081600f0b83600f0b600081128160016001607f1b0319018312811516156121c0576121c0611f0a565b8160016001607f1b030183138116156121db576121db611f0a565b5090039392505050565b634e487b7160e01b600052600160045260246000fdfea264697066735822122006c2487562a8890b7487e803ebbd8007a60163a86ea8fd9bdbd763a638187ceb64736f6c634300080d0033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.