Skip to content

StabilityNexus/Template-Repo-EVM-Contracts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

36 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Stability Nexus

Β 

Static Badge

Telegram Badge Β Β  X (formerly Twitter) Badge Β Β  Discord Badge Β Β  Medium Badge Β Β  LinkedIn Badge Β Β  Youtube Badge


TODO: Project Name

TODO is a ... TODO: Project Description.


πŸš€ Features

TODO: List your main features here:

  • Feature 1: Description
  • Feature 2: Description
  • Feature 3: Description
  • Feature 4: Description

Project Maturity

TODO: In the checklist below, mark the items that have been completed and delete items that are not applicable to the current project:

  • The protocol:
    • has been described and formally specified in a paper.
    • has had its main properties mathematically proven.
    • has been formally verified.
  • The smart contracts:
    • were thoroughly reviewed by at least two knights of The Stable Order.
    • were deployed to:
      • Ethereum Classic
      • Ethereum
      • Polygon
      • BSC
      • Base

Architecture

TODO: Replace with your actual contract architecture. Example below.

src/
β”œβ”€β”€ TODO_Contract.sol       # Core logic contract
β”œβ”€β”€ interfaces/
β”‚   └── ITODO_Contract.sol  # Interface definitions
└── libraries/
    └── TODO_Library.sol    # Shared utility library

script/
β”œβ”€β”€ Deploy.s.sol            # Deployment script
└── Interactions.s.sol      # Post-deploy interaction scripts

test/
β”œβ”€β”€ unit/
β”‚   └── TODO_ContractTest.t.sol
└── integration/
    └── TODO_IntegrationTest.t.sol

Contract Diagram (TODO: add a diagram or ASCII art showing contract relationships) You can create Web3 architecture diagrams using:

Example structure to include:

  • Frontend (DApp UI built with React/Next.js)
  • Wallet integration (MetaMask, WalletConnect, Coinbase Wallet)
  • Web3 provider / RPC (Infura, Alchemy, QuickNode)
  • Smart contracts (Solidity contracts deployed on blockchain)
  • Blockchain network (Ethereum, Polygon, Arbitrum, etc.)
  • Decentralized storage (IPFS, Filecoin, Arweave)
  • Indexing services (The Graph or similar)
  • Optional backend services (Node.js APIs, relayers, indexing)
  • Data flow between the frontend, wallet, smart contracts, and blockchain

Tech Stack

Layer Technology
Smart Contracts Solidity ^0.8.x
Framework Foundry (forge, cast, anvil)
Libraries OpenZeppelin (via lib/)

Repository Structure

.
β”œβ”€β”€ .github/
β”‚   └── workflows/           # CI, security, gas, fuzz, release pipelines
β”œβ”€β”€ lib/                     # Foundry dependencies (git submodules)
β”œβ”€β”€ public/                  # Logos and static assets
β”œβ”€β”€ script/                  # Forge deployment & interaction scripts
β”œβ”€β”€ src/                     # Solidity source contracts
β”œβ”€β”€ test/                    # Forge test suite
β”œβ”€β”€ .coderabbit.yaml         # CodeRabbit AI review config
β”œβ”€β”€ .env.example             # Environment variable template
β”œβ”€β”€ .gitmodules              # Submodule declarations
β”œβ”€β”€ foundry.toml             # Foundry project config (RPCs, verifiers)
β”œβ”€β”€ foundry.lock             # Locked dependency versions
└── README.md

πŸ”— Repository Links

TODO: Update with your repository structure

  1. Main Repository
  2. Frontend (if separate)
  3. contract (if separate)

Getting Started

Prerequisites

Tool Version Install
git any git-scm.com
foundryup latest See getfoundry.sh
forge / cast / anvil latest run foundryup after install

Verify installation:

forge --version   # e.g. forge 0.3.x
anvil --version
cast --version

Installation

# 1. Clone with submodules
git clone --recurse-submodules https://github.com/StabilityNexus/Template-Repo-EVM-Contracts.git
cd Template-Repo-EVM-Contracts

