Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 7,252 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Revoke Unclaimed... | 24519718 | 29 days ago | IN | 0 ETH | 0.00000344 | ||||
| Claim | 24409828 | 45 days ago | IN | 0 ETH | 0.00021013 | ||||
| Claim | 24409754 | 45 days ago | IN | 0 ETH | 0.00000922 | ||||
| Claim | 24409704 | 45 days ago | IN | 0 ETH | 0.00000926 | ||||
| Claim And Stake | 24405104 | 45 days ago | IN | 0 ETH | 0.00003996 | ||||
| Claim | 24404959 | 45 days ago | IN | 0 ETH | 0.00005486 | ||||
| Claim | 24398641 | 46 days ago | IN | 0 ETH | 0.00007415 | ||||
| Claim And Stake | 24396801 | 46 days ago | IN | 0 ETH | 0.00007485 | ||||
| Claim And Stake | 24396444 | 46 days ago | IN | 0 ETH | 0.00000817 | ||||
| Claim And Stake | 24396444 | 46 days ago | IN | 0 ETH | 0.00006673 | ||||
| Claim | 24392775 | 47 days ago | IN | 0 ETH | 0.00011613 | ||||
| Claim And Stake | 24389913 | 47 days ago | IN | 0 ETH | 0.00005042 | ||||
| Claim And Stake | 24389609 | 47 days ago | IN | 0 ETH | 0.00008308 | ||||
| Claim And Stake | 24388624 | 47 days ago | IN | 0 ETH | 0.00018379 | ||||
| Claim | 24372406 | 50 days ago | IN | 0 ETH | 0.00021566 | ||||
| Claim And Stake | 24371307 | 50 days ago | IN | 0 ETH | 0.00004728 | ||||
| Claim | 24370143 | 50 days ago | IN | 0 ETH | 0.00032261 | ||||
| Claim | 24367963 | 50 days ago | IN | 0 ETH | 0.0002285 | ||||
| Claim | 24367952 | 50 days ago | IN | 0 ETH | 0.0002275 | ||||
| Claim | 24365854 | 51 days ago | IN | 0 ETH | 0.00002059 | ||||
| Claim | 24365397 | 51 days ago | IN | 0 ETH | 0.0000239 | ||||
| Claim And Stake | 24360998 | 51 days ago | IN | 0 ETH | 0.00002581 | ||||
| Claim And Stake | 24360627 | 51 days ago | IN | 0 ETH | 0.00020118 | ||||
| Claim And Stake | 24360566 | 51 days ago | IN | 0 ETH | 0.00020428 | ||||
| Claim And Stake | 24358375 | 52 days ago | IN | 0 ETH | 0.00020863 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
AlmanakAirdrop
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable2Step.sol";
interface IVotingEscrow {
function createLockFor(address _for, uint256 _value, uint256 _unlockTime) external;
}
/**
* @title AlmanakAirdrop
* @author ALMANAK Platform Team
* @notice Merkle tree-based airdrop distribution contract for ALMANAK token TGE
* @dev Implements secure token distribution with claim deadline and revocation mechanism
*
* Security Features:
* - Merkle tree verification for gas-efficient distribution
* - ReentrancyGuard protection
* - Pausable for emergency stops
* - Claim deadline enforcement
* - Owner-only revocation after deadline
*/
contract AlmanakAirdrop is Ownable2Step, ReentrancyGuard, Pausable {
using SafeERC20 for IERC20;
// ============ State Variables ============
/// @notice Minimum duration for claim period (24 hours)
uint256 public constant MIN_CLAIM_DURATION = 1 days;
/// @notice The ALMANAK token contract
IERC20 public immutable token;
/// @notice The VotingEscrow (veALMANAK) contract
IVotingEscrow public immutable veToken;
/// @notice Merkle root of the airdrop distribution tree
bytes32 public immutable merkleRoot;
/// @notice Timestamp when claiming starts
uint256 public immutable claimStartTime;
/// @notice Duration of claim period in seconds
uint256 public immutable claimDuration;
/// @notice Timestamp after which claiming is no longer allowed
uint256 public immutable claimDeadline;
/// @notice Total amount of tokens allocated for the airdrop
uint256 public immutable totalAllocation;
/// @notice Initial slashing rate in basis points (e.g., 5000 = 50%)
uint256 public immutable initialSlashingRate;
/// @notice Duration of the slashing period in seconds
uint256 public immutable slashingPeriodDuration;
/// @notice Address that receives slashed tokens
address public slashingReceiver;
/// @notice Amount of tokens that have been claimed
uint256 public totalClaimed;
/// @notice Mapping of addresses that have claimed their tokens
mapping(address => bool) public hasClaimed;
/// @notice Whether unclaimed tokens have been revoked
bool public unclaimedRevoked;
// ============ Events ============
/**
* @notice Emitted when tokens are successfully claimed
* @param claimant Address that claimed the tokens
* @param recipient Address that received the tokens
* @param amount Total amount from merkle tree
* @param receivedAmount Amount received after slashing
* @param slashedAmount Amount slashed
*/
event TokensClaimed(
address indexed claimant,
address indexed recipient,
uint256 amount,
uint256 receivedAmount,
uint256 slashedAmount
);
/**
* @notice Emitted when tokens are claimed and staked in one transaction
* @param claimant Address that claimed the tokens
* @param recipient Address that received the liquid tokens
* @param totalAmount Total amount claimed
* @param stakedAmount Amount that was staked (veToken goes to claimant)
* @param liquidAmount Amount that was transferred as liquid tokens
* @param slashedAmount Amount that was slashed
* @param unlockTime Time when staked tokens unlock
*/
event TokensClaimedAndStaked(
address indexed claimant,
address indexed recipient,
uint256 totalAmount,
uint256 stakedAmount,
uint256 liquidAmount,
uint256 slashedAmount,
uint256 unlockTime
);
/**
* @notice Emitted when slashing receiver address is updated
* @param oldReceiver Previous slashing receiver address
* @param newReceiver New slashing receiver address
*/
event SlashingReceiverUpdated(address indexed oldReceiver, address indexed newReceiver);
/**
* @notice Emitted when unclaimed tokens are revoked by owner
* @param amount Amount of tokens revoked
* @param recipient Address that received the revoked tokens
*/
event UnclaimedTokensRevoked(uint256 amount, address indexed recipient);
/**
* @notice Emitted when the contract is paused
* @param account Address that triggered the pause
*/
event AirdropPaused(address indexed account);
/**
* @notice Emitted when the contract is unpaused
* @param account Address that triggered the unpause
*/
event AirdropUnpaused(address indexed account);
/**
* @notice Emitted when tokens are recovered from the contract
* @param tokenAddress Address of the recovered token
* @param recipient Address that received the tokens
* @param amount Amount of tokens recovered
*/
event TokensRecovered(address indexed tokenAddress, address indexed recipient, uint256 amount);
// ============ Custom Errors ============
/// @notice Thrown when claim period has not started yet
error ClaimPeriodNotStarted();
/// @notice Thrown when claim period has ended
error ClaimPeriodEnded();
/// @notice Thrown when address has already claimed
error AlreadyClaimed();
/// @notice Thrown when Merkle proof is invalid
error InvalidProof();
/// @notice Thrown when trying to revoke before deadline
error ClaimPeriodNotEnded();
/// @notice Thrown when unclaimed tokens have already been revoked
error AlreadyRevoked();
/// @notice Thrown when claim amount is zero
error InvalidClaimAmount();
/// @notice Thrown when claim start time is in the past
error InvalidClaimStartTime();
/// @notice Thrown when claim duration is less than minimum required
error InvalidClaimDuration();
/// @notice Thrown when merkle root is zero
error InvalidMerkleRoot();
/// @notice Thrown when token address is zero
error InvalidTokenAddress();
/// @notice Thrown when total allocation is zero
error InvalidTotalAllocation();
/// @notice Thrown when stake amount exceeds claim amount
error StakeAmountExceedsClaimAmount();
/// @notice Thrown when unlock time is required but not provided
error UnlockTimeRequired();
/// @notice Thrown when slashing receiver address is zero
error InvalidSlashingReceiver();
/// @notice Thrown when initial slashing rate exceeds 100%
error InvalidSlashingRate();
/// @notice Thrown when unlock time is before slashing period ends
error UnlockTimeBeforeSlashingPeriodEnds();
// ============ Constructor ============
/**
* @notice Initializes the airdrop contract
* @param _token Address of the ALMANAK token contract
* @param _merkleRoot Merkle root of the distribution tree
* @param _claimStartTime Timestamp when claiming starts
* @param _claimDuration Duration of claim period in seconds
* @param _totalAllocation Total amount of tokens allocated for airdrop
* @param _owner Address that will own this contract
* @param _veToken Address of the VotingEscrow (veALMANAK) contract
* @param _initialSlashingRate Initial slashing rate in basis points (0-10000, where 10000 = 100%)
* @param _slashingPeriodDuration Duration of slashing period in seconds
* @param _slashingReceiver Address that receives slashed tokens
*/
constructor(
address _token,
bytes32 _merkleRoot,
uint256 _claimStartTime,
uint256 _claimDuration,
uint256 _totalAllocation,
address _owner,
address _veToken,
uint256 _initialSlashingRate,
uint256 _slashingPeriodDuration,
address _slashingReceiver
) Ownable(_owner) {
if (_token == address(0)) revert InvalidTokenAddress();
if (_merkleRoot == bytes32(0)) revert InvalidMerkleRoot();
if (_claimStartTime < block.timestamp) revert InvalidClaimStartTime();
if (_claimDuration < MIN_CLAIM_DURATION) revert InvalidClaimDuration();
if (_totalAllocation == 0) revert InvalidTotalAllocation();
if (_veToken == address(0)) revert InvalidTokenAddress();
if (_initialSlashingRate > 10000) revert InvalidSlashingRate();
if (_slashingReceiver == address(0) && _initialSlashingRate > 0) revert InvalidSlashingReceiver();
token = IERC20(_token);
merkleRoot = _merkleRoot;
claimStartTime = _claimStartTime;
claimDuration = _claimDuration;
claimDeadline = _claimStartTime + _claimDuration;
totalAllocation = _totalAllocation;
veToken = IVotingEscrow(_veToken);
initialSlashingRate = _initialSlashingRate;
slashingPeriodDuration = _slashingPeriodDuration;
slashingReceiver = _slashingReceiver;
}
// ============ Internal Functions ============
/**
* @notice Calculates the slashing rate at a given timestamp
* @dev Returns slashing rate in basis points (0-10000)
* @param timestamp The timestamp to calculate the slashing rate for
* @return uint256 Slashing rate in basis points
*/
function calculateSlashingRate(uint256 timestamp) internal view returns (uint256) {
// If slashing is disabled (duration = 0), always return 0
if (slashingPeriodDuration == 0) {
return 0;
}
// If before claim start, return initial rate
if (timestamp < claimStartTime) {
return initialSlashingRate;
}
uint256 slashingEndTime = claimStartTime + slashingPeriodDuration;
// If after slashing period, return 0
if (timestamp >= slashingEndTime) {
return 0;
}
// Calculate elapsed time since claim start
uint256 elapsed = timestamp - claimStartTime;
// Linear decay: rate = initialRate * (duration - elapsed) / duration
uint256 remainingTime = slashingPeriodDuration - elapsed;
return (initialSlashingRate * remainingTime) / slashingPeriodDuration;
}
// ============ External Functions ============
/**
* @notice Claims airdrop tokens for the caller
* @dev Verifies Merkle proof and transfers tokens to specified recipient
* @param amount Amount of tokens to claim
* @param recipient Address to receive the claimed tokens
* @param merkleProof Merkle proof for the claim
*
* Requirements:
* - Claim period must have started
* - Claim period must not have ended
* - Caller must not have already claimed
* - Merkle proof must be valid
* - Contract must not be paused
* - Recipient must not be zero address
*/
function claim(
uint256 amount,
address recipient,
bytes32[] calldata merkleProof
) external nonReentrant whenNotPaused {
// Check claim period has started
if (block.timestamp < claimStartTime) revert ClaimPeriodNotStarted();
// Check claim period has not ended
if (block.timestamp > claimDeadline) revert ClaimPeriodEnded();
// Check if already claimed
if (hasClaimed[msg.sender]) revert AlreadyClaimed();
// Validate amount and recipient
if (amount == 0) revert InvalidClaimAmount();
if (recipient == address(0)) revert InvalidTokenAddress();
// Verify Merkle proof
bytes32 leaf = keccak256(
bytes.concat(keccak256(abi.encode(msg.sender, amount)))
);
if (!MerkleProof.verify(merkleProof, merkleRoot, leaf))
revert InvalidProof();
// Mark as claimed
hasClaimed[msg.sender] = true;
totalClaimed += amount;
// Calculate slashing
uint256 slashingRate = calculateSlashingRate(block.timestamp);
uint256 slashedAmount = (amount * slashingRate) / 10000;
uint256 userAmount = amount - slashedAmount;
// Transfer slashed tokens to slashing receiver
if (slashedAmount > 0) {
token.safeTransfer(slashingReceiver, slashedAmount);
}
// Transfer remaining tokens to recipient
if (userAmount > 0) {
token.safeTransfer(recipient, userAmount);
}
emit TokensClaimed(msg.sender, recipient, amount, userAmount, slashedAmount);
}
/**
* @notice Claims airdrop and optionally stakes tokens in one transaction
* @param amount Total amount to claim (must match merkle tree)
* @param stakeAmount Amount to stake (must be <= amount, veToken goes to caller)
* @param unlockTime Unix timestamp when staked tokens unlock (required if stakeAmount > 0)
* @param recipient Address to receive the liquid tokens (unstaked portion)
* @param merkleProof Merkle proof for the claim
*/
function claimAndStake(
uint256 amount,
uint256 stakeAmount,
uint256 unlockTime,
address recipient,
bytes32[] calldata merkleProof
) external nonReentrant whenNotPaused {
// Validate inputs
if (stakeAmount > amount) revert StakeAmountExceedsClaimAmount();
if (stakeAmount > 0 && unlockTime == 0) revert UnlockTimeRequired();
if (recipient == address(0)) revert InvalidTokenAddress();
// Validate unlockTime is after slashing period ends
uint256 slashingEndTime = claimStartTime + slashingPeriodDuration;
if (stakeAmount > 0 && unlockTime < slashingEndTime) {
revert UnlockTimeBeforeSlashingPeriodEnds();
}
// Standard claim checks (same as claim() function)
if (block.timestamp < claimStartTime) revert ClaimPeriodNotStarted();
if (block.timestamp > claimDeadline) revert ClaimPeriodEnded();
if (hasClaimed[msg.sender]) revert AlreadyClaimed();
if (amount == 0) revert InvalidClaimAmount();
// Verify merkle proof
bytes32 leaf = keccak256(bytes.concat(keccak256(abi.encode(msg.sender, amount))));
if (!MerkleProof.verify(merkleProof, merkleRoot, leaf)) revert InvalidProof();
// Mark as claimed
hasClaimed[msg.sender] = true;
totalClaimed += amount;
// Calculate slashing on unstaked portion only
uint256 unstaked = amount - stakeAmount;
uint256 slashingRate = calculateSlashingRate(block.timestamp);
uint256 slashedAmount = (unstaked * slashingRate) / 10000;
uint256 liquidAmount = unstaked - slashedAmount;
// Stake portion (if any) - full amount without slashing
if (stakeAmount > 0) {
// Approve veToken to transfer tokens
token.forceApprove(address(veToken), stakeAmount);
// Create lock for user
veToken.createLockFor(msg.sender, stakeAmount, unlockTime);
// Reset approval to 0 for security
token.forceApprove(address(veToken), 0);
}
// Transfer slashed tokens to slashing receiver
if (slashedAmount > 0) {
token.safeTransfer(slashingReceiver, slashedAmount);
}
// Transfer liquid portion to recipient (if any)
if (liquidAmount > 0) {
token.safeTransfer(recipient, liquidAmount);
}
emit TokensClaimedAndStaked(msg.sender, recipient, amount, stakeAmount, liquidAmount, slashedAmount, unlockTime);
}
/**
* @notice Revokes unclaimed tokens after the claim deadline
* @dev Can only be called by owner after deadline has passed
* @dev DEPRECATED: Use recoverTokens() for more flexible token recovery
* @param recipient Address to receive the unclaimed tokens
*
* Requirements:
* - Claim period must have ended
* - Unclaimed tokens must not have been revoked already
* - Only owner can call this function
*/
function revokeUnclaimedTokens(address recipient) external onlyOwner {
if (block.timestamp <= claimDeadline) revert ClaimPeriodNotEnded();
if (unclaimedRevoked) revert AlreadyRevoked();
if (recipient == address(0)) revert InvalidTokenAddress();
unclaimedRevoked = true;
uint256 unclaimedAmount = token.balanceOf(address(this));
if (unclaimedAmount > 0) {
token.safeTransfer(recipient, unclaimedAmount);
emit UnclaimedTokensRevoked(unclaimedAmount, recipient);
}
}
/**
* @notice Pauses the contract, preventing claims
* @dev Can only be called by owner
*/
function pause() external onlyOwner {
_pause();
emit AirdropPaused(msg.sender);
}
/**
* @notice Unpauses the contract, allowing claims
* @dev Can only be called by owner
*/
function unpause() external onlyOwner {
_unpause();
emit AirdropUnpaused(msg.sender);
}
/**
* @notice Updates the slashing receiver address
* @dev Can only be called by owner
* @param newReceiver New address to receive slashed tokens
*
* Requirements:
* - New receiver address must not be zero address
* - Only owner can call this function
*/
function setSlashingReceiver(address newReceiver) external onlyOwner {
if (newReceiver == address(0)) revert InvalidSlashingReceiver();
address oldReceiver = slashingReceiver;
slashingReceiver = newReceiver;
emit SlashingReceiverUpdated(oldReceiver, newReceiver);
}
// ============ View Functions ============
/**
* @notice Checks if an address can claim tokens
* @param claimant Address to check
* @param amount Amount to be claimed
* @param merkleProof Merkle proof for the claim
* @return bool True if the address can claim
*/
function canClaim(
address claimant,
uint256 amount,
bytes32[] calldata merkleProof
) external view returns (bool) {
// Check basic conditions
if (block.timestamp < claimStartTime) return false;
if (block.timestamp > claimDeadline) return false;
if (hasClaimed[claimant]) return false;
if (amount == 0) return false;
if (paused()) return false;
// Verify Merkle proof
bytes32 leaf = keccak256(
bytes.concat(keccak256(abi.encode(claimant, amount)))
);
return MerkleProof.verify(merkleProof, merkleRoot, leaf);
}
/**
* @notice Gets the claimable amount for an address
* @dev Returns 0 if already claimed or proof is invalid
* @param claimant Address to check
* @param amount Amount that could be claimed
* @param merkleProof Merkle proof for the claim
* @return uint256 Claimable amount (0 if not claimable)
*/
function getClaimableAmount(
address claimant,
uint256 amount,
bytes32[] calldata merkleProof
) external view returns (uint256) {
// If already claimed, return 0
if (hasClaimed[claimant]) return 0;
// If claim period not started, return 0
if (block.timestamp < claimStartTime) return 0;
// If claim period ended, return 0
if (block.timestamp > claimDeadline) return 0;
// If paused, return 0
if (paused()) return 0;
// Verify Merkle proof
bytes32 leaf = keccak256(
bytes.concat(keccak256(abi.encode(claimant, amount)))
);
if (MerkleProof.verify(merkleProof, merkleRoot, leaf)) {
return amount;
}
return 0;
}
/**
* @notice Gets the remaining time until claim deadline
* @return uint256 Seconds remaining (0 if deadline passed)
*/
function timeUntilDeadline() external view returns (uint256) {
if (block.timestamp >= claimDeadline) return 0;
return claimDeadline - block.timestamp;
}
/**
* @notice Gets the remaining time until claim period starts
* @return uint256 Seconds remaining (0 if already started)
*/
function timeUntilClaimStart() external view returns (uint256) {
if (block.timestamp >= claimStartTime) return 0;
return claimStartTime - block.timestamp;
}
/**
* @notice Gets the claim window information
* @return startTime When claiming begins
* @return duration Duration of claim period in seconds
* @return endTime When claiming ends
*/
function getClaimWindow() external view returns (
uint256 startTime,
uint256 duration,
uint256 endTime
) {
startTime = claimStartTime;
duration = claimDuration;
endTime = claimDeadline;
}
/**
* @notice Gets the total amount of unclaimed tokens
* @dev Returns the actual unclaimed amount based on allocation minus claims
* @return uint256 Amount of unclaimed tokens
*/
function getUnclaimedAmount() external view returns (uint256) {
return totalAllocation - totalClaimed;
}
/**
* @notice Gets airdrop statistics
* @return claimed Total amount claimed
* @return unclaimed Total amount unclaimed (based on allocation minus claims)
* @return claimStartTimestamp Claim start timestamp
* @return claimDeadlineTimestamp Claim deadline timestamp
* @return isRevoked Whether unclaimed tokens have been revoked
* @return isPaused Whether the contract is paused
*/
function getAirdropStats()
external
view
returns (
uint256 claimed,
uint256 unclaimed,
uint256 claimStartTimestamp,
uint256 claimDeadlineTimestamp,
bool isRevoked,
bool isPaused
)
{
claimed = totalClaimed;
unclaimed = totalAllocation - totalClaimed;
claimStartTimestamp = claimStartTime;
claimDeadlineTimestamp = claimDeadline;
isRevoked = unclaimedRevoked;
isPaused = paused();
}
/**
* @notice Gets the current slashing rate in basis points
* @return uint256 Current slashing rate (0-10000, where 10000 = 100%)
*/
function getCurrentSlashingRate() external view returns (uint256) {
return calculateSlashingRate(block.timestamp);
}
/**
* @notice Gets the timestamp when the slashing period ends
* @return uint256 Timestamp when slashing rate becomes 0
*/
function getSlashingEndTime() external view returns (uint256) {
return claimStartTime + slashingPeriodDuration;
}
/**
* @notice Calculates the amounts a user would receive if they claim now
* @param amount Total allocation amount from merkle tree
* @return netAmount Amount user would receive after slashing
* @return slashedAmount Amount that would be slashed
* @return slashingRate Current slashing rate in basis points
*/
function calculateClaimAmounts(uint256 amount)
external
view
returns (
uint256 netAmount,
uint256 slashedAmount,
uint256 slashingRate
)
{
slashingRate = calculateSlashingRate(block.timestamp);
slashedAmount = (amount * slashingRate) / 10000;
netAmount = amount - slashedAmount;
}
/**
* @notice Recovers any ERC20 tokens sent to the contract
* @dev Can recover any token including the airdrop token to handle accidental transfers
* @param tokenAddress Address of the token to recover
* @param recipient Address to receive the recovered tokens
* @param amount Amount to recover (0 = entire balance)
*
* Requirements:
* - Only owner can call this function
* - Recipient must not be zero address
*/
function recoverTokens(
address tokenAddress,
address recipient,
uint256 amount
) external onlyOwner {
require(recipient != address(0), "Invalid recipient");
IERC20 tokenToRecover = IERC20(tokenAddress);
uint256 balance = tokenToRecover.balanceOf(address(this));
// If amount is 0, recover entire balance
uint256 amountToRecover = amount == 0 ? balance : amount;
require(amountToRecover <= balance, "Insufficient balance");
if (amountToRecover > 0) {
tokenToRecover.safeTransfer(recipient, amountToRecover);
emit TokensRecovered(tokenAddress, recipient, amountToRecover);
}
}
}// 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.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.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/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) (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) (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
// 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.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.3.0) (utils/cryptography/Hashes.sol)
pragma solidity ^0.8.20;
/**
* @dev Library of standard hash functions.
*
* _Available since v5.1._
*/
library Hashes {
/**
* @dev Commutative Keccak256 hash of a sorted pair of bytes32. Frequently used when working with merkle proofs.
*
* NOTE: Equivalent to the `standardNodeHash` in our https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
*/
function commutativeKeccak256(bytes32 a, bytes32 b) internal pure returns (bytes32) {
return a < b ? efficientKeccak256(a, b) : efficientKeccak256(b, a);
}
/**
* @dev Implementation of keccak256(abi.encode(a, b)) that doesn't allocate or expand memory.
*/
function efficientKeccak256(bytes32 a, bytes32 b) internal pure returns (bytes32 value) {
assembly ("memory-safe") {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MerkleProof.sol)
// This file was procedurally generated from scripts/generate/templates/MerkleProof.js.
pragma solidity ^0.8.20;
import {Hashes} from "./Hashes.sol";
/**
* @dev These functions deal with verification of Merkle Tree proofs.
*
* The tree and the proofs can be generated using our
* https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
* You will find a quickstart guide in the readme.
*
* WARNING: You should avoid using leaf values that are 64 bytes long prior to
* hashing, or use a hash function other than keccak256 for hashing leaves.
* This is because the concatenation of a sorted pair of internal nodes in
* the Merkle tree could be reinterpreted as a leaf value.
* OpenZeppelin's JavaScript library generates Merkle trees that are safe
* against this attack out of the box.
*
* IMPORTANT: Consider memory side-effects when using custom hashing functions
* that access memory in an unsafe way.
*
* NOTE: This library supports proof verification for merkle trees built using
* custom _commutative_ hashing functions (i.e. `H(a, b) == H(b, a)`). Proving
* leaf inclusion in trees built using non-commutative hashing functions requires
* additional logic that is not supported by this library.
*/
library MerkleProof {
/**
*@dev The multiproof provided is not valid.
*/
error MerkleProofInvalidMultiproof();
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*
* This version handles proofs in memory with the default hashing function.
*/
function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in memory with the default hashing function.
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = Hashes.commutativeKeccak256(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*
* This version handles proofs in memory with a custom hashing function.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processProof(proof, leaf, hasher) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in memory with a custom hashing function.
*/
function processProof(
bytes32[] memory proof,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = hasher(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*
* This version handles proofs in calldata with the default hashing function.
*/
function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
return processProofCalldata(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in calldata with the default hashing function.
*/
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = Hashes.commutativeKeccak256(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*
* This version handles proofs in calldata with a custom hashing function.
*/
function verifyCalldata(
bytes32[] calldata proof,
bytes32 root,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processProofCalldata(proof, leaf, hasher) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in calldata with a custom hashing function.
*/
function processProofCalldata(
bytes32[] calldata proof,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = hasher(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* This version handles multiproofs in memory with the default hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProof}.
*/
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
* proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
* leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
* respectively.
*
* This version handles multiproofs in memory with the default hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the Merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](proofFlagsLen);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = Hashes.commutativeKeccak256(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* This version handles multiproofs in memory with a custom hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProof}.
*/
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processMultiProof(proof, proofFlags, leaves, hasher) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
* proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
* leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
* respectively.
*
* This version handles multiproofs in memory with a custom hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the Merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](proofFlagsLen);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = hasher(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* This version handles multiproofs in calldata with the default hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProofCalldata}.
*/
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
* proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
* leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
* respectively.
*
* This version handles multiproofs in calldata with the default hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the Merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](proofFlagsLen);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = Hashes.commutativeKeccak256(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* This version handles multiproofs in calldata with a custom hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProofCalldata}.
*/
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves, hasher) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
* proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
* leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
* respectively.
*
* This version handles multiproofs in calldata with a custom hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the Merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](proofFlagsLen);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = hasher(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
}// 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);
}// 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.1.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
* consider using {ReentrancyGuardTransient} instead.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"viaIR": true,
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"_claimStartTime","type":"uint256"},{"internalType":"uint256","name":"_claimDuration","type":"uint256"},{"internalType":"uint256","name":"_totalAllocation","type":"uint256"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_veToken","type":"address"},{"internalType":"uint256","name":"_initialSlashingRate","type":"uint256"},{"internalType":"uint256","name":"_slashingPeriodDuration","type":"uint256"},{"internalType":"address","name":"_slashingReceiver","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyClaimed","type":"error"},{"inputs":[],"name":"AlreadyRevoked","type":"error"},{"inputs":[],"name":"ClaimPeriodEnded","type":"error"},{"inputs":[],"name":"ClaimPeriodNotEnded","type":"error"},{"inputs":[],"name":"ClaimPeriodNotStarted","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"InvalidClaimAmount","type":"error"},{"inputs":[],"name":"InvalidClaimDuration","type":"error"},{"inputs":[],"name":"InvalidClaimStartTime","type":"error"},{"inputs":[],"name":"InvalidMerkleRoot","type":"error"},{"inputs":[],"name":"InvalidProof","type":"error"},{"inputs":[],"name":"InvalidSlashingRate","type":"error"},{"inputs":[],"name":"InvalidSlashingReceiver","type":"error"},{"inputs":[],"name":"InvalidTokenAddress","type":"error"},{"inputs":[],"name":"InvalidTotalAllocation","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":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"StakeAmountExceedsClaimAmount","type":"error"},{"inputs":[],"name":"UnlockTimeBeforeSlashingPeriodEnds","type":"error"},{"inputs":[],"name":"UnlockTimeRequired","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"AirdropPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"AirdropUnpaused","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":true,"internalType":"address","name":"oldReceiver","type":"address"},{"indexed":true,"internalType":"address","name":"newReceiver","type":"address"}],"name":"SlashingReceiverUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"claimant","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"receivedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"slashedAmount","type":"uint256"}],"name":"TokensClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"claimant","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stakedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"liquidAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"slashedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"unlockTime","type":"uint256"}],"name":"TokensClaimedAndStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensRecovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"}],"name":"UnclaimedTokensRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"MIN_CLAIM_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"calculateClaimAmounts","outputs":[{"internalType":"uint256","name":"netAmount","type":"uint256"},{"internalType":"uint256","name":"slashedAmount","type":"uint256"},{"internalType":"uint256","name":"slashingRate","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"claimant","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"canClaim","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"stakeAmount","type":"uint256"},{"internalType":"uint256","name":"unlockTime","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"claimAndStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimDeadline","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAirdropStats","outputs":[{"internalType":"uint256","name":"claimed","type":"uint256"},{"internalType":"uint256","name":"unclaimed","type":"uint256"},{"internalType":"uint256","name":"claimStartTimestamp","type":"uint256"},{"internalType":"uint256","name":"claimDeadlineTimestamp","type":"uint256"},{"internalType":"bool","name":"isRevoked","type":"bool"},{"internalType":"bool","name":"isPaused","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getClaimWindow","outputs":[{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"claimant","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"getClaimableAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentSlashingRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSlashingEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUnclaimedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"hasClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialSlashingRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"recoverTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"revokeUnclaimedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newReceiver","type":"address"}],"name":"setSlashingReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"slashingPeriodDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"slashingReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timeUntilClaimStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timeUntilDeadline","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unclaimedRevoked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"veToken","outputs":[{"internalType":"contract IVotingEscrow","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
6101a03461039b57601f611f6b38819003918201601f19168301916001600160401b038311848410176103a0578084926101409460405283398101031261039b57610049816103b6565b906020810151906040810151916060820151608083015161006c60a085016103b6565b9461007960c086016103b6565b9260e08601519461009361012061010089015198016103b6565b6001600160a01b0390981698891561038557600180546001600160a01b0319908116909155600080549182168c1781556040519b916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a360016002556001600160a01b03169485156103305781156103745742841061036357620151808310610352578415610341576001600160a01b031694851561033057612710871161031f576001600160a01b0389161580610316575b6103055760805260c0528160e052806101005281018091116102ef57610120526101405260a052610160526101805260038054610100600160a81b03191660089290921b610100600160a81b0316919091179055611ba090816103cb823960805181818161040401528181610446015281816104c00152818161073b01528181610923015281816109650152610ded015260a05181818161048c0152611443015260c05181818161031f01526114a5015260e051818181610239015281816107da01528181610bb801528181610ccd01528181610d4401528181611548015281816116880152818161178f015281816118860152611a19015261010051818181610d09015261156b0152610120518181816102960152818161080101528181610bde01528181610d8b0152818161140a01528181611591015281816117b60152818161182f01526118ad015261014051818181610b7a0152818161109c0152611510015261016051818181610c2a01528181611a680152611a9d01526101805181818161025e01528181610cac0152818161117b01526119f10152f35b634e487b7160e01b600052601160045260246000fd5b631d9efa0560e31b60005260046000fd5b50861515610152565b6307575d9560e11b60005260046000fd5b630f58058360e11b60005260046000fd5b63ac90bad360e01b60005260046000fd5b63618668a960e11b60005260046000fd5b63b6c000eb60e01b60005260046000fd5b639dd854d360e01b60005260046000fd5b631e4fbdf760e01b600052600060045260246000fd5b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b038216820361039b5756fe608080604052600436101561001357600080fd5b600090813560e01c9081630c82cfdf14611534575080632216730a146114f55780632aaaae79146114c85780632eb4a7ab1461148d5780633505151e146114725780633b92eb231461142d5780633ba86c44146113f25780633f4ba83a146113655780635c975abb146113425780635f3e849f146111bb578063663b6e421461119e5780636a7b574314611163578063715018a6146110fe57806373b2e80e146110bf57806379203dc41461108457806379ba509714610fff57806383c44a6614610fe45780638456cb5914610f645780638da5cb5b14610f3d5780639101bc0214610ee2578063934e28c714610d67578063a6a11bb114610d2c578063ab1a4d9414610cf1578063adeab43c14610c94578063b6b5d8e114610c71578063baaeac8214610c4d578063c215a19014610c12578063c4d92a7514610b5e578063d54ad2a114610b40578063dc38bdb514610b19578063e02e0fd414610a82578063e30c397814610a59578063f2fde38b146109ec578063f72d82cf14610788578063f76a97031461076a578063fc0c546a146107255763fd66ccac146101b857600080fd5b346107225760a0366003190112610722576064356001600160a01b0381169060043590604435906024358482036107205760843567ffffffffffffffff811161071c576102099036906004016115eb565b9190610213611ac6565b61021b611ae6565b85821161070d57811515928380610705575b6106f65787156106e7577f0000000000000000000000000000000000000000000000000000000000000000846102837f000000000000000000000000000000000000000000000000000000000000000083611874565b816106dd575b506106ce5742106106bf577f000000000000000000000000000000000000000000000000000000000000000042116106b057338952600560205260ff60408a2054166106a15786156106925760408051336020820190815291810189905261034b93929161034691610315919061030d81606081015b03601f1981018352826116c3565b5190206116fb565b60208151910120927f0000000000000000000000000000000000000000000000000000000000000000923691611716565b61199e565b1561068357338752600560205260408720600160ff1982541617905561037385600454611874565b6004556103808186611663565b926103a1612710610399610393426119ef565b87611861565b048095611663565b9261046f575b8361042f575b82806103fe575b505060405194855260208501526040840152606083015260808201527f9ba033e3a114c57105bae2ae65ba79c34ba75d80370c147e3b5fbe86b074183660a03392a3600160025580f35b610428917f0000000000000000000000000000000000000000000000000000000000000000611962565b38826103b4565b60035461046a90859060081c6001600160a01b03167f0000000000000000000000000000000000000000000000000000000000000000611962565b6103ad565b60405163095ea7b360e01b60208083019182526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166024840181905260448085018790528452927f0000000000000000000000000000000000000000000000000000000000000000929091908c906104f06064856116c3565b83519082865af18b513d8261065e575b505015610620575b50813b1561061c576040516329b55ca760e01b81523360048201528460248201528760448201528a8160648183875af18015610611576105fd575b506040519060208b81840163095ea7b360e01b8152856024860152816044860152604485526105736064866116c3565b84519082855af18b513d826105d8575b505015610593575b5050506103a7565b6105cb6105d0936040519063095ea7b360e01b602083015260248201528c6044820152604481526105c56064826116c3565b82611b03565b611b03565b38808061058b565b9091506105f557506001600160a01b0381163b15155b3880610583565b6001146105ee565b8a61060a919b929b6116c3565b9838610543565b6040513d8d823e3d90fd5b8980fd5b610658906105c560405163095ea7b360e01b60208201528560248201528d6044820152604481526106526064826116c3565b84611b03565b38610508565b90915061067b57506001600160a01b0382163b15155b3880610500565b600114610674565b6309bde33960e01b8752600487fd5b63843ce46b60e01b8952600489fd5b630c8d9eab60e31b8952600489fd5b63e3ea984960e01b8952600489fd5b63916da0d160e01b8952600489fd5b633fbefc3d60e11b8a5260048afd5b9050871038610289565b630f58058360e11b8952600489fd5b63eb5df6ef60e01b8952600489fd5b50851561022d565b6331ceb24b60e01b8852600488fd5b8680fd5b855b80fd5b50346107225780600319360112610722576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b50346107225780600319360112610722576020604051620151808152f35b5034610722576060366003190112610722576004356107a56115d5565b9060443567ffffffffffffffff81116109e8576107c69036906004016115eb565b92906107d0611ac6565b6107d8611ae6565b7f000000000000000000000000000000000000000000000000000000000000000042106109d9577f000000000000000000000000000000000000000000000000000000000000000042116109ca57338552600560205260ff6040862054166109bb5782156109ac576001600160a01b03821693841561099d5760408051336020820190815291810186905261087f93929161034691610315919061030d81606081016102ff565b1561098e577f29f0c8a21e522b40e408f893178873f3e9d2c870c9e3a0b737d4380cc158ad5090338552600560205260408520600160ff198254161790556108c983600454611874565b6004556127106108e16108db426119ef565b85611861565b04906108ed8285611663565b908261094e575b818061091d575b50506040805194855260208501919091528301523391606090a3600160025580f35b610947917f0000000000000000000000000000000000000000000000000000000000000000611962565b38816108fb565b60035461098990849060081c6001600160a01b03167f0000000000000000000000000000000000000000000000000000000000000000611962565b6108f4565b6309bde33960e01b8452600484fd5b630f58058360e11b8652600486fd5b63843ce46b60e01b8552600485fd5b630c8d9eab60e31b8552600485fd5b63e3ea984960e01b8552600485fd5b63916da0d160e01b8552600485fd5b8380fd5b503461072257602036600319011261072257610a066115ba565b610a0e611939565b600180546001600160a01b0319166001600160a01b0392831690811790915582549091167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227008380a380f35b50346107225780600319360112610722576001546040516001600160a01b039091168152602090f35b503461072257602036600319011261072257610a9c6115ba565b610aa4611939565b6001600160a01b038116908115610b0a5760038054610100600160a81b03198116600893841b610100600160a81b031617909155901c6001600160a01b03167fc08946ad9c5f7f5a99bdfbce07c37c1f11c254f0265f8c22ff83bef085798a778380a380f35b631d9efa0560e31b8352600483fd5b5034610722576020610b36610b2d3661161c565b92919091611881565b6040519015158152f35b50346107225780600319360112610722576020600454604051908152f35b503461072257806003193601126107225760c0600454610b9e817f0000000000000000000000000000000000000000000000000000000000000000611663565b60ff6006541660ff600354169160405193845260208401527f000000000000000000000000000000000000000000000000000000000000000060408401527f0000000000000000000000000000000000000000000000000000000000000000606084015215156080830152151560a0820152f35b503461072257806003193601126107225760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b50346107225780600319360112610722576020610c69426119ef565b604051908152f35b5034610722578060031936011261072257602060ff600654166040519015158152f35b50346107225780600319360112610722576020610c697f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611874565b503461072257806003193601126107225760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b503461072257806003193601126107225760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b503461072257602036600319011261072257610d816115ba565b610d89611939565b7f0000000000000000000000000000000000000000000000000000000000000000421115610ed3576006549060ff8216610ec4576001600160a01b038116918215610eb55760ff19166001176006556040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000906020816024816001600160a01b0386165afa908115610eaa578591610e74575b5080610e37578480f35b610e65817fc6cf1f3ec36d8acbd3ebf08a31df0bd0f8700ac116772f3c72ddebbdc9fedc7394602094611962565b604051908152a2388080808480f35b90506020813d602011610ea2575b81610e8f602093836116c3565b81010312610e9e575138610e2d565b8480fd5b3d9150610e82565b6040513d87823e3d90fd5b630f58058360e11b8452600484fd5b63905e710760e01b8352600483fd5b63a940b71f60e01b8252600482fd5b503461072257602036600319011261072257600435610f00426119ef565b610f39610f1b612710610f138486611861565b048094611663565b91604051938493846040919493926060820195825260208201520152565b0390f35b5034610722578060031936011261072257546040516001600160a01b039091168152602090f35b5034610722578060031936011261072257610f7d611939565b610f85611ae6565b600160ff1960035416176003557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a1337f7ea0f0cbc6254dd990efede5f7478d1d447be28ce3aff0480832a4d0e3ee6a6b8280a280f35b50346107225780600319360112610722576020610c6961182d565b5034610722578060031936011261072257600154336001600160a01b039091160361107157600180546001600160a01b0319908116909155815433918116821783556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b63118cdaa760e01b815233600452602490fd5b503461072257806003193601126107225760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b50346107225760203660031901126107225760209060ff906040906001600160a01b036110ea6115ba565b168152600584522054166040519015158152f35b5034610722578060031936011261072257611117611939565b600180546001600160a01b03199081169091558154908116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461072257806003193601126107225760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b5034610722576020610c696111b23661161c565b9291909161176c565b5034610722576060366003190112610722576111d56115ba565b6111dd6115d5565b6044356111e8611939565b6001600160a01b038216928315611309576040516370a0823160e01b81523060048201526001600160a01b0391909116929091602083602481875afa9283156112fe5786936112ca575b50806112c45750815b8211611288578161124a578480f35b816112797f401f439d865a766757ec78675925bd67198d5e78805aa41691b34b5d6a6cbbe69360209386611962565b604051908152a3388080808480f35b60405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b6044820152606490fd5b9161123b565b9092506020813d6020116112f6575b816112e6602093836116c3565b8101031261072057519138611232565b3d91506112d9565b6040513d88823e3d90fd5b60405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081c9958da5c1a595b9d607a1b6044820152606490fd5b5034610722578060031936011261072257602060ff600354166040519015158152f35b503461072257806003193601126107225761137e611939565b60035460ff8116156113e35760ff19166003557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a1337f510ea971abebb40f84f875485ffa74a49a5f3521a2805d4060e02e20cadb09798280a280f35b638dfc202b60e01b8252600482fd5b503461072257806003193601126107225760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b50346107225780600319360112610722576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b50346107225780600319360112610722576020610c69611686565b503461072257806003193601126107225760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b503461072257806003193601126107225760035460405160089190911c6001600160a01b03168152602090f35b50346107225780600319360112610722576020610c696004547f0000000000000000000000000000000000000000000000000000000000000000611663565b8234610722578060031936011261072257507f000000000000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060208201527f00000000000000000000000000000000000000000000000000000000000000006040820152606090f35b600435906001600160a01b03821682036115d057565b600080fd5b602435906001600160a01b03821682036115d057565b9181601f840112156115d05782359167ffffffffffffffff83116115d0576020808501948460051b0101116115d057565b60606003198201126115d0576004356001600160a01b03811681036115d05791602435916044359067ffffffffffffffff82116115d05761165f916004016115eb565b9091565b9190820391821161167057565b634e487b7160e01b600052601160045260246000fd5b7f0000000000000000000000000000000000000000000000000000000000000000804210156116bd576116ba904290611663565b90565b50600090565b90601f8019910116810190811067ffffffffffffffff8211176116e557604052565b634e487b7160e01b600052604160045260246000fd5b90604051916020830152602082526117146040836116c3565b565b9291909267ffffffffffffffff84116116e5578360051b90602060405161173f828501826116c3565b80968152019181019283116115d057905b82821061175c57505050565b8135815260209182019101611750565b91909260018060a01b038316600052600560205260ff60406000205416611824577f00000000000000000000000000000000000000000000000000000000000000004210611824577f000000000000000000000000000000000000000000000000000000000000000042116118245760ff6003541661182457604080516001600160a01b039094166020850190815290840185905261181a93610346916103159161030d81606081016102ff565b6116ba5750600090565b50505050600090565b7f0000000000000000000000000000000000000000000000000000000000000000804210156116bd576116ba904290611663565b8181029291811591840414171561167057565b9190820180921161167057565b9290927f00000000000000000000000000000000000000000000000000000000000000004210611824577f00000000000000000000000000000000000000000000000000000000000000004211611824576001600160a01b03811660009081526005602052604090205460ff166118245783156118245760ff6003541661182457604080516001600160a01b0390921660208301908152908201949094526116ba9361034691610315919061030d81606081016102ff565b6000546001600160a01b0316330361194d57565b63118cdaa760e01b6000523360045260246000fd5b60405163a9059cbb60e01b60208201526001600160a01b03929092166024830152604480830193909352918152611714916105cb6064836116c3565b929091906000915b84518310156119e757604060019160009060208660051b89010151908181106000146119db578252602052205b9201916119a6565b908252602052206119d3565b915092501490565b7f0000000000000000000000000000000000000000000000000000000000000000908115611abf577f0000000000000000000000000000000000000000000000000000000000000000808210611a9857611a498382611874565b821015611a9057611a60611a6691611a8c93611663565b83611663565b7f0000000000000000000000000000000000000000000000000000000000000000611861565b0490565b505050600090565b5050507f000000000000000000000000000000000000000000000000000000000000000090565b5050600090565b6002805414611ad55760028055565b633ee5aeb560e01b60005260046000fd5b60ff60035416611af257565b63d93c066560e01b60005260046000fd5b906000602091828151910182855af115611b5e576000513d611b5557506001600160a01b0381163b155b611b345750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b60011415611b2d565b6040513d6000823e3d90fdfea2646970667358221220e2eae18893038b3693bb3f3b76b96b970d21d8347c4c35f995eca7973b275a3a64736f6c634300081c0033000000000000000000000000defa1d21c5f1cbeac00eeb54b44c7d86467cc3a3e22ce41dcaecc2af18084d760794400b415a3e262e1c317e56ce3da89dd5e01c00000000000000000000000000000000000000000000000000000000693ab5c400000000000000000000000000000000000000000000000000000000004f1a0000000000000000000000000000000000000000000029ce3dc84bfaef11b5e387000000000000000000000000edcbd26e15c2575c8adede6712461172d4d14adb000000000000000000000000349fdff7768ed8d99107a911ee9d4a77d19dfff4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608080604052600436101561001357600080fd5b600090813560e01c9081630c82cfdf14611534575080632216730a146114f55780632aaaae79146114c85780632eb4a7ab1461148d5780633505151e146114725780633b92eb231461142d5780633ba86c44146113f25780633f4ba83a146113655780635c975abb146113425780635f3e849f146111bb578063663b6e421461119e5780636a7b574314611163578063715018a6146110fe57806373b2e80e146110bf57806379203dc41461108457806379ba509714610fff57806383c44a6614610fe45780638456cb5914610f645780638da5cb5b14610f3d5780639101bc0214610ee2578063934e28c714610d67578063a6a11bb114610d2c578063ab1a4d9414610cf1578063adeab43c14610c94578063b6b5d8e114610c71578063baaeac8214610c4d578063c215a19014610c12578063c4d92a7514610b5e578063d54ad2a114610b40578063dc38bdb514610b19578063e02e0fd414610a82578063e30c397814610a59578063f2fde38b146109ec578063f72d82cf14610788578063f76a97031461076a578063fc0c546a146107255763fd66ccac146101b857600080fd5b346107225760a0366003190112610722576064356001600160a01b0381169060043590604435906024358482036107205760843567ffffffffffffffff811161071c576102099036906004016115eb565b9190610213611ac6565b61021b611ae6565b85821161070d57811515928380610705575b6106f65787156106e7577f00000000000000000000000000000000000000000000000000000000693ab5c4846102837f000000000000000000000000000000000000000000000000000000000000000083611874565b816106dd575b506106ce5742106106bf577f000000000000000000000000000000000000000000000000000000006989cfc442116106b057338952600560205260ff60408a2054166106a15786156106925760408051336020820190815291810189905261034b93929161034691610315919061030d81606081015b03601f1981018352826116c3565b5190206116fb565b60208151910120927fe22ce41dcaecc2af18084d760794400b415a3e262e1c317e56ce3da89dd5e01c923691611716565b61199e565b1561068357338752600560205260408720600160ff1982541617905561037385600454611874565b6004556103808186611663565b926103a1612710610399610393426119ef565b87611861565b048095611663565b9261046f575b8361042f575b82806103fe575b505060405194855260208501526040840152606083015260808201527f9ba033e3a114c57105bae2ae65ba79c34ba75d80370c147e3b5fbe86b074183660a03392a3600160025580f35b610428917f000000000000000000000000defa1d21c5f1cbeac00eeb54b44c7d86467cc3a3611962565b38826103b4565b60035461046a90859060081c6001600160a01b03167f000000000000000000000000defa1d21c5f1cbeac00eeb54b44c7d86467cc3a3611962565b6103ad565b60405163095ea7b360e01b60208083019182526001600160a01b037f000000000000000000000000349fdff7768ed8d99107a911ee9d4a77d19dfff4166024840181905260448085018790528452927f000000000000000000000000defa1d21c5f1cbeac00eeb54b44c7d86467cc3a3929091908c906104f06064856116c3565b83519082865af18b513d8261065e575b505015610620575b50813b1561061c576040516329b55ca760e01b81523360048201528460248201528760448201528a8160648183875af18015610611576105fd575b506040519060208b81840163095ea7b360e01b8152856024860152816044860152604485526105736064866116c3565b84519082855af18b513d826105d8575b505015610593575b5050506103a7565b6105cb6105d0936040519063095ea7b360e01b602083015260248201528c6044820152604481526105c56064826116c3565b82611b03565b611b03565b38808061058b565b9091506105f557506001600160a01b0381163b15155b3880610583565b6001146105ee565b8a61060a919b929b6116c3565b9838610543565b6040513d8d823e3d90fd5b8980fd5b610658906105c560405163095ea7b360e01b60208201528560248201528d6044820152604481526106526064826116c3565b84611b03565b38610508565b90915061067b57506001600160a01b0382163b15155b3880610500565b600114610674565b6309bde33960e01b8752600487fd5b63843ce46b60e01b8952600489fd5b630c8d9eab60e31b8952600489fd5b63e3ea984960e01b8952600489fd5b63916da0d160e01b8952600489fd5b633fbefc3d60e11b8a5260048afd5b9050871038610289565b630f58058360e11b8952600489fd5b63eb5df6ef60e01b8952600489fd5b50851561022d565b6331ceb24b60e01b8852600488fd5b8680fd5b855b80fd5b50346107225780600319360112610722576040517f000000000000000000000000defa1d21c5f1cbeac00eeb54b44c7d86467cc3a36001600160a01b03168152602090f35b50346107225780600319360112610722576020604051620151808152f35b5034610722576060366003190112610722576004356107a56115d5565b9060443567ffffffffffffffff81116109e8576107c69036906004016115eb565b92906107d0611ac6565b6107d8611ae6565b7f00000000000000000000000000000000000000000000000000000000693ab5c442106109d9577f000000000000000000000000000000000000000000000000000000006989cfc442116109ca57338552600560205260ff6040862054166109bb5782156109ac576001600160a01b03821693841561099d5760408051336020820190815291810186905261087f93929161034691610315919061030d81606081016102ff565b1561098e577f29f0c8a21e522b40e408f893178873f3e9d2c870c9e3a0b737d4380cc158ad5090338552600560205260408520600160ff198254161790556108c983600454611874565b6004556127106108e16108db426119ef565b85611861565b04906108ed8285611663565b908261094e575b818061091d575b50506040805194855260208501919091528301523391606090a3600160025580f35b610947917f000000000000000000000000defa1d21c5f1cbeac00eeb54b44c7d86467cc3a3611962565b38816108fb565b60035461098990849060081c6001600160a01b03167f000000000000000000000000defa1d21c5f1cbeac00eeb54b44c7d86467cc3a3611962565b6108f4565b6309bde33960e01b8452600484fd5b630f58058360e11b8652600486fd5b63843ce46b60e01b8552600485fd5b630c8d9eab60e31b8552600485fd5b63e3ea984960e01b8552600485fd5b63916da0d160e01b8552600485fd5b8380fd5b503461072257602036600319011261072257610a066115ba565b610a0e611939565b600180546001600160a01b0319166001600160a01b0392831690811790915582549091167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227008380a380f35b50346107225780600319360112610722576001546040516001600160a01b039091168152602090f35b503461072257602036600319011261072257610a9c6115ba565b610aa4611939565b6001600160a01b038116908115610b0a5760038054610100600160a81b03198116600893841b610100600160a81b031617909155901c6001600160a01b03167fc08946ad9c5f7f5a99bdfbce07c37c1f11c254f0265f8c22ff83bef085798a778380a380f35b631d9efa0560e31b8352600483fd5b5034610722576020610b36610b2d3661161c565b92919091611881565b6040519015158152f35b50346107225780600319360112610722576020600454604051908152f35b503461072257806003193601126107225760c0600454610b9e817f00000000000000000000000000000000000000000029ce3dc84bfaef11b5e387611663565b60ff6006541660ff600354169160405193845260208401527f00000000000000000000000000000000000000000000000000000000693ab5c460408401527f000000000000000000000000000000000000000000000000000000006989cfc4606084015215156080830152151560a0820152f35b503461072257806003193601126107225760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b50346107225780600319360112610722576020610c69426119ef565b604051908152f35b5034610722578060031936011261072257602060ff600654166040519015158152f35b50346107225780600319360112610722576020610c697f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000693ab5c4611874565b503461072257806003193601126107225760206040517f00000000000000000000000000000000000000000000000000000000004f1a008152f35b503461072257806003193601126107225760206040517f00000000000000000000000000000000000000000000000000000000693ab5c48152f35b503461072257602036600319011261072257610d816115ba565b610d89611939565b7f000000000000000000000000000000000000000000000000000000006989cfc4421115610ed3576006549060ff8216610ec4576001600160a01b038116918215610eb55760ff19166001176006556040516370a0823160e01b81523060048201527f000000000000000000000000defa1d21c5f1cbeac00eeb54b44c7d86467cc3a3906020816024816001600160a01b0386165afa908115610eaa578591610e74575b5080610e37578480f35b610e65817fc6cf1f3ec36d8acbd3ebf08a31df0bd0f8700ac116772f3c72ddebbdc9fedc7394602094611962565b604051908152a2388080808480f35b90506020813d602011610ea2575b81610e8f602093836116c3565b81010312610e9e575138610e2d565b8480fd5b3d9150610e82565b6040513d87823e3d90fd5b630f58058360e11b8452600484fd5b63905e710760e01b8352600483fd5b63a940b71f60e01b8252600482fd5b503461072257602036600319011261072257600435610f00426119ef565b610f39610f1b612710610f138486611861565b048094611663565b91604051938493846040919493926060820195825260208201520152565b0390f35b5034610722578060031936011261072257546040516001600160a01b039091168152602090f35b5034610722578060031936011261072257610f7d611939565b610f85611ae6565b600160ff1960035416176003557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a1337f7ea0f0cbc6254dd990efede5f7478d1d447be28ce3aff0480832a4d0e3ee6a6b8280a280f35b50346107225780600319360112610722576020610c6961182d565b5034610722578060031936011261072257600154336001600160a01b039091160361107157600180546001600160a01b0319908116909155815433918116821783556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b63118cdaa760e01b815233600452602490fd5b503461072257806003193601126107225760206040517f00000000000000000000000000000000000000000029ce3dc84bfaef11b5e3878152f35b50346107225760203660031901126107225760209060ff906040906001600160a01b036110ea6115ba565b168152600584522054166040519015158152f35b5034610722578060031936011261072257611117611939565b600180546001600160a01b03199081169091558154908116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461072257806003193601126107225760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b5034610722576020610c696111b23661161c565b9291909161176c565b5034610722576060366003190112610722576111d56115ba565b6111dd6115d5565b6044356111e8611939565b6001600160a01b038216928315611309576040516370a0823160e01b81523060048201526001600160a01b0391909116929091602083602481875afa9283156112fe5786936112ca575b50806112c45750815b8211611288578161124a578480f35b816112797f401f439d865a766757ec78675925bd67198d5e78805aa41691b34b5d6a6cbbe69360209386611962565b604051908152a3388080808480f35b60405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b6044820152606490fd5b9161123b565b9092506020813d6020116112f6575b816112e6602093836116c3565b8101031261072057519138611232565b3d91506112d9565b6040513d88823e3d90fd5b60405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081c9958da5c1a595b9d607a1b6044820152606490fd5b5034610722578060031936011261072257602060ff600354166040519015158152f35b503461072257806003193601126107225761137e611939565b60035460ff8116156113e35760ff19166003557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a1337f510ea971abebb40f84f875485ffa74a49a5f3521a2805d4060e02e20cadb09798280a280f35b638dfc202b60e01b8252600482fd5b503461072257806003193601126107225760206040517f000000000000000000000000000000000000000000000000000000006989cfc48152f35b50346107225780600319360112610722576040517f000000000000000000000000349fdff7768ed8d99107a911ee9d4a77d19dfff46001600160a01b03168152602090f35b50346107225780600319360112610722576020610c69611686565b503461072257806003193601126107225760206040517fe22ce41dcaecc2af18084d760794400b415a3e262e1c317e56ce3da89dd5e01c8152f35b503461072257806003193601126107225760035460405160089190911c6001600160a01b03168152602090f35b50346107225780600319360112610722576020610c696004547f00000000000000000000000000000000000000000029ce3dc84bfaef11b5e387611663565b8234610722578060031936011261072257507f00000000000000000000000000000000000000000000000000000000693ab5c481527f00000000000000000000000000000000000000000000000000000000004f1a0060208201527f000000000000000000000000000000000000000000000000000000006989cfc46040820152606090f35b600435906001600160a01b03821682036115d057565b600080fd5b602435906001600160a01b03821682036115d057565b9181601f840112156115d05782359167ffffffffffffffff83116115d0576020808501948460051b0101116115d057565b60606003198201126115d0576004356001600160a01b03811681036115d05791602435916044359067ffffffffffffffff82116115d05761165f916004016115eb565b9091565b9190820391821161167057565b634e487b7160e01b600052601160045260246000fd5b7f00000000000000000000000000000000000000000000000000000000693ab5c4804210156116bd576116ba904290611663565b90565b50600090565b90601f8019910116810190811067ffffffffffffffff8211176116e557604052565b634e487b7160e01b600052604160045260246000fd5b90604051916020830152602082526117146040836116c3565b565b9291909267ffffffffffffffff84116116e5578360051b90602060405161173f828501826116c3565b80968152019181019283116115d057905b82821061175c57505050565b8135815260209182019101611750565b91909260018060a01b038316600052600560205260ff60406000205416611824577f00000000000000000000000000000000000000000000000000000000693ab5c44210611824577f000000000000000000000000000000000000000000000000000000006989cfc442116118245760ff6003541661182457604080516001600160a01b039094166020850190815290840185905261181a93610346916103159161030d81606081016102ff565b6116ba5750600090565b50505050600090565b7f000000000000000000000000000000000000000000000000000000006989cfc4804210156116bd576116ba904290611663565b8181029291811591840414171561167057565b9190820180921161167057565b9290927f00000000000000000000000000000000000000000000000000000000693ab5c44210611824577f000000000000000000000000000000000000000000000000000000006989cfc44211611824576001600160a01b03811660009081526005602052604090205460ff166118245783156118245760ff6003541661182457604080516001600160a01b0390921660208301908152908201949094526116ba9361034691610315919061030d81606081016102ff565b6000546001600160a01b0316330361194d57565b63118cdaa760e01b6000523360045260246000fd5b60405163a9059cbb60e01b60208201526001600160a01b03929092166024830152604480830193909352918152611714916105cb6064836116c3565b929091906000915b84518310156119e757604060019160009060208660051b89010151908181106000146119db578252602052205b9201916119a6565b908252602052206119d3565b915092501490565b7f0000000000000000000000000000000000000000000000000000000000000000908115611abf577f00000000000000000000000000000000000000000000000000000000693ab5c4808210611a9857611a498382611874565b821015611a9057611a60611a6691611a8c93611663565b83611663565b7f0000000000000000000000000000000000000000000000000000000000000000611861565b0490565b505050600090565b5050507f000000000000000000000000000000000000000000000000000000000000000090565b5050600090565b6002805414611ad55760028055565b633ee5aeb560e01b60005260046000fd5b60ff60035416611af257565b63d93c066560e01b60005260046000fd5b906000602091828151910182855af115611b5e576000513d611b5557506001600160a01b0381163b155b611b345750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b60011415611b2d565b6040513d6000823e3d90fdfea2646970667358221220e2eae18893038b3693bb3f3b76b96b970d21d8347c4c35f995eca7973b275a3a64736f6c634300081c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000defa1d21c5f1cbeac00eeb54b44c7d86467cc3a3e22ce41dcaecc2af18084d760794400b415a3e262e1c317e56ce3da89dd5e01c00000000000000000000000000000000000000000000000000000000693ab5c400000000000000000000000000000000000000000000000000000000004f1a0000000000000000000000000000000000000000000029ce3dc84bfaef11b5e387000000000000000000000000edcbd26e15c2575c8adede6712461172d4d14adb000000000000000000000000349fdff7768ed8d99107a911ee9d4a77d19dfff4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _token (address): 0xDeFA1D21c5F1cbeac00eeB54B44C7D86467cc3a3
Arg [1] : _merkleRoot (bytes32): 0xe22ce41dcaecc2af18084d760794400b415a3e262e1c317e56ce3da89dd5e01c
Arg [2] : _claimStartTime (uint256): 1765455300
Arg [3] : _claimDuration (uint256): 5184000
Arg [4] : _totalAllocation (uint256): 50539905783964774899770247
Arg [5] : _owner (address): 0xedCbD26e15c2575c8adEdE6712461172d4d14AdB
Arg [6] : _veToken (address): 0x349FDFF7768ed8d99107a911eE9d4a77d19DFFf4
Arg [7] : _initialSlashingRate (uint256): 0
Arg [8] : _slashingPeriodDuration (uint256): 0
Arg [9] : _slashingReceiver (address): 0x0000000000000000000000000000000000000000
-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 000000000000000000000000defa1d21c5f1cbeac00eeb54b44c7d86467cc3a3
Arg [1] : e22ce41dcaecc2af18084d760794400b415a3e262e1c317e56ce3da89dd5e01c
Arg [2] : 00000000000000000000000000000000000000000000000000000000693ab5c4
Arg [3] : 00000000000000000000000000000000000000000000000000000000004f1a00
Arg [4] : 00000000000000000000000000000000000000000029ce3dc84bfaef11b5e387
Arg [5] : 000000000000000000000000edcbd26e15c2575c8adede6712461172d4d14adb
Arg [6] : 000000000000000000000000349fdff7768ed8d99107a911ee9d4a77d19dfff4
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 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.