diff --git a/getting-started/installation.html b/getting-started/installation.html index 5b262a69..8d1b190d 100644 --- a/getting-started/installation.html +++ b/getting-started/installation.html @@ -184,7 +184,9 @@
Download the executable for your platform from the GitHub releases page.
Coming soon
+brew tap ethereum-optimism/tap
+brew install supersim
+
supersim
in vanilla modesupersim
diff --git a/print.html b/print.html
index 3704f6a1..17475e5d 100644
--- a/print.html
+++ b/print.html
@@ -199,7 +199,9 @@ Download the executable for your platform from the GitHub releases page.
Coming soon
+brew tap ethereum-optimism/tap
+brew install supersim
+
supersim
in vanilla modesupersim
diff --git a/searchindex.js b/searchindex.js
index f2e0b935..423a00da 100644
--- a/searchindex.js
+++ b/searchindex.js
@@ -1 +1 @@
-Object.assign(window.search, {"doc_urls":["introduction.html#introduction","introduction.html#features","getting-started/installation.html#installation","getting-started/installation.html#1-prerequisites-foundry","getting-started/installation.html#2-install-supersim","getting-started/installation.html#precompiled-binaries","getting-started/installation.html#homebrew-os-x-linux","getting-started/installation.html#3-start-supersim-in-vanilla-mode","getting-started/first-steps.html#first-steps","getting-started/first-steps.html#deposit-eth-from-the-l1-into-the-l2-l1-to-l2-message-passing","getting-started/first-steps.html#1-call-bridgeeth-function-on-the-l1standardbridgeproxy-contract-on-the-l1-chain-900","getting-started/first-steps.html#2-check-the-balance-on-the-l2-chain-901","getting-started/first-steps.html#send-an-interoperable-superchainerc20-token-from-chain-901-to-902-l2-to-l2-message-passing","getting-started/first-steps.html#1-start-supersim-with-the-autorelayer-enabled","getting-started/first-steps.html#2-mint-tokens-to-transfer-on-chain-901","getting-started/first-steps.html#3-initiate-the-send-transaction-on-chain-901","getting-started/first-steps.html#4-wait-for-the-relayed-message-to-appear-on-chain-902","getting-started/first-steps.html#5-check-the-balance-on-chain-902","reference/supersim.html#supersim-vanilla-mode","reference/supersim.html#overview","reference/supersim.html#configuration","reference/supersim-fork.html#supersim-fork-forked-mode","reference/supersim-fork.html#overview","reference/supersim-fork.html#configuration","reference/supersim-fork.html#notes","reference/supersim-fork.html#fork-height","reference/supersim-fork.html#interoperability-contracts","chain-environment/contracts/index.html#included-contracts","chain-environment/contracts/index.html#op-stack-system-contracts-l1","chain-environment/contracts/index.html#op-stack-l2-contracts-l2","chain-environment/contracts/index.html#periphery-contracts-l2","chain-environment/contracts/index.html#l2nativesuperchainerc20","chain-environment/network-details/index.html#network-details","chain-environment/network-details/op-chain-a.html#opchaina","chain-environment/network-details/op-chain-a.html#network-details","chain-environment/network-details/op-chain-a.html#contract-addresses","chain-environment/network-details/op-chain-a.html#l1-contracts","chain-environment/network-details/op-chain-a.html#l2-contracts","chain-environment/network-details/op-chain-b.html#opchainb","chain-environment/network-details/op-chain-b.html#network-details","chain-environment/network-details/op-chain-b.html#contract-addresses","chain-environment/network-details/op-chain-b.html#l1-contracts","chain-environment/network-details/op-chain-b.html#l2-contracts","guides/deposit-transactions.html#deposit-transactions","guides/interop/index.html#interoperability","guides/interop/manually-relaying-interop-messages-cast.html#manually-relaying-interop-messages-with-cast","guides/interop/manually-relaying-interop-messages-cast.html#overview","guides/interop/manually-relaying-interop-messages-cast.html#contracts-used","guides/interop/manually-relaying-interop-messages-cast.html#high-level-steps","guides/interop/manually-relaying-interop-messages-cast.html#message-identifier","guides/interop/manually-relaying-interop-messages-cast.html#steps","guides/interop/manually-relaying-interop-messages-cast.html#1-start-supersim","guides/interop/manually-relaying-interop-messages-cast.html#2-mint-tokens-to-transfer-on-chain-901","guides/interop/manually-relaying-interop-messages-cast.html#3-initiate-the-send-transaction-on-chain-901","guides/interop/manually-relaying-interop-messages-cast.html#4-get-the-log-emitted-by-the-l2tol2crossdomainmessenger","guides/interop/manually-relaying-interop-messages-cast.html#5-get-the-block-timestamp-the-log-was-emitted-in","guides/interop/manually-relaying-interop-messages-cast.html#6-prepare-the-identifier","guides/interop/manually-relaying-interop-messages-cast.html#7-send-the-relaymessage-transaction","guides/interop/manually-relaying-interop-messages-cast.html#8-check-the-balance-on-chain-902","guides/interop/manually-relaying-interop-messages-cast.html#alternatives","guides/interop/relay-using-viem.html#using-viem-to-relay-interop-messages-typescript","guides/interop/relay-using-viem.html#steps","guides/interop/relay-using-viem.html#1-start-supersim","guides/interop/relay-using-viem.html#2-install-typescript-packages","guides/interop/relay-using-viem.html#3-define-chains-and-constants","guides/interop/relay-using-viem.html#4-mint-and-send-l2nativesuperchainerc20-on-source-chain","guides/interop/relay-using-viem.html#5-relay-the-message-on-the-destination-chain","guides/interop/relay-using-viem.html#full-code-snippet","guides/interop/writing-contract-using-l2cdm.html#writing-cross-chain-contract-using-l2tol2crossdomainmessenger","guides/interop/writing-contract-using-l2cdm.html#high-level-overview","guides/interop/writing-contract-using-l2cdm.html#diagram","guides/interop/writing-contract-using-l2cdm.html#flow","guides/interop/writing-contract-using-l2cdm.html#walkthrough","guides/interop/writing-contract-using-l2cdm.html#initializing-contract-states","guides/interop/writing-contract-using-l2cdm.html#sending-a-cross-chain-message","guides/interop/writing-contract-using-l2cdm.html#receiving-a-cross-chain-message","guides/interop/writing-contract-using-l2cdm.html#takeaways","examples/cross-chain-tictactoe.html#cross-chain-tic-tac-toe"],"index":{"documentStore":{"docInfo":{"0":{"body":48,"breadcrumbs":2,"title":1},"1":{"body":48,"breadcrumbs":2,"title":1},"10":{"body":22,"breadcrumbs":11,"title":9},"11":{"body":24,"breadcrumbs":8,"title":6},"12":{"body":55,"breadcrumbs":13,"title":11},"13":{"body":2,"breadcrumbs":7,"title":5},"14":{"body":24,"breadcrumbs":8,"title":6},"15":{"body":27,"breadcrumbs":8,"title":6},"16":{"body":16,"breadcrumbs":9,"title":7},"17":{"body":49,"breadcrumbs":7,"title":5},"18":{"body":2,"breadcrumbs":4,"title":3},"19":{"body":118,"breadcrumbs":2,"title":1},"2":{"body":0,"breadcrumbs":2,"title":1},"20":{"body":133,"breadcrumbs":2,"title":1},"21":{"body":7,"breadcrumbs":6,"title":4},"22":{"body":126,"breadcrumbs":3,"title":1},"23":{"body":193,"breadcrumbs":3,"title":1},"24":{"body":0,"breadcrumbs":3,"title":1},"25":{"body":14,"breadcrumbs":4,"title":2},"26":{"body":15,"breadcrumbs":4,"title":2},"27":{"body":34,"breadcrumbs":4,"title":2},"28":{"body":24,"breadcrumbs":7,"title":5},"29":{"body":22,"breadcrumbs":7,"title":5},"3":{"body":10,"breadcrumbs":4,"title":3},"30":{"body":13,"breadcrumbs":5,"title":3},"31":{"body":30,"breadcrumbs":3,"title":1},"32":{"body":23,"breadcrumbs":6,"title":2},"33":{"body":8,"breadcrumbs":6,"title":1},"34":{"body":10,"breadcrumbs":7,"title":2},"35":{"body":0,"breadcrumbs":7,"title":2},"36":{"body":64,"breadcrumbs":7,"title":2},"37":{"body":40,"breadcrumbs":7,"title":2},"38":{"body":8,"breadcrumbs":6,"title":1},"39":{"body":10,"breadcrumbs":7,"title":2},"4":{"body":0,"breadcrumbs":4,"title":3},"40":{"body":0,"breadcrumbs":7,"title":2},"41":{"body":64,"breadcrumbs":7,"title":2},"42":{"body":40,"breadcrumbs":7,"title":2},"43":{"body":0,"breadcrumbs":5,"title":2},"44":{"body":0,"breadcrumbs":2,"title":1},"45":{"body":69,"breadcrumbs":11,"title":5},"46":{"body":0,"breadcrumbs":7,"title":1},"47":{"body":6,"breadcrumbs":8,"title":2},"48":{"body":30,"breadcrumbs":9,"title":3},"49":{"body":54,"breadcrumbs":8,"title":2},"5":{"body":6,"breadcrumbs":3,"title":2},"50":{"body":0,"breadcrumbs":7,"title":1},"51":{"body":1,"breadcrumbs":9,"title":3},"52":{"body":24,"breadcrumbs":12,"title":6},"53":{"body":27,"breadcrumbs":12,"title":6},"54":{"body":35,"breadcrumbs":10,"title":4},"55":{"body":57,"breadcrumbs":11,"title":5},"56":{"body":28,"breadcrumbs":9,"title":3},"57":{"body":119,"breadcrumbs":10,"title":4},"58":{"body":14,"breadcrumbs":11,"title":5},"59":{"body":30,"breadcrumbs":7,"title":1},"6":{"body":2,"breadcrumbs":5,"title":4},"60":{"body":56,"breadcrumbs":13,"title":6},"61":{"body":5,"breadcrumbs":8,"title":1},"62":{"body":1,"breadcrumbs":10,"title":3},"63":{"body":4,"breadcrumbs":11,"title":4},"64":{"body":90,"breadcrumbs":11,"title":4},"65":{"body":75,"breadcrumbs":13,"title":6},"66":{"body":58,"breadcrumbs":12,"title":5},"67":{"body":229,"breadcrumbs":10,"title":3},"68":{"body":98,"breadcrumbs":13,"title":6},"69":{"body":40,"breadcrumbs":10,"title":3},"7":{"body":23,"breadcrumbs":6,"title":5},"70":{"body":103,"breadcrumbs":8,"title":1},"71":{"body":138,"breadcrumbs":8,"title":1},"72":{"body":7,"breadcrumbs":8,"title":1},"73":{"body":239,"breadcrumbs":10,"title":3},"74":{"body":192,"breadcrumbs":11,"title":4},"75":{"body":177,"breadcrumbs":11,"title":4},"76":{"body":93,"breadcrumbs":8,"title":1},"77":{"body":0,"breadcrumbs":10,"title":5},"8":{"body":25,"breadcrumbs":4,"title":2},"9":{"body":0,"breadcrumbs":10,"title":8}},"docs":{"0":{"body":"Supersim is a lightweight tool to simulate the Superchain (with a single L1 and multiple OP-Stack L2s). Run multiple local nodes with one command, and coordinate message passing between these chains. It does not require a complicated devnet setup and is run using cli commands with configuration options that fall back to sensible defaults if they are not specified. Each chain is an instance of anvil , though future versions may support other local testing tools.","breadcrumbs":"Introduction » Introduction","id":"0","title":"Introduction"},"1":{"body":"spin up multiple anvil nodes predeployed OP Stack contracts and useful mock contracts (ERC20) fork multiple remote chains (fork the entire Superchain) simulate L1 <> L2 message passing (deposits) simulate L2 <> L2 message passing (interoperability) and auto-relayer ( Coming soon ) Withdrawals ( Coming soon ) ERC-4337 account abstraction services (bundlers / paymasters / wallet implementation)","breadcrumbs":"Introduction » Features","id":"1","title":"Features"},"10":{"body":"Initiate a bridge transaction on the L1: cast send 0xa01ae68902e205B420FD164435F299E07b0C778b \"bridgeETH(uint32 _minGasLimit, bytes calldata _extraData)\" 50000 0x --value 0.1ether --rpc-url http://127.0.0.1:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80","breadcrumbs":"First steps » 1. Call bridgeETH function on the L1StandardBridgeProxy contract on the L1 (chain 900)","id":"10","title":"1. Call bridgeETH function on the L1StandardBridgeProxy contract on the L1 (chain 900)"},"11":{"body":"Verify that the ETH balance of the sender has increased on the L2: cast balance 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --rpc-url http://127.0.0.1:9545 Now that you know how to pass messages from the L1 to the L2, let's try a sending an L2 to L2 message!","breadcrumbs":"First steps » 2. Check the balance on the L2 (chain 901)","id":"11","title":"2. Check the balance on the L2 (chain 901)"},"12":{"body":"In a typical L2 to L2 cross-chain transfer, two transactions are required: Send transaction on the source chain – This initiates the token transfer on Chain 901. Relay message transaction on the destination chain – This relays the transfer details to Chain 902. To simplify this process, you can use the --interop.autorelay flag. This flag automatically triggers the relay message transaction once the initial send transaction is completed on the source chain, improving the developer experience by removing the need to manually send the relay message.","breadcrumbs":"First steps » Send an interoperable SuperchainERC20 token from chain 901 to 902 (L2 to L2 message passing)","id":"12","title":"Send an interoperable SuperchainERC20 token from chain 901 to 902 (L2 to L2 message passing)"},"13":{"body":"supersim --interop.autorelay","breadcrumbs":"First steps » 1. Start supersim with the autorelayer enabled","id":"13","title":"1. Start supersim with the autorelayer enabled"},"14":{"body":"Run the following command to mint 1000 L2NativeSuperchainERC20 tokens to the recipient address: cast send 0x0bEa8920a4FfB1888Ec3Ac1BC0D23f414B0a28cA \"mint(address _to, uint256 _amount)\" 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 1000 --rpc-url http://127.0.0.1:9545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80","breadcrumbs":"First steps » 2. Mint tokens to transfer on chain 901","id":"14","title":"2. Mint tokens to transfer on chain 901"},"15":{"body":"Send the tokens from Chain 901 to Chain 902 using the following command: cast send 0x0bEa8920a4FfB1888Ec3Ac1BC0D23f414B0a28cA \"sendERC20(address _to, uint256 _amount, uint256 _chainId)\" 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 1000 902 --rpc-url http://127.0.0.1:9545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80","breadcrumbs":"First steps » 3. Initiate the send transaction on chain 901","id":"15","title":"3. Initiate the send transaction on chain 901"},"16":{"body":"In a few seconds, you should see the RelayedMessage on chain 902: # example\nINFO [08-30|14:30:14.698] L2ToL2CrossChainMessenger#RelayedMessage sourceChainID=901 destinationChainID=902 nonce=0 sender=0x0bEa8920a4FfB1888Ec3Ac1BC0D23f414B0a28cA target=0x0bEa8920a4FfB1888Ec3Ac1BC0D23f414B0a28cA","breadcrumbs":"First steps » 4. Wait for the relayed message to appear on chain 902","id":"16","title":"4. Wait for the relayed message to appear on chain 902"},"17":{"body":"Verify that the balance of the L2NativeSuperchainERC20 on chain 902 has increased: cast balance --erc20 0x0bEa8920a4FfB1888Ec3Ac1BC0D23f414B0a28cA 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --rpc-url http://127.0.0.1:9546 With the steps above, you've now successfully completed both an L1 to L2 ETH bridge and an L2 to L2 interoperable SuperchainERC20 token transfer, all done locally using supersim. This approach simplifies multichain testing, allowing you to focus on development without the need for complex setups or relying on external testnets.","breadcrumbs":"First steps » 5. Check the balance on chain 902","id":"17","title":"5. Check the balance on chain 902"},"18":{"body":"Overview Configuration","breadcrumbs":"supersim » supersim (vanilla mode)","id":"18","title":"supersim (vanilla mode)"},"19":{"body":"Start supersim in vanilla (non-forked) mode supersim Vanilla mode will start 3 chains, with the OP Stack contracts & periphery contracts already deployed. (1) L1 Chain Chain 900 (2) L2 Chains Chain 901 Chain 902 Example startup logs Available Accounts\n-----------------------\n(0): 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266\n(1): 0x70997970C51812dc3A010C7d01b50e0d17dc79C8\n(2): 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC\n(3): 0x90F79bf6EB2c4f870365E785982E1f101E93b906\n(4): 0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65\n(5): 0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc\n(6): 0x976EA74026E726554dB657fA54763abd0C3a0aa9\n(7): 0x14dC79964da2C08b23698B3D3cc7Ca32193d9955\n(8): 0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f\n(9): 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720 Private Keys\n-----------------------\n(0): 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80\n(1): 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d\n(2): 0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a\n(3): 0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6\n(4): 0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a\n(5): 0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba\n(6): 0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e\n(7): 0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356\n(8): 0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97\n(9): 0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6 Orchestrator Config:\nL1: Name: L1 Chain ID: 900 RPC: http://127.0.0.1:8545 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-900\nL2: Name: OPChainA Chain ID: 901 RPC: http://127.0.0.1:9545 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-901 Name: OPChainB Chain ID: 902 RPC: http://127.0.0.1:9546 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-902","breadcrumbs":"supersim » Overview","id":"19","title":"Overview"},"2":{"body":"","breadcrumbs":"Installation » Installation","id":"2","title":"Installation"},"20":{"body":"NAME: supersim - Superchain Multi-L2 Simulator USAGE: supersim [global options] command [command options] VERSION: untagged DESCRIPTION: Local multichain optimism development environment COMMANDS: fork Locally fork a network in the superchain registry help, h Shows a list of commands or help for one command GLOBAL OPTIONS: --interop.autorelay (default: false) ($SUPERSIM_AUTORELAY) Automatically relay messages sent to the L2ToL2CrossDomainMessenger using account 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720 --l1.port value (default: 8545) ($SUPERSIM_L1_PORT) Listening port for the L1 instance. `0` binds to any available port --l2.starting.port value (default: 9545) ($SUPERSIM_L2_STARTING_PORT) Starting port to increment from for L2 chains. `0` binds each chain to any available port --log.color (default: false) ($SUPERSIM_LOG_COLOR) Color the log output if in terminal mode --log.format value (default: text) ($SUPERSIM_LOG_FORMAT) Format the log output. Supported formats: 'text', 'terminal', 'logfmt', 'json', 'json-pretty', --log.level value (default: INFO) ($SUPERSIM_LOG_LEVEL) The lowest log level that will be output --log.pid (default: false) ($SUPERSIM_LOG_PID) Show pid in the log MISC --help, -h (default: false) show help --version, -v (default: false) print the version","breadcrumbs":"supersim » Configuration","id":"20","title":"Configuration"},"21":{"body":"Overview Configuration Notes Fork height Interoperability contracts","breadcrumbs":"supersim fork » supersim fork (forked mode)","id":"21","title":"supersim fork (forked mode)"},"22":{"body":"supersim fork The supersim fork command simplifies the process of forking multiple chains in the Superchain ecosystem simultaneously. It determines the appropriate block heights for each chain and launches both the L1 and L2 chains based on these values. If you're relying on contracts already deployed on testnet / mainnet chains, you can use fork mode to simulate and interact with the state of the chain without needing to re-deploy or modify the contracts. Locally fork any of the available chains in a superchain network of the superchain registry , default mainnet versions. Example startup logs Available Accounts\n-----------------------\n(0): 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266\n--- truncated for brevity --- Private Keys\n-----------------------\n(0): 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80\n--- truncated for brevity --- Orchestrator Config:\nL1: Name: mainnet Chain ID: 1 RPC: http://127.0.0.1:8545 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-1-1521250718\nL2: Name: op Chain ID: 10 RPC: http://127.0.0.1:9545 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-10 Name: base Chain ID: 8453 RPC: http://127.0.0.1:9546 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-8453 Name: zora Chain ID: 7777777 RPC: http://127.0.0.1:9547 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-7777777","breadcrumbs":"supersim fork » Overview","id":"22","title":"Overview"},"23":{"body":"NAME: supersim fork - Locally fork a network in the superchain registry USAGE: supersim fork [command options] OPTIONS: --l1.fork.height value (default: 0) ($SUPERSIM_L1_FORK_HEIGHT) L1 height to fork the superchain (bounds L2 time). `0` for latest --chains value ($SUPERSIM_CHAINS) chains to fork in the superchain, mainnet options: [base, lyra, metal, mode, op, orderly, race, zora]. In order to replace the public rpc endpoint for a chain, specify the ($SUPERSIM_RPC_URL_