Source Code
Latest 25 from a total of 3,048 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Claim Usdc | 147847398 | 1 hr ago | IN | 0 ETH | 0.000000019369 | ||||
| Claim Usdc | 147840804 | 4 hrs ago | IN | 0 ETH | 0.000000019066 | ||||
| Claim Usdc | 147839423 | 5 hrs ago | IN | 0 ETH | 0.00000000886 | ||||
| Claim Usdc | 147838058 | 6 hrs ago | IN | 0 ETH | 0.000000018771 | ||||
| Claim Usdc | 147835158 | 7 hrs ago | IN | 0 ETH | 0.000000007218 | ||||
| Claim Usdc | 147833127 | 9 hrs ago | IN | 0 ETH | 0.000000079626 | ||||
| Claim Usdc | 147826875 | 12 hrs ago | IN | 0 ETH | 0.000000004164 | ||||
| Claim Usdc | 147825280 | 13 hrs ago | IN | 0 ETH | 0.000000020715 | ||||
| Claim Usdc | 147822012 | 15 hrs ago | IN | 0 ETH | 0.000000019742 | ||||
| Claim Usdc | 147821817 | 15 hrs ago | IN | 0 ETH | 0.000000017781 | ||||
| Claim Usdc | 147820288 | 16 hrs ago | IN | 0 ETH | 0.000000002131 | ||||
| Claim Usdc | 147818478 | 17 hrs ago | IN | 0 ETH | 0.000000003081 | ||||
| Claim Usdc | 147816853 | 18 hrs ago | IN | 0 ETH | 0.000000019144 | ||||
| Claim Usdc | 147813739 | 19 hrs ago | IN | 0 ETH | 0.000000017685 | ||||
| Claim Usdc | 147812264 | 20 hrs ago | IN | 0 ETH | 0.000000000516 | ||||
| Claim Usdc | 147811378 | 21 hrs ago | IN | 0 ETH | 0.000000017916 | ||||
| Claim Usdc | 147810569 | 21 hrs ago | IN | 0 ETH | 0.000000019401 | ||||
| Claim Usdc | 147806326 | 23 hrs ago | IN | 0 ETH | 0.000008654881 | ||||
| Claim Usdc | 147805482 | 24 hrs ago | IN | 0 ETH | 0.000000008406 | ||||
| Claim Usdc | 147803527 | 25 hrs ago | IN | 0 ETH | 0.000000004682 | ||||
| Claim Usdc | 147795813 | 29 hrs ago | IN | 0 ETH | 0.000000079997 | ||||
| Claim Usdc | 147786000 | 35 hrs ago | IN | 0 ETH | 0.000000007888 | ||||
| Claim Usdc | 147785704 | 35 hrs ago | IN | 0 ETH | 0.000000009285 | ||||
| Claim Usdc | 147785314 | 35 hrs ago | IN | 0 ETH | 0.000000010169 | ||||
| Claim Usdc | 147785127 | 35 hrs ago | IN | 0 ETH | 0.000000009325 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
VeDistributor
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 20000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import { Ownable2Step } from "@openzeppelin/contracts/access/Ownable2Step.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { Pausable } from "@openzeppelin/contracts/utils/Pausable.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { IVeDistributor } from "./interfaces/IVeDistributor.sol";
import { IVotingEscrow } from "./interfaces/IVotingEscrow.sol";
/**
* @title VeDistributor
* @author LayerZero Labs (tinom.eth)
* @notice Minimal per-chain USDC distributor based on voting escrow balances at a given
* snapshot block.
*/
contract VeDistributor is IVeDistributor, Ownable2Step, Pausable {
using SafeERC20 for IERC20;
IERC20 public immutable USDC;
IVotingEscrow public immutable VE;
/// @dev Chain-specific `block.number` at snapshot timestamp (1754842920).
uint256 public immutable CHAIN_SNAPSHOT_BLOCK;
/// @dev Chain-specific `VE.totalSupplyAt(CHAIN_SNAPSHOT_BLOCK)`.
uint256 public immutable CHAIN_TOTAL_VE;
/// @dev Total USDC distributed in the chain so far.
uint256 public usdcDistributedAmount;
mapping(address user => uint256 claimedAmount) public userClaimedAmounts;
mapping(address user => uint256 cachedVeBalance) internal _cachedVeBalances;
constructor(address _usdc, address _ve, uint256 _snapshotBlock, address _owner) Ownable(_owner) {
if (_usdc == address(0) || _ve == address(0)) revert ZeroAddress();
USDC = IERC20(_usdc);
VE = IVotingEscrow(_ve);
CHAIN_SNAPSHOT_BLOCK = _snapshotBlock;
/// @dev Reverts if block was mined before `VE` deployment, or is in the future.
CHAIN_TOTAL_VE = VE.totalSupplyAt(CHAIN_SNAPSHOT_BLOCK);
/// @dev It could happen if `CHAIN_SNAPSHOT_BLOCK` is first `VE` epoch.
if (CHAIN_TOTAL_VE == 0) revert InvalidSnapshotBlock();
}
/**
* @notice Pause the contract.
* @dev Only callable by owner.
*/
function pause() public onlyOwner {
_pause();
}
/**
* @notice Unpause the contract.
* @dev Only callable by owner.
*/
function unpause() public onlyOwner {
_unpause();
}
/**
* @notice Emergency withdraw any ERC20 token from the contract.
* @dev Only callable by owner.
* @dev In the event of an emergency withdrawal of USDC, it should not be topped
* back up via `distribute`, as it would increment `usdcDistributedAmount`.
* It would have to be sent back through a normal `USDC.transfer`.
* @param _token Address of the token to withdraw
* @param _amount Amount of tokens to withdraw
* @param _to Address to send the withdrawn tokens to
*/
function emergencyWithdraw(address _token, uint256 _amount, address _to) public onlyOwner {
IERC20(_token).safeTransfer(_to, _amount);
emit EmergencyWithdrawn(_token, _to, _amount);
}
/**
* @notice Distribute USDC to the contract, instantly available to be claimed.
* @dev Only callable by owner.
* @dev Must approve the contract to transfer USDC first.
* @param _usdcAmount Amount of USDC to distribute
*/
function distribute(uint256 _usdcAmount) public onlyOwner {
/// @dev `usdcDistributedAmount` is monotonic, so irregular USDC transfers
/// (emergency withdrawals and raw USDC transfers) must be balanced
/// accordingly.
usdcDistributedAmount += _usdcAmount;
USDC.safeTransferFrom(msg.sender, address(this), _usdcAmount);
emit Distributed(_usdcAmount);
}
/**
* @notice Get the current claimable USDC amount for a user.
* @param _user Address of the user
* @return usdcClaimable Amount of USDC claimable by the user
*/
function getUsdcClaimable(address _user) public view returns (uint256 usdcClaimable) {
uint256 veBalance = VE.balanceOfAt(_user, CHAIN_SNAPSHOT_BLOCK);
return _calculateUsdcClaimable(_user, veBalance);
}
/**
* @notice Withdraw all claimable USDC to the sender.
* @return usdcClaimed Amount of USDC claimed
*/
function claimUsdc() public whenNotPaused returns (uint256 usdcClaimed) {
uint256 veBalance = _getAndCacheVeBalance(msg.sender);
uint256 usdcClaimable = _calculateUsdcClaimable(msg.sender, veBalance);
if (usdcClaimable == 0) revert NothingToClaim();
userClaimedAmounts[msg.sender] += usdcClaimable;
USDC.safeTransfer(msg.sender, usdcClaimable);
emit Claimed(msg.sender, usdcClaimable);
return usdcClaimable;
}
/**
* @notice Calculate the claimable USDC amount for a user.
* @param _user Address of the user
* @param _veBalance VE balance of the user at the snapshot block
*/
function _calculateUsdcClaimable(address _user, uint256 _veBalance) internal view returns (uint256 usdcClaimable) {
uint256 usdcClaimed = userClaimedAmounts[_user];
/// @dev VE max total supply at snapshot block in one chain is `9.148e24`.
/// It will never overflow when `usdcDistributedAmount < 1e52`.
return ((usdcDistributedAmount * _veBalance) / CHAIN_TOTAL_VE) - usdcClaimed;
}
/**
* @notice Get the VE balance of a user at the snapshot blocks.
* @dev Checks cache and, on miss, fetches it from the contract and stores it.
* @param _user Address of the user
* @return veBalance Amount of VE tokens held by the user at the snapshot block
*/
function _getAndCacheVeBalance(address _user) internal returns (uint256 veBalance) {
veBalance = _cachedVeBalances[_user];
/// @dev No need to use zero sentinel, this function is only called on claims,
/// and claims will revert if the VE balance is zero.
if (veBalance == 0) {
veBalance = VE.balanceOfAt(_user, CHAIN_SNAPSHOT_BLOCK);
_cachedVeBalances[_user] = veBalance;
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (access/Ownable2Step.sol)
pragma solidity ^0.8.20;
import {Ownable} from "./Ownable.sol";
/**
* @dev Contract module which provides access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This extension of the {Ownable} contract includes a two-step mechanism to transfer
* ownership, where the new owner must call {acceptOwnership} in order to replace the
* old one. This can help prevent common mistakes, such as transfers of ownership to
* incorrect accounts, or to contracts that are unable to interact with the
* permission system.
*
* The initial owner is specified at deployment time in the constructor for `Ownable`. This
* can later be changed with {transferOwnership} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2Step is Ownable {
address private _pendingOwner;
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*
* Setting `newOwner` to the zero address is allowed; this can be used to cancel an initiated ownership transfer.
*/
function transferOwnership(address newOwner) public virtual override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() public virtual {
address sender = _msgSender();
if (pendingOwner() != sender) {
revert OwnableUnauthorizedAccount(sender);
}
_transferOwnership(sender);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (utils/Pausable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
bool private _paused;
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
/**
* @dev The operation failed because the contract is paused.
*/
error EnforcedPause();
/**
* @dev The operation failed because the contract is not paused.
*/
error ExpectedPause();
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
if (paused()) {
revert EnforcedPause();
}
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
if (!paused()) {
revert ExpectedPause();
}
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 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 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @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.encodeCall(token.transfer, (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.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transferFrom, (from, to, 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.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @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.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @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 {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
// bubble errors
if iszero(success) {
let ptr := mload(0x40)
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
returnSize := returndatasize()
returnValue := mload(0)
}
if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @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 silently catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
bool success;
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
returnSize := returndatasize()
returnValue := mload(0)
}
return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
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 value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` 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 value) external returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { IVotingEscrow } from "./IVotingEscrow.sol";
interface IVeDistributor {
event Claimed(address indexed user, uint256 usdcAmount);
event Distributed(uint256 usdcAmount);
event EmergencyWithdrawn(address indexed token, address indexed to, uint256 amount);
error InvalidSnapshotBlock();
error ZeroAddress();
error NothingToClaim();
function USDC() external view returns (IERC20);
function VE() external view returns (IVotingEscrow);
function CHAIN_SNAPSHOT_BLOCK() external view returns (uint256);
function CHAIN_TOTAL_VE() external view returns (uint256);
function usdcDistributedAmount() external view returns (uint256);
function userClaimedAmounts(address _user) external view returns (uint256);
/**
* @notice Pause the contract.
* @dev Only callable by owner.
*/
function pause() external;
/**
* @notice Unpause the contract.
* @dev Only callable by owner.
*/
function unpause() external;
/**
* @notice Emergency withdraw any ERC20 token from the contract.
* @dev Only callable by owner.
* @dev In the event of an emergency withdrawal of USDC, it should not be topped
* back up via `distribute`, as it would increment `usdcDistributedAmount`.
* It would have to be sent back through a normal `USDC.transfer`.
* @param _token Address of the token to withdraw
* @param _amount Amount of tokens to withdraw
* @param _to Address to send the withdrawn tokens to
*/
function emergencyWithdraw(address _token, uint256 _amount, address _to) external;
/**
* @notice Distribute USDC to the contract, instantly available to be claimed.
* @dev Only callable by owner.
* @dev Must approve the contract to transfer USDC first.
* @param _usdcAmount Amount of USDC to distribute
*/
function distribute(uint256 _usdcAmount) external;
/**
* @notice Get the current claimable USDC amount for a user.
* @param _user Address of the user
* @return usdcClaimable Amount of USDC claimable by the user
*/
function getUsdcClaimable(address _user) external view returns (uint256);
/**
* @notice Withdraw all claimable USDC to the sender.
* @return usdcClaimed Amount of USDC claimed
*/
function claimUsdc() external returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
interface IVotingEscrow {
function balanceOfAt(address addr, uint256 _block) external view returns (uint256);
function totalSupplyAt(uint256 _block) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1363.sol)
pragma solidity >=0.6.2;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)
pragma solidity >=0.4.16;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC165.sol)
pragma solidity >=0.4.16;
import {IERC165} from "../utils/introspection/IERC165.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
"remappings": [
"ds-test/=node_modules/@layerzerolabs/toolbox-foundry/lib/ds-test/",
"forge-std/=node_modules/@layerzerolabs/toolbox-foundry/lib/forge-std/",
"@layerzerolabs/=node_modules/@layerzerolabs/",
"@openzeppelin/=node_modules/@openzeppelin/",
"@layerzerolabs/script-devtools-evm-foundry/=node_modules/@layerzerolabs/script-devtools-evm-foundry/",
"hardhat-deploy/=node_modules/hardhat-deploy/",
"hardhat/=node_modules/hardhat/",
"solidity-bytes-utils/=node_modules/solidity-bytes-utils/"
],
"optimizer": {
"enabled": true,
"runs": 20000
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_usdc","type":"address"},{"internalType":"address","name":"_ve","type":"address"},{"internalType":"uint256","name":"_snapshotBlock","type":"uint256"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"InvalidSnapshotBlock","type":"error"},{"inputs":[],"name":"NothingToClaim","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"usdcAmount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"usdcAmount","type":"uint256"}],"name":"Distributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"CHAIN_SNAPSHOT_BLOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CHAIN_TOTAL_VE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDC","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VE","outputs":[{"internalType":"contract IVotingEscrow","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimUsdc","outputs":[{"internalType":"uint256","name":"usdcClaimed","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_usdcAmount","type":"uint256"}],"name":"distribute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUsdcClaimable","outputs":[{"internalType":"uint256","name":"usdcClaimable","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"usdcDistributedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"userClaimedAmounts","outputs":[{"internalType":"uint256","name":"claimedAmount","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
6101006040523480156200001257600080fd5b5060405162001188380380620011888339810160408190526200003591620001e4565b806001600160a01b0381166200006557604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000708162000159565b506001600160a01b03841615806200008f57506001600160a01b038316155b15620000ae5760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b03848116608052831660a081905260c0839052604051630981b24d60e41b81526004810184905263981b24d090602401602060405180830381865afa15801562000103573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000129919062000238565b60e08190526000036200014f5760405163b98a813960e01b815260040160405180910390fd5b5050505062000252565b600180546001600160a01b0319169055620001748162000177565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620001df57600080fd5b919050565b60008060008060808587031215620001fb57600080fd5b6200020685620001c7565b93506200021660208601620001c7565b9250604085015191506200022d60608601620001c7565b905092959194509250565b6000602082840312156200024b57600080fd5b5051919050565b60805160a05160c05160e051610ecb620002bd60003960008181610295015261094901526000818161014001528181610504015261085b0152600081816102bc0152818161052f0152610881015260008181610218015281816103b601526106850152610ecb6000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80638456cb59116100b2578063b743005c11610081578063cf6adcb311610066578063cf6adcb3146102de578063e30c3978146102e7578063f2fde38b1461030557600080fd5b8063b743005c14610290578063c863657d146102b757600080fd5b80638456cb591461020b57806389a30271146102135780638da5cb5b1461025f57806391c05b0b1461027d57600080fd5b8063551512de11610109578063676e7f7c116100ee578063676e7f7c146101e8578063715018a6146101fb57806379ba50971461020357600080fd5b8063551512de146101a75780635c975abb146101ba57600080fd5b80630723462e1461013b5780631d6ee8eb146101755780633f4ba83a1461017d57806343ec862b14610187575b600080fd5b6101627f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b610162610318565b610185610418565b005b610162610195366004610d65565b60036020526000908152604090205481565b6101856101b5366004610d80565b61042a565b60015474010000000000000000000000000000000000000000900460ff16604051901515815260200161016c565b6101626101f6366004610d65565b6104bf565b6101856105ad565b6101856105bf565b61018561063b565b61023a7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161016c565b60005473ffffffffffffffffffffffffffffffffffffffff1661023a565b61018561028b366004610dbc565b61064b565b6101627f000000000000000000000000000000000000000000000000000000000000000081565b61023a7f000000000000000000000000000000000000000000000000000000000000000081565b61016260025481565b60015473ffffffffffffffffffffffffffffffffffffffff1661023a565b610185610313366004610d65565b6106e3565b6000610322610793565b600061032d336107e8565b9050600061033b338361091c565b905080600003610377576040517f969bf72800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526003602052604081208054839290610396908490610e04565b909155506103dd905073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163383610992565b60405181815233907fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a9060200160405180910390a291505090565b610420610a18565b610428610a6b565b565b610432610a18565b61045373ffffffffffffffffffffffffffffffffffffffff84168284610992565b8073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f457e4fe0c9f161a0c6f3bfb8d7809a4ac19f6291bd81b03b86b0d00f9af3717b846040516104b291815260200190565b60405180910390a3505050565b6040517f4ee2cd7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301527f0000000000000000000000000000000000000000000000000000000000000000602483015260009182917f00000000000000000000000000000000000000000000000000000000000000001690634ee2cd7e90604401602060405180830381865afa158015610576573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059a9190610e17565b90506105a6838261091c565b9392505050565b6105b5610a18565b6104286000610ae8565b600154339073ffffffffffffffffffffffffffffffffffffffff16811461062f576040517f118cdaa700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024015b60405180910390fd5b61063881610ae8565b50565b610643610a18565b610428610b19565b610653610a18565b80600260008282546106659190610e04565b909155506106ad905073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016333084610b88565b6040518181527fddc9c30275a04c48091f24199f9c405765de34d979d6847f5b9798a57232d2e59060200160405180910390a150565b6106eb610a18565b6001805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915561074e60005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60015474010000000000000000000000000000000000000000900460ff1615610428576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526004602052604081205490819003610917576040517f4ee2cd7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301527f000000000000000000000000000000000000000000000000000000000000000060248301527f00000000000000000000000000000000000000000000000000000000000000001690634ee2cd7e90604401602060405180830381865afa1580156108c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ec9190610e17565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260046020526040902081905590505b919050565b73ffffffffffffffffffffffffffffffffffffffff821660009081526003602052604081205460025481907f000000000000000000000000000000000000000000000000000000000000000090610974908690610e30565b61097e9190610e47565b6109889190610e82565b9150505b92915050565b60405173ffffffffffffffffffffffffffffffffffffffff838116602483015260448201839052610a1391859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610bd4565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610428576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610626565b610a73610c78565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b600180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561063881610ccc565b610b21610793565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610abe3390565b60405173ffffffffffffffffffffffffffffffffffffffff8481166024830152838116604483015260648201839052610bce9186918216906323b872dd906084016109cc565b50505050565b600080602060008451602086016000885af180610bf7576040513d6000823e3d81fd5b50506000513d91508115610c0f578060011415610c29565b73ffffffffffffffffffffffffffffffffffffffff84163b155b15610bce576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610626565b60015474010000000000000000000000000000000000000000900460ff16610428576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091757600080fd5b600060208284031215610d7757600080fd5b6105a682610d41565b600080600060608486031215610d9557600080fd5b610d9e84610d41565b925060208401359150610db360408501610d41565b90509250925092565b600060208284031215610dce57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561098c5761098c610dd5565b600060208284031215610e2957600080fd5b5051919050565b808202811582820484141761098c5761098c610dd5565b600082610e7d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8181038181111561098c5761098c610dd556fea2646970667358221220898fe0acec808b3804248fddc3d053ef50de480c6b45f49d0037f65652a7095464736f6c634300081800330000000000000000000000000b2c639c533813f4aa9d7837caf62653d097ff8500000000000000000000000043d2761ed16c89a2c4342e2b16a3c61ccf88f05b00000000000000000000000000000000000000000000000000000000085276b7000000000000000000000000392ac17a9028515a3bfa6cce51f8b70306c6bd43
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101365760003560e01c80638456cb59116100b2578063b743005c11610081578063cf6adcb311610066578063cf6adcb3146102de578063e30c3978146102e7578063f2fde38b1461030557600080fd5b8063b743005c14610290578063c863657d146102b757600080fd5b80638456cb591461020b57806389a30271146102135780638da5cb5b1461025f57806391c05b0b1461027d57600080fd5b8063551512de11610109578063676e7f7c116100ee578063676e7f7c146101e8578063715018a6146101fb57806379ba50971461020357600080fd5b8063551512de146101a75780635c975abb146101ba57600080fd5b80630723462e1461013b5780631d6ee8eb146101755780633f4ba83a1461017d57806343ec862b14610187575b600080fd5b6101627f00000000000000000000000000000000000000000000000000000000085276b781565b6040519081526020015b60405180910390f35b610162610318565b610185610418565b005b610162610195366004610d65565b60036020526000908152604090205481565b6101856101b5366004610d80565b61042a565b60015474010000000000000000000000000000000000000000900460ff16604051901515815260200161016c565b6101626101f6366004610d65565b6104bf565b6101856105ad565b6101856105bf565b61018561063b565b61023a7f0000000000000000000000000b2c639c533813f4aa9d7837caf62653d097ff8581565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161016c565b60005473ffffffffffffffffffffffffffffffffffffffff1661023a565b61018561028b366004610dbc565b61064b565b6101627f000000000000000000000000000000000000000000007338c05587bcd449acc681565b61023a7f00000000000000000000000043d2761ed16c89a2c4342e2b16a3c61ccf88f05b81565b61016260025481565b60015473ffffffffffffffffffffffffffffffffffffffff1661023a565b610185610313366004610d65565b6106e3565b6000610322610793565b600061032d336107e8565b9050600061033b338361091c565b905080600003610377576040517f969bf72800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526003602052604081208054839290610396908490610e04565b909155506103dd905073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000b2c639c533813f4aa9d7837caf62653d097ff85163383610992565b60405181815233907fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a9060200160405180910390a291505090565b610420610a18565b610428610a6b565b565b610432610a18565b61045373ffffffffffffffffffffffffffffffffffffffff84168284610992565b8073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f457e4fe0c9f161a0c6f3bfb8d7809a4ac19f6291bd81b03b86b0d00f9af3717b846040516104b291815260200190565b60405180910390a3505050565b6040517f4ee2cd7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301527f00000000000000000000000000000000000000000000000000000000085276b7602483015260009182917f00000000000000000000000043d2761ed16c89a2c4342e2b16a3c61ccf88f05b1690634ee2cd7e90604401602060405180830381865afa158015610576573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059a9190610e17565b90506105a6838261091c565b9392505050565b6105b5610a18565b6104286000610ae8565b600154339073ffffffffffffffffffffffffffffffffffffffff16811461062f576040517f118cdaa700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024015b60405180910390fd5b61063881610ae8565b50565b610643610a18565b610428610b19565b610653610a18565b80600260008282546106659190610e04565b909155506106ad905073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000b2c639c533813f4aa9d7837caf62653d097ff8516333084610b88565b6040518181527fddc9c30275a04c48091f24199f9c405765de34d979d6847f5b9798a57232d2e59060200160405180910390a150565b6106eb610a18565b6001805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915561074e60005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60015474010000000000000000000000000000000000000000900460ff1615610428576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526004602052604081205490819003610917576040517f4ee2cd7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301527f00000000000000000000000000000000000000000000000000000000085276b760248301527f00000000000000000000000043d2761ed16c89a2c4342e2b16a3c61ccf88f05b1690634ee2cd7e90604401602060405180830381865afa1580156108c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ec9190610e17565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260046020526040902081905590505b919050565b73ffffffffffffffffffffffffffffffffffffffff821660009081526003602052604081205460025481907f000000000000000000000000000000000000000000007338c05587bcd449acc690610974908690610e30565b61097e9190610e47565b6109889190610e82565b9150505b92915050565b60405173ffffffffffffffffffffffffffffffffffffffff838116602483015260448201839052610a1391859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610bd4565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610428576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610626565b610a73610c78565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b600180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561063881610ccc565b610b21610793565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610abe3390565b60405173ffffffffffffffffffffffffffffffffffffffff8481166024830152838116604483015260648201839052610bce9186918216906323b872dd906084016109cc565b50505050565b600080602060008451602086016000885af180610bf7576040513d6000823e3d81fd5b50506000513d91508115610c0f578060011415610c29565b73ffffffffffffffffffffffffffffffffffffffff84163b155b15610bce576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610626565b60015474010000000000000000000000000000000000000000900460ff16610428576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091757600080fd5b600060208284031215610d7757600080fd5b6105a682610d41565b600080600060608486031215610d9557600080fd5b610d9e84610d41565b925060208401359150610db360408501610d41565b90509250925092565b600060208284031215610dce57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561098c5761098c610dd5565b600060208284031215610e2957600080fd5b5051919050565b808202811582820484141761098c5761098c610dd5565b600082610e7d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8181038181111561098c5761098c610dd556fea2646970667358221220898fe0acec808b3804248fddc3d053ef50de480c6b45f49d0037f65652a7095464736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000b2c639c533813f4aa9d7837caf62653d097ff8500000000000000000000000043d2761ed16c89a2c4342e2b16a3c61ccf88f05b00000000000000000000000000000000000000000000000000000000085276b7000000000000000000000000392ac17a9028515a3bfa6cce51f8b70306c6bd43
-----Decoded View---------------
Arg [0] : _usdc (address): 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
Arg [1] : _ve (address): 0x43d2761ed16C89A2C4342e2B16A3C61Ccf88f05B
Arg [2] : _snapshotBlock (uint256): 139622071
Arg [3] : _owner (address): 0x392AC17A9028515a3bFA6CCe51F8b70306C6bd43
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000b2c639c533813f4aa9d7837caf62653d097ff85
Arg [1] : 00000000000000000000000043d2761ed16c89a2c4342e2b16a3c61ccf88f05b
Arg [2] : 00000000000000000000000000000000000000000000000000000000085276b7
Arg [3] : 000000000000000000000000392ac17a9028515a3bfa6cce51f8b70306c6bd43
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$744,386.41
Net Worth in ETH
373.590049
Token Allocations
USDC
89.80%
BSC-USD
10.20%
YFTE
0.00%
Multichain Portfolio | 34 Chains
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.