Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: event parameters #124

Merged
merged 2 commits into from
Jul 26, 2024
Merged
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
2 changes: 1 addition & 1 deletion src/contracts/L1OpUSDCBridgeAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ contract L1OpUSDCBridgeAdapter is IL1OpUSDCBridgeAdapter, OpUSDCBridgeAdapter {
emit MessageReceived(_user, _amount, MESSENGER);
} catch {
userBlacklistedFunds[_user] += _amount;
emit MessageFailed(_user, _amount);
emit MessageFailed(_user, _amount, MESSENGER);
}
}

Expand Down
5 changes: 1 addition & 4 deletions src/contracts/L2OpUSDCBridgeAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ contract L2OpUSDCBridgeAdapter is IL2OpUSDCBridgeAdapter, OpUSDCBridgeAdapter {
messengerStatus = Status.Deprecated;
roleCaller = _roleCaller;

// We need to do totalSupply + blacklistedFunds
// Because on `receiveMessage` mint would fail causing the totalSupply to not increase
// But the native token is still locked on L1
uint256 _burnAmount = IUSDC(USDC).totalSupply();

// Remove the L2 Adapter as a minter
Expand Down Expand Up @@ -219,7 +216,7 @@ contract L2OpUSDCBridgeAdapter is IL2OpUSDCBridgeAdapter, OpUSDCBridgeAdapter {
emit MessageReceived(_user, _amount, MESSENGER);
} catch {
userBlacklistedFunds[_user] += _amount;
emit MessageFailed(_user, _amount);
emit MessageFailed(_user, _amount, MESSENGER);
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/interfaces/IOpUSDCBridgeAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* @param Upgrading The messenger is upgrading
* @param Deprecated The messenger is deprecated
*/
enum Status {

Check warning on line 31 in src/interfaces/IOpUSDCBridgeAdapter.sol

View workflow job for this annotation

GitHub Actions / Lint Commit Messages

Function order is incorrect, enum definition can not go after struct definition (line 13)
Active,
Paused,
Upgrading,
Expand Down Expand Up @@ -81,8 +81,9 @@
* @notice Emitted when a message fails
* @param _user The user that the message failed for
* @param _amount The amount of tokens that were added to the blacklisted funds
* @param _messenger The address of the messenger that the message failed for
*/
event MessageFailed(address _user, uint256 _amount);
event MessageFailed(address _user, uint256 _amount, address _messenger);

/**
* @notice Emitted when the blacklisted funds are withdrawn
Expand Down
4 changes: 2 additions & 2 deletions test/unit/L1OpUSDCBridgeAdapter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ contract L1OpUSDCBridgeAdapter_Unit_SendMessageWithSignature is Base {
}

contract L1OpUSDCBridgeAdapter_Unit_ReceiveMessage is Base {
event MessageFailed(address _user, uint256 _amount);
event MessageFailed(address _user, uint256 _amount, address _messenger);

/**
* @notice Check that the function reverts if the sender is not the messenger
Expand Down Expand Up @@ -1116,7 +1116,7 @@ contract L1OpUSDCBridgeAdapter_Unit_ReceiveMessage is Base {
// Execute
vm.expectEmit(true, true, true, true);
vm.prank(_messenger);
emit MessageFailed(_user, _amount);
emit MessageFailed(_user, _amount, _messenger);
adapter.receiveMessage(_user, _user, _amount);
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/unit/L2OpUSDCBridgeAdapter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ contract L2OpUSDCBridgeAdapter_Unit_SendMessageWithSignature is Base {
}

contract L2OpUSDCBridgeAdapter_Unit_ReceiveMessage is Base {
event MessageFailed(address _user, uint256 _amount);
event MessageFailed(address _user, uint256 _amount, address _messenger);

/**
* @notice Check that the function reverts if the sender is not the messenger
Expand Down Expand Up @@ -785,7 +785,7 @@ contract L2OpUSDCBridgeAdapter_Unit_ReceiveMessage is Base {

// Execute
vm.expectEmit(true, true, true, true);
emit MessageFailed(_user, _amount);
emit MessageFailed(_user, _amount, _messenger);

vm.prank(_messenger);
adapter.receiveMessage(_user, _user, _amount);
Expand Down