Build, test, and deploy Solidity contracts on TAC using Foundry - the fast, portable toolkit
TAC EVM Layer provides full compatibility with Foundry, the blazing fast development toolkit for Ethereum. Deploy your contracts with lightning speed, run comprehensive Solidity tests, and leverage advanced debugging features.
# Run all testsforge test# Run tests with verbosityforge test -vvv# Run specific testforge test --match-test testSetValue# Run tests for specific contractforge test --match-contract SimpleStorageTest# Run with gas reportingforge test --gas-report
Copy
Ask AI
# Run all testsforge test# Run tests with verbosityforge test -vvv# Run specific testforge test --match-test testSetValue# Run tests for specific contractforge test --match-contract SimpleStorageTest# Run with gas reportingforge test --gas-report
Copy
Ask AI
# Test against TAC testnet forkforge test --fork-url https://spb.rpc.tac.build# Test at specific blockforge test --fork-url https://spb.rpc.tac.build --fork-block-number 1000000# Test with environment variableforge test --fork-url $TAC_TESTNET_RPC
Foundry’s fuzzing capabilities are excellent for testing edge cases in cross-chain scenarios.
# Deploy to TAC Saint Petersburg testnetforge script script/Deploy.s.sol:DeployScript \ --rpc-url tac_testnet \ --broadcast \ --verify
Expected output:
Copy
Ask AI
SimpleStorage deployed to: 0x5FbDB2315678afecb367f032d93F642f64180aa3TacEnabledContract deployed to: 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512Deployment completed on network: 2391
Copy
Ask AI
# Deploy to TAC Saint Petersburg testnetforge script script/Deploy.s.sol:DeployScript \ --rpc-url tac_testnet \ --broadcast \ --verify
Expected output:
Copy
Ask AI
SimpleStorage deployed to: 0x5FbDB2315678afecb367f032d93F642f64180aa3TacEnabledContract deployed to: 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512Deployment completed on network: 2391
# Build contractsforge build# Build with specific Solidity versionforge build --use 0.8.19# Build with size optimizationforge build --sizes# Generate ABI filesforge build --extra-output abi
# Generate coverage reportforge coverage# Coverage with specific formatforge coverage --report lcov# Coverage for specific testforge coverage --match-test testSetValue
Copy
Ask AI
# Generate coverage reportforge coverage# Coverage with specific formatforge coverage --report lcov# Coverage for specific testforge coverage --match-test testSetValue
Copy
Ask AI
# Gas report for all testsforge test --gas-report# Gas snapshot (track gas changes)forge snapshot# Compare gas usageforge snapshot --diff
Copy
Ask AI
# Debug specific testforge test --debug testSetValue# Debug with maximum verbosityforge test -vvvv --match-test testSetValue# Trace contract callsforge test --trace --match-test testSetValue