forked from hyperlane-xyz/hyperlane-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 1
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: zksync deployment logic [ZK-002] #21
Open
ljankovic-txfusion
wants to merge
20
commits into
feat/zksync-sdk-provider
Choose a base branch
from
feat/zksync-deployment-functions
base: feat/zksync-sdk-provider
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
8e6c6f6
feat: ZKSync functions, metadata and types for deployment
ljankovic-txfusion cd1eae9
docs(changeset): Added ZKSync specific deployment logic and artifact …
ljankovic-txfusion b83fb67
feat: ZKSync Provider types for proxy utils
ljankovic-txfusion ced1965
Merge remote-tracking branch 'origin/feat/zksync-sdk-provider' into f…
ljankovic-txfusion 7ed09b8
chore: change ZKSync SDK version to minor
ljankovic-txfusion 4befd65
refactor: rename Provider type to NetworkProvider for clarity in prox…
ljankovic-txfusion 3e3c6f5
refactor: rename STATIC_ISM_TYPE to STATIC_ISM_TYPES for consistency …
ljankovic-txfusion 541e650
Merge remote-tracking branch 'origin/feat/zksync-sdk-provider' into f…
ljankovic-txfusion 4dfafc4
Merge remote-tracking branch 'origin/main' into feat/zksync-deploymen…
ljankovic-txfusion f363a46
Merge remote-tracking branch 'origin/feat/zksync-sdk-provider' into f…
ljankovic-txfusion 5ffeaf6
Merge remote-tracking branch 'origin/feat/zksync-sdk-provider' into f…
ljankovic-txfusion 42a1215
fix: await loadAllZKSyncArtifacts in getZKSyncArtifactByContractName …
ljankovic-txfusion 8831a03
Merge remote-tracking branch 'origin/feat/zksync-sdk-provider' into f…
ljankovic-txfusion bbf963c
Merge remote-tracking branch 'origin/feat/zksync-sdk-provider' into f…
ljankovic-txfusion 1e191cb
Merge remote-tracking branch 'origin/feat/zksync-sdk-provider' into f…
ljankovic-txfusion f9dd542
fix(zksync): remove async from loadAllZKSyncArtifacts function call
ljankovic-txfusion 254ffb2
Merge remote-tracking branch 'origin/feat/zksync-sdk-provider' into f…
ljankovic-txfusion c24cfa1
Merge remote-tracking branch 'origin/feat/zksync-sdk-provider' into f…
ljankovic-txfusion ade32ef
Merge remote-tracking branch 'origin/feat/zksync-sdk-provider' into f…
ljankovic-txfusion ff8fc05
Merge remote-tracking branch 'origin/feat/zksync-sdk-provider' into f…
ljankovic-txfusion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@hyperlane-xyz/sdk': minor | ||
--- | ||
|
||
Added ZKSync specific deployment logic and artifact related utils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { ethers } from 'ethers'; | ||
|
||
import { proxyFactoryFactories } from './contracts.js'; | ||
import { ProxyFactoryFactoriesAddresses } from './types.js'; | ||
|
||
/** | ||
* Creates a default ProxyFactoryFactoriesAddresses object with all values set to ethers.constants.AddressZero. | ||
* @returns {ProxyFactoryFactoriesAddresses} An object with all factory addresses set to AddressZero. | ||
*/ | ||
export function createDefaultProxyFactoryFactories(): ProxyFactoryFactoriesAddresses { | ||
const defaultAddress = ethers.constants.AddressZero; | ||
return Object.keys(proxyFactoryFactories).reduce((acc, key) => { | ||
acc[key as keyof ProxyFactoryFactoriesAddresses] = defaultAddress; // Type assertion added here | ||
return acc; | ||
}, {} as ProxyFactoryFactoriesAddresses); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -67,6 +67,16 @@ export const MUTABLE_ISM_TYPE = [ | |||||
IsmType.PAUSABLE, | ||||||
]; | ||||||
|
||||||
// ISM types that require static deployment | ||||||
export const STATIC_ISM_TYPE = [ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved. Made a separate commit, since its used in multiple places |
||||||
IsmType.AGGREGATION, | ||||||
IsmType.MERKLE_ROOT_MULTISIG, | ||||||
IsmType.MESSAGE_ID_MULTISIG, | ||||||
IsmType.WEIGHTED_MERKLE_ROOT_MULTISIG, | ||||||
IsmType.WEIGHTED_MESSAGE_ID_MULTISIG, | ||||||
IsmType.ICA_ROUTING, | ||||||
]; | ||||||
|
||||||
// mapping between the two enums | ||||||
export function ismTypeToModuleType(ismType: IsmType): ModuleType { | ||||||
switch (ismType) { | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { ZKSyncArtifact, loadAllZKSyncArtifacts } from '@hyperlane-xyz/core'; | ||
|
||
/** | ||
* @dev Retrieves a ZkSync artifact by its contract name or qualified name. | ||
* @param name The name of the contract or qualified name in the format "sourceName:contractName". | ||
* @return The corresponding ZKSyncArtifact if found, or undefined if not found. | ||
*/ | ||
export const getZKSyncArtifactByContractName = async ( | ||
name: string, | ||
): Promise<ZKSyncArtifact | undefined> => { | ||
// Load all ZkSync artifacts | ||
const allArtifacts = loadAllZKSyncArtifacts(); | ||
|
||
// Find the artifact that matches the contract name or qualified name | ||
const artifact = Object.values(allArtifacts).find( | ||
({ contractName, sourceName }: ZKSyncArtifact) => { | ||
const lowerCaseContractName = contractName.toLowerCase(); | ||
const lowerCaseName = name.toLowerCase(); | ||
|
||
// Check if the contract name matches | ||
if (lowerCaseContractName === lowerCaseName) { | ||
return true; | ||
} | ||
|
||
// Check if the qualified name matches | ||
const qualifiedName = `${sourceName}:${contractName}`; | ||
return qualifiedName === name; // Return true if qualified name matches | ||
}, | ||
); | ||
|
||
return artifact; | ||
}; |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
ethers Provider and ZKSync Provider are not compatible with each other
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.
Can we maybe pick a more descriptive name for the Union type?
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.
picked
NetworkProvider