https://github.com/qiaopengjun5162/stakingrewards
https://github.com/qiaopengjun5162/stakingrewards
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/qiaopengjun5162/stakingrewards
- Owner: qiaopengjun5162
- Created: 2024-07-24T10:46:05.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-07-26T12:46:35.000Z (10 months ago)
- Last Synced: 2024-07-26T18:34:13.540Z (10 months ago)
- Language: Solidity
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Foundry
**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**
Foundry consists of:
- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools).
- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network.
- **Chisel**: Fast, utilitarian, and verbose solidity REPL.## Documentation
## Usage
### Build
```shell
forge build
```### Test
```shell
forge test
```### Format
```shell
forge fmt
```### Gas Snapshots
```shell
forge snapshot
```### Anvil
```shell
anvil
```### Deploy
```shell
forge script script/Counter.s.sol:CounterScript --rpc-url --private-key
```### Cast
```shell
cast
```### Help
```shell
forge --help
anvil --help
cast --help
➜ forge test --match-path ./test/StakingRewardsTest.sol --show-progress -vvvv > remappings.txt
```一个质押挖矿合约,实现如下功能:
1. 用户随时可以质押项目方代币 RNT(自定义的ERC20) ,开始赚取项目方Token(esRNT);
2. 可随时解押提取已质押的 RNT;
3. 可随时领取esRNT奖励,每质押1个RNT每天可奖励 1 esRNT;
4. esRNT 是锁仓性的 RNT, 1 esRNT 在 30 天后可兑换 1 RNT,随时间线性释放,支持提前将 esRNT 兑换成 RNT,但锁定部分将被 burn 燃烧掉。# StakingRewards