This condition will not hold true if a malicious party sends in 1 wei of the vault token to the MarketplaceZap contract, resulting in a denial of service since the function will always revert.
Note that unlike the StakingZap contract, there isn’t rescue() function to remove any funds sent by the malicious party. Nevertheless, even with its existence, it could be cumbersome and costly to perform rescues (if we assume the owner is a multisig + ETH mainnet costs for the transaction).
The malicious party can also cause griefing by frontrunning a liquidity provision transaction.
Recommended Mitigation Steps
The balance comparison should be similar to the provideInventory721() and provideInventory1155() functions of the StakingZap contract.
The sample fix for _mint721() is provided below. The fix for _mint1155() is similar.
Handle
GreyArt
Vulnerability details
Impact
The
_mint721()
and_mint1155()
functions check that the correct number of vault tokens have been minted, after accounting for mint fees.This condition will not hold true if a malicious party sends in 1 wei of the vault token to the MarketplaceZap contract, resulting in a denial of service since the function will always revert.
Note that unlike the StakingZap contract, there isn’t
rescue()
function to remove any funds sent by the malicious party. Nevertheless, even with its existence, it could be cumbersome and costly to perform rescues (if we assume the owner is a multisig + ETH mainnet costs for the transaction).The malicious party can also cause griefing by frontrunning a liquidity provision transaction.
Recommended Mitigation Steps
The balance comparison should be similar to the
provideInventory721()
andprovideInventory1155()
functions of the StakingZap contract.The sample fix for
_mint721()
is provided below. The fix for_mint1155()
is similar.