Now booking discovery calls

Book a call

Global delivery

Blockchain · Smart contracts

Smart contracts, tested as if someone will attack them

Solidity on audited building blocks, with unit, fuzz and invariant tests in Foundry, static analysis on every change and a codebase prepared for independent audit. A second reviewer’s line-by-line pass is recommended and scoped in the proposal.

Free discovery callNDA on requestFixed proposal after scoping

Where contracts fail, and how each is testedAccess control mistakes, where the wrong caller can run a function, are covered by role tests on every function. Reentrancy and call-ordering bugs are covered by fuzzed call orders and the checks-effects-interactions pattern. Oracle manipulation, a price moved within one block, is covered by staleness, deviation and time-weighted price checks. Precision and rounding errors that leak value over time are covered by invariant tests that totals always add up. Signature replay is covered by nonce and EIP-712 domain tests. Upgrade mistakes in storage layout and initializers are covered by storage-layout diffs. Access controlwho may call whatReentrancycall orderingOraclemanipulationprice moved in a blockPrecision &roundingvalue leaks over timeSignature replayone approval usedtwiceUpgrade mistakesstorage · initializersRole testsevery function, everyroleFuzzed call orderschecks-effects-interactionsOracle guardsstaleness · deviation· TWAPInvariant teststotals always add upNonce & domainEIP-712 replay testsUpgrade checksstorage layout diffs
  1. Access controlwho may call what
  2. Role testsevery function, every role
  3. Reentrancycall ordering
  4. Fuzzed call orderschecks-effects-interactions
  5. Oracle manipulationprice moved in a block
  6. Oracle guardsstaleness · deviation · TWAP
  7. Precision & roundingvalue leaks over time
  8. Invariant teststotals always add up
  9. Signature replayone approval used twice
  10. Nonce & domainEIP-712 replay tests
  11. Upgrade mistakesstorage · initializers
  12. Upgrade checksstorage layout diffs
Fig. 1 — Each common failure has its own test: role tests for access control, fuzzed call orders for reentrancy, oracle guards for manipulation, invariants for rounding, nonce and domain tests for replay, and storage-layout checks for upgrades.

In short

Smart contract development is writing the on-chain programs that hold assets and enforce rules on a blockchain. Solidity Labs writes contracts in Solidity (and Rust for Solana) on OpenZeppelin building blocks, tests them with unit, fuzz and invariant tests in Foundry, runs the Slither static analyzer on every change, and prepares high-value contracts for independent audit. A second reviewer’s line-by-line pass is recommended and agreed in the proposal.

Definition

What makes smart contract development different from other software?

Deployed code is public and permanent. Anyone can read it, call it in any order and with any input, and keep trying until something breaks.

A smart contract is a program deployed to a blockchain that holds state (balances, positions, permissions) and changes it according to its code. Once deployed, it is public and, unless designed to be upgradeable, can’t be changed. Every function is callable by anyone, in any order, with any input, often in the same block as other contracts reacting to it. Pending transactions are usually visible before they are included in a block, so others can see a call coming and act first.

That changes how you build. Specification comes first, as properties you can test: “no user can withdraw more than they deposited”, “only the minter role can mint”, “total supply always equals the sum of balances”. Code stays small and leans on audited libraries. Testing goes beyond examples to fuzzing (random inputs) and invariants (properties that must hold after any sequence of calls). Deployment, admin keys and upgrades are part of the design, not afterthoughts.

Our full engineering standard, from style rules to release checks, is on how we write, test and ship Solidity.

Problems we solve

