Closed sherlock-admin4 closed 3 months ago
Escalate This is valid medium, due to the DoS of
ArrakisMetaVaultPublic::mint()
function , in the first call of the function
You've deleted an escalation for this issue.
The watson references the _mint() method from OZ's ERC20 contract, but the protocol inherits Solady's ERC20 contract. It does not seem like the restriction mentioned in the report is enforced, unless it is implemented in the _before and _after hooks.
The watson references the _mint() method from OZ's ERC20 contract, but the protocol inherits Solady's ERC20 contract. It does not seem like the restriction mentioned in the report is enforced, unless it is implemented in the _before and _after hooks.
You are right that it use Solady ERC20, but in _beforeTokenTransfer
function it says when to is zero, amount of from's tokens will be burned.
, from and to are never both zero.
In this case both are zero
it clearly does not revert, just run forge test --mt test_mint
to run the test found in arrakis-modular/test/integration/ValantisIntegrationPublic.t.sol
NoOne
medium
Minting to Zero Address Causes Revert During Initial Supply Setup
Summary
The
mint
function in the contract is designed to mint shares of a vault position and deposit corresponding token amounts to a specified receiver. However, the function attempts to mintMINIMUM_LIQUIDITY
tokens to the zero address(address(0))
when the totalsupply
is zero. This results in a revert due to the_mint
function's check against minting to the zero address, causing the transaction to fail and preventing proper initialization.Vulnerability Detail
This design causes the
mint
function to fail when attempting to mint to the zero address, preventing proper initialization of the contract.Impact
The impact of this vulnerability is significant as it prevents the contract from correctly initializing the minimum liquidity, which is essential for the proper functioning of the vault. This issue can halt the minting process, leading to a denial of service for users trying to interact with the contract.
Code Snippet
function mint
Tool used
Manual Review
Recommendation
To resolve this issue, the
mint
function should be modified to mint the initialMINIMUM_LIQUIDITY
to the contract address itself(address(this))
instead of the zero address. This approach ensures that the tokens are accounted for and effectively locked within the contract, avoiding the revert and allowing proper initialization.