Within the both Bridge contract (BridgeReth.sol and BridgeSteth.sol), the following functions to subtract the fees would not be implemented:
The withdrawalFee() function
The unstakeFee() function
As a result,
Within the BridgeRouterFacet#withdraw(), 0 would always be stored into the withdrawalFee because the Bridge#withdrawalFee() would be 0.
Within the BridgeRouterFacet#unstakeEth(), 0 would always be stored into the fee because the Bridge#unstakeFee() would be 0.
This lead to that the DittoETH protocol would always be missing to collect the fees when the BridgeRouterFacet#withdraw() or the BridgeRouterFacet#unstakeEth() would be called.
Within the BridgeRouterFacet#withdraw(), the Bridge#withdrawalFee() would be called to get the withdrawalFee like this:
https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/BridgeRouterFacet.sol#L96
Within the BridgeRouterFacet#unstakeEth(), the Bridge#unstakeFee() would be called to get the fee like this:
https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/BridgeRouterFacet.sol#L123
As we can see the both functions above, within the both Bridge contract (BridgeReth.sol and BridgeSteth.sol), the following functions to subtract the fees are supposed to be implemented:
The withdrawalFee() function
The unstakeFee() function
However, within the both Bridge contract (BridgeReth.sol and BridgeSteth.sol), the both functions (the withdrawalFee() and the unstakeFee()) to subtract the fees would not be implemented.
As a result,
Within the BridgeRouterFacet#withdraw(), 0 would always be stored into the withdrawalFee because the Bridge#withdrawalFee() would be 0.
https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/BridgeRouterFacet.sol#L96
Within the BridgeRouterFacet#unstakeEth(), 0 would always be stored into the fee because the Bridge#unstakeFee() would be 0.
https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/BridgeRouterFacet.sol#L123
This lead to missing to collect the fees when the BridgeRouterFacet#withdraw() or the BridgeRouterFacet#unstakeEth() would be called.
The DittoETH protocol would always be missing to collect the fees when the BridgeRouterFacet#withdraw() or the BridgeRouterFacet#unstakeEth() would be called.
Foundry
Within the both Bridge contract (BridgeReth.sol and BridgeSteth.sol), consider implementing (adding) the withdrawalFee() function and the unstakeFee() 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.