This repository serves as a central hub for contracts related to ArcadeDAO and its initiatives. It represents a collective effort shaped by the community and for the community.
ArcadeStakingRewards is inspired by the Synthetix StakingRewards system. The contract facilitates a staking mechanism where users can stake ERC20 tokens stakingToken
to earn rewards over time in the form of another ERC20 token rewardsToken
. The rewards depend on the amount staked and the duration of the stake.
- Multiple Deposits: Users can make multiple deposits, with each deposit accruing rewards independently until the staking period ends.
- Lock Period: Upon staking, users must commit to a fixed lock period, during which funds are immovable. Early withdrawal before this period ends is not permitted.
- Automatic Re-staking: Post-lock period, funds automatically enter the next staking cycle without a lock period, allowing for withdrawal at any time.
- Bonus Multipliers: The contract offers bonus multipliers based on the chosen lock period (short, medium, or long), incentivizing longer commitments.
- Reward Calculation: Total reward = staked amount + (staked amount * chosen duration multiplier).
- Iteration Limits: Functions like
exitAll()
andclaimRewardAll()
have a limit on iterations to prevent exceeding the block gas limit. - MAX_DEPOSITS: A cap (defined by
MAX_DEPOSITS
variable) is set on the number of deposits per wallet to manage iterations within a single transaction. Users needing more stakes must use additional wallet addresses.
ArcadeStakingRewards.sol
utilizes the Council Kit LockingVault deployment here as its governance operations foundation.
-
Voting Power: Staking tokens grant users voting power in ArcadeDAO governance. A user’s voting power is determined by the quantity of ARCDWETH tokens they have committed and its representation of the user’s ARCD holdings in the ARCDWETH UniswapV2Pair contract. To calculate the user's voting power, a conversion rate is set in the locking pool at deployment time. The user’s voting power is the product of their deposited ARCDWETH stake amount and this conversion rate.
-
Automatic Delegation: Voting power is automatically accrued and delegated without additional transactions by the user.
- Utilization of Unaccrued Reward Tokens: Un-accrued reward tokens should be incorporated into new
reward
amounts specified in futurenotifyRewardAmount()
calls. This is necessary because these tokens cannot be retrieved byrecoverERC20()
unless the contract'stotalSupply()
equals zero, a condition that may never be met given the likelihood of continuous stakeholder participation.
To build and test, use:
- Build:
$ forge build
- Test:
$ forge test