Benchmarking and stress testing contract for EVM networks.
AccessControlBadConfirmation()- Bad access control confirmationAccessControlUnauthorizedAccount(address account, bytes32 neededRole)- Unauthorized accountUnauthorized()- General unauthorized access
BadInput()- Invalid input parameters
ECDSAInvalidSignature()- Invalid ECDSA signatureECDSAInvalidSignatureLength(uint256 length)- Invalid signature lengthECDSAInvalidSignatureS(bytes32 s)- Invalid signature S value
EnforcedPause()- Operation attempted while pausedExpectedPause()- Expected contract to be pausedReentrancyGuardReentrantCall()- Reentrancy detected
ForcedRevert(string why)- Intentional revert for testing
Op(uint8 kind, address indexed caller, uint256 beforeGas, uint256 afterGas, bytes32 indexed tag, bytes payload)- Generic operation event with gas tracking
ExternalCall(address target, bool success, uint256 gasUsed, bytes returndata)- External contract call result
DelegateCall(address target, bool success, uint256 gasUsed)- Delegate call result
StorageTouched(uint256 writes, uint256 reads)- Storage read/write tracking
FundsMoved(address indexed from, address indexed to, uint256 amount)- Native token transfers
RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
Paused(address account)Unpaused(address account)
Purpose: Consume gas through computation Parameters: Number of iterations State: Nonpayable Use Case: Test gas consumption patterns
Purpose: CPU-intensive hashing loop Parameters: Number of iterations Returns: Resulting hash State: View Use Case: Test computational overhead
Purpose: Pure hash computation Parameters: Input number Returns: Hash result State: Pure Use Case: Test pure function gas costs
Purpose: Perform storage reads/writes Parameters:
- writes: Number of storage writes
- reads: Number of storage reads
- tag: Identifier tag Use Case: Test storage gas costs (SLOAD/SSTORE)
hotSlot1/2/3() returns (uint256)- Frequently accessed slotscoldSlot1/2/3() returns (uint256)- Rarely accessed slots Use Case: Test hot vs cold storage access costs
Purpose: Expand dynamic arrays Parameters: Number of words to add Use Case: Test dynamic storage expansion costs
Purpose: Echo large calldata Parameters: Input data Returns: Same data Use Case: Test calldata handling and costs
dynamicArray(uint256) returns (uint256)- Dynamic array accessfixedArray(uint256) returns (uint256)- Fixed array accessbytesArray(uint256) returns (bytes)- Bytes array accessdynamicBytes() returns (bytes)- Dynamic bytes storagedynamicString() returns (string)- Dynamic string storage
Purpose: External contract call Parameters:
- data: Call data
- gasLimit: Gas limit for call Use Case: Test external call overhead
Purpose: Delegate call to another contract Parameters:
- data: Call data
- gasLimit: Gas limit Use Case: Test delegate call patterns
Purpose: Static call to external contract Parameters:
- target: Contract address
- data: Call data Returns: Return data State: View Use Case: Test view function calls
Purpose: Batch mint ERC-20 tokens Parameters:
- to: Recipient addresses
- amt: Amounts per recipient Use Case: Test ERC-20 batch operations
Purpose: Batch mint ERC-721 NFTs Parameters: Recipient addresses Use Case: Test ERC-721 batch minting
Purpose: Batch mint ERC-1155 tokens Parameters:
- to: Recipients
- id: Token ID
- amt: Amounts
- data: Additional data Use Case: Test ERC-1155 batch operations
Purpose: Deploy new contract using CREATE2 Parameters:
- salt: Deployment salt
- initCode: Contract bytecode Use Case: Test contract deployment costs
Purpose: Verify Merkle proof Parameters:
- leaf: Leaf node
- proof: Merkle proof array Returns: Verification result State: View Use Case: Test Merkle tree verification
Purpose: Verify ECDSA signature Parameters:
- expected: Expected signer address
- hash: Message hash
- sig: Signature Returns: Verification result State: View Use Case: Test signature verification
Purpose: Test reentrancy behavior Parameters: Recursion depth Use Case: Test reentrancy guards
Purpose: Enable/disable reentrancy Use Case: Configure reentrancy testing
Purpose: Set gas loop iterations
Purpose: Set number of storage writes
Purpose: Configure revert behavior
Purpose: Set random revert percentage
Purpose: Set event payload size
Purpose: Set Merkle root for verification
Purpose: Set delegate call target
Purpose: Set dummy call target
Purpose: Configure token contract addresses
Purpose: Get all configuration parameters Returns: All tunable parameters Use Case: Query current configuration
Purpose: Get structured data by key Returns: Data struct Use Case: Test complex return types
Purpose: Send native tokens Parameters: Recipient address State: Payable Use Case: Test native token transfers
Purpose: Sweep contract balance Parameters:
- to: Recipient
- amt: Amount to transfer Use Case: Recover funds
Purpose: Grant role to account
Purpose: Revoke role from account
Purpose: Renounce own role
Purpose: Check role membership
Purpose: Get role admin
Purpose: Transfer operator role
DEFAULT_ADMIN_ROLE() returns (bytes32)- Admin role identifierbalances(address) returns (uint256)- Balance mappinggasLoopIters() returns (uint256)- Gas loop configurationsstoreWrites() returns (uint256)- Storage write configurationrevertMode() returns (uint8)- Revert behavior moderandomRevertPct() returns (uint256)- Random revert percentageeventPayloadBytes() returns (uint256)- Event payload sizereentrancyEnabled() returns (bool)- Reentrancy flagdelegateTarget() returns (address)- Delegate target addressdummyCallee() returns (address)- Dummy call targeterc20/721/1155() returns (address)- Token addressesmerkleRoot() returns (bytes32)- Merkle rootpaused() returns (bool)- Pause statedataMap(bytes32) returns (...)- Data storage mappingnested(address, uint256) returns (bytes32)- Nested mapping
- Call
consumeGas()repeatedly - Measure TPS and gas consumption
- Call
touchStorage()with varying reads/writes - Test hot vs cold storage costs
- Use
batchMintERC20/721/1155() - Measure batch efficiency
- Call
bigCalldataEcho()with increasing sizes - Measure calldata costs
- Use
callDummy()anddelegateWork() - Measure call overhead
- Call
verifyProof()andverifySig() - Test verification costs
- Combine multiple operations
- Simulate realistic usage patterns