Source Code
Latest 25 from a total of 10,404 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Claim_many | 25436210 | 1 hr ago | IN | 0 HYPE | 0.00007036 | ||||
| Claim_many | 25432692 | 2 hrs ago | IN | 0 HYPE | 0.00027552 | ||||
| Claim_many | 25430916 | 2 hrs ago | IN | 0 HYPE | 0.00067312 | ||||
| Claim_many | 25429988 | 2 hrs ago | IN | 0 HYPE | 0.00009392 | ||||
| Claim_many | 25429744 | 2 hrs ago | IN | 0 HYPE | 0.0037165 | ||||
| Claim_many | 25428906 | 3 hrs ago | IN | 0 HYPE | 0.00048596 | ||||
| Claim_many | 25428260 | 3 hrs ago | IN | 0 HYPE | 0.00009089 | ||||
| Claim_many | 25427570 | 3 hrs ago | IN | 0 HYPE | 0.00011978 | ||||
| Claim_many | 25427502 | 3 hrs ago | IN | 0 HYPE | 0.01792232 | ||||
| Claim_many | 25427477 | 3 hrs ago | IN | 0 HYPE | 0.0002782 | ||||
| Claim_many | 25426389 | 3 hrs ago | IN | 0 HYPE | 0.00557064 | ||||
| Claim_many | 25426349 | 3 hrs ago | IN | 0 HYPE | 0.00008226 | ||||
| Claim_many | 25423629 | 4 hrs ago | IN | 0 HYPE | 0.00008691 | ||||
| Claim_many | 25423025 | 4 hrs ago | IN | 0 HYPE | 0.00316008 | ||||
| Claim_many | 25421387 | 5 hrs ago | IN | 0 HYPE | 0.00090352 | ||||
| Claim_many | 25420344 | 5 hrs ago | IN | 0 HYPE | 0.00009648 | ||||
| Claim_many | 25419697 | 5 hrs ago | IN | 0 HYPE | 0.00017805 | ||||
| Claim_many | 25418827 | 5 hrs ago | IN | 0 HYPE | 0.00014213 | ||||
| Claim_many | 25418465 | 5 hrs ago | IN | 0 HYPE | 0.00029395 | ||||
| Claim_many | 25418448 | 5 hrs ago | IN | 0 HYPE | 0.00007053 | ||||
| Claim_many | 25416919 | 6 hrs ago | IN | 0 HYPE | 0.00006982 | ||||
| Claim_many | 25415893 | 6 hrs ago | IN | 0 HYPE | 0.00012891 | ||||
| Claim_many | 25415614 | 6 hrs ago | IN | 0 HYPE | 0.00008138 | ||||
| Claim_many | 25414635 | 7 hrs ago | IN | 0 HYPE | 0.00013924 | ||||
| Claim_many | 25414106 | 7 hrs ago | IN | 0 HYPE | 0.00415161 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
RewardsDistributor
Compiler Version
v0.8.13+commit.abaa5c0e
Optimization Enabled:
Yes with 200 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.13;
import './libraries/Math.sol';
import './interfaces/IRewardsDistributor.sol';
import './interfaces/IVotingEscrow.sol';
import {HybraTimeLibrary} from "./libraries/HybraTimeLibrary.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
/*
@title Curve Fee Distribution modified for ve(3,3) emissions
@author Curve Finance, andrecronje
@license MIT
*/
contract RewardsDistributor is IRewardsDistributor {
using SafeERC20 for IERC20;
event CheckpointToken(
uint time,
uint tokens
);
event Claimed(
uint tokenId,
uint amount,
uint claim_epoch,
uint max_epoch
);
uint256 public WEEK;
uint public start_time;
uint public time_cursor;
mapping(uint => uint) public time_cursor_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 depositor;
constructor(address _voting_escrow) {
WEEK = HybraTimeLibrary.WEEK;
uint _t = block.timestamp / WEEK * WEEK;
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;
owner = msg.sender;
require(IERC20(_token).approve(_voting_escrow, type(uint).max), "approval failed");
}
modifier onlyOwner {
require(msg.sender == owner, 'not owner');
_;
}
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_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 _claim(uint _tokenId, address ve, uint _last_token_time) internal returns (uint) {
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) {
IVotingEscrow.Point memory user_point = IVotingEscrow(ve).user_point_history(_tokenId, 1);
week_cursor = user_point.ts / WEEK * WEEK;
}
if (week_cursor >= last_token_time) return 0;
if (week_cursor < _start_time) week_cursor = _start_time;
uint supply;
for (uint i = 0; i < 50; i++) {
if (week_cursor >= _last_token_time) break;
uint balance_of = IVotingEscrow(ve).balanceOfNFTAt(_tokenId, week_cursor + WEEK - 1);
supply = IVotingEscrow(ve).totalSupplyAtT(week_cursor + WEEK - 1);
supply = supply == 0 ? 1 : supply;
to_distribute += balance_of * tokens_per_week[week_cursor] / supply;
week_cursor += WEEK;
}
time_cursor_of[_tokenId] = week_cursor;
emit Claimed(_tokenId, to_distribute, week_cursor, max_user_epoch);
return to_distribute;
}
function _claimable(uint _tokenId, address ve, uint _last_token_time) internal view returns (uint) {
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) {
IVotingEscrow.Point memory user_point = IVotingEscrow(ve).user_point_history(_tokenId, 1);
week_cursor = user_point.ts / WEEK * WEEK;
}
if (week_cursor >= last_token_time) return 0;
if (week_cursor < _start_time) week_cursor = _start_time;
uint supply;
for (uint i = 0; i < 50; i++) {
if (week_cursor >= _last_token_time) break;
uint balance_of = IVotingEscrow(ve).balanceOfNFTAt(_tokenId, week_cursor + WEEK - 1);
supply = IVotingEscrow(ve).totalSupplyAtT(week_cursor + WEEK - 1);
supply = supply == 0 ? 1 : supply;
to_distribute += balance_of * tokens_per_week[week_cursor] / supply;
week_cursor += WEEK;
}
return to_distribute;
}
function claimable(uint _tokenId) external view returns (uint) {
uint _last_token_time = last_token_time / WEEK * WEEK;
return _claimable(_tokenId, voting_escrow, _last_token_time);
}
function claim(uint256 _tokenId) external returns (uint256) {
uint _last_token_time = last_token_time;
_last_token_time = _last_token_time / WEEK * WEEK;
uint amount = _claim(_tokenId, voting_escrow, _last_token_time);
if (amount != 0) {
// if locked.end then send directly
IVotingEscrow.LockedBalance memory _locked = IVotingEscrow(voting_escrow).locked(_tokenId);
// If lock has expired and is not permanent, transfer tokens directly
if (_locked.end < block.timestamp && !_locked.isPermanent) {
address _nftOwner = IVotingEscrow(voting_escrow).ownerOf(_tokenId);
IERC20(token).safeTransfer(_nftOwner, amount);
} else {
IVotingEscrow(voting_escrow).deposit_for(_tokenId, amount);
}
token_last_balance -= amount;
}
return amount;
}
function claim_many(uint[] memory _tokenIds) external returns (bool) {
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);
if (amount != 0) {
// if locked.end then send directly
IVotingEscrow.LockedBalance memory _locked = IVotingEscrow(_voting_escrow).locked(_tokenId);
if(_locked.end < block.timestamp && !_locked.isPermanent){
address _nftOwner = IVotingEscrow(_voting_escrow).ownerOf(_tokenId);
IERC20(token).safeTransfer(_nftOwner, amount);
} else {
IVotingEscrow(_voting_escrow).deposit_for(_tokenId, amount);
}
total += amount;
}
}
if (total != 0) {
token_last_balance -= total;
}
return true;
}
function setDepositor(address _depositor) external {
require(msg.sender == owner);
depositor = _depositor;
}
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).safeTransfer(msg.sender, _balance);
}
}// 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;
}}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
interface IRewardsDistributor {
function checkpoint_token() external;
function voting_escrow() external view returns(address);
function claimable(uint _tokenId) external view returns (uint);
function claim(uint _tokenId) external returns (uint);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
interface IVotingEscrow {
struct Point {
int128 bias;
int128 slope; // # -dweight / dt
uint256 ts;
uint256 blk; // block
uint256 permanent;
}
struct LockedBalance {
int128 amount;
uint end;
bool isPermanent;
}
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 permanentLockBalance() external view returns (uint256);
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 approve(address _approved, uint _tokenId) external;
function checkpoint() external;
function deposit_for(uint tokenId, uint value) external;
function balanceOfNFT(uint _id) external view returns (uint);
function balanceOfNFTAt(uint _tokenId, uint _t) external view returns (uint);
function balanceOf(address _owner) external view returns (uint);
function totalSupply() external view returns (uint);
function totalSupplyAtT(uint256 _t) external view returns (uint);
function supply() external view returns (uint);
function avm() external view returns (address);
function decimals() external view returns(uint8);
function lockPermanent(uint _tokenId) external;
function unlockPermanent(uint _tokenId) external;
function increase_unlock_time(uint _tokenId, uint _lock_duration) external;
function multiSplit(uint _tokenId, uint[] memory _amounts) external returns (uint[] memory);
function safeTransferFrom(address _from, address _to, uint _tokenId) external;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
library HybraTimeLibrary {
// for testnet
uint256 internal constant WEEK = 1 weeks;
uint internal constant NO_VOTING_WINDOW = 3600;
uint256 internal constant MAX_LOCK_DURATION = 86400 * 365 * 2;
uint256 internal constant GENESIS_STAKING_MATURITY_TIME = 2 * 86400;
uint256 internal constant NO_GENESIS_DEPOSIT_WINDOW = 600;
// uint256 internal constant WEEK = 7 * 86400;
// uint internal constant NO_VOTING_WINDOW = 3600;
// uint256 internal constant MAX_LOCK_DURATION = 86400 * 365 * 4;
// uint256 internal constant GENESIS_STAKING_MATURITY_TIME = 180 * 86400;
// uint256 internal constant NO_GENESIS_DEPOSIT_WINDOW = 3 * 3600;
/// @dev Returns start of epoch based on current timestamp
function epochStart(uint256 timestamp) internal pure returns (uint256) {
unchecked {
return timestamp - (timestamp % WEEK);
}
}
/// @dev Returns start of next epoch / end of current epoch
function epochNext(uint256 timestamp) internal pure returns (uint256) {
unchecked {
return timestamp - (timestamp % WEEK) + WEEK;
}
}
/// @dev Returns start of voting window
function epochVoteStart(uint256 timestamp) internal pure returns (uint256) {
unchecked {
return timestamp - (timestamp % WEEK) + NO_VOTING_WINDOW;
}
}
/// @dev Returns end of voting window / beginning of unrestricted voting window
function epochVoteEnd(uint256 timestamp) internal pure returns (uint256) {
unchecked {
return timestamp - (timestamp % WEEK) + WEEK - NO_VOTING_WINDOW;
}
}
/// @dev Returns the status if it is the last hour of the epoch
function isLastHour(uint256 timestamp) internal pure returns (bool) {
// return block.timestamp % 7 days >= 6 days + 23 hours;
return timestamp >= HybraTimeLibrary.epochVoteEnd(timestamp)
&& timestamp < HybraTimeLibrary.epochNext(timestamp);
}
/// @dev Returns duration in multiples of epoch
function epochMultiples(uint256 duration) internal pure returns (uint256) {
unchecked {
return (duration / WEEK) * WEEK;
}
}
/// @dev Returns duration in multiples of epoch
function isLastEpoch(uint256 timestamp, uint256 endTime) internal pure returns (bool) {
unchecked {
return endTime - WEEK <= timestamp && timestamp < endTime;
}
}
/// @dev Returns duration in multiples of epoch
function prevPreEpoch(uint256 timestamp) internal pure returns (uint256) {
unchecked {
return epochStart(timestamp) - NO_GENESIS_DEPOSIT_WINDOW;
}
}
/// @dev Returns duration in multiples of epoch
function currPreEpoch(uint256 timestamp) internal pure returns (uint256) {
unchecked {
return epochNext(timestamp) - NO_GENESIS_DEPOSIT_WINDOW;
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (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. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
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));
}
}// 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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (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.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
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].
*
* CAUTION: See Security Considerations above.
*/
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);
}// 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);
}
}
}{
"remappings": [
"@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/",
"@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/",
"@cryptoalgebra/integral-core/=node_modules/@cryptoalgebra/integral-core/",
"@cryptoalgebra/integral-periphery/=node_modules/@cryptoalgebra/integral-periphery/",
"@cryptoalgebra/integral-base-plugin/=node_modules/@cryptoalgebra/integral-base-plugin/",
"@cryptoalgebra/integral-farming/=node_modules/@cryptoalgebra/integral-farming/",
"@ensdomains/=node_modules/@ensdomains/",
"@ethereum-waffle/=node_modules/@ethereum-waffle/",
"@uniswap/=node_modules/@uniswap/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
"hardhat/=node_modules/hardhat/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs"
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "london",
"viaIR": true
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"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":"WEEK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"checkpoint_token","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":[],"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":"ve_supply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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
6080806040523462000215576200015c620000386200017b9262001c4c80380380916200002d82856200021a565b833981019062000254565b6200004562093a80600055565b6200007b620000626000546200005c814262000275565b62000296565b6200006c81600155565b6200007681600455565b600255565b604051637e062a3560e11b81526020926001600160a01b039284929083826004818489165afa91821562000205575b600092620001cf575b5066071afd498d000880546001600160a01b0319166001600160a01b03841617905566071afd498d000780546001600160a01b0319166001600160a01b03831617905566071afd498d000980546001600160a01b0319163317905566071afd498d000680546001600160a01b0319163317905560405163095ea7b360e01b81526001600160a01b0390911660048201526000196024820152938492839160009183906044820190565b0393165af1918215620001bf575b6000926200018b575b5050620002e7565b6040516119259081620003278239f35b620001af9250803d10620001b7575b620001a681836200021a565b810190620002cd565b388062000173565b503d6200019a565b620001c9620002c0565b6200016a565b620001f5919250843d8611620001fd575b620001ec81836200021a565b81019062000254565b9038620000b3565b503d620001e0565b6200020f620002c0565b620000aa565b600080fd5b601f909101601f19168101906001600160401b038211908210176200023e57604052565b634e487b7160e01b600052604160045260246000fd5b908160209103126200021557516001600160a01b0381168103620002155790565b811562000280570490565b634e487b7160e01b600052601260045260246000fd5b8060001904821181151516620002aa570290565b634e487b7160e01b600052601160045260246000fd5b506040513d6000823e3d90fd5b908160209103126200021557518015158103620002155790565b15620002ef57565b60405162461bcd60e51b815260206004820152600f60248201526e185c1c1c9bdd985b0819985a5b1959608a1b6044820152606490fdfe60806040526004361015610013575b600080fd5b60003560e01c8063127dcbd3146101a357806313af40351461019a5780631f1db0431461019157806322b04bfc14610188578063379607f51461017f578063486d25fe146101765780637f58e8f81461016d578063811a40fe14610164578063834ee4171461015b5780638da5cb5b14610152578063b80777ea14610149578063c7c4ff4614610140578063d1d58b2514610137578063d4dafba81461012e578063dfe0503114610125578063edf599971461011c578063f2c098b714610113578063f4359ce51461010a578063f4f3b200146101015763fc0c546a146100f957600080fd5b61000e610be9565b5061000e610b2a565b5061000e610b0b565b5061000e610ab6565b5061000e610a83565b5061000e610a53565b5061000e610a1a565b5061000e610999565b5061000e610969565b5061000e61093d565b5061000e61090d565b5061000e6108ee565b5061000e610644565b5061000e610625565b5061000e6105f8565b5061000e61039c565b5061000e610377565b5061000e6102c8565b5061000e6101e7565b5061000e6101b7565b600091031261000e57565b503461000e57600036600319011261000e576020600254604051908152f35b6001600160a01b0381160361000e57565b503461000e57602036600319011261000e57600435610205816101d6565b66071afd498d0006805490916001600160a01b0390818316330361000e576001600160a01b03199092169116179055005b50634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff811161026157604052565b610269610236565b604052565b6080810190811067ffffffffffffffff82111761026157604052565b6040810190811067ffffffffffffffff82111761026157604052565b90601f8019910116810190811067ffffffffffffffff82111761026157604052565b503461000e5760208060031936011261000e5767ffffffffffffffff60043581811161000e573660238201121561000e57806004013591821161036a575b8160051b6040519261031a858301856102a6565b83526024848401918301019136831161000e57602401905b82821061035b5761035761034585611426565b60405190151581529081906020820190565b0390f35b81358152908401908401610332565b610372610236565b610306565b503461000e57600036600319011261000e57602066038d7ea4c6800554604051908152f35b503461000e57602036600319011261000e57600435600454906103cc6000926103c784548092610c30565b610c50565b66071afd498d000780549092916103ec916001600160a01b0316836110c0565b91826103fe575b604051838152602090f35b805461042090610414906001600160a01b031681565b6001600160a01b031690565b604051635a2d1e0760e11b815260048101849052606081602481855afa9081156105eb575b86916105bd575b506020810151421190816105b0575b501561053d575054610357936104db9284926104a89160209161048890610414906001600160a01b031681565b60405180809581946331a9108f60e11b8352600483019190602083019252565b03915afa918215610530575b91610502575b5066071afd498d0008546104d6906001600160a01b0316610414565b611680565b6104fb6104f08266038d7ea4c6800554610ca8565b66038d7ea4c6800555565b38806103f3565b610523915060203d8111610529575b61051b81836102a6565b8101906110a8565b386104ba565b503d610511565b610538610c7e565b6104b4565b809291503b156105ac57604051631dd33fc560e31b81526004810191909152602481018390526103579390918290604490829084905af1801561059f575b610586575b506104db565b806105936105999261024d565b806101ac565b38610580565b6105a7610c7e565b61057b565b8380fd5b604001511590503861045b565b6105de915060603d81116105e4575b6105d681836102a6565b81019061104b565b3861044c565b503d6105cc565b6105f3610c7e565b610445565b503461000e57602036600319011261000e5760043560005260036020526020604060002054604051908152f35b503461000e57600036600319011261000e576020600454604051908152f35b503461000e576000806003193601126108eb5766071afd498d0009546001600160a01b031633036108d75766071afd498d00085461068c90610414906001600160a01b031681565b6040516370a0823160e01b815230600482015290602090829060249082905afa9081156108ca575b829161089c575b506106dd6106d166038d7ea4c680055483610ca8565b9166038d7ea4c6800555565b6004546106ea8142610ca8565b6106f342600455565b61070284546103c78185610c30565b91845b6014811061074e575b604080514281526020810187905287917fce749457b74e10f393f2c6b1ce4261b78791376db5a3f501477a809f03f500d69190819081015b0390a1604051f35b610759865485610cdb565b80421060001461082b5750509181610746937fce749457b74e10f393f2c6b1ce4261b78791376db5a3f501477a809f03f500d695931580610822575b156107e05750506107a86107d8916109f4565b6107bf846107ba8385549060031b1c90565b610cdb565b9082549060031b600019811b9283911b16911916179055565b91388061070e565b61080c61080661081d94936108016107fb6107bf9542610ca8565b88610c50565b610c30565b926109f4565b9190926107ba8385549060031b1c90565b6107d8565b50804214610795565b918390819592951580610893575b1561086d57505061084c61085e916109f4565b6107bf876107ba8385549060031b1c90565b6108688193610cbf565b610705565b61080c61080661088e94936108016108886107bf9589610ca8565b8b610c50565b61085e565b50808414610839565b6108bd915060203d81116108c3575b6108b581836102a6565b810190610c6f565b386106bb565b503d6108ab565b6108d2610c7e565b6106b4565b634e487b7160e01b81526001600452602490fd5b80fd5b503461000e57600036600319011261000e576020600154604051908152f35b503461000e57600036600319011261000e5766071afd498d0006546040516001600160a01b039091168152602090f35b503461000e57600036600319011261000e5760206109616000546103c78142610c30565b604051908152f35b503461000e57600036600319011261000e5766071afd498d0009546040516001600160a01b039091168152602090f35b503461000e57602036600319011261000e5760206109616109c36004546103c76000548092610c30565b66071afd498d0007546001600160a01b0316600435610d68565b50634e487b7160e01b600052603260045260246000fd5b66038d7ea4c68000811015610a0d575b60050190600090565b610a156109dd565b610a04565b503461000e57602036600319011261000e5760043566038d7ea4c6800081101561000e5760209066038d7ea4c680060154604051908152f35b503461000e57600036600319011261000e5766071afd498d0007546040516001600160a01b039091168152602090f35b503461000e57602036600319011261000e5760043566038d7ea4c6800081101561000e5760209060050154604051908152f35b503461000e57602036600319011261000e57600435610ad4816101d6565b66071afd498d0006546001600160a01b03908116330361000e5766071afd498d000980546001600160a01b03191691909216179055005b503461000e57600036600319011261000e576020600054604051908152f35b503461000e57602036600319011261000e57610bba600435610b4b816101d6565b66071afd498d000654610b7190610b6a906001600160a01b0316610414565b3314611679565b6001600160a01b0316610b85811515611679565b6040516370a0823160e01b815230600482015290602082602481845afa918215610bdc575b600092610bbc575b503390611680565b005b610bd591925060203d81116108c3576108b581836102a6565b9038610bb2565b610be4610c7e565b610baa565b503461000e57600036600319011261000e5766071afd498d0008546040516001600160a01b039091168152602090f35b50634e487b7160e01b600052601160045260246000fd5b8115610c3a570490565b634e487b7160e01b600052601260045260246000fd5b8060001904821181151516610c63570290565b610c6b610c19565b0290565b9081602091031261000e575190565b506040513d6000823e3d90fd5b60018110610c9b575b6000190190565b610ca3610c19565b610c94565b818110610cb3570390565b610cbb610c19565b0390565b6001906000198114610ccf570190565b610cd7610c19565b0190565b81198111610ccf570190565b519081600f0b820361000e57565b908160a091031261000e5760806040519160a0830183811067ffffffffffffffff821117610d5b575b604052610d2a81610ce7565b8352610d3860208201610ce7565b602084015260408101516040840152606081015160608401520151608082015290565b610d63610236565b610d1e565b60405163391044d760e21b81526004808201839052600094936001600160a01b0316602083602481845afa928315611031575b8693611010575b50600154921561100857610dc0846000526003602052604060002090565b54928315610f79575b8254841015610f7057808410610f68575b509085949294918654945b60328410610df8575b5050505050505090565b9091929394959685881015610f6257610eeb87610ee5610ef193610edf8c610801610e5c60208c8c8c610e33610e2e8c89610cdb565b610c8b565b60408051637028a55d60e11b815294850192835260208301919091529294859384928392910190565b03915afa908115610f55575b600091610f36575b50610ea660208d8d610e85610e2e8c89610cdb565b604051631c45b18360e21b8152928301908152919384928391829160200190565b03915afa908115610f29575b600091610f0a575b5080610efd5750610ed9610ecf6001946109f4565b90549060031b1c90565b90610c50565b90610cdb565b99610cdb565b94610cbf565b92919095949395610de5565b610ecf610ed991946109f4565b610f23915060203d6020116108c3576108b581836102a6565b38610eba565b610f31610c7e565b610eb2565b610f4f915060203d6020116108c3576108b581836102a6565b38610e70565b610f5d610c7e565b610e68565b96610dee565b925038610dda565b50505050505090565b604080516309bb79ed60e11b815284810187815260016020820152929550610fc79260a0908290819085010381875afa908115610ffb575b8991610fcd575b5001516103c788548092610c30565b92610dc9565b610fee915060a03d8111610ff4575b610fe681836102a6565b810190610cf5565b38610fb8565b503d610fdc565b611003610c7e565b610fb1565b505050505090565b61102a91935060203d6020116108c3576108b581836102a6565b9138610da2565b611039610c7e565b610d9b565b5190811515820361000e57565b9081606091031261000e5761109360408051926060840184811067ffffffffffffffff82111761109b575b825261108181610ce7565b8452602081015160208501520161103e565b604082015290565b6110a3610236565b611076565b9081602091031261000e57516110bd816101d6565b90565b6040805163391044d760e21b81526004808201849052600095939491936001600160a01b0390921692919060208086602481885afa9586156113f7575b88966113d8575b5060019081549587156113cc57611125896000526003602052604060002090565b5496871561134b575b845488101561133e57808810611336575b5093919089948a54945b603287106111bf575b505050505050508492826111b99286946111977fcae2990aa9af8eb1c64713b7eddb3a80bf18e49a94a13fe0d0002b5d61d58f00986000526003602052604060002090565b5551948594859094939260609260808301968352602083015260408201520152565b0390a190565b909192939495979a858c101561132f5761129d876112976112a3938f8f906108016112248f8c8e918d8d8b8885610edf9b6111fd610e2e8585610cdb565b8751637028a55d60e11b81528681019283526020830191909152998a918291604090910190565b0381875afa978815611322575b6000986112e0575b5093859361127593611256610e2e610ecf9995610ed99b99610cdb565b9251631c45b18360e21b81529081019283529384928391829160200190565b03915afa9182156112d3575b6000926112b6575b5050806112ae5750946109f4565b9d610cdb565b98610cbf565b959493929190611149565b9050946109f4565b6112cc9250803d106108c3576108b581836102a6565b8f80611289565b6112db610c7e565b611281565b610ed997959198509361127593611256610e2e8997956113108997610ecf9c3d8a116108c3576108b581836102a6565b9c95999b509550505093509395611239565b61132a610c7e565b611231565b9a97611152565b96503861113f565b5050505050505050505090565b86516309bb79ed60e11b81528581018b81526001602082015291985061139b9188919060a090829081906040010381875afa9081156113bf575b8d916113a1575b5001516103c78c548092610c30565b9661112e565b6113b9915060a03d8111610ff457610fe681836102a6565b3861138c565b6113c7610c7e565b611385565b50505050505050505090565b816113f09297503d88116108c3576108b581836102a6565b9438611104565b6113ff610c7e565b6110fd565b6020918151811015611419575b60051b010190565b6114216109dd565b611411565b60049182549261143e6000946103c786548092610c30565b66071afd498d0007546001600160a01b031692859291835b865181101561166c576114698188611404565b51801561163b578061147d84898c946110c0565b9081611495575b50505061149090610cbf565b611456565b60408051635a2d1e0760e11b815280890183815295999495939493606093926001600160a01b038d16928b928690829081906020010381875afa95861561162e575b899661160f575b5050602094818682015142119182611603575b50501561158f57848796956107ba9561155a99956114909b9561152b95518096819482936331a9108f60e11b845283019190602083019252565b03915afa928315611582575b92611565575b505066071afd498d0008546104d6906001600160a01b0316610414565b949050873880611484565b61157b9250803d106105295761051b81836102a6565b388061153d565b61158a610c7e565b611537565b96919594935050843b156108eb579451631dd33fc560e31b8152808901918252602082018490526114909561155a9591929091839182908490829060400103925af180156115f6575b6115e3575b50610cdb565b806105936115f09261024d565b386115dd565b6115fe610c7e565b6115d8565b015115905081386114f1565b611626929650803d106105e4576105d681836102a6565b9338806114de565b611636610c7e565b6114d7565b5050509450509150505b80611651575b50600190565b6104f06116669166038d7ea4c6800554610ca8565b3861164b565b5050945050915050611645565b1561000e57565b60405163a9059cbb60e01b60208083019182526001600160a01b03948516602484015260448084019690965294825261174594936117309360009182916116c68661026e565b1692604051946116d58661028a565b8786527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656488870152519082855af13d1561175f573d9161171483611767565b9261172260405194856102a6565b83523d60008785013e611851565b8051918215928315611747575b5050506117a6565b565b6117579350820181019101611792565b38808061173d565b606091611851565b60209067ffffffffffffffff8111611785575b601f01601f19160190565b61178d610236565b61177a565b9081602091031261000e576110bd9061103e565b156117ad57565b60405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b1561180c57565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b919290156118715750815115611865575090565b6110bd903b1515611805565b8251909150156118845750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251928360248401526000915b8483106118d65750509180604493116118c9575b601f01601f19168101030190fd5b60008382840101526118bb565b81830181015186840160440152859350918201916118a756fea2646970667358221220806de9479f42c20a581f3b78542f2d51956ae68db53adf8113eca261dfaaa62a64736f6c634300080d0033000000000000000000000000d7ed7792f71f3920dba01c544639fd546d87f4fd
Deployed Bytecode
0x60806040526004361015610013575b600080fd5b60003560e01c8063127dcbd3146101a357806313af40351461019a5780631f1db0431461019157806322b04bfc14610188578063379607f51461017f578063486d25fe146101765780637f58e8f81461016d578063811a40fe14610164578063834ee4171461015b5780638da5cb5b14610152578063b80777ea14610149578063c7c4ff4614610140578063d1d58b2514610137578063d4dafba81461012e578063dfe0503114610125578063edf599971461011c578063f2c098b714610113578063f4359ce51461010a578063f4f3b200146101015763fc0c546a146100f957600080fd5b61000e610be9565b5061000e610b2a565b5061000e610b0b565b5061000e610ab6565b5061000e610a83565b5061000e610a53565b5061000e610a1a565b5061000e610999565b5061000e610969565b5061000e61093d565b5061000e61090d565b5061000e6108ee565b5061000e610644565b5061000e610625565b5061000e6105f8565b5061000e61039c565b5061000e610377565b5061000e6102c8565b5061000e6101e7565b5061000e6101b7565b600091031261000e57565b503461000e57600036600319011261000e576020600254604051908152f35b6001600160a01b0381160361000e57565b503461000e57602036600319011261000e57600435610205816101d6565b66071afd498d0006805490916001600160a01b0390818316330361000e576001600160a01b03199092169116179055005b50634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff811161026157604052565b610269610236565b604052565b6080810190811067ffffffffffffffff82111761026157604052565b6040810190811067ffffffffffffffff82111761026157604052565b90601f8019910116810190811067ffffffffffffffff82111761026157604052565b503461000e5760208060031936011261000e5767ffffffffffffffff60043581811161000e573660238201121561000e57806004013591821161036a575b8160051b6040519261031a858301856102a6565b83526024848401918301019136831161000e57602401905b82821061035b5761035761034585611426565b60405190151581529081906020820190565b0390f35b81358152908401908401610332565b610372610236565b610306565b503461000e57600036600319011261000e57602066038d7ea4c6800554604051908152f35b503461000e57602036600319011261000e57600435600454906103cc6000926103c784548092610c30565b610c50565b66071afd498d000780549092916103ec916001600160a01b0316836110c0565b91826103fe575b604051838152602090f35b805461042090610414906001600160a01b031681565b6001600160a01b031690565b604051635a2d1e0760e11b815260048101849052606081602481855afa9081156105eb575b86916105bd575b506020810151421190816105b0575b501561053d575054610357936104db9284926104a89160209161048890610414906001600160a01b031681565b60405180809581946331a9108f60e11b8352600483019190602083019252565b03915afa918215610530575b91610502575b5066071afd498d0008546104d6906001600160a01b0316610414565b611680565b6104fb6104f08266038d7ea4c6800554610ca8565b66038d7ea4c6800555565b38806103f3565b610523915060203d8111610529575b61051b81836102a6565b8101906110a8565b386104ba565b503d610511565b610538610c7e565b6104b4565b809291503b156105ac57604051631dd33fc560e31b81526004810191909152602481018390526103579390918290604490829084905af1801561059f575b610586575b506104db565b806105936105999261024d565b806101ac565b38610580565b6105a7610c7e565b61057b565b8380fd5b604001511590503861045b565b6105de915060603d81116105e4575b6105d681836102a6565b81019061104b565b3861044c565b503d6105cc565b6105f3610c7e565b610445565b503461000e57602036600319011261000e5760043560005260036020526020604060002054604051908152f35b503461000e57600036600319011261000e576020600454604051908152f35b503461000e576000806003193601126108eb5766071afd498d0009546001600160a01b031633036108d75766071afd498d00085461068c90610414906001600160a01b031681565b6040516370a0823160e01b815230600482015290602090829060249082905afa9081156108ca575b829161089c575b506106dd6106d166038d7ea4c680055483610ca8565b9166038d7ea4c6800555565b6004546106ea8142610ca8565b6106f342600455565b61070284546103c78185610c30565b91845b6014811061074e575b604080514281526020810187905287917fce749457b74e10f393f2c6b1ce4261b78791376db5a3f501477a809f03f500d69190819081015b0390a1604051f35b610759865485610cdb565b80421060001461082b5750509181610746937fce749457b74e10f393f2c6b1ce4261b78791376db5a3f501477a809f03f500d695931580610822575b156107e05750506107a86107d8916109f4565b6107bf846107ba8385549060031b1c90565b610cdb565b9082549060031b600019811b9283911b16911916179055565b91388061070e565b61080c61080661081d94936108016107fb6107bf9542610ca8565b88610c50565b610c30565b926109f4565b9190926107ba8385549060031b1c90565b6107d8565b50804214610795565b918390819592951580610893575b1561086d57505061084c61085e916109f4565b6107bf876107ba8385549060031b1c90565b6108688193610cbf565b610705565b61080c61080661088e94936108016108886107bf9589610ca8565b8b610c50565b61085e565b50808414610839565b6108bd915060203d81116108c3575b6108b581836102a6565b810190610c6f565b386106bb565b503d6108ab565b6108d2610c7e565b6106b4565b634e487b7160e01b81526001600452602490fd5b80fd5b503461000e57600036600319011261000e576020600154604051908152f35b503461000e57600036600319011261000e5766071afd498d0006546040516001600160a01b039091168152602090f35b503461000e57600036600319011261000e5760206109616000546103c78142610c30565b604051908152f35b503461000e57600036600319011261000e5766071afd498d0009546040516001600160a01b039091168152602090f35b503461000e57602036600319011261000e5760206109616109c36004546103c76000548092610c30565b66071afd498d0007546001600160a01b0316600435610d68565b50634e487b7160e01b600052603260045260246000fd5b66038d7ea4c68000811015610a0d575b60050190600090565b610a156109dd565b610a04565b503461000e57602036600319011261000e5760043566038d7ea4c6800081101561000e5760209066038d7ea4c680060154604051908152f35b503461000e57600036600319011261000e5766071afd498d0007546040516001600160a01b039091168152602090f35b503461000e57602036600319011261000e5760043566038d7ea4c6800081101561000e5760209060050154604051908152f35b503461000e57602036600319011261000e57600435610ad4816101d6565b66071afd498d0006546001600160a01b03908116330361000e5766071afd498d000980546001600160a01b03191691909216179055005b503461000e57600036600319011261000e576020600054604051908152f35b503461000e57602036600319011261000e57610bba600435610b4b816101d6565b66071afd498d000654610b7190610b6a906001600160a01b0316610414565b3314611679565b6001600160a01b0316610b85811515611679565b6040516370a0823160e01b815230600482015290602082602481845afa918215610bdc575b600092610bbc575b503390611680565b005b610bd591925060203d81116108c3576108b581836102a6565b9038610bb2565b610be4610c7e565b610baa565b503461000e57600036600319011261000e5766071afd498d0008546040516001600160a01b039091168152602090f35b50634e487b7160e01b600052601160045260246000fd5b8115610c3a570490565b634e487b7160e01b600052601260045260246000fd5b8060001904821181151516610c63570290565b610c6b610c19565b0290565b9081602091031261000e575190565b506040513d6000823e3d90fd5b60018110610c9b575b6000190190565b610ca3610c19565b610c94565b818110610cb3570390565b610cbb610c19565b0390565b6001906000198114610ccf570190565b610cd7610c19565b0190565b81198111610ccf570190565b519081600f0b820361000e57565b908160a091031261000e5760806040519160a0830183811067ffffffffffffffff821117610d5b575b604052610d2a81610ce7565b8352610d3860208201610ce7565b602084015260408101516040840152606081015160608401520151608082015290565b610d63610236565b610d1e565b60405163391044d760e21b81526004808201839052600094936001600160a01b0316602083602481845afa928315611031575b8693611010575b50600154921561100857610dc0846000526003602052604060002090565b54928315610f79575b8254841015610f7057808410610f68575b509085949294918654945b60328410610df8575b5050505050505090565b9091929394959685881015610f6257610eeb87610ee5610ef193610edf8c610801610e5c60208c8c8c610e33610e2e8c89610cdb565b610c8b565b60408051637028a55d60e11b815294850192835260208301919091529294859384928392910190565b03915afa908115610f55575b600091610f36575b50610ea660208d8d610e85610e2e8c89610cdb565b604051631c45b18360e21b8152928301908152919384928391829160200190565b03915afa908115610f29575b600091610f0a575b5080610efd5750610ed9610ecf6001946109f4565b90549060031b1c90565b90610c50565b90610cdb565b99610cdb565b94610cbf565b92919095949395610de5565b610ecf610ed991946109f4565b610f23915060203d6020116108c3576108b581836102a6565b38610eba565b610f31610c7e565b610eb2565b610f4f915060203d6020116108c3576108b581836102a6565b38610e70565b610f5d610c7e565b610e68565b96610dee565b925038610dda565b50505050505090565b604080516309bb79ed60e11b815284810187815260016020820152929550610fc79260a0908290819085010381875afa908115610ffb575b8991610fcd575b5001516103c788548092610c30565b92610dc9565b610fee915060a03d8111610ff4575b610fe681836102a6565b810190610cf5565b38610fb8565b503d610fdc565b611003610c7e565b610fb1565b505050505090565b61102a91935060203d6020116108c3576108b581836102a6565b9138610da2565b611039610c7e565b610d9b565b5190811515820361000e57565b9081606091031261000e5761109360408051926060840184811067ffffffffffffffff82111761109b575b825261108181610ce7565b8452602081015160208501520161103e565b604082015290565b6110a3610236565b611076565b9081602091031261000e57516110bd816101d6565b90565b6040805163391044d760e21b81526004808201849052600095939491936001600160a01b0390921692919060208086602481885afa9586156113f7575b88966113d8575b5060019081549587156113cc57611125896000526003602052604060002090565b5496871561134b575b845488101561133e57808810611336575b5093919089948a54945b603287106111bf575b505050505050508492826111b99286946111977fcae2990aa9af8eb1c64713b7eddb3a80bf18e49a94a13fe0d0002b5d61d58f00986000526003602052604060002090565b5551948594859094939260609260808301968352602083015260408201520152565b0390a190565b909192939495979a858c101561132f5761129d876112976112a3938f8f906108016112248f8c8e918d8d8b8885610edf9b6111fd610e2e8585610cdb565b8751637028a55d60e11b81528681019283526020830191909152998a918291604090910190565b0381875afa978815611322575b6000986112e0575b5093859361127593611256610e2e610ecf9995610ed99b99610cdb565b9251631c45b18360e21b81529081019283529384928391829160200190565b03915afa9182156112d3575b6000926112b6575b5050806112ae5750946109f4565b9d610cdb565b98610cbf565b959493929190611149565b9050946109f4565b6112cc9250803d106108c3576108b581836102a6565b8f80611289565b6112db610c7e565b611281565b610ed997959198509361127593611256610e2e8997956113108997610ecf9c3d8a116108c3576108b581836102a6565b9c95999b509550505093509395611239565b61132a610c7e565b611231565b9a97611152565b96503861113f565b5050505050505050505090565b86516309bb79ed60e11b81528581018b81526001602082015291985061139b9188919060a090829081906040010381875afa9081156113bf575b8d916113a1575b5001516103c78c548092610c30565b9661112e565b6113b9915060a03d8111610ff457610fe681836102a6565b3861138c565b6113c7610c7e565b611385565b50505050505050505090565b816113f09297503d88116108c3576108b581836102a6565b9438611104565b6113ff610c7e565b6110fd565b6020918151811015611419575b60051b010190565b6114216109dd565b611411565b60049182549261143e6000946103c786548092610c30565b66071afd498d0007546001600160a01b031692859291835b865181101561166c576114698188611404565b51801561163b578061147d84898c946110c0565b9081611495575b50505061149090610cbf565b611456565b60408051635a2d1e0760e11b815280890183815295999495939493606093926001600160a01b038d16928b928690829081906020010381875afa95861561162e575b899661160f575b5050602094818682015142119182611603575b50501561158f57848796956107ba9561155a99956114909b9561152b95518096819482936331a9108f60e11b845283019190602083019252565b03915afa928315611582575b92611565575b505066071afd498d0008546104d6906001600160a01b0316610414565b949050873880611484565b61157b9250803d106105295761051b81836102a6565b388061153d565b61158a610c7e565b611537565b96919594935050843b156108eb579451631dd33fc560e31b8152808901918252602082018490526114909561155a9591929091839182908490829060400103925af180156115f6575b6115e3575b50610cdb565b806105936115f09261024d565b386115dd565b6115fe610c7e565b6115d8565b015115905081386114f1565b611626929650803d106105e4576105d681836102a6565b9338806114de565b611636610c7e565b6114d7565b5050509450509150505b80611651575b50600190565b6104f06116669166038d7ea4c6800554610ca8565b3861164b565b5050945050915050611645565b1561000e57565b60405163a9059cbb60e01b60208083019182526001600160a01b03948516602484015260448084019690965294825261174594936117309360009182916116c68661026e565b1692604051946116d58661028a565b8786527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656488870152519082855af13d1561175f573d9161171483611767565b9261172260405194856102a6565b83523d60008785013e611851565b8051918215928315611747575b5050506117a6565b565b6117579350820181019101611792565b38808061173d565b606091611851565b60209067ffffffffffffffff8111611785575b601f01601f19160190565b61178d610236565b61177a565b9081602091031261000e576110bd9061103e565b156117ad57565b60405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b1561180c57565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b919290156118715750815115611865575090565b6110bd903b1515611805565b8251909150156118845750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251928360248401526000915b8483106118d65750509180604493116118c9575b601f01601f19168101030190fd5b60008382840101526118bb565b81830181015186840160440152859350918201916118a756fea2646970667358221220806de9479f42c20a581f3b78542f2d51956ae68db53adf8113eca261dfaaa62a64736f6c634300080d0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000d7ed7792f71f3920dba01c544639fd546d87f4fd
-----Decoded View---------------
Arg [0] : _voting_escrow (address): 0xD7Ed7792f71F3920DbA01c544639FD546d87f4fD
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000d7ed7792f71f3920dba01c544639fd546d87f4fd
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in HYPE
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
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.