-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vault Incentive Implementation #96
Conversation
e0b9280
to
bed1fdc
Compare
…ne/onebtc into vault-incentive-implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments/questions on different things. Also I plan to push a couple extra comments I added to the code while reviewing, hopefully that is ok and helps overall documentation.
Specifically, please take a look at the permissioning of setValueRewardAddress in vault registry and make sure it is correct.
…ne/onebtc into vault-incentive-implementation
uint256 secPerDay = 60 * 60 * 24; | ||
uint256 elapsedSecs; | ||
if (block.timestamp <= vault.lockExpireAt) { | ||
rewardClaimAt = block.timestamp.sub( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(not sure what the requirement) but do you need to check if block.timestamp - vault.rewardClaimAt >= 2 weeks. Otherwise, you're effectively shifting the rewardClaimAt back as far as +1 sec, and letting them claim anytime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rewards can be claimed every 14 days. It's one of the requirements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Wouldn't it make sense to add some checks on minimum period to collect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok. Seems like if you check for period first, you don't need to mod at all.
); | ||
} | ||
|
||
function setVaultRewardAddress(address _vaultReward) external { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the note or architecture, because we use inheritance, and expose various inherited classes as external, it be quite difficult to which is external layer, and internal layer. I think with code size refactor later as we move away from inheritance, we can make this clearer.
close #90