When vesting factor is updated distribute amounts may be calculated wrong, due to using the new updated vesting factor for the time since the last distribution. This can also happen
The protocol issues Temple Gold Tokens which are not transferable between users. The tokens can be acquired through staking in TempleGoldStaking
or through auction in the DaiGoldAuction
.
TGLD is only transferred to these contract by the TempleGold
contract itself. The amount to transfer is calculated based on
distribution params and vesting factor.
The distribution params are used to calculate the share percentages of TGLD to send to staking, escrow (dai/gold auction) and gnosis.
The vesting factor is used to calculate the amount of tokens to mint and distribute depending on the time passed as can be seen in the following code snippet:
Both the vesting factor and the distribution params can be updated via setVestingFactor
or setDistributionParams
.
The problem with this is that if mint()
has NOT been called in while and the vesting factor or distribution params are updated, the next call to mint()
would mint and distribute tokens, from before the update, according to the newly updated values of the distribution params or vesting factor. This will cause more or less tokens tokes to be send to staking and escrow resulting in losses for the users or the protocol.
Users receive wrong amount of tokens for staking or in the DAI/TGLD auction - either less or more
Manual review
Call mint
in order to distribute rewards according to the old vesting factor before setting the new one
and also in the setDistributionParams
:
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.