hyperlane-xyz / hyperlane-deploy Goto Github PK
View Code? Open in Web Editor NEWScripts for deploying Hyperlane contracts
License: Apache License 2.0
Scripts for deploying Hyperlane contracts
License: Apache License 2.0
Remove -v2 suffix
Currently the following contracts are not included in the deployment script:
Happy submitting a PR if I get the thumbs up?
I am trying to test and deploy hyperlane on anvil local chain.
The deployment script fails with following error:
duplicate definition - NotCrossChainCall()
hyperlane Beginning Hyperlane deployment script +0ms
hyperlane Preparing Hyperlane deployer +1ms
hyperlane Beginning Hyperlane deployment +101ms
hyperlane:HyperlanePermissionlessDeployer Deploying ISM factory contracts +0ms
hyperlane:IsmFactoryDeployer Start deploy to anvil2,anvil1 +0ms
hyperlane:IsmFactoryDeployer Deploying to anvil2 from 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 +9ms
hyperlane:IsmFactoryDeployer Recovered merkleRootMultisigIsmFactory on anvil2 0x5FbDB2315678afecb367f032d93F642f64180aa3 +8ms
hyperlane:IsmFactoryDeployer Recovered messageIdMultisigIsmFactory on anvil2 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 +4ms
hyperlane:IsmFactoryDeployer Recovered aggregationIsmFactory on anvil2 0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0 +2ms
hyperlane:IsmFactoryDeployer Recovered routingIsmFactory on anvil2 0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 +2ms
hyperlane:IsmFactoryDeployer Deploying to anvil1 from 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 +4ms
hyperlane:IsmFactoryDeployer Recovered merkleRootMultisigIsmFactory on anvil1 0x5FbDB2315678afecb367f032d93F642f64180aa3 +16ms
hyperlane:IsmFactoryDeployer Recovered messageIdMultisigIsmFactory on anvil1 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 +3ms
hyperlane:IsmFactoryDeployer Recovered aggregationIsmFactory on anvil1 0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0 +2ms
hyperlane:IsmFactoryDeployer Recovered routingIsmFactory on anvil1 0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 +1ms
hyperlane:HyperlanePermissionlessDeployer Writing contract addresses to artifacts/addresses.json +52ms
hyperlane:HyperlanePermissionlessDeployer ISM factory deployment complete +1ms
hyperlane:HyperlanePermissionlessDeployer Deploying IGP contracts +0ms
hyperlane:IgpDeployer Start deploy to anvil2,anvil1 +0ms
hyperlane:IgpDeployer Deploying to anvil2 from 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 +4ms
hyperlane:IgpDeployer Recovered proxyAdmin on anvil2 0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9 +5ms
hyperlane:IgpDeployer Recovered storageGasOracle on anvil2 0x5FC8d32690cc91D4c39d9d3abcBD16989F875707 +2ms
hyperlane:IgpDeployer Recovered interchainGasPaymaster on anvil2 0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6 +5ms
hyperlane:ERROR Error running Hyperlane deployment Error: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method="gasOracles(uint32)", data="0x", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.7.0)
at Logger.makeError (/Users/mac/hyperlane/hyperlane-deploy/node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
at Logger.throwError (/Users/mac/hyperlane/hyperlane-deploy/node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
at Interface.decodeFunctionResult (/Users/mac/hyperlane/hyperlane-deploy/node_modules/@ethersproject/abi/src.ts/interface.ts:427:23)
at Contract.<anonymous> (/Users/mac/hyperlane/hyperlane-deploy/node_modules/@ethersproject/contracts/src.ts/index.ts:400:44)
at step (/Users/mac/hyperlane/hyperlane-deploy/node_modules/@ethersproject/contracts/lib/index.js:48:23)
at Object.next (/Users/mac/hyperlane/hyperlane-deploy/node_modules/@ethersproject/contracts/lib/index.js:29:53)
at fulfilled (/Users/mac/hyperlane/hyperlane-deploy/node_modules/@ethersproject/contracts/lib/index.js:20:58)
at processTicksAndRejections (internal/process/task_queues.js:95:5) {
reason: null,
code: 'CALL_EXCEPTION',
method: 'gasOracles(uint32)',
data: '0x',
errorArgs: null,
errorName: null,
errorSignature: null,
address: '0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6',
args: [ 31337 ],
transaction: {
data: '0x1d16c8c80000000000000000000000000000000000000000000000000000000000007a69',
to: '0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6',
from: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
}
} +0ms
Below are my configurations.
DEBUG=hyperlane* yarn ts-node scripts/deploy-hyperlane.ts --local anvil1 \
--remotes anvil2 \
--key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
import { ChainMap, ChainMetadata, ProtocolType } from '@hyperlane-xyz/sdk';
// import { chainMetadata } from '@hyperlane-xyz/sdk';
// A map of chain names to ChainMetadata
export const chains: ChainMap<ChainMetadata> = {
// ----------- Add your chains here -----------------
anvil1: {
name: 'anvil1',
protocol: ProtocolType.Ethereum,
// anvil default chain id
chainId: 31337,
// Used to configure a Warp Route to bridge anvil1 ETH
// to anvil2 in CI tests.
nativeToken: {
name: 'ether',
symbol: 'ETH',
decimals: 18,
},
rpcUrls: [
{
http: 'http://127.0.0.1:8545',
},
],
// You can set overrides for transaction fields here
// transactionOverrides: {
// gasLimit: 1000000
// },
},
anvil2: {
name: 'anvil2',
protocol: ProtocolType.Ethereum,
chainId: 31338,
nativeToken: {
name: 'ether',
symbol: 'ETH',
decimals: 18,
},
rpcUrls: [
{
http: 'http://127.0.0.1:8555',
},
],
},
// --------------------------------------------------
// You can also override the default chain metadata (completely)
// ethereum: {
// ...chainMetadata.ethereum,
// publicRpcUrls: [
// {
// http: 'my.custom.rpc.url',
// }
// ],
// }
};
import { ChainMap, ModuleType, MultisigIsmConfig } from '@hyperlane-xyz/sdk';
export const multisigIsmConfig: ChainMap<MultisigIsmConfig> = {
// ----------- Your chains here -----------------
anvil1: {
type: ModuleType.LEGACY_MULTISIG,
threshold: 1,
validators: [
// Last anvil address
'0xa0ee7a142d267c1f36714e4a8f75612f20a79720',
],
},
anvil2: {
type: ModuleType.LEGACY_MULTISIG,
threshold: 1,
validators: [
// Last anvil address
'0xa0ee7a142d267c1f36714e4a8f75612f20a79720',
],
},
};
Let me know if something is missing from my side.
chain.ts
import { ChainMap, ChainMetadata, ProtocolType } from '@hyperlane-xyz/sdk';
// import { chainMetadata } from '@hyperlane-xyz/sdk';
// A map of chain names to ChainMetadata
export const chains: ChainMap<ChainMetadata> = {
// ----------- Add your chains here -----------------
goerli: {
name: 'goerli',
protocol: ProtocolType.Ethereum,
chainId: 5, // This is the chain ID for Goerli (Matic testnet)
nativeToken: {
name: 'GeorliToken',
symbol: 'GoerliETH',
decimals: 18,
},
rpcUrls: [
{
http: `https://eth-goerli.g.alchemy.com/v2/${process.env.API_KEY_GOERLI}`, // Adjust this to the Goerli RPC endpoint you want to use.
},
],
},
sepolia: {
name: 'sepolia',
protocol: ProtocolType.Ethereum, // Assuming there's a custom protocol type for Sepolia
chainId: 12345, // Replace with the actual chain ID for Sepolia
nativeToken: {
name: 'SepoliaToken', // Replace with the native token name if applicable
symbol: 'SepoliaETH', // Replace with the native token symbol if applicable
decimals: 18, // Replace with the number of decimals for the native token if applicable
},
rpcUrls: [
{
http: `https://eth-sepolia.g.alchemy.com/v2/${process.env.API_KEY_SEPOLIA}`, // Replace with the Sepolia RPC endpoint you want to use.
},
],
},
// --------------------------------------------------
// You can also override the default chain metadata (completely)
// ethereum: {
// ...chainMetadata.ethereum,
// publicRpcUrls: [
// {
// http: 'my.custom.rpc.url',
// }
// ],
// }
};
![image](https://github.com/hyperlane-xyz/hyperlane-deploy/assets/75583927/e2608bdc-a62e-4ff6-9f2e-7c25ef23c699)
![image](https://github.com/hyperlane-xyz/hyperlane-deploy/assets/75583927/d6a8a232-d604-47c3-9688-da087b250170)
I'm trying to deploy Hyperlane to Filecoin's testnet wallaby
by following these docs, but when I run
forge script scripts/DeployCore.s.sol --broadcast --rpc-url $RPC_URL
I get an error that
## Setting up (1) EVMs.
Failed with `ERC1967: new implementation is not a contract`:
I've attached the full output in logs.txt, and it looks like the deployment code was executed but the EVM setup failed.
LOCAL=wallaby
RPC_URL=https://wallaby.node.glif.io/rpc/v0
REMOTES=goerli
I initialized the keys under contracts
as ""
, and the script filled in the addresses.
"wallaby": {
"id": 31415,
"owner": "0xbcb8E197F783E2aE4B3f3b6358B582a9692f9F85",
"contracts": {
"interchainGasPaymaster": "0xBb2180ebd78ce97360503434eD37fcf4a1Df61c3",
"mailbox": "0x416C42991d05b31E9A6dC209e91AD22b79D87Ae6",
"proxyAdmin": "0x34A1D3fff3958843C43aD80F30b94c510645C316",
"testRecipient": "0xd21060559c9beb54fC07aFd6151aDf6cFCDDCAeB",
"create2Factory": "0x0000000000000000000000000000000000000000"
}
}
Has anyone encountered this error before? Am I missing a step in the setup? I also tried to deploy to hyperspace
, another Filecoin testnet, but saw the same failure message.
at this line, I believe ism
should be config.interchainSecurityModule
I'm just reading the code and have just noticed, didn't try to reproduce.
It's probably a minor change in the new TypeScript SDK, but previously with Forge scripting it was possible to set a different owner
(in config/networks.json
) than the deployer key,
now the owner is always the deployer:
We want to transfer ownership of the deployed contracts to a Safe wallet. So using the new SDK we need to call transferOwnership
on all the deployed contracts, which means an additional post-deployment step
I have a config at config/multisig_ism.json
as:
"ethereum1": {
"threshold": 2,
"validators": [
{
"address": "0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec",
"name": "validator 1"
},
{
"address": "0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097",
"name": "validator 2"
},
{
"address": "0xcd3B766CCDd6AE721141F452C550Ca635964ce71",
"name": "validator 3"
}
]
},
above only 3 validators are specified. But Multisig.validators
returns 5 validators:
0x0000000000000000000000000000000000000020
0x0000000000000000000000000000000000000003
0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec
0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097
0xcd3B766CCDd6AE721141F452C550Ca635964ce71
This is because the readMultisigIsmDomainConfig
uses JSON parseRaw
on .validators[*].address
that returns ABI-encoded byte array (including the offset specifier and length).
hyperlane-deploy/lib/ConfigLib.sol
Line 122 in 28af30d
hyperlane-deploy/lib/ConfigLib.sol
Line 123 in 28af30d
One workaround I applied locally was to read addresses starting from that offset:
uint256 offset = 64;
uint256 numValidators = (validatorBytes.length - offset) / 32;
address[] memory validators = new address[](numValidators);
for (uint256 i = 0; i < validators.length; i++) {
validators[i] = abi.decode(
validatorBytes.slice(offset + i * 32, 32),
(address)
);
}
There must be a better way. I experimented with StdJson.sol
's utility function
address[] memory validators = json.readAddressArray(
string.concat(".", chainName, ".validators[*].address")
);
but it doesn't work with wildcard *
selector.
For proxies and implementations
README says I need to add an entry to config/start_blocks.ts
if I need to deploy to a new chain. but it seems scripts/deploy-hyperlane.ts
runs fine without it. is it b/c it's default to be 0?
the instruction was also not clear which block should be put in that file. should I just pick the latest block number?
Atm, our warp route tooling only supports a single "base" type (i.e. native or collateral token), and many synthetic types.
Advanced use cases involve having multiple collateral or native warp route tokens in a single deployment. E.g. the plan for Nautilus, which will involve 1 collateral on Solana, 1 collateral on BSC, and 1 native on Nautilus
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.