Skip to content

A simple smart contract built with Foundry for learning and testing purposes. ## Features - Basic counter functionality with increment and set operations - Deployed using Foundry scripts

Notifications You must be signed in to change notification settings

block-vision/simple-contract-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Counter Contract

A simple smart contract built with Foundry for learning and testing purposes.

Features

  • Basic counter functionality with increment and set operations
  • Deployed using Foundry scripts

Prerequisites

Setup

  1. Clone and navigate to the project:
cd simple-contract-test
  1. Install dependencies:
forge install
  1. Create environment file:
cp .env.example .env
  1. Edit .env file and add your private key:
PRIVATE_KEY=your_private_key_here

Deployment

Quick Deploy

./deploy.sh monad_testnet

Manual Deploy

# Dry run (simulation)
forge script script/Counter.s.sol --rpc-url monad_testnet

# Deploy to Monad Testnet (verification done separately with Sourcify)
forge script script/Counter.s.sol \
    --rpc-url monad_testnet \
    --private-key $PRIVATE_KEY \
    --broadcast

# Deploy to other networks with auto-verification
forge script script/Counter.s.sol \
    --rpc-url sepolia \
    --private-key $PRIVATE_KEY \
    --broadcast \
    --verify

Verification

Sourcify Verification (for Monad Testnet)

For Monad Testnet, use Sourcify for contract verification:

./verify-sourcify.sh [contract_address] monad_testnet

Example:

./verify-sourcify.sh 0x123...abc monad_testnet

Traditional Block Explorer Verification

For other networks with automatic verification:

./verify.sh [contract_address] [network]

Example:

./verify.sh 0x123...abc sepolia

Testing

Run the test suite:

forge test

Run tests with gas reporting:

forge test --gas-report

Supported Networks

  • Monad Testnet (Chain ID: 10143) - Primary testnet

Faucets

Get test tokens from these faucets:

  • Monad Testnet: Visit Monad Discord for faucet access

Verification Services

Project Structure

├── src/
│   └── Counter.sol          # Main contract
├── script/
│   └── Counter.s.sol        # Deployment script
├── test/
│   └── Counter.t.sol        # Test file
├── deploy.sh                # Deployment helper script
├── verify.sh                # Verification helper script
└── foundry.toml             # Foundry configuration

Foundry Documentation

For more information about Foundry: https://book.getfoundry.sh/

About

A simple smart contract built with Foundry for learning and testing purposes. ## Features - Basic counter functionality with increment and set operations - Deployed using Foundry scripts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published