Bribe
Contract for third parties to bribe sDYSON holders into depositing their sDYSON in certain Gauge contract. Each Bribe contract is paired with one Gauge contract. Third parties can add multiple tokens as rewards. Please refer to Sponsorship section in our white paper to learn more.
addReward
Adds a reward of a given token to a specific week. Below is an introduction to what the function does:
Require Statement:
Ensures that the specified week is either the present week or a future week.
Token Transfer:
Transfers the specified amount of tokens from the caller's address to the Bribe contract.
Update Total Reward:
Increases the total reward amount for the given token and week by the specified amount.
This function is designed to be used by third parties to contribute rewards to the Bribe contract for specific tokens and weeks. The require
statement ensures that rewards cannot be added for past weeks. The function provides transparency by emitting an event for every reward addition.
Parameters:
_claimReward
Claims the reward by the user for a specific token and week. Below is the key actions in the function:
Require Statements:
Ensures that the specified week is in the past.
Ensures that the user has not already claimed the reward for the given token and week.
User and Total Votes Calculation:
Retrieves the user's voting power (
userVotes
) and the total voting power (totalVotes
) for the specified week from the associated Gauge contract.
Reward Calculation:
Calculates the amount of reward the user is eligible to claim based on their voting power relative to the total voting power.
Mark as Claimed:
Marks the reward as claimed for the user, preventing duplicate claims.
This function is internal and is used internally by the contract. It calculates and facilitates the claiming of rewards for a user for a specific token and week.
Parameters:
Return Values:
claimReward
Enables sDYSON holders to claim rewards for a specific token and week based on _claimReward
.
Parameters:
Return Values:
claimRewards
Claims multiple rewards by the user for a specific token and multiple weeks based on _claimReward
.
Parameters:
Return Values:
claimRewardsMultipleTokens
Claims multiple rewards for multiple tokens and multiple weeks based on _claimReward
.
Parameters:
Return Values:
Last updated