Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ fuzz.runs = 10_000
fs_permissions = [
{ access = "read-write", path = "./script/wormhole.json" },
{ access = "read-write", path = "./script/polymer.json" },
{ access = "read", path = "./script/axelar.json" },
{ access = "read", path = "./script/ccip.json" },
{ access = "read", path = "./test/oracle/broadcaster/payloads/ethereum-sepolia" },
]

Expand Down
16 changes: 16 additions & 0 deletions script/axelar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"implementation": {
"ethereum": { "chainId": 1, "gateway": "0x4F4495243837681061C4743b74B3eEdf548D56A5", "gasService": "0x2d5d7d31F671F86C782533cc367F14109a082712" },
"bsc": { "chainId": 56, "gateway": "0x304acf330bbE08d1e512eefaa92F6a57871fD895", "gasService": "0x2d5d7d31F671F86C782533cc367F14109a082712" },
"polygon": { "chainId": 137, "gateway": "0x6f015F16De9fC8791b234eF68D486d2bF203FBA8", "gasService": "0x2d5d7d31F671F86C782533cc367F14109a082712" },
"avalanche": { "chainId": 43114, "gateway": "0x5029C0EFf6C34351a0CEc334542cDb22c7928f78", "gasService": "0x2d5d7d31F671F86C782533cc367F14109a082712" },
"base": { "chainId": 8453, "gateway": "0xe432150cce91c13a887f7D836923d5597adD8E31", "gasService": "0x2d5d7d31F671F86C782533cc367F14109a082712" },
"optimism": { "chainId": 10, "gateway": "0xe432150cce91c13a887f7D836923d5597adD8E31", "gasService": "0x2d5d7d31F671F86C782533cc367F14109a082712" },
"arbitrum": { "chainId": 42161, "gateway": "0xe432150cce91c13a887f7D836923d5597adD8E31", "gasService": "0x2d5d7d31F671F86C782533cc367F14109a082712" },
"mantle": { "chainId": 5000, "gateway": "0xe432150cce91c13a887f7D836923d5597adD8E31", "gasService": "0x2d5d7d31F671F86C782533cc367F14109a082712" },
"celo": { "chainId": 42220, "gateway": "0xe432150cce91c13a887f7D836923d5597adD8E31", "gasService": "0x2d5d7d31F671F86C782533cc367F14109a082712" },
"hyperevm": { "chainId": 999, "gateway": "0xe432150cce91c13a887f7D836923d5597adD8E31", "gasService": "0x2d5d7d31F671F86C782533cc367F14109a082712" },
"monad": { "chainId": 143, "gateway": "0xe432150cce91c13a887f7D836923d5597adD8E31", "gasService": "0x2d5d7d31F671F86C782533cc367F14109a082712" },
"arc": { "chainId": 5042, "gateway": "0xD8346AEAaE536e2A98A7B2992CE32E58bd76EC3c", "gasService": "0x4A86ab8c9b0b5C17587F6a243a8f2E5DE3067BD8" }
}
}
43 changes: 43 additions & 0 deletions script/axelar.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity ^0.8.26;

import { AxelarOracle } from "OIF/src/integrations/oracles/axelar/AxelarOracle.sol";
import { console } from "forge-std/console.sol";

import { multichain } from "./multichain.s.sol";

