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

feat(protocol): restrict receive()'s msg.sender to vaults #13110

Merged
merged 20 commits into from
Feb 9, 2023
Merged
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.
dionysuzx marked this conversation as resolved.
Show resolved Hide resolved
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