Skip to content

Commit

Permalink
Fix [L-2] Missing sanity checks for PrimarySale and PlatformFee recip…
Browse files Browse the repository at this point in the history
…ients
  • Loading branch information
nkrishang committed Sep 26, 2023
1 parent c38d61c commit 97949b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contracts/extension/upgradeable/PlatformFee.sol
Expand Up @@ -64,6 +64,9 @@ abstract contract PlatformFee is IPlatformFee {
if (_platformFeeBps > 10_000) {
revert("Exceeds max bps");
}
if (_platformFeeRecipient == address(0)) {
revert("Invalid recipient");
}

_platformFeeStorage().platformFeeBps = uint16(_platformFeeBps);
_platformFeeStorage().platformFeeRecipient = _platformFeeRecipient;
Expand Down
3 changes: 3 additions & 0 deletions contracts/extension/upgradeable/PrimarySale.sol
Expand Up @@ -52,6 +52,9 @@ abstract contract PrimarySale is IPrimarySale {

/// @dev Lets a contract admin set the recipient for all primary sales.
function _setupPrimarySaleRecipient(address _saleRecipient) internal {
if (_saleRecipient == address(0)) {
revert("Invalid recipient");
}
_primarySaleStorage().recipient = _saleRecipient;
emit PrimarySaleRecipientUpdated(_saleRecipient);
}
Expand Down

0 comments on commit 97949b8

Please sign in to comment.