|
1 | 1 | # ICoreRegistry |
2 | | -[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/main/zevm/interfaces/ICoreRegistry.sol) |
| 2 | +[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/main/contracts/zevm/interfaces/ICoreRegistry.sol) |
3 | 3 |
|
4 | 4 | **Inherits:** |
5 | | -[ICoreRegistryErrors](/contracts/zevm/interfaces/ICoreRegistry.sol/interface.ICoreRegistryErrors.md), [ICoreRegistryEvents](/contracts/zevm/interfaces/ICoreRegistry.sol/interface.ICoreRegistryEvents.md) |
6 | | - |
7 | | -Primary interface for the CoreRegistry contract, the central registry for ZetaChain ecosystem. |
| 5 | +[IBaseRegistry](/contracts/helpers/interfaces/IBaseRegistry.sol/interface.IBaseRegistry.md) |
8 | 6 |
|
9 | 7 |
|
10 | 8 | ## Functions |
11 | | -### changeChainStatus |
12 | | - |
13 | | -Changes status of the chain to activated/deactivated. |
14 | | - |
15 | | - |
16 | | -```solidity |
17 | | -function changeChainStatus(uint256 chainId, address gasZRC20, bytes calldata registry, bool activation) external; |
18 | | -``` |
19 | | -**Parameters** |
20 | | - |
21 | | -|Name|Type|Description| |
22 | | -|----|----|-----------| |
23 | | -|`chainId`|`uint256`|The ID of the chain to activate.| |
24 | | -|`gasZRC20`|`address`|The address of the ZRC20 token that represents gas token for the chain.| |
25 | | -|`registry`|`bytes`|| |
26 | | -|`activation`|`bool`|Whether activate or deactivate a chain| |
27 | | - |
28 | | - |
29 | | -### updateChainMetadata |
30 | | - |
31 | | -Updates chain metadata. |
32 | | - |
33 | | - |
34 | | -```solidity |
35 | | -function updateChainMetadata(uint256 chainId, string calldata key, bytes calldata value) external; |
36 | | -``` |
37 | | -**Parameters** |
38 | | - |
39 | | -|Name|Type|Description| |
40 | | -|----|----|-----------| |
41 | | -|`chainId`|`uint256`|The ID of the chain.| |
42 | | -|`key`|`string`|The metadata key to update.| |
43 | | -|`value`|`bytes`|The new value for the metadata.| |
44 | | - |
45 | | - |
46 | | -### registerContract |
47 | | - |
48 | | -Registers a new contract address for a specific chain. |
49 | | - |
50 | | - |
51 | | -```solidity |
52 | | -function registerContract(uint256 chainId, string calldata contractType, bytes calldata addressBytes) external; |
53 | | -``` |
54 | | -**Parameters** |
55 | | - |
56 | | -|Name|Type|Description| |
57 | | -|----|----|-----------| |
58 | | -|`chainId`|`uint256`|The ID of the chain where the contract is deployed.| |
59 | | -|`contractType`|`string`|The type of the contract (e.g., "connector", "gateway").| |
60 | | -|`addressBytes`|`bytes`|The bytes representation of the non-EVM address.| |
61 | | - |
62 | | - |
63 | | -### updateContractConfiguration |
64 | | - |
65 | | -Updates contract configuration. |
66 | | - |
67 | | - |
68 | | -```solidity |
69 | | -function updateContractConfiguration( |
70 | | - uint256 chainId, |
71 | | - string calldata contractType, |
72 | | - string calldata key, |
73 | | - bytes calldata value |
74 | | -) |
75 | | - external; |
76 | | -``` |
77 | | -**Parameters** |
78 | | - |
79 | | -|Name|Type|Description| |
80 | | -|----|----|-----------| |
81 | | -|`chainId`|`uint256`|The ID of the chain where the contract is deployed.| |
82 | | -|`contractType`|`string`|The type of the contract.| |
83 | | -|`key`|`string`|The configuration key to update.| |
84 | | -|`value`|`bytes`|The new value for the configuration.| |
85 | | - |
86 | | - |
87 | | -### setContractActive |
88 | | - |
89 | | - |
90 | | -```solidity |
91 | | -function setContractActive(uint256 chainId, string calldata contractType, bool active) external; |
92 | | -``` |
93 | | - |
94 | | -### registerZRC20Token |
95 | | - |
96 | | -Registers a new ZRC20 token in the registry. |
| 9 | +### gatewayZEVM |
97 | 10 |
|
98 | 11 |
|
99 | 12 | ```solidity |
100 | | -function registerZRC20Token( |
101 | | - address address_, |
102 | | - string calldata symbol, |
103 | | - uint256 originChainId, |
104 | | - bytes calldata originAddress, |
105 | | - string calldata coinType, |
106 | | - uint8 decimals |
107 | | -) |
108 | | - external; |
| 13 | +function gatewayZEVM() external returns (address); |
109 | 14 | ``` |
110 | | -**Parameters** |
111 | | - |
112 | | -|Name|Type|Description| |
113 | | -|----|----|-----------| |
114 | | -|`address_`|`address`|The address of the ZRC20 token on ZetaChain.| |
115 | | -|`symbol`|`string`|The symbol of the token.| |
116 | | -|`originChainId`|`uint256`|The ID of the foreign chain where the original asset exists.| |
117 | | -|`originAddress`|`bytes`|The address or identifier of the asset on its native chain.| |
118 | | -|`coinType`|`string`|| |
119 | | -|`decimals`|`uint8`|| |
120 | | - |
121 | | - |
122 | | -### setZRC20TokenActive |
123 | | - |
124 | | -Updates ZRC20 token information. |
125 | | - |
126 | | - |
127 | | -```solidity |
128 | | -function setZRC20TokenActive(address address_, bool active) external; |
129 | | -``` |
130 | | -**Parameters** |
131 | | - |
132 | | -|Name|Type|Description| |
133 | | -|----|----|-----------| |
134 | | -|`address_`|`address`|The address of the ZRC20 token.| |
135 | | -|`active`|`bool`|Whether the token should be active.| |
136 | | - |
137 | | - |
138 | | -### getChainMetadata |
139 | | - |
140 | | -Gets chain-specific metadata. |
141 | | - |
142 | | - |
143 | | -```solidity |
144 | | -function getChainMetadata(uint256 chainId, string calldata key) external view returns (bytes memory); |
145 | | -``` |
146 | | -**Parameters** |
147 | | - |
148 | | -|Name|Type|Description| |
149 | | -|----|----|-----------| |
150 | | -|`chainId`|`uint256`|The ID of the chain.| |
151 | | -|`key`|`string`|The metadata key to retrieve.| |
152 | | - |
153 | | -**Returns** |
154 | | - |
155 | | -|Name|Type|Description| |
156 | | -|----|----|-----------| |
157 | | -|`<none>`|`bytes`|The value of the requested metadata.| |
158 | | - |
159 | | - |
160 | | -### getContractInfo |
161 | | - |
162 | | -Gets information about a specific contract. |
163 | | - |
164 | | - |
165 | | -```solidity |
166 | | -function getContractInfo( |
167 | | - uint256 chainId, |
168 | | - string calldata contractType |
169 | | -) |
170 | | - external |
171 | | - view |
172 | | - returns (bool active, bytes memory addressBytes); |
173 | | -``` |
174 | | -**Parameters** |
175 | | - |
176 | | -|Name|Type|Description| |
177 | | -|----|----|-----------| |
178 | | -|`chainId`|`uint256`|The ID of the chain where the contract is deployed.| |
179 | | -|`contractType`|`string`|The type of the contract.| |
180 | | - |
181 | | -**Returns** |
182 | | - |
183 | | -|Name|Type|Description| |
184 | | -|----|----|-----------| |
185 | | -|`active`|`bool`|Whether the contract is active.| |
186 | | -|`addressBytes`|`bytes`|The address of the contract.| |
187 | | - |
188 | | - |
189 | | -### getContractConfiguration |
190 | | - |
191 | | -Gets contract-specific configuration. |
192 | | - |
193 | | - |
194 | | -```solidity |
195 | | -function getContractConfiguration( |
196 | | - uint256 chainId, |
197 | | - string calldata contractType, |
198 | | - string calldata key |
199 | | -) |
200 | | - external |
201 | | - view |
202 | | - returns (bytes memory); |
203 | | -``` |
204 | | -**Parameters** |
205 | | - |
206 | | -|Name|Type|Description| |
207 | | -|----|----|-----------| |
208 | | -|`chainId`|`uint256`|The ID of the chain where the contract is deployed.| |
209 | | -|`contractType`|`string`|The type of the contract.| |
210 | | -|`key`|`string`|The configuration key to retrieve.| |
211 | | - |
212 | | -**Returns** |
213 | | - |
214 | | -|Name|Type|Description| |
215 | | -|----|----|-----------| |
216 | | -|`<none>`|`bytes`|The value of the requested configuration.| |
217 | | - |
218 | | - |
219 | | -### getZRC20TokenInfo |
220 | | - |
221 | | -Gets information about a specific ZRC20 token. |
222 | | - |
223 | | - |
224 | | -```solidity |
225 | | -function getZRC20TokenInfo(address address_) |
226 | | - external |
227 | | - view |
228 | | - returns ( |
229 | | - bool active, |
230 | | - string memory symbol, |
231 | | - uint256 originChainId, |
232 | | - bytes memory originAddress, |
233 | | - string memory coinType, |
234 | | - uint8 decimals |
235 | | - ); |
236 | | -``` |
237 | | -**Parameters** |
238 | | - |
239 | | -|Name|Type|Description| |
240 | | -|----|----|-----------| |
241 | | -|`address_`|`address`|The address of the ZRC20 token.| |
242 | | - |
243 | | -**Returns** |
244 | | - |
245 | | -|Name|Type|Description| |
246 | | -|----|----|-----------| |
247 | | -|`active`|`bool`|Whether the token is active.| |
248 | | -|`symbol`|`string`|The symbol of the token| |
249 | | -|`originChainId`|`uint256`|The ID of the foreign chain where the original asset exists.| |
250 | | -|`originAddress`|`bytes`|The address or identifier of the asset on its native chain.| |
251 | | -|`coinType`|`string`|The type of the original coin.| |
252 | | -|`decimals`|`uint8`|The number of decimals the token uses.| |
253 | | - |
254 | | - |
255 | | -### getZRC20AddressByForeignAsset |
256 | | - |
257 | | -Gets the ZRC20 token address for a specific asset on a foreign chain. |
258 | | - |
259 | | - |
260 | | -```solidity |
261 | | -function getZRC20AddressByForeignAsset( |
262 | | - uint256 originChainId, |
263 | | - bytes calldata originAddress |
264 | | -) |
265 | | - external |
266 | | - view |
267 | | - returns (address); |
268 | | -``` |
269 | | -**Parameters** |
270 | | - |
271 | | -|Name|Type|Description| |
272 | | -|----|----|-----------| |
273 | | -|`originChainId`|`uint256`|The ID of the foreign chain.| |
274 | | -|`originAddress`|`bytes`|The address or identifier of the asset on its native chain.| |
275 | | - |
276 | | -**Returns** |
277 | | - |
278 | | -|Name|Type|Description| |
279 | | -|----|----|-----------| |
280 | | -|`<none>`|`address`|The address of the corresponding ZRC20 token on ZetaChain.| |
281 | | - |
282 | | - |
283 | | -### getActiveChains |
284 | | - |
285 | | -Gets all active chains in the registry. |
286 | | - |
287 | | - |
288 | | -```solidity |
289 | | -function getActiveChains() external view returns (uint256[] memory); |
290 | | -``` |
291 | | -**Returns** |
292 | | - |
293 | | -|Name|Type|Description| |
294 | | -|----|----|-----------| |
295 | | -|`<none>`|`uint256[]`|Array of chain IDs for all active chains.| |
296 | | - |
297 | 15 |
|
0 commit comments