cjhare / separate-staking-reward-erc4626-vault Goto Github PK
View Code? Open in Web Editor NEWA ERC4626 Vault that hands out rewards in the vein of Masterchef V2
License: Apache License 2.0
A ERC4626 Vault that hands out rewards in the vein of Masterchef V2
License: Apache License 2.0
New function to allow the staker to withdraw their stake and forfeit any and all rewards for their time staking that are owed.
The contract has a trust assumption that the admin will transfer adequate rewards in a timely fashion (as withdraw will revert when there aren't enough rewards), this function will keep the users stake safu.
Mutation of emergency withdraw on asset and shares is identical to a normal withdraw.
Avoid re-entrancy and reduce gas overhead by having a private harvest function, with a public pass on (exposer(
On a GitHub release, using GitHub actions create a NPM release and push to NPM (using secret tokens).
Rename the GitHub repo to include the term ERC 4626
The vault being a specialization of the ERC4626 implementation, including that term in the title gives a better intuitive description.
Some public function can be made 'external' and others 'private', besides better encapsulation, 'external' costs less gas that 'public', ...'private' even less.
The rewards split amongst shareholders is currently hardcoded as one per a block, have this value be an input argument for the constructor.
ERC20 Token sweeper; a mechanism for recovering tokens that have been transferred to the contract.
Restriction: the asset may only be recovered when there are no shares remaining.
Security: contract to have a owner (Ownable) with the recovery function being guarded by
isOwner` modifier.
@CjHare Very good idea, this is probably the first ERC-4626 vault implementation where the reward token is different from the underlying token!
Is it production ready yet, or are there still things to be added? ๐
Get rid of the mock ERC20 and use the Waffle mock ERC20!
Also verify events are emitted.
https://ethereum-waffle.readthedocs.io/en/latest/getting-started.html#writing-tests
Convert the usage of msg.sender
to OZ Context
's sender()
to support gasless operations using a paymaster.
Add Slither to the project, as dependency, with sensible configuration and as part of CI.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.