In real deployment GatewayRouter.outboundTransfer()
has 3 important variables to determine {value : msg.value}
as gas for execution on the Arbitrum chain. The 3 variables are gasLimit_
, maxFeePerGas_
, and maxSubmissionCost_
. However, the {value : msg.value}
calculation is not applied to GatewayRouterMock.outboundTransfer()
so whatever the values of gasLimit_
, maxFeePerGas_
, and maxSubmissionCost_
, the test results will be successful ( even {value : 0}
) because the function only transfers tokens with transferFrom
.
This is the GatewayRouterMock.outboundTransfer()
codebase :
Based on this codebase, whatever input for gasLimit
, maxFeePerGas
, maxSubmissionCost
and call value {value : msg.value}
the test results will be successful.
Even though based on docs and tests from Arbitrum, call value must pass maxSubmissionCost
+ maxGas
* gasPriceBid
. Funds can be lost if the L1 call value provided is insufficient to cover maxSubmissionCost
, or stuck if insufficient to cover maxSubmissionCost
+ maxGas
* gasPriceBid
.
Test code variables :
gasLimit
= 10000000000
maxFeePerGas
=15000000000
maxSubmissionCost
= 1000000000
{value : msg.value}
= 0
Result :
This coded POC
was written using the default environment of the protocol so just input in the Distribution.test.ts
file and paste it in the bridgeOverplus
section then the POC
can be executed immediately.
Wrong result in all tests (related to this function) and lead to vulnerability on deployment (mainnet)
Manual Review
Consider implementing the real deployment implementation based on Arbitrum docs and test :
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.