Sablier

Sablier
DeFiFoundry
53,440 USDC
View results
Submission Details
Severity: low
Invalid

Use SafeMint instead of mint

Summary

When minting NFT for a particular stream, the contract uses the mint function to mint NFT to the receiver address.

Vulnerability Details

We are submitting this issue since bot report did not mentioned all the place where the mint is used.

The bot report mention only the SablierV2LockupTranched.sol contract.

But the mint function is used in other places such as SablierV2LockupDynamic.sol and SablierV2LockupLinear.sol

When a stream is created, NFT is minted to the receiver address who will use it to receive the funds from the stream sender.

Sablier has the following type of streams, SablierV2LockupDynamic.sol and SablierV2LockupLinear.sol and SablierV2LockupTranched.sol

For example,

SablierV2LockupDynamic.sol#L353-L358

// Effect: mint the NFT to the recipient.
_mint({ to: params.recipient, tokenId: streamId });
// Interaction: transfer the deposit amount.
params.asset.safeTransferFrom({ from: msg.sender, to: address(this), value: createAmounts.deposit });

Impact

Using ERC721::_mint() can mint ERC721 tokens to addresses which don't support ERC721 tokens, while ERC721::_safeMint() ensures that ERC721 tokens are only minted to addresses which support them. OpenZeppelin discourages the use of _mint().

Tools Used

Manual review

Recommendations

Use _safeMint() instead of _mint() for ERC721. Also, add re-entrance protection guard.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue
Assigned finding tags:

Known - LightChaser

https://github.com/Cyfrin/2024-05-Sablier/issues/1

ak1 Submitter
about 1 year ago
inallhonesty Lead Judge
about 1 year ago
inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue
Assigned finding tags:

Known - LightChaser

https://github.com/Cyfrin/2024-05-Sablier/issues/1

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.