Skip to content
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

Merged
merged 50 commits into from
May 1, 2022
Merged

Conversation

apptreeso
Copy link
Contributor

@apptreeso apptreeso commented Apr 7, 2022

close #90

@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
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.

contract/bridge/contracts/Replace.sol Show resolved Hide resolved
contract/bridge/contracts/VaultRegistry.sol Show resolved Hide resolved
contract/bridge/contracts/VaultReward.sol Outdated Show resolved Hide resolved
contract/bridge/contracts/VaultReward.sol Show resolved Hide resolved
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