Skip to content

Commit

Permalink
feat(protocol): restrict receive()'s msg.sender to vaults (#13110)
Browse files Browse the repository at this point in the history
  • Loading branch information
d1onys1us committed Feb 9, 2023
1 parent eeb3a0e commit 2d8fa12
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/protocol/contracts/bridge/Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,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

0 comments on commit 2d8fa12

Please sign in to comment.