Skip to content

Commit 00312b5

Browse files
committed
chore(unichain): support unichain
1 parent 477c666 commit 00312b5

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ETHEREUM_RPC_URL="https://1rpc.io/eth"
22
BASE_RPC_URL="https://mainnet.base.org"
33
ARBITRUM_RPC_URL="https://arb1.arbitrum.io/rpc"
44
BSC_MAINNET_RPC_URL="https://bsc-dataseed1.binance.org/"
5-
5+
UNICHAIN_RPC_URL="https://mainnet.unichain.org"
66
# No need to change
77
executorLzReceiveOptionMaxGas=200000
88
gasDropInWeiOnDestChain=0

hardhat.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const ETHEREUM_RPC_URL = process.env.ETHEREUM_RPC_URL;
1010
const BASE_RPC_URL = process.env.BASE_RPC_URL;
1111
const ARBITRUM_RPC_URL = process.env.ARBITRUM_RPC_URL;
1212
const BSC_MAINNET_RPC_URL = process.env.BSC_MAINNET_RPC_URL;
13+
const UNICHAIN_RPC_URL = process.env.UNICHAIN_RPC_URL;
1314

1415
module.exports = {
1516
defaultNetwork: "hardhat",
@@ -52,6 +53,11 @@ module.exports = {
5253
chainId: 56,
5354
url: BSC_MAINNET_RPC_URL,
5455
accounts: ACCOUNTS,
56+
},
57+
unichain: {
58+
chianId: 130,
59+
url: UNICHAIN_RPC_URL,
60+
accounts: ACCOUNTS
5561
}
5662
},
5763
etherscan: {

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,26 @@
77
"ora-eth-to-base": "export PATHWAY='ETHEREUM->BASE' && npx hardhat run scripts/send_via_oft_adapter.ts --network ethereum",
88
"ora-eth-to-binance": "export PATHWAY='ETHEREUM->BINANCE' && npx hardhat run scripts/send_via_oft_adapter.ts --network ethereum",
99
"ora-eth-to-solana": "export PATHWAY='ETHEREUM->SOLANA' && npx hardhat run scripts/send_via_oft_adapter_sol.ts --network ethereum",
10+
"ora-eth-to-unichain": "export PATHWAY='ETHEREUM->UNICHAIN' && npx hardhat run scripts/send_via_oft.ts --network ethereum",
1011
"ora-base-to-eth": "export PATHWAY='BASE->ETHEREUM' && npx hardhat run scripts/send_via_oft.ts --network base",
1112
"ora-base-to-binance": "export PATHWAY='BASE->BINANCE' && npx hardhat run scripts/send_via_oft.ts --network base",
1213
"ora-base-to-arbitrum": "export PATHWAY='BASE->ARBITRUM' && npx hardhat run scripts/send_via_oft.ts --network base",
1314
"ora-base-to-solana": "export PATHWAY='BASE->SOLANA' && npx hardhat run scripts/send_via_oft_sol.ts --network base",
15+
"ora-base-to-unichain": "export PATHWAY='BASE->UNICHAIN' && npx hardhat run scripts/send_via_oft.ts --network base",
1416
"ora-arbitrum-to-base": "export PATHWAY='ARBITRUM->BASE' && npx hardhat run scripts/send_via_oft.ts --network arbitrum",
1517
"ora-arbitrum-to-binance": "export PATHWAY='ARBITRUM->BINANCE' && npx hardhat run scripts/send_via_oft.ts --network arbitrum",
1618
"ora-arbitrum-to-eth": "export PATHWAY='ARBITRUM->ETHEREUM' && npx hardhat run scripts/send_via_oft.ts --network arbitrum",
1719
"ora-arbitrum-to-solana": "export PATHWAY='ARBITRUM->SOLANA' && npx hardhat run scripts/send_via_oft_sol.ts --network arbitrum",
20+
"ora-arbitrum-to-unichain": "export PATHWAY='ARBITRUM->UNICHAIN' && npx hardhat run scripts/send_via_oft.ts --network arbitrum",
1821
"ora-binance-to-base": "export PATHWAY='BINANCE->BASE' && npx hardhat run scripts/send_via_oft.ts --network binance",
1922
"ora-binance-to-arbitrum": "export PATHWAY='BINANCE->ARBITRUM' && npx hardhat run scripts/send_via_oft.ts --network binance",
2023
"ora-binance-to-eth": "export PATHWAY='BINANCE->ETHEREUM' && npx hardhat run scripts/send_via_oft.ts --network binance",
21-
"ora-binance-to-solana": "export PATHWAY='BINANCE->SOLANA' && npx hardhat run scripts/send_via_oft_sol.ts --network binance"
24+
"ora-binance-to-solana": "export PATHWAY='BINANCE->SOLANA' && npx hardhat run scripts/send_via_oft_sol.ts --network binance",
25+
"ora-binance-to-unichain": "export PATHWAY='BINANCE->UNICHAIN' && npx hardhat run scripts/send_via_oft.ts --network binance",
26+
"ora-unichain-to-eth": "export PATHWAY='UNICHAIN->ETHEREUM' && npx hardhat run scripts/send_via_oft.ts --network unichain",
27+
"ora-unichain-to-base": "export PATHWAY='UNICHAIN->BASE' && npx hardhat run scripts/send_via_oft.ts --network unichain",
28+
"ora-unichain-to-arbitrum": "export PATHWAY='UNICHAIN->ARBITRUM' && npx hardhat run scripts/send_via_oft.ts --network unichain",
29+
"ora-unichain-to-binance": "export PATHWAY='UNICHAIN->BINANCE' && npx hardhat run scripts/send_via_oft.ts --network unichain"
2230
},
2331
"devDependencies": {
2432
"@ethersproject/bytes": "^5.7.0",

scripts/layer0_bridge_data.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ const CHAIN_CONFIG: any = {
1919
SOLANA: {
2020
oftContractAddress: "BVf9xuRTRLmb8DjfaxDgPuGBdy9qTnspLwYpDpfdUoAY",
2121
lzEndpointIdOnCurrentChain: 30168
22+
},
23+
UNICHAIN: {
24+
oftContractAddress: "0x2d1b035CA47E04A119dff0FAC828f4a57A67E4dE",
25+
lzEndpointIdOnCurrentChain: 30320,
2226
}
2327
};
2428

0 commit comments

Comments
 (0)