Where contracts usually fail

  1. Access control mistakes

    An unprotected initializer or admin function lets anyone take control of the contract. A proxy’s implementation contract left uninitialized is a classic case. Every privileged function gets an explicit role and a test proving others can’t call it, and every implementation locks its initializers in its constructor.

  2. Reentrancy and call ordering

    External calls before state updates let attackers re-enter. We follow checks-effects-interactions and add reentrancy guards where calls are unavoidable.

  3. Oracle manipulation

    A spot price read from one pool can be moved within a single transaction, often with a flash loan. We read oracle feeds with staleness and deviation checks, and use time-weighted prices only from pools deep enough to make moving them expensive.

  4. Precision and rounding

    Integer division and decimal mismatches leak value. Rounding favors the contract (down when paying out, up when charging), as the ERC-4626 vault standard recommends, and fuzz tests probe the edges.

  5. Signature replay

    A signed message without a nonce, a deadline and a domain naming the chain and the contract can be used again. EIP-712 typed data supplies the domain but leaves replay protection to the contract, so we add a nonce and a deadline to every signed message.

  6. Unsafe upgrades

    A storage collision or an unprotected upgrade function breaks a proxy. We use OpenZeppelin’s upgrade patterns, check the storage layout against the previous version before every upgrade, and put upgrades behind a multisig and a timelock.

What we build

What we build

Token contracts

ERC-20, ERC-721, ERC-1155 and permissioned tokens, with vesting, minting roles and supply controls.

DeFi primitives

Vaults (ERC-4626), lending markets, staking, AMMs and reward distribution.

Tokenization contracts

ERC-3643 tokens, identity registries and compliance modules for real-world assets.

Payments and escrow

Stablecoin payment flows, escrow, streaming payments and settlement contracts.

Governance

Governor contracts, timelocks and multisig setups.

Account abstraction

ERC-4337 smart accounts, paymasters and session keys.

Deployment & verification

Deterministic deployment scripts, verified source on block explorers, role handover to your multisig.

Monitoring

Alerts on admin actions, large movements and invariant breaches, with a pause-and-respond runbook.

How it works

Our contract lifecycle

Specification to monitoring. The depth of each step scales with the value at risk.

Smart contract lifecycleSpecification and threat model, development, unit fuzz and invariant tests, static analysis, a recommended second review pass, testnet deployment, a recommended independent audit, fixes and re-test, mainnet deployment and verification, monitoring and incident response, upgrades through a timelock. Spec & threatmodelDevelopSolidity ·OpenZeppelinUnit · fuzz ·invariantFoundryStatic analysisSlitherReview passscoped in proposalTestnetrealistic scenariosIndependent audithigh-value contractsFix & re-testMainnet deployverified sourceMonitor & respondalerts · pause runbookUpgrade viatimelockif upgradeable
  1. Spec & threat model
  2. DevelopSolidity · OpenZeppelin
  3. Unit · fuzz · invariantFoundry
  4. Static analysisSlither
  5. Review passscoped in proposal
  6. Testnetrealistic scenarios
  7. Upgrade via timelockif upgradeable
  8. Monitor & respondalerts · pause runbook
  9. Mainnet deployverified source
  10. Fix & re-test
  11. Independent audithigh-value contracts
Fig. 2 — Specification to monitoring. Tests and static analysis come before mainnet; a second reviewer's pass and, for contracts holding meaningful value, an independent audit are recommended and agreed in the proposal.
Specification
Roles, states, invariants and an attack-scenario list, reviewed with you before coding.
Development
Small contracts on OpenZeppelin; NatSpec comments; events for every state change.
Tests
Foundry unit tests, fuzz tests on every external function, invariant tests with handler contracts, fork tests against live integrations.
Analysis
Slither on every pull request; findings fixed or documented with a reason.
Review
We recommend a second reviewer’s line-by-line pass against a vulnerability checklist; who reviews, and how, is agreed in the proposal.
Audit & deploy
Independent audit recommended when value is at stake; scripted deployment; admin roles to your multisig.

From the codebase

What our contracts look like

The example below is the shape of almost every state-changing function we write: checks, then effects, then interactions, with an event at the end. It is simple on purpose: in larger code, an external call made before the state update is how reentrancy bugs get in.

