shapeshift / rFOX

rFOX - RUNE rewards for FOX stakers
MIT License
0 stars 0 forks source link

fixes TRST-M-1 - adds additional padding for precision loss #51

Closed 0xean closed 4 weeks ago

0xean commented 1 month ago

Screenshot 2024-05-29 at 1 00 28 PM

While we don't plan to use this for tokens with > 18 decimals or more than 1 billion staked tokens, we can still add some additional padding to make the contract more flexible and future proof.

This adds additional padding to the REWARD_RATE which is the same outcome as suggested by the auditors it also adds additional paranoia in testing by increasing the supply of test fox tokens and the number of years we check for overflow on.

note: this doesn't divide by the increase as suggested by Trust in the audit - but I don't think that is required based on the expected use case here and the checks for overflow.