Skip to content

SaadAbdullah72/ERC20-TOKEN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(ERC20-TOKEN Project)

# 🔥 OurToken - ERC20 Token Using Foundry

A blazing fast, fully tested ERC20 token project built using [Foundry](https://github.com/foundry-rs/foundry), OpenZeppelin, and Solidity. This project demonstrates how to create, test, and deploy an ERC20 token with modern Ethereum tooling.

---

## 🧱 Tech Stack

- [Foundry](https://github.com/foundry-rs/foundry) – Rust-based Ethereum dev toolkit
- Solidity (v0.8.19)
- [OpenZeppelin Contracts](https://github.com/OpenZeppelin/openzeppelin-contracts)
- Forge (Testing & Scripting)
- Anvil (Local Ethereum Node)
- Cast (On-chain CLI Tools)

---

## 📦 Project Structure

ERC20-TOKEN/ ├── lib/ # Dependencies (OpenZeppelin, forge-std) ├── out/ # Forge build output ├── src/ │ └── OurToken.sol # ERC20 contract ├── script/ │ └── DeployOurToken.s.sol # Deployment script ├── test/ │ └── OurTokenTest.t.sol # Unit tests ├── foundry.toml # Foundry config └── README.md # You're here!


---

## 🔐 Contract Details

### ✅ `OurToken.sol`

```solidity
contract OurToken is ERC20 {
    constructor(uint256 initialSupply) ERC20("OurToken", "OT") {
        _mint(msg.sender, initialSupply);
    }
}
  • Token Name: OurToken
  • Symbol: OT
  • Supply: Configurable via constructor
  • Standard: ERC20

⚙️ Installation & Setup

# Clone this repo
git clone https://github.com/SaadAbdullah72/ERC20-TOKEN.git
cd ERC20-TOKEN

# Install Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup

# Install dependencies
forge install

🛠️ Build Contracts

forge build

🧪 Run Tests

forge test -vvvv

Includes tests for:

  • ✅ Total supply
  • ✅ Transfers
  • ✅ Reverts on insufficient balance
  • ✅ Allowances and approvals
  • transferFrom and approve

🚀 Local Deployment (Anvil)

Start Anvil (local node):

anvil

Deploy using your script:

forge script script/DeployOurToken.s.sol:DeployOurToken \
  --rpc-url http://localhost:8545 \
  --private-key <your-private-key> \
  --broadcast

🧠 Useful Foundry Commands

Action Command
🧱 Build forge build
✅ Run tests forge test
🎨 Format code forge fmt
🧪 Gas snapshot forge snapshot
🚀 Run local node anvil
📦 Run script forge script <script>
🛠 Interact w/ chain cast <command>

📚 Resources


🪪 License

MIT © 2025 Saad Abdullah Feel free to fork and build upon this!


🤝 Contributing

Open issues, suggest improvements, or submit a PR. Contributions are welcome!

About

ERC20 TOKEN

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors