Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: Operator Access Module #52
feat: Operator Access Module #52
Changes from 1 commit
17ca3b8
0c8bd5b
db96f64
630ce61
59fdc19
4a93673
4eab453
9153e5d
13be099
3534df6
64ecc28
25c3341
a2e83e7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
HorizonAccountingExtension
features an immutable state variable forHorizonStaking
, which is inconsistent with how it is treated here.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.
I wasn’t aware of
IHorizonStakingExtension::HORIZON_STAKING()
. I wouldn't say it's inconsistent, it could definitely lead to unexpected behavior if the wrong addresses are set during deployment.But more importantly, if
horizonStaking
can be obtained via a call (staticcall
?) tohorizonAccountingExtension
, then I propose removing thehorizonStaking
state variable and instead callingHorizonStakingExtension::HORIZON_STAKING
every time it’s needed, which is only inside of thehasAccess
function.Would this make sense to you?
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.
Performing an external call ad infinitum to get an immutable variable doesn't make sense to me in terms of gas efficiency, compared to storing it once. The
HorizonStaking
address could be sent in the constructor or got through a single external call in it—however, this last option requiresHorizonAccountingExtension
to have been deployed, which might not be desirable.Beware that
HorizonStaking
,HorizonStakingExtension
andHorizonAccountingExtension
refer to different contracts.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.
My bad, I mixed up the contract names.
HorizonAccountingExtension
is the one that has the external viewHORIZON_STAKING
The HorizonAccountingExtension should be already deployed when
EBOAccessModule
is live because it's used inhasAccess
to do theisAuthorized
call.And if that isn't the case, the module also have
setHorizonAccountingExtension
to update its address whenever necessary.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.
now whenever the
horizonAccountingExtension
is updated, it will also callHORIZON_STAKING
and update thehorizonStaking
address.Relevant changes in: 630ce61
Check warning on line 8 in test/unit/EBOAccessModule.t.sol
GitHub Actions / Lint Commit Messages
Check warning on line 8 in test/unit/EBOAccessModule.t.sol
GitHub Actions / Lint Commit Messages