This repo contains the staking smart contracts based on Synthetix to be used on Euler.
yarn
npx hardhat test
- Solidity compiler set to ^0.8.0 which required some syntactic changes
- Got rid of
SafeMath
andSafeDecimalMath
libraries throughout the smart contracts - In
RewardsDistribution.sol
got rid ofRewardEscrow
andFeePoolProxy
references along with related functionalities. Modified contract to enforce success on everynotifyRewardAmount()
call (it means that each staking contract must implementRewardsDistributionRecipient.sol
) - In
StakingRewards.sol
used own safe transfer functions instead of keeping OpenZeppelin dependencies.rewardsToken
andstakingToken
variables have been changed to immutables.notifyRewardAmount()
has been modified so that it's not possible to to add more rewards before current staking period is over (prevents from calling the function multiple times and drainingRewardsDistribution
contract) - In
IRewardsDistribution.sol
andIStakingRewards.sol
removed unnecessary view functions for public variables - Added Euler sub-accounts support. For that functions
stake()
,withdraw()
andexit()
functions ofStakingRewards.sol
were overloaded