MultiMerkleDistributorV2

questRewardToken

mapping(uint256 => address) questRewardToken

Mapping listing the reward token associated to each Quest ID

rewardTokens

mapping(address => bool) rewardTokens

Mapping of tokens this contract is or was distributing

questClosedPeriods

mapping(uint256 => uint256[]) questClosedPeriods

List of Closed QuestPeriods by Quest ID

questMerkleRootPerPeriod

mapping(uint256 => mapping(uint256 => bytes32)) questMerkleRootPerPeriod

Merkle Root for each period of a Quest (indexed by Quest ID)

questRewardsPerPeriod

mapping(uint256 => mapping(uint256 => uint256)) questRewardsPerPeriod

Amount of rewards for each period of a Quest (indexed by Quest ID)

questBoard

address questBoard

Address of the QuestBoard contract

lootCreator

address lootCreator

Address of the Loot Creator contract

Claimed

event Claimed(uint256 questID, uint256 period, uint256 index, uint256 amount, address rewardToken, address account)

Event emitted when a user Claims

NewQuest

event NewQuest(uint256 questID, address rewardToken)

Event emitted when a New Quest is added

QuestPeriodUpdated

event QuestPeriodUpdated(uint256 questID, uint256 period, bytes32 merkleRoot)

Event emitted when a Period of a Quest is updated (when the Merkle Root is added)

LootCreatorUpdated

event LootCreatorUpdated(address oldCreator, address newCreator)

Event emitted when the Loot Creator address is updated

isClaimed

function isClaimed(uint256 questID, uint256 period, uint256 index) public view returns (bool)

Checks if the rewards were claimed for a user on a given period

Parameters

NameTypeDescription

questID

uint256

ID of the Quest

period

uint256

Amount of underlying to borrow

index

uint256

Index of the claim

Return Values

NameTypeDescription

[0]

bool

bool : true if already claimed

claim

function claim(uint256 questID, uint256 period, uint256 index, address account, uint256 amount, bytes32[] merkleProof) public

Claims the reward for a user for a given period of a Quest

Parameters

NameTypeDescription

questID

uint256

ID of the Quest

period

uint256

Timestamp of the period

index

uint256

Index in the Merkle Tree

account

address

Address of the user claiming the rewards

amount

uint256

Amount of rewards to claim

merkleProof

bytes32[]

Proof to claim the rewards

ClaimParams

struct ClaimParams {
  uint256 questID;
  uint256 period;
  uint256 index;
  uint256 amount;
  bytes32[] merkleProof;
}

multiClaim

function multiClaim(address account, struct MultiMerkleDistributorV2.ClaimParams[] claims) external

Claims multiple rewards for a given list

Parameters

NameTypeDescription

account

address

Address of the user claiming the rewards

claims

struct MultiMerkleDistributorV2.ClaimParams[]

List of ClaimParams struct data to claim

claimQuest

function claimQuest(address account, uint256 questID, struct MultiMerkleDistributorV2.ClaimParams[] claims) external

Claims the reward for all the given periods of a Quest, and transfer all the rewards at once

Parameters

NameTypeDescription

account

address

Address of the user claiming the rewards

questID

uint256

ID of the Quest

claims

struct MultiMerkleDistributorV2.ClaimParams[]

List of ClaimParams struct data to claim

getClosedPeriodsByQuests

function getClosedPeriodsByQuests(uint256 questID) external view returns (uint256[])

Returns all current Closed periods for the given Quest ID

Parameters

NameTypeDescription

questID

uint256

ID of the Quest

Return Values

NameTypeDescription

[0]

uint256[]

uint256[] : List of closed periods

addQuest

function addQuest(uint256 questID, address token) external returns (bool)

Adds a new Quest to the listing

Parameters

NameTypeDescription

questID

uint256

ID of the Quest

token

address

Address of the ERC20 reward token

Return Values

NameTypeDescription

[0]

bool

bool : success

addQuestPeriod

function addQuestPeriod(uint256 questID, uint256 period, uint256 totalRewardAmount) external returns (bool)

Adds a new period & the rewards of this period for a Quest

Parameters

NameTypeDescription

questID

uint256

ID of the Quest

period

uint256

Timestamp of the period

totalRewardAmount

uint256

Total amount of rewards to distribute for the period

Return Values

NameTypeDescription

[0]

bool

bool : success

fixQuestPeriod

function fixQuestPeriod(uint256 questID, uint256 period, uint256 newTotalRewardAmount) external returns (bool)

updateQuestPeriod

function updateQuestPeriod(uint256 questID, uint256 period, uint256 totalAmount, bytes32 merkleRoot) external returns (bool)

Updates the period of a Quest by adding the Merkle Root

Parameters

NameTypeDescription

questID

uint256

ID of the Quest

period

uint256

timestamp of the period

totalAmount

uint256

sum of all rewards for the Merkle Tree

merkleRoot

bytes32

MerkleRoot to add

Return Values

NameTypeDescription

[0]

bool

bool: success

Last updated