/// @notice Deploys AxelarOracle with CREATE2 salt 0 on every listed chain from `script/axelar.json`.
/// Sets no chain maps: mainnet oracles are owned by intents-oracle-owner, which sets every map.
/// Re-running is safe: chains where the oracle already exists are skipped.
contract deployAxelar is multichain {
error WrongChain(string chain, uint256 expected, uint256 actual);
error NoCode(string chain, address target);

string private constant AXELAR_CONFIG = "/script/axelar.json";

function run(
string[] calldata chains,
address initialOwner
) public iter_chains(chains) broadcast returns (AxelarOracle oracle) {
string memory activeChain = getChain();
string memory config = vm.readFile(string.concat(vm.projectRoot(), AXELAR_CONFIG));
string memory prefix = string.concat(".implementation.", activeChain);

uint256 expectedChainId = vm.parseJsonUint(config, string.concat(prefix, ".chainId"));
if (block.chainid != expectedChainId) revert WrongChain(activeChain, expectedChainId, block.chainid);
address gateway = vm.parseJsonAddress(config, string.concat(prefix, ".gateway"));
address gasService = vm.parseJsonAddress(config, string.concat(prefix, ".gasService"));
if (gateway.code.length == 0) revert NoCode(activeChain, gateway);
if (gasService.code.length == 0) revert NoCode(activeChain, gasService);

address expected = getExpectedCreate2Address(
0, type(AxelarOracle).creationCode, abi.encode(initialOwner, gateway, gasService)
);
if (expected.code.length != 0) {
console.log("%s: AxelarOracle already deployed at %s", activeChain, expected);
return AxelarOracle(expected);
}
oracle = new AxelarOracle{ salt: 0 }(initialOwner, gateway, gasService);
console.log("%s: AxelarOracle deployed at %s", activeChain, address(oracle));
}
}
26 changes: 26 additions & 0 deletions script/ccip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"implementation": {
"ethereum": { "chainId": 1, "router": "0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D" },
"base": { "chainId": 8453, "router": "0x881e3A65B4d4a04dD529061dd0071cf975F58bCD" },
"optimism": { "chainId": 10, "router": "0x3206695CaE29952f4b0c22a169725a865bc8Ce0f" },
"arbitrum": { "chainId": 42161, "router": "0x141fa059441E0ca23ce184B6A78bafD2A517DdE8" },
"polygon": { "chainId": 137, "router": "0x849c5ED5a80F5B408Dd4969b78c2C8fdf0565Bfe" },
"bsc": { "chainId": 56, "router": "0x34B03Cb9086d7D758AC55af71584F81A598759FE" },
"katana": { "chainId": 747474, "router": "0x7c19b79D2a054114Ab36ad758A36e92376e267DA" },
"robinhood": { "chainId": 4663, "router": "0x06fC836cf9839B1cd891C440A0a45242DA6Ae1c9" },
"arc": { "chainId": 5042, "router": "0xB79791184973589c38e114D43Eb8E4588C283A18" },
"tempo": { "chainId": 4217, "router": "0xa132F089492CcE5f1D79483a9e4552f37266ed01" },
"pharos": { "chainId": 1672, "router": "0x4e52dD94e9BCfeFE3C78153bDfB0AB1d30687297" },
"plasma": { "chainId": 9745, "router": "0xcDca5D374e46A6DDDab50bD2D9acB8c796eC35C3" },
"unichain": { "chainId": 130, "router": "0x68891f5F96695ECd7dEdBE2289D1b73426ae7864" },
"avalanche": { "chainId": 43114, "router": "0xF4c7E640EdA248ef95972845a62bdC74237805dB" },
"monad": { "chainId": 143, "router": "0x33566fE5976AAa420F3d5C64996641Fc3858CaDB" },
"gnosis": { "chainId": 100, "router": "0x4aAD6071085df840abD9Baf1697d5D5992bDadce" },
"stable": { "chainId": 988, "router": "0xECFF67559c0583027A5fbd85136E33bC4D66eeA0" },
"celo": { "chainId": 42220, "router": "0xfB48f15480926A4ADf9116Dca468bDd2EE6C5F62" },
"ink": { "chainId": 57073, "router": "0xca7c90A52B44E301AC01Cb5EB99b2fD99339433A" },
"worldchain": { "chainId": 480, "router": "0x5fd9E4986187c56826A3064954Cfa2Cf250cfA0f" },
"hyperevm": { "chainId": 999, "router": "0x13b3332b66389B1467CA6eBd6fa79775CCeF65ec" },
"mantle": { "chainId": 5000, "router": "0x670052635a9850bb45882Cb2eCcF66bCff0F41B7" }
}
}
40 changes: 40 additions & 0 deletions script/ccip.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity ^0.8.26;

import { ChainlinkCCIPOracle } from "OIF/src/integrations/oracles/chainlink/ChainlinkCCIPOracle.sol";
import { console } from "forge-std/console.sol";

import { multichain } from "./multichain.s.sol";

/// @notice Deploys ChainlinkCCIPOracle with CREATE2 salt 0 on every listed chain from `script/ccip.json`.
/// Sets no chain maps: mainnet oracles are owned by intents-oracle-owner, which sets every map.
/// Re-running is safe: chains where the oracle already exists are skipped.
contract deployCCIP is multichain {
error WrongChain(string chain, uint256 expected, uint256 actual);
error NoCode(string chain, address target);

string private constant CCIP_CONFIG = "/script/ccip.json";

function run(
string[] calldata chains,
address initialOwner
) public iter_chains(chains) broadcast returns (ChainlinkCCIPOracle oracle) {
string memory activeChain = getChain();
string memory config = vm.readFile(string.concat(vm.projectRoot(), CCIP_CONFIG));
string memory prefix = string.concat(".implementation.", activeChain);

uint256 expectedChainId = vm.parseJsonUint(config, string.concat(prefix, ".chainId"));
if (block.chainid != expectedChainId) revert WrongChain(activeChain, expectedChainId, block.chainid);
address router = vm.parseJsonAddress(config, string.concat(prefix, ".router"));
if (router.code.length == 0) revert NoCode(activeChain, router);

address expected =
getExpectedCreate2Address(0, type(ChainlinkCCIPOracle).creationCode, abi.encode(initialOwner, router));
if (expected.code.length != 0) {
console.log("%s: ChainlinkCCIPOracle already deployed at %s", activeChain, expected);
return ChainlinkCCIPOracle(expected);
}
oracle = new ChainlinkCCIPOracle{ salt: 0 }(initialOwner, router);
console.log("%s: ChainlinkCCIPOracle deployed at %s", activeChain, address(oracle));
}
}
Loading