An open API service indexing awesome lists of open source software.

https://github.com/qiaopengjun5162/stakingrewards


https://github.com/qiaopengjun5162/stakingrewards

Last synced: 2 months ago
JSON representation

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