EpochBasedTokenClaim

Contract to claim rewards based on epoch and merkle tree (used for Arbitrum STIP trading incentives)

Methods

acceptOwnership

function acceptOwnership() external nonpayable

The new owner accepts the ownership transfer.

claimMultipleRewards

function claimMultipleRewards(uint256[] _epochs, uint256[] _rewardAmounts, bytes32[][] _proofs) external nonpayable

Claims trader rewards for multiple _epochs

Parameters

NameTypeDescription

_epochs

uint256[]

undefined

_rewardAmounts

uint256[]

undefined

_proofs

bytes32[][]

undefined

claimRewards

function claimRewards(uint256 _epoch, uint256 _rewardAmount, bytes32[] _proof) external nonpayable

Claims trader rewards for a specific _epoch

Parameters

NameTypeDescription

_epoch

uint256

undefined

_rewardAmount

uint256

undefined

_proof

bytes32[]

undefined

epochCids

function epochCids(uint256) external view returns (string)

Parameters

NameTypeDescription

_0

uint256

undefined

Returns

NameTypeDescription

_0

string

undefined

epochRoots

function epochRoots(uint256) external view returns (bytes32)

Parameters

NameTypeDescription

_0

uint256

undefined

Returns

NameTypeDescription

_0

bytes32

undefined

epochTraderClaimed

function epochTraderClaimed(uint256, address) external view returns (bool)

Parameters

NameTypeDescription

_0

uint256

undefined

_1

address

undefined

Returns

NameTypeDescription

_0

bool

undefined

manager

function manager() external view returns (address)

Returns

NameTypeDescription

_0

address

undefined

owner

function owner() external view returns (address)

Returns the address of the current owner.

Returns

NameTypeDescription

_0

address

undefined

pendingOwner

function pendingOwner() external view returns (address)

Returns the address of the pending owner.

Returns

NameTypeDescription

_0

address

undefined

renounceOwnership

function renounceOwnership() external nonpayable

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.

rewardToken

function rewardToken() external view returns (contract IERC20)

Returns

NameTypeDescription

_0

contract IERC20

undefined

setManager

function setManager(address _manager) external nonpayable

Sets manager address to _manager. Only callable by owner() (multisig)

Parameters

NameTypeDescription

_manager

address

undefined

setRoot

function setRoot(uint256 _epoch, bytes32 _root, uint256 _totalRewards, string _cid) external nonpayable

Sets Merkle Tree _root and '_cid' for an _epoch and transfers _totalRewards from the owner() (multisig) to this contract. Only callable by manager.

Parameters

NameTypeDescription

_epoch

uint256

undefined

_root

bytes32

undefined

_totalRewards

uint256

undefined

_cid

string

undefined

transferOwnership

function transferOwnership(address newOwner) external nonpayable

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.

Parameters

NameTypeDescription

newOwner

address

undefined

withdrawTokens

function withdrawTokens() external nonpayable

Prevents stuck tokens in case of misconfiguration; Only owner() (multisig) can claim the tokens back

Events

EpochMerkleRootSet

event EpochMerkleRootSet(uint256 indexed epoch, bytes32 root, uint256 totalRewards, string cid)

Parameters

NameTypeDescription

epoch indexed

uint256

undefined

root

bytes32

undefined

totalRewards

uint256

undefined

cid

string

undefined

ManagerUpdated

event ManagerUpdated(address newManager)

Parameters

NameTypeDescription

newManager

address

undefined

OwnershipTransferStarted

event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner)

Parameters

NameTypeDescription

previousOwner indexed

address

undefined

newOwner indexed

address

undefined

OwnershipTransferred

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Parameters

NameTypeDescription

previousOwner indexed

address

undefined

newOwner indexed

address

undefined

TokensClaimed

event TokensClaimed(uint256[] epochs, address indexed user, uint256 rewardAmount)

Parameters

NameTypeDescription

epochs

uint256[]

undefined

user indexed

address

undefined

rewardAmount

uint256

undefined

TokensWithdrawn

event TokensWithdrawn()

Errors

AddressZero

error AddressZero()

AlreadyClaimed

error AlreadyClaimed()

ArrayLengthMismatch

error ArrayLengthMismatch()

CidZero

error CidZero()

EpochNotSet

error EpochNotSet()

InvalidEpochs

error InvalidEpochs()

InvalidProof

error InvalidProof()

NotEnoughBalance

error NotEnoughBalance()

NotManager

error NotManager()

RewardsZero

error RewardsZero()

RootAlreadySet

error RootAlreadySet()

RootZero

error RootZero()