A flexible and secure staking smart contract system supporting both ERC20 and ERC721 tokens, with customizable reward strategies and safe transfer mechanisms.
- Supports ERC20 and ERC721 staking: Users can stake fungible or non-fungible tokens.
- Customizable reward strategies: Easily implement and plug in new reward logic.
- Safe transfer: Assets are transferred securely during staking and withdrawal.
- Upgradeable architecture: Proxy design allows for contract upgrades.
- Comprehensive testing: Includes JavaScript/Hardhat-based test suite.
- Well-documented: Protocol specification PDF included.
contracts/
RewardStrategyFactory.sol
core/
interfaces/
proxy/
strategies/
test/
test/
StakingProtocol.test.js
scripts/
hardhat.config.js
package.json
README.md
Staking Protocol.pdf
-
Install dependencies:
yarn install # or npm install
-
Compile contracts:
npx hardhat compile
-
Run tests:
npx hardhat test
-
Deploy contracts: Edit deployment scripts in the
scripts/
directory and run with Hardhat.
- RewardStrategyFactory.sol: Factory for creating/managing reward strategies.
- core/: Core protocol logic and state management.
- interfaces/: Interface contracts for staking and token standards.
- proxy/: Upgradeability/proxy contracts.
- strategies/: Implementations of various reward strategies.
- test/: Test contracts and JavaScript tests.
- scripts/: Deployment and utility scripts.
- See
Staking Protocol.pdf
for the protocol specification and detailed explanation. - The
report/
directory may contain audit or coverage reports.
See LICENSE.
Note: For a full directory listing, visit the repository contents page.