// Vault redemption (ERC-4626 style, caller redeems own shares):
// checks → effects → interactions, guarded against reentrancy.
function redeem(uint256 shares, address receiver) external nonReentrant returns (uint256 assets) {
    if (shares == 0) revert ZeroShares();                       // checks
    assets = previewRedeem(shares);                             // rounds down, in the vault's favor
    if (assets == 0) revert ZeroAssets();

    _burn(msg.sender, shares);                                  // effects before any external call
    totalManaged -= assets;

    asset.safeTransfer(receiver, assets);                       // interaction last
    emit Withdraw(msg.sender, receiver, msg.sender, assets, shares); // sender, receiver, owner
}

And this is the kind of property we test with an invariant: whatever sequence of deposits, withdrawals and transfers the fuzzer tries, the vault never owes more than it holds.

// Foundry invariant test (handler-based): solvency must hold after any call sequence.
function invariant_vaultIsSolvent() public view {
    assertGe(asset.balanceOf(address(vault)), vault.totalAssets(), "vault owes more than it holds");
}

function invariant_supplyMatchesBalances() public view {
    assertEq(vault.totalSupply(), handler.sumOfBalances(), "share supply drifted");
}

Every contract we deliver comes with a test report (coverage, fuzz runs, invariant runs), the static-analysis results with each finding resolved or explained, deployment scripts and a short operations runbook. When a review pass is in the proposal, its checklist is delivered too.

Before mainnet we check:

  • Constructor and initializer arguments match the specification, and every implementation contract has its initializers disabled.
  • Every admin, minter, pauser and upgrader role is held by your multisig, and the deployer address holds no role.
  • Source code is verified on the block explorer for every deployed address.
  • For an upgrade, the storage layout matches the previous version, and the timelock delay is the one in the specification.
  • Monitoring alerts are live before the contract accepts funds.
  • New contracts that will hold value start with deposit caps, raised as they prove themselves in production.

Process

How we run it

  1. Specification

    Properties, roles, upgrade strategy and threat model written and agreed.

    Written spec

  2. Fixed proposal

    Contracts, test coverage targets, audit scope and deployment plan as milestones, with milestone-based payments agreed in the proposal.

    Fixed proposal

  3. Build with tests

    Tests written alongside code; coverage and invariant results shown in demos at a cadence agreed in the proposal.

    Regular demos

  4. Review and audit

    Testnet deployment, then the review pass and independent audit agreed in the proposal, fixes and re-test.

    Testnet release

  5. Mainnet and monitoring

    Verified deployment, role handover, monitoring alerts and runbook.

    Handover

Technology

Tools we use for this

Languages

  • Solidity
  • Rust

Frameworks

  • Foundry
  • Hardhat
  • OpenZeppelin
  • Solady

Security tools

  • Slither
  • Echidna
  • Halmos

Chains

  • Ethereum
  • Base
  • Arbitrum
  • Optimism
  • Polygon
  • BNB Chain
  • Avalanche
  • Solana

Operations

  • Safe multisig
  • OpenZeppelin Monitor
  • Tenderly
  • Etherscan verification

Scope drivers

What shapes scope

We don’t publish prices or week counts, because they depend on scope. These are the factors that actually move them.

01

Value at risk

The more value a contract holds, the deeper the testing, formal properties and audit scope.

02

Novelty of the logic

Standard tokens and vaults on audited libraries are small; novel pricing, liquidation or cross-chain logic is large.

03

External integrations

Oracles, DEX routers, lending markets and bridges need fork tests and failure handling.

04

Upgradeability and governance

Proxies, timelocks and governance add design work and audit surface.

05

Number of chains

Each chain adds deployment, verification, testing and monitoring.

06

Audit scope

An independent audit is a separate cost from an audit firm; scope depends on lines of code and complexity.

Typical shapes: a fixed-scope contract build with testnet deployment, then an audit-and-mainnet phase. For existing code we start with a security review.

Every engagement includes

  • Source code & IP transfer
  • Documentation
  • Handover session
  • Post-launch support as agreed
  • Demos at an agreed cadence

We give a fixed proposal after a free discovery call and a written scope of work. Prepare a brief with the Project Planner

Comparison

