The deployment script is deploying an ERC1967Proxy but then fails to initialize it.
Due to the fact that src/protocol/ThunderLoan::initialize
and src/upgradedProtocol/ThunderLoanUpgraded::initialize
are all unprotected external methods, anyone can frontrun the deployment and initialize the proxy with a address(0) as the tswapAddress thereby making this instance of the application completely useless.
Combining the current state of the deployment script as is with a bot and it causes a denial of service to the protocol authors as well as users as it won't let a functioning instance of the application be deployed.
and run in the terminal forge test --mt testWrongInitializationCannotDeposit -vvv
By initializing the proxy with address(0) as the pool factory address, this makes it impossible to deposit/redeem as the call to ThunderLoan::getCalculatedFee
or ThunderLoanUpgraded::getCalculatedFee
will always revert at getPriceInWeth
call.
This line particularly.
address swapPoolOfToken = IPoolFactory(s_poolFactory).getPool(token);
Let's note that, because the initialize function was called by the attacker, he effectively seized the ownership of the protocol from the protocol authors and can now do only owner stuff like say set an exhorbitantly high flashloan fee making the protocol useless as well.
Manual review
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.