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

build: refund accountant #27

Merged
merged 11 commits into from
Nov 17, 2023
Merged

build: refund accountant #27

merged 11 commits into from
Nov 17, 2023

Conversation

Schlagonia
Copy link
Collaborator

No description provided.

@@ -7,6 +7,9 @@ import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol

import {IVault} from "@yearn-vaults/interfaces/IVault.sol";

/// @title Health Check Accountant.
/// @dev Will charge fees issue refunds as well as run healthcheck on any
Copy link
Collaborator

Choose a reason for hiding this comment

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

added commas, and fix typo...
"Will charge fees, issue refunds, and run health check on any reported gains or losses during a strategy's report."

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -17,18 +20,24 @@ contract HealthCheckAccountant {
event UpdateDefaultFeeConfig(Fee defaultFeeConfig);
Copy link
Collaborator

Choose a reason for hiding this comment

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

style: should put struct definition ahead of its usage Fee

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

would prefer to keep the events about the struct definition

@@ -66,8 +75,29 @@ contract HealthCheckAccountant {
_;
}

modifier onlyVaultManagers() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

small: technically this should be onlyVaultOrFeeManagers? maybe we feel that fee manager is already implied?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -320,7 +366,7 @@ contract HealthCheckAccountant {
uint16 customMaxFee,
uint16 customMaxGain,
uint16 customMaxLoss
) external onlyFeeManager {
) external virtual onlyFeeManager {
Copy link
Collaborator

Choose a reason for hiding this comment

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

small suggestion for natspec:

on updateDefaultConfig instead of "used for all strategies", i would say: "... effective for all strategies that don't already have a custom config set"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

}

function _checkVaultIsAdded() internal view virtual {
require(vaults[msg.sender], "!authorized");
Copy link
Collaborator

Choose a reason for hiding this comment

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

small: i would suggest slightly more informative message like "vault not added" rather than generic access control.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -390,7 +432,7 @@ contract HealthCheckAccountant {
function custom(
address vault,
address strategy
) external view returns (bool) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

what do you think about isCustomConfig or hasCustomConfig instead of custom?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

b0aa488

Went with useCustomConfig

@Schlagonia Schlagonia merged commit 9c36607 into master Nov 17, 2023
4 checks passed
@Schlagonia Schlagonia deleted the rewards branch November 17, 2023 20:35
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.

2 participants