LootCreator
Contract handling the Budget for gauges & Quests and the Loot creation. The budget allocated to each Quest for each period is based on the weight of a gauge received through votes on the LootVoteController, and the number of Quest on each gauge. All unallocated budget is pushed back to the pending budget for the next period. The rewards allocated to Quest voters are allocated by this contract (which creates the Loot), based on the Quest allocation, the user voting rewards and the user boosting power. All rewards not allocated to an user for its Loot (by lack of boosting power) are pushed back to the pending budget for the next period. Each period budget is pulled from the LootBudget or the LootGauge.
BASE_MULTIPLIER
Base Multiplier for Loot rewards
MAX_MULTIPLIER
Max Multiplier for Loot rewards
Budget
Budget struct
Allocation
Allocation strcut
CreateVars
Struct use in memory for Loot creation method
loot
Address of the Loot contract
lootVoteController
Address of the Loot Vote Controller contract
holyPower
Address of the HolyPalPower contract
lootGauge
Address of the Loot Gauge or Budget contract
allowedDistributors
Quest Distributors allowed to intract with this contract
distributorsBoards
QuestBoard for each Distributor
distributors
List of listed Quest Distributors
nextBudgetUpdatePeriod
Timestamp of the next Budget update
pendingBudget
Current pending budget to be used during next period
periodBudget
Budgets for each period
allocatedBudgetHistory
History of allocated amounts from the Budget of each period
gaugeBudgetPerPeriod
Budget allocated to a Gauge for each period
isGaugeAllocatedForPeriod
Was the gauge allocated a Budget for each period
totalQuestPeriodRewards
Total Rewards distributed for a period for a Quest
totalQuestPeriodSet
Was the total reward set for a Quest period
userQuestPeriodRewards
User claimed amount for a Quest period
userQuestPeriodCreated
User created Loot for a Quest period
Init
Event emitted when the contract is initialized
NewDistributorListed
Event emitted when a new Distributor is listed
DistributorUnlisted
Event emitted when Distributor is unlisted
GaugeUpdated
Event emitted when the budget Gauge is updated
LootCreated
Event emitted when a Loot is created
getBudgetForPeriod
Returns the global budget for a period
Parameters
period
uint256
Timestamp of the period
Return Values
palAmount
uint256
(uint256) : Amount of PAL tokens allocated for the period
extraAmount
uint256
(uint256) : Amount of extra tokens allocated for the period
getGaugeBudgetForPeriod
Returns the gauge budget for a period
Parameters
gauge
address
Address of the gauge
period
uint256
Timestamp of the period
Return Values
palAmount
uint256
(uint256) : Amount of PAL tokens allocated for the period
extraAmount
uint256
(uint256) : Amount of extra tokens allocated for the period
getQuestAllocationForPeriod
Returns the allocation for a Quest for a period
Parameters
questId
uint256
ID of the Quest
distributor
address
Address of the Distributor handling the Quest rewards
period
uint256
Timestamp of the period
Return Values
palPerVote
uint256
(uint256) : Amount of PAL tokens allocated for the period
extraPerVote
uint256
(uint256) : Amount of extra tokens allocated for the period
getListedDistributors
Returns all listed Distributors
Return Values
[0]
address[]
uint256 : List of Distributors
createLoot
Creates a Loot for a user
Parameters
user
address
Address of the user
distributor
address
Address of the Distributor handling the Quest rewards
questId
uint256
ID of the Quest
period
uint256
Timestamp of the period
createMultipleLoot
Creates multiple Loots for a user
Parameters
user
address
Address of the user
params
struct ILootCreator.MultiCreate[]
Quest claim parameters (distributor, questId, period)
notifyQuestClaim
Notifies of a Quest claim
Parameters
user
address
Address of the user
questId
uint256
ID of the Quest
period
uint256
Timestamp of the period
claimedAmount
uint256
Amount of rewards claimed by the user
notifyDistributedQuestPeriod
Notifies of a Quest period distribution
Parameters
questId
uint256
ID of the Quest
period
uint256
Timestamp of the period
totalRewards
uint256
Total amount of rewards distributed for the period for the Quest
notifyAddedRewardsQuestPeriod
Notifies of the amount added to a Quest period via emergency update in Distributors
Parameters
questId
uint256
ID of the Quest
period
uint256
Timestamp of the period
addedRewards
uint256
Amount added to the total
notifyUndistributedRewards
Notifies of undistributed rewards
Parameters
palAmount
uint256
Amount of PAL tokens slashed
notifyNewBudget
Notifies of new budget
Parameters
palAmount
uint256
Amount of PAL tokens added to the budget
extraAmount
uint256
Amount of extra tokens added to the budget
updatePeriod
Updates the period
Last updated