Skip to content

Vault Incentive Implementation#96

Merged
gupadhyaya merged 50 commits intomainfrom
vault-incentive-implementation
May 1, 2022
Merged

Vault Incentive Implementation#96
gupadhyaya merged 50 commits intomainfrom
vault-incentive-implementation

Conversation

@apptreeso
Copy link
Contributor

@apptreeso apptreeso commented Apr 7, 2022

close #90

@apptreeso apptreeso requested a review from gupadhyaya April 7, 2022 16:13
@gupadhyaya gupadhyaya force-pushed the vault-incentive-implementation branch from e0b9280 to bed1fdc Compare April 12, 2022 05:02
@apptreeso apptreeso self-assigned this Apr 13, 2022
@gupadhyaya gupadhyaya requested a review from brucdarc April 26, 2022 01:11
Copy link
Contributor

@brucdarc brucdarc left a 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.

@gupadhyaya gupadhyaya requested a review from hashmesan April 27, 2022 05:50
uint256 secPerDay = 60 * 60 * 24;
uint256 elapsedSecs;
if (block.timestamp <= vault.lockExpireAt) {
rewardClaimAt = block.timestamp.sub(

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.

Copy link
Contributor Author

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.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

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.

@gupadhyaya gupadhyaya self-requested a review May 1, 2022 17:34
@gupadhyaya gupadhyaya merged commit 64cb925 into main May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vault incentive implementation

4 participants