Skip to content

Commit

Permalink
Add an early getSubnet() exists check in fundWithToken() (#877)
Browse files Browse the repository at this point in the history
  • Loading branch information
snissn authored Apr 10, 2024
1 parent fdcca99 commit 31bf153
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions contracts/src/gateway/GatewayManagerFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ contract GatewayManagerFacet is GatewayActorModifiers, ReentrancyGuard {
// prevent spamming if there's no value to fund.
revert InvalidXnetMessage(InvalidXnetMessageReason.Value);
}
// slither-disable-next-line unused-return
(bool registered, ) = LibGateway.getSubnet(subnetId);
if (!registered) {
revert NotRegisteredSubnet();
}

// Check that the supply strategy is ERC20.
// There is no need to check whether the subnet exists. If it doesn't exist, the call to getter will revert.
Expand Down

0 comments on commit 31bf153

Please sign in to comment.