Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Important: If you're upgrading snforge to version 0.48.0 or later, please read the 0.48.0 Migration Guide.

How Contracts Are Collected

snforge supports two mechanisms for collecting contracts used in tests. The default one depends on Scarb version used and can be controlled with --no-optimization flag.

📝 Note

Enabling new mechanism requires Scarb version >= 2.8.3.

Differences Between Collection Mechanisms

FeatureOld MechanismOptimised Mechanism
Using contracts from /src
Using contracts from /tests
Using contracts from modules marked with #[cfg(test)]
Using contracts from dependencies
Contracts more closely resemble ones from real network
Less compilation steps required (faster compilation)
Additional compilation step required (scarb build)