Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 152 additions & 0 deletions campaigns/full-spectrum.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
name = "full-spectrum"
description = "4-stage campaign covering all scenario categories: warmup with simple ops, ramp into DeFi, peak with full protocol mix, cooldown"

[spam]
mode = "tps"
rate = 100
duration = 120
seed = 42

# ──────────────────────────────────────────────────────────────
# Stage 1: Warmup — simple token operations
# ──────────────────────────────────────────────────────────────
[[spam.stage]]
name = "warmup"
rate = 50
duration = 60

[[spam.stage.mix]]
scenario = "erc20"
share_pct = 30.0

[[spam.stage.mix]]
scenario = "scenarios/erc721.toml"
share_pct = 25.0

[[spam.stage.mix]]
scenario = "scenarios/erc1155.toml"
share_pct = 25.0

[[spam.stage.mix]]
scenario = "scenarios/stablecoin.toml"
share_pct = 20.0

# ──────────────────────────────────────────────────────────────
# Stage 2: Ramp — DeFi protocols come online
# ──────────────────────────────────────────────────────────────
[[spam.stage]]
name = "defi-ramp"
rate = 150
duration = 120

[[spam.stage.mix]]
scenario = "scenarios/simpleAMM.toml"
share_pct = 25.0

[[spam.stage.mix]]
scenario = "scenarios/lending.toml"
share_pct = 20.0

[[spam.stage.mix]]
scenario = "scenarios/staking.toml"
share_pct = 15.0

[[spam.stage.mix]]
scenario = "scenarios/erc4626vault.toml"
share_pct = 15.0

[[spam.stage.mix]]
scenario = "scenarios/orderBook.toml"
share_pct = 15.0

[[spam.stage.mix]]
scenario = "scenarios/bridge.toml"
share_pct = 10.0

# ──────────────────────────────────────────────────────────────
# Stage 3: Peak — everything at once, max diversity
# ──────────────────────────────────────────────────────────────
[[spam.stage]]
name = "full-load"
rate = 300
duration = 180

[[spam.stage.mix]]
scenario = "scenarios/simpleAMM.toml"
share_pct = 15.0

[[spam.stage.mix]]
scenario = "scenarios/lending.toml"
share_pct = 12.0

[[spam.stage.mix]]
scenario = "scenarios/orderBook.toml"
share_pct = 10.0

[[spam.stage.mix]]
scenario = "scenarios/staking.toml"
share_pct = 8.0

[[spam.stage.mix]]
scenario = "scenarios/erc4626vault.toml"
share_pct = 8.0

[[spam.stage.mix]]
scenario = "scenarios/governance.toml"
share_pct = 7.0

[[spam.stage.mix]]
scenario = "scenarios/multisig.toml"
share_pct = 7.0

[[spam.stage.mix]]
scenario = "scenarios/bridge.toml"
share_pct = 7.0

[[spam.stage.mix]]
scenario = "scenarios/dutchAuction.toml"
share_pct = 5.0

[[spam.stage.mix]]
scenario = "scenarios/nameRegistry.toml"
share_pct = 5.0

[[spam.stage.mix]]
scenario = "scenarios/precompiles/hashPrecompiles.toml"
share_pct = 5.0

[[spam.stage.mix]]
scenario = "scenarios/stablecoin.toml"
share_pct = 5.0

[[spam.stage.mix]]
scenario = "scenarios/erc721.toml"
share_pct = 3.0

[[spam.stage.mix]]
scenario = "scenarios/erc1155.toml"
share_pct = 3.0

# ──────────────────────────────────────────────────────────────
# Stage 4: Cooldown — light governance + staking tail
# ──────────────────────────────────────────────────────────────
[[spam.stage]]
name = "cooldown"
rate = 30
duration = 60

[[spam.stage.mix]]
scenario = "scenarios/governance.toml"
share_pct = 30.0

[[spam.stage.mix]]
scenario = "scenarios/staking.toml"
share_pct = 30.0

[[spam.stage.mix]]
scenario = "scenarios/nameRegistry.toml"
share_pct = 20.0

[[spam.stage.mix]]
scenario = "erc20"
share_pct = 20.0
161 changes: 161 additions & 0 deletions scenarios/bondingCurve.toml

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions scenarios/bridge.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# ============================================================
# L1->L2 Bridge Deposit Scenario
# ============================================================
# Simulates bridge deposit traffic: ETH deposits, ERC20 deposits,
# and deposit processing. Event-heavy with storage writes for
# nonce tracking and deposit hash storage.
# Source: /tmp/bridge.sol (Solidity 0.8.26, optimized with 200 runs)
# ============================================================

