Skip to content

Commit

Permalink
Revert "feat(protocol): revert Bridge receive() checks (#13128)"
Browse files Browse the repository at this point in the history
This reverts commit 675611d.
  • Loading branch information
dantaik committed Feb 10, 2023
1 parent 675611d commit f33e357
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
9 changes: 6 additions & 3 deletions packages/protocol/contracts/bridge/Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ contract Bridge is EssentialContract, IBridge {

event MessageStatusChanged(
bytes32 indexed msgHash,
LibBridgeStatus.MessageStatus status,
address transactor
LibBridgeStatus.MessageStatus status
);

event DestChainEnabled(uint256 indexed chainId, bool enabled);
Expand All @@ -49,7 +48,11 @@ contract Bridge is EssentialContract, IBridge {

/// Allow Bridge to receive ETH from the TokenVault or EtherVault.
receive() external payable {
// TODO(dave,PR#13110): require the sender is the TokenVault or EtherVault
// 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)
);
}

/// @dev Initializer to be called after being deployed behind a proxy.
Expand Down
12 changes: 2 additions & 10 deletions packages/protocol/contracts/bridge/libs/LibBridgeStatus.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ library LibBridgeStatus {
FAILED
}

event MessageStatusChanged(
bytes32 indexed msgHash,
MessageStatus status,
address transactor
);
event MessageStatusChanged(bytes32 indexed msgHash, MessageStatus status);

/**
* @dev If messageStatus is same as in the messageStatus mapping,
Expand All @@ -42,11 +38,7 @@ library LibBridgeStatus {
) internal {
if (getMessageStatus(msgHash) != status) {
_setMessageStatus(msgHash, status);
emit LibBridgeStatus.MessageStatusChanged(
msgHash,
status,
msg.sender
);
emit LibBridgeStatus.MessageStatusChanged(msgHash, status);
}
}

Expand Down

0 comments on commit f33e357

Please sign in to comment.