Upgradeable or immutable?

CriterionImmutableUpgradeable (UUPS / transparent proxy)
Trust modelUsers trust the code aloneUsers also trust whoever controls upgrades
Fixing bugsRedeploy and migrateUpgrade in place, through multisig + timelock
Audit surfaceSmallerLarger (proxy, storage layout, admin)
Typical fitTokens, simple vaults, mature protocolsEarly-stage protocols, regulated assets needing changes

Honest guidance

When not to choose this

Scope boundary

What we engineer, and what others provide

We engineer

  • Specification, contracts, tests and static analysis
  • Deployment scripts, verification and monitoring alerts
  • Audit coordination and fix implementation

You provide

  • Product decisions and economic design sign-off
  • Multisig signers and key custody
  • Legal review of token and protocol

Licensed partners & providers

  • Independent audit firms
  • Oracle and infrastructure providers
  • Legal counsel

Security & quality

How we keep it safe and correct

  • Unit, fuzz and invariant tests in Foundry; fork tests for integrations
  • Slither static analysis on every change; findings triaged and documented
  • Recommended: a second reviewer’s line-by-line pass against a vulnerability checklist, scoped in the proposal
  • Admin roles handed to your multisig (hardware keys recommended); timelocks on upgrades
  • Independent audit recommended for contracts holding meaningful value
  • Monitoring alerts and a pause-and-respond runbook, handed over to your team

Engineering example

Tokenized transfer compliance

Attempt transfers between synthetic investors and watch an ERC-3643-style rule engine allow or block each one, with the reason.

Illustrative engineering example: synthetic data, not a client project. Verified case studies will appear here when consented ones exist.

FAQ

Questions buyers ask us

Not covered here? Ask us directly — a person reads every message.

How much does smart contract development cost?

It depends on the value at risk, how novel the logic is, integrations, upgradeability, the number of chains and the audit scope. We don’t publish prices; after a free discovery call and a written specification we send a fixed proposal.

How long does smart contract development take?

The schedule is in the proposal once the specification is agreed. Testing and audit are a large share of it by design; we don’t compress them for high-value contracts.

Do you audit your own contracts?

We test and analyze our own code: unit, fuzz and invariant tests and static analysis. We recommend a second reviewer’s line-by-line pass, and its scope is agreed in the proposal. For contracts holding meaningful value, we prepare for and coordinate an independent audit, because no team should be the only auditor of its own code.

Which languages and chains do you use?

Solidity on Ethereum and EVM chains (Base, Arbitrum, Optimism, Polygon, BNB Chain, Avalanche) and Rust with Anchor on Solana.

What are fuzz and invariant tests?

Fuzz tests call functions with many random inputs to find edge cases. Invariant tests run random sequences of calls and check properties that must always hold, such as total supply matching the sum of balances.

Who controls the contracts after deployment?

You do. Admin and upgrade roles go to multisig wallets your team controls; we recommend hardware keys for every signer. We hand over and keep no production keys.

Can you work on contracts written by another team?

Yes. We start with a review and test-coverage assessment, then fix, extend or prepare them for audit.

Do you write upgradeable contracts?

When it’s the right trade-off. Upgradeability adds flexibility and trust assumptions; we document who can upgrade, behind a multisig and timelock.

Can AI write smart contracts?

AI tools help with boilerplate and as an extra reviewer, but every line we ship is written or checked by an engineer and covered by tests. We don’t ship unreviewed AI-generated contract code.

Keep exploring

From the blog

RWA Tokenization

ERC-3643 Explained: Permissioned Tokens for Regulated Assets

ERC-3643 is the Ethereum standard for tokens that only verified, eligible investors may hold. Here is how its identity registry, claims, compliance modules and agent roles work, and what the standard does not do for you.

Solidity Labs · · 8 min read

Last reviewed: Reviewed by our independent expert review under our editorial policy

Get a quote WhatsApp

Have a build in mind? Let’s scope it properly.

Free discovery call · NDA on request

WhatsApp