# 2. If you forgot --recurse-submodules
git submodule update --init --recursive

# 3. Install/update Foundry dependencies
forge install

Environment Setup

cp .env.example .env

Edit .env and fill in:

# Required for deployment
PRIVATE_KEY=0x...

# Required for contract verification
ETHERSCAN_API_KEY=...

# Optional: override default public RPCs
RPC_ETHEREUM=https://mainnet.infura.io/v3/YOUR_KEY
RPC_SEPOLIA=https://sepolia.infura.io/v3/YOUR_KEY

Usage

Build

forge build

Test

# Run all tests
forge test

# Verbose output (shows logs and traces)
forge test -vvv

# Run a specific test file
forge test --match-path test/unit/TODO_ContractTest.t.sol

# Run a specific test function
forge test --match-test testTransfer -vvv

Coverage

forge coverage

# Generate LCOV report
forge coverage --report lcov
genhtml lcov.info --output-directory coverage/

Gas Snapshot

# Generate snapshot
forge snapshot

# Compare against last snapshot
forge snapshot --diff

Format & Lint

forge fmt          # Format Solidity files
forge fmt --check  # Check without writing (used in CI)

Deployment

Make sure your .env is configured before deploying.

Testnet

# Deploy to Sepolia (Ethereum testnet)
forge script script/Deploy.s.sol \
  --rpc-url sepolia \
  --broadcast \
  --verify \
  -vvvv

# Deploy to Mordor (Ethereum Classic testnet)
forge script script/Deploy.s.sol \
  --rpc-url mordor \
  --broadcast \
  -vvvv

Mainnet

# Deploy to Ethereum mainnet
forge script script/Deploy.s.sol \
  --rpc-url ethereum \
  --broadcast \
  --verify \
  -vvvv

# Deploy to Base
forge script script/Deploy.s.sol \
  --rpc-url base \
  --broadcast \
  --verify \
  -vvvv

ℹ️ RPC aliases (sepolia, ethereum, base, etc.) are pre-configured in foundry.toml.


Supported Networks

Pre-configured RPC endpoints in foundry.toml.

| Network | Type | Chain ID | |---|---|---|---| | Ethereum | Mainnet | 1 | | Ethereum Classic | Mainnet | 61 | | Polygon PoS | Mainnet | 137 | | BNB Smart Chain | Mainnet | 56 | | Base | Mainnet | 8453 | | Sepolia | Testnet | 11155111 | | Mordor (ETC) | Testnet | 63 |


CI/CD Workflows

Workflow Trigger What it does
ci.yml Push / PR Format check β†’ Build β†’ Unit tests β†’ Coverage report
security-slither.yml Push / PR Slither static analysis for vulnerabilities
gas-snapshot.yml Push / PR Gas baseline and regression checks
nightly-fuzz.yml Nightly (cron) Deep fuzz & invariant testing
release.yml Tag push Builds and publishes release artifacts

Security

  • Static analysis is run on every PR via Slither (see .github/workflows/security-slither.yml)
  • CodeRabbit AI review is enabled via .coderabbit.yaml
  • Deep fuzz runs nightly to catch edge cases

Found a vulnerability? Please do not open a public issue. Contact the Stability Nexus team privately via Discord or Telegram.


πŸ™Œ Contributing

⭐ Don't forget to star this repository if you find it useful! ⭐

Thank you for considering contributing to this project! Contributions are highly appreciated and welcomed. To ensure smooth collaboration, please refer to our Contribution Guidelines.


✨ Maintainers

TODO: Add maintainer information


πŸ“ License

See the LICENSE file for details.


πŸ’ͺ Thanks To All Contributors

Thanks a lot for spending your time helping TODO grow. Keep rocking!

Contributors

Β© 2025 Stability Nexus

About

Template Repo for EVM Contracts

Resources

Stars

Watchers

Forks

Contributors