https://github.com/zaryab2000/brb_staking_contract
A staking contract with foundry for BRB Solidity Workshop
https://github.com/zaryab2000/brb_staking_contract
Last synced: about 1 year ago
JSON representation
A staking contract with foundry for BRB Solidity Workshop
- Host: GitHub
- URL: https://github.com/zaryab2000/brb_staking_contract
- Owner: zaryab2000
- Created: 2024-06-13T07:42:37.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-13T08:09:47.000Z (about 2 years ago)
- Last Synced: 2025-01-31T21:11:28.158Z (over 1 year ago)
- Language: Solidity
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## BRB Staking with Foundry
### Details of Staking Contract:
* Initialization Requirement: “Users must be able to initialize their staking profile.”
* Staking Tokens: “Users should be able to stake ERC20 tokens in the contract.”
* Lockup Period: “A 7-day lockup period must be enforced before users can unstake their tokens.”
* Unstaking Tokens: “Users should be able to unstake their tokens after the 7-day lockup period.”
* Fixed Reward: “Upon successful unstaking after the lockup period, users should receive a fixed reward of 100 tokens.”
* Reward Addition by Admin: “The admin should be able to add tokens to the reward pool.”
### Details on Foundry Framework
**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
https://book.getfoundry.sh/
## 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
```