All Capabilities/Engineering/ENGINEERING / SMART CONTRACTS
02.2 / ENGINEERING / SMART CONTRACTS

Solana Rust & EVM
contract systems.

We architect, write, and formally verify production smart contracts across Solana (Rust/Anchor) and EVM (Solidity/Foundry), built for audit readiness from line one.

18 / 18AUDIT FINDINGS REMEDIATED

100% remediation across Critical, High, Medium, and Low findings with Certora.

48 / 48FOUNDRY & ANCHOR SUITES

Unit, fuzz, and multi-actor lifecycle tests shipping with every repository.

ZeroORPHANED LEGS OR LOCKED FUNDS

Strict pull-over-push claimable accounting and atomic EVM/SVM rollback invariants.

01 / FOUNDER PERSPECTIVE

Smart contracts are financial state machines, not web backends.

WHY MOST TEAMS STALL HERE

Most contract exploits and audit delays happen because contracts are written as monolithic scripts without explicit state invariants, pull-over-push accounting, or atomic rollback guarantees. When an external oracle lags or a lending pool rounding edge case hits, funds lock up.

HOW WE ENGINEER IT AT WEB3SPELL LABS

We engineer smart contracts around strict mathematical invariants. Whether we are building a 5-contract modular ROSCA suite with Compound III yield integration (ChainPot V4) or a dual-leg atomic CLOB router with ERC-6909 claims (Divergence Router), every state transition is guarded by custom errors, reentrancy locks, and exhaustive Foundry/Anchor invariant suites.

02 / TECHNICAL ARCHITECTURE & SCOPE

What we actually
design and ship.

No vague retainers or slide-deck theater. Every engagement in this practice is decomposed into concrete engineering and design workstreams.

01EVM / SOLIDITY

EVM Protocol Engineering (Solidity & Foundry)

We build modular, gas-optimized Solidity contract systems across Base, Arbitrum, Ethereum, Somnia, and Bitcoin L2s.

SPECIFICATIONS & ARTIFACTS
  • DeFi vaults, CLOB routers, lending adapters (Compound III / Aave), and ERC-6909 / ERC-4626 tokens
  • Chainlink VRF V2.5, Pyth / RedStone oracle integrations & keeper automation
  • EIP-712 typed signatures, EIP-2612 permits & ERC-4337 smart account modules
02SOLANA / SVM

Solana Program Engineering (Rust & Anchor)

We engineer high-throughput Solana programs with deterministic PDA hierarchies, zero-copy account layouts, and SPL Token-2022 extensions.

SPECIFICATIONS & ARTIFACTS
  • Deterministic PDA escrow vaults, Merkle root registries & CPI composability
  • Compute-unit optimization and custom nostd syscall integrations
  • TypeScript Anchor client generation & deterministic devnet/mainnet deploy pipelines
03VERIFICATION

Formal Verification (Certora CVL) & Fuzz Testing

Unit tests only check the scenarios you thought of. We write stateful fuzz tests and Certora Verification Language (CVL) rules to prove solvency across all possible inputs.

SPECIFICATIONS & ARTIFACTS
  • Vault solvency invariants (`sum(userClaims) <= vaultBalance`) proven mathematically
  • Multi-actor lifecycle simulations (defaults, liquidations, partial fills, emergency pause)
  • Pre-audit internal threat modeling to make external security audits fast and clean
04REMEDIATION

Audit Remediation & V4+ Protocol Upgrades

Received an audit report from Certora, Trail of Bits, or OtterSec? We step in to re-architect vulnerable modules, fix every finding, and verify the patch suite.

SPECIFICATIONS & ARTIFACTS
  • Monolithic-to-modular contract refactoring (breaking 24KB+ bytecode limits cleanly)
  • Replacing push-transfer loops with DoS-proof pull-over-push accounting
  • Line-by-line audit remediation verification and regression test coverage
03 / EXECUTION CADENCE

How an engagement
runs week by week.

Direct Slack/Telegram channel with our founders and engineers, weekly shippable milestones, and clean handoff to your internal team.

01Week 1

Storage, PDA & Invariant Design

We define every contract storage slot or Solana PDA seed, access-control role, and mathematical solvency rule before coding.

OUTPUTContract Architecture & Invariant Spec
02Week 2–4

Modular Contract Implementation

We write clean, documented Solidity or Rust code with custom errors, explicit events, and minimal external trust assumptions.

OUTPUTCore Smart Contract Suite
03Week 4–5

Fuzzing & Formal Verification

We build exhaustive Foundry/Anchor test suites and CVL formal verification rules to stress-test every edge case.

OUTPUT100% Passing Test & Prover Suite
04Week 6+

Audit Support & Mainnet Deployment

We shepherd the codebase through external security audits, remediate findings, and run deterministic deployment scripts.

OUTPUTVerified Mainnet Contracts
WHO THIS IS BUILT FOR
  • DeFi, prediction market, consumer crypto, and infrastructure protocols building on EVM or Solana
  • Teams preparing for a top-tier security audit who want formal invariants and clean modular code
  • Protocols needing a V2/V4 architectural overhaul after outgrowing their initial MVP contracts
TANGIBLE DELIVERABLES
  • Production Solidity (Foundry) or Solana Rust (Anchor) smart contract repository
  • Complete unit, stateful fuzz, and integration test suite
  • Certora CVL formal verification rules & solvency proofs (for EVM DeFi)
  • Deterministic deployment scripts, ABI/IDL artifacts & contract verification
  • Audit-ready technical documentation and state-transition diagrams
PRODUCTION STACK & TOOLING
Solidity 0.8.24Foundry (Forge / Cast / Anvil)Rust / Anchor 0.31Certora Prover (CVL)OpenZeppelin V5ERC-6909 / ERC-4626 / SPL Token-2022Chainlink VRF V2.5 / Compound III
SHIPPED PROOF · CHAINPOT PROTOCOL (SUPPORTED BY COMPOUND · AUDITED BY CERTORA)

ChainPot

Read the ChainPot dossier to see how we decomposed a monolithic contract into 5 modular V4 engines, integrated Compound III yield, and remediated all 18 Certora audit findings.

READY WHEN YOU ARE

Bring us your
hardest problem.

Whether you need a focused 4-week intervention in solana rust & evm or a complete 0-to-Hero protocol build, you work directly with our founders and senior engineers.

Start a project