EpochBasedTokenClaim
Contract to claim rewards based on epoch and merkle tree (used for Arbitrum STIP trading incentives)
rewardToken
contract IERC20 rewardTokenmanager
address managerepochRoots
mapping(uint256 => bytes32) epochRootsepochCids
mapping(uint256 => string) epochCidsepochTraderClaimed
mapping(uint256 => mapping(address => bool)) epochTraderClaimedManagerUpdated
TokensWithdrawn
EpochMerkleRootSet
TokensClaimed
TokensClaimed
AddressZero
NotManager
RootAlreadySet
RootZero
RewardsZero
CidZero
InvalidEpochs
ArrayLengthMismatch
EpochNotSet
NotEnoughBalance
AlreadyClaimed
InvalidProof
constructor
onlyManager
setManager
Sets manager address to _manager. Only callable by owner() (multisig)
setRoot
_Sets Merkle Tree _root and 'cid' for an _epoch and transfers _totalRewards from the owner() (multisig) to this contract. Only callable by manager.
withdrawTokens
Prevents stuck tokens in case of misconfiguration; Only owner() (multisig) can claim the tokens back
claimRewards
Claims trader rewards for a specific _epoch
claimMultipleRewards
Claims trader rewards for multiple _epochs
_hashLeaf
Returns a hashed leaf of _user + _amount
_validateClaim
_Validates that:
The
_epochmerkle tree root is setThere are enough token rewards in the contract
Rewards for leaf are unclaimed
The
leafand_proofvalidate againstepochRoot_
Was this helpful?