[env]
initialSupply = "1000000000000000000000000000"
destinationChainId = "42161"

# Deploy BridgeToken with initial supply
[[create]]
name = "BridgeToken"
bytecode = "0x60c0604052600b60809081526a213934b233b2aa37b5b2b760a91b60a0525f90610029908261016f565b5060408051808201909152600381526242524760e81b6020820152600190610051908261016f565b506002805460ff1916601217905534801561006a575f80fd5b506040516109bb3803806109bb83398101604081905261008991610229565b6003819055335f818152600460209081526040808320859055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a350610240565b634e487b7160e01b5f52604160045260245ffd5b600181811c908216806100ff57607f821691505b60208210810361011d57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561016a57805f5260205f20601f840160051c810160208510156101485750805b601f840160051c820191505b81811015610167575f8155600101610154565b50505b505050565b81516001600160401b03811115610188576101886100d7565b61019c8161019684546100eb565b84610123565b6020601f8211600181146101ce575f83156101b75750848201515b5f19600385901b1c1916600184901b178455610167565b5f84815260208120601f198516915b828110156101fd57878501518255602094850194600190920191016101dd565b508482101561021a57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f60208284031215610239575f80fd5b5051919050565b61076e8061024d5f395ff3fe608060405234801561000f575f80fd5b506004361061009b575f3560e01c806340c10f191161006357806340c10f191461012957806370a082311461013e57806395d89b411461015d578063a9059cbb14610165578063dd62ed3e14610178575f80fd5b806306fdde031461009f578063095ea7b3146100bd57806318160ddd146100e057806323b872dd146100f7578063313ce5671461010a575b5f80fd5b6100a76101a2565b6040516100b491906105c3565b60405180910390f35b6100d06100cb366004610613565b61022d565b60405190151581526020016100b4565b6100e960035481565b6040519081526020016100b4565b6100d061010536600461063b565b610299565b6002546101179060ff1681565b60405160ff90911681526020016100b4565b61013c610137366004610613565b61044f565b005b6100e961014c366004610675565b60046020525f908152604090205481565b6100a76104d5565b6100d0610173366004610613565b6104e2565b6100e9610186366004610695565b600560209081525f928352604080842090915290825290205481565b5f80546101ae906106c6565b80601f01602080910402602001604051908101604052809291908181526020018280546101da906106c6565b80156102255780601f106101fc57610100808354040283529160200191610225565b820191905f5260205f20905b81548152906001019060200180831161020857829003601f168201915b505050505081565b335f8181526005602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906102879086815260200190565b60405180910390a35060015b92915050565b6001600160a01b0383165f908152600460205260408120548211156102fc5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b60448201526064015b60405180910390fd5b6001600160a01b0384165f9081526005602090815260408083203384529091529020548211156103675760405162461bcd60e51b8152602060048201526016602482015275496e73756666696369656e7420616c6c6f77616e636560501b60448201526064016102f3565b6001600160a01b0384165f90815260056020908152604080832033845290915281208054849290610399908490610712565b90915550506001600160a01b0384165f90815260046020526040812080548492906103c5908490610712565b90915550506001600160a01b0383165f90815260046020526040812080548492906103f1908490610725565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161043d91815260200190565b60405180910390a35060019392505050565b8060035f8282546104609190610725565b90915550506001600160a01b0382165f908152600460205260408120805483929061048c908490610725565b90915550506040518181526001600160a01b038316905f907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b600180546101ae906106c6565b335f908152600460205260408120548211156105375760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b60448201526064016102f3565b335f9081526004602052604081208054849290610555908490610712565b90915550506001600160a01b0383165f9081526004602052604081208054849290610581908490610725565b90915550506040518281526001600160a01b0384169033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610287565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b80356001600160a01b038116811461060e575f80fd5b919050565b5f8060408385031215610624575f80fd5b61062d836105f8565b946020939093013593505050565b5f805f6060848603121561064d575f80fd5b610656846105f8565b9250610664602085016105f8565b929592945050506040919091013590565b5f60208284031215610685575f80fd5b61068e826105f8565b9392505050565b5f80604083850312156106a6575f80fd5b6106af836105f8565b91506106bd602084016105f8565b90509250929050565b600181811c908216806106da57607f821691505b6020821081036106f857634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b81810381811115610293576102936106fe565b80820180821115610293576102936106fe56fea2646970667358221220b5525893496b8c03e7490ee0afa301b608e821a0070a13eecd4bf31d8edc13a864736f6c634300081a0033"
args = ["{initialSupply}"]

