From 2d8b498fe74cd6e1099ab5cacaea35a81319be0c Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Fri, 10 Feb 2023 11:39:27 +0800 Subject: [PATCH 1/2] Revert "feat(protocol): restrict receive()'s msg.sender to vaults (#13110)" This reverts commit 2d8fa12a72f6850f75adb468d945af080671f3f8. --- packages/protocol/contracts/bridge/Bridge.sol | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/protocol/contracts/bridge/Bridge.sol b/packages/protocol/contracts/bridge/Bridge.sol index dbc5b9ce85b..bd1f8dd014e 100644 --- a/packages/protocol/contracts/bridge/Bridge.sol +++ b/packages/protocol/contracts/bridge/Bridge.sol @@ -48,11 +48,7 @@ contract Bridge is EssentialContract, IBridge { /// Allow Bridge to receive ETH from the TokenVault or EtherVault. receive() external payable { - // Ensure the sender is either the Ether vault or the token vault. - require( - msg.sender == this.resolve("token_vault", false) || - msg.sender == this.resolve("ether_vault", true) - ); + // TODO(dave,PR#13110): require the sender is the TokenVault or EtherVault } /// @dev Initializer to be called after being deployed behind a proxy. From cbc0da6fa2fd2cd838070fe07869a88039740032 Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Fri, 10 Feb 2023 11:43:33 +0800 Subject: [PATCH 2/2] feat(protocol): add transactor to Bridge's MessageStatusChanged event (#13126) --- packages/protocol/contracts/bridge/Bridge.sol | 3 ++- .../contracts/bridge/libs/LibBridgeStatus.sol | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/protocol/contracts/bridge/Bridge.sol b/packages/protocol/contracts/bridge/Bridge.sol index bd1f8dd014e..86b2d7a5849 100644 --- a/packages/protocol/contracts/bridge/Bridge.sol +++ b/packages/protocol/contracts/bridge/Bridge.sol @@ -37,7 +37,8 @@ contract Bridge is EssentialContract, IBridge { event MessageStatusChanged( bytes32 indexed msgHash, - LibBridgeStatus.MessageStatus status + LibBridgeStatus.MessageStatus status, + address transactor ); event DestChainEnabled(uint256 indexed chainId, bool enabled); diff --git a/packages/protocol/contracts/bridge/libs/LibBridgeStatus.sol b/packages/protocol/contracts/bridge/libs/LibBridgeStatus.sol index 19e5404633e..f93e435c5a2 100644 --- a/packages/protocol/contracts/bridge/libs/LibBridgeStatus.sol +++ b/packages/protocol/contracts/bridge/libs/LibBridgeStatus.sol @@ -24,7 +24,11 @@ library LibBridgeStatus { FAILED } - event MessageStatusChanged(bytes32 indexed msgHash, MessageStatus status); + event MessageStatusChanged( + bytes32 indexed msgHash, + MessageStatus status, + address transactor + ); /** * @dev If messageStatus is same as in the messageStatus mapping, @@ -38,7 +42,11 @@ library LibBridgeStatus { ) internal { if (getMessageStatus(msgHash) != status) { _setMessageStatus(msgHash, status); - emit LibBridgeStatus.MessageStatusChanged(msgHash, status); + emit LibBridgeStatus.MessageStatusChanged( + msgHash, + status, + msg.sender + ); } }