The function incorrectly transfers templeGold tokens to an arbitrary "to" address instead of returning them to the templeGold contract address.
In the recoverToken
function, templeGold tokens are transferred to an arbitrary address:
templeGold.safeTransfer(to, amount);
And there is no check that the "to" address is the templeGold contract address.
This transfer does not align with the token distribution mechanism described in the startAuction
function.
The startAuction
function includes a call to _distributeGold()
, which mints and distributes templeGold tokens to the DaiGoldAuction contract:
This indicates that templeGold tokens should originate from and return to the templeGold contract.
There is potential loss of tokens meant for users who don't claim their tokens immediately after an auction ends. Also, there would be inconsistency between the amount of tokens minted by templeGold and the amount available in the ecosystem.
Manual review
Modify the recoverToken
function to transfer tokens back to the templeGold contract address instead of an arbitrary "to" address.
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.