Skip to content

Commit 87d2a70

Browse files
committed
chore: artifacts updated, BlockhashRNG removed, scripts updated
1 parent 697dac8 commit 87d2a70

File tree

9 files changed

+8811
-9982
lines changed

9 files changed

+8811
-9982
lines changed

contracts/deployments/arbitrumSepoliaDevnet.ts

Lines changed: 5840 additions & 6240 deletions
Large diffs are not rendered by default.

contracts/deployments/contractsEthers.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
policyRegistryConfig as devnetPolicyRegistryConfig,
1313
transactionBatcherConfig as devnetBatcherConfig,
1414
chainlinkRngConfig as devnetChainlinkRngConfig,
15-
blockHashRngConfig as devnetBlockHashRngConfig,
15+
rngWithFallbackConfig as devnetRngWithFallbackConfig,
1616
pnkConfig as devnetPnkConfig,
1717
klerosCoreSnapshotProxyConfig as devnetSnapshotProxyConfig,
1818
klerosCoreUniversityConfig as devnetCoreUniversityConfig,
@@ -34,7 +34,6 @@ import {
3434
policyRegistryConfig as testnetPolicyRegistryConfig,
3535
transactionBatcherConfig as testnetBatcherConfig,
3636
chainlinkRngConfig as testnetChainlinkRngConfig,
37-
blockHashRngConfig as testnetBlockHashRngConfig,
3837
pnkConfig as testnetPnkConfig,
3938
klerosCoreSnapshotProxyConfig as testnetSnapshotProxyConfig,
4039
} from "./testnet.viem";
@@ -52,7 +51,6 @@ import {
5251
transactionBatcherConfig as mainnetBatcherConfig,
5352
chainlinkRngConfig as mainnetChainlinkRngConfig,
5453
randomizerRngConfig as mainnetRandomizerRngConfig,
55-
blockHashRngConfig as mainnetBlockHashRngConfig,
5654
pnkConfig as mainnetPnkConfig,
5755
klerosCoreSnapshotProxyConfig as mainnetSnapshotProxyConfig,
5856
} from "./mainnet.viem";
@@ -83,8 +81,8 @@ import {
8381
ChainlinkRNG__factory,
8482
RandomizerRNG,
8583
RandomizerRNG__factory,
86-
BlockHashRNG,
87-
BlockHashRNG__factory,
84+
RNGWithFallback,
85+
RNGWithFallback__factory,
8886
PNK,
8987
PNK__factory,
9088
KlerosCoreSnapshotProxy,
@@ -108,7 +106,7 @@ type CommonFactoriesConfigs = {
108106
batcherConfig: ContractConfig;
109107
chainlinkRngConfig?: ContractConfig;
110108
randomizerRngConfig?: ContractConfig;
111-
blockHashRngConfig: ContractConfig;
109+
rngWithFallbackConfig?: ContractConfig;
112110
pnkConfig: ContractConfig;
113111
snapshotProxyConfig: ContractConfig;
114112
};
@@ -125,7 +123,7 @@ type CommonFactories = {
125123
transactionBatcher: TransactionBatcher;
126124
chainlinkRng: ChainlinkRNG | null;
127125
randomizerRng: RandomizerRNG | null;
128-
blockHashRng: BlockHashRNG;
126+
rngWithFallback: RNGWithFallback | null;
129127
pnk: PNK;
130128
klerosCoreSnapshotProxy: KlerosCoreSnapshotProxy;
131129
};
@@ -157,7 +155,9 @@ function getCommonFactories(
157155
randomizerRng: configs.randomizerRngConfig
158156
? RandomizerRNG__factory.connect(getAddress(configs.randomizerRngConfig, chainId), provider)
159157
: null,
160-
blockHashRng: BlockHashRNG__factory.connect(getAddress(configs.blockHashRngConfig, chainId), provider),
158+
rngWithFallback: configs.rngWithFallbackConfig
159+
? RNGWithFallback__factory.connect(getAddress(configs.rngWithFallbackConfig, chainId), provider)
160+
: null,
161161
pnk: PNK__factory.connect(getAddress(configs.pnkConfig, chainId), provider),
162162
klerosCoreSnapshotProxy: KlerosCoreSnapshotProxy__factory.connect(
163163
getAddress(configs.snapshotProxyConfig, chainId),
@@ -188,7 +188,7 @@ export const getContracts = async (provider: ethers.Provider, deployment: Deploy
188188
policyRegistryConfig: devnetPolicyRegistryConfig,
189189
batcherConfig: devnetBatcherConfig,
190190
chainlinkRngConfig: devnetChainlinkRngConfig,
191-
blockHashRngConfig: devnetBlockHashRngConfig,
191+
rngWithFallbackConfig: devnetRngWithFallbackConfig,
192192
pnkConfig: devnetPnkConfig,
193193
snapshotProxyConfig: devnetSnapshotProxyConfig,
194194
},
@@ -212,7 +212,6 @@ export const getContracts = async (provider: ethers.Provider, deployment: Deploy
212212
policyRegistryConfig: devnetPolicyRegistryConfig,
213213
batcherConfig: devnetBatcherConfig,
214214
chainlinkRngConfig: devnetChainlinkRngConfig,
215-
blockHashRngConfig: devnetBlockHashRngConfig,
216215
pnkConfig: devnetPnkConfig,
217216
snapshotProxyConfig: devnetSnapshotProxyConfig,
218217
},
@@ -236,7 +235,6 @@ export const getContracts = async (provider: ethers.Provider, deployment: Deploy
236235
policyRegistryConfig: testnetPolicyRegistryConfig,
237236
batcherConfig: testnetBatcherConfig,
238237
chainlinkRngConfig: testnetChainlinkRngConfig,
239-
blockHashRngConfig: testnetBlockHashRngConfig,
240238
pnkConfig: testnetPnkConfig,
241239
snapshotProxyConfig: testnetSnapshotProxyConfig,
242240
},
@@ -260,7 +258,6 @@ export const getContracts = async (provider: ethers.Provider, deployment: Deploy
260258
batcherConfig: mainnetBatcherConfig,
261259
chainlinkRngConfig: mainnetChainlinkRngConfig,
262260
randomizerRngConfig: mainnetRandomizerRngConfig,
263-
blockHashRngConfig: mainnetBlockHashRngConfig,
264261
pnkConfig: mainnetPnkConfig,
265262
snapshotProxyConfig: mainnetSnapshotProxyConfig,
266263
},

contracts/deployments/contractsViem.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
policyRegistryConfig as devnetPolicyRegistryConfig,
1414
transactionBatcherConfig as devnetBatcherConfig,
1515
chainlinkRngConfig as devnetChainlinkRngConfig,
16-
blockHashRngConfig as devnetBlockHashRngConfig,
16+
rngWithFallbackConfig as devnetRngWithFallbackConfig,
1717
pnkConfig as devnetPnkConfig,
1818
klerosCoreSnapshotProxyConfig as devnetSnapshotProxyConfig,
1919
klerosCoreUniversityConfig as devnetCoreUniversityConfig,
@@ -35,7 +35,6 @@ import {
3535
policyRegistryConfig as testnetPolicyRegistryConfig,
3636
transactionBatcherConfig as testnetBatcherConfig,
3737
chainlinkRngConfig as testnetChainlinkRngConfig,
38-
blockHashRngConfig as testnetBlockHashRngConfig,
3938
pnkConfig as testnetPnkConfig,
4039
klerosCoreSnapshotProxyConfig as testnetSnapshotProxyConfig,
4140
} from "./testnet.viem";
@@ -53,7 +52,6 @@ import {
5352
transactionBatcherConfig as mainnetBatcherConfig,
5453
chainlinkRngConfig as mainnetChainlinkRngConfig,
5554
randomizerRngConfig as mainnetRandomizerRngConfig,
56-
blockHashRngConfig as mainnetBlockHashRngConfig,
5755
pnkConfig as mainnetPnkConfig,
5856
klerosCoreSnapshotProxyConfig as mainnetSnapshotProxyConfig,
5957
} from "./mainnet.viem";
@@ -84,7 +82,7 @@ type ContractInstances = {
8482
transactionBatcher: ContractInstance;
8583
chainlinkRng?: ContractInstance;
8684
randomizerRng?: ContractInstance;
87-
blockHashRng: ContractInstance;
85+
rngWithFallback?: ContractInstance;
8886
pnk: ContractInstance;
8987
klerosCoreSnapshotProxy: ContractInstance;
9088
};
@@ -106,7 +104,7 @@ function getCommonConfigs({
106104
evidence: ContractConfig;
107105
policyRegistry: ContractConfig;
108106
transactionBatcher: ContractConfig;
109-
blockHashRng: ContractConfig;
107+
rngWithFallback?: ContractConfig;
110108
pnk: ContractConfig;
111109
klerosCoreSnapshotProxy: ContractConfig;
112110
chainlinkRng?: ContractConfig;
@@ -122,7 +120,6 @@ function getCommonConfigs({
122120
evidence: getContractConfig({ config: configs.evidence, chainId }),
123121
policyRegistry: getContractConfig({ config: configs.policyRegistry, chainId }),
124122
transactionBatcher: getContractConfig({ config: configs.transactionBatcher, chainId }),
125-
blockHashRng: getContractConfig({ config: configs.blockHashRng, chainId }),
126123
pnk: getContractConfig({ config: configs.pnk, chainId }),
127124
klerosCoreSnapshotProxy: getContractConfig({ config: configs.klerosCoreSnapshotProxy, chainId }),
128125
};
@@ -137,6 +134,8 @@ function getCommonConfigs({
137134

138135
if (configs.chainlinkRng) base.chainlinkRng = getContractConfig({ config: configs.chainlinkRng, chainId });
139136

137+
if (configs.rngWithFallback) base.rngWithFallback = getContractConfig({ config: configs.rngWithFallback, chainId });
138+
140139
if (configs.randomizerRng) base.randomizerRng = getContractConfig({ config: configs.randomizerRng, chainId });
141140

142141
return base;
@@ -160,7 +159,7 @@ export const getConfigs = ({ deployment }: { deployment: DeploymentName }): Cont
160159
evidence: devnetEvidenceConfig,
161160
policyRegistry: devnetPolicyRegistryConfig,
162161
transactionBatcher: devnetBatcherConfig,
163-
blockHashRng: devnetBlockHashRngConfig,
162+
rngWithFallback: devnetRngWithFallbackConfig,
164163
pnk: devnetPnkConfig,
165164
klerosCoreSnapshotProxy: devnetSnapshotProxyConfig,
166165
chainlinkRng: devnetChainlinkRngConfig,
@@ -177,7 +176,6 @@ export const getConfigs = ({ deployment }: { deployment: DeploymentName }): Cont
177176
evidence: getContractConfig({ config: devnetEvidenceConfig, chainId }), // Not arbitrator specific
178177
policyRegistry: getContractConfig({ config: devnetPolicyRegistryConfig, chainId }), // Not arbitrator specific
179178
transactionBatcher: getContractConfig({ config: devnetBatcherConfig, chainId }), // Not arbitrator specific
180-
blockHashRng: getContractConfig({ config: devnetBlockHashRngConfig, chainId }), // Not used in university
181179
pnk: getContractConfig({ config: devnetPnkConfig, chainId }), // Not arbitrator specific
182180
klerosCoreSnapshotProxy: getContractConfig({ config: devnetSnapshotProxyConfig, chainId }), // Not used in university
183181
};
@@ -197,7 +195,6 @@ export const getConfigs = ({ deployment }: { deployment: DeploymentName }): Cont
197195
evidence: testnetEvidenceConfig,
198196
policyRegistry: testnetPolicyRegistryConfig,
199197
transactionBatcher: testnetBatcherConfig,
200-
blockHashRng: testnetBlockHashRngConfig,
201198
pnk: testnetPnkConfig,
202199
klerosCoreSnapshotProxy: testnetSnapshotProxyConfig,
203200
chainlinkRng: testnetChainlinkRngConfig,
@@ -219,7 +216,6 @@ export const getConfigs = ({ deployment }: { deployment: DeploymentName }): Cont
219216
evidence: mainnetEvidenceConfig,
220217
policyRegistry: mainnetPolicyRegistryConfig,
221218
transactionBatcher: mainnetBatcherConfig,
222-
blockHashRng: mainnetBlockHashRngConfig,
223219
pnk: mainnetPnkConfig,
224220
klerosCoreSnapshotProxy: mainnetSnapshotProxyConfig,
225221
chainlinkRng: mainnetChainlinkRngConfig,
@@ -310,10 +306,12 @@ export const getContracts = ({
310306
...clientConfig,
311307
})
312308
: undefined;
313-
const blockHashRng = getContract({
314-
...contractConfigs.blockHashRng,
315-
...clientConfig,
316-
});
309+
const rngWithFallback = contractConfigs.rngWithFallback
310+
? getContract({
311+
...contractConfigs.rngWithFallback,
312+
...clientConfig,
313+
})
314+
: undefined;
317315
const pnk = getContract({
318316
...contractConfigs.pnk,
319317
...clientConfig,
@@ -336,7 +334,7 @@ export const getContracts = ({
336334
transactionBatcher,
337335
chainlinkRng,
338336
randomizerRng,
339-
blockHashRng,
337+
rngWithFallback,
340338
pnk,
341339
klerosCoreSnapshotProxy,
342340
};

0 commit comments

Comments
 (0)