Back to Case Studies
Developer Tooling|Open Source / Internal

Fadroma: Smart Contract Development Framework

Open-source framework for smart contract development that distills years of production deployment experience into reusable tooling for the CosmWasm ecosystem.

Cover Image for Fadroma: Smart Contract Development Framework

The Challenge

After years of building production smart contracts across multiple blockchain platforms, we kept encountering the same friction points:

Repetitive Boilerplate: Every new project required writing the same initialization logic, access control patterns, and deployment scripts. Senior engineers were spending time on solved problems instead of novel features.

Testing Complexity: Smart contract testing requires simulating blockchain state, handling async operations, and managing test fixtures. Each project reinvented testing infrastructure with varying quality.

Deployment Chaos: Moving from local development to testnet to mainnet involved manual steps, environment-specific configurations, and opportunities for costly mistakes. We'd seen projects deploy with wrong addresses or miss critical initialization steps.

Knowledge Silos: Patterns that worked well in one project didn't automatically transfer to the next. Lessons learned from security incidents or gas optimizations lived in individual codebases rather than shared infrastructure.

Multi-Chain Reality: Our work spans Secret Network, other Cosmos chains, and occasionally Ethereum. Each ecosystem had different tooling with different maturity levels. Engineers context-switching between chains lost productivity to tooling differences.

This wasn't just our problem - every team building on CosmWasm faced similar challenges. The ecosystem needed better shared infrastructure.

"It's truly a great experience to work with such a committed and professional team. Key tools like Undexer and Fadroma have been and are being used by other developers and builders nowadays."

  • Daniel, Mandragora Validators

Our Approach

We built Fadroma to be the framework we wished we'd had from day one- distilling years of production experience into reusable, well-tested components.

Philosophy: Blockchain as Compute Substrate

Rather than treating blockchain development as fundamentally different from traditional software engineering, Fadroma embraces familiar patterns:

  • Configuration over convention: Explicit configuration beats magic
  • Composition over inheritance: Small, focused components combine flexibly
  • Testing as first-class: If it's not tested, it doesn't work
  • Documentation as code: Examples and docs live alongside implementation

Build vs. Use Decision

We evaluated existing tools before building:

ToolStrengthsGaps for Our Needs
CosmWasm templateOfficial, minimalNo deployment tooling, basic testing
cw-plusBattle-tested contractsLibrary, not framework
Terrain (Terra)Good DXTerra-specific
Hardhat (EVM)Excellent modelWrong ecosystem

Nothing provided the full development lifecycle support we needed, so we built it.

Open Source from Day One

Fadroma isn't a proprietary advantage - it's ecosystem infrastructure. Open sourcing means:

  • Community contributions improve everyone's tools
  • Security review from more eyes
  • Adoption validates our approach

The Solution

Fadroma provides a complete development lifecycle for CosmWasm smart contracts, from initial scaffolding through mainnet deployment.

Core Components

Project Scaffolding

# Create new project with sensible defaults
fadroma new my-project

# Add a new contract to existing project
fadroma add my-contract

Generated projects include:

  • Cargo workspace configuration
  • Contract boilerplate with common patterns
  • Test infrastructure
  • Deployment configuration
  • CI/CD templates

Smart Contract Utilities

Building blocks for common patterns:

  • Admin Module: Role-based access control
  • Killswitch: Emergency pause functionality
  • Migration Support: Safe upgrade patterns
  • Storage Helpers: Type-safe state management

Testing Framework

#[fadroma::test]
fn test_initialization() {
    let mut suite = TestSuite::new();
    let contract = suite.deploy::<MyContract>();

    assert_eq!(contract.query_state(), expected_state);
}

Features:

  • Mock blockchain environment
  • Multi-contract integration tests
  • Gas consumption tracking
  • Snapshot/restore for complex scenarios

Deployment Pipeline

# Deploy to testnet
fadroma deploy --network testnet

# Promote to mainnet with same artifacts
fadroma deploy --network mainnet --verify

Capabilities:

  • Environment-specific configuration
  • Deterministic builds for verification
  • Transaction batching for complex deployments
  • Rollback support for failed deployments

Multi-Chain Support

Fadroma abstracts chain-specific details:

  • Secret Network (primary target)
  • Other CosmWasm chains (Cosmos Hub, Osmosis, etc.)
  • Consistent API across chains
  • Chain-specific optimizations where needed

Architecture Principles

Modular Design

Fadroma components can be used independently:

fadroma-core      -> Base utilities (usable standalone)
fadroma-testing   -> Test framework (usable with any contracts)
fadroma-deploy    -> Deployment tools (usable with manual contracts)
fadroma-cli       -> Full framework experience

Type Safety

Rust's type system catches errors at compile time:

  • Contract addresses typed by contract
  • Message types enforced at boundaries
  • State access with compile-time key validation

Documentation Integration

  • Inline examples that compile and test
  • Generated API documentation
  • Tutorial-style guides for common patterns

Evolution Over Time

Fadroma isn't a one-time release - it evolves with our experience:

Each major project we complete feeds improvements back into Fadroma.

Results

Internal Impact

MetricBefore FadromaAfter Fadroma
Project setup time2-3 days2-3 hours
Testing coverageVariableConsistently high
Deployment errorsOccasionalNear zero
Knowledge transferProject-specificFramework-based

Ecosystem Adoption

Fadroma is used beyond Hack.bg:

  • Sienna Network: Core development framework
  • Independent Developers: Discovered via documentation and community
  • Validators: Infrastructure tooling built on Fadroma patterns

"Key tools like Undexer and Fadroma have been and are being used by other developers and builders nowadays."

  • Daniel, Mandragora Validators

Open Source Health

  • Active GitHub repository with external contributors
  • Documentation site with tutorials and API reference
  • Discord community for questions and discussion

Continuous Improvement

Every client project provides feedback that improves Fadroma:

  • Sienna Swap/Lend -> Privacy-preserving patterns
  • Namada tooling -> Multi-chain abstractions
  • Cosmos -> cosmos ecosystem compatible contracts
  • Solana -> framework for solana programs
  • Liquid network -> Simplicity support

Technologies Used

Rust CosmWasm Secret Network Cosmos SDK TypeScript Node.js GitHub Actions


Repository: github.com/hackbg/fadroma

Documentation: Available in repository

Website: fadroma.tech

Ready to ship your blockchain project?

From smart contracts to full-stack dApps, we turn your Web3 vision into reality. Let's talk about what you're building.

hello@hack.bg

By submitting, you agree to our privacy policy.