Commit de38be09 authored by AgusDuha's avatar AgusDuha Committed by GitHub

refactor: rename crosschain events (#12564)

* fix: rename crosschain events (#109)

* fix: rename crosschain events

* fix: semver

---------
Co-authored-by: default avatarDisco <131301107+0xDiscotech@users.noreply.github.com>
Co-authored-by: default avatar0xng <ng@defi.sucks>
Co-authored-by: default avatar0xParticle <particle@defi.sucks>
Co-authored-by: default avatargotzenx <78360669+gotzenx@users.noreply.github.com>

* fix: pre pr

* fix: pre pr

---------
Co-authored-by: default avatarDisco <131301107+0xDiscotech@users.noreply.github.com>
Co-authored-by: default avatar0xng <ng@defi.sucks>
Co-authored-by: default avatar0xParticle <particle@defi.sucks>
Co-authored-by: default avatargotzenx <78360669+gotzenx@users.noreply.github.com>
parent 358dd3f7
......@@ -108,8 +108,8 @@
"sourceCodeHash": "0x4bb08a8a9d5de37d1fb2dd8a9bcc483305510c32508f0be2d54757e6e257aedb"
},
"src/L2/OptimismSuperchainERC20.sol": {
"initCodeHash": "0x4e25579079d73c93f1d494e1976334b77fc4ec181c67f376d8e2613c7b207f52",
"sourceCodeHash": "0xe41cf3b005f1ea007fc1b5f69f630be5f6ef12d6e5e94a50e3160b0ebe0a1613"
"initCodeHash": "0x24d85d246858d1aff78ae86c614dd0dc0f63b3326b2b662e3462c3a6f9b7965e",
"sourceCodeHash": "0xcb705d26e63e733051c8bd442ea69ce637a00c16d646ccc37b687b20941366fe"
},
"src/L2/OptimismSuperchainERC20Beacon.sol": {
"initCodeHash": "0x23dba3ceb9e58646695c306996c9e15251ac79acc6339c1a93d10a4c79da6dab",
......@@ -125,15 +125,15 @@
},
"src/L2/SuperchainERC20.sol": {
"initCodeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
"sourceCodeHash": "0x45b9afdc9e52c27f192673388868a803f54d8f0bffe9defd81d584642e282b6b"
"sourceCodeHash": "0xba47f404e66e010ce417410476f26c704f2be4ce584cb79210bc5536a82ddb1f"
},
"src/L2/SuperchainTokenBridge.sol": {
"initCodeHash": "0xef7590c30630a75f105384e339e52758569c25a5aa0a5934c521e004b8f86220",
"sourceCodeHash": "0x4f539e9d9096d31e861982b8f751fa2d7de0849590523375cf92e175294d1036"
},
"src/L2/SuperchainWETH.sol": {
"initCodeHash": "0x09c7efed7d6c8ae5981f6e7a75c7b8c675f73d679265d15a010844ad9b41fa9b",
"sourceCodeHash": "0x8d7612a71deaadfb324c4136673df96019211292ff54494fa4b7724e2e5dd22a"
"initCodeHash": "0xc120d1fd9edd8aa392cf112859a3a3907c3b5d55132d6a5edd80ff1d6b6baeaa",
"sourceCodeHash": "0x445f088aa91fafde43f558f34da4b9f85b82e6a76f8b2dec9563838eb4335928"
},
"src/L2/WETH.sol": {
"initCodeHash": "0xfb253765520690623f177941c2cd9eba23e4c6d15063bccdd5e98081329d8956",
......
......@@ -456,7 +456,7 @@
"type": "uint256"
}
],
"name": "CrosschainBurnt",
"name": "CrosschainBurn",
"type": "event"
},
{
......@@ -475,7 +475,7 @@
"type": "uint256"
}
],
"name": "CrosschainMinted",
"name": "CrosschainMint",
"type": "event"
},
{
......
......@@ -289,7 +289,7 @@
"type": "uint256"
}
],
"name": "CrosschainBurnt",
"name": "CrosschainBurn",
"type": "event"
},
{
......@@ -308,7 +308,7 @@
"type": "uint256"
}
],
"name": "CrosschainMinted",
"name": "CrosschainMint",
"type": "event"
},
{
......
......@@ -59,8 +59,8 @@ contract OptimismSuperchainERC20 is SuperchainERC20, Initializable, ERC165 {
}
/// @notice Semantic version.
/// @custom:semver 1.0.0-beta.7
string public constant override version = "1.0.0-beta.7";
/// @custom:semver 1.0.0-beta.8
string public constant override version = "1.0.0-beta.8";
/// @notice Constructs the OptimismSuperchainERC20 contract.
constructor() {
......
......@@ -13,9 +13,9 @@ import { Unauthorized } from "src/libraries/errors/CommonErrors.sol";
/// burn and mint tokens.
abstract contract SuperchainERC20 is ERC20, ICrosschainERC20, ISemver {
/// @notice Semantic version.
/// @custom:semver 1.0.0-beta.3
/// @custom:semver 1.0.0-beta.4
function version() external view virtual returns (string memory) {
return "1.0.0-beta.3";
return "1.0.0-beta.4";
}
/// @notice Allows the SuperchainTokenBridge to mint tokens.
......@@ -26,7 +26,7 @@ abstract contract SuperchainERC20 is ERC20, ICrosschainERC20, ISemver {
_mint(_to, _amount);
emit CrosschainMinted(_to, _amount);
emit CrosschainMint(_to, _amount);
}
/// @notice Allows the SuperchainTokenBridge to burn tokens.
......@@ -37,6 +37,6 @@ abstract contract SuperchainERC20 is ERC20, ICrosschainERC20, ISemver {
_burn(_from, _amount);
emit CrosschainBurnt(_from, _amount);
emit CrosschainBurn(_from, _amount);
}
}
......@@ -22,8 +22,8 @@ import { Unauthorized, NotCustomGasToken } from "src/libraries/errors/CommonErro
/// do not use a custom gas token.
contract SuperchainWETH is WETH98, ICrosschainERC20, ISemver {
/// @notice Semantic version.
/// @custom:semver 1.0.0-beta.7
string public constant version = "1.0.0-beta.7";
/// @custom:semver 1.0.0-beta.8
string public constant version = "1.0.0-beta.8";
/// @inheritdoc WETH98
function deposit() public payable override {
......@@ -66,7 +66,7 @@ contract SuperchainWETH is WETH98, ICrosschainERC20, ISemver {
IETHLiquidity(Predeploys.ETH_LIQUIDITY).mint(_amount);
}
emit CrosschainMinted(_to, _amount);
emit CrosschainMint(_to, _amount);
}
/// @notice Allows the SuperchainTokenBridge to burn tokens.
......@@ -82,6 +82,6 @@ contract SuperchainWETH is WETH98, ICrosschainERC20, ISemver {
IETHLiquidity(Predeploys.ETH_LIQUIDITY).burn{ value: _amount }();
}
emit CrosschainBurnt(_from, _amount);
emit CrosschainBurn(_from, _amount);
}
}
......@@ -7,12 +7,12 @@ interface ICrosschainERC20 {
/// @notice Emitted when a crosschain transfer mints tokens.
/// @param to Address of the account tokens are being minted for.
/// @param amount Amount of tokens minted.
event CrosschainMinted(address indexed to, uint256 amount);
event CrosschainMint(address indexed to, uint256 amount);
/// @notice Emitted when a crosschain transfer burns tokens.
/// @param from Address of the account tokens are being burned from.
/// @param amount Amount of tokens burned.
event CrosschainBurnt(address indexed from, uint256 amount);
event CrosschainBurn(address indexed from, uint256 amount);
/// @notice Mint tokens through a crosschain transfer.
/// @param _to Address to mint tokens to.
......
......@@ -60,9 +60,9 @@ contract SuperchainERC20Test is Test {
vm.expectEmit(address(superchainERC20));
emit IERC20.Transfer(ZERO_ADDRESS, _to, _amount);
// Look for the emit of the `CrosschainMinted` event
// Look for the emit of the `CrosschainMint` event
vm.expectEmit(address(superchainERC20));
emit ICrosschainERC20.CrosschainMinted(_to, _amount);
emit ICrosschainERC20.CrosschainMint(_to, _amount);
// Call the `mint` function with the bridge caller
vm.prank(SUPERCHAIN_TOKEN_BRIDGE);
......@@ -86,7 +86,7 @@ contract SuperchainERC20Test 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);
......@@ -103,9 +103,9 @@ contract SuperchainERC20Test is Test {
vm.expectEmit(address(superchainERC20));
emit IERC20.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));
emit ICrosschainERC20.CrosschainBurnt(_from, _amount);
emit ICrosschainERC20.CrosschainBurn(_from, _amount);
// Call the `burn` function with the bridge caller
vm.prank(SUPERCHAIN_TOKEN_BRIDGE);
......
......@@ -25,10 +25,10 @@ contract SuperchainWETH_Test is CommonTest {
event Withdrawal(address indexed src, uint256 wad);
/// @notice Emitted when a crosschain transfer mints tokens.
event CrosschainMinted(address indexed to, uint256 amount);
event CrosschainMint(address indexed to, uint256 amount);
/// @notice Emitted when a crosschain transfer burns tokens.
event CrosschainBurnt(address indexed from, uint256 amount);
event CrosschainBurn(address indexed from, uint256 amount);
address internal constant ZERO_ADDRESS = address(0);
......@@ -143,7 +143,7 @@ contract SuperchainWETH_Test is CommonTest {
superchainWeth.crosschainMint(_to, _amount);
}
/// @notice Tests the `crosschainMint` with non custom gas token succeeds and emits the `CrosschainMinted` event.
/// @notice Tests the `crosschainMint` with non custom gas token succeeds and emits the `CrosschainMint` event.
function testFuzz_crosschainMint_fromBridgeNonCustomGasTokenChain_succeeds(address _to, uint256 _amount) public {
// Ensure `_to` is not the zero address
vm.assume(_to != ZERO_ADDRESS);
......@@ -157,9 +157,9 @@ contract SuperchainWETH_Test is CommonTest {
vm.expectEmit(address(superchainWeth));
emit Transfer(ZERO_ADDRESS, _to, _amount);
// Look for the emit of the `CrosschainMinted` event
// Look for the emit of the `CrosschainMint` event
vm.expectEmit(address(superchainWeth));
emit CrosschainMinted(_to, _amount);
emit CrosschainMint(_to, _amount);
// Mock the `isCustomGasToken` function to return false
_mockAndExpect(address(l1Block), abi.encodeCall(l1Block.isCustomGasToken, ()), abi.encode(false));
......@@ -177,7 +177,7 @@ contract SuperchainWETH_Test is CommonTest {
assertEq(address(superchainWeth).balance, _amount);
}
/// @notice Tests the `crosschainMint` with custom gas token succeeds and emits the `CrosschainMinted` event.
/// @notice Tests the `crosschainMint` with custom gas token succeeds and emits the `CrosschainMint` event.
function testFuzz_crosschainMint_fromBridgeCustomGasTokenChain_succeeds(address _to, uint256 _amount) public {
// Ensure `_to` is not the zero address
vm.assume(_to != ZERO_ADDRESS);
......@@ -190,9 +190,9 @@ contract SuperchainWETH_Test is CommonTest {
vm.expectEmit(address(superchainWeth));
emit Transfer(ZERO_ADDRESS, _to, _amount);
// Look for the emit of the `CrosschainMinted` event
// Look for the emit of the `CrosschainMint` event
vm.expectEmit(address(superchainWeth));
emit CrosschainMinted(_to, _amount);
emit CrosschainMint(_to, _amount);
// Mock the `isCustomGasToken` function to return false
_mockAndExpect(address(l1Block), abi.encodeCall(l1Block.isCustomGasToken, ()), abi.encode(true));
......@@ -223,7 +223,7 @@ contract SuperchainWETH_Test is CommonTest {
superchainWeth.crosschainBurn(_from, _amount);
}
/// @notice Tests the `crosschainBurn` with non custom gas token burns the amount and emits the `CrosschainBurnt`
/// @notice Tests the `crosschainBurn` with non custom gas token burns the amount and emits the `CrosschainBurn`
/// event.
function testFuzz_crosschainBurn_fromBridgeNonCustomGasTokenChain_succeeds(address _from, uint256 _amount) public {
// Ensure `_from` is not the zero address
......@@ -243,9 +243,9 @@ contract SuperchainWETH_Test is CommonTest {
vm.expectEmit(address(superchainWeth));
emit Transfer(_from, ZERO_ADDRESS, _amount);
// Look for the emit of the `CrosschainBurnt` event
// Look for the emit of the `CrosschainBurn` event
vm.expectEmit(address(superchainWeth));
emit CrosschainBurnt(_from, _amount);
emit CrosschainBurn(_from, _amount);
// Mock the `isCustomGasToken` function to return false
_mockAndExpect(address(l1Block), abi.encodeCall(l1Block.isCustomGasToken, ()), abi.encode(false));
......@@ -263,7 +263,7 @@ contract SuperchainWETH_Test is CommonTest {
assertEq(address(superchainWeth).balance, 0);
}
/// @notice Tests the `crosschainBurn` with custom gas token burns the amount and emits the `CrosschainBurnt`
/// @notice Tests the `crosschainBurn` with custom gas token burns the amount and emits the `CrosschainBurn`
/// event.
function testFuzz_crosschainBurn_fromBridgeCustomGasTokenChain_succeeds(address _from, uint256 _amount) public {
// Ensure `_from` is not the zero address
......@@ -285,9 +285,9 @@ contract SuperchainWETH_Test is CommonTest {
vm.expectEmit(address(superchainWeth));
emit Transfer(_from, ZERO_ADDRESS, _amount);
// Look for the emit of the `CrosschainBurnt` event
// Look for the emit of the `CrosschainBurn` event
vm.expectEmit(address(superchainWeth));
emit CrosschainBurnt(_from, _amount);
emit CrosschainBurn(_from, _amount);
// Expect to not call the `burn` function in the `ETHLiquidity` contract
vm.expectCall(Predeploys.ETH_LIQUIDITY, abi.encodeCall(IETHLiquidity.burn, ()), 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment