This repository was archived by the owner on Jun 19, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathAxiomV2Addresses.sol
More file actions
134 lines (119 loc) · 6.27 KB
/
Copy pathAxiomV2Addresses.sol
File metadata and controls
134 lines (119 loc) · 6.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { MAINNET_CHAIN_ID, SEPOLIA_CHAIN_ID } from "../libraries/configuration/AxiomV2Configuration.sol";
/// @title AxiomV2Addresses
/// @notice AxiomV2Addresses is a library that contains the addresses of deployed Axiom V2 contracts
library AxiomV2Addresses {
address public constant AXIOM_V2_CORE_ADDRESS = 0x69963768F8407dE501029680dE46945F838Fc98B;
address public constant AXIOM_V2_QUERY_ADDRESS = 0x83c8c0B395850bA55c830451Cfaca4F2A667a983;
address public constant SEPOLIA_AXIOM_V2_CORE_MOCK_ADDRESS = 0x69963768F8407dE501029680dE46945F838Fc98B;
address public constant SEPOLIA_AXIOM_V2_QUERY_MOCK_ADDRESS = 0x83c8c0B395850bA55c830451Cfaca4F2A667a983;
uint256 public constant AXIOM_V2_CORE_DEPLOY_BLOCK = 18_993_287;
uint256 public constant AXIOM_V2_QUERY_DEPLOY_BLOCK = 19_027_522;
uint256 public constant SEPOLIA_AXIOM_V2_CORE_MOCK_DEPLOY_BLOCK = 5_095_060;
uint256 public constant SEPOLIA_AXIOM_V2_QUERY_MOCK_DEPLOY_BLOCK = 5_103_063;
/// @dev Error returned if the corresponding Axiom V2 contract does not exist for the requested chainId
error ContractDoesNotExistForChainId();
/// @dev Error returned if the corresponding Axiom V2 contract has not yet been deployed
error ContractNotYetDeployed();
/// @notice Returns the address of the AxiomV2Query contract on the chain corresponding to `chainId`
/// @param chainId The chainId of the AxiomV2Query contract
/// @return addr The address of the AxiomV2Query contract
function axiomV2QueryAddress(uint64 chainId) public pure returns (address addr) {
if (chainId == MAINNET_CHAIN_ID) {
addr = AXIOM_V2_QUERY_ADDRESS;
} else {
revert ContractDoesNotExistForChainId();
}
if (addr == address(0)) {
revert ContractNotYetDeployed();
}
}
/// @notice Returns the address of the AxiomV2QueryMock contract on the chain corresponding to `chainId`
/// @param chainId The chainId of the AxiomV2QueryMock contract
/// @return addr The address of the AxiomV2QueryMock contract
function axiomV2QueryMockAddress(uint64 chainId) public pure returns (address addr) {
if (chainId == MAINNET_CHAIN_ID) {
revert ContractDoesNotExistForChainId();
} else if (chainId == SEPOLIA_CHAIN_ID) {
addr = SEPOLIA_AXIOM_V2_QUERY_MOCK_ADDRESS;
} else {
revert ContractDoesNotExistForChainId();
}
if (addr == address(0)) {
revert ContractNotYetDeployed();
}
}
/// @notice Returns the address of the AxiomV2Core contract on the chain corresponding to `chainId`
/// @param chainId The chainId of the AxiomV2Core contract
/// @return addr The address of the AxiomV2Core contract
function axiomV2CoreAddress(uint64 chainId) public pure returns (address addr) {
if (chainId == MAINNET_CHAIN_ID) {
addr = AXIOM_V2_CORE_ADDRESS;
} else {
revert ContractDoesNotExistForChainId();
}
if (addr == address(0)) {
revert ContractNotYetDeployed();
}
}
/// @notice Returns the address of the AxiomV2CoreMock contract on the chain corresponding to `chainId`
/// @param chainId The chainId of the AxiomV2CoreMock contract
/// @return addr The address of the AxiomV2CoreMock contract
function axiomV2CoreMockAddress(uint64 chainId) public pure returns (address addr) {
if (chainId == MAINNET_CHAIN_ID) {
revert ContractDoesNotExistForChainId();
} else if (chainId == SEPOLIA_CHAIN_ID) {
addr = SEPOLIA_AXIOM_V2_CORE_MOCK_ADDRESS;
} else {
revert ContractDoesNotExistForChainId();
}
if (addr == address(0)) {
revert ContractNotYetDeployed();
}
}
/// @notice Returns the block number at which the AxiomV2Query contract was deployed on the chain corresponding to `chainId`
/// @param chainId The chainId of the AxiomV2Query contract
/// @return blockNumber The block number at which the AxiomV2Query contract was deployed
function axiomV2QueryDeployBlock(uint64 chainId) public pure returns (uint256 blockNumber) {
if (chainId == MAINNET_CHAIN_ID) {
blockNumber = AXIOM_V2_QUERY_DEPLOY_BLOCK;
} else {
revert ContractDoesNotExistForChainId();
}
}
/// @notice Returns the block number at which the AxiomV2QueryMock contract was deployed on the chain corresponding to `chainId`
/// @param chainId The chainId of the AxiomV2QueryMock contract
/// @return blockNumber The block number at which the AxiomV2QueryMock contract was deployed
function axiomV2QueryMockDeployBlock(uint64 chainId) public pure returns (uint256 blockNumber) {
if (chainId == MAINNET_CHAIN_ID) {
revert ContractDoesNotExistForChainId();
} else if (chainId == SEPOLIA_CHAIN_ID) {
blockNumber = SEPOLIA_AXIOM_V2_QUERY_MOCK_DEPLOY_BLOCK;
} else {
revert ContractDoesNotExistForChainId();
}
}
/// @notice Returns the block number at which the AxiomV2Core contract was deployed on the chain corresponding to `chainId`
/// @param chainId The chainId of the AxiomV2Core contract
/// @return blockNumber The block number at which the AxiomV2Core contract was deployed
function axiomV2CoreDeployBlock(uint64 chainId) public pure returns (uint256 blockNumber) {
if (chainId == MAINNET_CHAIN_ID) {
blockNumber = AXIOM_V2_CORE_DEPLOY_BLOCK;
} else {
revert ContractDoesNotExistForChainId();
}
}
/// @notice Returns the block number at which the AxiomV2CoreMock contract was deployed on the chain corresponding to `chainId`
/// @param chainId The chainId of the AxiomV2CoreMock contract
/// @return blockNumber The block number at which the AxiomV2CoreMock contract was deployed
function axiomV2CoreMockDeployBlock(uint64 chainId) public pure returns (uint256 blockNumber) {
if (chainId == MAINNET_CHAIN_ID) {
revert ContractDoesNotExistForChainId();
} else if (chainId == SEPOLIA_CHAIN_ID) {
blockNumber = SEPOLIA_AXIOM_V2_CORE_MOCK_DEPLOY_BLOCK;
} else {
revert ContractDoesNotExistForChainId();
}
}
}