EeseeMining
EeseeMining
Claim
Claim: {rewardID} - RewardID the tokens are claimed for. {balance} - Amount of tokens to claim. {merkleProof} - Merkle proof to verify claim.
struct Claim {
uint128 rewardID;
uint128 balance;
bytes32[] merkleProof;
}
ESE
contract IERC20 ESE
ESE token.
rewardID
uint128 rewardID
Current reward ID.
rewardRoot
mapping(uint128 => bytes32) rewardRoot
Maps {rewardID} to its merkle root.
isClaimed
mapping(address => mapping(uint128 => bool)) isClaimed
Has address claimed reward for {rewardID}.
MERKLE_ROOT_UPDATER_ROLE
bytes32 MERKLE_ROOT_UPDATER_ROLE
Merkle root updater role in {accessManager}.
RewardAdded
event RewardAdded(uint128 rewardID, bytes32 merkleRoot)
RewardClaimed
event RewardClaimed(uint128 rewardID, address claimer, uint128 amount)
InvalidMerkleProof
error InvalidMerkleProof()
AlreadyClaimed
error AlreadyClaimed()
InvalidESE
error InvalidESE()
MerkleRootNotExists
error MerkleRootNotExists()
claimRewards
function claimRewards(struct EeseeMining.Claim[] claims, address claimer) external returns (uint256 rewards)
Claims rewards for multiple {rewardID}s. Emits {RewardClaimed} event for each reward claimed.
Parameters
claims
struct EeseeMining.Claim[]
- Claim structs.
claimer
address
- Address to claim rewards for.
addReward
function addReward(bytes32 merkleRoot) external
Adds new merkle root and advances to the next {rewardID}. Emits {RewardAdded} event.
Parameters
merkleRoot
bytes32
- Merkle root.
Note: This function can only be called by the MERKLE_ROOT_UPDATER_ROLE.
getRewards
function getRewards(address claimer, struct EeseeMining.Claim[] claims) external view returns (uint128 rewards)
Verifies {claims} and returns rewards to be claimed from {claims}.
Parameters
claimer
address
- Address to check.
claims
struct EeseeMining.Claim[]
- Claims to check.
Return Values
rewards
uint128
- Rewards to be claimed.
verifyClaim
function verifyClaim(address claimer, struct EeseeMining.Claim claim) public view returns (bool)
Verifies {claim} for {claimer}.
Parameters
claimer
address
- Address to verify claim for.
claim
struct EeseeMining.Claim
- Claim to verify.
Return Values
[0]
bool
bool - Does {claim} exist in merkle root.
Inherited from EeseeRoleHandler
Inherited from ERC2771Context
isTrustedForwarder
function isTrustedForwarder(address forwarder) public view virtual returns (bool)
Last updated