diff --git a/package.json b/package.json index 41c526c..bbab2da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "l1-lottery-contracts", - "version": "0.7.25", + "version": "0.7.32", "description": "", "author": "", "license": "Apache-2.0", diff --git a/random_request_cid b/random_request_cid deleted file mode 100644 index c13f9ac..0000000 --- a/random_request_cid +++ /dev/null @@ -1 +0,0 @@ -bafkreicnannsz4gqqk3ccfwfd3z2hfzonr63z3hgsplefgrmz37psay23y \ No newline at end of file diff --git a/random_request_cid.js b/random_request_cid.js new file mode 100644 index 0000000..aa706a2 --- /dev/null +++ b/random_request_cid.js @@ -0,0 +1 @@ +export const cidBuffer = 'bafkreicnannsz4gqqk3ccfwfd3z2hfzonr63z3hgsplefgrmz37psay23y'; \ No newline at end of file diff --git a/scripts/utils.ts b/scripts/utils.ts index 16668e4..0f87228 100644 --- a/scripts/utils.ts +++ b/scripts/utils.ts @@ -1,7 +1,6 @@ import dotenv from 'dotenv'; dotenv.config(); import { Cache, Field, Mina, PrivateKey, PublicKey } from 'o1js'; -import * as fs from 'fs'; import { LotteryAction, TicketReduceProgram, @@ -16,6 +15,7 @@ import { ZkOnCoordinatorAddress } from '../src/constants.js'; import { RandomManagerManager } from '../src/StateManager/RandomManagerManager.js'; import { FactoryManager } from '../src/StateManager/FactoryStateManager.js'; import { PlotteryFactory } from '../src/Factory.js'; +import { cidBuffer } from '../random_request_cid.js'; export const configDefaultInstance = (): { transactionFee: number } => { const transactionFee = 100_000_000; @@ -198,7 +198,5 @@ export const getIPFSCID = (): { hashPart1: Field; hashPart2: Field } => { return { hashPart1, hashPart2 }; } - let cidBuffer = fs.readFileSync('./random_request_cid'); - return segmentHash(cidBuffer.toString()); }; diff --git a/src/util.ts b/src/util.ts index 1994074..1b9fc70 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1,4 +1,4 @@ -import * as fs from 'fs'; +// import * as fs from 'fs'; import { Field, @@ -15,6 +15,7 @@ import { import { MerkleMap20 } from './Structs/CustomMerkleMap.js'; // import { PackedUInt32Factory } from 'o1js-pack'; import { StringCircuitValue } from 'zkon-zkapp'; +import { cidBuffer } from '../random_request_cid.js'; const MAX_BITS_PER_FIELD = 254n; const L = 7; // 7 32-bit uints fit in one Field @@ -197,7 +198,5 @@ export const getIPFSCID = (): { hashPart1: Field; hashPart2: Field } => { return { hashPart1, hashPart2 }; } - let cidBuffer = fs.readFileSync('./random_request_cid'); - return segmentHash(cidBuffer.toString()); };