Skip to content

Commit

Permalink
fix: small version fix and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
agusduha committed Aug 29, 2024
1 parent 7649a19 commit 9fcb52b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
4 changes: 2 additions & 2 deletions packages/contracts-bedrock/semver-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@
"sourceCodeHash": "0x972564d2e2fab111cd431f3c78d00c7b0f0ae422fa5e9a8bf5b202cdaef89bf9"
},
"src/L2/OptimismSuperchainERC20.sol": {
"initCodeHash": "0x24ac38990bc313df5e5fb1a6bbc777c6b77f9e2aefb75a5a0ca603f5d2cf4faa",
"sourceCodeHash": "0x12efb55402b5cdfe1ea032d65e33c101aaf73c9958ec7d3bd8ddefd9609a3877"
"initCodeHash": "0x782aaff652a602a7cefda3102b37f724a45d009933a70a6ee235d14909d74ab1",
"sourceCodeHash": "0x9282c807007dc670cd10a32cb46c6d913b7635748693eddfaba496ebbcf5b7a5"
},
"src/L2/SequencerFeeVault.sol": {
"initCodeHash": "0xb94145f571e92ee615c6fe903b6568e8aac5fe760b6b65148ffc45d2fb0f5433",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
"type": "string"
}
],
"stateMutability": "pure",
"stateMutability": "view",
"type": "function"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ contract OptimismSuperchainERC20 is

/// @notice Semantic version.
/// @custom:semver 1.0.0-beta.1
function version() public pure override returns (string memory) {
return "1.0.0-beta.1";
}
string public constant version = "1.0.0-beta.1";

/// @notice Constructs the OptimismSuperchainERC20 contract.
constructor() SuperchainERC20("", "", 18) {
Expand Down
16 changes: 8 additions & 8 deletions packages/contracts-bedrock/test/L2/OptimismSuperchainERC20.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ contract OptimismSuperchainERC20Test is Test {
uint256 _toBalanceBefore = superchainERC20.balanceOf(_to);

// Look for the emit of the `Transfer` event
vm.expectEmit(true, true, true, true, address(superchainERC20));
vm.expectEmit(address(superchainERC20));
emit IERC20.Transfer(ZERO_ADDRESS, _to, _amount);

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

// Call the `mint` function with the bridge caller
Expand Down Expand Up @@ -179,11 +179,11 @@ contract OptimismSuperchainERC20Test is Test {
uint256 _fromBalanceBefore = superchainERC20.balanceOf(_from);

// Look for the emit of the `Transfer` event
vm.expectEmit(true, true, true, true, address(superchainERC20));
vm.expectEmit(address(superchainERC20));
emit IERC20.Transfer(_from, ZERO_ADDRESS, _amount);

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

// Call the `burn` function with the bridge caller
Expand Down Expand Up @@ -221,11 +221,11 @@ contract OptimismSuperchainERC20Test is Test {
uint256 _senderBalanceBefore = superchainERC20.balanceOf(_sender);

// Look for the emit of the `Transfer` event
vm.expectEmit(true, true, true, true, address(superchainERC20));
vm.expectEmit(address(superchainERC20));
emit IERC20.Transfer(_sender, ZERO_ADDRESS, _amount);

// Look for the emit of the `SendERC20` event
vm.expectEmit(true, true, true, true, address(superchainERC20));
vm.expectEmit(address(superchainERC20));
emit ISuperchainERC20Extensions.SendERC20(_sender, _to, _amount, _chainId);

// Mock the call over the `sendMessage` function and expect it to be called properly
Expand Down Expand Up @@ -329,11 +329,11 @@ contract OptimismSuperchainERC20Test is Test {
uint256 _toBalanceBefore = superchainERC20.balanceOf(_to);

// Look for the emit of the `Transfer` event
vm.expectEmit(true, true, true, true, address(superchainERC20));
vm.expectEmit(address(superchainERC20));
emit IERC20.Transfer(ZERO_ADDRESS, _to, _amount);

// Look for the emit of the `RelayERC20` event
vm.expectEmit(true, true, true, true, address(superchainERC20));
vm.expectEmit(address(superchainERC20));
emit ISuperchainERC20Extensions.RelayERC20(_from, _to, _amount, _source);

// Call the `relayERC20` function with the messenger caller
Expand Down
8 changes: 4 additions & 4 deletions packages/contracts-bedrock/test/L2/SuperchainERC20.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ contract SuperchainERC20Test is Test {
uint256 _senderBalanceBefore = superchainERC20.balanceOf(_sender);

// Look for the emit of the `Transfer` event
vm.expectEmit(true, true, true, true, address(superchainERC20));
vm.expectEmit(address(superchainERC20));
emit IERC20.Transfer(_sender, ZERO_ADDRESS, _amount);

// Look for the emit of the `SendERC20` event
vm.expectEmit(true, true, true, true, address(superchainERC20));
vm.expectEmit(address(superchainERC20));
emit ISuperchainERC20Extensions.SendERC20(_sender, _to, _amount, _chainId);

// Mock the call over the `sendMessage` function and expect it to be called properly
Expand Down Expand Up @@ -195,11 +195,11 @@ contract SuperchainERC20Test is Test {
uint256 _toBalanceBefore = superchainERC20.balanceOf(_to);

// Look for the emit of the `Transfer` event
vm.expectEmit(true, true, true, true, address(superchainERC20));
vm.expectEmit(address(superchainERC20));
emit IERC20.Transfer(ZERO_ADDRESS, _to, _amount);

// Look for the emit of the `RelayERC20` event
vm.expectEmit(true, true, true, true, address(superchainERC20));
vm.expectEmit(address(superchainERC20));
emit ISuperchainERC20Extensions.RelayERC20(_from, _to, _amount, _source);

// Call the `relayERC20` function with the messenger caller
Expand Down

0 comments on commit 9fcb52b

Please sign in to comment.