Skip to content

Commit

Permalink
feat(protocol): re-implement bridge receive check (#13134)
Browse files Browse the repository at this point in the history
Co-authored-by: dave | d1onys1us <13951458+d1onys1us@users.noreply.github.com>
  • Loading branch information
dantaik and d1onys1us committed Feb 10, 2023
1 parent 5d9b063 commit 3c10706
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/protocol/contracts/bridge/Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ 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
require(
msg.sender == resolve("token_vault", true) ||
msg.sender == resolve("ether_vault", true) ||
msg.sender == owner(),
"B:receive"
);
}

/// @dev Initializer to be called after being deployed behind a proxy.
Expand Down

0 comments on commit 3c10706

Please sign in to comment.