Welcome to GrayChain — a simple yet secure smart contract system built on Solidity.
This project contains two core components:
- GrayToken (GRE) – A custom ERC20 token with
mintandburnfunctionality. - GrayVault – A secure vault that lets users deposit and withdraw GRE tokens safely.
This project is designed for learning, experimenting, and showcasing Solidity development with a strong emphasis on security practices (using OpenZeppelin, Pausable, ReentrancyGuard, and SafeERC20).
-
✅ GrayToken (GRE)
- Standard ERC20 token
- Minting and burning by the contract owner
- Useful for testing vault interactions
-
✅ GrayVault
- Deposit GRE tokens into the vault
- Withdraw tokens at any time
- Emergency withdraw (only possible if the vault is paused)
- Contract owner can pause/unpause
- Protected against reentrancy
- Events emitted for every critical action
-
✅ Testing
- Full unit tests and fuzz tests written in Foundry
- Includes invariants to ensure vault safety
- Covers edge cases like zero deposits, over-withdraws, and paused state
Make sure you have Foundry installed.
Clone the repository:
git clone https://github.com/YOUR_USERNAME/GrayVault.git
cd GrayVault
forge build
forge test# GrayChain