# Deploy SimpleBridge
[[create]]
name = "SimpleBridge"
bytecode = "0x6080604052348015600e575f80fd5b50610b368061001c5f395ff3fe60806040526004361061006e575f3560e01c8063873d8ea41161004c578063873d8ea4146100e9578063ae7e3baf14610108578063b581d2d114610136578063de35f5cb14610155575f80fd5b806321425ee01461007257806340c5faf0146100935780635358fbda146100d6575b5f80fd5b34801561007d575f80fd5b5061009161008c3660046107a8565b610177565b005b34801561009e575f80fd5b506100c16100ad3660046107d8565b60026020525f908152604090205460ff1681565b60405190151581526020015b60405180910390f35b6100916100e43660046107d8565b610404565b3480156100f4575f80fd5b50610091610103366004610923565b61055e565b348015610113575f80fd5b506100c16101223660046107d8565b60016020525f908152604090205460ff1681565b348015610141575f80fd5b50610091610150366004610a08565b6106d9565b348015610160575f80fd5b506101695f5481565b6040519081526020016100cd565b5f82116101be5760405162461bcd60e51b815260206004820152601060248201526f04d757374206465706f736974203e20360841b60448201526064015b60405180910390fd5b5f805481806101cc83610a3b565b909155506040516001600160601b031933606090811b8216602084015287901b1660348201526048810185905260688101849052608881018290524260a88201529091505f9060c80160408051808303601f1901815282825280516020918201205f818152600192839052928320805460ff19169092179091553360248401523060448401526064830187905292509081906001600160a01b0388169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b179052516102a19190610a5f565b5f604051808303815f865af19150503d805f81146102da576040519150601f19603f3d011682016040523d82523d5f602084013e6102df565b606091505b50915091508180156103095750805115806103095750808060200190518101906103099190610a75565b6103475760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016101b5565b6040516001600160601b031933606090811b8216602084015289901b1660348201526048810187905260688101869052608881018590524260a88201524360c88201523a60e88201525f90610108016040516020818303038152906040529050876001600160a01b0316336001600160a01b03167f83f979c86e35c88739c699828e098f274ca74b323949a3d7e0bcee8659291c5989898989876040516103f2959493929190610a9b565b60405180910390a35050505050505050565b5f34116104435760405162461bcd60e51b815260206004820152600d60248201526c09aeae6e840e6cadcc8408aa89609b1b60448201526064016101b5565b5f8054818061045183610a3b565b909155506040516001600160601b03193360601b16602082015234603482015260548101849052607481018290524260948201529091505f9060b40160408051808303601f1901815282825280516020918201205f8181526001808452938120805460ff19169094179093556001600160601b03193360601b169184019190915234603484015260548301869052607483018590524260948401524360b48401523a60d484015292509060f4016040516020818303038152906040529050336001600160a01b03167f9115d9081fb8f9b65e895000da18c06368188a5cff8812f41583d514cc472c3c3486868686604051610550959493929190610a9b565b60405180910390a250505050565b81518351148015610570575080518251145b6105ae5760405162461bcd60e51b815260206004820152600f60248201526e098cadccee8d040dad2e6dac2e8c6d608b1b60448201526064016101b5565b5f5b83518110156106d35760025f8583815181106105ce576105ce610aec565b60209081029190910181015182528101919091526040015f205460ff166106cb57600160025f86848151811061060657610606610aec565b602002602001015181526020019081526020015f205f6101000a81548160ff02191690831515021790555083818151811061064357610643610aec565b60200260200101517f7d77e3f1866839ef93f5eda23990fa4368bf7b0af583ae0f64ecae4da14a4d6184838151811061067e5761067e610aec565b602002602001015184848151811061069857610698610aec565b60200260200101516040516106c29291906001600160a01b03929092168252602082015260400190565b60405180910390a25b6001016105b0565b50505050565b5f8381526002602052604090205460ff161561072b5760405162461bcd60e51b8152602060048201526011602482015270105b1c9958591e481c1c9bd8d95cdcd959607a1b60448201526064016101b5565b5f83815260026020908152604091829020805460ff1916600117905581516001600160a01b038516815290810183905284917f7d77e3f1866839ef93f5eda23990fa4368bf7b0af583ae0f64ecae4da14a4d61910160405180910390a2505050565b80356001600160a01b03811681146107a3575f80fd5b919050565b5f805f606084860312156107ba575f80fd5b6107c38461078d565b95602085013595506040909401359392505050565b5f602082840312156107e8575f80fd5b5035919050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561082c5761082c6107ef565b604052919050565b5f67ffffffffffffffff82111561084d5761084d6107ef565b5060051b60200190565b5f82601f830112610866575f80fd5b813561087961087482610834565b610803565b8082825260208201915060208360051b86010192508583111561089a575f80fd5b602085015b838110156108be576108b08161078d565b83526020928301920161089f565b5095945050505050565b5f82601f8301126108d7575f80fd5b81356108e561087482610834565b8082825260208201915060208360051b860101925085831115610906575f80fd5b602085015b838110156108be57803583526020928301920161090b565b5f805f60608486031215610935575f80fd5b833567ffffffffffffffff81111561094b575f80fd5b8401601f8101861361095b575f80fd5b803561096961087482610834565b8082825260208201915060208360051b85010192508883111561098a575f80fd5b6020840193505b828410156109ac578335825260209384019390910190610991565b9550505050602084013567ffffffffffffffff8111156109ca575f80fd5b6109d686828701610857565b925050604084013567ffffffffffffffff8111156109f2575f80fd5b6109fe868287016108c8565b9150509250925092565b5f805f60608486031215610a1a575f80fd5b83359250610a2a6020850161078d565b929592945050506040919091013590565b5f60018201610a5857634e487b7160e01b5f52601160045260245ffd5b5060010190565b5f82518060208501845e5f920191825250919050565b5f60208284031215610a85575f80fd5b81518015158114610a94575f80fd5b9392505050565b85815284602082015283604082015282606082015260a060808201525f82518060a0840152806020850160c085015e5f60c0828501015260c0601f19601f8301168401019150509695505050505050565b634e487b7160e01b5f52603260045260245ffdfea2646970667358221220c6237f765464f07265664dc7df1b6eb37bb7735d8d12b71e268b1e9404a36f1c64736f6c634300081a0033"

