Skip to content

Commit 4404065

Browse files
committed
fix: keeper bot
1 parent d0f814f commit 4404065

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

contracts/config/courts.v2.mainnet-neo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"id": 1,
44
"parent": 0,
55
"hiddenVotes": true,
6-
"minStake": "150000000000000000000",
6+
"minStake": "2300000000000000000000",
77
"alpha": "10000",
88
"feeForJuror": "5000000000000000",
99
"jurorsForCourtJump": "511",

contracts/scripts/keeperBot.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ const getContracts = async () => {
6161
default:
6262
throw new Error("Invalid core type, must be one of base, neo");
6363
}
64-
const randomizerRng = (await ethers.getContract("RandomizerRNG")) as RandomizerRNG;
65-
const blockHashRNG = (await ethers.getContract("BlockHashRNG")) as BlockHashRNG;
64+
const randomizerRng = await ethers.getContractOrNull<RandomizerRNG>("RandomizerRNG");
65+
const blockHashRNG = await ethers.getContractOrNull<BlockHashRNG>("BlockHashRNG");
6666
const pnk = (await ethers.getContract("PNK")) as PNK;
6767
return { core, sortition, randomizerRng, blockHashRNG, disputeKitClassic, pnk };
6868
};
@@ -183,7 +183,7 @@ const handleError = (e: any) => {
183183
const isRngReady = async () => {
184184
const { randomizerRng, blockHashRNG, sortition } = await getContracts();
185185
const currentRng = await sortition.rng();
186-
if (currentRng === randomizerRng.target) {
186+
if (currentRng === randomizerRng?.target) {
187187
const requesterID = await randomizerRng.requesterToID(sortition.target);
188188
const n = await randomizerRng.randomNumbers(requesterID);
189189
if (Number(n) === 0) {
@@ -193,7 +193,7 @@ const isRngReady = async () => {
193193
logger.info(`RandomizerRNG is ready: ${n.toString()}`);
194194
return true;
195195
}
196-
} else if (currentRng === blockHashRNG.target) {
196+
} else if (currentRng === blockHashRNG?.target) {
197197
const requestBlock = await sortition.randomNumberRequestBlock();
198198
const lookahead = await sortition.rngLookahead();
199199
const n = await blockHashRNG.receiveRandomness.staticCall(requestBlock + lookahead);

0 commit comments

Comments
 (0)