-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: Earner Manager #100
base: feat/set-claim-recipient
Are you sure you want to change the base?
feat: Earner Manager #100
Conversation
LCOV of commit
|
869827e
to
4c1d530
Compare
090fff0
to
77b0cc9
Compare
4c1d530
to
2c7cfc7
Compare
77b0cc9
to
2abc438
Compare
2c7cfc7
to
afbf5fc
Compare
2abc438
to
90c8b21
Compare
EarnerDetails storage details_ = _earnerDetails[account_]; | ||
|
||
// NOTE: Not using `isInAdministratedEarnersList(account_)` here to avoid redundant storage reads. | ||
return _isValidAdmin(details_.admin) ? (true, details_.feeRate, details_.admin) : (false, 0, address(0)); |
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.
Does this mean that if an admin is removed from the registrar, _isValidAdmin(details_.admin)
will return false
and now anyone can call stopEarningFor()
on Wrapped M?
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.
Yes. If the only reason an account is earning is because of an admin, and that admin is not longer approved, the that account is no longer approved instantly.
/** | ||
* @notice Sets the status for `account` to `status`. | ||
* @notice If approving an earner that is already earning, but was recently removed from the Registrar earners list, | ||
* call `wrappedM.stopEarning(account)` before calling this, then call `wrappedM.startEarning(account)`. |
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.
Is this required because hasEarnerDetails
wouldn't be set otherwise?
Does that mean that the earner would still earn but no fee would be taken from the yield since hasEarnerDetails
will be false?
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.
Correct. Earning WM is a stateful status that needs to be explicitly stopped. Directing a fee to the admin is a "claim time" process based on the details at that time. Note that hasEarnerDetails
will not be false if the originally approving admin is no longer valid, but rather, the _getEarnerDetails
query will return a zero feeRate
and zero admin
.
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.
looks good, any extra changes comparing to the last approved/merged/audited version ?
455dd19
to
430773c
Compare
90c8b21
to
2c56563
Compare
430773c
to
d3acb5a
Compare
2c56563
to
d67dc62
Compare
Other than more tests, there should not be. |
d67dc62
to
dd23154
Compare
d3acb5a
to
7d256ec
Compare
dd23154
to
accb16b
Compare
7d256ec
to
8d7134c
Compare
821a060
to
1d2c2b0
Compare
8d7134c
to
2c9338d
Compare
1d2c2b0
to
97a061f
Compare
2c9338d
to
dfb97c4
Compare
97a061f
to
c3b694c
Compare
dfb97c4
to
72915e7
Compare
c3b694c
to
df6a118
Compare
72915e7
to
d9b89fd
Compare
df6a118
to
10e6354
Compare
d9b89fd
to
c1d9903
Compare
10e6354
to
15f5837
Compare
c1d9903
to
99fe3ce
Compare
15f5837
to
c0914c1
Compare
be37ff9
to
a044c21
Compare
c0914c1
to
848f90c
Compare
No description provided.