Small fixes#304
Conversation
acenolaza
left a comment
There was a problem hiding this comment.
LGTM 👍🏻
Just added a few minor comments that might be useful.
|
I added |
acenolaza
left a comment
There was a problem hiding this comment.
LGTM again. I was just wondering, should we add "To" to variables like userSharesUpdate (userSharesToUpdate) for consistency with other local variables (i.e. delegatedToUpdate)?
| // Should never return false because the API3 token uses the | ||
| // OpenZeppelin implementation | ||
| assert(api3Token.transferFrom(source, address(this), amount)); | ||
| emit DepositedByTimelockManager( |
There was a problem hiding this comment.
Should we also add source to the event just for completeness and consistency since we are adding all inputs on other events?
There was a problem hiding this comment.
source will always be timelockManager (which is immutable) due to the awkward way TimelockManager.sol was implemented, so not really needed (could be done for consistency but meh)
| @@ -118,7 +122,9 @@ abstract contract TimelockUtils is ClaimUtils, ITimelockUtils { | |||
| userAddress, | |||
There was a problem hiding this comment.
source is also only timelockManager
|
A bunch of small fixes:
In Api3Voting,
EPOCH_LENGTHis already assigned tovoteTimeininitialize()and sinceEPOCH_LENGTHandvoteTimedon't change, we can usevoteTimeinstead of fetchingEPOCH_LENGTHfrom the pool contract. It will just be slightly cheaper.Typecasts at checkpoint arrays were
assert()ed but the ones at reward records weren't, so added it for the sake of completeness.totalStakeis added to the reward records. This is actually not used in anywhere in the contract, but the problem I wanted to solve is that we don't keep any history of total staked amount on-chain for someone to build an external contract that uses that somehow. It just makes reward payments a bit more expensive so felt like it's worth it.Delegation and delegation update events being the same was confusing, so created another one.
Small formatting and comment stuff