Users are not obligated to withdraw their funds from the same bridge where they made their deposit. This can result in some users encountering higher withdrawal fees, which may seem unfair.
The BridgeRouterFacet
is responsible for routing users' funds between different bridges, currently including BridgeReth
and BridgeSteth
. Users have the option to deposit LSTs, which can be in the form of rETH
or stETH
, or they can choose to depositETH, which will then be converted into LST. In return, users will receive zETH
. Subsequently, users can withdraw their funds, a process that will remove their zETH
from the corresponding vault and return the LST to them. Alternatively, they can choose to unstakeEth, which will unstake the zETH
and send them the native ETH.
Both withdraw and unstakeETH may have different fees, depending on the bridge fees, and these fees will be charged to the user for these two operations.
As can be seen in the OwnerFacet.createBridge, bridges can be created with or without fees for withdraw
/unstakeEth
, with the only restrictions being an upper bound of 15% for withdraw and 2.5% for unstake. This means that one bridge can have fees while the other may not, or one bridge may have lower fees than the other.
Every user can deposit through the bridge of their choice, but they are not obliged to withdraw
/unstakeEth
from the same bridge.
Taking this into account, it may not be reasonable to withdraw
/unstakeEth
from the same bridge if the fees are higher. Consequently, this situation can lead to the funds from the bridge with lower or no fees being depleted first, forcing subsequent users to withdraw
/unstakeEth
from the other bridge with higher fees.
In the provided test case, Alice and Bob deposited an equal amount of stETH
and rETH
in both of the bridges. However, only the BridgeReth
imposes a withdrawal fee. As a result, when Alice decided to withdraw all of her tokens through the BridgeSteth
(the bridge without a fee), Bob was compelled to use the other bridge, which incurs significant fees. This distribution of fees is unfair because Alice and Bob deposited an equal amount in both bridges, and therefore, the fees should also be shared during the withdrawal process.
Place the following test case in test/Bridges.t.sol and run it with the command forge test --mt test_unfair_fee_distribution -vvv
.
Result:
Some users may be subject to higher fees.
Manual Review
Ensure that the user can withdraw
/unstakeEth
only from the bridge in which it was deposited.
Alternatively, require that all of the bridges has equal fees.
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.