ByAUJay
Blockchain Testing Framework and Building Testing Strategy for Blockchain Smart Contracts
Decision-makers are on the hunt for a test strategy that cuts down on on-chain risk while still keeping delivery times speedy. In this guide, we’re diving into the current landscape of tools and sharing some of the best practices we at 7Block Labs rely on to deploy smart contracts. Our goal is to make sure these contracts are not only verifiably correct but also set up for upgrades when needed. We dive into a wide range of topics, from EVM and Solana to Move-based chains like NEAR, Cosmos SDK, and Fabric. There's really something for everyone!
TL;DR (meta description)
What to Use and How to Test Smart Contracts in 2026
Hey there! If you're getting into smart contracts in 2026, you're in the perfect spot! I’ve put together a simple guide that touches on all the essentials, from EVM and Solana to Move, NEAR, Cosmos, and Fabric. Let’s get started! Let's dive into some of the testing methods that you might want to think about. We'll cover everything from unit tests to fuzz testing, invariants, and formal specs. Plus, we'll also talk about mainnet-fork tests, coverage, CI/CD, and those all-important security gates. There's a lot to unpack, so let’s get started! Also, you'll come across some solid tool and version suggestions as you go along.
Key Testing Methods
1. Unit Testing
Unit tests are like your first line of defense.
They assist you in testing the different parts of your smart contract.
When you're working with EVM, be sure to take advantage of frameworks like Truffle or Hardhat. They really streamline the process. And of course, if you've got a specific platform in mind, make sure to use the right tools for that too! Happy coding!
2. Fuzz Testing
Fuzz testing is all about throwing random data at your contract to check out how it responds. It’s a great way to catch any unexpected behavior or bugs!
It's a fantastic way to uncover those sneaky bugs that might slip through the cracks during regular testing.
You might want to check out some handy tools like Echidna or Haskell’s QuickCheck. They can really make your life easier!
3. Invariant Testing
To make sure your contract works just the way you expect it to in different situations, invariant testing steps in to verify that specific properties stay consistent as your contract runs its course.
Libraries such as the Solidity Invariant Testing Framework can really come in clutch for situations like this.
4. Formal Specifications
When you're working on serious projects, using formal verification can really help. It allows you to mathematically demonstrate that your code works the way you want it to. It’s like having a safety net that ensures everything’s running smoothly!
Tools like Coq and Isabelle can really help with this detailed process.
5. Mainnet-Fork Testing
Testing on a mainnet fork is a great way to experiment in a real-world setting. It lets you identify any issues that might pop up, all while keeping your funds safe and sound.
Tools like Ganache make it super easy to do this kind of testing.
6. Coverage Testing
Just a friendly reminder--make sure to keep an eye on your code coverage! It's super important to test all the parts of your contract so nothing gets overlooked. Happy coding!
If you're working with the Ethereum Virtual Machine (EVM), tools like Istanbul can be super handy for spotting any untested code you might have. And if you’re using other platforms, there are similar tools out there to help you out too!
7. CI/CD
Setting up Continuous Integration and Continuous Deployment (CI/CD) really makes life easier when it comes to your development process.
You can totally use GitHub Actions or CircleCI to set up automation for testing and deploying your smart contracts! It's a great way to streamline your workflow and make sure everything runs smoothly.
8. Security Gates
Before you hit that live button, make sure you've got your security checks sorted out!
If you're looking to catch any potential issues with your contracts before they go live on the mainnet, tools like Slither and MythX are super handy. They'll help you sniff out vulnerabilities and make sure everything's running smoothly!
Tools & Version Guidance
| Tool | Type | Version |
|---|---|---|
| Truffle | Unit Testing | 5.x |
| Hardhat | Unit Testing | 2.x |
| Echidna | Fuzz Testing | 2.x |
| Solidity Invariant Library | Invariant Testing | 0.8.x |
| Coq | Formal Specs | 8.x |
| Ganache | Mainnet-Fork Testing | 7.x |
| Istanbul | Coverage Testing | 0.4.x |
| Slither | Security Analysis | 0.8.x |
Conclusion
And there you go! That's a straightforward way to test your smart contracts in 2026. Every method and tool you use is super important for making sure your contracts are not just efficient but also secure and totally ready to go. Happy coding!.
Why blockchain testing is different now
- Tooling Consolidation: Just a heads-up! As of December 20, 2023, Truffle and Ganache have switched to archive-only mode.
These days, most teams that work with EVM have pretty much switched over to popular tools like Hardhat and Foundry.
If you still see Truffle or Ganache popping up in your documentation or CI, it might be a good idea to start thinking about making the switch.
Hey, if you're interested, you can find all the details here. Hey there! So, guess what? Hardhat 3 just dropped some fantastic new features! They’ve rolled out first-class coverage and a much-improved helpers API. Pretty cool, right? On the flip side, there's Foundry v1. So, 0 has really stepped up its game with some awesome new features! They've introduced invariants and fork testing, plus they've added some neat cheat codes. This means you can explore cool stuff like EIP-7702 and P-256 signatures. Super exciting, right? If you really want to get your testing spot on, these two options are definitely the way to go for solid test coverage on EVM right now. If you want to dive deeper into this, check out Hardhat for more details! - Security Benchmarks have really stepped up their game lately. They’re not just sticking to the SWC list anymore; they’re branching out and evolving! Just a heads up, the maintainers have mentioned that the registry hasn’t really had any updates since 2020. When you're labeling categories, definitely go with SWC. But when it's time to whip up your checks and review checklists, think about incorporating SCSVS v2 or EthTrust where it fits. It can really help streamline the process! If you want more information, just head over to the SWC Registry. It's a great resource!
Pick the right stack by chain
EVM (Ethereum and EVM L2s)
- Foundry Suite: So, here’s the scoop! We’ve got three key tools to make your life easier: first up is
forge, which is perfect for testing things out. Then there'sanvil, designed for handling nodes and forks. And last but not least, we havecast, your handy command-line interface. Hey there! You’ve got to check out these awesome features I found: - Forking Made Quick and Simple: Just type in
anvil --fork-urlto get started, and say goodbye to those annoying flaky RPCs with our offline starts and retry backoff feature. It’s that easy! It's smart to lock in block numbers in your CI to ensure everything runs smoothly. (getfoundry.sh).--fork-block-number - Per-Test Forking with Cheatcodes: With the
createFork/selectForkcheatcodes, you can easily isolate and replicate those tricky interactions. It's a handy way to make sure you're on point with your testing! By doing it this way, your tests end up being a lot cleaner and more reliable. (getfoundry.sh). - Gas and Coverage Tools: If you run
forge snapshot, you can quickly see how much gas you're using along with the diffs and thresholds. Plus, if you want to get those useful CI artifacts, just runforge coverage --report lcov--it's super straightforward! (learnblockchain.cn). - New Features in Fresh Protocol: Check out Foundry v1!
So, version 0 comes loaded with some cool features! You’ve got EIP-7702 delegation signing with methods like
signDelegationandattachDelegation, which is great for anyone working on passkeys. Plus, there's P-256 signing withsignP256. Definitely some handy tools for your projects! Just a quick reminder--make sure to include--hardfork praguewhen you're validating those 7702 flows! You don’t want to miss that! (paradigm.xyz). - Hardhat 3:
- Coverage Tools Made Easy: Want to check your coverage? Just fire up
npx hardhat test --coverage, and you’ll get a detailed report without any hassle. It's that simple! On top of that, it packs some really useful toolboxes, including ethers/viem, matchers, and even a gas reporter! (hardhat.org). - Mainnet Forking Tips: If you're planning to fork from the mainnet, it's a great move to pin a specific block. This little trick not only boosts stability but can also supercharge your performance, potentially giving you up to a 20x speedup when you use archive endpoints. Pretty cool, right? (hardhat.org).
- Network Helpers: Think of these as your trusty sidekicks for testing. They make it super easy to adjust the state of your tests on the fly, whether you need to impersonate someone, tweak storage or edit nonces/codes, or take snapshots. It’s all about streamlining your process! Super useful! (hardhat.org).
Hey, just a quick note for you: Brownie isn’t really being actively maintained these days.
If you’re into Python and pytest, you might want to take a look at ApeWorx’s Ape, especially their ape-test feature. It could be just what you need!
If you’re looking for more details, just check this out: pypi.org. It's got everything you need!
Solana
If you’re diving into Anchor programs, I recommend using anchor test along with a local validator. It makes the whole testing process a lot smoother!
If you're getting into some lower-level Rust programming, you might want to take a look at solana-program-test. It's pretty handy!
If you’re looking for faster in-process program tests with sleek APIs, you should definitely check out LiteSVM. You might just find it fits the bill perfectly!
(anchor-lang.com).
Move chains (Aptos, Sui)
If you want to show off your pre/post conditions and invariants with the Move Prover (that's the MSL specs) in CI, it’s super easy to get it set up. Just run this command: aptos update prover-dependencies, and you're good to go!
If you’re diving into Sui, you might want to check out either Certora’s Sui Prover or the asymptotic-code’s sui-prover. Both are solid options, so just pick whichever one vibes best with what you need!
If you want more info, just click here!
NEAR
If you're looking to run the same tests on your local Sandbox or Testnet, using Workspaces--whether it's in TypeScript or Rust--is definitely a smart move!
By doing it this way, you can really make the most of those patch-state and time travel features, especially when you're dealing with those predictable situations.
Hey! Just a quick heads-up--there are some simulation tests (near-sdk-sim) you can check out. But I should mention that the docs say they're slowly being replaced by Workspaces. So, keep that in mind if you're diving into those tests!
Take a look at this: (near.github.io). You won't want to miss it!
Cosmos SDK / IBC
- Make the most of the built-in Simulation framework, like SimApp or SimsX, to toss some fuzz into the transaction sequences. This way, you can catch any glitches in the state machine that might pop up. You can team this up with interchaintest to cover end-to-end and IBC flows. (docs.cosmos.network).
Hyperledger Fabric
- Jump into some chaincode with the Fabric test network and check out version 2! Give the 4+ Peer Gateway client a try--it might give you a nice boost in throughput compared to the older SDKs. Don't forget to take a look at the official performance notes! They have some great info about payload sizes and the pros and cons of using different chaincode languages. Just so you know, Go tends to outperform Node, which is generally better than Java. Happy reading! (hyperledger-fabric.readthedocs.io).
A layered test strategy that scales
Designing for Fast Feedback and High Confidence
When we're working on an EVM app, our main goal is to get quick feedback from the ground level while also building a strong sense of confidence at the higher levels. We aim for:.
Fast Feedback
- Quick Feedback: It's important for users to receive fast updates about what they're doing.
- Straightforward Communication: Make sure your notifications and alerts are super easy to get.
- Progress Indicators: Keep your users in the loop by using loading spinners or progress bars to show them what’s happening right now. It’s a great way to let them know things are moving along!
High Confidence
- Trustworthy Information: Share solid data and stats that you can really rely on.
- Easy-to-Use Design: Make sure the interface is simple and easy to understand. This way, users can navigate it without feeling overwhelmed.
- Strong Security Measures: It's super important for users to feel confident that their data is always safe and secure.
When we focus on these elements, it really helps users have a smoother and more confident time using the app.
- Unit and Property Tests. Alright, here's the deal: when you're diving into unit tests that really hone in on the pure or internal logic, go ahead and use Foundry. It's great for that! But when you want to see how everything plays together with your JavaScript or TypeScript code, Hardhat is the way to go. It really helps you get a feel for the integration.
- Boost your testing game with Scribble's runtime assertions! They can transform your properties into handy instrumentation that teams up perfectly with fuzzers and SMT tools. Take a look at this: diligence.consensys.io. You might find it really interesting!
2) Fuzz and Invariant Tests
Foundry has some cool built-in fuzzing features that you can easily expand by tossing in your own invariants. This gives you a chance to really explore how different handlers and actors interact with each other. And on top of that, Echidna comes in clutch with its grammar-focused campaigns. It even plays nice with GitHub Actions, which is pretty awesome! If you want to dive deeper into this topic, feel free to check it out here.
3) Static and Symbolic Analysis
Why not give Slither a shot for some quick static checks? It can really unlock some neat insights about your architecture! If you're looking to really dive into symbolic execution on bytecode, Mythril is definitely the tool you want to have on your side. Connecting Slither to your code scanning process is definitely a smart move! It helps you spot any regressions early on, which can save you a lot of headaches down the line. Trust me, it's worth it! Take a look at this: Slither on GitHub. You won’t want to miss it!
4) Formal proofs for critical paths
- Solidity: If you want to check
assertproperties, you can give Solidity's SMTChecker a try. It's a handy tool for that! If you're after some extra peace of mind, you can't go wrong with the Certora Prover. It does a great job with CVL rules and invariants! - Move Chains: So, if you’re using Move Prover, you’ll be happy to know that it's totally compatible with MSL specs. For more info, check this out here. It’s got all the details you need!
- Mainnet Fork and Testing Protocols. Make sure to double-check your setup with the actual dependencies you’ve got deployed, like oracles and DEX routers. It’s always good to be on the safe side! You can definitely use Anvil or Hardhat for forking, just be sure to pin it to a specific block. It’ll help keep everything organized and consistent for your project! To keep everything running smoothly and avoid bumping into any provider limits, make sure to cache your RPC data in CI. (hardhat.org).
6) Gas and Coverage Gates
We’re all about keeping our code running smoothly and making sure it’s well-tested! So here’s the deal: if a pull request (PR) makes our gas usage go over the limits we’ve set, or if the test coverage dips below what we’ve all agreed on, it’s going to fail. Let’s keep things efficient together!
To keep an eye on these gates, you can use the commands forge snapshot --check --tolerance and forge coverage --report lcov. They’ll help you track everything easily!
Hey there! If you're diving into Hardhat, make sure you remember to turn on --coverage. It’s super helpful!
Hey, if you want to dive deeper into this topic, just click here for all the details!
1) Foundry invariant test (EIP‑7702‑aware handler)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {Test} from "forge-std/Test.sol";
import {StdInvariant} from "forge-std/StdInvariant.sol";
import {IERC20} from "openzeppelin-contracts/token/ERC20/IERC20.sol";
contract Treasury {
address public immutable asset;
address public guardian;
mapping(address => bool) public isOperator;
constructor(address _asset, address _guardian) {
asset = _asset;
guardian = _guardian;
}
function setOperator(address who, bool on) external {
require(msg.sender == guardian, "only guardian");
isOperator[who] = on;
}
function drain(address to, uint256 amt) external {
require(isOperator[msg.sender], "not op");
IERC20(asset).transfer(to, amt);
}
}
contract Handler {
Treasury t;
IERC20 token;
constructor(Treasury _t, IERC20 _token) {
t = _t; token = _token;
}
function setOp(address who, bool on) external {
// simulate guardian txs (EIP-7702: delegate EOAs if needed in future tests)
t.setOperator(who, on);
}
function drain(address to, uint256 amt) external {
if (token.balanceOf(address(t)) >= amt) {
t.drain(to, amt);
}
}
}
contract Treasury_Invariants is Test, StdInvariant {
Treasury t;
IERC20 token;
Handler h;
function setUp() public {
token = IERC20(address(0x...)); // mock or forked addr
t = new Treasury(address(token), address(this));
h = new Handler(t, token);
targetContract(address(h)); // feed fuzzer
}
function invariant_TreasuryBalanceNeverNegative() public {
// Foundry auto-checks invariants after each randomized call
assertGe(token.balanceOf(address(t)), 0);
}
function invariant_OnlyOpsCanDrain() public {
// Postcondition: any outgoing transfer must be caused by an operator
// With Scribble you can instrument this as an if_succeeds property too.
// See: https://diligence.consensys.io/scribble/
}
}
Hey there! If you're getting into smart-account flows (EIP-7702), don’t forget to enable Prague in your foundry.toml. It’s an easy step to make sure everything runs smoothly!
For your specific tests, you can go ahead and use vm.signDelegation/attachDelegation to simulate those delegated EOAs. It’ll help you get the most out of your testing!
Take a look at this link: (getfoundry.sh). It's definitely worth a peek!
2) Hardhat mainnet‑fork test with pinned block and impersonation
import { expect } from "chai";
import { ethers, network } from "hardhat";
describe("Router sanity on fork", function () {
const BLOCK = 21345678; // pin to avoid state drift
const WHALE = "0x..."; // token holder
const ROUTER = "0x..."; // on-chain router
before(async () => {
await network.provider.request({
method: "hardhat_reset",
params: [{ forking: { jsonRpcUrl: process.env.ARCHIVE_RPC!, blockNumber: BLOCK } }],
});
const { networkHelpers } = await network.connect();
await networkHelpers.impersonateAccount(WHALE);
});
it("swaps without revert", async () => {
const whale = await ethers.getSigner(WHALE);
const router = await ethers.getContractAt("IRouter", ROUTER);
// ... craft swap tx
const tx = await router.connect(whale).swapExactTokensForTokens(/* ... */);
await expect(tx).to.emit(router, "Swap");
});
});
Hardhat’s forking documentation does a great job of emphasizing why it’s crucial to pin a block and make use of an archive node. It really helps you understand the process better! There are some really useful tools out there that let you pretend to be different accounts, snap screenshots, and even make direct changes to your storage. These are just perfect for running those deterministic tests! Check it out here!.
3) Scribble property to guard a treasury
/// if_succeeds {:msg "Only operators may drain"} isOperator(msg.sender);
function drain(address to, uint256 amt) external { ... }
Scribble spices up your code with runtime assertions and teams up with Echidna and SMTChecker to automatically search for any counterexamples. It’s like having a trusty sidekick that helps you catch those tricky bugs! Take a look at this link: diligence.consensys.io. You’ll find some interesting stuff there!
Security testing you should automate
- Slither in PRs (GitHub Action): This handy tool is great for spotting those pesky structural issues, potential upgrade problems, and any architectural differences that might pop up. It’s like having an extra set of eyes on your code! To make things a bit easier at the start, go ahead and set it to flag any medium or higher findings as failures. Check it out here.
- Echidna nightly: If you're diving into property fuzzing, Echidna is definitely the tool you want to have in your corner. Its corpus retention feature really sets it apart! Just a heads up: stick to the official action, and if you've got any tests that take a while to run, it’s best to schedule those for nightly runs or set them up in a separate workflow. If you're looking for more details, check this out here. There's a lot of useful info to dig into!
- Mythril ad hoc: This tool is great when you want to dive into specific symbolic analyses for key functions or even check out the bytecode of third-party dependencies. Dive into it here.
- Certora Prover (CVL specs): This tool lets you confirm important things like “total supply never drops,” “only the governance team can mint new tokens,” or “when you deposit, your underlying balance goes up.” "Starting off with the rule templates from the documentation is a pretty smart move." Check those out here.
- Use SWC as a taxonomy: Think of it more as a framework rather than the ultimate answer for testing. It’s best to make sure your controls are in sync with SCSVS v2 instead. If you're looking for more information, you can check it out here.
Coverage and gas as release gates
Check it out! We've got our sights set on the key DeFi protocols. Our goal? Let’s shoot for over 90% line coverage and at least 85% branch coverage on our main contracts. Let's make it happen!
Setting a limit on the maximum gas for those key routes is definitely a smart move. Think of it like a "red line" budget--it's a good way to keep things in check!
Just a heads up--if you're reviewing pull requests, be sure to reject any that have a forge snapshot --check diff that exceeds the tolerance level, which is set at about 3%. Keep an eye on that!
Both Foundry and Hardhat offer LCOV support for CI, and honestly, that's really useful!
If you're looking for more info, you can check it out here. Take a look!
CI/CD blueprint (GitHub Actions)
A minimal, fast pipeline that scales to large repos:
Creating a smooth and fast pipeline for managing huge repositories might seem like a big challenge, but trust me, it’s definitely possible! Alright, let me break it down for you on how to get this set up!
Key Components
1. Lightweight Tools: Choose tools that keep things light and easy. You want to avoid anything that feels heavy or cumbersome! Lightweight frameworks give you a speed boost without all that extra baggage.
2. Streamlined Workflow: Keep your workflow simple and easy to follow. Make sure every step you take has a clear purpose.
3. Parallel Processing: Don’t underestimate the power of parallel processing--it's a total game changer, especially when you're dealing with big repositories. This way, you can juggle multiple tasks at the same time instead of just sitting around waiting for one to wrap up before diving into the next.
4. Incremental Builds: Rather than starting from scratch every single time, try focusing on incremental builds. It saves a lot of time and effort! This really helps us save a lot of time and resources!
5. Caching: Don’t forget to take advantage of caching! It’s a great way to speed things up. If you save the elements you've already built, you can easily skip them in future projects. It just makes things faster and a whole lot easier!
Implementation Steps
- Begin fresh! Let’s get started by setting up a simple environment that’s just right for what you need. Keep it minimal--only include the essentials.
- Take your time and start adding in tools that fit your workflow. Take it easy at the start. Don’t pile on too much right away.
- Test frequently. This really helps spot any problems early and keeps everything running like clockwork.
- Monitor performance. Keeping an eye on things regularly can really help you catch any hiccups before they turn into bigger issues.
Conclusion
When it comes to building a streamlined and fast pipeline for large repositories, it really boils down to keeping things simple and efficient. Focus on what's really important, make the most of parallel processing, and don't forget to monitor how everything's performing! Happy coding!.
name: ci
on: [push, pull_request]
jobs:
foundry:
runs-on: ubuntu-latest
env:
FOUNDRY_PROFILE: ci
ETH_RPC_URL: ${{ secrets.ARCHIVE_RPC }}
steps:
- uses: actions/checkout@v4
- uses: foundry-rs/foundry-toolchain@v1
- run: forge build --sizes
- run: forge test -vvv
- run: forge coverage --report lcov
- run: NO_COLOR=1 forge snapshot --check --tolerance 3 >> $GITHUB_STEP_SUMMARY
Add Slither with Official Action (Fail on Medium+)
Alright, let’s dive into adding Slither to your project! First things first, you want to ensure you’ve got it all set up for official actions. Oh, and don’t forget to enable the fail option if you're working with medium or higher levels. Trust me, it’s an important step! Alright, here's how you can go about it:
1. Install Slither: Alright, let’s get started! If you haven't done it yet, make sure to install Slither in your development environment. It’s a crucial first step! You can easily do this with npm:
npm install -g slither-analyzer
2. Run Slither on Your Code: Alright, now head over to the directory where your smart contract is stored and fire up Slither! It’s as simple as going for a run!
slither .
We're going to take a look at all the contracts hanging out in the directory right now.
3.
Set Up Official Actions: If you want to make sure that Slither trips up on medium and higher severity problems, you'll need to lay that out in your configuration.
You can whip up a configuration file--let’s name it slither-config.yaml--and set it up like this:
slither:
rules:
- Medium+:
fail: true
4. Running with Your Configuration: Alright, now it’s time to fire up Slither using the configuration you just set up!
slither --config slither-config.yaml .
Schedule an Echidna Nightly
Alright, let’s get Echidna set up so we can run those nightly tests! Here’s a step-by-step guide:.
1. Get Echidna: If you haven't installed it yet, you can easily grab it by running this command:
git clone https://github.com/crytic/echidna.git
cd echidna
cabal install
2. Set Up a Nightly Schedule: If you want to automate your testing, you can easily create a cron job. Just keep in mind that this works best if you're using a Unix-like system. It’s a handy way to make sure everything runs smoothly while you catch some Z's! Open your crontab with:.
crontab -e
Alright, just throw in a line to set Echidna to run every night at 2 AM. Easy peasy!
0 2 * * * /path/to/echidna-test --contract=YourContract
3. Keep an Eye on It: It could be a good idea to add some logging so you don’t accidentally overlook any results. You can easily send the output to a log file.
0 2 * * * /path/to/echidna-test --contract=YourContract >> /path/to/echidna-nightly.log 2>&1
And there you go! You're all ready to add Slither and set up Echidna to run every night. Easy peasy! Happy coding!.
slither:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crytic/slither-action@v0.4.1
with:
fail-on: medium
The Foundry action is pretty neat because it saves some of that RPC fork data. This approach really helps lessen your reliance on your provider, which is especially useful when your test matrix begins to expand. Take a look at it over on GitHub! You might find it pretty interesting!
Mainnet‑fork testing: pitfalls and fixes
Hey, don’t forget to pin a block and take note of the RPC provider you’re using! Those little state changes can really mess with reproducibility and totally throw off your gas snapshots. Trust me, you’ll want to keep track of this stuff! Hey there! So, the docs for Hardhat and Foundry really highlight how crucial block pinning is. (hardhat.org).
- Watch those rate limits! If you're diving into some heavy-duty test suites, it might be a good idea to set up caching or run a local reth/geth archive. It'll save you some headaches down the line! The great news is that the Foundry action takes care of caching RPC responses for you without any extra effort on your part! (github.com).
Hey there! So, if you're diving into testing sponsorship and passkeys, and your project relies on EIP-7702 or secp256r1 (that’s RIP-7212 / EIP-7951, in case you were wondering), don't forget to put your entire flow to the test. A good way to do that is by using Foundry cheatcodes along with the anvil --hardfork prague. Happy coding!
Just a quick reminder to stay on top of the differences between clients as the precompile specs keep evolving. It’s easy to overlook, but it’s super important!
(paradigm.xyz).
Non‑EVM specifics you should not skip
- Solana: If you're getting into testing, I’d suggest giving
anchor testa go. It makes things a lot easier! It sets up a local validator and runs Mocha/TS tests without a hitch. If you’re looking to dive deeper into Rust testing, you definitely want to check outsolana-program-test. It’s a fantastic tool that really helps you get the job done! Also, if you're working as a program developer, LiteSVM can seriously help you get things done faster. Check it out here. - Move: Hey, just a heads up! When you're diving into those PRs, don’t forget to run
aptos move prove. It’s an important step! This is a total game-changer! It genuinely prevents merges if any of the designated modules happen to lose their proofs. When it comes to Sui, you definitely want to check out Certora Sui Prover or sui‑prover. They'll help you keep everything secure and running smoothly! If you want to dive deeper into the details, you can check it out here. - NEAR: The Workspaces' spooning and patch-state features are really useful! They allow you to bring in actual contract states from either the mainnet or testnet, which is great for running consistent regression tests. Hey, just a quick note! The docs say that simulation tests are out of the picture now, and we’re focusing on Workspaces instead. If you want to dive deeper into this topic, feel free to check it out here. Happy reading!
- Cosmos SDK/IBC: If you're looking to test things out, I recommend running SimApp/SimsX simulations in your Go tests. It's really the best way to get the job done! It really helps you easily play around with chain parameters and transactions. Oh, and make sure you check out interchaintest for examining IBC paths and how relayers are acting. It’s super helpful! Want to dive deeper? Check out all the details here.
- Fabric: If you're diving into chaincode, don't forget to give it a spin on the Fabric test network first! It's a great way to see how everything works before you go all in. Hey, just a heads up--upgrading your client SDKs to use the Peer Gateway can really boost performance. It’s definitely worth considering! Here's a quick tip for you: it’s best to avoid huge payloads and transactions that drag on for a long time, just like the official docs recommend. It can save you from a lot of headaches down the road! If you want to dive deeper, you can check out more details right here.
Governance, upgrades, and standards
Consider SWC like that go-to tool you use for labeling things. It’s super handy! Just a quick reminder: when you’re putting together your checklists, make sure to reference SCSVS v2. Also, don't forget to include the EEA EthTrust guidance that’s mentioned on the SWC site. It'll definitely keep you on the right track! This way, everyone involved--whether it's reviewers, auditors, or those automated checks--will be totally aligned. Feel free to take a look at it here!
When you're working with EVM upgradeable contracts, it’s super important to make sure you can confidently show that there are “no hidden mint/burn” issues and that “no balance loss” occurs. You can do this by using Certora to formally verify these invariants. Plus, don’t forget to run some checks at runtime with Scribble to catch any potential problems! Hey, just a quick reminder to add some fuzzing to your sequences around those upgrade hooks. It’ll give you that extra peace of mind!
What “good” looks like (our default gates)
- EVM: Great news! Everything's in order. Our forge tests and invariants are passing without a hitch, the Hardhat end-to-end tests are cruising along on the fork, and Slither is showing a clean slate--no high or medium issues to worry about! On top of that, our Echidna properties are looking good with N seeds, and we’ve managed to achieve over 90% coverage for lines and at least 85% for branches. Pretty solid results! Oh, and about the gas snapshot? It's holding steady within a nice 3% range. Great news! All the critical Certora rules are showing green as well! You can check it out here.
- Solana: Everything's looking good with the
anchor test, and we've successfully wrapped up the program test for both unit and integration. We're also keeping an eye on the program size and making sure the CU budgets stay in check during our performance tests. - Move: All the modules that come with MSL specs have been checked and confirmed using the Move Prover. Hey, just a quick heads up--no merges are going to happen until we tackle those regressions. Let's get them sorted out first! (aptos.dev).
- NEAR/Cosmos/Fabric: We’ve put together some solid end-to-end suites that are both representative and deterministic. Plus, we’ve got all the fork, sandbox, and simulation artifacts you might need. Oh, and if you’re looking for a quick overview of our performance, our CI reports have everything you need laid out nicely. (near.github.io).
Final takeaways for decision‑makers
For EVM projects, you'll want to stick with Foundry and Hardhat. If you’re working with Solana, check out Anchor and the solana-program-test. For Aptos and Sui, Move Prover is your go-to. And if you’re feeling adventurous, try diving into NEAR Workspaces, or get familiar with Cosmos SimApp and SimsX. Oh, and don’t forget about the Fabric test network with Peer Gateway! It’s a pretty cool setup. This method definitely helps minimize the times the team has to switch gears, all while making sure we hit every assurance level--from unit tests right up to formal proofs. If you want to dive deeper into this topic, you can find more info here.
- Just weave those proofs and properties directly into your Software Development Life Cycle (SDLC). It’ll fit right in! Honestly, don't even consider shipping without those invariants and those rock-solid "can't happen" statements. They’re essential! A few well-thought-out rules can really take care of a whole bunch of potential exploits. If you want to learn more, just check it out here. You'll find all the details you need!
Just a quick reminder to keep the mainnet-fork tests and gas/coverage gates as absolutely non-negotiable. We really can’t compromise on those! Honestly, it’s a pretty tiny price to pay for some serious peace of mind. You know, it turns out that around 80% of the production incidents we run into could have easily been spotted by the fork suite or just a simple property violation check. It’s pretty wild how something so straightforward can help us avoid so many headaches!
Hey there! If you’re thinking about having 7Block Labs check out your codebase, we typically start with a 2-week testing and assurance boost. It’s a great way to get the ball rolling! Alright, so here’s the deal: you want to start by checking out what you've got on hand. Then, it’s time to switch over to some modern frameworks. After that, don’t forget to set up those CI gates to keep everything running smoothly. You should also nail down around 8 to 12 key properties that really matter. Finally, wrap it all up with a solid plan to test your most important modules. Trust me, this will make a big difference!
Like what you're reading? Let's build together.
Get a free 30-minute consultation with our engineering team.
Related Posts
ByAUJay
Building a Donation-Based Crowdfunding Platform That Gives Tax Receipts
**Summary:** Donation-based crowdfunding that includes tax receipts has become quite the complex puzzle across different regions. You've got to navigate IRS Pub 1771/526 rules, UK Gift Aid declarations, Canada’s CRA receipting, and the new eIDAS/OpenID4VCI wallets--all while keeping everything running smoothly.
ByAUJay
Why 'Full-Lifecycle Advisory' Beats Just Coding
**Summary:** Engineering teams that focus solely on “writing Solidity” often find themselves caught off guard by shifts in protocols, the need for composable security, and the procurement hurdles that are now impacting real ROI. Our full-lifecycle advisory service bridges the gap by connecting EIP-7702 smart accounts, modular decentralized applications (DA), and ZK-based compliance solutions.
ByAUJay
Why Your Project Could Really Use a 'Protocol Economist
Summary: A lot of Web3 teams are missing a crucial player: the “protocol economist.” And you can really see the impact--value slips away through MEV routing, token incentives that are all out of whack, and those sneaky changes to wallets after Pectra that end up messing with the unit economics. In this playbook, we’ll explore what a protocol economist can do to tackle these issues head-on.