# Setup: mint BridgeTokens to all spammer accounts
[[setup]]
kind = "mint_tokens"
to = "{BridgeToken}"
from_pool = "admin"
for_all_accounts = true
signature = "mint(address to, uint256 amount)"
args = ["{_sender}", "{initialSupply}"]

# Setup: approve SimpleBridge to spend tokens for all spammer accounts
[[setup]]
kind = "approve_bridge"
to = "{BridgeToken}"
for_all_accounts = true
signature = "approve(address spender, uint256 amount)"
args = ["{SimpleBridge}", "{initialSupply}"]

# Spam 1: depositETH - fuzz tx value from 0.001 to 0.01 ETH
[[spam]]
[spam.tx]
kind = "deposit_eth"
to = "{SimpleBridge}"
from_pool = "depositors"
signature = "function depositETH(uint256 destinationChainId) payable"
args = ["{destinationChainId}"]
value = "0.005 eth"
gas_limit = 150000
fuzz = [
{ value = true, min = "1000000000000000", max = "10000000000000000" },
]

# Spam 2: depositERC20 - fuzz amount from 1e15 to 1e18
[[spam]]
[spam.tx]
kind = "deposit_erc20"
to = "{SimpleBridge}"
from_pool = "depositors"
signature = "function depositERC20(address token, uint256 amount, uint256 destinationChainId)"
args = ["{BridgeToken}", "1000000000000000000", "{destinationChainId}"]
gas_limit = 200000
fuzz = [
{ param = "amount", min = "1000000000000000", max = "1000000000000000000" },
]

# Spam 3: processDeposit - simulate processing with fuzzed depositHash
[[spam]]
[spam.tx]
kind = "process_deposit"
to = "{SimpleBridge}"
from_pool = "processors"
signature = "function processDeposit(bytes32 depositHash, address recipient, uint256 amount)"
args = ["0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000001", "1000000000000000000"]
gas_limit = 120000
fuzz = [
{ param = "depositHash", min = "0", max = "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" },
]
Loading