Files
sonr/contracts/wSNR/README.md
Prad NukalaandGitHub 13e6c3e84d Master (#1262)
* clear

* feat: Add everything

* fix: Commenht
2025-10-03 14:45:52 -04:00

1.6 KiB

Sonr Smart Contracts

This directory contains the smart contracts for the Sonr blockchain, including the WSNR (Wrapped SNR) ERC-20 token contract.

Setup

Prerequisites

  1. Install Foundry:
curl -L https://foundry.paradigm.xyz | bash
foundryup
  1. Install dependencies:
make install
  1. Copy environment variables:
cp .env.example .env
  1. Configure your .env file with appropriate values

Development

Build contracts:

make build

Run tests:

make test

Run tests with gas reporting:

make test-gas

Generate coverage report:

make coverage

Format code:

make format

Deploy to local Sonr network:

make deploy-local

Deploy to Sonr testnet:

make deploy-testnet

Clean build artifacts:

make clean

Start local Anvil node (for testing):

make anvil

Project Structure

contracts/
├── src/           # Contract source files
├── test/          # Test files
├── script/        # Deployment scripts
├── lib/           # Dependencies (gitignored)
├── foundry.toml   # Foundry configuration
└── Makefile       # Build commands

Testing on Sonr Native EVM

Start the local testnet with EVM enabled:

# From project root
docker-compose -f docker-compose.dev.yml up -d sonr-node

The EVM JSON-RPC endpoint will be available at:

Foundry Commands

For a full list of available commands:

make help

Contract Addresses

  • WSNR: TBD (after deployment)