The _ensureTokenRegisteredWithNTV
function in the L2AssetRouter.sol
contract does not assign a value to the assetId
return variable. This will cause functions that rely on the assetId
return value to fail, such as _withdrawSender
during IAssetHandler.bridgeBurn
, IAssetRouterBase.finalizeDeposit
, or revert with AssetIdNotSupported
.
The _ensureTokenRegisteredWithNTV
function is defined to return a bytes32 assetId
. However, within the function body, assetId
is never assigned a value. As a result, the function will return the default value of bytes32(0)
, and functions relying on it will revert
Run with yarn l1 test:foundry --match-test test_withdrawTokenFromGateway -vvvvv
. The test will revert due to the issue above, when it should not.
L2AssetRouter.withdrawToken
will revert due to an incorrect bytes32(0)
assetId value.
Manual code review
Ensure that the assetId return value is properly assigned within the _ensureTokenRegisteredWithNTV
function.
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.