Skip to content

feat: Create hyperdrive registry#676

Merged
jalextowle merged 6 commits intomainfrom
lm/feat/create-hyperdrive-registry
Dec 19, 2023
Merged

feat: Create hyperdrive registry#676
jalextowle merged 6 commits intomainfrom
lm/feat/create-hyperdrive-registry

Conversation

@lucas-manuel
Copy link
Copy Markdown
Contributor

@lucas-manuel lucas-manuel commented Nov 19, 2023

This is a first very bare bones implementation to get some technical validation.

Figured with a nested mapping structure like this, we can add any info we want.

Some examples:

hyperdriveInfo[hyperdriveInstance1]["GOVERNANCE_ONBOARDED"].data == bytes32(1)

hyperdriveInfo[hyperdriveInstance2]["BOND_RATING"].data == bytes32("AAA") &&
hyperdriveInfo[hyperdriveInstance2]["BOND_RATING"].lastUpdated > block.timestamp - 30 days

hyperdriveInfo[hyperdriveInstance3]["SAFETY_RATING"].data >= bytes32(50_00) &&
hyperdriveInfo[hyperdriveInstance3]["SAFETY_RATING"].lastUpdated > block.timestamp - 30 days

@lucas-manuel lucas-manuel self-assigned this Nov 19, 2023
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 19, 2023

Hyperdrive Gas Benchmark

Benchmark suite Current: 3e5db23 Previous: 51a4ea6 Deviation Status
addLiquidity: min 1600 gas 1600 gas 0% 🟰
addLiquidity: avg 53436 gas 53699 gas -0.4898%
addLiquidity: max 232457 gas 99828 gas 132.8575% 🚨
checkpoint: min 1216 gas 1216 gas 0% 🟰
checkpoint: avg 48049 gas 47501 gas 1.1537% 🚨
checkpoint: max 201987 gas 114768 gas 75.9959% 🚨
closeLong: min 1690 gas 1690 gas 0% 🟰
closeLong: avg 26484 gas 26952 gas -1.7364%
closeLong: max 139742 gas 137971 gas 1.2836% 🚨
closeShort: min 1693 gas 1693 gas 0% 🟰
closeShort: avg 28908 gas 29406 gas -1.6935%
closeShort: max 144509 gas 110684 gas 30.5600% 🚨
initialize: min 1605 gas 1605 gas 0% 🟰
initialize: avg 181851 gas 181724 gas 0.0699% 🚨
initialize: max 256942 gas 256838 gas 0.0405% 🚨
openLong: min 736 gas 736 gas 0% 🟰
openLong: avg 39704 gas 54437 gas -27.0643%
openLong: max 161281 gas 179948 gas -10.3736%
openShort: min 702 gas 702 gas 0% 🟰
openShort: avg 46371 gas 53869 gas -13.9190%
openShort: max 160559 gas 177871 gas -9.7329%
redeemWithdrawalShares: min 1598 gas 1598 gas 0% 🟰
redeemWithdrawalShares: avg 18552 gas 20783 gas -10.7347%
redeemWithdrawalShares: max 84776 gas 51824 gas 63.5844% 🚨
removeLiquidity: min 1661 gas 1661 gas 0% 🟰
removeLiquidity: avg 120937 gas 76001 gas 59.1255% 🚨
removeLiquidity: max 258840 gas 212872 gas 21.5942% 🚨

This comment was automatically generated by workflow using github-action-benchmark.

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Nov 19, 2023

Coverage Status

coverage: 95.024% (+0.02%) from 95.004%
when pulling 3e5db23 on lm/feat/create-hyperdrive-registry
into 9dba534 on main.

Comment thread contracts/src/interfaces/IHyperdriveRegistry.sol
Comment thread contracts/src/factory/HyperdriveRegistry.sol Outdated
@lucas-manuel
Copy link
Copy Markdown
Contributor Author

lucas-manuel commented Nov 30, 2023

Add function to spec that is generic eg. getRegistryInfo(address instance) returns (uint256)

Create interface that only has this function.

@lucas-manuel lucas-manuel force-pushed the lm/feat/create-hyperdrive-registry branch from 5d63702 to b68c3a1 Compare December 14, 2023 11:04
@lucas-manuel lucas-manuel marked this pull request as ready for review December 14, 2023 19:05
@lucas-manuel lucas-manuel changed the title feat: Create hyperdrive registry [WIP] feat: Create hyperdrive registry Dec 14, 2023
Comment thread contracts/src/interfaces/IHyperdriveRegistry.sol Outdated
Copy link
Copy Markdown
Contributor

@jalextowle jalextowle left a comment

Choose a reason for hiding this comment

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

This is excellent! Looks great to me, and I'll do an early approval. I left one comment about tweaking the registry which I'm happy to discuss.

@jalextowle jalextowle enabled auto-merge (squash) December 19, 2023 02:03
@jalextowle jalextowle merged commit 6c0f5a4 into main Dec 19, 2023
@jalextowle jalextowle deleted the lm/feat/create-hyperdrive-registry branch December 19, 2023 20:38
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.

3 participants