Skip to content

Commit

Permalink
Merge pull request #228 from ethereum-optimism/harry/update_superc20_…
Browse files Browse the repository at this point in the history
…event_names

feat: update supersim to contain crosschain event name change
  • Loading branch information
tremarkley authored Oct 23, 2024
2 parents 0085952 + 39cc63c commit a907454
Show file tree
Hide file tree
Showing 15 changed files with 230 additions and 226 deletions.
2 changes: 1 addition & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ generate-monorepo-bindings: install-abigen
generate-genesis: build-contracts
go run ./genesis/cmd/main.go --monorepo-artifacts $(just calculate-artifact-url) --periphery-artifacts ./contracts/out --outdir ./genesis/generated

generate-all: generate-genesis generate-monorepo-bindings
generate-all version: (install-monorepo version) generate-genesis generate-monorepo-bindings
106 changes: 53 additions & 53 deletions bindings/l2nativesuperchainerc20.go

Large diffs are not rendered by default.

106 changes: 53 additions & 53 deletions bindings/superchainerc20.go

Large diffs are not rendered by default.

106 changes: 53 additions & 53 deletions bindings/superchainweth.go

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions contracts/test/L2NativeSuperchainERC20.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ contract L2NativeSuperchainERC20Test is Test {

// Look for the emit of the `Mint` event
vm.expectEmit(true, true, true, true, address(superchainERC20));
emit ICrosschainERC20.CrosschainMinted(_to, _amount);
emit ICrosschainERC20.CrosschainMint(_to, _amount);

vm.prank(SUPERCHAIN_TOKEN_BRIDGE);
superchainERC20.crosschainMint(_to, _amount);
Expand All @@ -106,7 +106,7 @@ contract L2NativeSuperchainERC20Test is Test {
superchainERC20.crosschainBurn(_from, _amount);
}

/// @notice Tests the `burn` burns the amount and emits the `CrosschainBurnt` event.
/// @notice Tests the `burn` burns the amount and emits the `CrosschainBurn` event.
function testFuzz_crosschainBurn_succeeds(address _from, uint256 _amount) public {
// Ensure `_from` is not the zero address
vm.assume(_from != ZERO_ADDRESS);
Expand All @@ -123,10 +123,10 @@ contract L2NativeSuperchainERC20Test is Test {
vm.expectEmit(address(superchainERC20));
emit ERC20.Transfer(_from, ZERO_ADDRESS, _amount);

// Look for the emit of the `CrosschainBurnt` event
// Look for the emit of the `CrosschainBurn` event
// vm.expectEmit(address(superchainERC20));
vm.expectEmit(true, true, true, true, address(superchainERC20));
emit ICrosschainERC20.CrosschainBurnt(_from, _amount);
emit ICrosschainERC20.CrosschainBurn(_from, _amount);

// Call the `burn` function with the bridge caller
vm.prank(SUPERCHAIN_TOKEN_BRIDGE);
Expand Down
14 changes: 7 additions & 7 deletions genesis/generated/900-l1-genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"depositContractAddress": "0x0000000000000000000000000000000000000000"
},
"nonce": "0x0",
"timestamp": "0x67191ed8",
"timestamp": "0x67196bbe",
"extraData": "0x",
"gasLimit": "0x1c9c380",
"difficulty": "0x0",
Expand Down Expand Up @@ -299,7 +299,7 @@
"0x0000000000000000000000000000000000000000000000000000000000000035": "0x0000000000000000000000811d626a3444c5c10fa01607ee11efbeaf19b0ff00",
"0x0000000000000000000000000000000000000000000000000000000000000037": "0x000000000000000000000000fb295aa436f23be2bd17678adf1232bdec02fed1",
"0x0000000000000000000000000000000000000000000000000000000000000038": "0x00000000000000000000000094e2e1fcbfd1099b450b2d5ac1f1701327361163",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067191ed800000001",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067196bbe00000001",
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000fa16d7079aab573acdf911dd58e4457a20547548",
"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x000000000000000000000000d98e0b378583bbcc8183184ce053aecbd15f22e5"
},
Expand All @@ -315,7 +315,7 @@
"0x0000000000000000000000000000000000000000000000000000000000000035": "0x0000000000000000000000811d626a3444c5c10fa01607ee11efbeaf19b0ff00",
"0x0000000000000000000000000000000000000000000000000000000000000037": "0x000000000000000000000000fd19a33f8d757b8ea93bb2b40b1cde946c1e1f4d",
"0x0000000000000000000000000000000000000000000000000000000000000038": "0x000000000000000000000000124efba5858a36f53726e107481e71d9060d84e0",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067191ed800000001",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067196bbe00000001",
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000fa16d7079aab573acdf911dd58e4457a20547548",
"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x0000000000000000000000000c2405b5f131d7fe2e1f49e41e8a20d8e4179e7e"
},
Expand Down Expand Up @@ -521,7 +521,7 @@
"0x0000000000000000000000000000000000000000000000000000000000000035": "0x0000000000000000000000811d626a3444c5c10fa01607ee11efbeaf19b0ff00",
"0x0000000000000000000000000000000000000000000000000000000000000037": "0x00000000000000000000000025782c27ef09d9173f8f274bead411bb9ac5417c",
"0x0000000000000000000000000000000000000000000000000000000000000038": "0x000000000000000000000000ed76b1d812dad3a322fdc3d766f251d51a78c3a9",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067191ed800000001",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067196bbe00000001",
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000fa16d7079aab573acdf911dd58e4457a20547548",
"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x00000000000000000000000048ff3b8ac58f74a9060dadfd60093d71a2e0b2ea"
},
Expand Down Expand Up @@ -830,7 +830,7 @@
"0x0000000000000000000000000000000000000000000000000000000000000035": "0x0000000000000000000000811d626a3444c5c10fa01607ee11efbeaf19b0ff00",
"0x0000000000000000000000000000000000000000000000000000000000000037": "0x00000000000000000000000083e3463f6d53730367af74ad398779760b6404dd",
"0x0000000000000000000000000000000000000000000000000000000000000038": "0x0000000000000000000000000a4bf4bfdbd1155df635021f4558eef0754e3706",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067191ed800000001",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067196bbe00000001",
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000fa16d7079aab573acdf911dd58e4457a20547548",
"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x000000000000000000000000041ce2550a7925b7307fb1253962a3a6d89e7135"
},
Expand Down Expand Up @@ -937,7 +937,7 @@
"0x0000000000000000000000000000000000000000000000000000000000000035": "0x0000000000000000000000811d626a3444c5c10fa01607ee11efbeaf19b0ff00",
"0x0000000000000000000000000000000000000000000000000000000000000037": "0x000000000000000000000000489d9f7f107dfca422f31f7b9d90d27442c76d64",
"0x0000000000000000000000000000000000000000000000000000000000000038": "0x000000000000000000000000ed5f8f44f210716c76111f7973acbddb39784d73",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067191ed800000001",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067196bbe00000001",
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000fa16d7079aab573acdf911dd58e4457a20547548",
"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x000000000000000000000000702ff7bf17315db7a068039006515a1c9a40c1c0"
},
Expand Down Expand Up @@ -1266,7 +1266,7 @@
"0x0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000000001",
"0x0000000000000000000000000000000000000000000000000000000000000001": "0x000000000000000000000000000000000000000000000000000000003b9aca00",
"0x0000000000000000000000000000000000000000000000000000000000000032": "0x000000000000000000000000000000000000000000000000000000000000dead",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067191ed800000000"
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067196bbe00000000"
},
"balance": "0x0",
"nonce": "0x1"
Expand Down
18 changes: 9 additions & 9 deletions genesis/generated/901-l2-genesis.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions genesis/generated/902-l2-genesis.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions genesis/generated/903-l2-genesis.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions genesis/generated/904-l2-genesis.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions genesis/generated/905-l2-genesis.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.22.3

