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

feat(contracts): add REZ token to Hyperlane AVS #4786

Open
wants to merge 5 commits into
base: audit-q3-2024
Choose a base branch
from

Conversation

aroralanuk
Copy link
Contributor

@aroralanuk aroralanuk commented Oct 30, 2024

Description

  • addRezStrategy for adding REZ to our AVS
  • REZAdditionTest is a fork test to mock if the REZ strategy is accounted for both the overall AVS and for a operator who gets REZ deposited to them (THIS TEST WILL NOT BE MERGED, ONLY ADDED TO TEST IF REZ INCLUSION WORKS ON A FORK)

Drive-by changes

None

Related issues

Backward compatibility

Yes

Testing

Fork test on ethereum mainnet

Copy link

changeset-bot bot commented Oct 30, 2024

⚠️ No Changeset found

Latest commit: 823d26d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (audit-q3-2024@7a3b0d0). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             audit-q3-2024    #4786   +/-   ##
================================================
  Coverage                 ?   73.74%           
================================================
  Files                    ?      100           
  Lines                    ?     1436           
  Branches                 ?      189           
================================================
  Hits                     ?     1059           
  Misses                   ?      356           
  Partials                 ?       21           
Components Coverage Δ
core 84.61% <0.00%> (?)
hooks 75.57% <0.00%> (?)
isms 77.58% <0.00%> (?)
token 89.54% <0.00%> (?)
middlewares 77.39% <0.00%> (?)

Comment on lines +250 to +258
uint256 totalStrategies = newQuorum.strategies.length;
uint96 baseMultiplier = uint96(10000 / totalStrategies);

uint96 remainder = 10000 % uint96(totalStrategies);

for (uint256 i = 0; i < currentQuorum.strategies.length; i++) {
newQuorum.strategies[i] = currentQuorum.strategies[i];
newQuorum.strategies[i].multiplier = baseMultiplier;
}
Copy link
Member

Choose a reason for hiding this comment

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

do we really want to apply a prorate quorum for REZ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doesn't matter, we'll read it manually for ISM config.

bytes memory encodedCall = abi.encodeWithSelector(
stakeRegistry.updateQuorumConfig.selector,
newQuorum,
new address[](0)
Copy link
Member

Choose a reason for hiding this comment

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

whats this param?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update operator weights, if we give an empty array, it doesn't update it.

solidity/script/avs/DeployAVS.s.sol Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

2 participants