Skip to content

A simple vault that holds a deposit from users and disperses a reward based on percentage allocation

Notifications You must be signed in to change notification settings

0xpluto/simple-vault

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Vault

Users can deposit eth into the contract to lock for minimum a week. There are week long time periods for users to deposit eth and collect rewards from.

This was just a fun silly little experiment. This contract should not be used in production (it doesn't make any money)

Notes

  • Rewards will not finish collecting until team calls releaseRewards. Only until then will a new collecting period start

  • If the team does not releaseRewards after a week of collecting during the current period then users will keep depositing into the previous week

Security Considerations

  • Contract owner should submit the releaseRewards transaction to a private bundle to prevent sandwiching this transaction and collecting majority of rewards for given time period. For example, there is 10 total eth in a time period lock up. The owner submits the tx to release rewards. Searcher front runs this with a majority allocation deposit of eth. After the rewards released they claim their rewards and other users unknowningly get very little rewards. (To fix this, weight rewards by time in vault and size of deposit)

About

A simple vault that holds a deposit from users and disperses a reward based on percentage allocation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published