require (
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef
github.com/ethereum-optimism/optimism v1.9.5-0.20241023083742-a82a3287dafa
github.com/ethereum-optimism/optimism v1.9.5-0.20241023211601-7b119c533f22
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20241002103526-9083af857790
github.com/ethereum/go-ethereum v1.14.11
github.com/joho/godotenv v1.5.1
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs=
github.com/ethereum-optimism/op-geth v1.101411.1-rc.2 h1:nOeSTzcFWUCvJO1MJ5AyI26dqR1F7vYgz2jNNKuEtoE=
github.com/ethereum-optimism/op-geth v1.101411.1-rc.2/go.mod h1:7S4pp8KHBmEmKkRjL1BPOc6jY9hW+64YeMUjR3RVLw4=
github.com/ethereum-optimism/optimism v1.9.4 h1:u/UGeyLu9WgQKWHY6e+/JDLdcMTM2YDqjBaNcdimuz0=
github.com/ethereum-optimism/optimism v1.9.4/go.mod h1:AWta6PYBofr4hxrGpXR5O46/qhov3FbEE6YOw0yDS7A=
github.com/ethereum-optimism/optimism v1.9.5-0.20241022202907-85248727fe59 h1:BQU5WUL5PKATBL6B85kmR8Lv7NF5zFtuBOmdHDMPSKg=
github.com/ethereum-optimism/optimism v1.9.5-0.20241022202907-85248727fe59/go.mod h1:pA+0LrOL45eGFQeOzkkPDojBPlSRVCXvpx6NsB5Am6M=
github.com/ethereum-optimism/optimism v1.9.5-0.20241022232055-de795648c5d9 h1:1R4OpVoHxpEmsPQ7lQSb6koCGWFm9uAJ3scYVQkvMbg=
Expand All @@ -107,6 +109,8 @@ github.com/ethereum-optimism/optimism v1.9.5-0.20241023083742-a82a3287dafa h1:ZR
github.com/ethereum-optimism/optimism v1.9.5-0.20241023083742-a82a3287dafa/go.mod h1:pA+0LrOL45eGFQeOzkkPDojBPlSRVCXvpx6NsB5Am6M=
github.com/ethereum-optimism/optimism v1.9.5-0.20241023150946-2bbffdc432c3 h1:LBXYbA5gXRjMVNsQsTj0A9B1TrLGn7dHVVbNRNf97Cg=
github.com/ethereum-optimism/optimism v1.9.5-0.20241023150946-2bbffdc432c3/go.mod h1:pA+0LrOL45eGFQeOzkkPDojBPlSRVCXvpx6NsB5Am6M=
github.com/ethereum-optimism/optimism v1.9.5-0.20241023211601-7b119c533f22 h1:dAKFxNhWJWSua7nXw/LNHY9GY7AwTjXevbE2mHwKOi8=
github.com/ethereum-optimism/optimism v1.9.5-0.20241023211601-7b119c533f22/go.mod h1:pA+0LrOL45eGFQeOzkkPDojBPlSRVCXvpx6NsB5Am6M=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20241002103526-9083af857790 h1:yZlEBCdD0izqzTvmhET1roNSzMfXL50DhL+dALYlnXk=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20241002103526-9083af857790/go.mod h1:XaVXL9jg8BcyOeugECgIUGa9Y3DjYJj71RHmb5qon6M=
github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA=
Expand Down
16 changes: 8 additions & 8 deletions opsimulator/opsimulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@ func (opSim *OpSimulator) startBackgroundTasks() {
return fmt.Errorf("failed to create L2NativeSuperchainERC20 contract: %w", err)
}

mintEventChan := make(chan *bindings.L2NativeSuperchainERC20CrosschainMinted)
mintSub, err := superchainERC20.WatchCrosschainMinted(&bind.WatchOpts{Context: opSim.bgTasksCtx}, mintEventChan, nil)
mintEventChan := make(chan *bindings.L2NativeSuperchainERC20CrosschainMint)
mintSub, err := superchainERC20.WatchCrosschainMint(&bind.WatchOpts{Context: opSim.bgTasksCtx}, mintEventChan, nil)
if err != nil {
return fmt.Errorf("failed to subscribe to L2NativeSuperchainERC20#CrosschainMint: %w", err)
}

burnEventChan := make(chan *bindings.L2NativeSuperchainERC20CrosschainBurnt)
burnSub, err := superchainERC20.WatchCrosschainBurnt(&bind.WatchOpts{Context: opSim.bgTasksCtx}, burnEventChan, nil)
burnEventChan := make(chan *bindings.L2NativeSuperchainERC20CrosschainBurn)
burnSub, err := superchainERC20.WatchCrosschainBurn(&bind.WatchOpts{Context: opSim.bgTasksCtx}, burnEventChan, nil)
if err != nil {
return fmt.Errorf("failed to subscribe to L2NativeSuperchainERC20#CrosschainBurn: %w", err)
}
Expand Down Expand Up @@ -240,14 +240,14 @@ func (opSim *OpSimulator) startBackgroundTasks() {
return fmt.Errorf("failed to create SuperchainWETH contract: %w", err)
}

mintEventChan := make(chan *bindings.SuperchainWETHCrosschainMinted)
mintSub, err := superchainWETH.WatchCrosschainMinted(&bind.WatchOpts{Context: opSim.bgTasksCtx}, mintEventChan, nil)
mintEventChan := make(chan *bindings.SuperchainWETHCrosschainMint)
mintSub, err := superchainWETH.WatchCrosschainMint(&bind.WatchOpts{Context: opSim.bgTasksCtx}, mintEventChan, nil)
if err != nil {
return fmt.Errorf("failed to subscribe to SuperchainWETH#SendERC20: %w", err)
}

burnEventChan := make(chan *bindings.SuperchainWETHCrosschainBurnt)
burnSub, err := superchainWETH.WatchCrosschainBurnt(&bind.WatchOpts{Context: opSim.bgTasksCtx}, burnEventChan, nil)
burnEventChan := make(chan *bindings.SuperchainWETHCrosschainBurn)
burnSub, err := superchainWETH.WatchCrosschainBurn(&bind.WatchOpts{Context: opSim.bgTasksCtx}, burnEventChan, nil)
if err != nil {
return fmt.Errorf("failed to subscribe to SuperchainWETH#RelayERC20: %w", err)
}
Expand Down

0 comments on commit a907454

Please sign in to comment.