The bid
function in the DaiGoldAuction contract transfers tokens before updating state variables, potentially exposing the contract to reentrancy attacks.
In the bid
function , the contract transfers tokens from the user to the treasury before updating the user's deposit amount and the total bid amount for the epoch. This violates the checks-effects-interactions pattern, which is a best practice for preventing reentrancy attacks.
Anyone could potentially exploit this vulnerability to bid multiple times with the same tokens, artificially inflating their bid amount and diluting other participants' shares of the auction. This could lead to an unfair distribution of Temple Gold and a loss of funds for other participants.
Manual code review
Implement the checks-effects-interactions pattern by updating the contract's state before making external calls. This will significantly reduce the risk of reentrancy attacks and improve the overall security of the contract.
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.