There are no checks in depositTokens
for whether msg.value
is sufficient for bridging causing transfers to fail and needing admin intervention.
The msg.value
in depositTokens
is used to pay for gas on L2. If this value is set too low, bridging will not be successful.
Looking at the starknet documentation for messaging (https://docs.starknet.io/architecture-and-concepts/network-architecture/messaging-mechanism/) at L1 → L2 message fees
it states:
This means the fee sent needs to be sufficient for the sequencer to include it in a block on L2.
Since now the msg.value
can be set arbitrarily and users may not know how much fees they need to send, if they do not send enough accidentally, their NFT will be stuck in the L1 bridge. This is because the NFT will be sent to the bridge on L1 but never minted in the bridge on L2.
Now it is possible to retrieve the NFT again by going through the cancelMessage
steps on L1 but that takes a few days (five days) as there is a cooldown for cancellation. This means the user's NFT will be locked for at least 5 days causing major inconvenience.
Manual review
In order to prevent this, I would recommend adding a fee-calculation mechanism on the L1 side, checking if the provided msg.value
is sufficient to bridge the requested NFTs.
Impact: Medium/High. Need an admin to start a cancellation and wait for 5 days once done. DoS > 5 days. Likelyhood: Low. Everytime a wallet/or a user do not send enough gas
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.