@thesingularitynetwork/darkswap-sdk-synara 1.0.0-beta1 → 1.0.0-beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/darkswap-sdk-synara.cjs.development.js +65 -497
- package/dist/darkswap-sdk-synara.cjs.development.js.map +1 -1
- package/dist/darkswap-sdk-synara.cjs.production.min.js +1 -1
- package/dist/darkswap-sdk-synara.cjs.production.min.js.map +1 -1
- package/dist/darkswap-sdk-synara.esm.js +65 -497
- package/dist/darkswap-sdk-synara.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"darkswap-sdk-synara.cjs.development.js","sources":["../src/utils/util.ts","../src/entities/error.ts","../src/entities/types.ts","../src/utils/constants.ts","../src/utils/encoders.ts","../src/utils/mimc.ts","../src/proof/noteService.ts","../src/aztec/bigint-buffer/index.ts","../src/aztec/serialize/buffer_reader.ts","../src/aztec/fields/fields.ts","../src/aztec/crypto/serialize.ts","../src/aztec/serialize/types.ts","../src/aztec/crypto/schnorr/signature.ts","../src/aztec/serialize/free_funcs.ts","../src/aztec/serialize/serialize.ts","../src/aztec/crypto/poseidon/index.ts","../src/aztec/serialize/field_reader.ts","../src/aztec/string/index.ts","../src/aztec/fields/point.ts","../src/aztec/crypto/schnorr/index.ts","../src/proof/keyService.ts","../src/services/noteService.ts","../src/config/chain.ts","../src/config/config.ts","../src/types.ts","../src/utils/formatters.ts","../src/utils/proofUtils.ts","../src/proof/baseProofService.ts","../src/proof/basic/depositProof.ts","../src/services/BaseService.ts","../src/services/merkletree.ts","../src/config/contractConfig.ts","../src/utils/gasUtil.ts","../src/services/base/deposit.ts","../src/proof/basic/withdrawProof.ts","../src/services/base/withdraw.ts","../src/proof/basic/joinProof.ts","../src/services/base/join.ts","../src/proof/basic/tripleJoinProof.ts","../src/services/base/tripleJoin.ts","../src/services/feeRatioService.ts","../src/proof/pro/orders/createOrderProof.ts","../src/services/pro/createOrder.ts","../src/proof/pro/orders/cancelOrderProof.ts","../src/services/pro/cancelOrder.ts","../src/proof/pro/orders/swapProof.ts","../src/proof/retail/depositOrderProof.ts","../src/services/pro/proSwap.ts","../src/proof/retail/cancelOrderProof.ts","../src/services/retail/cancelAndWithdrawOrder.ts","../src/services/retail/depositAndCreateOrder.ts","../src/proof/retail/swapProof.ts","../src/services/agent/retailSwap.ts","../src/proof/synara/bridgeOrderProof.ts","../src/config/zkverifyConfig.ts","../src/services/synara/bridgeAndCreateOrder.ts","../src/darkSwap.ts","../src/utils/swapUtils.ts"],"sourcesContent":["import { ethers } from 'ethers';\n\nconst NATIVE_ASSETS = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE';\n\nexport function isNativeAsset(asset: string): boolean {\n return asset.toLowerCase() === NATIVE_ASSETS.toLowerCase();\n}\n\nexport function isAddressEquals(address1: string, address2: string): boolean {\n if (!address1 || !address2) return false;\n return address1.toLowerCase() === address2.toLowerCase();\n}\n\nexport function hexlify32(value: bigint | number): string {\n return ethers.zeroPadValue(ethers.toBeHex(value), 32);\n}\n\nexport function isHexEquals(hex1: string, hex2: string): boolean {\n if (!hex1 || !hex2) return false;\n return hex1.toLowerCase() === hex2.toLowerCase();\n}\n","export class DarkSwapError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'DarkSwapError';\n }\n}\n","export enum NoteOnChainStatus {\n ACTIVE = 'ACTIVE',\n SPENT = 'SPENT',\n LOCKED = 'LOCKED',\n UNKNOWN = 'UNKNOWN'\n}\n","export const P: bigint = BigInt(\"21888242871839275222246405745257275088548364400416034343698204186575808495617\");\n\nexport const MAX_ALLOWANCE = BigInt('115792089237316195423570985008687907853269984665640564039457584007913129639935'); // 2**256 - 1\n","import { AbiCoder, ripemd160 } from \"ethers\";\n\nconst defaultAbiCoder = new AbiCoder();\n\nexport function encodeAddress(address: string): bigint {\n let encoder = defaultAbiCoder;\n let encodedAddress = encoder.encode([\"address\"], [address]);\n let hashedAddress = ripemd160(encodedAddress);\n return BigInt(hashedAddress);\n}","import { P } from './constants';\n\n\nfunction toBits(x: bigint): bigint[] {\n const bits: bigint[] = [];\n while (x > 0n) {\n bits.push(x & 1n);\n x >>= 1n;\n }\n while (bits.length < 32) {\n bits.push(0n);\n }\n return bits;\n}\n\nfunction pow32(x: bigint, exponent: bigint): bigint {\n let r = 1n;\n let b = toBits(exponent);\n\n for (let i = 1; i < 33; i++) {\n r = (r * r) % P;\n r = (b[32 - i] * (r * x) + (1n - b[32 - i]) * r) % P;\n }\n return r;\n}\n\nfunction mimc(x: bigint, k: bigint, constants: bigint[], exp: bigint): bigint {\n // round 0\n let t = (x + k) % P;\n let h = pow32(t, exp) % P;\n // next rounds\n for (let i = 1; i < constants.length; i++) {\n t = (h + k + constants[i]) % P;\n h = pow32(t, exp) % P;\n }\n return (h + k) % P;\n}\n\nexport function mimc_bn254(array: bigint[]): bigint {\n //mimc parameters\n const exponent = 7n;\n //generated from seed \"mimc\" using keccak256\n const constants: bigint[] = [\n 0n,\n 20888961410941983456478427210666206549300505294776164667214940546594746570981n,\n 15265126113435022738560151911929040668591755459209400716467504685752745317193n,\n 8334177627492981984476504167502758309043212251641796197711684499645635709656n,\n 1374324219480165500871639364801692115397519265181803854177629327624133579404n,\n 11442588683664344394633565859260176446561886575962616332903193988751292992472n,\n 2558901189096558760448896669327086721003508630712968559048179091037845349145n,\n 11189978595292752354820141775598510151189959177917284797737745690127318076389n,\n 3262966573163560839685415914157855077211340576201936620532175028036746741754n,\n 17029914891543225301403832095880481731551830725367286980611178737703889171730n,\n 4614037031668406927330683909387957156531244689520944789503628527855167665518n,\n 19647356996769918391113967168615123299113119185942498194367262335168397100658n,\n 5040699236106090655289931820723926657076483236860546282406111821875672148900n,\n 2632385916954580941368956176626336146806721642583847728103570779270161510514n,\n 17691411851977575435597871505860208507285462834710151833948561098560743654671n,\n 11482807709115676646560379017491661435505951727793345550942389701970904563183n,\n 8360838254132998143349158726141014535383109403565779450210746881879715734773n,\n 12663821244032248511491386323242575231591777785787269938928497649288048289525n,\n 3067001377342968891237590775929219083706800062321980129409398033259904188058n,\n 8536471869378957766675292398190944925664113548202769136103887479787957959589n,\n 19825444354178182240559170937204690272111734703605805530888940813160705385792n,\n 16703465144013840124940690347975638755097486902749048533167980887413919317592n,\n 13061236261277650370863439564453267964462486225679643020432589226741411380501n,\n 10864774797625152707517901967943775867717907803542223029967000416969007792571n,\n 10035653564014594269791753415727486340557376923045841607746250017541686319774n,\n 3446968588058668564420958894889124905706353937375068998436129414772610003289n,\n 4653317306466493184743870159523234588955994456998076243468148492375236846006n,\n 8486711143589723036499933521576871883500223198263343024003617825616410932026n,\n 250710584458582618659378487568129931785810765264752039738223488321597070280n,\n 2104159799604932521291371026105311735948154964200596636974609406977292675173n,\n 16313562605837709339799839901240652934758303521543693857533755376563489378839n,\n 6032365105133504724925793806318578936233045029919447519826248813478479197288n,\n 14025118133847866722315446277964222215118620050302054655768867040006542798474n,\n 7400123822125662712777833064081316757896757785777291653271747396958201309118n,\n 1744432620323851751204287974553233986555641872755053103823939564833813704825n,\n 8316378125659383262515151597439205374263247719876250938893842106722210729522n,\n 6739722627047123650704294650168547689199576889424317598327664349670094847386n,\n 21211457866117465531949733809706514799713333930924902519246949506964470524162n,\n 13718112532745211817410303291774369209520657938741992779396229864894885156527n,\n 5264534817993325015357427094323255342713527811596856940387954546330728068658n,\n 18884137497114307927425084003812022333609937761793387700010402412840002189451n,\n 5148596049900083984813839872929010525572543381981952060869301611018636120248n,\n 19799686398774806587970184652860783461860993790013219899147141137827718662674n,\n 19240878651604412704364448729659032944342952609050243268894572835672205984837n,\n 10546185249390392695582524554167530669949955276893453512788278945742408153192n,\n 5507959600969845538113649209272736011390582494851145043668969080335346810411n,\n 18177751737739153338153217698774510185696788019377850245260475034576050820091n,\n 19603444733183990109492724100282114612026332366576932662794133334264283907557n,\n 10548274686824425401349248282213580046351514091431715597441736281987273193140n,\n 1823201861560942974198127384034483127920205835821334101215923769688644479957n,\n 11867589662193422187545516240823411225342068709600734253659804646934346124945n,\n 18718569356736340558616379408444812528964066420519677106145092918482774343613n,\n 10530777752259630125564678480897857853807637120039176813174150229243735996839n,\n 20486583726592018813337145844457018474256372770211860618687961310422228379031n,\n 12690713110714036569415168795200156516217175005650145422920562694422306200486n,\n 17386427286863519095301372413760745749282643730629659997153085139065756667205n,\n 2216432659854733047132347621569505613620980842043977268828076165669557467682n,\n 6309765381643925252238633914530877025934201680691496500372265330505506717193n,\n 20806323192073945401862788605803131761175139076694468214027227878952047793390n,\n 4037040458505567977365391535756875199663510397600316887746139396052445718861n,\n 19948974083684238245321361840704327952464170097132407924861169241740046562673n,\n 845322671528508199439318170916419179535949348988022948153107378280175750024n,\n 16222384601744433420585982239113457177459602187868460608565289920306145389382n,\n 10232118865851112229330353999139005145127746617219324244541194256766741433339n,\n 6699067738555349409504843460654299019000594109597429103342076743347235369120n,\n 6220784880752427143725783746407285094967584864656399181815603544365010379208n,\n 6129250029437675212264306655559561251995722990149771051304736001195288083309n,\n 10773245783118750721454994239248013870822765715268323522295722350908043393604n,\n 4490242021765793917495398271905043433053432245571325177153467194570741607167n,\n 19596995117319480189066041930051006586888908165330319666010398892494684778526n,\n 837850695495734270707668553360118467905109360511302468085569220634750561083n,\n 11803922811376367215191737026157445294481406304781326649717082177394185903907n,\n 10201298324909697255105265958780781450978049256931478989759448189112393506592n,\n 13564695482314888817576351063608519127702411536552857463682060761575100923924n,\n 9262808208636973454201420823766139682381973240743541030659775288508921362724n,\n 173271062536305557219323722062711383294158572562695717740068656098441040230n,\n 18120430890549410286417591505529104700901943324772175772035648111937818237369n,\n 20484495168135072493552514219686101965206843697794133766912991150184337935627n,\n 19155651295705203459475805213866664350848604323501251939850063308319753686505n,\n 11971299749478202793661982361798418342615500543489781306376058267926437157297n,\n 18285310723116790056148596536349375622245669010373674803854111592441823052978n,\n 7069216248902547653615508023941692395371990416048967468982099270925308100727n,\n 6465151453746412132599596984628739550147379072443683076388208843341824127379n,\n 16143532858389170960690347742477978826830511669766530042104134302796355145785n,\n 19362583304414853660976404410208489566967618125972377176980367224623492419647n,\n 1702213613534733786921602839210290505213503664731919006932367875629005980493n,\n 10781825404476535814285389902565833897646945212027592373510689209734812292327n,\n 4212716923652881254737947578600828255798948993302968210248673545442808456151n,\n 7594017890037021425366623750593200398174488805473151513558919864633711506220n,\n 18979889247746272055963929241596362599320706910852082477600815822482192194401n,\n 13602139229813231349386885113156901793661719180900395818909719758150455500533n,\n ];\n\n let r = 0n;\n for (const elem of array) {\n let h = mimc(elem, r, constants, exponent);\n r = (r + elem + h) % P;\n }\n return r % P;\n}","import { hexlify } from 'ethers'\nimport { DarkSwapNote, DarkSwapNoteExt, DarkSwapOrderNote } from '../types'\nimport { P } from '../utils/constants'\nimport { encodeAddress } from '../utils/encoders'\nimport { mimc_bn254 } from '../utils/mimc'\nimport { Fr } from '../aztec/fields/fields'\n\nlet getRandomValues: (buf: Uint8Array) => Uint8Array;\n\nif (typeof window !== 'undefined' && window.crypto && window.crypto.getRandomValues) {\n getRandomValues = (buf) => window.crypto.getRandomValues(buf);\n} else {\n const nodeCrypto = require('crypto');\n getRandomValues = (buf) => {\n const randomBytes = nodeCrypto.randomBytes(buf.length);\n buf.set(randomBytes);\n return buf;\n };\n}\n\nexport const DOMAIN_NOTE = 2n\nexport const DOMAIN_ORDER_NOTE = 3n\n\nexport const EMPTY_NOTE: DarkSwapNote = {\n address: '0x0000000000000000000000000000000000000000',\n rho: 0n,\n note: 0n,\n amount: 0n,\n asset: '0x0000000000000000000000000000000000000000',\n}\n\nexport function createNote(\n address: string,\n asset: string,\n amount: bigint,\n fuzkPubKey: [Fr, Fr]\n): DarkSwapNoteExt {\n const rho = generateRho()\n const footer = getNoteFooter(rho, fuzkPubKey)\n\n const addressMod = encodeAddress(address)\n const assetMod = encodeAddress(asset)\n const note = mimc_bn254([DOMAIN_NOTE, addressMod, assetMod, amount, footer])\n return {\n address,\n rho,\n note,\n asset,\n amount,\n footer,\n }\n}\n\nexport function getNoteFooter(rho: bigint, publicKey: [Fr, Fr]): bigint {\n return mimc_bn254([\n mimc_bn254([BigInt(rho)]),\n BigInt(publicKey[0].toString()),\n BigInt(publicKey[1].toString()),\n ])\n}\n\nfunction generateRho(): bigint {\n const securityLevel = 128\n const primeByteLength = Math.ceil(P.toString(2).length / 8)\n const totalBytes = primeByteLength + Math.ceil(securityLevel / 8)\n\n let rho = BigInt(0)\n do {\n let ab = new ArrayBuffer(totalBytes)\n let buf = new Uint8Array(ab)\n rho = BigInt(hexlify(getRandomValues(buf))) % P\n } while (rho === BigInt(0))\n\n return rho\n}\n\nexport function calcNullifier(rho: bigint, fuzkPubKey: [Fr, Fr]): bigint {\n return mimc_bn254([\n rho,\n BigInt(fuzkPubKey[0].toString()),\n BigInt(fuzkPubKey[1].toString()),\n ])\n}\n\nexport function createOrderNoteExt(\n address: string,\n asset: string,\n amount: bigint,\n feeRatio: bigint,\n fuzkPubKey: [Fr, Fr]\n): DarkSwapOrderNote {\n const rho = generateRho()\n const footer = getNoteFooter(rho, fuzkPubKey)\n\n const assetMod = encodeAddress(asset)\n const addressMod = encodeAddress(address)\n const noteCommitment = mimc_bn254([\n DOMAIN_ORDER_NOTE,\n addressMod,\n assetMod,\n amount,\n feeRatio,\n footer,\n ])\n\n return {\n address,\n rho,\n note: noteCommitment,\n asset,\n amount,\n feeRatio,\n }\n}\n\n\nexport function validateNoteWithPubKey(note: DarkSwapNote, fuzkPubKey: [Fr, Fr]) {\n const addressMod = encodeAddress(note.address)\n const assetMod = encodeAddress(note.asset)\n const footer = getNoteFooter(note.rho, fuzkPubKey)\n const noteCommitment = mimc_bn254([DOMAIN_NOTE, addressMod, assetMod, note.amount, footer])\n return noteCommitment === note.note;\n}\n\nexport function validateOrderNoteWithPubKey(note: DarkSwapOrderNote, fuzkPubKey: [Fr, Fr]) {\n const footer = getNoteFooter(note.rho, fuzkPubKey)\n\n const assetMod = encodeAddress(note.asset)\n const addressMod = encodeAddress(note.address)\n const noteCommitment = mimc_bn254([\n DOMAIN_ORDER_NOTE,\n addressMod,\n assetMod,\n note.amount,\n note.feeRatio,\n footer,\n ])\n return noteCommitment === note.note;\n}","/**\n * Convert a little-endian buffer into a BigInt.\n * @param buf - The little-endian buffer to convert.\n * @returns A BigInt with the little-endian representation of buf.\n */\nexport function toBigIntLE(buf: Buffer): bigint {\n const reversed = Buffer.from(buf);\n reversed.reverse();\n const hex = reversed.toString('hex');\n if (hex.length === 0) {\n return BigInt(0);\n }\n return BigInt(`0x${hex}`);\n }\n \n /**\n * Convert a big-endian buffer into a BigInt.\n * @param buf - The big-endian buffer to convert.\n * @returns A BigInt with the big-endian representation of buf.\n */\n export function toBigIntBE(buf: Buffer): bigint {\n const hex = buf.toString('hex');\n if (hex.length === 0) {\n return BigInt(0);\n }\n return BigInt(`0x${hex}`);\n }\n \n /**\n * Convert a BigInt to a little-endian buffer.\n * @param num - The BigInt to convert.\n * @param width - The number of bytes that the resulting buffer should be.\n * @returns A little-endian buffer representation of num.\n */\n export function toBufferLE(num: bigint, width: number): Buffer {\n if (num < BigInt(0)) {\n throw new Error(`Cannot convert negative bigint ${num.toString()} to buffer with toBufferLE.`);\n }\n const hex = num.toString(16);\n const buffer = Buffer.from(hex.padStart(width * 2, '0').slice(0, width * 2), 'hex');\n buffer.reverse();\n return buffer;\n }\n \n /**\n * Convert a BigInt to a big-endian buffer.\n * @param num - The BigInt to convert.\n * @param width - The number of bytes that the resulting buffer should be.\n * @returns A big-endian buffer representation of num.\n */\n export function toBufferBE(num: bigint, width: number): Buffer {\n if (num < BigInt(0)) {\n throw new Error(`Cannot convert negative bigint ${num.toString()} to buffer with toBufferBE.`);\n }\n const hex = num.toString(16);\n const buffer = Buffer.from(hex.padStart(width * 2, '0').slice(0, width * 2), 'hex');\n if (buffer.length > width) {\n throw new Error(`Number ${num.toString(16)} does not fit in ${width}`);\n }\n return buffer;\n }\n \n /**\n * Converts a BigInt to its hex representation.\n * @param num - The BigInt to convert.\n * @param padTo32 - Whether to pad the resulting string to 32 bytes.\n * @returns An even-length 0x-prefixed string.\n */\n export function toHex(num: bigint, padTo32 = false): string {\n const str = num.toString(16);\n const targetLen = str.length % 2 === 0 ? str.length : str.length + 1;\n const paddedStr = str.padStart(padTo32 ? 64 : targetLen, '0');\n return `0x${paddedStr}`;\n }\n \n /**\n * Converts a hex string to a buffer. Throws if input is not a valid hex string.\n * @param value - The hex string to convert. May be 0x prefixed or not.\n * @returns A buffer.\n */\n export function fromHex(value: string): Buffer {\n const hexRegex = /^(0x)?[0-9a-fA-F]*$/;\n if (!hexRegex.test(value) || value.length % 2 !== 0) {\n throw new Error(`Invalid hex string: ${value}`);\n }\n return Buffer.from(value.replace(/^0x/i, ''), 'hex');\n }","\n/**\n * The BufferReader class provides a utility for reading various data types from a buffer.\n * It supports reading numbers, booleans, byte arrays, Fr and Fq field elements,\n * vectors, arrays, objects, strings, and maps. It maintains an internal index to\n * keep track of the current reading position in the buffer.\n *\n * Usage:\n * Create a new instance of BufferReader with a buffer and an optional offset.\n * Use the provided methods to read desired data types from the buffer.\n * The reading methods automatically advance the internal index.\n *\n * @example\n * const reader = new BufferReader(someBuffer);\n * const num = reader.readNumber();\n * const bool = reader.readBoolean();\n * const byteArray = reader.readBytes(4);\n */\nexport class BufferReader {\n private index: number;\n constructor(\n private buffer: Buffer,\n offset = 0,\n ) {\n this.index = offset;\n }\n\n /**\n * Creates a BufferReader instance from either a Buffer or an existing BufferReader.\n * If the input is a Buffer, it creates a new BufferReader with the given buffer.\n * If the input is already a BufferReader, it returns the input unchanged.\n *\n * @param bufferOrReader - A Buffer or BufferReader to initialize the BufferReader.\n * @returns An instance of BufferReader.\n */\n public static asReader(bufferOrReader: Uint8Array | Buffer | BufferReader): BufferReader {\n if (bufferOrReader instanceof BufferReader) {\n return bufferOrReader;\n }\n\n const buf = Buffer.isBuffer(bufferOrReader)\n ? bufferOrReader\n : Buffer.from(bufferOrReader.buffer, bufferOrReader.byteOffset, bufferOrReader.byteLength);\n\n return new BufferReader(buf);\n }\n\n /** Returns true if the underlying buffer has been consumed completely. */\n public isEmpty(): boolean {\n return this.index === this.buffer.length;\n }\n\n /**\n * Reads a 32-bit unsigned integer from the buffer at the current index position.\n * Updates the index position by 4 bytes after reading the number.\n *\n * @returns The read 32-bit unsigned integer value.\n */\n public readNumber(): number {\n this.rangeCheck(4);\n this.index += 4;\n return this.buffer.readUint32BE(this.index - 4);\n }\n\n\n /**\n * Reads a 256-bit unsigned integer from the buffer at the current index position.\n * Updates the index position by 32 bytes after reading the number.\n *\n * Assumes the number is stored in big-endian format.\n *\n * @returns The read 256 bit value as a bigint.\n */\n public readUInt64(): bigint {\n this.rangeCheck(8);\n\n const result = this.buffer.readBigUInt64BE(this.index);\n\n this.index += 8;\n return result;\n }\n\n /**\n * Reads a 128-bit unsigned integer from the buffer at the current index position.\n * Updates the index position by 16 bytes after reading the number.\n *\n * Assumes the number is stored in big-endian format.\n *\n * @returns The read 128 bit value as a bigint.\n */\n public readUInt128(): bigint {\n this.rangeCheck(16);\n\n let result = BigInt(0);\n for (let i = 0; i < 2; i++) {\n result = (result << BigInt(64)) | this.buffer.readBigUInt64BE(this.index + i * 8);\n }\n\n this.index += 16;\n return result;\n }\n\n /**\n * Reads a 256-bit unsigned integer from the buffer at the current index position.\n * Updates the index position by 32 bytes after reading the number.\n *\n * Assumes the number is stored in big-endian format.\n *\n * @returns The read 256 bit value as a bigint.\n */\n public readUInt256(): bigint {\n this.rangeCheck(32);\n\n let result = BigInt(0);\n for (let i = 0; i < 4; i++) {\n result = (result << BigInt(64)) | this.buffer.readBigUInt64BE(this.index + i * 8);\n }\n\n this.index += 32;\n return result;\n }\n\n /**\n * Reads a 16-bit unsigned integer from the buffer at the current index position.\n * Updates the index position by 2 bytes after reading the number.\n *\n * @returns The read 16 bit value.\n */\n public readUInt16(): number {\n this.rangeCheck(2);\n this.index += 2;\n return this.buffer.readUInt16BE(this.index - 2);\n }\n\n /**\n * Reads a 8-bit unsigned integer from the buffer at the current index position.\n * Updates the index position by 1 byte after reading the number.\n *\n * @returns The read 8 bit value.\n */\n public readUInt8(): number {\n this.rangeCheck(1);\n this.index += 1;\n return this.buffer.readUInt8(this.index - 1);\n }\n\n /**\n * Reads and returns the next boolean value from the buffer.\n * Advances the internal index by 1, treating the byte at the current index as a boolean value.\n * Returns true if the byte is non-zero, false otherwise.\n *\n * @returns A boolean value representing the byte at the current index.\n */\n public readBoolean(): boolean {\n this.rangeCheck(1);\n this.index += 1;\n return Boolean(this.buffer.at(this.index - 1));\n }\n\n /**\n * Reads a specified number of bytes from the buffer and returns a new Buffer containing those bytes.\n * Advances the reader's index by the number of bytes read. Throws an error if there are not enough\n * bytes left in the buffer to satisfy the requested number of bytes.\n *\n * @param n - The number of bytes to read from the buffer.\n * @returns A new Buffer containing the read bytes.\n */\n public readBytes(n: number): Buffer {\n this.rangeCheck(n);\n this.index += n;\n return Buffer.from(this.buffer.subarray(this.index - n, this.index));\n }\n\n /** Reads until the end of the buffer. */\n public readToEnd(): Buffer {\n const result = this.buffer.subarray(this.index);\n this.index = this.buffer.length;\n return result;\n }\n\n /**\n * Reads a vector of numbers from the buffer and returns it as an array of numbers.\n * The method utilizes the 'readVector' method, passing a deserializer that reads numbers.\n *\n * @returns An array of numbers representing the vector read from the buffer.\n */\n public readNumberVector(): number[] {\n return this.readVector({\n fromBuffer: (reader: BufferReader) => reader.readNumber(),\n });\n }\n\n /**\n * Reads a vector of 256-bit unsigned integers from the buffer and returns it as an array of bigints.\n * The method utilizes the 'readVector' method, passing a deserializer that reads bigints.\n *\n * @returns An array of bigints representing the vector read from the buffer.\n */\n public readUint256Vector(): bigint[] {\n return this.readVector({\n fromBuffer: (reader: BufferReader) => reader.readUInt256(),\n });\n }\n\n /**\n * Reads a vector of fixed size from the buffer and deserializes its elements using the provided itemDeserializer object.\n * The 'itemDeserializer' object should have a 'fromBuffer' method that takes a BufferReader instance and returns the deserialized element.\n * The method first reads the size of the vector (a number) from the buffer, then iterates through its elements,\n * deserializing each one using the 'fromBuffer' method of 'itemDeserializer'.\n *\n * @param itemDeserializer - Object with 'fromBuffer' method to deserialize vector elements.\n * @returns An array of deserialized elements of type T.\n */\n public readVector<T>(itemDeserializer: {\n /**\n * A method to deserialize data from a buffer.\n */\n fromBuffer: (reader: BufferReader) => T;\n }): T[] {\n const size = this.readNumber();\n const result = new Array<T>(size);\n for (let i = 0; i < size; i++) {\n result[i] = itemDeserializer.fromBuffer(this);\n }\n return result;\n }\n\n /**\n * Reads a vector of fixed size from the buffer and deserializes its elements using the provided itemDeserializer object.\n * The 'itemDeserializer' object should have a 'fromBuffer' method that takes a BufferReader instance and returns the deserialized element.\n * The method first reads the size of the vector (a number) from the buffer, then iterates through its elements,\n * deserializing each one using the 'fromBuffer' method of 'itemDeserializer'.\n *\n * @param itemDeserializer - Object with 'fromBuffer' method to deserialize vector elements.\n * @returns An array of deserialized elements of type T.\n */\n public readVectorUint8Prefix<T>(itemDeserializer: {\n /**\n * A method to deserialize data from a buffer.\n */\n fromBuffer: (reader: BufferReader) => T;\n }): T[] {\n const size = this.readUInt8();\n const result = new Array<T>(size);\n for (let i = 0; i < size; i++) {\n result[i] = itemDeserializer.fromBuffer(this);\n }\n return result;\n }\n\n /**\n * Read a variable sized Buffer array where elements are represented by length + data.\n * The method consecutively looks for a number which is the size of the proceeding buffer,\n * then reads the bytes until it reaches the end of the reader's internal buffer.\n * NOTE: if `size` is not provided, this will run to the end of the reader's buffer.\n * @param size - Size of the buffer array in bytes (full remaining buffer length if left empty).\n * @returns An array of variable sized buffers.\n */\n public readBufferArray(size = -1): Buffer[] {\n const result: Buffer[] = [];\n const end = size >= 0 ? this.index + size : this.buffer.length;\n this.rangeCheck(end - this.index);\n while (this.index < end) {\n const item = this.readBuffer();\n result.push(item);\n }\n // Ensure that all bytes have been read.\n if (this.index !== end) {\n throw new Error(\n `Reader buffer was not fully consumed. Consumed up to ${this.index} bytes. End of data: ${end} bytes.`,\n );\n }\n return result;\n }\n\n /**\n * Reads a serialized object from a buffer and returns the deserialized object using the given deserializer.\n *\n * @typeparam T - The type of the deserialized object.\n * @param deserializer - An object with a 'fromBuffer' method that takes a BufferReader instance and returns an instance of the deserialized object.\n * @returns The deserialized object of type T.\n */\n public readObject<T>(deserializer: {\n /**\n * A method that takes a BufferReader instance and returns an instance of the deserialized data type.\n */\n fromBuffer: (reader: BufferReader) => T;\n }): T {\n return deserializer.fromBuffer(this);\n }\n\n /**\n * Returns a Buffer containing the next n bytes from the current buffer without modifying the reader's index position.\n * If n is not provided or exceeds the remaining length of the buffer, it returns all bytes from the current position till the end of the buffer.\n *\n * @param n - The number of bytes to peek from the current buffer. (Optional).\n * @returns A Buffer with the next n bytes or the remaining bytes if n is not provided or exceeds the buffer length.\n */\n public peekBytes(n?: number): Buffer {\n this.rangeCheck(n || 0);\n return this.buffer.subarray(this.index, n ? this.index + n : undefined);\n }\n\n /**\n * Reads a string from the buffer and returns it.\n * The method first reads the size of the string, then reads the corresponding\n * number of bytes from the buffer and converts them to a string.\n *\n * @returns The read string from the buffer.\n */\n public readString(): string {\n return this.readBuffer().toString();\n }\n\n /**\n * Reads a buffer from the current position of the reader and advances the index.\n * The method first reads the size (number) of bytes to be read, and then returns\n * a Buffer with that size containing the bytes. Useful for reading variable-length\n * binary data encoded as (size, data) format.\n *\n * @returns A Buffer containing the read bytes.\n */\n public readBuffer(): Buffer {\n const size = this.readNumber();\n this.rangeCheck(size);\n return this.readBytes(size);\n }\n\n /**\n * Reads a buffer from the current position of the reader and advances the index.\n * The method first reads the size (number) of bytes to be read, and then returns\n * a Buffer with that size containing the bytes. Useful for reading variable-length\n * binary data encoded as (size, data) format.\n *\n * @returns A Buffer containing the read bytes.\n */\n public readUint8Array(): Uint8Array {\n const size = this.readNumber();\n this.rangeCheck(size);\n return this.readBytes(size);\n }\n\n /**\n * Reads and constructs a map object from the current buffer using the provided deserializer.\n * The method reads the number of entries in the map, followed by iterating through each key-value pair.\n * The key is read as a string, while the value is obtained using the passed deserializer's `fromBuffer` method.\n * The resulting map object is returned, containing all the key-value pairs read from the buffer.\n *\n * @param deserializer - An object with a `fromBuffer` method to deserialize the values in the map.\n * @returns A map object with string keys and deserialized values based on the provided deserializer.\n */\n public readMap<T>(deserializer: {\n /**\n * Deserializes an element of type T from a BufferReader instance.\n */\n fromBuffer: (reader: BufferReader) => T;\n }): { [key: string]: T } {\n const numEntries = this.readNumber();\n const map: { [key: string]: T } = {};\n for (let i = 0; i < numEntries; i++) {\n const key = this.readString();\n const value = this.readObject<T>(deserializer);\n map[key] = value;\n }\n return map;\n }\n\n /**\n * Get the length of the reader's buffer.\n * @returns The length of the underlying reader's buffer.\n */\n public getLength(): number {\n return this.buffer.length;\n }\n\n /**\n * Gets bytes remaining to be read from the buffer.\n * @returns Bytes remaining to be read from the buffer.\n */\n public remainingBytes(): number {\n return this.buffer.length - this.index;\n }\n\n private rangeCheck(numBytes: number) {\n if (this.index + numBytes > this.buffer.length) {\n throw new Error(\n `Attempted to read beyond buffer length. Start index: ${this.index}, Num bytes to read: ${numBytes}, Buffer length: ${this.buffer.length}`,\n );\n }\n }\n}\n\n/**\n * A deserializer\n */\nexport interface FromBuffer<T> {\n /**\n * Deserializes an object from a buffer\n * @param buffer - The buffer to deserialize.\n */\n fromBuffer(buffer: Buffer): T;\n}","import { toBigIntBE, toBufferBE } from '../bigint-buffer';\nimport { BufferReader } from '../serialize/buffer_reader';\n\nconst ZERO_BUFFER = Buffer.alloc(32);\n\n/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\n\n/**\n * Represents a field derived from BaseField.\n */\ntype DerivedField<T extends BaseField> = {\n new (value: any): T;\n /**\n * All derived fields will specify a MODULUS.\n */\n MODULUS: bigint;\n};\n\n/**\n * Base field class.\n * Conversions from Buffer to BigInt and vice-versa are not cheap.\n * We allow construction with either form and lazily convert to other as needed.\n * We only check we are within the field modulus when initializing with bigint.\n */\nabstract class BaseField {\n static SIZE_IN_BYTES = 32;\n private asBuffer?: Buffer;\n private asBigInt?: bigint;\n\n /**\n * Return bigint representation.\n * @deprecated Just to get things compiling. Use toBigInt().\n * */\n get value(): bigint {\n return this.toBigInt();\n }\n\n /** Returns the size in bytes. */\n get size(): number {\n return BaseField.SIZE_IN_BYTES;\n }\n\n protected constructor(value: number | bigint | boolean | BaseField | Buffer) {\n if (Buffer.isBuffer(value)) {\n if (value.length > BaseField.SIZE_IN_BYTES) {\n throw new Error(`Value length ${value.length} exceeds ${BaseField.SIZE_IN_BYTES}`);\n }\n this.asBuffer =\n value.length === BaseField.SIZE_IN_BYTES\n ? value\n : Buffer.concat([Buffer.alloc(BaseField.SIZE_IN_BYTES - value.length), value]);\n } else if (typeof value === 'bigint' || typeof value === 'number' || typeof value === 'boolean') {\n this.asBigInt = BigInt(value);\n if (this.asBigInt >= this.modulus()) {\n throw new Error(`Value 0x${this.asBigInt.toString(16)} is greater or equal to field modulus.`);\n }\n } else if (value instanceof BaseField) {\n this.asBuffer = value.asBuffer;\n this.asBigInt = value.asBigInt;\n } else {\n throw new Error(`Type '${typeof value}' with value '${value}' passed to BaseField ctor.`);\n }\n }\n\n protected abstract modulus(): bigint;\n\n /**\n * We return a copy of the Buffer to ensure this remains immutable.\n */\n toBuffer(): Buffer {\n if (!this.asBuffer) {\n this.asBuffer = toBufferBE(this.asBigInt!, 32);\n }\n return Buffer.from(this.asBuffer);\n }\n\n toString(): string {\n return `0x${this.toBuffer().toString('hex')}`;\n }\n\n toBigInt(): bigint {\n if (this.asBigInt === undefined) {\n this.asBigInt = toBigIntBE(this.asBuffer!);\n if (this.asBigInt >= this.modulus()) {\n throw new Error(`Value 0x${this.asBigInt.toString(16)} is greater or equal to field modulus.`);\n }\n }\n return this.asBigInt;\n }\n\n toBool(): boolean {\n return Boolean(this.toBigInt());\n }\n\n /**\n * Converts this field to a number.\n * Throws if the underlying value is greater than MAX_SAFE_INTEGER.\n */\n toNumber(): number {\n const value = this.toBigInt();\n if (value > Number.MAX_SAFE_INTEGER) {\n throw new Error(`Value ${value.toString(16)} greater than than max safe integer`);\n }\n return Number(value);\n }\n\n /**\n * Converts this field to a number.\n * May cause loss of precision if the underlying value is greater than MAX_SAFE_INTEGER.\n */\n toNumberUnsafe(): number {\n const value = this.toBigInt();\n return Number(value);\n }\n\n toShortString(): string {\n const str = this.toString();\n return `${str.slice(0, 10)}...${str.slice(-4)}`;\n }\n\n equals(rhs: BaseField): boolean {\n return this.toBuffer().equals(rhs.toBuffer());\n }\n\n lt(rhs: BaseField): boolean {\n return this.toBigInt() < rhs.toBigInt();\n }\n\n cmp(rhs: BaseField): -1 | 0 | 1 {\n const lhsBigInt = this.toBigInt();\n const rhsBigInt = rhs.toBigInt();\n return lhsBigInt === rhsBigInt ? 0 : lhsBigInt < rhsBigInt ? -1 : 1;\n }\n\n isZero(): boolean {\n return this.toBuffer().equals(ZERO_BUFFER);\n }\n\n isEmpty(): boolean {\n return this.isZero();\n }\n\n toFriendlyJSON(): string {\n return this.toString();\n }\n\n toField() {\n return this;\n }\n}\n\n/**\n * Constructs a field from a Buffer of BufferReader.\n * It maybe not read the full 32 bytes if the Buffer is shorter, but it will padded in BaseField constructor.\n */\nexport function fromBuffer<T extends BaseField>(buffer: Buffer | BufferReader, f: DerivedField<T>) {\n const reader = BufferReader.asReader(buffer);\n return new f(reader.readBytes(BaseField.SIZE_IN_BYTES));\n}\n\n/**\n * Constructs a field from a Buffer, but reduces it first, modulo the field modulus.\n * This requires a conversion to a bigint first so the initial underlying representation will be a bigint.\n */\nfunction fromBufferReduce<T extends BaseField>(buffer: Buffer, f: DerivedField<T>) {\n return new f(toBigIntBE(buffer) % f.MODULUS);\n}\n\n/**\n * Constructs a field from a 0x prefixed hex string.\n */\nfunction fromHexString<T extends BaseField>(buf: string, f: DerivedField<T>) {\n const withoutPrefix = buf.replace(/^0x/i, '');\n const checked = withoutPrefix.match(/^[0-9A-F]+$/i)?.[0];\n if (checked === undefined) {\n throw new Error(`Invalid hex-encoded string: \"${buf}\"`);\n }\n\n const buffer = Buffer.from(checked.length % 2 === 1 ? '0' + checked : checked, 'hex');\n\n return new f(buffer);\n}\n\n/** Branding to ensure fields are not interchangeable types. */\nexport interface Fr {\n /** Brand. */\n _branding: 'Fr';\n}\n\n/**\n * Fr field class.\n * @dev This class is used to represent elements of BN254 scalar field or elements in the base field of Grumpkin.\n * (Grumpkin's scalar field corresponds to BN254's base field and vice versa.)\n */\nexport class Fr extends BaseField {\n static ZERO = new Fr(0n);\n static ONE = new Fr(1n);\n static MODULUS = 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001n;\n static MAX_FIELD_VALUE = new Fr(Fr.MODULUS - 1n);\n\n constructor(value: number | bigint | boolean | Fr | Buffer) {\n super(value);\n }\n\n protected modulus() {\n return Fr.MODULUS;\n }\n\n static zero() {\n return Fr.ZERO;\n }\n\n static isZero(value: Fr) {\n return value.isZero();\n }\n\n static fromBuffer(buffer: Buffer | BufferReader) {\n return fromBuffer(buffer, Fr);\n }\n\n static fromBufferReduce(buffer: Buffer) {\n return fromBufferReduce(buffer, Fr);\n }\n\n /**\n * Creates a Fr instance from a string.\n * @param buf - the string to create a Fr from.\n * @returns the Fr instance\n * @remarks if the string only consists of numbers, we assume we are parsing a bigint,\n * otherwise we require the hex string to be prepended with \"0x\", to ensure there is no misunderstanding\n * as to what is being parsed.\n */\n static fromString(buf: string) {\n if (buf.match(/^\\d+$/) !== null) {\n return new Fr(toBufferBE(BigInt(buf), 32));\n }\n if (buf.match(/^0x/i) !== null) {\n return fromHexString(buf, Fr);\n }\n\n throw new Error(`Tried to create a Fr from an invalid string: ${buf}`);\n }\n\n /**\n * Creates a Fr instance from a hex string.\n * @param buf - a hex encoded string.\n * @returns the Fr instance\n */\n static fromHexString(buf: string) {\n return fromHexString(buf, Fr);\n }\n}\n\n\n/**\n * Branding to ensure fields are not interchangeable types.\n */\nexport interface Fq {\n /** Brand. */\n _branding: 'Fq';\n}\n\n/**\n * Fq field class.\n * @dev This class is used to represent elements of BN254 base field or elements in the scalar field of Grumpkin.\n * (Grumpkin's scalar field corresponds to BN254's base field and vice versa.)\n */\nexport class Fq extends BaseField {\n static ZERO = new Fq(0n);\n static MODULUS = 0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47n;\n private static HIGH_SHIFT = BigInt((BaseField.SIZE_IN_BYTES / 2) * 8);\n private static LOW_MASK = (1n << Fq.HIGH_SHIFT) - 1n;\n\n get lo(): Fr {\n return new Fr(this.toBigInt() & Fq.LOW_MASK);\n }\n\n get hi(): Fr {\n return new Fr(this.toBigInt() >> Fq.HIGH_SHIFT);\n }\n\n constructor(value: number | bigint | boolean | Fq | Buffer) {\n super(value);\n }\n\n protected modulus() {\n return Fq.MODULUS;\n }\n\n static zero() {\n return Fq.ZERO;\n }\n\n static fromBuffer(buffer: Buffer | BufferReader) {\n return fromBuffer(buffer, Fq);\n }\n\n static fromBufferReduce(buffer: Buffer) {\n return fromBufferReduce(buffer, Fq);\n }\n\n /**\n * Creates a Fq instance from a string.\n * @param buf - the string to create a Fq from.\n * @returns the Fq instance\n * @remarks if the string only consists of numbers, we assume we are parsing a bigint,\n * otherwise we require the hex string to be prepended with \"0x\", to ensure there is no misunderstanding\n * as to what is being parsed.\n */\n static fromString(buf: string) {\n if (buf.match(/^\\d+$/) !== null) {\n return new Fq(toBufferBE(BigInt(buf), 32));\n }\n if (buf.match(/^0x/i) !== null) {\n return fromHexString(buf, Fq);\n }\n\n throw new Error(`Tried to create a Fq from an invalid string: ${buf}`);\n }\n\n /**\n * Creates a Fq instance from a hex string.\n * @param buf - a hex encoded string.\n * @returns the Fq instance\n */\n static fromHexString(buf: string) {\n return fromHexString(buf, Fq);\n }\n\n static fromHighLow(high: Fr, low: Fr): Fq {\n return new Fq((high.toBigInt() << Fq.HIGH_SHIFT) + low.toBigInt());\n }\n\n add(rhs: Fq) {\n return new Fq((this.toBigInt() + rhs.toBigInt()) % Fq.MODULUS);\n }\n\n toJSON() {\n return this.toString();\n }\n\n toFields() {\n // The following has to match the order of the limbs in EmbeddedCurveScalar struct in noir::std. This is because\n // this function is used when returning Scalar from the getAddressSecret oracle and in Noir the values get deserialized\n // using the intrinsic serialization of Noir (which follows the order of the fields/members in the struct).\n return [this.lo, this.hi];\n }\n}\n\n/**\n * GrumpkinScalar is an Fq.\n * @remarks Called GrumpkinScalar because it is used to represent elements in Grumpkin's scalar field as defined in\n * the Aztec Protocol Specs.\n */\nexport type GrumpkinScalar = Fq;\nexport const GrumpkinScalar = Fq;\n\n/** Wraps a function that returns a buffer so that all results are reduced into a field of the given type. */\nexport function reduceFn<TInput, TField extends BaseField>(fn: (input: TInput) => Buffer, field: DerivedField<TField>) {\n return (input: TInput) => fromBufferReduce(fn(input), field);\n}","// TODO find a new home for this as we move to external bb.js\n// See https://github.com/AztecProtocol/aztec-packages/issues/782\nimport { Buffer } from 'buffer';\n\n/**\n * For serializing an array of fixed length buffers.\n * TODO move to foundation pkg.\n * @param arr - Array of bufffers.\n * @returns The serialized buffers.\n */\nexport function serializeBufferArrayToVector(arr: Buffer[]) {\n const lengthBuf = Buffer.alloc(4);\n lengthBuf.writeUInt32BE(arr.length, 0);\n return Buffer.concat([lengthBuf, ...arr]);\n}\n\n/**\n * Helper function for deserializeArrayFromVector.\n */\ntype DeserializeFn<T> = (\n buf: Buffer,\n offset: number,\n) => {\n /**\n * The deserialized type.\n */\n elem: T;\n /**\n * How many bytes to advance by.\n */\n adv: number;\n};\n\n/**\n * For deserializing numbers to 32-bit little-endian form.\n * TODO move to foundation pkg.\n * @param n - The number.\n * @returns The endian-corrected number.\n */\nexport function deserializeArrayFromVector<T>(deserialize: DeserializeFn<T>, vector: Buffer, offset = 0) {\n let pos = offset;\n const size = vector.readUInt32BE(pos);\n pos += 4;\n const arr = new Array<T>(size);\n for (let i = 0; i < size; ++i) {\n const { elem, adv } = deserialize(vector, pos);\n pos += adv;\n arr[i] = elem;\n }\n return { elem: arr, adv: pos - offset };\n}\n\n/**\n * For serializing numbers to 32 bit little-endian form.\n * TODO move to foundation pkg.\n * @param n - The number.\n * @returns The endian-corrected number.\n */\nexport function numToUInt32LE(n: number, bufferSize = 4) {\n const buf = Buffer.alloc(bufferSize);\n buf.writeUInt32LE(n, bufferSize - 4);\n return buf;\n}\n\n/**\n * Deserialize the 256-bit number at address `offset`.\n * @param buf - The buffer.\n * @param offset - The address.\n * @returns The derserialized 256-bit field.\n */\nexport function deserializeField(buf: Buffer, offset = 0) {\n const adv = 32;\n return { elem: buf.slice(offset, offset + adv), adv };\n}\n\nexport function concatenateUint8Arrays(arrayOfUint8Arrays: Uint8Array[]) {\n const totalLength = arrayOfUint8Arrays.reduce((prev, curr) => prev + curr.length, 0);\n const result = new Uint8Array(totalLength);\n let length = 0;\n for (const array of arrayOfUint8Arrays) {\n result.set(array, length);\n length += array.length;\n }\n return result;\n}","\n/**\n * Annoying, mapping a tuple does not preserve length.\n * This is a helper to preserve length during a map operation.\n * @typeparam T - The original array type.\n */\ntype MapTuple<T extends any[], F extends (item: any) => any> = {\n [K in keyof T]: T[K] extends infer U ? (F extends (item: U) => infer V ? V : never) : never;\n};\n\n/**\n * Annoyingly, mapping a tuple does not preserve length.\n * This is a helper to preserve length during a map operation.\n * @see https://github.com/microsoft/TypeScript/issues/29841.\n * @param array - A tuple array.\n */\nexport function mapTuple<T extends any[], F extends (item: T[number]) => any>(tuple: T, fn: F): MapTuple<T, F> {\n return tuple.map(fn) as MapTuple<T, F>;\n}","import type { Signature } from '../signature';\nimport { Fr } from '../../fields/fields';\nimport { BufferReader } from '../../serialize/buffer_reader';\nimport { mapTuple } from '../../serialize/types';\n\n/**\n * Schnorr signature used for transactions.\n * @see cpp/barretenberg/cpp/src/barretenberg/crypto/schnorr/schnorr.hpp\n */\nexport class SchnorrSignature implements Signature {\n /**\n * The size of the signature in bytes.\n */\n public static SIZE = 64;\n\n /**\n * An empty signature.\n */\n public static EMPTY = new SchnorrSignature(Buffer.alloc(64));\n\n constructor(private buffer: Buffer) {\n if (buffer.length !== SchnorrSignature.SIZE) {\n throw new Error(`Invalid signature buffer of length ${buffer.length}.`);\n }\n }\n\n /**\n * Determines if the provided signature is valid or not.\n * @param signature - The data to be checked.\n * @returns Boolean indicating if the provided data is a valid schnorr signature.\n */\n public static isSignature(signature: string) {\n return /^(0x)?[0-9a-f]{128}$/i.test(signature);\n }\n\n /**\n * Constructs a SchnorrSignature from the provided string.\n * @param signature - The string to be converted to a schnorr signature.\n * @returns The constructed schnorr signature.\n */\n public static fromString(signature: string) {\n if (!SchnorrSignature.isSignature(signature)) {\n throw new Error(`Invalid signature string: ${signature}`);\n }\n return new SchnorrSignature(Buffer.from(signature.replace(/^0x/i, ''), 'hex'));\n }\n\n /**\n * Returns the 's' component of the signature.\n * @returns A buffer containing the signature's 's' component.\n */\n get s() {\n return this.buffer.subarray(0, 32);\n }\n\n /**\n * Returns the 'e' component of the signature.\n * @returns A buffer containing the signature's 'e' component.\n */\n get e() {\n return this.buffer.subarray(32);\n }\n\n /**\n * Returns the full signature as a buffer.\n * @returns A buffer containing the signature.\n */\n toBuffer() {\n return this.buffer;\n }\n\n /**\n * Deserializes from a buffer.\n * @param buffer - The buffer representation of the object.\n * @returns The new object.\n */\n static fromBuffer(buffer: Buffer | BufferReader): SchnorrSignature {\n const reader = BufferReader.asReader(buffer);\n return new SchnorrSignature(reader.readBytes(SchnorrSignature.SIZE));\n }\n\n /**\n * Returns the full signature as a hex string.\n * @returns A string containing the signature in hex format.\n */\n toString() {\n return `0x${this.buffer.toString('hex')}`;\n }\n\n /**\n * Converts the signature to an array of three fields.\n * @returns The signature components as an array of three fields\n */\n toFields(): Fr[] {\n const sig = this.toBuffer();\n\n const buf1 = Buffer.alloc(32);\n const buf2 = Buffer.alloc(32);\n const buf3 = Buffer.alloc(32);\n\n sig.copy(buf1, 1, 0, 31);\n sig.copy(buf2, 1, 31, 62);\n sig.copy(buf3, 1, 62, 64);\n\n return mapTuple([buf1, buf2, buf3], Fr.fromBuffer);\n }\n}","import { toBufferBE } from '../bigint-buffer';\nimport { Fr } from '../fields/fields';\n\n/**\n * Convert a boolean value to its corresponding byte representation in a Buffer of size 1.\n * The function takes a boolean value and writes it into a new buffer as either 1 (true) or 0 (false).\n * This method is useful for converting a boolean value into a binary format that can be stored or transmitted easily.\n *\n * @param b - The boolean value to be converted.\n * @returns A Buffer containing the byte representation of the input boolean value.\n */\nexport function boolToByte(b: boolean) {\n const buf = Buffer.alloc(1);\n buf.writeUInt8(b ? 1 : 0);\n return buf;\n}\n\n/**\n * @param n - The input number to be converted to a big-endian unsigned 16-bit integer Buffer.\n * @param bufferSize - Optional, the size of the output Buffer (default is 2).\n * @returns A Buffer containing the big-endian unsigned 16-bit integer representation of the input number.\n */\nexport function numToUInt16BE(n: number, bufferSize = 2) {\n const buf = Buffer.alloc(bufferSize);\n buf.writeUInt16BE(n, bufferSize - 2);\n return buf;\n}\n\n/**\n * Convert a number into a 4-byte little-endian unsigned integer buffer.\n * The input number is serialized as an unsigned 32-bit integer in little-endian byte order,\n * and returned as a Buffer of specified size (defaults to 4).\n * If the provided bufferSize is greater than 4, the additional bytes will be padded with zeros.\n *\n * @param n - The number to be converted into a little-endian unsigned integer buffer.\n * @param bufferSize - Optional, the size of the output buffer (default value is 4).\n * @returns A Buffer containing the serialized little-endian unsigned integer representation of the input number.\n */\nexport function numToUInt32LE(n: number, bufferSize = 4) {\n const buf = Buffer.alloc(bufferSize);\n buf.writeUInt32LE(n, bufferSize - 4);\n return buf;\n}\n\n/**\n * Convert a number to a big-endian unsigned 32-bit integer Buffer.\n * This function takes a number and an optional buffer size as input and creates a Buffer with the specified size (defaults to 4) containing the big-endian representation of the input number as an unsigned 32-bit integer. Note that the bufferSize should be greater than or equal to 4, otherwise the output Buffer might truncate the serialized value.\n *\n * @param n - The input number to be converted to a big-endian unsigned 32-bit integer Buffer.\n * @param bufferSize - Optional, the size of the output Buffer (default is 4).\n * @returns A Buffer containing the big-endian unsigned 32-bit integer representation of the input number.\n */\nexport function numToUInt32BE(n: number, bufferSize = 4) {\n const buf = Buffer.alloc(bufferSize);\n buf.writeUInt32BE(n, bufferSize - 4);\n return buf;\n}\n\n/**\n * Convert a bigint to a big-endian unsigned 64-bit integer Buffer.\n *\n * @param n - The bigint to be converted to a big-endian unsigned 64-bit integer Buffer.\n * @param bufferSize - Optional, the size of the output Buffer (default is 8).\n * @returns A Buffer containing the big-endian unsigned 64-bit integer representation of the input number.\n */\nexport function bigintToUInt64BE(n: bigint, bufferSize = 8) {\n const buf = Buffer.alloc(bufferSize);\n buf.writeBigUInt64BE(n, bufferSize - 8);\n return buf;\n}\n\n/**\n * Convert a bigint to a big-endian unsigned 128-bit integer Buffer.\n *\n * @param n - The bigint to be converted to a big-endian unsigned 128-bit integer Buffer.\n * @param bufferSize - Optional, the size of the output Buffer (default is 16).\n * @returns A Buffer containing the big-endian unsigned 128-bit integer representation of the input number.\n */\nexport function bigintToUInt128BE(n: bigint, bufferSize = 16) {\n return toBufferBE(n, bufferSize);\n}\n\n/**\n * Serialize a number into a big-endian signed 32-bit integer Buffer with the specified buffer size.\n * This function converts the input number into its binary representation and stores it in a Buffer\n * with the provided buffer size. By default, the buffer size is set to 4 bytes which represents a 32-bit integer.\n * The function will use the last 4 bytes of the buffer to store the serialized number. If the input number\n * is outside the range of a 32-bit signed integer, the resulting serialization may be incorrect due to truncation.\n *\n * @param n - The number to be serialized as a signed 32-bit integer.\n * @param bufferSize - Optional, the size of the output Buffer (default is 4 bytes).\n * @returns A Buffer containing the serialized big-endian signed 32-bit integer.\n */\nexport function numToInt32BE(n: number, bufferSize = 4) {\n const buf = Buffer.alloc(bufferSize);\n buf.writeInt32BE(n, bufferSize - 4);\n return buf;\n}\n\n/**\n * Convert a number to an 8-bit unsigned integer and return it as a Buffer of length 1.\n * The input number is written as an 8-bit unsigned integer into the buffer. This function\n * is useful for converting small numeric values to a standardized binary format that can be\n * easily stored or transmitted.\n *\n * @param n - The number to be converted to an 8-bit unsigned integer.\n * @returns A Buffer containing the 8-bit unsigned integer representation of the input number.\n */\nexport function numToUInt8(n: number) {\n const bufferSize = 1;\n const buf = Buffer.alloc(bufferSize);\n buf.writeUInt8(n, 0);\n return buf;\n}\n\n/**\n * Adds a 4-byte byte-length prefix to a buffer.\n * @param buf - The input Buffer to be prefixed\n * @returns A Buffer with 4-byte byte-length prefix.\n */\nexport function prefixBufferWithLength(buf: Buffer) {\n const lengthBuf = Buffer.alloc(4);\n lengthBuf.writeUInt32BE(buf.length, 0);\n return Buffer.concat([lengthBuf, buf]);\n}\n\n/**\n * Parse a buffer as a big integer.\n */\nexport function toBigInt(buf: Buffer): bigint {\n const hex = buf.toString('hex');\n if (hex.length === 0) {\n return BigInt(0);\n }\n return BigInt(`0x${hex}`);\n}\n\n/**\n * Stores full 256 bits of information in 2 fields.\n * @param buf - 32 bytes of data\n * @returns 2 field elements\n */\nexport function to2Fields(buf: Buffer): [Fr, Fr] {\n if (buf.length !== 32) {\n throw new Error('Buffer must be 32 bytes');\n }\n\n // Split the hash into two fields, a high and a low\n const buf1 = Buffer.concat([Buffer.alloc(16), buf.subarray(0, 16)]);\n const buf2 = Buffer.concat([Buffer.alloc(16), buf.subarray(16, 32)]);\n\n return [Fr.fromBuffer(buf1), Fr.fromBuffer(buf2)];\n}\n\n/**\n * Reconstructs the original 32 bytes of data from 2 field elements.\n * @param field1 - First field element\n * @param field2 - Second field element\n * @returns 32 bytes of data as a Buffer\n */\nexport function from2Fields(field1: Fr, field2: Fr): Buffer {\n // Convert the field elements back to buffers\n const buf1 = field1.toBuffer();\n const buf2 = field2.toBuffer();\n\n // Remove the padding (first 16 bytes) from each buffer\n const originalPart1 = buf1.subarray(Fr.SIZE_IN_BYTES / 2, Fr.SIZE_IN_BYTES);\n const originalPart2 = buf2.subarray(Fr.SIZE_IN_BYTES / 2, Fr.SIZE_IN_BYTES);\n\n // Concatenate the two parts to form the original buffer\n return Buffer.concat([originalPart1, originalPart2]);\n}\n\n/**\n * Truncates SHA hashes to match Noir's truncated version\n * @param buf - 32 bytes of data\n * @returns 31 bytes of data padded to 32\n */\nexport function truncateAndPad(buf: Buffer): Buffer {\n // Note that we always truncate here, to match solidity's sha256ToField()\n if (buf.length !== 32) {\n throw new Error('Buffer to truncate must be 32 bytes');\n }\n return Buffer.concat([Buffer.alloc(1), buf.subarray(0, 31)]);\n}\n\nexport function toHumanReadable(buf: Buffer, maxLen?: number): string {\n const result = buf.every(byte => byte >= 32 && byte <= 126) ? buf.toString('ascii') : `0x${buf.toString('hex')}`;\n if (maxLen && result.length > maxLen) {\n return result.slice(0, maxLen) + '...';\n }\n return result;\n}","import { toBigIntBE, toBufferBE } from '../bigint-buffer';\nimport { Fr } from '../fields/fields';\nimport { numToUInt32BE } from './free_funcs';\n\n/**\n * For serializing an array of fixed length buffers.\n * @param arr - Array of bufferable.\n * @param prefixLength - The length of the prefix (denominated in bytes).\n * @returns The serialized buffers.\n */\nexport function serializeArrayOfBufferableToVector(objs: Bufferable[], prefixLength = 4): Buffer {\n const arr = serializeToBufferArray(objs);\n let lengthBuf: Buffer;\n if (prefixLength === 1) {\n lengthBuf = Buffer.alloc(1);\n lengthBuf.writeUInt8(arr.length, 0);\n } else if (prefixLength === 4) {\n lengthBuf = Buffer.alloc(4);\n lengthBuf.writeUInt32BE(arr.length, 0);\n } else {\n throw new Error(`Unsupported prefix length. Got ${prefixLength}, expected 1 or 4`);\n }\n return Buffer.concat([lengthBuf, ...arr]);\n}\n\n/**\n * Helper function for deserializeArrayFromVector.\n */\ntype DeserializeFn<T> = (\n buf: Buffer,\n offset: number,\n) => {\n /**\n * The deserialized type.\n */\n elem: T;\n /**\n * How many bytes to advance by.\n */\n adv: number;\n};\n\n/**\n * Deserializes an array from a vector on an element-by-element basis.\n * @param deserialize - A function used to deserialize each element of the vector.\n * @param vector - The vector to deserialize.\n * @param offset - The position in the vector to start deserializing from.\n * @returns Deserialized array and how many bytes we advanced by.\n */\nexport function deserializeArrayFromVector<T>(\n deserialize: DeserializeFn<T>,\n vector: Buffer,\n offset = 0,\n): {\n /**\n * The deserialized array.\n */\n elem: T[];\n /**\n * How many bytes we advanced by.\n */\n adv: number;\n} {\n let pos = offset;\n const size = vector.readUInt32BE(pos);\n pos += 4;\n const arr = new Array<T>(size);\n for (let i = 0; i < size; ++i) {\n const { elem, adv } = deserialize(vector, pos);\n pos += adv;\n arr[i] = elem;\n }\n return { elem: arr, adv: pos - offset };\n}\n\n/**\n * Cast a uint8 array to a number.\n * @param array - The uint8 array.\n * @returns The number.\n */\nexport function uint8ArrayToNum(array: Uint8Array): number {\n const buf = Buffer.from(array);\n return buf.readUint32LE();\n}\n\n/**\n * Serializes a boolean to a buffer.\n * @param value - Value to serialize.\n * @returns The serialized boolean.\n */\nexport function boolToBuffer(value: boolean, bufferSize = 1): Buffer {\n const buf = Buffer.alloc(bufferSize);\n buf.writeUInt8(value ? 1 : 0, bufferSize - 1);\n return buf;\n}\n\n/**\n * Deserialize the 256-bit number at address `offset`.\n * @param buf - The buffer.\n * @param offset - The address.\n * @returns The deserialized 256-bit field.\n */\nexport function deserializeField(buf: Buffer, offset = 0) {\n const adv = 32;\n return { elem: buf.slice(offset, offset + adv), adv };\n}\n\n/** A type that can be written to a buffer. */\nexport type Bufferable =\n | boolean\n | Buffer\n | Uint8Array\n | number\n | bigint\n | string\n | {\n /**\n * Serialize to a buffer.\n */\n toBuffer: () => Buffer;\n }\n | Bufferable[];\n\n/** A type that can be converted to a Field or a Field array. */\nexport type Fieldable =\n | Fr\n | boolean\n | number\n | bigint\n | Buffer\n | {\n /**\n * Serialize to a field.\n * @dev Duplicate to `toField` but left as is as it is used in AVM codebase.\n */\n toFr: () => Fr;\n }\n | {\n /** Serialize to a field. */\n toField: () => Fr;\n }\n | {\n /** Serialize to an array of fields. */\n toFields: () => Fr[];\n }\n | Fieldable[];\n\n/**\n * Serializes a list of objects contiguously.\n * @param objs - Objects to serialize.\n * @returns A buffer list with the concatenation of all fields.\n */\nexport function serializeToBufferArray(...objs: Bufferable[]): Buffer[] {\n const ret: Buffer[] = [];\n for (const obj of objs) {\n if (Array.isArray(obj)) {\n ret.push(...serializeToBufferArray(...obj));\n } else if (Buffer.isBuffer(obj)) {\n ret.push(obj);\n } else if (typeof obj === 'boolean') {\n ret.push(boolToBuffer(obj));\n } else if (typeof obj === 'bigint') {\n // Throw if bigint does not fit into 32 bytes\n if (obj > BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')) {\n throw new Error(`BigInt ${obj} does not fit into 32 bytes`);\n }\n ret.push(serializeBigInt(obj));\n } else if (typeof obj === 'number') {\n // Note: barretenberg assumes everything is big-endian\n ret.push(numToUInt32BE(obj)); // TODO: Are we always passing numbers as UInt32?\n } else if (typeof obj === 'string') {\n ret.push(numToUInt32BE(obj.length));\n ret.push(Buffer.from(obj));\n } else if ('toBuffer' in obj) {\n ret.push(obj.toBuffer());\n } else {\n throw new Error(`Cannot serialize input to buffer: ${typeof obj} ${(obj as any).constructor?.name}`);\n }\n }\n return ret;\n}\n\n/**\n * Serializes a list of objects contiguously.\n * @param objs - Objects to serialize.\n * @returns An array of fields with the concatenation of all fields.\n */\nexport function serializeToFields(...objs: Fieldable[]): Fr[] {\n const ret: Fr[] = [];\n for (const obj of objs) {\n if (Array.isArray(obj)) {\n ret.push(...serializeToFields(...obj));\n } else if (obj instanceof Fr) {\n ret.push(obj);\n } else if (typeof obj === 'boolean' || typeof obj === 'number' || typeof obj === 'bigint') {\n ret.push(new Fr(obj));\n } else if ('toFields' in obj) {\n ret.push(...obj.toFields());\n } else if ('toFr' in obj) {\n ret.push(obj.toFr());\n } else if ('toField' in obj) {\n ret.push(obj.toField());\n } else if (Buffer.isBuffer(obj)) {\n ret.push(Fr.fromBuffer(obj));\n } else {\n throw new Error(`Cannot serialize input to field: ${typeof obj} ${(obj as any).constructor?.name}`);\n }\n }\n return ret;\n}\n\n/**\n * Serializes a list of objects contiguously.\n * @param objs - Objects to serialize.\n * @returns A single buffer with the concatenation of all fields.\n */\nexport function serializeToBuffer(...objs: Bufferable[]): Buffer {\n return Buffer.concat(serializeToBufferArray(...objs));\n}\n\n/**\n * Returns a user-friendly JSON representation of an object, showing buffers as hex strings.\n * @param obj - Object to json-stringify.\n * @returns A JSON string.\n */\nexport function toFriendlyJSON(obj: object): string {\n return JSON.stringify(\n obj,\n (_key, value) => {\n if (value !== null && typeof value === 'object' && value.type === 'Buffer' && Array.isArray(value.data)) {\n return '0x' + Buffer.from(value.data).toString('hex');\n } else if (typeof value === 'bigint') {\n return value.toString();\n } else if (\n value &&\n (\n value as {\n /**\n * Signature of the target serialization function.\n */\n toFriendlyJSON: () => string;\n }\n ).toFriendlyJSON\n ) {\n return value.toFriendlyJSON();\n } else if (value && value.type && ['Fr', 'Fq', 'AztecAddress', 'EthAddress'].includes(value.type)) {\n return value.value;\n } else {\n return value;\n }\n },\n 2,\n );\n}\n\n/**\n * Serialize a BigInt value into a Buffer of specified width.\n * The function converts the input BigInt into its big-endian representation and stores it in a Buffer of the given width.\n * If the width is not provided, a default value of 32 bytes will be used. It is important to provide an appropriate width\n * to avoid truncation or incorrect serialization of large BigInt values.\n *\n * @param n - The BigInt value to be serialized.\n * @param width - The width (in bytes) of the output Buffer, optional with default value 32.\n * @returns A Buffer containing the serialized BigInt value in big-endian format.\n */\nexport function serializeBigInt(n: bigint, width = 32) {\n return toBufferBE(n, width);\n}\n\n/**\n * Deserialize a big integer from a buffer, given an offset and width.\n * Reads the specified number of bytes from the buffer starting at the offset, converts it to a big integer, and returns the deserialized result along with the number of bytes read (advanced).\n *\n * @param buf - The buffer containing the big integer to be deserialized.\n * @param offset - The position in the buffer where the big integer starts. Defaults to 0.\n * @param width - The number of bytes to read from the buffer for the big integer. Defaults to 32.\n * @returns An object containing the deserialized big integer value ('elem') and the number of bytes advanced ('adv').\n */\nexport function deserializeBigInt(buf: Buffer, offset = 0, width = 32) {\n return { elem: toBigIntBE(buf.subarray(offset, offset + width)), adv: width };\n}\n\n/**\n * Serializes a Date object into a Buffer containing its timestamp as a big integer value.\n * The resulting Buffer has a fixed width of 8 bytes, representing a 64-bit big-endian integer.\n * This function is useful for converting date values into a binary format that can be stored or transmitted easily.\n *\n * @param date - The Date object to be serialized.\n * @returns A Buffer containing the serialized timestamp of the input Date object.\n */\nexport function serializeDate(date: Date) {\n return serializeBigInt(BigInt(date.getTime()), 8);\n}\n\n/**\n * Deserialize a boolean value from a given buffer at the specified offset.\n * Reads a single byte at the provided offset in the buffer and returns\n * the deserialized boolean value along with the number of bytes read (adv).\n *\n * @param buf - The buffer containing the serialized boolean value.\n * @param offset - The position in the buffer to start reading the boolean value.\n * @returns An object containing the deserialized boolean value (elem) and the number of bytes read (adv).\n */\nexport function deserializeBool(buf: Buffer, offset = 0) {\n const adv = 1;\n return { elem: buf.readUInt8(offset), adv };\n}\n\n/**\n * Deserialize a 4-byte unsigned integer from a buffer, starting at the specified offset.\n * The deserialization reads 4 bytes from the given buffer and converts it into a number.\n * Returns an object containing the deserialized unsigned integer and the number of bytes advanced (4).\n *\n * @param buf - The buffer containing the serialized unsigned integer.\n * @param offset - The starting position in the buffer to deserialize from (default is 0).\n * @returns An object with the deserialized unsigned integer as 'elem' and the number of bytes advanced ('adv') as 4.\n */\nexport function deserializeUInt32(buf: Buffer, offset = 0) {\n const adv = 4;\n return { elem: buf.readUInt32BE(offset), adv };\n}\n\n/**\n * Deserialize a signed 32-bit integer from a buffer at the given offset.\n * The input 'buf' should be a Buffer containing binary data, and 'offset' should be the position in the buffer\n * where the signed 32-bit integer starts. Returns an object with both the deserialized integer (elem) and the\n * number of bytes advanced in the buffer (adv, always equal to 4).\n *\n * @param buf - The buffer containing the binary data.\n * @param offset - Optional, the position in the buffer where the signed 32-bit integer starts (default is 0).\n * @returns An object with the deserialized integer as 'elem' and the number of bytes advanced as 'adv'.\n */\nexport function deserializeInt32(buf: Buffer, offset = 0) {\n const adv = 4;\n return { elem: buf.readInt32BE(offset), adv };\n}","import { BarretenbergSync, Fr as FrBarretenberg } from '@aztec/bb.js';\n\nimport { Fr } from '../../fields/fields';\nimport { Fieldable, serializeToFields } from '../../serialize/serialize';\n\n/**\n * Create a poseidon hash (field) from an array of input fields.\n * @param input - The input fields to hash.\n * @returns The poseidon hash.\n */\nexport async function poseidon2Hash(input: Fieldable[]): Promise<Fr> {\n const inputFields = serializeToFields(input);\n const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);\n const hash = api.poseidon2Hash(\n inputFields.map(i => new FrBarretenberg(i.toBuffer())), // TODO(#4189): remove this stupid conversion\n );\n return Fr.fromBuffer(Buffer.from(hash.toBuffer()));\n}","import { Fq, Fr } from '../fields/fields';\n\n/**\n * The FieldReader class provides a utility for reading various data types from a field array.\n *\n * Usage:\n * Create a new instance of FieldReader with an array of fields and an optional offset.\n * Use the provided methods to read desired data types from the field array.\n * The reading methods automatically advance the internal index.\n */\nexport class FieldReader {\n private index: number;\n private readonly length: number;\n\n constructor(\n private fields: Fr[],\n offset = 0,\n ) {\n this.index = offset;\n this.length = fields.length;\n if (offset > this.length) {\n throw new Error('Offset out of bounds.');\n }\n }\n\n /**\n * Creates a FieldReader instance from either a field array or an existing FieldReader.\n *\n * @param fields - A field array or FieldReader to initialize the FieldReader.\n * @returns An instance of FieldReader.\n */\n public static asReader(fields: Fr[] | FieldReader): FieldReader {\n if (fields instanceof FieldReader) {\n return fields;\n }\n\n return new FieldReader(fields);\n }\n\n /**\n * Returns the current cursor position.\n *\n * @returns The current cursor position.\n */\n public get cursor() {\n return this.index;\n }\n\n public remainingFields(): number {\n return this.length - this.index;\n }\n\n /**\n * Skips the next n fields.\n *\n * @param n - The number of fields to skip.\n */\n public skip(n: number) {\n if (this.index + n > this.length) {\n throw new Error('Not enough fields to be consumed.');\n }\n this.index += n;\n }\n\n /**\n * Reads a single field from the array.\n *\n * @returns A field.\n */\n public readField(): Fr {\n if (this.index === this.length) {\n throw new Error('Not enough fields to be consumed.');\n }\n return this.fields[this.index++];\n }\n\n /**\n * Peeks at the next field without advancing the cursor.\n *\n * @returns A field.\n */\n public peekField(): Fr {\n if (this.index === this.length) {\n throw new Error('Not enough fields to be consumed.');\n }\n return this.fields[this.index];\n }\n\n /**\n * Reads a Fq from the array.\n *\n * @returns An Fq.\n */\n public readFq(): Fq {\n return Fq.fromHighLow(this.readField(), this.readField());\n }\n\n /**\n * Reads and returns the next boolean value from the field array.\n * Advances the internal index by 1, treating the field at the current index as a boolean value.\n * Returns true if the field is non-zero, false otherwise.\n * Throw if the value is not 0 or 1.\n *\n * @returns A boolean value representing the field at the current index.\n */\n public readBoolean(): boolean {\n const field = this.readField();\n const value = field.toBigInt();\n if (value > 1n) {\n throw new Error('Field is not a boolean.');\n }\n return value == 1n;\n }\n\n /**\n * Reads a 32-bit unsigned integer from the field array at the current index position.\n * Updates the index position by 1 after reading the number.\n * Throw if the value is greater than 2 ** 32.\n *\n * @returns The read 32-bit unsigned integer value.\n */\n public readU32(): number {\n const field = this.readField();\n const value = field.toBigInt();\n if (value >= 1n << 32n) {\n throw new Error('Field is not a u32.');\n }\n return Number(value);\n }\n\n /**\n * Reads a serialized object from a field array and returns the deserialized object using the given deserializer.\n *\n * @typeparam T - The type of the deserialized object.\n * @param deserializer - An object with a 'fromFields' method that takes a FieldReader instance and returns an instance of the deserialized object.\n * @returns The deserialized object of type T.\n */\n public readObject<T>(deserializer: {\n /**\n * A method that takes a FieldReader instance and returns an instance of the deserialized data type.\n */\n fromFields: (reader: FieldReader) => T;\n }): T {\n return deserializer.fromFields(this);\n }\n\n /**\n * Returns whether the reader has finished reading all fields.\n * @returns A bool.\n */\n public isFinished(): boolean {\n return this.index >= this.length;\n }\n}","export function hasHexPrefix(str: string): boolean {\n return str.startsWith('0x');\n}\n\nexport function withoutHexPrefix(str: string): string {\n return hasHexPrefix(str) ? str.slice(2) : str;\n}\n\nexport function isHex(str: string): boolean {\n return /^(0x)?[0-9a-fA-F]*$/.test(str);\n}\n\nexport function hexToBuffer(str: string): Buffer {\n return Buffer.from(withoutHexPrefix(str), 'hex');\n}\n\nexport function bufferToHex(buffer: Buffer): string {\n return `0x${buffer.toString('hex')}`;\n}\n\nexport function pluralize(str: string, count: number | bigint, plural?: string): string {\n return count === 1 || count === 1n ? str : (plural ?? `${str}s`);\n}\n\nexport function count(count: number | bigint, str: string, plural?: string): string {\n return `${count} ${pluralize(str, count, plural)}`;\n}\n\nexport function truncate(str: string, length: number = 64): string {\n return str.length > length ? str.slice(0, length) + '...' : str;\n}\n\nexport function isoDate(date?: Date) {\n return (date ?? new Date()).toISOString().replace(/[-:T]/g, '').replace(/\\..+$/, '');\n}\n\nexport function urlJoin(...args: string[]): string {\n return args.map(arg => arg.replace(/\\/+$/, '').replace(/^\\/+/, '')).join('/');\n}","import { poseidon2Hash } from '../crypto/poseidon';\nimport { BufferReader } from '../serialize/buffer_reader';\nimport { FieldReader } from '../serialize/field_reader';\nimport { serializeToBuffer } from '../serialize/serialize';\nimport { bufferToHex, hexToBuffer } from '../string';\nimport { Fr } from './fields';\n\n/**\n * Represents a Point on an elliptic curve with x and y coordinates.\n * The Point class provides methods for creating instances from different input types,\n * converting instances to various output formats, and checking the equality of points.\n * TODO(#7386): Clean up this class.\n */\nexport class Point {\n static ZERO = new Point(Fr.ZERO, Fr.ZERO, false);\n static SIZE_IN_BYTES = Fr.SIZE_IN_BYTES * 2;\n static COMPRESSED_SIZE_IN_BYTES = Fr.SIZE_IN_BYTES;\n\n /** Used to differentiate this class from AztecAddress */\n public readonly kind = 'point';\n\n constructor(\n /**\n * The point's x coordinate\n */\n public readonly x: Fr,\n /**\n * The point's y coordinate\n */\n public readonly y: Fr,\n /**\n * Whether the point is at infinity\n */\n public readonly isInfinite: boolean,\n ) {\n // TODO(#7386): check if on curve\n }\n\n toJSON() {\n return this.toString();\n }\n\n /**\n * Create a Point instance from a given buffer or BufferReader.\n * The input 'buffer' should have exactly 64 bytes representing the x and y coordinates.\n *\n * @param buffer - The buffer or BufferReader containing the x and y coordinates of the point.\n * @returns A Point instance.\n */\n static fromBuffer(buffer: Buffer | BufferReader) {\n const reader = BufferReader.asReader(buffer);\n return new this(Fr.fromBuffer(reader), Fr.fromBuffer(reader), false);\n }\n\n /**\n * Create a Point instance from a hex-encoded string.\n * The input should be prefixed with '0x' or not, and have exactly 128 hex characters representing the x and y coordinates.\n * Throws an error if the input length is invalid or coordinate values are out of range.\n *\n * @param str - The hex-encoded string representing the Point coordinates.\n * @returns A Point instance.\n */\n static fromString(str: string) {\n return this.fromBuffer(hexToBuffer(str));\n }\n\n /**\n * Returns the contents of the point as an array of 2 fields.\n * @returns The point as an array of 2 fields\n */\n toFields() {\n return [this.x, this.y, new Fr(this.isInfinite)];\n }\n\n static fromFields(fields: Fr[] | FieldReader) {\n const reader = FieldReader.asReader(fields);\n return new this(reader.readField(), reader.readField(), reader.readBoolean());\n }\n\n\n /**\n * Returns the x coordinate and the sign of the y coordinate.\n * @dev The y sign can be determined by checking if the y coordinate is greater than half of the modulus.\n * @returns The x coordinate and the sign of the y coordinate.\n */\n toXAndSign(): [Fr, boolean] {\n return [this.x, this.y.toBigInt() <= (Fr.MODULUS - 1n) / 2n];\n }\n\n /**\n * Returns the contents of the point as BigInts.\n * @returns The point as BigInts\n */\n toBigInts() {\n return {\n x: this.x.toBigInt(),\n y: this.y.toBigInt(),\n isInfinite: this.isInfinite ? 1n : 0n,\n };\n }\n\n /**\n * Converts the Point instance to a Buffer representation of the coordinates.\n * @returns A Buffer representation of the Point instance.\n * @dev Note that toBuffer does not include the isInfinite flag and other serialization methods do (e.g. toFields).\n * This is because currently when we work with point as bytes we don't want to populate the extra bytes for\n * isInfinite flag because:\n * 1. Our Grumpkin BB API currently does not handle point at infinity,\n * 2. we use toBuffer when serializing notes and events and there we only work with public keys and point at infinity\n * is not considered a valid public key and the extra byte would raise DA cost.\n */\n toBuffer() {\n if (this.isInfinite) {\n throw new Error('Cannot serialize infinite point with isInfinite flag');\n }\n const buf = serializeToBuffer([this.x, this.y]);\n if (buf.length !== Point.SIZE_IN_BYTES) {\n throw new Error(`Invalid buffer length for Point: ${buf.length}`);\n }\n return buf;\n }\n\n /**\n * Converts the Point instance to a compressed Buffer representation of the coordinates.\n * @returns A Buffer representation of the Point instance\n */\n toCompressedBuffer() {\n const [x, sign] = this.toXAndSign();\n // Here we leverage that Fr fits into 254 bits (log2(Fr.MODULUS) < 254) and given that we serialize Fr to 32 bytes\n // and we use big-endian the 2 most significant bits are never populated. Hence we can use one of the bits as\n // a sign bit.\n const compressedValue = x.toBigInt() + (sign ? 2n ** 255n : 0n);\n const buf = serializeToBuffer(compressedValue);\n if (buf.length !== Point.COMPRESSED_SIZE_IN_BYTES) {\n throw new Error(`Invalid buffer length for compressed Point: ${buf.length}`);\n }\n return buf;\n }\n\n /**\n * Convert the Point instance to a hexadecimal string representation.\n * The output string is prefixed with '0x' and consists of exactly 128 hex characters,\n * representing the concatenated x and y coordinates of the point.\n *\n * @returns A hex-encoded string representing the Point instance.\n */\n toString() {\n return bufferToHex(this.toBuffer());\n }\n\n /**\n * Generate a short string representation of the Point instance.\n * The returned string includes the first 10 and last 4 characters of the full string representation,\n * with '...' in between to indicate truncation. This is useful for displaying or logging purposes\n * when the full string representation may be too long.\n *\n * @returns A truncated string representation of the Point instance.\n */\n toShortString() {\n const str = this.toString();\n return `${str.slice(0, 10)}...${str.slice(-4)}`;\n }\n\n toNoirStruct() {\n /* eslint-disable camelcase */\n return { x: this.x, y: this.y, is_infinite: this.isInfinite };\n /* eslint-enable camelcase */\n }\n\n // Used for IvpkM, OvpkM, NpkM and TpkM. TODO(#8124): Consider removing this method.\n toWrappedNoirStruct() {\n return { inner: this.toNoirStruct() };\n }\n\n /**\n * Check if two Point instances are equal by comparing their buffer values.\n * Returns true if the buffer values are the same, and false otherwise.\n *\n * @param rhs - The Point instance to compare with the current instance.\n * @returns A boolean indicating whether the two Point instances are equal.\n */\n equals(rhs: Point) {\n return this.x.equals(rhs.x) && this.y.equals(rhs.y);\n }\n\n isZero() {\n return this.x.isZero() && this.y.isZero();\n }\n\n hash() {\n return poseidon2Hash(this.toFields());\n }\n\n /**\n * Check if this is point at infinity.\n * Check this is consistent with how bb is encoding the point at infinity\n */\n public get inf() {\n return this.isInfinite;\n }\n}\n\nexport class NotOnCurveError extends Error {\n constructor(x: Fr) {\n super('The given x-coordinate is not on the Grumpkin curve: ' + x.toString());\n this.name = 'NotOnCurveError';\n }\n}","import { BarretenbergSync } from '@aztec/bb.js';\n\nimport { concatenateUint8Arrays } from '../serialize';\nimport { SchnorrSignature } from './signature';\nimport { GrumpkinScalar } from '../../fields/fields';\nimport { Point } from '../../fields/point';\nimport { numToInt32BE } from '../../serialize/free_funcs';\n\nexport * from './signature';\n\n/**\n * Schnorr signature construction and helper operations.\n */\nexport class Schnorr {\n /**\n * Computes a grumpkin public key from a private key.\n * @param privateKey - The private key.\n * @returns A grumpkin public key.\n */\n public async computePublicKey(privateKey: GrumpkinScalar): Promise<Point> {\n const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);\n const [result] = api.getWasm().callWasmExport('schnorr_compute_public_key', [privateKey.toBuffer()], [64]);\n return Point.fromBuffer(Buffer.from(result));\n }\n\n /**\n * Constructs a Schnorr signature given a msg and a private key.\n * @param msg - Message over which the signature is constructed.\n * @param privateKey - The private key of the signer.\n * @returns A Schnorr signature of the form (s, e).\n */\n public async constructSignature(msg: Uint8Array, privateKey: GrumpkinScalar) {\n const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);\n const messageArray = concatenateUint8Arrays([numToInt32BE(msg.length), msg]);\n const [s, e] = api\n .getWasm()\n .callWasmExport('schnorr_construct_signature', [messageArray, privateKey.toBuffer()], [32, 32]);\n \n return new SchnorrSignature(Buffer.from(concatenateUint8Arrays([s,e])));\n }\n}","import { Fq, Fr } from \"../aztec/fields/fields\";\nimport { Schnorr } from \"../aztec/crypto/schnorr\";\n\nexport async function generateKeyPair(signature: string): Promise<[[Fr, Fr], Fr]> {\n const privateKey = Fr.fromBufferReduce(Buffer.from(signature.replace(\"0x\", \"\"), \"hex\"));\n const schnorr = new Schnorr();\n const publicKey = await schnorr.computePublicKey(Fq.fromBufferReduce(privateKey.toBuffer()));\n return [[publicKey.x, publicKey.y], privateKey];\n}","import { hexlify32 } from '../utils/util';\nimport { ethers } from 'ethers';\nimport MerkleAbi from '../abis/MerkleTreeOperator.json';\nimport { NoteOnChainStatus } from '../entities';\nimport { DarkSwap } from '../darkSwap';\nimport { DarkSwapNote } from '../types';\nimport { calcNullifier } from '../proof/noteService';\nimport { generateKeyPair } from '../proof/keyService';\nimport { Fr } from '../aztec/fields/fields';\n\nfunction getContract(address: string, darkSwap: DarkSwap) {\n const provider = darkSwap.provider;\n return new ethers.Contract(address, MerkleAbi.abi, provider);\n}\n\nasync function getNoteOnChainStatus(darkSwap: DarkSwap, note: string, nullifier: string) {\n const contract = getContract(darkSwap.contracts.merkleTreeOperator, darkSwap);\n const isNotCreated = (await contract.noteIsNotCreated(note)) as boolean;\n if (isNotCreated) {\n return NoteOnChainStatus.UNKNOWN;\n }\n const isSpent = (await contract.nullifiersUsed(nullifier)) as boolean;\n if (isSpent) {\n return NoteOnChainStatus.SPENT;\n }\n const isLocked = (await contract.nullifiersLocked(nullifier)) as boolean;\n if (isLocked) {\n return NoteOnChainStatus.LOCKED;\n }\n return NoteOnChainStatus.ACTIVE;\n}\n\nexport async function getNoteOnChainStatusByPublicKey(\n darkSwap: DarkSwap,\n note: DarkSwapNote,\n publicKey: [Fr, Fr]\n): Promise<NoteOnChainStatus> {\n const nullifier = calcNullifier(note.rho, publicKey);\n const onChainStatus = await getNoteOnChainStatus(darkSwap, hexlify32(note.note), hexlify32(nullifier));\n return onChainStatus;\n}\n\nexport async function getNoteOnChainStatusBySignature(\n darkSwap: DarkSwap,\n note: DarkSwapNote,\n signature: string\n): Promise<NoteOnChainStatus> {\n const [publicKey] = await generateKeyPair(signature);\n const nullifier = calcNullifier(note.rho, publicKey);\n const onChainStatus = await getNoteOnChainStatus(darkSwap, hexlify32(note.note), hexlify32(nullifier));\n return onChainStatus;\n}\n\nexport async function isNoteActive(darkSwap: DarkSwap, note: DarkSwapNote, publicKey: [Fr, Fr]): Promise<boolean> {\n const nullifier = calcNullifier(note.rho, publicKey);\n const onChainStatus = await getNoteOnChainStatus(darkSwap, hexlify32(note.note), hexlify32(nullifier));\n return onChainStatus === NoteOnChainStatus.ACTIVE;\n}\n\nexport async function isNoteSpent(darkSwap: DarkSwap, note: DarkSwapNote, publicKey: [Fr, Fr]) {\n const nullifier = calcNullifier(note.rho, publicKey);\n const onChainStatus = await getNoteOnChainStatus(darkSwap, hexlify32(note.note), hexlify32(nullifier));\n return onChainStatus === NoteOnChainStatus.SPENT;\n}\n\nexport async function isNoteValid(darkSwap: DarkSwap, note: DarkSwapNote, publicKey: [Fr, Fr]) {\n const nullifier = calcNullifier(note.rho, publicKey);\n const onChainStatus = await getNoteOnChainStatus(darkSwap, hexlify32(note.note), hexlify32(nullifier));\n return onChainStatus === NoteOnChainStatus.ACTIVE;\n}\n\nexport async function getNullifierBySignature(note: DarkSwapNote, signature: string): Promise<string> {\n const [publicKey] = await generateKeyPair(signature);\n return hexlify32(calcNullifier(note.rho, publicKey));\n}\n\nexport async function isNoteCreated(darkSwap: DarkSwap, note: bigint) {\n const contract = getContract(darkSwap.contracts.merkleTreeOperator, darkSwap);\n const isNotCreated = (await contract.noteIsNotCreated(hexlify32(note))) as boolean;\n return !isNotCreated;\n}\n","export enum ChainId {\n HARDHAT = 31337,\n HARDHAT_ARBITRUM = 31338,\n HARDHAT_BASE = 31339,\n MAINNET = 1,\n SEPOLIA = 11155111,\n BASE_SEPOLIA = 84532,\n HORIZEN_TESTNET = 845320009,\n ARBITRUM_ONE = 42161,\n BASE = 8453,\n}\n","import { ChainId } from './chain';\n\nexport const legacyTokenConfig: { [chainId: number]: string[] } = {\n [ChainId.MAINNET]: ['0xdac17f958d2ee523a2206206994597c13d831ec7'],\n [ChainId.HARDHAT]: ['0xdac17f958d2ee523a2206206994597c13d831ec7']\n};\n\nconst confirmationsConfig: { [chainId: number]: number } = {\n [ChainId.MAINNET]: 3,\n [ChainId.ARBITRUM_ONE]: 3,\n [ChainId.BASE]: 3,\n [ChainId.SEPOLIA]: 3,\n [ChainId.HARDHAT]: 3,\n}\n\nconst DEFAULT_CONFIRMATIONS = 3;\n\nexport const getConfirmations = (chainId: number) => confirmationsConfig[chainId] || DEFAULT_CONFIRMATIONS;\n\nexport const DEFAULT_FEE_RATIO = 300n;\n\nexport const GAS_LIMIT_MULTIPLIER = 120n;\nexport const GAS_LIMIT_PRECISION = 100n;","import { Fr } from \"./aztec/fields/fields\";\n\nexport type Hex = string;\n\nexport enum PROOF_DOMAIN {\n DEPOSIT = 10001,\n WITHDRAW = 10002,\n RETAIL_CREATE_ORDER = 10003,\n PRO_CREATE_ORDER = 10004,\n PRO_SWAP = 10005,\n PRO_CANCEL_ORDER = 10006,\n RETAIL_CANCEL_ORDER = 10007,\n JOIN = 10008,\n TRIPLE_JOIN = 10009,\n RETAIL_SWAP = 10010,\n RETAIL_BRIDGE_ORDER = 20003,\n}\n\nexport const EMPTY_NULLIFIER = 0n;\nexport const EMPTY_FOOTER = 0n;\n\nexport const FEE_RATIO_PRECISION = 1000000n;\n\nexport class DarkSwapProofError extends Error {\n constructor(message: string) {\n super(message)\n this.name = 'DarkSwapProofError'\n Object.setPrototypeOf(this, DarkSwapProofError.prototype)\n }\n}\n\nexport type DarkSwapNote = CreateNoteParam & {\n note: bigint,\n}\nexport type DarkSwapOrderNote = DarkSwapNote & {\n feeRatio: bigint,\n}\n\nexport type DarkSwapOrderNoteExt = DarkSwapOrderNote & {\n nullifier: string,\n}\n\nexport type CreateNoteParam = {\n address: string,\n rho: bigint,\n amount: bigint,\n asset: string,\n}\n\nexport type DarkSwapNoteExt = DarkSwapNote & { footer: bigint }\n\n\nexport type BaseProofParam = {\n address: string,\n signedMessage: string,\n}\n\nexport type BaseProofResult = {\n proof: string,\n verifyInputs: string[],\n}\n\nexport type BaseProofInput = {\n address: string,\n pub_key: [string, string],\n signature: any\n}\n\nexport type DarkSwapMessage = {\n address: string,\n orderNote: DarkSwapOrderNote,\n orderNullifier: string,\n inNote: DarkSwapNote,\n feeAmount: bigint,\n publicKey: [Fr, Fr],\n signature: string,\n}","export function bn_to_hex(n: bigint) {\n return n.toString(16).padStart(64, \"0\");\n}\n\nexport function bn_to_0xhex(n: bigint) {\n return \"0x\" + bn_to_hex(n);\n}\n\nexport function bn_to_0xAddress(n: bigint) {\n return \"0x\" + n.toString(16).padStart(40, \"0\");\n}","\n\nexport function mergeUnit8Array(arr1: Uint8Array, arr2: Uint8Array) {\n return Array.from(arr1).concat(Array.from(arr2));\n}\n\n\nexport function signatureToHexString(sig: Buffer): string {\n return '0x' + sig.toString('hex');\n}\n\nexport function hexStringToSignature(hex: string): Uint8Array {\n return Buffer.from(hex.replace(/^0x/i, ''), 'hex')\n}\n\nexport function uint8ArrayToNumberArray(uint8Array: Uint8Array): number[] {\n return Array.from(uint8Array).map((x) => x);\n}\n","import { UltraHonkBackend } from \"@aztec/bb.js\";\nimport { Schnorr } from \"../aztec/crypto/schnorr\";\nimport { Fq, Fr } from \"../aztec/fields/fields\";\nimport { Noir } from \"@noir-lang/noir_js\";\nimport { hexlify } from \"ethers\";\n\nexport async function generateProof(\n circuit: any,\n inputs: any,\n) {\n\n const start_time = new Date().getTime();\n const backend = new UltraHonkBackend(circuit.bytecode);\n\n const noir = new Noir(circuit);\n try {\n const { witness } = await noir.execute(inputs);\n const proof = await backend.generateProof(witness, { keccak: true });\n console.log(\"Proof generated in \" + (new Date().getTime() - start_time) + \"ms\");\n\n return { proof: hexlify(proof.proof), verifyInputs: proof.publicInputs };\n } finally {\n const destroy_start_time = new Date().getTime();\n await backend.destroy();\n console.log(\"Destroyed in \" + (new Date().getTime() - destroy_start_time) + \"ms\");\n }\n}\n\n\nexport async function signMessage(message: string, fuzkPriKey: Fr) {\n const schnorr = new Schnorr();\n const signature = await schnorr.constructSignature(Buffer.from(message, \"hex\").reverse(), Fq.fromBufferReduce(fuzkPriKey.toBuffer()));\n return signature.toBuffer();\n}","import depositCircuit from \"../../circuits/pro/dark_swap_deposit_compiled_circuit.json\";\nimport { BaseProofParam, BaseProofResult, DarkSwapNote, DarkSwapProofError, EMPTY_NULLIFIER, PROOF_DOMAIN } from \"../../types\";\nimport { encodeAddress } from \"../../utils/encoders\";\nimport { bn_to_0xhex, bn_to_hex } from \"../../utils/formatters\";\nimport { mimc_bn254 } from \"../../utils/mimc\";\nimport { uint8ArrayToNumberArray } from \"../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../baseProofService\";\nimport { generateKeyPair } from \"../keyService\";\nimport { calcNullifier, getNoteFooter } from \"../noteService\";\n\ntype DepositProofInput = {\n merkle_root: string,\n merkle_index: number[],\n merkle_path: string[],\n\n address: string,\n asset: string,\n\n in_amount: string,\n\n existing_note: string,\n existing_amount: string,\n existing_rho: string,\n existing_nullifier: string,\n\n account_note: string,\n account_rho: string,\n account_note_footer: string,\n\n pub_key: [string, string],\n signature: any\n}\n\nexport type DepositProofParam = BaseProofParam & {\n merkleRoot: string,\n merkleIndex: number[],\n merklePath: string[],\n oldBalanceNote: DarkSwapNote,\n newBalanceNote: DarkSwapNote,\n}\n\nexport type DepositProofResult = BaseProofResult & {\n oldBalanceNullifier: string,\n newBalanceFooter: string,\n}\n\nexport async function generateDepositProof(param: DepositProofParam): Promise<DepositProofResult> {\n const depositAmount = param.newBalanceNote.amount - param.oldBalanceNote.amount;\n if (depositAmount <= 0) {\n throw new DarkSwapProofError(\"Deposit amount must be greater than 0\");\n }\n\n if (param.oldBalanceNote.amount < 0n) {\n throw new DarkSwapProofError(\"Old balance note amount must be greater or equal to 0\");\n }\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.signedMessage);\n\n let oldBalanceNullifier = EMPTY_NULLIFIER;\n if (param.oldBalanceNote.amount != 0n) {\n oldBalanceNullifier = calcNullifier(param.oldBalanceNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n }\n\n const newBalanceFooter = getNoteFooter(param.newBalanceNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n\n const addressMod = encodeAddress(param.address);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.DEPOSIT),\n oldBalanceNullifier,\n addressMod,\n param.newBalanceNote.note,\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: DepositProofInput = {\n merkle_root: param.merkleRoot,\n merkle_index: param.merkleIndex,\n merkle_path: param.merklePath.map((x) => bn_to_0xhex(BigInt(x))),\n\n address: bn_to_0xhex(addressMod),\n asset: bn_to_0xhex(encodeAddress(param.newBalanceNote.asset)),\n in_amount: bn_to_0xhex(depositAmount),\n existing_note: bn_to_0xhex(param.oldBalanceNote.note),\n existing_amount: bn_to_0xhex(param.oldBalanceNote.amount),\n existing_rho: bn_to_0xhex(param.oldBalanceNote.rho),\n existing_nullifier: bn_to_0xhex(oldBalanceNullifier),\n\n account_note: bn_to_0xhex(param.newBalanceNote.note),\n account_rho: bn_to_0xhex(param.newBalanceNote.rho),\n account_note_footer: bn_to_0xhex(newBalanceFooter),\n\n pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n signature: uint8ArrayToNumberArray(signature),\n };\n const proof = await generateProof(depositCircuit, inputs);\n return {\n ...proof,\n oldBalanceNullifier: inputs.existing_nullifier,\n newBalanceFooter: inputs.account_note_footer,\n }\n};","import { DarkSwap } from '../darkSwap';\n\nexport class BaseContext {\n private _address?: string;\n private _signature: string;\n private _merkleRoot?: string;\n private _tx?: string;\n\n constructor(signature: string) {\n this._signature = signature;\n }\n\n set address(address: string | undefined) {\n this._address = address;\n }\n\n get address(): string | undefined {\n return this._address;\n }\n\n get signature(): string {\n return this._signature;\n }\n\n set merkleRoot(merkleRoot: string | undefined) {\n this._merkleRoot = merkleRoot;\n }\n\n get merkleRoot(): string | undefined {\n return this._merkleRoot;\n }\n\n set tx(tx: string | undefined) {\n this._tx = tx;\n }\n\n get tx(): string | undefined {\n return this._tx;\n }\n}\n\n\nexport abstract class BaseContractService {\n protected _darkSwap: DarkSwap;\n\n constructor(_darkSwap: DarkSwap) {\n this._darkSwap = _darkSwap;\n }\n}","import { ethers } from 'ethers';\nimport MerkleAbi from '../abis/MerkleTreeOperator.json';\nimport { hexlify32 } from '../utils/util';\nimport { DarkSwap } from '../darkSwap';\n\n\nexport interface MerklePath {\n noteCommitment: bigint;\n path: string[];\n index: number[];\n root: string;\n}\n\nexport const EMPTY_PATH: MerklePath = {\n noteCommitment: 0n,\n path: Array(32).fill('0x0000000000000000000000000000000000000000000000000000000000000000'),\n index: Array(32).fill(0),\n root: '0x0000000000000000000000000000000000000000000000000000000000000000'\n}\n\nfunction getContract(address: string, darkSwap: DarkSwap) {\n const provider = darkSwap.provider;\n return new ethers.Contract(address, MerkleAbi.abi, provider);\n}\n\nexport async function getMerklePathAndRoot(note: bigint, darkSwap: DarkSwap): Promise<MerklePath> {\n const result = await multiGetMerklePathAndRoot([note], darkSwap);\n return result[0];\n}\n\nexport async function multiGetMerklePathAndRoot(notes: bigint[], darkSwap: DarkSwap): Promise<MerklePath[]> {\n const contract = getContract(darkSwap.contracts.merkleTreeOperator, darkSwap);\n\n const [root, paths, indexes] = await contract.getMultiMerklePaths(notes.map(note => hexlify32(note)));\n const results: MerklePath[] = [];\n for (let i = 0; i < notes.length; i++) {\n results.push({\n noteCommitment: notes[i],\n path: paths[i],\n index: indexes[i].map((x: boolean) => (x ? 1 : 0)),\n root\n });\n }\n\n return results;\n}\n","import { ChainId } from './chain';\n\nexport type ContractConfiguartion = {\n priceOracle: string;\n ethAddress: string;\n nativeWrapper: string;\n merkleTreeOperator: string;\n darkSwapAssetManager: string;\n darkSwapFeeAssetManager: string;\n synaraDarkSwapOnBridgeAssetManager: string;\n synaraBridge: string;\n synaraCanonicalTokenRegistry: string;\n zkverifyRelayerUrls: string[];\n};\n\nexport const contractConfig: { [chainId: number]: ContractConfiguartion } = {\n [ChainId.MAINNET]: {\n priceOracle: '0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8',\n ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',\n nativeWrapper: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',\n merkleTreeOperator: '0x0', //FIXME\n darkSwapAssetManager: '0x0', //FIXME\n darkSwapFeeAssetManager: '0x0', //FIXME\n synaraDarkSwapOnBridgeAssetManager: '0x0', //FIXME\n synaraBridge: '0x0', //FIXME\n synaraCanonicalTokenRegistry: '0x0', //FIXME\n zkverifyRelayerUrls: [],//FIXME\n },\n [ChainId.ARBITRUM_ONE]: {\n priceOracle: '0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8',\n ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',\n nativeWrapper: '0x82af49447d8a07e3bd95bd0d56f35241523fbab1',\n merkleTreeOperator: '0x0', //FIXME\n darkSwapAssetManager: '0x0', //FIXME\n darkSwapFeeAssetManager: '0x0', //FIXME\n synaraDarkSwapOnBridgeAssetManager: '0x0', //FIXME\n synaraBridge: '0x0', //FIXME\n synaraCanonicalTokenRegistry: '0x0', //FIXME\n zkverifyRelayerUrls: [],//FIXME\n },\n [ChainId.BASE]: {\n priceOracle: '0xf224a25453D76A41c4427DD1C05369BC9f498444',\n ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',\n nativeWrapper: '0x4200000000000000000000000000000000000006',\n merkleTreeOperator: '0x918B4F76CAE5F67A3818D8eD3d0e11D9888684E9',\n darkSwapAssetManager: '0x6fbA1F1aAb8449b7ba576E41F4617d918391b7cF',\n darkSwapFeeAssetManager: '0xfde341e63EB2f25A32D353d58C2DAd7f91c8Bd57',\n synaraDarkSwapOnBridgeAssetManager: '0x0', //FIXME\n synaraBridge: '0x0', //FIXME\n synaraCanonicalTokenRegistry: '0x0', //FIXME\n zkverifyRelayerUrls: [],//FIXME\n },\n [ChainId.SEPOLIA]: {\n priceOracle: '0x4Fe44a9aC8Ef059Be2dB97f9e3bcA32Ab698C2f2',\n ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',\n nativeWrapper: '0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14',\n merkleTreeOperator: '0xbeCd9FD715d131F8E897095Ef008BB4d9325B744',\n darkSwapAssetManager: '0x6E56b48361aD94Cb67EB5aA9182b2813bC76E6C0',\n darkSwapFeeAssetManager: '0x5C550CE1F4a02865F0f59d839D86807C75A6ddE0',\n synaraDarkSwapOnBridgeAssetManager: '0xEAC8292c1ef7b112Ccd5B3CB16E587E1799358db',\n synaraBridge: '0x2a9569b5df66B7E24B4FdC2B91d19E4C1C02F2D3',\n synaraCanonicalTokenRegistry: '0xD35264a934b5b7b8b3507b1d073e29EeBa4Dc754',\n zkverifyRelayerUrls: [],//FIXME\n },\n [ChainId.BASE_SEPOLIA]: {\n priceOracle: '0x4Fe44a9aC8Ef059Be2dB97f9e3bcA32Ab698C2f2',\n ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',\n nativeWrapper: '0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14',\n merkleTreeOperator: '0xC486e448e068A888AF09c386337E3C3C4812569b',\n darkSwapAssetManager: '0xEd349302ff6C2527be9555Fa386061652EAC712D',\n darkSwapFeeAssetManager: '0xa62C0693296f64eb9BA29ff2E41E96749c18de0F',\n synaraDarkSwapOnBridgeAssetManager: '0x0aAd845E874F0007e328862A3C455CB2D6625660',\n synaraBridge: '0xda348F7dEAeE972D8a5B4D4D182EF0273aDd3E2c',\n synaraCanonicalTokenRegistry: '0x016C6334d644E0B21aD5c6e91083Dd2f22739eB6',\n zkverifyRelayerUrls: [],//FIXME\n },\n [ChainId.HORIZEN_TESTNET]: {\n priceOracle: '0x54c375f28ce4B0c2B986D6256E4Bc75d242A8793',\n ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',\n nativeWrapper: '0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14',\n merkleTreeOperator: '0x8Cd4061C8b3743810B811E1F4A0B597D79225f4E',\n darkSwapAssetManager: '0xEBeD6c7C2189bf8ad6687D3A4cf4b83fB4D1a3D2',\n darkSwapFeeAssetManager: '0x8CF86856Bd7dE95b4ba33DCae4cd5Ec02542Bf5b',\n synaraDarkSwapOnBridgeAssetManager: '0x0', //FIXME\n synaraBridge: '0x0', //FIXME\n synaraCanonicalTokenRegistry: '0x0', //FIXME\n zkverifyRelayerUrls: [],//FIXME\n },\n [ChainId.HARDHAT]: {\n priceOracle: '0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8',\n ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',\n nativeWrapper: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',\n merkleTreeOperator: '0xEd8D7d3A98CB4ea6C91a80dcd2220719c264531f',\n darkSwapAssetManager: '0x6D39d71fF4ab56a4873febd34e1a3BDefc01b41e',\n darkSwapFeeAssetManager: '0xb9b0c96e4E7181926D2A7ed331C9C346dfa59b4D',\n synaraDarkSwapOnBridgeAssetManager: '0x0', //FIXME\n synaraBridge: '0x0', //FIXME\n synaraCanonicalTokenRegistry: '0x0', //FIXME\n zkverifyRelayerUrls: [],//FIXME\n },\n [ChainId.HARDHAT_BASE]: {\n priceOracle: '0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8',\n ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',\n nativeWrapper: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',\n merkleTreeOperator: '0xEd8D7d3A98CB4ea6C91a80dcd2220719c264531f',\n darkSwapAssetManager: '0x6D39d71fF4ab56a4873febd34e1a3BDefc01b41e',\n darkSwapFeeAssetManager: '0xb9b0c96e4E7181926D2A7ed331C9C346dfa59b4D',\n synaraDarkSwapOnBridgeAssetManager: '0x0', //FIXME\n synaraBridge: '0x0', //FIXME\n synaraCanonicalTokenRegistry: '0x0', //FIXME\n zkverifyRelayerUrls: [],//FIXME\n }\n};\n","import { GAS_LIMIT_MULTIPLIER, GAS_LIMIT_PRECISION } from \"../config\";\n\nexport function refineGasLimit(estimatedGas: bigint){\n return (estimatedGas * GAS_LIMIT_MULTIPLIER) / GAS_LIMIT_PRECISION;\n}","import { ethers } from 'ethers';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport ERC20Abi from '../../abis/IERC20.json';\nimport ERC20_USDT from '../../abis/IERC20_USDT.json';\nimport { getConfirmations, legacyTokenConfig } from '../../config/config';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { DepositProofResult, generateDepositProof } from '../../proof/basic/depositProof';\nimport { generateKeyPair } from '../../proof/keyService';\nimport { createNote } from '../../proof/noteService';\nimport { DarkSwapNote } from '../../types';\nimport { MAX_ALLOWANCE } from '../../utils/constants';\nimport { hexlify32, isNativeAsset } from '../../utils/util';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { EMPTY_PATH, getMerklePathAndRoot } from '../merkletree';\nimport { refineGasLimit } from '../../utils/gasUtil';\n\nexport class DepositContext extends BaseContext {\n private _currentBalance?: DarkSwapNote;\n private _newBalance?: DarkSwapNote;\n private _proof?: DepositProofResult;\n private _depositAmount?: bigint;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set currentBalance(currentBalance: DarkSwapNote | undefined) {\n this._currentBalance = currentBalance;\n }\n\n get currentBalance(): DarkSwapNote | undefined {\n return this._currentBalance;\n }\n\n set newBalance(newBalance: DarkSwapNote | undefined) {\n this._newBalance = newBalance;\n }\n\n get newBalance(): DarkSwapNote | undefined {\n return this._newBalance;\n }\n\n set proof(proof: DepositProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): DepositProofResult | undefined {\n return this._proof;\n }\n\n set depositAmount(depositAmount: bigint | undefined) {\n this._depositAmount = depositAmount;\n }\n\n get depositAmount(): bigint | undefined {\n return this._depositAmount;\n }\n}\n\nexport class DepositService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public async prepare(\n currentBalance: DarkSwapNote,\n depositAsset: string,\n depositAmount: bigint,\n walletAddress: string,\n signature: string,\n ): Promise<{ context: DepositContext; newBalanceNote: DarkSwapNote }> {\n const [pubKey] = await generateKeyPair(signature);\n const newBalanceAmount = depositAmount + currentBalance.amount;\n const newBalance = createNote(walletAddress, depositAsset, newBalanceAmount, pubKey);\n const context = new DepositContext(signature);\n context.currentBalance = currentBalance;\n context.newBalance = newBalance;\n context.address = walletAddress;\n context.depositAmount = depositAmount;\n return { context, newBalanceNote: newBalance };\n }\n\n private async generateProof(context: DepositContext): Promise<void> {\n if (!context || !context.currentBalance || !context.newBalance || !context.address || !context.signature) {\n throw new DarkSwapError('Invalid context');\n }\n\n const path = context.currentBalance.amount === 0n ?\n EMPTY_PATH :\n await getMerklePathAndRoot(context.currentBalance.note, this._darkSwap);\n context.merkleRoot = path.root;\n\n const proof = await generateDepositProof({\n merkleRoot: path.root,\n merkleIndex: path.index,\n merklePath: path.path,\n oldBalanceNote: context.currentBalance,\n newBalanceNote: context.newBalance,\n signedMessage: context.signature,\n address: context.address,\n });\n context.proof = proof;\n }\n\n public async execute(context: DepositContext): Promise<string> {\n await this.generateProof(context);\n\n if (!context\n || !context.currentBalance\n || !context.newBalance\n || !context.address\n || !context.signature\n || !context.proof\n || !context.depositAmount\n ) {\n throw new DarkSwapError('Invalid context');\n }\n const signer = this._darkSwap.signer;\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n signer\n );\n\n if (!isNativeAsset(context.newBalance.asset)) {\n await this.allowance(context);\n const depositArgs = [\n context.merkleRoot,\n context.newBalance.asset,\n hexlify32(context.depositAmount),\n context.proof.oldBalanceNullifier,\n hexlify32(context.newBalance.note),\n context.proof.newBalanceFooter,\n context.proof.proof];\n const estimatedGas = await contract.deposit.estimateGas(\n ...depositArgs,\n { value: 0n }\n );\n const gasLimit = refineGasLimit(estimatedGas);\n const tx = await contract.deposit(\n ...depositArgs,\n { value: 0n, gasLimit }\n );\n await tx.wait();\n return tx.hash;\n } else {\n const depositArgs = [\n context.merkleRoot,\n context.newBalance.asset,\n hexlify32(context.depositAmount),\n context.proof.oldBalanceNullifier,\n hexlify32(context.newBalance.note),\n context.proof.newBalanceFooter,\n context.proof.proof\n ];\n const estimatedGas = await contract.deposit.estimateGas(\n ...depositArgs,\n { value: context.depositAmount }\n );\n const tx = await contract.deposit(\n ...depositArgs,\n { value: context.depositAmount, gasLimit: refineGasLimit(estimatedGas) }\n );\n await tx.wait();\n return tx.hash;\n }\n }\n\n protected async allowance(context: DepositContext) {\n if (!context || !context.newBalance || !context.address || !context.signature || !context.proof) {\n throw new DarkSwapError('Invalid context');\n }\n const signer = this._darkSwap.signer;\n const allowanceContract = new ethers.Contract(context.newBalance.asset, ERC20Abi.abi, this._darkSwap);\n const allowance = await allowanceContract.allowance(\n signer.getAddress(),\n this._darkSwap.contracts.darkSwapAssetManager\n );\n if (BigInt(allowance) < context.newBalance.amount) {\n const isLegacy =\n legacyTokenConfig.hasOwnProperty(this._darkSwap.chainId) &&\n legacyTokenConfig[this._darkSwap.chainId].includes(context.newBalance.asset.toLowerCase());\n const contract = new ethers.Contract(context.newBalance.asset, isLegacy ? ERC20_USDT.abi : ERC20Abi.abi, signer);\n const tx = await contract.approve(this._darkSwap.contracts.darkSwapAssetManager, hexlify32(MAX_ALLOWANCE));\n await tx.wait(getConfirmations(this._darkSwap.chainId));\n }\n }\n}\n","import withdrawCircuit from \"../../circuits/pro/dark_swap_withdraw_compiled_circuit.json\";\nimport { BaseProofInput, BaseProofParam, BaseProofResult, DarkSwapNote, DarkSwapProofError, EMPTY_FOOTER, PROOF_DOMAIN } from \"../../types\";\nimport { encodeAddress } from \"../../utils/encoders\";\nimport { bn_to_0xhex, bn_to_hex } from \"../../utils/formatters\";\nimport { mimc_bn254 } from \"../../utils/mimc\";\nimport { uint8ArrayToNumberArray } from \"../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../baseProofService\";\nimport { generateKeyPair } from \"../keyService\";\nimport { calcNullifier, getNoteFooter } from \"../noteService\";\n\ntype WithdrawProofInput = BaseProofInput & {\n merkle_root: string,\n merkle_index: number[],\n merkle_path: string[],\n\n note: string,\n asset: string,\n rho: string,\n out_amount: string,\n nullifier: string,\n\n remaining_note: string,\n remaining_rho: string,\n remaining_note_footer: string,\n remaining_amount: string,\n}\n\nexport type WithdrawProofParam = BaseProofParam & {\n merkleRoot: string,\n merkleIndex: number[],\n merklePath: string[],\n oldBalance: DarkSwapNote,\n newBalance: DarkSwapNote,\n}\n\nexport type WithdrawProofResult = BaseProofResult & {\n oldBalanceNullifier: string,\n newBalanceFooter: string,\n}\n\nexport async function generateWithdrawProof(param: WithdrawProofParam): Promise<WithdrawProofResult> {\n const withdrawAmount = param.oldBalance.amount - param.newBalance.amount;\n if (param.oldBalance.amount <= 0n\n || param.newBalance.amount < 0n\n || withdrawAmount <= 0n\n ) {\n throw new DarkSwapProofError(\"Invalid withdraw amount\");\n }\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.signedMessage);\n\n const oldBalanceNullifier = calcNullifier(param.oldBalance.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n\n //new balance note could be empty note\n let newBalanceFooter = EMPTY_FOOTER;\n if (param.newBalance.amount != 0n) {\n newBalanceFooter = getNoteFooter(param.newBalance.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n }\n\n const addressMod = encodeAddress(param.address);\n const assetMod = encodeAddress(param.oldBalance.asset);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.WITHDRAW),\n addressMod,\n oldBalanceNullifier,\n param.newBalance.note,\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: WithdrawProofInput = {\n merkle_root: param.merkleRoot,\n merkle_index: param.merkleIndex,\n merkle_path: param.merklePath.map((x) => bn_to_0xhex(BigInt(x))),\n\n address: bn_to_0xhex(addressMod),\n asset: bn_to_0xhex(assetMod),\n rho: bn_to_0xhex(param.oldBalance.rho),\n out_amount: bn_to_0xhex(withdrawAmount),\n nullifier: bn_to_0xhex(oldBalanceNullifier),\n\n note: bn_to_0xhex(param.oldBalance.note),\n\n remaining_note: bn_to_0xhex(param.newBalance.note),\n remaining_rho: bn_to_0xhex(param.newBalance.rho),\n remaining_note_footer: bn_to_0xhex(newBalanceFooter),\n remaining_amount: bn_to_0xhex(param.newBalance.amount),\n\n pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n signature: uint8ArrayToNumberArray(signature),\n };\n const proof = await generateProof(withdrawCircuit, inputs);\n return {\n ...proof,\n oldBalanceNullifier: inputs.nullifier,\n newBalanceFooter: inputs.remaining_note_footer,\n }\n};","import { ethers } from 'ethers';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateWithdrawProof, WithdrawProofResult } from '../../proof/basic/withdrawProof';\nimport { generateKeyPair } from '../../proof/keyService';\nimport { createNote } from '../../proof/noteService';\nimport { DarkSwapNote } from '../../types';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { getMerklePathAndRoot } from '../merkletree';\nimport { hexlify32 } from '../../utils/util';\n\nclass WithdrawContext extends BaseContext {\n private _currentBalance?: DarkSwapNote;\n private _newBalance?: DarkSwapNote;\n private _withdrawAmount?: bigint;\n private _proof?: WithdrawProofResult;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set currentBalance(note: DarkSwapNote | undefined) {\n this._currentBalance = note;\n }\n\n get currentBalance(): DarkSwapNote | undefined {\n return this._currentBalance;\n }\n\n set newBalance(note: DarkSwapNote | undefined) {\n this._newBalance = note;\n }\n\n get newBalance(): DarkSwapNote | undefined {\n return this._newBalance;\n }\n\n set withdrawAmount(amount: bigint | undefined) {\n this._withdrawAmount = amount;\n }\n\n get withdrawAmount(): bigint | undefined {\n return this._withdrawAmount;\n }\n\n set proof(proof: WithdrawProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): WithdrawProofResult | undefined {\n return this._proof;\n }\n}\n\nexport class WithdrawService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public async prepare(\n address: string,\n currentBalance: DarkSwapNote,\n withdrawAmount: bigint,\n signature: string\n ): Promise<{ context: WithdrawContext; newBalanceNote: DarkSwapNote }> {\n const [pubKey] = await generateKeyPair(signature);\n const newBalanceNote = createNote(address, currentBalance.asset, currentBalance.amount - withdrawAmount, pubKey);\n\n const context = new WithdrawContext(signature);\n context.currentBalance = currentBalance;\n context.newBalance = newBalanceNote;\n context.withdrawAmount = withdrawAmount;\n context.address = address;\n return { context, newBalanceNote };\n }\n\n private async generateProof(context: WithdrawContext): Promise<void> {\n if (!context || !context.currentBalance || !context.newBalance || !context.withdrawAmount || !context.address) {\n throw new DarkSwapError('Invalid context');\n }\n\n const path = await getMerklePathAndRoot(context.currentBalance.note, this._darkSwap);\n context.merkleRoot = path.root;\n\n const proof = await generateWithdrawProof({\n oldBalance: context.currentBalance,\n newBalance: context.newBalance,\n address: context.address,\n merkleRoot: path.root,\n merklePath: path.path,\n merkleIndex: path.index,\n signedMessage: context.signature,\n });\n context.proof = proof;\n }\n\n public async execute(context: WithdrawContext): Promise<string> {\n await this.generateProof(context);\n\n if (!context || !context.currentBalance || !context.newBalance || !context.proof || !context.merkleRoot) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n this._darkSwap.signer\n );\n\n const tx = await contract.withdraw(\n context.merkleRoot,\n context.currentBalance.asset,\n context.withdrawAmount,\n context.proof.oldBalanceNullifier,\n hexlify32(context.newBalance.note),\n context.proof.newBalanceFooter,\n context.proof.proof\n );\n await tx.wait();\n return tx.hash;\n }\n}\n","import joinCircuit from \"../../circuits/pro/dark_swap_join_compiled_circuit.json\";\nimport { BaseProofParam, BaseProofResult, DarkSwapNote, DarkSwapProofError, PROOF_DOMAIN } from \"../../types\";\nimport { encodeAddress } from \"../../utils/encoders\";\nimport { bn_to_0xhex, bn_to_hex } from \"../../utils/formatters\";\nimport { mimc_bn254 } from \"../../utils/mimc\";\nimport { uint8ArrayToNumberArray } from \"../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../baseProofService\";\nimport { generateKeyPair } from \"../keyService\";\nimport { calcNullifier, getNoteFooter } from \"../noteService\";\n\ntype JoinProofInput = {\n merkle_root: string,\n in_merkle_index_1: number[],\n in_merkle_index_2: number[],\n in_merkle_path_1: string[],\n in_merkle_path_2: string[],\n address: string,\n in_note_1: string,\n in_note_2: string,\n asset: string,\n in_amount_1: string,\n in_amount_2: string,\n in_rho_1: string,\n in_rho_2: string,\n in_nullifier_1: string,\n in_nullifier_2: string,\n\n out_note: string,\n out_rho: string,\n out_note_footer: string,\n\n pub_key: [string, string],\n signature: any\n}\n\nexport type JoinProofParam = BaseProofParam & {\n merkleRoot: string,\n inMerkleIndex1: number[],\n inMerkleIndex2: number[],\n inMerklePath1: string[],\n inMerklePath2: string[],\n inNote1: DarkSwapNote,\n inNote2: DarkSwapNote,\n outNote: DarkSwapNote,\n}\n\nexport type JoinProofResult = BaseProofResult & {\n inNullifier1: string,\n inNullifier2: string,\n outNoteFooter: string,\n}\n\nexport async function generateJoinProof(param: JoinProofParam): Promise<JoinProofResult> {\n if (param.inNote1.amount <= 0n\n || param.inNote2.amount <= 0n\n || param.outNote.amount != param.inNote1.amount + param.inNote2.amount) {\n throw new DarkSwapProofError(\"Invalid join amount\");\n }\n\n if (param.inNote1.asset.toLowerCase() !== param.inNote2.asset.toLowerCase()\n || param.inNote1.asset.toLowerCase() !== param.outNote.asset.toLowerCase()) {\n throw new DarkSwapProofError(\"Invalid join asset\");\n }\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.signedMessage);\n\n const inNullifier1 = calcNullifier(param.inNote1.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const inNullifier2 = calcNullifier(param.inNote2.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const outNoteFooter = getNoteFooter(param.outNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n\n const addressMod = encodeAddress(param.address);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.JOIN),\n inNullifier1,\n inNullifier2,\n param.outNote.note,\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: JoinProofInput = {\n merkle_root: param.merkleRoot,\n in_merkle_index_1: param.inMerkleIndex1,\n in_merkle_index_2: param.inMerkleIndex2,\n in_merkle_path_1: param.inMerklePath1.map((x) => bn_to_0xhex(BigInt(x))),\n in_merkle_path_2: param.inMerklePath2.map((x) => bn_to_0xhex(BigInt(x))),\n\n address: bn_to_0xhex(addressMod),\n asset: bn_to_0xhex(encodeAddress(param.outNote.asset)),\n in_amount_1: bn_to_0xhex(param.inNote1.amount),\n in_amount_2: bn_to_0xhex(param.inNote2.amount),\n in_rho_1: bn_to_0xhex(param.inNote1.rho),\n in_rho_2: bn_to_0xhex(param.inNote2.rho),\n in_nullifier_1: bn_to_0xhex(inNullifier1),\n in_nullifier_2: bn_to_0xhex(inNullifier2),\n in_note_1: bn_to_0xhex(param.inNote1.note),\n in_note_2: bn_to_0xhex(param.inNote2.note),\n\n out_note: bn_to_0xhex(param.outNote.note),\n out_rho: bn_to_0xhex(param.outNote.rho),\n out_note_footer: bn_to_0xhex(outNoteFooter),\n\n pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n signature: uint8ArrayToNumberArray(signature),\n };\n const proof = await generateProof(joinCircuit, inputs);\n return {\n ...proof,\n inNullifier1: inputs.in_nullifier_1,\n inNullifier2: inputs.in_nullifier_2,\n outNoteFooter: inputs.out_note_footer,\n }\n};","import { ethers } from 'ethers';\nimport { generateJoinProof, JoinProofResult } from '../../proof/basic/joinProof';\nimport { DarkSwapNote, EMPTY_NULLIFIER } from '../../types';\nimport { hexlify32, isAddressEquals } from '../../utils/util';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { multiGetMerklePathAndRoot } from '../merkletree';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateKeyPair } from '../../proof/keyService';\nimport { createNote } from '../../proof/noteService';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport { refineGasLimit } from '../../utils/gasUtil';\n\nclass JoinContext extends BaseContext {\n private _inNote1?: DarkSwapNote;\n private _inNote2?: DarkSwapNote;\n private _outNote?: DarkSwapNote;\n private _proof?: JoinProofResult;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set inNote1(note: DarkSwapNote | undefined) {\n this._inNote1 = note;\n }\n\n get inNote1(): DarkSwapNote | undefined {\n return this._inNote1;\n }\n\n set inNote2(note: DarkSwapNote | undefined) {\n this._inNote2 = note;\n }\n\n get inNote2(): DarkSwapNote | undefined {\n return this._inNote2;\n }\n\n set outNote(note: DarkSwapNote | undefined) {\n this._outNote = note;\n }\n\n get outNote(): DarkSwapNote | undefined {\n return this._outNote;\n }\n\n set proof(proof: JoinProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): JoinProofResult | undefined {\n return this._proof;\n }\n}\n\nexport class JoinService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public async prepare(\n address: string,\n inNote1: DarkSwapNote,\n inNote2: DarkSwapNote,\n signature: string\n ): Promise<{ context: JoinContext; outNote: DarkSwapNote }> {\n if (!isAddressEquals(inNote1.asset, inNote2.asset)) {\n throw new DarkSwapError('inNote1 and inNote2 must have the same asset');\n }\n\n if (inNote1.note === inNote2.note) {\n throw new DarkSwapError('inNote1 and inNote2 must have different note');\n }\n\n const [pubKey] = await generateKeyPair(signature);\n const outNote = createNote(address, inNote1.asset, inNote1.amount + inNote2.amount, pubKey);\n const context = new JoinContext(signature);\n context.inNote1 = inNote1;\n context.inNote2 = inNote2;\n context.outNote = outNote;\n context.address = address;\n return { context, outNote };\n }\n\n private async generateProof(context: JoinContext): Promise<void> {\n if (!context || !context.inNote1 || !context.inNote2 || !context.outNote || !context.address) {\n throw new DarkSwapError('Invalid context');\n }\n\n const merklePathes = await multiGetMerklePathAndRoot([context.inNote1.note, context.inNote2.note], this._darkSwap);\n const path1 = merklePathes[0];\n const path2 = merklePathes[1];\n\n const proof = await generateJoinProof({\n inNote1: context.inNote1,\n inNote2: context.inNote2,\n outNote: context.outNote,\n merkleRoot: path1.root,\n inMerklePath1: path1.path,\n inMerkleIndex1: path1.index,\n inMerklePath2: path2.path,\n inMerkleIndex2: path2.index,\n signedMessage: context.signature,\n address: context.address,\n });\n context.merkleRoot = path1.root;\n context.proof = proof;\n }\n\n public async execute(context: JoinContext): Promise<string> {\n await this.generateProof(context);\n if (!context || !context.inNote1 || !context.inNote2 || !context.outNote || !context.proof || !context.merkleRoot) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n this._darkSwap.signer\n );\n\n const joinArgs = [\n context.merkleRoot,\n [\n context.proof.inNullifier1,\n context.proof.inNullifier2,\n hexlify32(EMPTY_NULLIFIER)\n ],\n hexlify32(context.outNote.note),\n context.proof.outNoteFooter,\n context.proof.proof\n ];\n\n const estimatedGas = await contract.join.estimateGas(...joinArgs);\n const gasLimit = refineGasLimit(estimatedGas);\n\n const tx = await contract.join(...joinArgs, { gasLimit });\n await tx.wait();\n return tx.hash;\n }\n}\n","import tripleJoinCircuit from \"../../circuits/pro/dark_swap_triple_join_compiled_circuit.json\";\nimport { BaseProofInput, BaseProofParam, BaseProofResult, DarkSwapNote, DarkSwapProofError, PROOF_DOMAIN } from \"../../types\";\nimport { encodeAddress } from \"../../utils/encoders\";\nimport { bn_to_0xhex, bn_to_hex } from \"../../utils/formatters\";\nimport { mimc_bn254 } from \"../../utils/mimc\";\nimport { uint8ArrayToNumberArray } from \"../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../baseProofService\";\nimport { generateKeyPair } from \"../keyService\";\nimport { calcNullifier, getNoteFooter } from \"../noteService\";\n\ntype TripleJoinProofInput = BaseProofInput & {\n merkle_root: string,\n in_merkle_index_1: number[],\n in_merkle_index_2: number[],\n in_merkle_index_3: number[],\n in_merkle_path_1: string[],\n in_merkle_path_2: string[],\n in_merkle_path_3: string[],\n in_note_1: string,\n in_note_2: string,\n in_note_3: string,\n asset: string,\n in_amount_1: string,\n in_amount_2: string,\n in_amount_3: string,\n in_rho_1: string,\n in_rho_2: string,\n in_rho_3: string,\n in_nullifier_1: string,\n in_nullifier_2: string,\n in_nullifier_3: string,\n out_note: string,\n out_rho: string,\n out_note_footer: string,\n}\n\nexport type TripleJoinProofParam = BaseProofParam & {\n merkleRoot: string,\n inMerkleIndex1: number[],\n inMerkleIndex2: number[],\n inMerkleIndex3: number[],\n inMerklePath1: string[],\n inMerklePath2: string[],\n inMerklePath3: string[],\n inNote1: DarkSwapNote,\n inNote2: DarkSwapNote,\n inNote3: DarkSwapNote,\n outNote: DarkSwapNote,\n}\n\nexport type TripleJoinProofResult = BaseProofResult & {\n inNullifier1: string,\n inNullifier2: string,\n inNullifier3: string,\n outNoteFooter: string,\n}\n\nexport async function generateTripleJoinProof(param: TripleJoinProofParam): Promise<TripleJoinProofResult> {\n if (param.inNote1.amount <= 0n\n || param.inNote2.amount <= 0n\n || param.inNote3.amount <= 0n\n || param.outNote.amount != param.inNote1.amount + param.inNote2.amount + param.inNote3.amount) {\n throw new DarkSwapProofError(\"Invalid triple join amount\");\n }\n\n if (param.inNote1.asset.toLowerCase() !== param.inNote2.asset.toLowerCase()\n || param.inNote1.asset.toLowerCase() !== param.inNote3.asset.toLowerCase()\n || param.inNote1.asset.toLowerCase() !== param.outNote.asset.toLowerCase()) {\n throw new DarkSwapProofError(\"Invalid triple join asset\");\n }\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.signedMessage);\n\n const inNullifier1 = calcNullifier(param.inNote1.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const inNullifier2 = calcNullifier(param.inNote2.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const inNullifier3 = calcNullifier(param.inNote3.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const outNoteFooter = getNoteFooter(param.outNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n\n const addressMod = encodeAddress(param.address);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.TRIPLE_JOIN),\n inNullifier1,\n inNullifier2,\n inNullifier3,\n param.outNote.note,\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: TripleJoinProofInput = {\n merkle_root: param.merkleRoot,\n in_merkle_index_1: param.inMerkleIndex1,\n in_merkle_index_2: param.inMerkleIndex2,\n in_merkle_index_3: param.inMerkleIndex3,\n in_merkle_path_1: param.inMerklePath1.map((x) => bn_to_0xhex(BigInt(x))),\n in_merkle_path_2: param.inMerklePath2.map((x) => bn_to_0xhex(BigInt(x))),\n in_merkle_path_3: param.inMerklePath3.map((x) => bn_to_0xhex(BigInt(x))),\n\n address: bn_to_0xhex(addressMod),\n asset: bn_to_0xhex(encodeAddress(param.outNote.asset)),\n in_amount_1: bn_to_0xhex(param.inNote1.amount),\n in_amount_2: bn_to_0xhex(param.inNote2.amount),\n in_amount_3: bn_to_0xhex(param.inNote3.amount),\n in_rho_1: bn_to_0xhex(param.inNote1.rho),\n in_rho_2: bn_to_0xhex(param.inNote2.rho),\n in_rho_3: bn_to_0xhex(param.inNote3.rho),\n\n in_nullifier_1: bn_to_0xhex(inNullifier1),\n in_nullifier_2: bn_to_0xhex(inNullifier2),\n in_nullifier_3: bn_to_0xhex(inNullifier3),\n\n in_note_1: bn_to_0xhex(param.inNote1.note),\n in_note_2: bn_to_0xhex(param.inNote2.note),\n in_note_3: bn_to_0xhex(param.inNote3.note),\n\n out_note: bn_to_0xhex(param.outNote.note),\n out_rho: bn_to_0xhex(param.outNote.rho),\n out_note_footer: bn_to_0xhex(outNoteFooter),\n\n pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n signature: uint8ArrayToNumberArray(signature),\n };\n const proof = await generateProof(tripleJoinCircuit, inputs);\n return {\n ...proof,\n inNullifier1: inputs.in_nullifier_1,\n inNullifier2: inputs.in_nullifier_2,\n inNullifier3: inputs.in_nullifier_3,\n outNoteFooter: inputs.out_note_footer,\n }\n};","import { ethers } from 'ethers';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateTripleJoinProof, TripleJoinProofResult } from '../../proof/basic/tripleJoinProof';\nimport { generateKeyPair } from '../../proof/keyService';\nimport { createNote } from '../../proof/noteService';\nimport { DarkSwapNote } from '../../types';\nimport { hexlify32, isAddressEquals } from '../../utils/util';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { multiGetMerklePathAndRoot } from '../merkletree';\nimport { refineGasLimit } from '../../utils/gasUtil';\n\nclass TripleJoinContext extends BaseContext {\n private _inNote1?: DarkSwapNote;\n private _inNote2?: DarkSwapNote;\n private _inNote3?: DarkSwapNote;\n private _outNote?: DarkSwapNote;\n private _proof?: TripleJoinProofResult;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set inNote1(note: DarkSwapNote | undefined) {\n this._inNote1 = note;\n }\n\n get inNote1(): DarkSwapNote | undefined {\n return this._inNote1;\n }\n\n set inNote2(note: DarkSwapNote | undefined) {\n this._inNote2 = note;\n }\n\n get inNote2(): DarkSwapNote | undefined {\n return this._inNote2;\n }\n\n set inNote3(note: DarkSwapNote | undefined) {\n this._inNote3 = note;\n }\n\n get inNote3(): DarkSwapNote | undefined {\n return this._inNote3;\n }\n\n\n set outNote(note: DarkSwapNote | undefined) {\n this._outNote = note;\n }\n\n get outNote(): DarkSwapNote | undefined {\n return this._outNote;\n }\n\n set proof(proof: TripleJoinProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): TripleJoinProofResult | undefined {\n return this._proof;\n }\n}\n\nexport class TripleJoinService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public async prepare(\n address: string,\n inNote1: DarkSwapNote,\n inNote2: DarkSwapNote,\n inNote3: DarkSwapNote,\n signature: string\n ): Promise<{ context: TripleJoinContext; outNote: DarkSwapNote }> {\n if (!isAddressEquals(inNote1.asset, inNote2.asset)) {\n throw new DarkSwapError('inNote1 and inNote2 must have the same asset');\n }\n\n if (inNote1.note === inNote2.note) {\n throw new DarkSwapError('inNote1 and inNote2 must have different note');\n }\n\n const [pubKey] = await generateKeyPair(signature);\n const outNote = createNote(address, inNote1.asset, inNote1.amount + inNote2.amount + inNote3.amount, pubKey);\n const context = new TripleJoinContext(signature);\n context.inNote1 = inNote1;\n context.inNote2 = inNote2;\n context.inNote3 = inNote3;\n context.outNote = outNote;\n context.address = address;\n return { context, outNote };\n }\n\n private async generateProof(context: TripleJoinContext): Promise<void> {\n if (!context\n || !context.inNote1\n || !context.inNote2\n || !context.inNote3\n || !context.outNote\n || !context.address) {\n throw new DarkSwapError('Invalid context');\n }\n\n const merklePathes = await multiGetMerklePathAndRoot([context.inNote1.note, context.inNote2.note, context.inNote3.note], this._darkSwap);\n const path1 = merklePathes[0];\n const path2 = merklePathes[1];\n const path3 = merklePathes[2];\n\n const proof = await generateTripleJoinProof({\n inNote1: context.inNote1,\n inNote2: context.inNote2,\n inNote3: context.inNote3,\n outNote: context.outNote,\n merkleRoot: path1.root,\n inMerklePath1: path1.path,\n inMerkleIndex1: path1.index,\n inMerklePath2: path2.path,\n inMerkleIndex2: path2.index,\n inMerklePath3: path3.path,\n inMerkleIndex3: path3.index,\n signedMessage: context.signature,\n address: context.address,\n });\n context.merkleRoot = path1.root;\n context.proof = proof;\n }\n\n public async execute(context: TripleJoinContext): Promise<string> {\n await this.generateProof(context);\n if (!context\n || !context.inNote1\n || !context.inNote2\n || !context.inNote3\n || !context.outNote\n || !context.proof\n || !context.merkleRoot) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n this._darkSwap.signer\n );\n\n const joinArgs = [\n context.merkleRoot,\n [\n context.proof.inNullifier1,\n context.proof.inNullifier2,\n context.proof.inNullifier3\n ],\n hexlify32(context.outNote.note),\n context.proof.outNoteFooter,\n context.proof.proof\n ];\n\n const estimatedGas = await contract.join.estimateGas(...joinArgs);\n const gasLimit = refineGasLimit(estimatedGas);\n const tx = await contract.join(...joinArgs, { gasLimit });\n return tx.hash;\n }\n}\n","import { ethers } from 'ethers';\nimport DarkSwapFeeAssetManagerAbi from '../abis/DarkSwapFeeAssetManager.json';\nimport { DarkSwap } from '../darkSwap';\nimport { FEE_RATIO_PRECISION } from '../types';\n\nfunction getContract(address: string, darkSwap: DarkSwap) {\n const provider = darkSwap.provider;\n return new ethers.Contract(address, DarkSwapFeeAssetManagerAbi.abi, provider);\n}\n\nexport async function getFeeRatio(wallet: string, darkSwap: DarkSwap) {\n const contract = getContract(darkSwap.contracts.darkSwapFeeAssetManager, darkSwap);\n return await contract.getServiceFeePercentage(wallet);\n}\n\nexport function calcFeeAmount(amount: bigint, feeRatio: bigint) {\n return (amount * feeRatio + FEE_RATIO_PRECISION - 1n) / FEE_RATIO_PRECISION;\n}","import proCreateOrderCircuit from \"../../../circuits/pro/dark_swap_pro_create_order_compiled_circuit.json\";\nimport { calcFeeAmount } from \"../../../services/feeRatioService\";\nimport { BaseProofInput, BaseProofParam, BaseProofResult, DarkSwapNote, DarkSwapOrderNote, DarkSwapProofError, EMPTY_FOOTER, PROOF_DOMAIN } from \"../../../types\";\nimport { encodeAddress } from \"../../../utils/encoders\";\nimport { bn_to_0xhex, bn_to_hex } from \"../../../utils/formatters\";\nimport { mimc_bn254 } from \"../../../utils/mimc\";\nimport { uint8ArrayToNumberArray } from \"../../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../../baseProofService\";\nimport { generateKeyPair } from \"../../keyService\";\nimport { calcNullifier, getNoteFooter } from \"../../noteService\";\n\ntype ProCreateOrderProofInput = BaseProofInput & {\n merkle_root: string,\n merkle_index: number[],\n merkle_path: string[],\n\n out_note: string,\n out_rho: string,\n out_nullifier: string,\n out_amount: string,\n\n //fee\n fee_ratio: string,\n fee_amount: string,\n\n //new balance note\n change_note: string,\n change_rho: string,\n change_note_footer: string,\n change_amount: string,\n\n //order note swap out\n order_note: string,\n order_rho: string,\n order_note_footer: string,\n\n //note swap in\n order_asset: string,\n order_amount: string,\n in_asset: string,\n in_amount: string,\n}\n\nexport type ProCreateOrderProofParam = BaseProofParam & {\n merkleRoot: string,\n merkleIndex: number[],\n merklePath: string[],\n oldBalanceNote: DarkSwapNote,\n newBalanceNote: DarkSwapNote,\n orderNote: DarkSwapOrderNote,\n inAsset: string,\n inAmount: bigint,\n}\n\nexport type ProCreateOrderProofResult = BaseProofResult & {\n oldBalanceNullifier: string,\n newBalanceFooter: string,\n orderNoteFooter: string,\n}\n\nexport async function generateProCreateOrderProof(param: ProCreateOrderProofParam): Promise<ProCreateOrderProofResult> {\n if (param.orderNote.feeRatio < 0n) {\n throw new DarkSwapProofError(\"Invalid fee ratio\");\n }\n\n if (param.newBalanceNote.amount < 0n\n || param.oldBalanceNote.amount <= 0n\n || param.inAmount <= 0n\n || param.orderNote.amount <= 0n) {\n throw new DarkSwapProofError(\"Invalid note amount\");\n }\n\n if (param.orderNote.amount != param.oldBalanceNote.amount - param.newBalanceNote.amount) {\n throw new DarkSwapProofError(\"Invalid order amount\");\n }\n\n const feeAmount = calcFeeAmount(param.inAmount, param.orderNote.feeRatio);\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.signedMessage);\n\n let newBalanceFooter = EMPTY_FOOTER;\n if (param.newBalanceNote.amount != 0n) {\n newBalanceFooter = getNoteFooter(param.newBalanceNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n }\n\n const oldBalanceNullifier = calcNullifier(param.oldBalanceNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const orderNoteFooter = getNoteFooter(param.orderNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n\n const addressMod = encodeAddress(param.address);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.PRO_CREATE_ORDER),\n oldBalanceNullifier,\n param.orderNote.feeRatio,\n param.newBalanceNote.note,\n param.orderNote.note,\n encodeAddress(param.inAsset),\n param.inAmount\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: ProCreateOrderProofInput = {\n merkle_root: param.merkleRoot,\n merkle_index: param.merkleIndex,\n merkle_path: param.merklePath,\n\n address: bn_to_0xhex(addressMod),\n out_note: bn_to_0xhex(param.oldBalanceNote.note),\n out_rho: bn_to_0xhex(param.oldBalanceNote.rho),\n out_nullifier: bn_to_0xhex(oldBalanceNullifier),\n out_amount: bn_to_0xhex(param.oldBalanceNote.amount),\n fee_ratio: bn_to_0xhex(param.orderNote.feeRatio),\n fee_amount: bn_to_0xhex(feeAmount),\n\n change_note: bn_to_0xhex(param.newBalanceNote.note),\n change_rho: bn_to_0xhex(param.newBalanceNote.rho),\n change_note_footer: bn_to_0xhex(newBalanceFooter),\n change_amount: bn_to_0xhex(param.newBalanceNote.amount),\n\n order_note: bn_to_0xhex(param.orderNote.note),\n order_rho: bn_to_0xhex(param.orderNote.rho),\n order_note_footer: bn_to_0xhex(orderNoteFooter),\n order_asset: bn_to_0xhex(encodeAddress(param.orderNote.asset)),\n order_amount: bn_to_0xhex(param.orderNote.amount),\n in_asset: bn_to_0xhex(encodeAddress(param.inAsset)),\n in_amount: bn_to_0xhex(param.inAmount),\n\n pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n signature: uint8ArrayToNumberArray(signature),\n };\n const proof = await generateProof(proCreateOrderCircuit, inputs);\n return {\n ...proof,\n oldBalanceNullifier: inputs.out_nullifier,\n newBalanceFooter: inputs.change_note_footer,\n orderNoteFooter: inputs.order_note_footer,\n }\n};","import { ethers } from 'ethers';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateKeyPair } from '../../proof/keyService';\nimport { calcNullifier, createNote, createOrderNoteExt } from '../../proof/noteService';\nimport { generateProCreateOrderProof, ProCreateOrderProofResult } from '../../proof/pro/orders/createOrderProof';\nimport { DarkSwapMessage, DarkSwapNote, DarkSwapOrderNote, DarkSwapOrderNoteExt } from '../../types';\nimport { hexlify32 } from '../../utils/util';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { getFeeRatio } from '../feeRatioService';\nimport { getMerklePathAndRoot } from '../merkletree';\nimport { refineGasLimit } from '../../utils/gasUtil';\n\nclass ProCreateOrderContext extends BaseContext {\n private _orderNote?: DarkSwapOrderNote;\n private _oldBalance?: DarkSwapNote;\n private _newBalance?: DarkSwapNote;\n private _swapInAsset?: string;\n private _swapInAmount?: bigint;\n private _proof?: ProCreateOrderProofResult;\n private _feeAmount?: bigint;\n private _swapMessage?: DarkSwapMessage;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set orderNote(orderNote: DarkSwapOrderNote | undefined) {\n this._orderNote = orderNote;\n }\n\n get orderNote(): DarkSwapOrderNote | undefined {\n return this._orderNote;\n }\n\n set swapInAsset(swapInAsset: string | undefined) {\n this._swapInAsset = swapInAsset;\n }\n\n get swapInAsset(): string | undefined {\n return this._swapInAsset;\n }\n\n set swapInAmount(swapInAmount: bigint | undefined) {\n this._swapInAmount = swapInAmount;\n }\n\n get swapInAmount(): bigint | undefined {\n return this._swapInAmount;\n }\n\n set oldBalance(oldBalance: DarkSwapNote | undefined) {\n this._oldBalance = oldBalance;\n }\n\n get oldBalance(): DarkSwapNote | undefined {\n return this._oldBalance;\n }\n\n set newBalance(newBalance: DarkSwapNote | undefined) {\n this._newBalance = newBalance;\n }\n\n get newBalance(): DarkSwapNote | undefined {\n return this._newBalance;\n }\n\n set feeAmount(feeAmount: bigint | undefined) {\n this._feeAmount = feeAmount;\n }\n\n get feeAmount(): bigint | undefined {\n return this._feeAmount;\n }\n\n set proof(proof: ProCreateOrderProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): ProCreateOrderProofResult | undefined {\n return this._proof;\n }\n\n set swapMessage(swapMessage: DarkSwapMessage | undefined) {\n this._swapMessage = swapMessage;\n }\n\n get swapMessage(): DarkSwapMessage | undefined {\n return this._swapMessage;\n }\n}\n\nexport class ProCreateOrderService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public async prepare(\n address: string,\n orderAsset: string,\n orderAmount: bigint,\n swapInAsset: string,\n swapInAmount: bigint,\n balanceNote: DarkSwapNote,\n signature: string\n ): Promise<{ context: ProCreateOrderContext; orderNote: DarkSwapOrderNoteExt, newBalance: DarkSwapNote }> {\n const [pubKey] = await generateKeyPair(signature);\n const feeRatio = BigInt(await getFeeRatio(address, this._darkSwap));\n const orderNote = createOrderNoteExt(address, orderAsset, orderAmount, feeRatio, pubKey);\n const orderNullifier = hexlify32(calcNullifier(orderNote.rho, pubKey));\n const newBalance = createNote(address, orderAsset, balanceNote.amount - orderAmount, pubKey);\n const context = new ProCreateOrderContext(signature);\n context.orderNote = orderNote;\n context.swapInAsset = swapInAsset;\n context.swapInAmount = swapInAmount;\n context.oldBalance = balanceNote;\n context.newBalance = newBalance;\n context.address = address;\n return { context, orderNote: { ...orderNote, nullifier: orderNullifier }, newBalance };\n }\n\n private async generateProof(context: ProCreateOrderContext): Promise<void> {\n if (!context\n || !context.orderNote\n || !context.swapInAsset\n || !context.swapInAmount\n || !context.oldBalance\n || !context.newBalance\n || !context.address\n || !context.signature) {\n throw new DarkSwapError('Invalid context');\n }\n\n const { root, index, path } = await getMerklePathAndRoot(context.oldBalance.note, this._darkSwap);\n\n const proof = await generateProCreateOrderProof({\n merkleRoot: root,\n merkleIndex: index,\n merklePath: path,\n orderNote: context.orderNote,\n oldBalanceNote: context.oldBalance,\n newBalanceNote: context.newBalance,\n inAsset: context.swapInAsset,\n inAmount: context.swapInAmount,\n address: context.address,\n signedMessage: context.signature\n });\n context.merkleRoot = root;\n context.proof = proof;\n }\n\n public async execute(context: ProCreateOrderContext): Promise<string> {\n await this.generateProof(context);\n if (!context\n || !context.orderNote\n || !context.swapInAsset\n || !context.swapInAmount\n || !context.oldBalance\n || !context.newBalance\n || !context.proof) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n this._darkSwap.signer\n );\n\n const txData = [\n context.merkleRoot,\n context.proof.oldBalanceNullifier,\n hexlify32(context.newBalance.note),\n context.proof.newBalanceFooter,\n hexlify32(context.orderNote.note),\n context.proof.orderNoteFooter\n ];\n\n const estimatedGas = await contract.proCreateOrder.estimateGas(\n txData,\n context.proof.proof\n );\n\n const gasLimit = refineGasLimit(estimatedGas);\n \n const tx = await contract.proCreateOrder(\n txData,\n context.proof.proof,\n { gasLimit }\n );\n await tx.wait();\n return tx.hash;\n }\n}\n","import proCancelOrderCircuit from \"../../../circuits/pro/dark_swap_cancel_order_compiled_circuit.json\";\nimport { BaseProofInput, BaseProofParam, BaseProofResult, DarkSwapNote, DarkSwapOrderNote, DarkSwapProofError, EMPTY_NULLIFIER, PROOF_DOMAIN } from \"../../../types\";\nimport { encodeAddress } from \"../../../utils/encoders\";\nimport { bn_to_0xhex, bn_to_hex } from \"../../../utils/formatters\";\nimport { mimc_bn254 } from \"../../../utils/mimc\";\nimport { uint8ArrayToNumberArray } from \"../../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../../baseProofService\";\nimport { generateKeyPair } from \"../../keyService\";\nimport { calcNullifier, getNoteFooter } from \"../../noteService\";\n\n\ntype ProCancelOrderProofInput = BaseProofInput & {\n merkle_root: string,\n merkle_index: number[],\n merkle_path: string[],\n merkle_index_remaining: number[],\n merkle_path_remaining: string[],\n\n asset: string,\n\n //order note\n order_note: string,\n order_rho: string,\n order_nullifier: string,\n order_amount: string,\n fee_ratio: string,\n\n //account remaining note\n remaining_note: string,\n remaining_rho: string,\n remaining_nullifier: string,\n remaining_amount: string,\n\n //account available note after cancel\n account_note: string,\n account_rho: string,\n account_note_footer: string,\n}\n\nexport type ProCancelOrderProofParam = BaseProofParam & {\n merkleRoot: string,\n merkleIndex: number[],\n merklePath: string[],\n merkleIndexRemaining: number[],\n merklePathRemaining: string[],\n orderNote: DarkSwapOrderNote,\n oldBalanceNote: DarkSwapNote,\n newBalanceNote: DarkSwapNote,\n}\n\nexport type ProCancelOrderProofResult = BaseProofResult & {\n orderNullifier: string,\n oldBalanceNullifier: string,\n newBalanceNoteFooter: string,\n}\n\nexport async function generateProCancelOrderProof(param: ProCancelOrderProofParam): Promise<ProCancelOrderProofResult> {\n if (param.orderNote.amount <= 0n) {\n throw new DarkSwapProofError(\"Invalid order amount\");\n }\n\n if (param.oldBalanceNote.amount < 0n) {\n throw new DarkSwapProofError(\"Invalid old balance amount\");\n }\n if (param.newBalanceNote.amount < 0n) {\n throw new DarkSwapProofError(\"Invalid new balance amount\");\n }\n\n if (param.orderNote.amount != param.newBalanceNote.amount - param.oldBalanceNote.amount) {\n throw new DarkSwapProofError(\"Invalid order amount\");\n }\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.signedMessage);\n\n const orderNullifier = calcNullifier(param.orderNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n let oldBalanceNullifier = EMPTY_NULLIFIER;\n if (param.oldBalanceNote.amount != 0n) {\n oldBalanceNullifier = calcNullifier(param.oldBalanceNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n }\n const newBalanceNoteFooter = getNoteFooter(param.newBalanceNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n\n const addressMod = encodeAddress(param.address);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.PRO_CANCEL_ORDER),\n orderNullifier,\n param.orderNote.feeRatio,\n oldBalanceNullifier,\n param.newBalanceNote.note,\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: ProCancelOrderProofInput = {\n address: bn_to_0xhex(addressMod),\n merkle_root: param.merkleRoot,\n merkle_index: param.merkleIndex,\n merkle_path: param.merklePath.map((x) => bn_to_0xhex(BigInt(x))),\n merkle_index_remaining: param.merkleIndexRemaining,\n merkle_path_remaining: param.merklePathRemaining.map((x) => bn_to_0xhex(BigInt(x))),\n order_note: bn_to_0xhex(param.orderNote.note),\n order_rho: bn_to_0xhex(param.orderNote.rho),\n order_nullifier: bn_to_0xhex(orderNullifier),\n order_amount: bn_to_0xhex(param.orderNote.amount),\n fee_ratio: bn_to_0xhex(param.orderNote.feeRatio),\n\n remaining_note: bn_to_0xhex(param.oldBalanceNote.note),\n remaining_rho: bn_to_0xhex(param.oldBalanceNote.rho),\n remaining_nullifier: bn_to_0xhex(oldBalanceNullifier),\n remaining_amount: bn_to_0xhex(param.oldBalanceNote.amount),\n\n account_note: bn_to_0xhex(param.newBalanceNote.note),\n account_rho: bn_to_0xhex(param.newBalanceNote.rho),\n account_note_footer: bn_to_0xhex(newBalanceNoteFooter),\n\n asset: bn_to_0xhex(encodeAddress(param.orderNote.asset)),\n\n pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n signature: uint8ArrayToNumberArray(signature),\n };\n const proof = await generateProof(proCancelOrderCircuit, inputs);\n return {\n ...proof,\n orderNullifier: inputs.order_nullifier,\n oldBalanceNullifier: inputs.remaining_nullifier,\n newBalanceNoteFooter: inputs.account_note_footer,\n }\n};","import { ethers } from 'ethers';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateKeyPair } from '../../proof/keyService';\nimport { createNote } from '../../proof/noteService';\nimport { generateProCancelOrderProof, ProCancelOrderProofResult } from '../../proof/pro/orders/cancelOrderProof';\nimport { DarkSwapNote, DarkSwapOrderNote } from '../../types';\nimport { hexlify32 } from '../../utils/util';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { EMPTY_PATH, getMerklePathAndRoot, MerklePath, multiGetMerklePathAndRoot } from '../merkletree';\n\nclass ProCancelOrderContext extends BaseContext {\n private _orderNote?: DarkSwapOrderNote;\n private _oldBalance?: DarkSwapNote;\n private _newBalance?: DarkSwapNote;\n private _proof?: ProCancelOrderProofResult;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set orderNote(orderNote: DarkSwapOrderNote | undefined) {\n this._orderNote = orderNote;\n }\n\n get orderNote(): DarkSwapOrderNote | undefined {\n return this._orderNote;\n }\n\n set oldBalance(oldBalance: DarkSwapNote | undefined) {\n this._oldBalance = oldBalance;\n }\n\n get oldBalance(): DarkSwapNote | undefined {\n return this._oldBalance;\n }\n\n set newBalance(newBalance: DarkSwapNote | undefined) {\n this._newBalance = newBalance;\n }\n\n get newBalance(): DarkSwapNote | undefined {\n return this._newBalance;\n }\n\n set proof(proof: ProCancelOrderProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): ProCancelOrderProofResult | undefined {\n return this._proof;\n }\n}\n\nexport class ProCancelOrderService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public async prepare(\n address: string,\n orderNote: DarkSwapOrderNote,\n balanceNote: DarkSwapNote,\n signature: string\n ): Promise<{ context: ProCancelOrderContext; newBalance: DarkSwapNote }> {\n const [pubKey] = await generateKeyPair(signature);\n const newBalance = createNote(address, orderNote.asset, balanceNote.amount + orderNote.amount, pubKey);\n const context = new ProCancelOrderContext(signature);\n context.orderNote = orderNote;\n context.oldBalance = balanceNote;\n context.newBalance = newBalance;\n context.address = address;\n return { context, newBalance };\n }\n\n private async generateProof(context: ProCancelOrderContext): Promise<void> {\n if (!context\n || !context.orderNote\n || !context.oldBalance\n || !context.newBalance\n || !context.address\n || !context.signature) {\n throw new DarkSwapError('Invalid context');\n }\n\n let orderPath: MerklePath;\n let oldBalancePath: MerklePath;\n if (context.oldBalance.amount === 0n) {\n const path1 = await getMerklePathAndRoot(context.orderNote.note, this._darkSwap);\n orderPath = path1;\n oldBalancePath = EMPTY_PATH;\n } else {\n const merklePathes = await multiGetMerklePathAndRoot([context.orderNote.note, context.oldBalance.note], this._darkSwap);\n orderPath = merklePathes[0];\n oldBalancePath = merklePathes[1];\n }\n\n const proof = await generateProCancelOrderProof({\n merkleRoot: orderPath.root,\n merkleIndex: orderPath.index,\n merklePath: orderPath.path,\n merkleIndexRemaining: oldBalancePath.index,\n merklePathRemaining: oldBalancePath.path,\n orderNote: context.orderNote,\n oldBalanceNote: context.oldBalance,\n newBalanceNote: context.newBalance,\n address: context.address,\n signedMessage: context.signature,\n });\n context.merkleRoot = orderPath.root;\n context.proof = proof;\n }\n\n public async execute(context: ProCancelOrderContext): Promise<string> {\n await this.generateProof(context);\n if (!context\n || !context.orderNote\n || !context.oldBalance\n || !context.newBalance\n || !context.proof\n || !context.merkleRoot) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n this._darkSwap.signer\n );\n const tx = await contract.cancelOrder(\n context.merkleRoot,\n context.proof.orderNullifier,\n context.proof.oldBalanceNullifier,\n hexlify32(context.newBalance.note),\n context.proof.newBalanceNoteFooter,\n context.proof.proof\n );\n await tx.wait();\n return tx.hash;\n }\n}\n","import swapCircuit from \"../../../circuits/pro/dark_swap_pro_swap_compiled_circuit.json\";\nimport { BaseProofResult, DarkSwapMessage, DarkSwapNote, DarkSwapOrderNote, DarkSwapProofError, EMPTY_FOOTER, PROOF_DOMAIN } from \"../../../types\";\nimport { encodeAddress } from \"../../../utils/encoders\";\nimport { bn_to_0xhex, bn_to_hex } from \"../../../utils/formatters\";\nimport { mimc_bn254 } from \"../../../utils/mimc\";\nimport { hexStringToSignature, uint8ArrayToNumberArray } from \"../../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../../baseProofService\";\nimport { generateKeyPair } from \"../../keyService\";\nimport { calcNullifier, getNoteFooter } from \"../../noteService\";\n\ntype ProSwapProofInput = {\n merkle_root: string,\n\n // Alice input\n alice_merkle_index: number[],\n alice_merkle_path: string[],\n alice_address: string,\n alice_out_note: string,\n alice_out_amount: string,\n alice_out_rho: string,\n alice_out_nullifier: string,\n\n //Alice fee\n alice_fee_ratio: string,\n alice_fee_amount: string,\n\n // Alice output\n alice_in_note: string,\n alice_in_rho: string,\n alice_in_note_footer: string,\n\n alice_change_note: string,\n alice_change_rho: string,\n alice_change_note_footer: string,\n\n // Alice pub key and signature\n alice_pub_key: string[],\n alice_signature: any,\n\n //Bob order\n bob_out_asset: string,\n bob_out_amount: string,\n bob_in_asset: string,\n bob_in_amount: string,\n\n // Bob input\n bob_merkle_index: number[],\n bob_merkle_path: string[],\n bob_address: string,\n bob_out_note: string,\n\n bob_out_rho: string,\n bob_out_nullifier: string,\n\n //bob fee\n bob_fee_ratio: string,\n bob_fee_amount: string,\n\n // Bob output\n bob_in_note: string,\n bob_in_rho: string,\n bob_in_note_footer: string,\n\n // Bob pub key and signature\n bob_pub_key: string[],\n bob_signature: any,\n}\n\nexport type ProSwapProofParam = {\n merkleRoot: string,\n aliceMerkleIndex: number[],\n aliceMerklePath: string[],\n aliceAddress: string,\n aliceOrderNote: DarkSwapOrderNote,\n aliceFeeAmount: bigint,\n aliceInNote: DarkSwapNote,\n aliceChangeNote: DarkSwapNote,\n aliceSignedMessage: string,\n\n bobMerkleIndex: number[],\n bobMerklePath: string[],\n bobAddress: string,\n bobMessage: DarkSwapMessage,\n}\n\nexport type ProSwapProofResult = BaseProofResult & {\n aliceOutNullifier: string,\n aliceInNoteFooter: string,\n aliceChangeNoteFooter: string,\n bobOutNullifier: string,\n bobInNoteFooter: string,\n}\n\nexport async function generateProSwapProof(param: ProSwapProofParam): Promise<ProSwapProofResult> {\n if (param.aliceOrderNote.feeRatio < 0n\n || param.bobMessage.orderNote.feeRatio < 0n) {\n throw new DarkSwapProofError(\"Invalid fee ratio\");\n }\n\n if (param.aliceChangeNote.amount < 0n\n || param.aliceOrderNote.amount <= 0n\n || param.aliceInNote.amount <= 0n\n || param.bobMessage.inNote.amount <= 0n\n || param.bobMessage.orderNote.amount <= 0n) {\n throw new DarkSwapProofError(\"Invalid note amount\");\n }\n\n if (param.aliceOrderNote.amount != param.aliceChangeNote.amount + param.bobMessage.inNote.amount + param.bobMessage.feeAmount\n || param.bobMessage.orderNote.amount != param.aliceInNote.amount + param.aliceFeeAmount) {\n throw new DarkSwapProofError(\"Invalid order amount\");\n }\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.aliceSignedMessage);\n\n const aliceOrderNoteNullifier = calcNullifier(param.aliceOrderNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const aliceInNoteFooter = getNoteFooter(param.aliceInNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const aliceChangeNoteFooter = param.aliceChangeNote.amount == 0n ? EMPTY_FOOTER : getNoteFooter(param.aliceChangeNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const bobOrderNoteNullifier = calcNullifier(param.bobMessage.orderNote.rho, param.bobMessage.publicKey);\n const bobInNoteFooter = getNoteFooter(param.bobMessage.inNote.rho, param.bobMessage.publicKey);\n\n const aliceAddressMod = encodeAddress(param.aliceAddress);\n const bobAddressMod = encodeAddress(param.bobAddress);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.PRO_SWAP),\n aliceOrderNoteNullifier,\n param.aliceOrderNote.feeRatio,\n param.bobMessage.orderNote.feeRatio,\n bobOrderNoteNullifier,\n param.aliceInNote.note,\n param.aliceChangeNote.note,\n param.bobMessage.inNote.note\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: ProSwapProofInput = {\n merkle_root: param.merkleRoot,\n alice_merkle_index: param.aliceMerkleIndex,\n alice_merkle_path: param.aliceMerklePath,\n alice_address: bn_to_0xhex(aliceAddressMod),\n alice_out_note: bn_to_0xhex(param.aliceOrderNote.note),\n alice_out_rho: bn_to_0xhex(param.aliceOrderNote.rho),\n alice_out_nullifier: bn_to_0xhex(aliceOrderNoteNullifier),\n alice_out_amount: bn_to_0xhex(param.aliceOrderNote.amount),\n alice_fee_ratio: bn_to_0xhex(param.aliceOrderNote.feeRatio),\n alice_fee_amount: bn_to_0xhex(param.aliceFeeAmount),\n\n alice_in_note: bn_to_0xhex(param.aliceInNote.note),\n alice_in_rho: bn_to_0xhex(param.aliceInNote.rho),\n alice_in_note_footer: bn_to_0xhex(aliceInNoteFooter),\n\n alice_change_note: bn_to_0xhex(param.aliceChangeNote.note),\n alice_change_rho: bn_to_0xhex(param.aliceChangeNote.rho),\n alice_change_note_footer: bn_to_0xhex(aliceChangeNoteFooter),\n\n alice_pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n alice_signature: uint8ArrayToNumberArray(signature),\n\n bob_out_asset: bn_to_0xhex(encodeAddress(param.bobMessage.orderNote.asset)),\n bob_out_amount: bn_to_0xhex(param.bobMessage.orderNote.amount),\n bob_in_asset: bn_to_0xhex(encodeAddress(param.bobMessage.inNote.asset)),\n bob_in_amount: bn_to_0xhex(param.bobMessage.inNote.amount + param.bobMessage.feeAmount),\n\n bob_merkle_index: param.bobMerkleIndex,\n bob_merkle_path: param.bobMerklePath,\n bob_address: bn_to_0xhex(bobAddressMod),\n\n bob_out_note: bn_to_0xhex(param.bobMessage.orderNote.note),\n bob_out_rho: bn_to_0xhex(param.bobMessage.orderNote.rho),\n bob_out_nullifier: bn_to_0xhex(bobOrderNoteNullifier),\n bob_fee_ratio: bn_to_0xhex(param.bobMessage.orderNote.feeRatio),\n bob_fee_amount: bn_to_0xhex(param.bobMessage.feeAmount),\n\n bob_in_note: bn_to_0xhex(param.bobMessage.inNote.note),\n bob_in_rho: bn_to_0xhex(param.bobMessage.inNote.rho),\n bob_in_note_footer: bn_to_0xhex(bobInNoteFooter),\n\n bob_pub_key: [param.bobMessage.publicKey[0].toString(), param.bobMessage.publicKey[1].toString()],\n bob_signature: uint8ArrayToNumberArray(hexStringToSignature(param.bobMessage.signature)),\n };\n const proof = await generateProof(swapCircuit, inputs);\n return {\n ...proof,\n aliceOutNullifier: inputs.alice_out_nullifier,\n aliceInNoteFooter: inputs.alice_in_note_footer,\n aliceChangeNoteFooter: inputs.alice_change_note_footer,\n bobOutNullifier: inputs.bob_out_nullifier,\n bobInNoteFooter: inputs.bob_in_note_footer,\n }\n};","import { BaseProofInput, BaseProofParam, BaseProofResult, DarkSwapMessage, DarkSwapNote, DarkSwapOrderNote, DarkSwapProofError, PROOF_DOMAIN } from \"../../types\";\nimport { encodeAddress } from \"../../utils/encoders\";\nimport { bn_to_0xhex } from \"../../utils/formatters\";\nimport { bn_to_hex } from \"../../utils/formatters\";\nimport { mimc_bn254 } from \"../../utils/mimc\";\nimport { signatureToHexString, uint8ArrayToNumberArray } from \"../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../baseProofService\";\nimport { generateKeyPair } from \"../keyService\";\nimport { calcNullifier, getNoteFooter } from \"../noteService\";\nimport retailCreateOrderCircuit from \"../../circuits/retail/dark_swap_retail_deposit_create_order_compiled_circuit.json\";\nimport { Fr } from \"../../aztec/fields/fields\";\n\ntype RetailCreateOrderProofInput = BaseProofInput & {\n deposit_out_note: string,\n deposit_out_nullifier: string,\n deposit_out_note_footer: string,\n deposit_out_rho: string,\n\n //order\n out_asset: string,\n out_amount: string,\n in_asset: string,\n in_amount: string,\n\n //fee\n fee_ratio: string,\n fee_amount: string,\n\n //swap in \n in_note: string,\n in_note_footer: string,\n in_rho: string,\n}\n\nexport type RetailCreateOrderProofParam = BaseProofParam & {\n depositNote: DarkSwapOrderNote,\n swapInNote: DarkSwapNote,\n feeAmount: bigint\n}\n\nexport type RetailCreateOrderProofResult = BaseProofResult & {\n depositNullifier: string,\n depositFooter: string,\n swapInNoteFooter: string,\n}\n\nexport async function generateRetailSwapMessage(\n address: string,\n orderNote: DarkSwapOrderNote,\n swapInNote: DarkSwapNote,\n feeAmount: bigint,\n pubKey: [Fr, Fr],\n privKey: Fr\n): Promise<DarkSwapMessage> {\n\n const addressMod = encodeAddress(address);\n const orderNoteNullifier = calcNullifier(orderNote.rho, pubKey);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.RETAIL_CREATE_ORDER),\n addressMod,\n orderNoteNullifier,\n orderNote.feeRatio,\n swapInNote.note,\n ]));\n const signature = await signMessage(message, privKey);\n\n return {\n address: address,\n orderNote: orderNote,\n orderNullifier: bn_to_0xhex(orderNoteNullifier),\n inNote: swapInNote,\n feeAmount: feeAmount,\n publicKey: pubKey,\n signature: signatureToHexString(signature),\n }\n}\n\nexport async function generateRetailCreateOrderProof(param: RetailCreateOrderProofParam): Promise<RetailCreateOrderProofResult> {\n if (param.depositNote.amount <= 0n) {\n throw new DarkSwapProofError(\"Deposit amount must be greater than 0\");\n }\n\n if (param.depositNote.feeRatio < 0n) {\n throw new DarkSwapProofError(\"Fee ratio must be greater or equal to 0\");\n }\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.signedMessage);\n\n const depositNullifier = calcNullifier(param.depositNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const depositFooter = getNoteFooter(param.depositNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const inAmount = param.feeAmount + param.swapInNote.amount;\n\n const swapInNoteFooter = getNoteFooter(param.swapInNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n\n const addressMod = encodeAddress(param.address);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.RETAIL_CREATE_ORDER),\n addressMod,\n param.depositNote.note,\n param.depositNote.feeRatio,\n param.swapInNote.note,\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: RetailCreateOrderProofInput = {\n address: bn_to_0xhex(addressMod),\n deposit_out_note: bn_to_0xhex(param.depositNote.note),\n deposit_out_nullifier: bn_to_0xhex(depositNullifier),\n deposit_out_note_footer: bn_to_0xhex(depositFooter),\n deposit_out_rho: bn_to_0xhex(param.depositNote.rho),\n\n out_asset: bn_to_0xhex(encodeAddress(param.depositNote.asset)),\n out_amount: bn_to_0xhex(param.depositNote.amount),\n in_asset: bn_to_0xhex(encodeAddress(param.swapInNote.asset)),\n in_amount: bn_to_0xhex(inAmount),\n\n in_note: bn_to_0xhex(param.swapInNote.note),\n in_note_footer: bn_to_0xhex(swapInNoteFooter),\n in_rho: bn_to_0xhex(param.swapInNote.rho),\n fee_ratio: bn_to_0xhex(param.depositNote.feeRatio),\n fee_amount: bn_to_0xhex(param.feeAmount),\n\n pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n signature: uint8ArrayToNumberArray(signature),\n };\n const proof = await generateProof(retailCreateOrderCircuit, inputs);\n return {\n ...proof,\n depositNullifier: inputs.deposit_out_nullifier,\n depositFooter: inputs.deposit_out_note_footer,\n swapInNoteFooter: inputs.in_note_footer,\n }\n};","import { ethers } from 'ethers';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateKeyPair } from '../../proof/keyService';\nimport { createNote, EMPTY_NOTE } from '../../proof/noteService';\nimport { generateProSwapProof, ProSwapProofResult } from '../../proof/pro/orders/swapProof';\nimport { DarkSwapMessage, DarkSwapNote, DarkSwapOrderNote } from '../../types';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { multiGetMerklePathAndRoot } from '../merkletree';\nimport { hexlify32 } from '../../utils/util';\nimport { generateRetailSwapMessage } from '../../proof/retail/depositOrderProof';\nimport { calcFeeAmount } from '../feeRatioService';\n\nclass ProSwapContext extends BaseContext {\n private _orderNote?: DarkSwapOrderNote;\n private _changeNote?: DarkSwapNote;\n private _swapInNote?: DarkSwapNote;\n private _proof?: ProSwapProofResult;\n private _bobAddress?: string;\n private _bobSwapMessage?: DarkSwapMessage;\n private _aliceFeeAmount?: bigint;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set orderNote(orderNote: DarkSwapOrderNote | undefined) {\n this._orderNote = orderNote;\n }\n\n get orderNote(): DarkSwapOrderNote | undefined {\n return this._orderNote;\n }\n\n set changeNote(changeNote: DarkSwapNote | undefined) {\n this._changeNote = changeNote;\n }\n\n get changeNote(): DarkSwapNote | undefined {\n return this._changeNote;\n }\n\n set swapInNote(swapInNote: DarkSwapNote | undefined) {\n this._swapInNote = swapInNote;\n }\n\n get swapInNote(): DarkSwapNote | undefined {\n return this._swapInNote;\n }\n\n set aliceFeeAmount(aliceFeeAmount: bigint | undefined) {\n this._aliceFeeAmount = aliceFeeAmount;\n }\n\n get aliceFeeAmount(): bigint | undefined {\n return this._aliceFeeAmount;\n }\n\n set proof(proof: ProSwapProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): ProSwapProofResult | undefined {\n return this._proof;\n }\n\n set bobSwapMessage(bobSwapMessage: DarkSwapMessage | undefined) {\n this._bobSwapMessage = bobSwapMessage;\n }\n\n get bobSwapMessage(): DarkSwapMessage | undefined {\n return this._bobSwapMessage;\n }\n\n set bobAddress(bobAddress: string | undefined) {\n this._bobAddress = bobAddress;\n }\n\n get bobAddress(): string | undefined {\n return this._bobAddress;\n }\n}\n\nexport class ProSwapService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public static async prepareProSwapMessageForBob(\n address: string,\n orderNote: DarkSwapOrderNote,\n swapInAmount: bigint,\n swapInAsset: string,\n signature: string\n ): Promise<DarkSwapMessage> {\n const [pubKey, privKey] = await generateKeyPair(signature);\n const feeAmount = calcFeeAmount(swapInAmount, orderNote.feeRatio);\n const swapInNote = createNote(address, swapInAsset, swapInAmount - feeAmount, pubKey);\n const darkSwapMessage = await generateRetailSwapMessage(address, orderNote, swapInNote, feeAmount, pubKey, privKey);\n return darkSwapMessage;\n }\n\n public async prepare(\n address: string,\n orderNote: DarkSwapOrderNote,\n bobAddress: string,\n bobSwapMessage: DarkSwapMessage,\n signature: string\n ): Promise<{ context: ProSwapContext; swapInNote: DarkSwapNote, changeNote: DarkSwapNote, feeAmount: bigint }> {\n const [pubKey] = await generateKeyPair(signature);\n const swapOutAmount = bobSwapMessage.feeAmount + bobSwapMessage.inNote.amount;\n const swapInAmount = bobSwapMessage.orderNote.amount;\n const aliceFeeAmount = calcFeeAmount(swapInAmount, orderNote.feeRatio);\n const changeAmount = orderNote.amount - swapOutAmount;\n const changeNote = changeAmount == 0n ? EMPTY_NOTE : createNote(address, orderNote.asset, changeAmount, pubKey);\n const swapInNote = createNote(address, bobSwapMessage.orderNote.asset, swapInAmount - aliceFeeAmount, pubKey);\n\n const context = new ProSwapContext(signature);\n context.orderNote = orderNote;\n context.swapInNote = swapInNote;\n context.changeNote = changeNote;\n context.aliceFeeAmount = aliceFeeAmount;\n context.address = address;\n context.bobAddress = bobAddress;\n context.bobSwapMessage = bobSwapMessage;\n return { context, swapInNote, changeNote, feeAmount: aliceFeeAmount };\n }\n\n private async generateProof(context: ProSwapContext): Promise<void> {\n if (!context\n || !context.orderNote\n || !context.swapInNote\n || !context.changeNote\n || !context.address\n || !context.signature\n || !context.bobSwapMessage\n || !context.bobAddress) {\n throw new DarkSwapError('Invalid context');\n }\n\n const merklePathes = await multiGetMerklePathAndRoot([context.orderNote.note, context.bobSwapMessage.orderNote.note], this._darkSwap);\n const orderNotePath = merklePathes[0];\n const bobOrderNotePath = merklePathes[1];\n\n const proof = await generateProSwapProof({\n merkleRoot: orderNotePath.root,\n aliceAddress: context.address,\n aliceMerkleIndex: orderNotePath.index,\n aliceMerklePath: orderNotePath.path,\n aliceOrderNote: context.orderNote,\n aliceChangeNote: context.changeNote,\n aliceInNote: context.swapInNote,\n aliceFeeAmount: context.aliceFeeAmount!,\n aliceSignedMessage: context.signature,\n bobAddress: context.bobAddress,\n bobMerkleIndex: bobOrderNotePath.index,\n bobMerklePath: bobOrderNotePath.path,\n bobMessage: context.bobSwapMessage,\n });\n context.merkleRoot = orderNotePath.root;\n context.proof = proof;\n }\n\n public async execute(context: ProSwapContext): Promise<string> {\n await this.generateProof(context);\n if (!context\n || !context.orderNote\n || !context.swapInNote\n || !context.changeNote\n || !context.proof\n || !context.bobSwapMessage\n || !context.bobAddress) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n this._darkSwap.signer\n );\n\n const swapArgs = [\n context.merkleRoot,\n context.proof.aliceOutNullifier,\n hexlify32(context.orderNote.feeRatio),\n hexlify32(context.swapInNote.note),\n context.proof.aliceInNoteFooter,\n hexlify32(context.changeNote.note),\n context.proof.aliceChangeNoteFooter,\n context.proof.bobOutNullifier,\n hexlify32(context.bobSwapMessage.orderNote.feeRatio),\n hexlify32(context.bobSwapMessage.inNote.note),\n context.proof.bobInNoteFooter\n ];\n\n const estimatedGas = await contract.proSwap.estimateGas(\n swapArgs,\n context.proof.proof\n );\n\n const tx = await contract.proSwap(\n swapArgs,\n context.proof.proof,\n { gasLimit: estimatedGas }\n );\n await tx.wait();\n return tx.hash;\n }\n}\n","import retailCancelOrderCircuit from \"../../circuits/retail/dark_swap_cancel_order_withdraw_compiled_circuit.json\";\nimport { BaseProofInput, BaseProofParam, BaseProofResult, DarkSwapOrderNote, DarkSwapProofError, PROOF_DOMAIN } from \"../../types\";\nimport { encodeAddress } from \"../../utils/encoders\";\nimport { bn_to_0xhex, bn_to_hex } from \"../../utils/formatters\";\nimport { mimc_bn254 } from \"../../utils/mimc\";\nimport { uint8ArrayToNumberArray } from \"../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../baseProofService\";\nimport { generateKeyPair } from \"../keyService\";\nimport { calcNullifier } from \"../noteService\";\n\n\ntype RetailCancelOrderProofInput = BaseProofInput & {\n merkle_root: string,\n merkle_index: number[],\n merkle_path: string[],\n //order note\n out_note: string,\n out_asset: string,\n out_amount: string,\n out_rho: string,\n out_nullifier: string,\n fee_ratio: string,\n}\n\nexport type RetailCancelOrderProofParam = BaseProofParam & {\n merkleRoot: string,\n merkleIndex: number[],\n merklePath: string[],\n orderNote: DarkSwapOrderNote,\n}\n\nexport type RetailCancelOrderProofResult = BaseProofResult & {\n nullifier: string,\n}\n\nexport async function generateRetailCancelOrderProof(param: RetailCancelOrderProofParam): Promise<RetailCancelOrderProofResult> {\n if (param.orderNote.amount <= 0n) {\n throw new DarkSwapProofError(\"Order amount must be greater than 0\");\n }\n\n if (param.orderNote.feeRatio < 0n) {\n throw new DarkSwapProofError(\"Fee ratio must be greater or equal to 0\");\n }\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.signedMessage);\n\n const nullifier = calcNullifier(param.orderNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n\n const addressMod = encodeAddress(param.address);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.RETAIL_CANCEL_ORDER),\n addressMod,\n nullifier,\n param.orderNote.feeRatio,\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: RetailCancelOrderProofInput = {\n address: bn_to_0xhex(addressMod),\n merkle_root: param.merkleRoot,\n merkle_index: param.merkleIndex,\n merkle_path: param.merklePath.map((x) => bn_to_0xhex(BigInt(x))),\n out_note: bn_to_0xhex(param.orderNote.note),\n out_asset: bn_to_0xhex(encodeAddress(param.orderNote.asset)),\n out_amount: bn_to_0xhex(param.orderNote.amount),\n out_rho: bn_to_0xhex(param.orderNote.rho),\n out_nullifier: bn_to_0xhex(nullifier),\n fee_ratio: bn_to_0xhex(param.orderNote.feeRatio),\n\n pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n signature: uint8ArrayToNumberArray(signature),\n };\n const proof = await generateProof(retailCancelOrderCircuit, inputs);\n return {\n ...proof,\n nullifier: inputs.out_nullifier,\n }\n};","import { ethers } from 'ethers';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateRetailCancelOrderProof, RetailCancelOrderProofResult } from '../../proof/retail/cancelOrderProof';\nimport { DarkSwapOrderNote } from '../../types';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { getMerklePathAndRoot } from '../merkletree';\nimport { hexlify32 } from '../../utils/util';\n\nclass RetailCancelOrderContext extends BaseContext {\n private _orderNote?: DarkSwapOrderNote;\n private _proof?: RetailCancelOrderProofResult;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set orderNote(orderNote: DarkSwapOrderNote | undefined) {\n this._orderNote = orderNote;\n }\n\n get orderNote(): DarkSwapOrderNote | undefined {\n return this._orderNote;\n }\n\n set proof(proof: RetailCancelOrderProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): RetailCancelOrderProofResult | undefined {\n return this._proof;\n }\n}\n\nexport class RetailCancelOrderService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public async prepare(\n address: string,\n orderNote: DarkSwapOrderNote,\n signature: string\n ): Promise<{ context: RetailCancelOrderContext }> {\n const context = new RetailCancelOrderContext(signature);\n context.orderNote = orderNote;\n context.address = address;\n return { context };\n }\n\n private async generateProof(context: RetailCancelOrderContext): Promise<void> {\n if (!context\n || !context.orderNote\n || !context.address\n || !context.signature) {\n throw new DarkSwapError('Invalid context');\n }\n\n const { root, index, path } = await getMerklePathAndRoot(context.orderNote.note, this._darkSwap);\n\n const proof = await generateRetailCancelOrderProof({\n merkleRoot: root,\n merkleIndex: index,\n merklePath: path,\n orderNote: context.orderNote,\n address: context.address,\n signedMessage: context.signature,\n });\n context.merkleRoot = root;\n context.proof = proof;\n }\n\n public async execute(context: RetailCancelOrderContext): Promise<string> {\n await this.generateProof(context);\n if (!context || !context.orderNote || !context.proof) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n this._darkSwap.signer\n );\n const tx = await contract.cancelOrderWithdraw(\n context.merkleRoot,\n context.orderNote.asset,\n hexlify32(context.orderNote.amount),\n context.proof.nullifier,\n context.proof.proof\n );\n await tx.wait();\n return tx.hash;\n }\n}\n","import { ethers } from 'ethers';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateKeyPair } from '../../proof/keyService';\nimport { createNote, createOrderNoteExt, validateOrderNoteWithPubKey } from '../../proof/noteService';\nimport { generateRetailCreateOrderProof, generateRetailSwapMessage, RetailCreateOrderProofResult } from '../../proof/retail/depositOrderProof';\nimport { DarkSwapMessage, DarkSwapNote, DarkSwapOrderNote } from '../../types';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { calcFeeAmount, getFeeRatio } from '../feeRatioService';\nimport { hexlify32 } from '../../utils/util';\nimport { bn_to_0xhex } from '../../utils/formatters';\nimport { isNativeAsset } from '../../utils/util';\nimport { getConfirmations, legacyTokenConfig } from '../../config';\nimport { MAX_ALLOWANCE } from '../../utils/constants';\nimport ERC20Abi from '../../abis/IERC20.json';\nimport ERC20_USDT from '../../abis/IERC20_USDT.json';\n\nclass RetailCreateOrderContext extends BaseContext {\n private _orderNote?: DarkSwapOrderNote;\n private _swapInNote?: DarkSwapNote;\n private _proof?: RetailCreateOrderProofResult;\n private _feeAmount?: bigint;\n private _swapMessage?: DarkSwapMessage;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set orderNote(orderNote: DarkSwapOrderNote | undefined) {\n this._orderNote = orderNote;\n }\n\n get orderNote(): DarkSwapOrderNote | undefined {\n return this._orderNote;\n }\n\n set swapInNote(swapInNote: DarkSwapNote | undefined) {\n this._swapInNote = swapInNote;\n }\n\n get swapInNote(): DarkSwapNote | undefined {\n return this._swapInNote;\n }\n\n set feeAmount(feeAmount: bigint | undefined) {\n this._feeAmount = feeAmount;\n }\n\n get feeAmount(): bigint | undefined {\n return this._feeAmount;\n }\n\n set proof(proof: RetailCreateOrderProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): RetailCreateOrderProofResult | undefined {\n return this._proof;\n }\n\n set swapMessage(swapMessage: DarkSwapMessage | undefined) {\n this._swapMessage = swapMessage;\n }\n\n get swapMessage(): DarkSwapMessage | undefined {\n return this._swapMessage;\n }\n}\n\nexport class RetailCreateOrderService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public async rebuildContextFromSwapMessage(swapMessage: DarkSwapMessage, signature: string) {\n const [pubKey] = await generateKeyPair(signature);\n //validate the swapMessage is by this signature\n if(!validateOrderNoteWithPubKey(swapMessage.orderNote, pubKey)) {\n throw new DarkSwapError('SwapMessage does not belong to this wallet');\n }\n const context = new RetailCreateOrderContext(signature);\n context.orderNote = swapMessage.orderNote;\n context.swapInNote = swapMessage.inNote;\n context.feeAmount = swapMessage.feeAmount;\n context.address = swapMessage.address;\n await this.generateProof(context);\n return context;\n }\n\n public async prepare(\n address: string,\n depositAsset: string,\n depositAmount: bigint,\n swapInAsset: string,\n swapInAmount: bigint,\n signature: string\n ): Promise<{ context: RetailCreateOrderContext; swapMessage: DarkSwapMessage }> {\n const [pubKey, privKey] = await generateKeyPair(signature);\n const feeRatio = BigInt(await getFeeRatio(address, this._darkSwap));\n const orderNote = createOrderNoteExt(address, depositAsset, depositAmount, feeRatio, pubKey);\n const feeAmount = calcFeeAmount(swapInAmount, feeRatio);\n const realSwapInAmount = swapInAmount - feeAmount\n const swapInNote = createNote(address, swapInAsset, realSwapInAmount, pubKey);\n const context = new RetailCreateOrderContext(signature);\n context.orderNote = orderNote;\n context.swapInNote = swapInNote;\n context.feeAmount = feeAmount;\n context.address = address;\n\n const swapMessage = await generateRetailSwapMessage(address, orderNote, swapInNote, feeAmount, pubKey, privKey);\n context.swapMessage = swapMessage;\n return { context, swapMessage };\n }\n\n private async generateProof(context: RetailCreateOrderContext): Promise<void> {\n if (!context\n || !context.orderNote\n || !context.swapInNote\n || !context.address\n || !context.feeAmount\n || !context.signature) {\n throw new DarkSwapError('Invalid context');\n }\n\n const proof = await generateRetailCreateOrderProof({\n depositNote: context.orderNote,\n swapInNote: context.swapInNote,\n address: context.address,\n signedMessage: context.signature,\n feeAmount: context.feeAmount\n });\n context.proof = proof;\n }\n\n public async allowance(context: RetailCreateOrderContext) {\n if (!context || !context.orderNote || !context.address || !context.signature || !context.proof) {\n throw new DarkSwapError('Invalid context');\n }\n if (isNativeAsset(context.orderNote.asset)) {\n return;\n }\n const signer = this._darkSwap.signer;\n const asset = context.orderNote.asset;\n const amount = context.orderNote.amount;\n const allowanceContract = new ethers.Contract(asset, ERC20Abi.abi, this._darkSwap);\n const allowance = await allowanceContract.allowance(\n signer.getAddress(),\n this._darkSwap.contracts.darkSwapAssetManager\n );\n if (BigInt(allowance) < amount) {\n const isLegacy =\n legacyTokenConfig.hasOwnProperty(this._darkSwap.chainId) &&\n legacyTokenConfig[this._darkSwap.chainId].includes(asset.toLowerCase());\n const contract = new ethers.Contract(asset, isLegacy ? ERC20_USDT.abi : ERC20Abi.abi, signer);\n const tx = await contract.approve(this._darkSwap.contracts.darkSwapAssetManager, hexlify32(MAX_ALLOWANCE));\n await tx.wait(getConfirmations(this._darkSwap.chainId));\n }\n }\n\n public async execute(context: RetailCreateOrderContext): Promise<string> {\n await this.generateProof(context);\n if (!context || !context.orderNote || !context.swapInNote || !context.proof) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n this._darkSwap.signer\n );\n let ethAmount = 0n;\n if (isNativeAsset(context.orderNote.asset)) {\n ethAmount = context.orderNote.amount;\n } else {\n await this.allowance(context);\n }\n const tx = await contract.retailDepositCreateOrder(\n [\n hexlify32(context.orderNote.note),\n context.proof.depositFooter,\n context.orderNote.asset,\n bn_to_0xhex(context.orderNote.amount),\n hexlify32(context.swapInNote.note),\n context.proof.swapInNoteFooter\n ],\n context.proof.proof,\n {\n value: bn_to_0xhex(ethAmount)\n }\n );\n await tx.wait();\n return tx.hash;\n }\n}\n","import retailSwapCircuit from \"../../circuits/retail/dark_swap_retail_swap_compiled_circuit.json\";\nimport { BaseProofResult, DarkSwapMessage, DarkSwapProofError } from \"../../types\";\nimport { encodeAddress } from \"../../utils/encoders\";\nimport { bn_to_0xhex } from \"../../utils/formatters\";\nimport { hexStringToSignature, uint8ArrayToNumberArray } from \"../../utils/proofUtils\";\nimport { generateProof } from \"../baseProofService\";\nimport { calcNullifier, getNoteFooter } from \"../noteService\";\n\ntype RetailSwapProofInput = {\n merkle_root: string,\n\n // Alice input\n alice_merkle_index: number[],\n alice_merkle_path: string[],\n alice_address: string,\n alice_out_note: string,\n alice_out_rho: string,\n alice_out_nullifier: string,\n\n //Alice fee\n alice_fee_ratio: string,\n alice_fee_amount: string,\n\n // Alice output\n alice_in_note: string,\n alice_in_rho: string,\n alice_in_note_footer: string,\n\n // Alice pub key and signature\n alice_pub_key: string[],\n alice_signature: any,\n\n //order\n alice_out_asset: string,\n alice_out_amount: string,\n alice_in_asset: string,\n alice_in_amount: string,\n\n // Bob input\n bob_merkle_index: number[],\n bob_merkle_path: string[],\n bob_address: string,\n bob_out_note: string,\n bob_out_rho: string,\n bob_out_nullifier: string,\n\n //bob fee\n bob_fee_ratio: string,\n bob_fee_amount: string,\n\n // Bob output\n bob_in_note: string,\n bob_in_rho: string,\n bob_in_note_footer: string,\n\n // Bob pub key and signature\n bob_pub_key: string[],\n bob_signature: any,\n}\n\nexport type RetailSwapProofParam = {\n merkleRoot: string,\n aliceMerkleIndex: number[],\n aliceMerklePath: string[],\n aliceMessage: DarkSwapMessage,\n\n bobMerkleIndex: number[],\n bobMerklePath: string[],\n bobMessage: DarkSwapMessage,\n}\n\nexport type RetailSwapProofResult = BaseProofResult & {\n aliceOrderNullifier: string,\n aliceInNoteFooter: string,\n bobOrderNullifier: string,\n bobInNoteFooter: string,\n}\n\nexport async function generateRetailSwapProof(param: RetailSwapProofParam): Promise<RetailSwapProofResult> {\n if (param.aliceMessage.orderNote.feeRatio < 0n\n || param.bobMessage.orderNote.feeRatio < 0n) {\n throw new DarkSwapProofError(\"Invalid fee ratio\");\n }\n\n if (param.aliceMessage.inNote.amount <= 0n\n || param.aliceMessage.orderNote.amount <= 0n\n || param.aliceMessage.inNote.amount <= 0n\n || param.bobMessage.inNote.amount <= 0n\n || param.bobMessage.orderNote.amount <= 0n) {\n throw new DarkSwapProofError(\"Invalid note amount\");\n }\n\n if (param.aliceMessage.orderNote.amount != param.bobMessage.inNote.amount + param.bobMessage.feeAmount\n || param.bobMessage.orderNote.amount != param.aliceMessage.inNote.amount + param.aliceMessage.feeAmount) {\n throw new DarkSwapProofError(\"Invalid order amount\");\n }\n\n const aliceOrderNoteNullifier = calcNullifier(param.aliceMessage.orderNote.rho, param.aliceMessage.publicKey);\n const aliceInNoteFooter = getNoteFooter(param.aliceMessage.inNote.rho, param.aliceMessage.publicKey);\n const bobOrderNoteNullifier = calcNullifier(param.bobMessage.orderNote.rho, param.bobMessage.publicKey);\n const bobInNoteFooter = getNoteFooter(param.bobMessage.inNote.rho, param.bobMessage.publicKey);\n\n const aliceAddressMod = encodeAddress(param.aliceMessage.address);\n const bobAddressMod = encodeAddress(param.bobMessage.address);\n\n const inputs: RetailSwapProofInput = {\n merkle_root: param.merkleRoot,\n\n alice_merkle_index: param.aliceMerkleIndex,\n alice_merkle_path: param.aliceMerklePath.map((x) => bn_to_0xhex(BigInt(x))),\n alice_address: bn_to_0xhex(aliceAddressMod),\n\n alice_out_rho: bn_to_0xhex(param.aliceMessage.orderNote.rho),\n alice_out_asset: bn_to_0xhex(encodeAddress(param.aliceMessage.orderNote.asset)),\n alice_out_amount: bn_to_0xhex(param.aliceMessage.orderNote.amount),\n alice_out_note: bn_to_0xhex(param.aliceMessage.orderNote.note),\n alice_out_nullifier: bn_to_0xhex(aliceOrderNoteNullifier),\n alice_fee_ratio: bn_to_0xhex(param.aliceMessage.orderNote.feeRatio),\n alice_fee_amount: bn_to_0xhex(param.aliceMessage.feeAmount),\n\n alice_in_rho: bn_to_0xhex(param.aliceMessage.inNote.rho),\n alice_in_asset: bn_to_0xhex(encodeAddress(param.aliceMessage.inNote.asset)),\n alice_in_amount: bn_to_0xhex(param.aliceMessage.inNote.amount + param.aliceMessage.feeAmount),\n alice_in_note: bn_to_0xhex(param.aliceMessage.inNote.note),\n alice_in_note_footer: bn_to_0xhex(aliceInNoteFooter),\n\n alice_pub_key: [param.aliceMessage.publicKey[0].toString(), param.aliceMessage.publicKey[1].toString()],\n alice_signature: uint8ArrayToNumberArray(hexStringToSignature(param.aliceMessage.signature)),\n\n bob_merkle_index: param.bobMerkleIndex,\n bob_merkle_path: param.bobMerklePath.map((x) => bn_to_0xhex(BigInt(x))),\n bob_address: bn_to_0xhex(bobAddressMod),\n\n bob_out_note: bn_to_0xhex(param.bobMessage.orderNote.note),\n bob_out_rho: bn_to_0xhex(param.bobMessage.orderNote.rho),\n bob_out_nullifier: bn_to_0xhex(bobOrderNoteNullifier),\n bob_fee_ratio: bn_to_0xhex(param.bobMessage.orderNote.feeRatio),\n bob_fee_amount: bn_to_0xhex(param.bobMessage.feeAmount),\n\n bob_in_note: bn_to_0xhex(param.bobMessage.inNote.note),\n bob_in_rho: bn_to_0xhex(param.bobMessage.inNote.rho),\n bob_in_note_footer: bn_to_0xhex(bobInNoteFooter),\n\n bob_pub_key: [param.bobMessage.publicKey[0].toString(), param.bobMessage.publicKey[1].toString()],\n bob_signature: uint8ArrayToNumberArray(hexStringToSignature(param.bobMessage.signature)),\n };\n const proof = await generateProof(retailSwapCircuit, inputs);\n return {\n ...proof,\n aliceOrderNullifier: inputs.alice_out_nullifier,\n aliceInNoteFooter: inputs.alice_in_note_footer,\n bobOrderNullifier: inputs.bob_out_nullifier,\n bobInNoteFooter: inputs.bob_in_note_footer,\n }\n};","import { ethers } from 'ethers';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateRetailSwapProof, RetailSwapProofResult } from '../../proof/retail/swapProof';\nimport { DarkSwapMessage } from '../../types';\nimport { hexlify32 } from '../../utils/util';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { multiGetMerklePathAndRoot } from '../merkletree';\n\nclass RetailSwapContext extends BaseContext {\n private _aliceSwapMessage?: DarkSwapMessage;\n private _bobSwapMessage?: DarkSwapMessage;\n private _proof?: RetailSwapProofResult;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set aliceSwapMessage(aliceSwapMessage: DarkSwapMessage | undefined) {\n this._aliceSwapMessage = aliceSwapMessage;\n }\n\n get aliceSwapMessage(): DarkSwapMessage | undefined {\n return this._aliceSwapMessage;\n }\n\n set bobSwapMessage(bobSwapMessage: DarkSwapMessage | undefined) {\n this._bobSwapMessage = bobSwapMessage;\n }\n\n get bobSwapMessage(): DarkSwapMessage | undefined {\n return this._bobSwapMessage;\n }\n\n set proof(proof: RetailSwapProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): RetailSwapProofResult | undefined {\n return this._proof;\n }\n}\n\nexport class RetailSwapService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public async prepare(\n aliceSwapMessage: DarkSwapMessage,\n bobSwapMessage: DarkSwapMessage\n ): Promise<{ context: RetailSwapContext }> {\n const context = new RetailSwapContext(aliceSwapMessage.signature);\n context.aliceSwapMessage = aliceSwapMessage;\n context.bobSwapMessage = bobSwapMessage;\n return { context };\n }\n\n private async generateProof(context: RetailSwapContext): Promise<void> {\n if (!context\n || !context.aliceSwapMessage\n || !context.bobSwapMessage) {\n throw new DarkSwapError('Invalid context');\n }\n\n const merklePathes = await multiGetMerklePathAndRoot([context.aliceSwapMessage.orderNote.note, context.bobSwapMessage.orderNote.note], this._darkSwap);\n const aliceOrderNotePath = merklePathes[0];\n const bobOrderNotePath = merklePathes[1];\n\n const proof = await generateRetailSwapProof({\n merkleRoot: aliceOrderNotePath.root,\n aliceMerkleIndex: aliceOrderNotePath.index,\n aliceMerklePath: aliceOrderNotePath.path,\n aliceMessage: context.aliceSwapMessage,\n bobMerkleIndex: bobOrderNotePath.index,\n bobMerklePath: bobOrderNotePath.path,\n bobMessage: context.bobSwapMessage,\n });\n context.merkleRoot = aliceOrderNotePath.root;\n context.proof = proof;\n }\n\n public async execute(context: RetailSwapContext): Promise<string> {\n await this.generateProof(context);\n if (!context\n || !context.merkleRoot\n || !context.aliceSwapMessage\n || !context.bobSwapMessage\n || !context.proof) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n this._darkSwap.signer\n );\n const tx = await contract.retailSwap(\n [\n context.merkleRoot,\n hexlify32(context.aliceSwapMessage.orderNote.feeRatio),\n context.proof.aliceOrderNullifier,\n hexlify32(context.aliceSwapMessage.inNote.note),\n context.proof.aliceInNoteFooter,\n hexlify32(context.bobSwapMessage.orderNote.feeRatio),\n context.proof.bobOrderNullifier,\n hexlify32(context.bobSwapMessage.inNote.note),\n context.proof.bobInNoteFooter\n ],\n context.proof.proof\n );\n await tx.wait();\n return tx.hash;\n }\n}\n","import retailBridgeOrderCircuit from \"../../circuits/synara/synara_dark_swap_retail_deposit_bridge_create_order_compiled_circuit.json\";\nimport { BaseProofInput, BaseProofParam, BaseProofResult, DarkSwapNote, DarkSwapOrderNote, DarkSwapProofError, PROOF_DOMAIN } from \"../../types\";\nimport { encodeAddress } from \"../../utils/encoders\";\nimport { bn_to_0xhex, bn_to_hex } from \"../../utils/formatters\";\nimport { mimc_bn254 } from \"../../utils/mimc\";\nimport { uint8ArrayToNumberArray } from \"../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../baseProofService\";\nimport { generateKeyPair } from \"../keyService\";\nimport { getNoteFooter } from \"../noteService\";\n\ntype RetailDepositBridgeOrderProofInput = BaseProofInput & {\n dest_chain: string,\n //bridge fee\n bridge_fee_amount: string,\n\n deposit_out_note: string,\n deposit_out_note_footer: string,\n deposit_out_rho: string,\n\n //order\n out_asset_a: string,\n out_asset_b: string,\n out_amount: string,\n in_asset: string,\n in_amount: string,\n\n //fee\n fee_ratio: string,\n fee_amount: string,\n\n //swap in \n in_note: string,\n in_note_footer: string,\n in_rho: string,\n}\n\nexport type RetailBridgeOrderProofParam = BaseProofParam & {\n depositSourceAsset: string,\n depositNote: DarkSwapOrderNote,\n swapInNote: DarkSwapNote,\n feeRatio: bigint,\n feeAmount: bigint,\n destChain: number,\n bridgeFeeAmount: bigint,\n}\n\nexport type RetailBridgeOrderProofResult = BaseProofResult & {\n depositFooter: string,\n swapInNoteFooter: string,\n}\n\nexport async function generateRetailBridgeOrderProof(param: RetailBridgeOrderProofParam): Promise<RetailBridgeOrderProofResult> {\n if (param.depositNote.amount <= 0n) {\n throw new DarkSwapProofError(\"Deposit amount must be greater than 0\");\n }\n\n if (param.depositNote.feeRatio < 0n) {\n throw new DarkSwapProofError(\"Fee ratio must be greater or equal to 0\");\n }\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.signedMessage);\n\n const depositFooter = getNoteFooter(param.depositNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const inAmount = param.feeAmount + param.swapInNote.amount;\n\n const swapInNoteFooter = getNoteFooter(param.swapInNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n\n const addressMod = encodeAddress(param.address);\n const depositSourceAssetMod = encodeAddress(param.depositSourceAsset);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.RETAIL_BRIDGE_ORDER),\n BigInt(param.destChain),\n addressMod,\n depositSourceAssetMod,\n param.depositNote.note,\n param.depositNote.feeRatio,\n param.swapInNote.note,\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: RetailDepositBridgeOrderProofInput = {\n address: bn_to_0xhex(addressMod),\n dest_chain: bn_to_0xhex(BigInt(param.destChain)),\n bridge_fee_amount: bn_to_0xhex(param.bridgeFeeAmount),\n deposit_out_note: bn_to_0xhex(param.depositNote.note),\n deposit_out_note_footer: bn_to_0xhex(depositFooter),\n deposit_out_rho: bn_to_0xhex(param.depositNote.rho),\n\n out_asset_a: bn_to_0xhex(depositSourceAssetMod),\n out_asset_b: bn_to_0xhex(encodeAddress(param.depositNote.asset)),\n out_amount: bn_to_0xhex(param.depositNote.amount + param.bridgeFeeAmount),\n in_asset: bn_to_0xhex(encodeAddress(param.swapInNote.asset)),\n in_amount: bn_to_0xhex(inAmount),\n\n fee_ratio: bn_to_0xhex(param.feeRatio),\n fee_amount: bn_to_0xhex(param.feeAmount),\n\n in_note: bn_to_0xhex(param.swapInNote.note),\n in_note_footer: bn_to_0xhex(swapInNoteFooter),\n in_rho: bn_to_0xhex(param.swapInNote.rho),\n\n pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n signature: uint8ArrayToNumberArray(signature),\n };\n const proof = await generateProof(retailBridgeOrderCircuit, inputs);\n return {\n ...proof,\n depositFooter: inputs.deposit_out_note_footer,\n swapInNoteFooter: inputs.in_note_footer,\n }\n};","import { PROOF_DOMAIN } from \"../types\";\n\nexport const VK_HASH_CONFIG = {\n [PROOF_DOMAIN.RETAIL_BRIDGE_ORDER]: '0x0ca4f42da1fbc3e0f0b6b715f2b5458e41ff6c91f0a0c4b035cd64243c2661d6',\n}\n","import { ethers, keccak256, solidityPacked } from 'ethers';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateKeyPair } from '../../proof/keyService';\nimport { createNote, createOrderNoteExt } from '../../proof/noteService';\nimport { generateRetailSwapMessage } from '../../proof/retail/depositOrderProof';\nimport { generateRetailBridgeOrderProof, RetailBridgeOrderProofResult } from '../../proof/synara/bridgeOrderProof';\nimport {\n DarkSwapMessage, DarkSwapNote, DarkSwapOrderNote,\n PROOF_DOMAIN\n} from '../../types';\nimport { BaseContext } from '../BaseService';\nimport { calcFeeAmount, getFeeRatio } from '../feeRatioService';\nimport {\n hexlify32,\n isNativeAsset\n} from '../../utils/util';\nimport axios from 'axios';\nimport { VK_HASH_CONFIG } from '../../config/zkverifyConfig';\nimport { legacyTokenConfig } from '../../config';\nimport ERC20Abi from '../../abis/IERC20.json';\nimport ERC20_USDT from '../../abis/IERC20_USDT.json';\nimport SynaraDarkSwapOnBridgeAssetManagerAbi from '../../abis/SynaraDarkSwapOnBridgeAssetManager.json';\nimport CanonicalTokenRegistryAbi from '../../abis/CanonicalTokenRegistry.json';\nimport BridgeAbi from '../../abis/Bridge.json';\nimport { bn_to_0xhex } from '../../utils/formatters';\nimport { MAX_ALLOWANCE } from '../../utils/constants';\n\nconst _DOMAIN_PREFIX = \"0x191253796e6172614272696467654465706f7369740a\";\n\ninterface RetailDepositBridgeCreateOrderArgs {\n destChain: bigint;\n bridgeFee: bigint;\n owner: string;\n depositOutNote: string;\n depositOutNoteFooter: string;\n outAssetSource: string;\n outAssetDest: string;\n outAmount: bigint;\n feeRatio: bigint;\n inNote: string;\n inNoteFooter: string;\n destContractAddress: string;\n}\n\ninterface AttestationDetails {\n attestationId: bigint;\n merklePath: string[];\n leafCount: bigint;\n index: bigint;\n}\n\nclass BridgeCreateOrderContext extends BaseContext {\n private _orderNote?: DarkSwapOrderNote;\n private _swapInNote?: DarkSwapNote;\n private _proof?: RetailBridgeOrderProofResult;\n private _feeAmount?: bigint;\n private _swapMessage?: DarkSwapMessage;\n private _sourceChainId?: number;\n private _destChainId?: number;\n private _sourceAsset?: string;\n private _sourceAmount?: bigint;\n private _bridgeFeeAmount?: bigint;\n private _depositId?: string;\n private _attestationDetails?: AttestationDetails;\n private _relayer?: string;\n private _jobId?: string;\n private _canonicalId?: string;\n private _callDataHash?: string;\n private _nonce?: bigint;\n private _callData?: string;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set orderNote(orderNote: DarkSwapOrderNote | undefined) {\n this._orderNote = orderNote;\n }\n\n get orderNote(): DarkSwapOrderNote | undefined {\n return this._orderNote;\n }\n\n set swapInNote(swapInNote: DarkSwapNote | undefined) {\n this._swapInNote = swapInNote;\n }\n\n get swapInNote(): DarkSwapNote | undefined {\n return this._swapInNote;\n }\n\n set feeAmount(feeAmount: bigint | undefined) {\n this._feeAmount = feeAmount;\n }\n\n get feeAmount(): bigint | undefined {\n return this._feeAmount;\n }\n\n set proof(proof: RetailBridgeOrderProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): RetailBridgeOrderProofResult | undefined {\n return this._proof;\n }\n\n set swapMessage(swapMessage: DarkSwapMessage | undefined) {\n this._swapMessage = swapMessage;\n }\n\n get swapMessage(): DarkSwapMessage | undefined {\n return this._swapMessage;\n }\n\n set sourceChainId(sourceChainId: number | undefined) {\n this._sourceChainId = sourceChainId;\n }\n\n get sourceChainId(): number | undefined {\n return this._sourceChainId;\n }\n\n set destChainId(destChainId: number | undefined) {\n this._destChainId = destChainId;\n }\n\n get destChainId(): number | undefined {\n return this._destChainId;\n }\n\n set sourceAsset(sourceAsset: string | undefined) {\n this._sourceAsset = sourceAsset;\n }\n\n get sourceAsset(): string | undefined {\n return this._sourceAsset;\n }\n\n set sourceAmount(sourceAmount: bigint | undefined) {\n this._sourceAmount = sourceAmount;\n }\n\n get sourceAmount(): bigint | undefined {\n return this._sourceAmount;\n }\n\n set bridgeFeeAmount(bridgeFeeAmount: bigint | undefined) {\n this._bridgeFeeAmount = bridgeFeeAmount;\n }\n\n get bridgeFeeAmount(): bigint | undefined {\n return this._bridgeFeeAmount;\n }\n\n set depositId(depositId: string | undefined) {\n this._depositId = depositId;\n }\n\n get depositId(): string | undefined {\n return this._depositId;\n }\n\n set attestationDetails(attestationDetails: AttestationDetails | undefined) {\n this._attestationDetails = attestationDetails;\n }\n\n get attestationDetails(): AttestationDetails | undefined {\n return this._attestationDetails;\n }\n\n set relayer(relayer: string | undefined) {\n this._relayer = relayer;\n }\n\n get relayer(): string | undefined {\n return this._relayer;\n }\n\n set jobId(jobId: string | undefined) {\n this._jobId = jobId;\n }\n\n get jobId(): string | undefined {\n return this._jobId;\n }\n\n set canonicalId(canonicalId: string | undefined) {\n this._canonicalId = canonicalId;\n }\n\n get canonicalId(): string | undefined {\n return this._canonicalId;\n }\n\n set callDataHash(callDataHash: string | undefined) {\n this._callDataHash = callDataHash;\n }\n\n get callDataHash(): string | undefined {\n return this._callDataHash;\n }\n\n set nonce(nonce: bigint | undefined) {\n this._nonce = nonce;\n }\n\n get nonce(): bigint | undefined {\n return this._nonce;\n }\n\n set callData(callData: string | undefined) {\n this._callData = callData;\n }\n\n get callData(): string | undefined {\n return this._callData;\n }\n}\n\nexport type SubmitProofRelayerRequest = {\n proof: string;\n publicSignals: string[];\n vkHash: string;\n};\n\nexport class BridgeCreateOrderService {\n protected _darkSwapOfSourceChain: DarkSwap;\n protected _darkSwapOfDestChain: DarkSwap;\n\n constructor(_darkSwapOfSourceChain: DarkSwap, _darkSwapOfDestChain: DarkSwap) {\n this._darkSwapOfSourceChain = _darkSwapOfSourceChain;\n this._darkSwapOfDestChain = _darkSwapOfDestChain;\n }\n\n private async getCanonicalTokenAddress(sourceChainId: number, sourceAsset: string): Promise<string> {\n const canonicalTokenRegistry = new ethers.Contract(\n this._darkSwapOfSourceChain.contracts.synaraCanonicalTokenRegistry,\n CanonicalTokenRegistryAbi.abi,\n this._darkSwapOfSourceChain.provider,\n );\n return await canonicalTokenRegistry.getCanonicalId(BigInt(sourceChainId), sourceAsset);\n }\n\n private async getBridgeFee(canonicalId: string, wallet: string, amount: bigint): Promise<bigint> {\n const bridge = new ethers.Contract(\n this._darkSwapOfSourceChain.contracts.synaraBridge,\n BridgeAbi.abi,\n this._darkSwapOfSourceChain.provider,\n );\n return await bridge.getBridgeFee(canonicalId, wallet, amount);\n }\n\n public async prepare(\n address: string,\n sourceChainId: number,\n sourceAsset: string,\n sourceAmount: bigint,\n canonicalId: string,\n bridgeFee: bigint,\n destChainId: number,\n depositAsset: string,\n depositAmount: bigint,\n swapInAsset: string,\n swapInAmount: bigint,\n signature: string\n ): Promise<{ context: BridgeCreateOrderContext; swapMessage: DarkSwapMessage }> {\n const [pubKey, privKey] = await generateKeyPair(signature);\n const feeRatio = BigInt(await getFeeRatio(address, this._darkSwapOfDestChain));\n const canonicalIdFromContract = await this.getCanonicalTokenAddress(sourceChainId, sourceAsset);\n if (canonicalIdFromContract !== canonicalId) {\n throw new DarkSwapError('CanonicalId not match');\n }\n const bridgeFeeAmountFromContract = await this.getBridgeFee(canonicalId, address, sourceAmount);\n if (bridgeFeeAmountFromContract !== bridgeFee) {\n throw new DarkSwapError('BridgeFee not match');\n }\n const orderNote = createOrderNoteExt(address, depositAsset, depositAmount, feeRatio, pubKey);\n const feeAmount = calcFeeAmount(swapInAmount, feeRatio);\n const realSwapInAmount = swapInAmount - feeAmount\n const swapInNote = createNote(address, swapInAsset, realSwapInAmount, pubKey);\n const context = new BridgeCreateOrderContext(signature);\n context.orderNote = orderNote;\n context.swapInNote = swapInNote;\n context.feeAmount = feeAmount;\n context.address = address;\n context.sourceChainId = sourceChainId;\n context.destChainId = destChainId;\n context.sourceAsset = sourceAsset;\n context.sourceAmount = sourceAmount;\n context.bridgeFeeAmount = bridgeFee;\n context.canonicalId = canonicalId;\n\n const swapMessage = await generateRetailSwapMessage(address, orderNote, swapInNote, feeAmount, pubKey, privKey);\n context.swapMessage = swapMessage;\n return { context, swapMessage };\n }\n\n private pickRelayer() {\n return this._darkSwapOfSourceChain.contracts.zkverifyRelayerUrls[0];\n }\n\n private async submitProof(context: BridgeCreateOrderContext): Promise<void> {\n if (!context) {\n throw new DarkSwapError('Invalid context');\n }\n context.proof = await this.generateProof(context);\n\n const relayerRequest: SubmitProofRelayerRequest = {\n proof: context.proof.proof,\n publicSignals: context.proof.verifyInputs,\n vkHash: VK_HASH_CONFIG[PROOF_DOMAIN.RETAIL_BRIDGE_ORDER],\n }\n context.relayer = this.pickRelayer();\n const response = await axios.post(context.relayer + '/v1/zkVerifySubmitProof', relayerRequest);\n if (response.status == 200) {\n context.jobId = response.data.id;\n } else if (response.status == 400) {\n throw new Error('Request error' + response.data.error);\n } else {\n throw new Error('Relayer not asscessable');\n }\n\n const { error, result } = await this.pollJobStatus(context);\n if (error) {\n throw new DarkSwapError(error);\n }\n context.attestationDetails = result;\n }\n\n private async pollJobStatus(context: BridgeCreateOrderContext): Promise<{ error: string | undefined; result: AttestationDetails | undefined }> {\n let tries = 1;\n while (tries <= 100) {\n if (tries >= 100) {\n break;\n }\n try {\n const response = await axios.get(`${context.relayer}/v1/jobs/${context.jobId}`);\n if (response.status === 400) {\n const { error } = response.data;\n console.log(error);\n return {\n error: 'Failed to submit proof to relayer:' + error,\n result: undefined\n };\n }\n if (response.status === 200) {\n const { status, failedReason, result } = response.data;\n\n if (status === 'FAILED') {\n return {\n error: failedReason ?? 'Transaction failed.',\n result: undefined\n };\n }\n if (status === 'CONFIRMED' || status === 'MINED') {\n return {\n error: undefined,\n result: {\n attestationId: BigInt(result.attestationId),\n merklePath: result.merklePath,\n leafCount: BigInt(result.leafCount),\n index: BigInt(result.index),\n }\n };\n }\n }\n await new Promise(resolve => setTimeout(resolve, 5000));\n } catch (error) {\n console.log(error);\n }\n tries++;\n }\n\n return {\n error: 'Waited too long for getting attestation details.',\n result: undefined\n };\n }\n\n private async generateProof(context: BridgeCreateOrderContext): Promise<RetailBridgeOrderProofResult> {\n if (!context\n || !context.orderNote\n || !context.swapInNote\n || !context.address\n || context.feeAmount === undefined\n || !context.signature\n || !context.sourceChainId\n || !context.destChainId\n || !context.sourceAsset\n || !context.sourceAmount\n || context.bridgeFeeAmount === undefined) {\n throw new DarkSwapError('Invalid context');\n }\n\n const proof = await generateRetailBridgeOrderProof({\n depositSourceAsset: context.sourceAsset,\n depositNote: context.orderNote,\n swapInNote: context.swapInNote,\n feeRatio: context.orderNote.feeRatio,\n feeAmount: context.feeAmount,\n destChain: context.destChainId,\n bridgeFeeAmount: context.bridgeFeeAmount,\n address: context.address,\n signedMessage: context.signature,\n });\n return proof;\n }\n\n private async computeDepositId(context: BridgeCreateOrderContext): Promise<string> {\n if (!context\n || !context.callData\n || !context.orderNote\n || !context.swapInNote\n || !context.address\n || context.feeAmount === undefined\n || !context.signature\n || !context.sourceChainId\n || !context.destChainId\n || !context.sourceAsset\n || context.bridgeFeeAmount === undefined) {\n throw new DarkSwapError('Invalid context');\n }\n\n const callDataHash = ethers.solidityPackedKeccak256(\n ['address', 'bytes'],\n [this._darkSwapOfDestChain.contracts.synaraDarkSwapOnBridgeAssetManager, context.callData]\n );\n context.callDataHash = callDataHash;\n const currentNonce = await this.getCurrentNonce(context) as bigint;\n context.nonce = currentNonce;\n\n const packedData = solidityPacked(\n [\n \"bytes\", // _DOMAIN_PREFIX\n \"address\", // bridge\n \"bytes32\", // canonicalId\n \"address\", // synaraDarkSwapOnBridgeAssetManager\n \"address\", // userWallet\n \"bytes32\", // amount\n \"bytes32\", // destinationChainId\n \"bytes32\", // nonce\n \"bytes32\", // block.chainid\n \"bytes32\" // _computeCallDataHash(call)\n ],\n [\n _DOMAIN_PREFIX,\n this._darkSwapOfSourceChain.contracts.synaraBridge,\n context.canonicalId,\n this._darkSwapOfSourceChain.contracts.synaraDarkSwapOnBridgeAssetManager,\n context.address,\n hexlify32(context.orderNote.amount),\n hexlify32(context.destChainId),\n hexlify32(context.nonce),\n hexlify32(context.sourceChainId),\n context.callDataHash,\n ]\n );\n const depositCommitment = keccak256(packedData);\n return depositCommitment;\n }\n\n private async getCurrentNonce(context: BridgeCreateOrderContext) {\n const provider = this._darkSwapOfSourceChain.provider;\n const contract = new ethers.Contract(\n this._darkSwapOfSourceChain.contracts.synaraDarkSwapOnBridgeAssetManager,\n SynaraDarkSwapOnBridgeAssetManagerAbi.abi,\n provider);\n return await contract.currentNonce({ from: context.address });\n }\n\n private async composeCallData(context: BridgeCreateOrderContext): Promise<string> {\n if (!context\n || !context.orderNote\n || !context.swapInNote\n || !context.address\n || !context.destChainId\n || !context.sourceAsset\n || context.bridgeFeeAmount === undefined\n || !context.proof\n || !context.attestationDetails) {\n throw new DarkSwapError('Invalid context');\n }\n const functionSignature = \"_retailBridgeCreateOrder((uint256,uint256,address,bytes32,bytes32,address,address,uint256,uint256,bytes32,bytes32,address),(uint256,bytes32[],uint256,uint256))\";\n\n const args: RetailDepositBridgeCreateOrderArgs = {\n destChain: BigInt(context.destChainId),\n bridgeFee: context.bridgeFeeAmount,\n owner: context.address,\n depositOutNote: hexlify32(context.orderNote.note),\n depositOutNoteFooter: context.proof.depositFooter,\n outAssetSource: context.sourceAsset,\n outAssetDest: context.orderNote.asset,\n outAmount: context.orderNote.amount,\n feeRatio: context.orderNote.feeRatio,\n inNote: hexlify32(context.swapInNote.note),\n inNoteFooter: context.proof.swapInNoteFooter,\n destContractAddress: this._darkSwapOfDestChain.contracts.synaraDarkSwapOnBridgeAssetManager,\n };\n\n const iface = new ethers.Interface([`function ${functionSignature}`]);\n const fullData = iface.encodeFunctionData('_retailBridgeCreateOrder', [\n [\n args.destChain,\n args.bridgeFee,\n args.owner,\n args.depositOutNote,\n args.depositOutNoteFooter,\n args.outAssetSource,\n args.outAssetDest,\n args.outAmount,\n args.feeRatio,\n args.inNote,\n args.inNoteFooter,\n args.destContractAddress\n ],\n [\n context.attestationDetails.attestationId,\n context.attestationDetails.merklePath,\n context.attestationDetails.leafCount,\n context.attestationDetails.index\n ]\n ]);\n return fullData;\n }\n\n protected async allowance(context: BridgeCreateOrderContext) {\n if (!context || !context.orderNote || !context.address || !context.signature || !context.proof) {\n throw new DarkSwapError('Invalid context');\n }\n const signer = this._darkSwapOfSourceChain.signer;\n const asset = context.orderNote.asset;\n const amount = context.orderNote.amount;\n const allowanceContract = new ethers.Contract(asset, ERC20Abi.abi, this._darkSwapOfSourceChain);\n const allowance = await allowanceContract.allowance(\n signer.getAddress(),\n this._darkSwapOfSourceChain.contracts.darkSwapAssetManager\n );\n if (BigInt(allowance) < amount) {\n const isLegacy =\n legacyTokenConfig.hasOwnProperty(this._darkSwapOfSourceChain.chainId) &&\n legacyTokenConfig[this._darkSwapOfSourceChain.chainId].includes(asset.toLowerCase());\n const contract = new ethers.Contract(asset, isLegacy ? ERC20_USDT.abi : ERC20Abi.abi, signer);\n const tx = await contract.approve(this._darkSwapOfSourceChain.contracts.darkSwapAssetManager, hexlify32(MAX_ALLOWANCE));\n await tx.wait();\n }\n }\n\n public async execute(context: BridgeCreateOrderContext): Promise<{ depositId: string, txHash: string }> {\n await this.submitProof(context);\n const callData = await this.composeCallData(context);\n context.callData = callData;\n context.depositId = await this.computeDepositId(context);\n const txHash = await this._execute(context);\n return {\n depositId: context.depositId,\n txHash,\n };\n }\n\n private async _execute(context: BridgeCreateOrderContext): Promise<string> {\n if (!context\n || !context.destChainId\n || !context.attestationDetails\n || !context.orderNote\n || !context.swapInNote\n || !context.sourceAsset\n || !context.sourceAmount\n || context.bridgeFeeAmount === undefined\n || !context.depositId\n || !context.proof) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwapOfSourceChain.contracts.synaraDarkSwapOnBridgeAssetManager,\n SynaraDarkSwapOnBridgeAssetManagerAbi.abi,\n this._darkSwapOfSourceChain.signer\n );\n let ethAmount = 0n;\n if (isNativeAsset(context.sourceAsset)) {\n ethAmount = context.sourceAmount;\n } else {\n await this.allowance(context);\n }\n const tx = await contract.retailDepositBridge(\n context.depositId,\n [\n hexlify32(BigInt(context.destChainId)),\n hexlify32(context.bridgeFeeAmount),\n context.address,\n hexlify32(context.orderNote.note),\n context.proof.depositFooter,\n context.sourceAsset,\n context.orderNote.asset,\n hexlify32(context.sourceAmount),\n hexlify32(context.orderNote.feeRatio),\n hexlify32(context.swapInNote.note),\n context.proof.swapInNoteFooter,\n this._darkSwapOfDestChain.contracts.synaraDarkSwapOnBridgeAssetManager\n ],\n [\n hexlify32(context.attestationDetails.attestationId),\n context.attestationDetails.merklePath,\n hexlify32(context.attestationDetails.leafCount),\n hexlify32(context.attestationDetails.index)\n ],\n {\n value: bn_to_0xhex(ethAmount)\n }\n );\n await tx.wait();\n return tx.hash;\n }\n}","import { ethers } from 'ethers';\nimport { ContractConfiguartion, contractConfig } from './config/contractConfig';\nimport { DarkSwapError } from './entities';\n\nexport class DarkSwap {\n signer: ethers.Signer;\n provider: ethers.Provider;\n chainId: number;\n contracts: ContractConfiguartion;\n\n constructor(\n signer: ethers.Signer,\n chainId: number,\n provider?: ethers.Provider,\n contracts?: ContractConfiguartion,\n ) {\n // @ts-ignore\n this.signer = signer;\n // @ts-ignore\n this.provider = provider || signer.provider;\n this.chainId = chainId;\n if (contracts) {\n this.contracts = contracts;\n } else {\n if (contractConfig[chainId]) {\n this.contracts = contractConfig[chainId];\n } else {\n throw new DarkSwapError('There is no default contract configuration for the provided chainId');\n }\n }\n }\n}\n","import { DarkSwapMessage } from \"../types\";\nimport { Fr } from \"../aztec/fields/fields\";\n\nexport function serializeDarkSwapMessage(swapMessage: DarkSwapMessage): string {\n return JSON.stringify({\n address: swapMessage.address,\n orderNote: {\n rho: swapMessage.orderNote.rho.toString(),\n amount: swapMessage.orderNote.amount.toString(),\n asset: swapMessage.orderNote.asset,\n note: swapMessage.orderNote.note.toString(),\n feeRatio: swapMessage.orderNote.feeRatio.toString(),\n },\n orderNullifier: swapMessage.orderNullifier,\n inNote: {\n rho: swapMessage.inNote.rho.toString(),\n amount: swapMessage.inNote.amount.toString(),\n asset: swapMessage.inNote.asset,\n note: swapMessage.inNote.note.toString(),\n },\n feeAmount: swapMessage.feeAmount.toString(),\n pubKey: [swapMessage.publicKey[0].toString(), swapMessage.publicKey[1].toString()],\n signature: swapMessage.signature,\n });\n}\n\nfunction deserializePublicKey(publicKeyString: string[]): [Fr, Fr] {\n return [Fr.fromHexString(publicKeyString[0]), Fr.fromHexString(publicKeyString[1])];\n}\n\nexport function deserializeDarkSwapMessage(serializedMessage: string): DarkSwapMessage {\n const message = JSON.parse(serializedMessage);\n return {\n address: message.address,\n orderNote: {\n address: message.orderNote.address,\n rho: BigInt(message.orderNote.rho),\n amount: BigInt(message.orderNote.amount),\n asset: message.orderNote.asset,\n note: BigInt(message.orderNote.note),\n feeRatio: BigInt(message.orderNote.feeRatio),\n },\n feeAmount: BigInt(message.feeAmount),\n inNote: {\n address: message.inNote.address,\n rho: BigInt(message.inNote.rho),\n amount: BigInt(message.inNote.amount),\n asset: message.inNote.asset,\n note: BigInt(message.inNote.note),\n },\n signature: message.signature,\n publicKey: deserializePublicKey(message.pubKey),\n orderNullifier: message.orderNullifier,\n };\n}"],"names":["NATIVE_ASSETS","isNativeAsset","asset","toLowerCase","isAddressEquals","address1","address2","hexlify32","value","ethers","zeroPadValue","toBeHex","isHexEquals","hex1","hex2","DarkSwapError","_Error","message","_this","call","name","_inheritsLoose","_wrapNativeSuper","Error","NoteOnChainStatus","P","BigInt","MAX_ALLOWANCE","defaultAbiCoder","AbiCoder","encodeAddress","address","encoder","encodedAddress","encode","hashedAddress","ripemd160","toBits","x","bits","push","length","pow32","exponent","r","b","i","mimc","k","constants","exp","t","h","mimc_bn254","array","_iterator","_createForOfIteratorHelperLoose","_step","done","elem","getRandomValues","window","crypto","buf","nodeCrypto","require","randomBytes","set","DOMAIN_NOTE","DOMAIN_ORDER_NOTE","EMPTY_NOTE","rho","note","amount","createNote","fuzkPubKey","generateRho","footer","getNoteFooter","addressMod","assetMod","publicKey","toString","securityLevel","primeByteLength","Math","ceil","totalBytes","ab","ArrayBuffer","Uint8Array","hexlify","calcNullifier","createOrderNoteExt","feeRatio","noteCommitment","validateNoteWithPubKey","validateOrderNoteWithPubKey","toBigIntBE","hex","toBufferBE","num","width","buffer","Buffer","from","padStart","slice","BufferReader","offset","index","asReader","bufferOrReader","isBuffer","byteOffset","byteLength","_proto","prototype","isEmpty","readNumber","rangeCheck","readUint32BE","readUInt64","result","readBigUInt64BE","readUInt128","readUInt256","readUInt16","readUInt16BE","readUInt8","readBoolean","Boolean","at","readBytes","n","subarray","readToEnd","readNumberVector","readVector","fromBuffer","reader","readUint256Vector","itemDeserializer","size","Array","readVectorUint8Prefix","readBufferArray","end","item","readBuffer","readObject","deserializer","peekBytes","undefined","readString","readUint8Array","readMap","numEntries","map","key","getLength","remainingBytes","numBytes","ZERO_BUFFER","alloc","BaseField","SIZE_IN_BYTES","asBuffer","concat","asBigInt","modulus","toBuffer","toBigInt","toBool","toNumber","Number","MAX_SAFE_INTEGER","toNumberUnsafe","toShortString","str","equals","rhs","lt","cmp","lhsBigInt","rhsBigInt","isZero","toFriendlyJSON","toField","_createClass","get","f","fromBufferReduce","MODULUS","fromHexString","withoutPrefix","replace","checked","_withoutPrefix$match","match","Fr","_BaseField","_proto2","zero","ZERO","fromString","Fq","_BaseField2","_proto3","fromHighLow","high","low","HIGH_SHIFT","add","toJSON","toFields","lo","hi","LOW_MASK","concatenateUint8Arrays","arrayOfUint8Arrays","totalLength","reduce","prev","curr","mapTuple","tuple","fn","SchnorrSignature","SIZE","isSignature","signature","test","sig","buf1","buf2","buf3","copy","numToUInt32BE","bufferSize","writeUInt32BE","numToInt32BE","writeInt32BE","boolToBuffer","writeUInt8","serializeToBufferArray","ret","_len","arguments","objs","_key2","_i","_objs","obj","isArray","apply","serializeBigInt","_obj$constructor","constructor","serializeToFields","_len2","_key3","_i2","_objs2","toFr","_obj$constructor2","serializeToBuffer","poseidon2Hash","_x","_poseidon2Hash","_asyncToGenerator","_regenerator","m","_callee","input","inputFields","api","hash","w","_context","BarretenbergSync","initSingleton","process","env","BB_WASM_PATH","v","FrBarretenberg","a","FieldReader","fields","remainingFields","skip","readField","peekField","readFq","field","readU32","fromFields","isFinished","hasHexPrefix","startsWith","withoutHexPrefix","hexToBuffer","bufferToHex","Point","y","isInfinite","toXAndSign","toBigInts","toCompressedBuffer","_this$toXAndSign","sign","compressedValue","pow","COMPRESSED_SIZE_IN_BYTES","toNoirStruct","is_infinite","toWrappedNoirStruct","inner","Schnorr","computePublicKey","_computePublicKey","privateKey","_api$getWasm$callWasm","getWasm","callWasmExport","constructSignature","_constructSignature","_callee2","msg","messageArray","_api$getWasm$callWasm2","s","e","_context2","_x2","_x3","generateKeyPair","_generateKeyPair","schnorr","getContract","darkSwap","provider","Contract","MerkleAbi","abi","getNoteOnChainStatus","_getNoteOnChainStatus","nullifier","contract","isNotCreated","isSpent","isLocked","contracts","merkleTreeOperator","noteIsNotCreated","UNKNOWN","nullifiersUsed","SPENT","nullifiersLocked","LOCKED","ACTIVE","getNoteOnChainStatusByPublicKey","_x4","_x5","_x6","_getNoteOnChainStatusByPublicKey","onChainStatus","getNoteOnChainStatusBySignature","_x7","_x8","_x9","_getNoteOnChainStatusBySignature","_callee3","_yield$generateKeyPai","_context3","isNoteActive","_x0","_x1","_x10","_isNoteActive","_callee4","_context4","isNoteSpent","_x11","_x12","_x13","_isNoteSpent","_callee5","_context5","isNoteValid","_x14","_x15","_x16","_isNoteValid","_callee6","_context6","getNullifierBySignature","_x17","_x18","_getNullifierBySignature","_callee7","_yield$generateKeyPai2","_context7","isNoteCreated","_x19","_x20","_isNoteCreated","_callee8","_context8","ChainId","legacyTokenConfig","_legacyTokenConfig","MAINNET","HARDHAT","confirmationsConfig","_confirmationsConfig","ARBITRUM_ONE","BASE","SEPOLIA","DEFAULT_CONFIRMATIONS","getConfirmations","chainId","DEFAULT_FEE_RATIO","GAS_LIMIT_MULTIPLIER","GAS_LIMIT_PRECISION","PROOF_DOMAIN","EMPTY_NULLIFIER","EMPTY_FOOTER","FEE_RATIO_PRECISION","DarkSwapProofError","Object","setPrototypeOf","bn_to_hex","bn_to_0xhex","signatureToHexString","hexStringToSignature","uint8ArrayToNumberArray","uint8Array","generateProof","_generateProof","circuit","inputs","start_time","backend","noir","_yield$noir$execute","witness","proof","destroy_start_time","Date","getTime","UltraHonkBackend","bytecode","Noir","p","execute","keccak","console","log","verifyInputs","publicInputs","destroy","signMessage","_signMessage","fuzkPriKey","reverse","generateDepositProof","_generateDepositProof","param","depositAmount","fuzkPubKeyX","fuzkPubKeyY","oldBalanceNullifier","newBalanceFooter","newBalanceNote","oldBalanceNote","signedMessage","DEPOSIT","merkle_root","merkleRoot","merkle_index","merkleIndex","merkle_path","merklePath","in_amount","existing_note","existing_amount","existing_rho","existing_nullifier","account_note","account_rho","account_note_footer","pub_key","depositCircuit","_extends","BaseContext","_signature","_address","_merkleRoot","_tx","tx","BaseContractService","_darkSwap","EMPTY_PATH","path","fill","root","getMerklePathAndRoot","_getMerklePathAndRoot","multiGetMerklePathAndRoot","_multiGetMerklePathAndRoot","notes","_yield$contract$getMu","paths","indexes","results","getMultiMerklePaths","contractConfig","_contractConfig","priceOracle","ethAddress","nativeWrapper","darkSwapAssetManager","darkSwapFeeAssetManager","synaraDarkSwapOnBridgeAssetManager","synaraBridge","synaraCanonicalTokenRegistry","zkverifyRelayerUrls","BASE_SEPOLIA","HORIZEN_TESTNET","HARDHAT_BASE","refineGasLimit","estimatedGas","DepositContext","_BaseContext","_currentBalance","currentBalance","_newBalance","newBalance","_proof","_depositAmount","DepositService","_BaseContractService","prepare","_prepare","depositAsset","walletAddress","pubKey","newBalanceAmount","context","_t","_execute","signer","_contract$deposit","depositArgs","gasLimit","_contract$deposit2","_depositArgs","_estimatedGas","DarkSwapAssetManagerAbi","allowance","deposit","estimateGas","wait","_allowance","allowanceContract","isLegacy","ERC20Abi","getAddress","hasOwnProperty","includes","ERC20_USDT","approve","generateWithdrawProof","_generateWithdrawProof","withdrawAmount","oldBalance","WITHDRAW","out_amount","remaining_note","remaining_rho","remaining_note_footer","remaining_amount","withdrawCircuit","WithdrawContext","_withdrawAmount","WithdrawService","withdraw","generateJoinProof","_generateJoinProof","inNullifier1","inNullifier2","outNoteFooter","inNote1","inNote2","outNote","JOIN","in_merkle_index_1","inMerkleIndex1","in_merkle_index_2","inMerkleIndex2","in_merkle_path_1","inMerklePath1","in_merkle_path_2","inMerklePath2","in_amount_1","in_amount_2","in_rho_1","in_rho_2","in_nullifier_1","in_nullifier_2","in_note_1","in_note_2","out_note","out_rho","out_note_footer","joinCircuit","JoinContext","_inNote1","_inNote2","_outNote","JoinService","merklePathes","path1","path2","_contract$join","joinArgs","join","generateTripleJoinProof","_generateTripleJoinProof","inNullifier3","inNote3","TRIPLE_JOIN","in_merkle_index_3","inMerkleIndex3","in_merkle_path_3","inMerklePath3","in_amount_3","in_rho_3","in_nullifier_3","in_note_3","tripleJoinCircuit","TripleJoinContext","_inNote3","TripleJoinService","path3","DarkSwapFeeAssetManagerAbi","getFeeRatio","_getFeeRatio","wallet","getServiceFeePercentage","calcFeeAmount","generateProCreateOrderProof","_generateProCreateOrderProof","feeAmount","orderNoteFooter","orderNote","inAmount","PRO_CREATE_ORDER","inAsset","out_nullifier","fee_ratio","fee_amount","change_note","change_rho","change_note_footer","change_amount","order_note","order_rho","order_note_footer","order_asset","order_amount","in_asset","proCreateOrderCircuit","ProCreateOrderContext","_orderNote","_swapInAsset","swapInAsset","_swapInAmount","swapInAmount","_oldBalance","_feeAmount","_swapMessage","swapMessage","ProCreateOrderService","orderAsset","orderAmount","balanceNote","orderNullifier","_t2","_yield$getMerklePathA","txData","proCreateOrder","generateProCancelOrderProof","_generateProCancelOrderProof","newBalanceNoteFooter","PRO_CANCEL_ORDER","merkle_index_remaining","merkleIndexRemaining","merkle_path_remaining","merklePathRemaining","order_nullifier","remaining_nullifier","proCancelOrderCircuit","ProCancelOrderContext","ProCancelOrderService","orderPath","oldBalancePath","cancelOrder","generateProSwapProof","_generateProSwapProof","aliceOrderNoteNullifier","aliceInNoteFooter","aliceChangeNoteFooter","bobOrderNoteNullifier","bobInNoteFooter","aliceAddressMod","bobAddressMod","aliceOrderNote","bobMessage","aliceChangeNote","aliceInNote","inNote","aliceFeeAmount","aliceSignedMessage","aliceAddress","bobAddress","PRO_SWAP","alice_merkle_index","aliceMerkleIndex","alice_merkle_path","aliceMerklePath","alice_address","alice_out_note","alice_out_rho","alice_out_nullifier","alice_out_amount","alice_fee_ratio","alice_fee_amount","alice_in_note","alice_in_rho","alice_in_note_footer","alice_change_note","alice_change_rho","alice_change_note_footer","alice_pub_key","alice_signature","bob_out_asset","bob_out_amount","bob_in_asset","bob_in_amount","bob_merkle_index","bobMerkleIndex","bob_merkle_path","bobMerklePath","bob_address","bob_out_note","bob_out_rho","bob_out_nullifier","bob_fee_ratio","bob_fee_amount","bob_in_note","bob_in_rho","bob_in_note_footer","bob_pub_key","bob_signature","swapCircuit","aliceOutNullifier","bobOutNullifier","generateRetailSwapMessage","_generateRetailSwapMessage","swapInNote","privKey","orderNoteNullifier","RETAIL_CREATE_ORDER","generateRetailCreateOrderProof","_generateRetailCreateOrderProof","depositNullifier","depositFooter","swapInNoteFooter","depositNote","deposit_out_note","deposit_out_nullifier","deposit_out_note_footer","deposit_out_rho","out_asset","in_note","in_note_footer","in_rho","retailCreateOrderCircuit","ProSwapContext","_changeNote","changeNote","_swapInNote","_aliceFeeAmount","_bobSwapMessage","bobSwapMessage","_bobAddress","ProSwapService","prepareProSwapMessageForBob","_prepareProSwapMessageForBob","darkSwapMessage","swapOutAmount","changeAmount","orderNotePath","bobOrderNotePath","swapArgs","proSwap","generateRetailCancelOrderProof","_generateRetailCancelOrderProof","RETAIL_CANCEL_ORDER","retailCancelOrderCircuit","RetailCancelOrderContext","RetailCancelOrderService","cancelOrderWithdraw","RetailCreateOrderContext","RetailCreateOrderService","rebuildContextFromSwapMessage","_rebuildContextFromSwapMessage","realSwapInAmount","ethAmount","retailDepositCreateOrder","generateRetailSwapProof","_generateRetailSwapProof","aliceMessage","alice_out_asset","alice_in_asset","alice_in_amount","retailSwapCircuit","aliceOrderNullifier","bobOrderNullifier","RetailSwapContext","_aliceSwapMessage","aliceSwapMessage","RetailSwapService","aliceOrderNotePath","retailSwap","generateRetailBridgeOrderProof","_generateRetailBridgeOrderProof","depositSourceAssetMod","depositSourceAsset","RETAIL_BRIDGE_ORDER","destChain","dest_chain","bridge_fee_amount","bridgeFeeAmount","out_asset_a","out_asset_b","retailBridgeOrderCircuit","VK_HASH_CONFIG","_VK_HASH_CONFIG","_DOMAIN_PREFIX","BridgeCreateOrderContext","_sourceChainId","sourceChainId","_destChainId","destChainId","_sourceAsset","sourceAsset","_sourceAmount","sourceAmount","_bridgeFeeAmount","_depositId","depositId","_attestationDetails","attestationDetails","_relayer","relayer","_jobId","jobId","_canonicalId","canonicalId","_callDataHash","callDataHash","_nonce","nonce","_callData","callData","BridgeCreateOrderService","_darkSwapOfSourceChain","_darkSwapOfDestChain","getCanonicalTokenAddress","_getCanonicalTokenAddress","canonicalTokenRegistry","CanonicalTokenRegistryAbi","getCanonicalId","getBridgeFee","_getBridgeFee","bridge","BridgeAbi","bridgeFee","canonicalIdFromContract","bridgeFeeAmountFromContract","pickRelayer","submitProof","_submitProof","relayerRequest","response","_yield$this$pollJobSt","error","publicSignals","vkHash","axios","post","status","data","id","pollJobStatus","_pollJobStatus","tries","_response$data","failedReason","_t3","attestationId","leafCount","Promise","resolve","setTimeout","computeDepositId","_computeDepositId","currentNonce","packedData","depositCommitment","solidityPackedKeccak256","getCurrentNonce","solidityPacked","keccak256","_getCurrentNonce","SynaraDarkSwapOnBridgeAssetManagerAbi","composeCallData","_composeCallData","_callee9","functionSignature","args","iface","fullData","_context9","owner","depositOutNote","depositOutNoteFooter","outAssetSource","outAssetDest","outAmount","inNoteFooter","destContractAddress","Interface","encodeFunctionData","_x21","_callee0","_context0","_x22","_execute2","_callee1","txHash","_context1","_x23","_execute3","_callee10","_context10","retailDepositBridge","_x24","DarkSwap","serializeDarkSwapMessage","JSON","stringify","deserializePublicKey","publicKeyString","deserializeDarkSwapMessage","serializedMessage","parse"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAACksB,MAAM,CAAC5oB,GAAG,CAAC;MAC/BE,MAAM,EAAE/C,MAAM,CAACT,OAAO,CAACksB,MAAM,CAAC1oB,MAAM,CAAC;MACrCvE,KAAK,EAAEe,OAAO,CAACksB,MAAM,CAACjtB,KAAK;MAC3BsE,IAAI,EAAE9C,MAAM,CAACT,OAAO,CAACksB,MAAM,CAAC3oB,IAAI;KACnC;IACD+J,SAAS,EAAEtN,OAAO,CAACsN,SAAS;IAC5BtJ,SAAS,EAAEq3B,oBAAoB,CAACr7B,OAAO,CAACmhB,MAAM,CAAC;IAC/C6I,cAAc,EAAEhqB,OAAO,CAACgqB;GAC3B;AACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"darkswap-sdk-synara.cjs.development.js","sources":["../src/utils/util.ts","../src/entities/error.ts","../src/entities/types.ts","../src/utils/constants.ts","../src/utils/encoders.ts","../src/utils/mimc.ts","../src/proof/noteService.ts","../src/aztec/bigint-buffer/index.ts","../src/aztec/serialize/buffer_reader.ts","../src/aztec/fields/fields.ts","../src/aztec/crypto/serialize.ts","../src/aztec/serialize/types.ts","../src/aztec/crypto/schnorr/signature.ts","../src/aztec/serialize/free_funcs.ts","../src/aztec/serialize/serialize.ts","../src/aztec/crypto/poseidon/index.ts","../src/aztec/serialize/field_reader.ts","../src/aztec/string/index.ts","../src/aztec/fields/point.ts","../src/aztec/crypto/schnorr/index.ts","../src/proof/keyService.ts","../src/services/noteService.ts","../src/config/chain.ts","../src/config/config.ts","../src/types.ts","../src/utils/formatters.ts","../src/utils/proofUtils.ts","../src/proof/baseProofService.ts","../src/proof/basic/depositProof.ts","../src/services/BaseService.ts","../src/services/merkletree.ts","../src/config/contractConfig.ts","../src/utils/gasUtil.ts","../src/services/base/deposit.ts","../src/proof/basic/withdrawProof.ts","../src/services/base/withdraw.ts","../src/proof/basic/joinProof.ts","../src/services/base/join.ts","../src/proof/basic/tripleJoinProof.ts","../src/services/base/tripleJoin.ts","../src/services/feeRatioService.ts","../src/proof/pro/orders/createOrderProof.ts","../src/services/pro/createOrder.ts","../src/proof/pro/orders/cancelOrderProof.ts","../src/services/pro/cancelOrder.ts","../src/proof/pro/orders/swapProof.ts","../src/proof/retail/depositOrderProof.ts","../src/services/pro/proSwap.ts","../src/proof/retail/cancelOrderProof.ts","../src/services/retail/cancelAndWithdrawOrder.ts","../src/services/retail/depositAndCreateOrder.ts","../src/proof/retail/swapProof.ts","../src/services/agent/retailSwap.ts","../src/proof/synara/bridgeOrderProof.ts","../src/config/zkverifyConfig.ts","../src/services/synara/bridgeAndCreateOrder.ts","../src/darkSwap.ts","../src/utils/swapUtils.ts"],"sourcesContent":["import { ethers } from 'ethers';\n\nconst NATIVE_ASSETS = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE';\n\nexport function isNativeAsset(asset: string): boolean {\n return asset.toLowerCase() === NATIVE_ASSETS.toLowerCase();\n}\n\nexport function isAddressEquals(address1: string, address2: string): boolean {\n if (!address1 || !address2) return false;\n return address1.toLowerCase() === address2.toLowerCase();\n}\n\nexport function hexlify32(value: bigint | number): string {\n return ethers.zeroPadValue(ethers.toBeHex(value), 32);\n}\n\nexport function isHexEquals(hex1: string, hex2: string): boolean {\n if (!hex1 || !hex2) return false;\n return hex1.toLowerCase() === hex2.toLowerCase();\n}\n","export class DarkSwapError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'DarkSwapError';\n }\n}\n","export enum NoteOnChainStatus {\n ACTIVE = 'ACTIVE',\n SPENT = 'SPENT',\n LOCKED = 'LOCKED',\n UNKNOWN = 'UNKNOWN'\n}\n","export const P: bigint = BigInt(\"21888242871839275222246405745257275088548364400416034343698204186575808495617\");\n\nexport const MAX_ALLOWANCE = BigInt('115792089237316195423570985008687907853269984665640564039457584007913129639935'); // 2**256 - 1\n","import { AbiCoder, ripemd160 } from \"ethers\";\n\nconst defaultAbiCoder = new AbiCoder();\n\nexport function encodeAddress(address: string): bigint {\n let encoder = defaultAbiCoder;\n let encodedAddress = encoder.encode([\"address\"], [address]);\n let hashedAddress = ripemd160(encodedAddress);\n return BigInt(hashedAddress);\n}","import { P } from './constants';\n\n\nfunction toBits(x: bigint): bigint[] {\n const bits: bigint[] = [];\n while (x > 0n) {\n bits.push(x & 1n);\n x >>= 1n;\n }\n while (bits.length < 32) {\n bits.push(0n);\n }\n return bits;\n}\n\nfunction pow32(x: bigint, exponent: bigint): bigint {\n let r = 1n;\n let b = toBits(exponent);\n\n for (let i = 1; i < 33; i++) {\n r = (r * r) % P;\n r = (b[32 - i] * (r * x) + (1n - b[32 - i]) * r) % P;\n }\n return r;\n}\n\nfunction mimc(x: bigint, k: bigint, constants: bigint[], exp: bigint): bigint {\n // round 0\n let t = (x + k) % P;\n let h = pow32(t, exp) % P;\n // next rounds\n for (let i = 1; i < constants.length; i++) {\n t = (h + k + constants[i]) % P;\n h = pow32(t, exp) % P;\n }\n return (h + k) % P;\n}\n\nexport function mimc_bn254(array: bigint[]): bigint {\n //mimc parameters\n const exponent = 7n;\n //generated from seed \"mimc\" using keccak256\n const constants: bigint[] = [\n 0n,\n 20888961410941983456478427210666206549300505294776164667214940546594746570981n,\n 15265126113435022738560151911929040668591755459209400716467504685752745317193n,\n 8334177627492981984476504167502758309043212251641796197711684499645635709656n,\n 1374324219480165500871639364801692115397519265181803854177629327624133579404n,\n 11442588683664344394633565859260176446561886575962616332903193988751292992472n,\n 2558901189096558760448896669327086721003508630712968559048179091037845349145n,\n 11189978595292752354820141775598510151189959177917284797737745690127318076389n,\n 3262966573163560839685415914157855077211340576201936620532175028036746741754n,\n 17029914891543225301403832095880481731551830725367286980611178737703889171730n,\n 4614037031668406927330683909387957156531244689520944789503628527855167665518n,\n 19647356996769918391113967168615123299113119185942498194367262335168397100658n,\n 5040699236106090655289931820723926657076483236860546282406111821875672148900n,\n 2632385916954580941368956176626336146806721642583847728103570779270161510514n,\n 17691411851977575435597871505860208507285462834710151833948561098560743654671n,\n 11482807709115676646560379017491661435505951727793345550942389701970904563183n,\n 8360838254132998143349158726141014535383109403565779450210746881879715734773n,\n 12663821244032248511491386323242575231591777785787269938928497649288048289525n,\n 3067001377342968891237590775929219083706800062321980129409398033259904188058n,\n 8536471869378957766675292398190944925664113548202769136103887479787957959589n,\n 19825444354178182240559170937204690272111734703605805530888940813160705385792n,\n 16703465144013840124940690347975638755097486902749048533167980887413919317592n,\n 13061236261277650370863439564453267964462486225679643020432589226741411380501n,\n 10864774797625152707517901967943775867717907803542223029967000416969007792571n,\n 10035653564014594269791753415727486340557376923045841607746250017541686319774n,\n 3446968588058668564420958894889124905706353937375068998436129414772610003289n,\n 4653317306466493184743870159523234588955994456998076243468148492375236846006n,\n 8486711143589723036499933521576871883500223198263343024003617825616410932026n,\n 250710584458582618659378487568129931785810765264752039738223488321597070280n,\n 2104159799604932521291371026105311735948154964200596636974609406977292675173n,\n 16313562605837709339799839901240652934758303521543693857533755376563489378839n,\n 6032365105133504724925793806318578936233045029919447519826248813478479197288n,\n 14025118133847866722315446277964222215118620050302054655768867040006542798474n,\n 7400123822125662712777833064081316757896757785777291653271747396958201309118n,\n 1744432620323851751204287974553233986555641872755053103823939564833813704825n,\n 8316378125659383262515151597439205374263247719876250938893842106722210729522n,\n 6739722627047123650704294650168547689199576889424317598327664349670094847386n,\n 21211457866117465531949733809706514799713333930924902519246949506964470524162n,\n 13718112532745211817410303291774369209520657938741992779396229864894885156527n,\n 5264534817993325015357427094323255342713527811596856940387954546330728068658n,\n 18884137497114307927425084003812022333609937761793387700010402412840002189451n,\n 5148596049900083984813839872929010525572543381981952060869301611018636120248n,\n 19799686398774806587970184652860783461860993790013219899147141137827718662674n,\n 19240878651604412704364448729659032944342952609050243268894572835672205984837n,\n 10546185249390392695582524554167530669949955276893453512788278945742408153192n,\n 5507959600969845538113649209272736011390582494851145043668969080335346810411n,\n 18177751737739153338153217698774510185696788019377850245260475034576050820091n,\n 19603444733183990109492724100282114612026332366576932662794133334264283907557n,\n 10548274686824425401349248282213580046351514091431715597441736281987273193140n,\n 1823201861560942974198127384034483127920205835821334101215923769688644479957n,\n 11867589662193422187545516240823411225342068709600734253659804646934346124945n,\n 18718569356736340558616379408444812528964066420519677106145092918482774343613n,\n 10530777752259630125564678480897857853807637120039176813174150229243735996839n,\n 20486583726592018813337145844457018474256372770211860618687961310422228379031n,\n 12690713110714036569415168795200156516217175005650145422920562694422306200486n,\n 17386427286863519095301372413760745749282643730629659997153085139065756667205n,\n 2216432659854733047132347621569505613620980842043977268828076165669557467682n,\n 6309765381643925252238633914530877025934201680691496500372265330505506717193n,\n 20806323192073945401862788605803131761175139076694468214027227878952047793390n,\n 4037040458505567977365391535756875199663510397600316887746139396052445718861n,\n 19948974083684238245321361840704327952464170097132407924861169241740046562673n,\n 845322671528508199439318170916419179535949348988022948153107378280175750024n,\n 16222384601744433420585982239113457177459602187868460608565289920306145389382n,\n 10232118865851112229330353999139005145127746617219324244541194256766741433339n,\n 6699067738555349409504843460654299019000594109597429103342076743347235369120n,\n 6220784880752427143725783746407285094967584864656399181815603544365010379208n,\n 6129250029437675212264306655559561251995722990149771051304736001195288083309n,\n 10773245783118750721454994239248013870822765715268323522295722350908043393604n,\n 4490242021765793917495398271905043433053432245571325177153467194570741607167n,\n 19596995117319480189066041930051006586888908165330319666010398892494684778526n,\n 837850695495734270707668553360118467905109360511302468085569220634750561083n,\n 11803922811376367215191737026157445294481406304781326649717082177394185903907n,\n 10201298324909697255105265958780781450978049256931478989759448189112393506592n,\n 13564695482314888817576351063608519127702411536552857463682060761575100923924n,\n 9262808208636973454201420823766139682381973240743541030659775288508921362724n,\n 173271062536305557219323722062711383294158572562695717740068656098441040230n,\n 18120430890549410286417591505529104700901943324772175772035648111937818237369n,\n 20484495168135072493552514219686101965206843697794133766912991150184337935627n,\n 19155651295705203459475805213866664350848604323501251939850063308319753686505n,\n 11971299749478202793661982361798418342615500543489781306376058267926437157297n,\n 18285310723116790056148596536349375622245669010373674803854111592441823052978n,\n 7069216248902547653615508023941692395371990416048967468982099270925308100727n,\n 6465151453746412132599596984628739550147379072443683076388208843341824127379n,\n 16143532858389170960690347742477978826830511669766530042104134302796355145785n,\n 19362583304414853660976404410208489566967618125972377176980367224623492419647n,\n 1702213613534733786921602839210290505213503664731919006932367875629005980493n,\n 10781825404476535814285389902565833897646945212027592373510689209734812292327n,\n 4212716923652881254737947578600828255798948993302968210248673545442808456151n,\n 7594017890037021425366623750593200398174488805473151513558919864633711506220n,\n 18979889247746272055963929241596362599320706910852082477600815822482192194401n,\n 13602139229813231349386885113156901793661719180900395818909719758150455500533n,\n ];\n\n let r = 0n;\n for (const elem of array) {\n let h = mimc(elem, r, constants, exponent);\n r = (r + elem + h) % P;\n }\n return r % P;\n}","import { hexlify } from 'ethers'\nimport { DarkSwapNote, DarkSwapNoteExt, DarkSwapOrderNote } from '../types'\nimport { P } from '../utils/constants'\nimport { encodeAddress } from '../utils/encoders'\nimport { mimc_bn254 } from '../utils/mimc'\nimport { Fr } from '../aztec/fields/fields'\n\nlet getRandomValues: (buf: Uint8Array) => Uint8Array;\n\nif (typeof window !== 'undefined' && window.crypto && window.crypto.getRandomValues) {\n getRandomValues = (buf) => window.crypto.getRandomValues(buf);\n} else {\n const nodeCrypto = require('crypto');\n getRandomValues = (buf) => {\n const randomBytes = nodeCrypto.randomBytes(buf.length);\n buf.set(randomBytes);\n return buf;\n };\n}\n\nexport const DOMAIN_NOTE = 2n\nexport const DOMAIN_ORDER_NOTE = 3n\n\nexport const EMPTY_NOTE: DarkSwapNote = {\n address: '0x0000000000000000000000000000000000000000',\n rho: 0n,\n note: 0n,\n amount: 0n,\n asset: '0x0000000000000000000000000000000000000000',\n}\n\nexport function createNote(\n address: string,\n asset: string,\n amount: bigint,\n fuzkPubKey: [Fr, Fr]\n): DarkSwapNoteExt {\n const rho = generateRho()\n const footer = getNoteFooter(rho, fuzkPubKey)\n\n const addressMod = encodeAddress(address)\n const assetMod = encodeAddress(asset)\n const note = mimc_bn254([DOMAIN_NOTE, addressMod, assetMod, amount, footer])\n return {\n address,\n rho,\n note,\n asset,\n amount,\n footer,\n }\n}\n\nexport function getNoteFooter(rho: bigint, publicKey: [Fr, Fr]): bigint {\n return mimc_bn254([\n mimc_bn254([BigInt(rho)]),\n BigInt(publicKey[0].toString()),\n BigInt(publicKey[1].toString()),\n ])\n}\n\nfunction generateRho(): bigint {\n const securityLevel = 128\n const primeByteLength = Math.ceil(P.toString(2).length / 8)\n const totalBytes = primeByteLength + Math.ceil(securityLevel / 8)\n\n let rho = BigInt(0)\n do {\n let ab = new ArrayBuffer(totalBytes)\n let buf = new Uint8Array(ab)\n rho = BigInt(hexlify(getRandomValues(buf))) % P\n } while (rho === BigInt(0))\n\n return rho\n}\n\nexport function calcNullifier(rho: bigint, fuzkPubKey: [Fr, Fr]): bigint {\n return mimc_bn254([\n rho,\n BigInt(fuzkPubKey[0].toString()),\n BigInt(fuzkPubKey[1].toString()),\n ])\n}\n\nexport function createOrderNoteExt(\n address: string,\n asset: string,\n amount: bigint,\n feeRatio: bigint,\n fuzkPubKey: [Fr, Fr]\n): DarkSwapOrderNote {\n const rho = generateRho()\n const footer = getNoteFooter(rho, fuzkPubKey)\n\n const assetMod = encodeAddress(asset)\n const addressMod = encodeAddress(address)\n const noteCommitment = mimc_bn254([\n DOMAIN_ORDER_NOTE,\n addressMod,\n assetMod,\n amount,\n feeRatio,\n footer,\n ])\n\n return {\n address,\n rho,\n note: noteCommitment,\n asset,\n amount,\n feeRatio,\n }\n}\n\n\nexport function validateNoteWithPubKey(note: DarkSwapNote, fuzkPubKey: [Fr, Fr]) {\n const addressMod = encodeAddress(note.address)\n const assetMod = encodeAddress(note.asset)\n const footer = getNoteFooter(note.rho, fuzkPubKey)\n const noteCommitment = mimc_bn254([DOMAIN_NOTE, addressMod, assetMod, note.amount, footer])\n return noteCommitment === note.note;\n}\n\nexport function validateOrderNoteWithPubKey(note: DarkSwapOrderNote, fuzkPubKey: [Fr, Fr]) {\n const footer = getNoteFooter(note.rho, fuzkPubKey)\n\n const assetMod = encodeAddress(note.asset)\n const addressMod = encodeAddress(note.address)\n const noteCommitment = mimc_bn254([\n DOMAIN_ORDER_NOTE,\n addressMod,\n assetMod,\n note.amount,\n note.feeRatio,\n footer,\n ])\n return noteCommitment === note.note;\n}","/**\n * Convert a little-endian buffer into a BigInt.\n * @param buf - The little-endian buffer to convert.\n * @returns A BigInt with the little-endian representation of buf.\n */\nexport function toBigIntLE(buf: Buffer): bigint {\n const reversed = Buffer.from(buf);\n reversed.reverse();\n const hex = reversed.toString('hex');\n if (hex.length === 0) {\n return BigInt(0);\n }\n return BigInt(`0x${hex}`);\n }\n \n /**\n * Convert a big-endian buffer into a BigInt.\n * @param buf - The big-endian buffer to convert.\n * @returns A BigInt with the big-endian representation of buf.\n */\n export function toBigIntBE(buf: Buffer): bigint {\n const hex = buf.toString('hex');\n if (hex.length === 0) {\n return BigInt(0);\n }\n return BigInt(`0x${hex}`);\n }\n \n /**\n * Convert a BigInt to a little-endian buffer.\n * @param num - The BigInt to convert.\n * @param width - The number of bytes that the resulting buffer should be.\n * @returns A little-endian buffer representation of num.\n */\n export function toBufferLE(num: bigint, width: number): Buffer {\n if (num < BigInt(0)) {\n throw new Error(`Cannot convert negative bigint ${num.toString()} to buffer with toBufferLE.`);\n }\n const hex = num.toString(16);\n const buffer = Buffer.from(hex.padStart(width * 2, '0').slice(0, width * 2), 'hex');\n buffer.reverse();\n return buffer;\n }\n \n /**\n * Convert a BigInt to a big-endian buffer.\n * @param num - The BigInt to convert.\n * @param width - The number of bytes that the resulting buffer should be.\n * @returns A big-endian buffer representation of num.\n */\n export function toBufferBE(num: bigint, width: number): Buffer {\n if (num < BigInt(0)) {\n throw new Error(`Cannot convert negative bigint ${num.toString()} to buffer with toBufferBE.`);\n }\n const hex = num.toString(16);\n const buffer = Buffer.from(hex.padStart(width * 2, '0').slice(0, width * 2), 'hex');\n if (buffer.length > width) {\n throw new Error(`Number ${num.toString(16)} does not fit in ${width}`);\n }\n return buffer;\n }\n \n /**\n * Converts a BigInt to its hex representation.\n * @param num - The BigInt to convert.\n * @param padTo32 - Whether to pad the resulting string to 32 bytes.\n * @returns An even-length 0x-prefixed string.\n */\n export function toHex(num: bigint, padTo32 = false): string {\n const str = num.toString(16);\n const targetLen = str.length % 2 === 0 ? str.length : str.length + 1;\n const paddedStr = str.padStart(padTo32 ? 64 : targetLen, '0');\n return `0x${paddedStr}`;\n }\n \n /**\n * Converts a hex string to a buffer. Throws if input is not a valid hex string.\n * @param value - The hex string to convert. May be 0x prefixed or not.\n * @returns A buffer.\n */\n export function fromHex(value: string): Buffer {\n const hexRegex = /^(0x)?[0-9a-fA-F]*$/;\n if (!hexRegex.test(value) || value.length % 2 !== 0) {\n throw new Error(`Invalid hex string: ${value}`);\n }\n return Buffer.from(value.replace(/^0x/i, ''), 'hex');\n }","\n/**\n * The BufferReader class provides a utility for reading various data types from a buffer.\n * It supports reading numbers, booleans, byte arrays, Fr and Fq field elements,\n * vectors, arrays, objects, strings, and maps. It maintains an internal index to\n * keep track of the current reading position in the buffer.\n *\n * Usage:\n * Create a new instance of BufferReader with a buffer and an optional offset.\n * Use the provided methods to read desired data types from the buffer.\n * The reading methods automatically advance the internal index.\n *\n * @example\n * const reader = new BufferReader(someBuffer);\n * const num = reader.readNumber();\n * const bool = reader.readBoolean();\n * const byteArray = reader.readBytes(4);\n */\nexport class BufferReader {\n private index: number;\n constructor(\n private buffer: Buffer,\n offset = 0,\n ) {\n this.index = offset;\n }\n\n /**\n * Creates a BufferReader instance from either a Buffer or an existing BufferReader.\n * If the input is a Buffer, it creates a new BufferReader with the given buffer.\n * If the input is already a BufferReader, it returns the input unchanged.\n *\n * @param bufferOrReader - A Buffer or BufferReader to initialize the BufferReader.\n * @returns An instance of BufferReader.\n */\n public static asReader(bufferOrReader: Uint8Array | Buffer | BufferReader): BufferReader {\n if (bufferOrReader instanceof BufferReader) {\n return bufferOrReader;\n }\n\n const buf = Buffer.isBuffer(bufferOrReader)\n ? bufferOrReader\n : Buffer.from(bufferOrReader.buffer, bufferOrReader.byteOffset, bufferOrReader.byteLength);\n\n return new BufferReader(buf);\n }\n\n /** Returns true if the underlying buffer has been consumed completely. */\n public isEmpty(): boolean {\n return this.index === this.buffer.length;\n }\n\n /**\n * Reads a 32-bit unsigned integer from the buffer at the current index position.\n * Updates the index position by 4 bytes after reading the number.\n *\n * @returns The read 32-bit unsigned integer value.\n */\n public readNumber(): number {\n this.rangeCheck(4);\n this.index += 4;\n return this.buffer.readUint32BE(this.index - 4);\n }\n\n\n /**\n * Reads a 256-bit unsigned integer from the buffer at the current index position.\n * Updates the index position by 32 bytes after reading the number.\n *\n * Assumes the number is stored in big-endian format.\n *\n * @returns The read 256 bit value as a bigint.\n */\n public readUInt64(): bigint {\n this.rangeCheck(8);\n\n const result = this.buffer.readBigUInt64BE(this.index);\n\n this.index += 8;\n return result;\n }\n\n /**\n * Reads a 128-bit unsigned integer from the buffer at the current index position.\n * Updates the index position by 16 bytes after reading the number.\n *\n * Assumes the number is stored in big-endian format.\n *\n * @returns The read 128 bit value as a bigint.\n */\n public readUInt128(): bigint {\n this.rangeCheck(16);\n\n let result = BigInt(0);\n for (let i = 0; i < 2; i++) {\n result = (result << BigInt(64)) | this.buffer.readBigUInt64BE(this.index + i * 8);\n }\n\n this.index += 16;\n return result;\n }\n\n /**\n * Reads a 256-bit unsigned integer from the buffer at the current index position.\n * Updates the index position by 32 bytes after reading the number.\n *\n * Assumes the number is stored in big-endian format.\n *\n * @returns The read 256 bit value as a bigint.\n */\n public readUInt256(): bigint {\n this.rangeCheck(32);\n\n let result = BigInt(0);\n for (let i = 0; i < 4; i++) {\n result = (result << BigInt(64)) | this.buffer.readBigUInt64BE(this.index + i * 8);\n }\n\n this.index += 32;\n return result;\n }\n\n /**\n * Reads a 16-bit unsigned integer from the buffer at the current index position.\n * Updates the index position by 2 bytes after reading the number.\n *\n * @returns The read 16 bit value.\n */\n public readUInt16(): number {\n this.rangeCheck(2);\n this.index += 2;\n return this.buffer.readUInt16BE(this.index - 2);\n }\n\n /**\n * Reads a 8-bit unsigned integer from the buffer at the current index position.\n * Updates the index position by 1 byte after reading the number.\n *\n * @returns The read 8 bit value.\n */\n public readUInt8(): number {\n this.rangeCheck(1);\n this.index += 1;\n return this.buffer.readUInt8(this.index - 1);\n }\n\n /**\n * Reads and returns the next boolean value from the buffer.\n * Advances the internal index by 1, treating the byte at the current index as a boolean value.\n * Returns true if the byte is non-zero, false otherwise.\n *\n * @returns A boolean value representing the byte at the current index.\n */\n public readBoolean(): boolean {\n this.rangeCheck(1);\n this.index += 1;\n return Boolean(this.buffer.at(this.index - 1));\n }\n\n /**\n * Reads a specified number of bytes from the buffer and returns a new Buffer containing those bytes.\n * Advances the reader's index by the number of bytes read. Throws an error if there are not enough\n * bytes left in the buffer to satisfy the requested number of bytes.\n *\n * @param n - The number of bytes to read from the buffer.\n * @returns A new Buffer containing the read bytes.\n */\n public readBytes(n: number): Buffer {\n this.rangeCheck(n);\n this.index += n;\n return Buffer.from(this.buffer.subarray(this.index - n, this.index));\n }\n\n /** Reads until the end of the buffer. */\n public readToEnd(): Buffer {\n const result = this.buffer.subarray(this.index);\n this.index = this.buffer.length;\n return result;\n }\n\n /**\n * Reads a vector of numbers from the buffer and returns it as an array of numbers.\n * The method utilizes the 'readVector' method, passing a deserializer that reads numbers.\n *\n * @returns An array of numbers representing the vector read from the buffer.\n */\n public readNumberVector(): number[] {\n return this.readVector({\n fromBuffer: (reader: BufferReader) => reader.readNumber(),\n });\n }\n\n /**\n * Reads a vector of 256-bit unsigned integers from the buffer and returns it as an array of bigints.\n * The method utilizes the 'readVector' method, passing a deserializer that reads bigints.\n *\n * @returns An array of bigints representing the vector read from the buffer.\n */\n public readUint256Vector(): bigint[] {\n return this.readVector({\n fromBuffer: (reader: BufferReader) => reader.readUInt256(),\n });\n }\n\n /**\n * Reads a vector of fixed size from the buffer and deserializes its elements using the provided itemDeserializer object.\n * The 'itemDeserializer' object should have a 'fromBuffer' method that takes a BufferReader instance and returns the deserialized element.\n * The method first reads the size of the vector (a number) from the buffer, then iterates through its elements,\n * deserializing each one using the 'fromBuffer' method of 'itemDeserializer'.\n *\n * @param itemDeserializer - Object with 'fromBuffer' method to deserialize vector elements.\n * @returns An array of deserialized elements of type T.\n */\n public readVector<T>(itemDeserializer: {\n /**\n * A method to deserialize data from a buffer.\n */\n fromBuffer: (reader: BufferReader) => T;\n }): T[] {\n const size = this.readNumber();\n const result = new Array<T>(size);\n for (let i = 0; i < size; i++) {\n result[i] = itemDeserializer.fromBuffer(this);\n }\n return result;\n }\n\n /**\n * Reads a vector of fixed size from the buffer and deserializes its elements using the provided itemDeserializer object.\n * The 'itemDeserializer' object should have a 'fromBuffer' method that takes a BufferReader instance and returns the deserialized element.\n * The method first reads the size of the vector (a number) from the buffer, then iterates through its elements,\n * deserializing each one using the 'fromBuffer' method of 'itemDeserializer'.\n *\n * @param itemDeserializer - Object with 'fromBuffer' method to deserialize vector elements.\n * @returns An array of deserialized elements of type T.\n */\n public readVectorUint8Prefix<T>(itemDeserializer: {\n /**\n * A method to deserialize data from a buffer.\n */\n fromBuffer: (reader: BufferReader) => T;\n }): T[] {\n const size = this.readUInt8();\n const result = new Array<T>(size);\n for (let i = 0; i < size; i++) {\n result[i] = itemDeserializer.fromBuffer(this);\n }\n return result;\n }\n\n /**\n * Read a variable sized Buffer array where elements are represented by length + data.\n * The method consecutively looks for a number which is the size of the proceeding buffer,\n * then reads the bytes until it reaches the end of the reader's internal buffer.\n * NOTE: if `size` is not provided, this will run to the end of the reader's buffer.\n * @param size - Size of the buffer array in bytes (full remaining buffer length if left empty).\n * @returns An array of variable sized buffers.\n */\n public readBufferArray(size = -1): Buffer[] {\n const result: Buffer[] = [];\n const end = size >= 0 ? this.index + size : this.buffer.length;\n this.rangeCheck(end - this.index);\n while (this.index < end) {\n const item = this.readBuffer();\n result.push(item);\n }\n // Ensure that all bytes have been read.\n if (this.index !== end) {\n throw new Error(\n `Reader buffer was not fully consumed. Consumed up to ${this.index} bytes. End of data: ${end} bytes.`,\n );\n }\n return result;\n }\n\n /**\n * Reads a serialized object from a buffer and returns the deserialized object using the given deserializer.\n *\n * @typeparam T - The type of the deserialized object.\n * @param deserializer - An object with a 'fromBuffer' method that takes a BufferReader instance and returns an instance of the deserialized object.\n * @returns The deserialized object of type T.\n */\n public readObject<T>(deserializer: {\n /**\n * A method that takes a BufferReader instance and returns an instance of the deserialized data type.\n */\n fromBuffer: (reader: BufferReader) => T;\n }): T {\n return deserializer.fromBuffer(this);\n }\n\n /**\n * Returns a Buffer containing the next n bytes from the current buffer without modifying the reader's index position.\n * If n is not provided or exceeds the remaining length of the buffer, it returns all bytes from the current position till the end of the buffer.\n *\n * @param n - The number of bytes to peek from the current buffer. (Optional).\n * @returns A Buffer with the next n bytes or the remaining bytes if n is not provided or exceeds the buffer length.\n */\n public peekBytes(n?: number): Buffer {\n this.rangeCheck(n || 0);\n return this.buffer.subarray(this.index, n ? this.index + n : undefined);\n }\n\n /**\n * Reads a string from the buffer and returns it.\n * The method first reads the size of the string, then reads the corresponding\n * number of bytes from the buffer and converts them to a string.\n *\n * @returns The read string from the buffer.\n */\n public readString(): string {\n return this.readBuffer().toString();\n }\n\n /**\n * Reads a buffer from the current position of the reader and advances the index.\n * The method first reads the size (number) of bytes to be read, and then returns\n * a Buffer with that size containing the bytes. Useful for reading variable-length\n * binary data encoded as (size, data) format.\n *\n * @returns A Buffer containing the read bytes.\n */\n public readBuffer(): Buffer {\n const size = this.readNumber();\n this.rangeCheck(size);\n return this.readBytes(size);\n }\n\n /**\n * Reads a buffer from the current position of the reader and advances the index.\n * The method first reads the size (number) of bytes to be read, and then returns\n * a Buffer with that size containing the bytes. Useful for reading variable-length\n * binary data encoded as (size, data) format.\n *\n * @returns A Buffer containing the read bytes.\n */\n public readUint8Array(): Uint8Array {\n const size = this.readNumber();\n this.rangeCheck(size);\n return this.readBytes(size);\n }\n\n /**\n * Reads and constructs a map object from the current buffer using the provided deserializer.\n * The method reads the number of entries in the map, followed by iterating through each key-value pair.\n * The key is read as a string, while the value is obtained using the passed deserializer's `fromBuffer` method.\n * The resulting map object is returned, containing all the key-value pairs read from the buffer.\n *\n * @param deserializer - An object with a `fromBuffer` method to deserialize the values in the map.\n * @returns A map object with string keys and deserialized values based on the provided deserializer.\n */\n public readMap<T>(deserializer: {\n /**\n * Deserializes an element of type T from a BufferReader instance.\n */\n fromBuffer: (reader: BufferReader) => T;\n }): { [key: string]: T } {\n const numEntries = this.readNumber();\n const map: { [key: string]: T } = {};\n for (let i = 0; i < numEntries; i++) {\n const key = this.readString();\n const value = this.readObject<T>(deserializer);\n map[key] = value;\n }\n return map;\n }\n\n /**\n * Get the length of the reader's buffer.\n * @returns The length of the underlying reader's buffer.\n */\n public getLength(): number {\n return this.buffer.length;\n }\n\n /**\n * Gets bytes remaining to be read from the buffer.\n * @returns Bytes remaining to be read from the buffer.\n */\n public remainingBytes(): number {\n return this.buffer.length - this.index;\n }\n\n private rangeCheck(numBytes: number) {\n if (this.index + numBytes > this.buffer.length) {\n throw new Error(\n `Attempted to read beyond buffer length. Start index: ${this.index}, Num bytes to read: ${numBytes}, Buffer length: ${this.buffer.length}`,\n );\n }\n }\n}\n\n/**\n * A deserializer\n */\nexport interface FromBuffer<T> {\n /**\n * Deserializes an object from a buffer\n * @param buffer - The buffer to deserialize.\n */\n fromBuffer(buffer: Buffer): T;\n}","import { toBigIntBE, toBufferBE } from '../bigint-buffer';\nimport { BufferReader } from '../serialize/buffer_reader';\n\nconst ZERO_BUFFER = Buffer.alloc(32);\n\n/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\n\n/**\n * Represents a field derived from BaseField.\n */\ntype DerivedField<T extends BaseField> = {\n new (value: any): T;\n /**\n * All derived fields will specify a MODULUS.\n */\n MODULUS: bigint;\n};\n\n/**\n * Base field class.\n * Conversions from Buffer to BigInt and vice-versa are not cheap.\n * We allow construction with either form and lazily convert to other as needed.\n * We only check we are within the field modulus when initializing with bigint.\n */\nabstract class BaseField {\n static SIZE_IN_BYTES = 32;\n private asBuffer?: Buffer;\n private asBigInt?: bigint;\n\n /**\n * Return bigint representation.\n * @deprecated Just to get things compiling. Use toBigInt().\n * */\n get value(): bigint {\n return this.toBigInt();\n }\n\n /** Returns the size in bytes. */\n get size(): number {\n return BaseField.SIZE_IN_BYTES;\n }\n\n protected constructor(value: number | bigint | boolean | BaseField | Buffer) {\n if (Buffer.isBuffer(value)) {\n if (value.length > BaseField.SIZE_IN_BYTES) {\n throw new Error(`Value length ${value.length} exceeds ${BaseField.SIZE_IN_BYTES}`);\n }\n this.asBuffer =\n value.length === BaseField.SIZE_IN_BYTES\n ? value\n : Buffer.concat([Buffer.alloc(BaseField.SIZE_IN_BYTES - value.length), value]);\n } else if (typeof value === 'bigint' || typeof value === 'number' || typeof value === 'boolean') {\n this.asBigInt = BigInt(value);\n if (this.asBigInt >= this.modulus()) {\n throw new Error(`Value 0x${this.asBigInt.toString(16)} is greater or equal to field modulus.`);\n }\n } else if (value instanceof BaseField) {\n this.asBuffer = value.asBuffer;\n this.asBigInt = value.asBigInt;\n } else {\n throw new Error(`Type '${typeof value}' with value '${value}' passed to BaseField ctor.`);\n }\n }\n\n protected abstract modulus(): bigint;\n\n /**\n * We return a copy of the Buffer to ensure this remains immutable.\n */\n toBuffer(): Buffer {\n if (!this.asBuffer) {\n this.asBuffer = toBufferBE(this.asBigInt!, 32);\n }\n return Buffer.from(this.asBuffer);\n }\n\n toString(): string {\n return `0x${this.toBuffer().toString('hex')}`;\n }\n\n toBigInt(): bigint {\n if (this.asBigInt === undefined) {\n this.asBigInt = toBigIntBE(this.asBuffer!);\n if (this.asBigInt >= this.modulus()) {\n throw new Error(`Value 0x${this.asBigInt.toString(16)} is greater or equal to field modulus.`);\n }\n }\n return this.asBigInt;\n }\n\n toBool(): boolean {\n return Boolean(this.toBigInt());\n }\n\n /**\n * Converts this field to a number.\n * Throws if the underlying value is greater than MAX_SAFE_INTEGER.\n */\n toNumber(): number {\n const value = this.toBigInt();\n if (value > Number.MAX_SAFE_INTEGER) {\n throw new Error(`Value ${value.toString(16)} greater than than max safe integer`);\n }\n return Number(value);\n }\n\n /**\n * Converts this field to a number.\n * May cause loss of precision if the underlying value is greater than MAX_SAFE_INTEGER.\n */\n toNumberUnsafe(): number {\n const value = this.toBigInt();\n return Number(value);\n }\n\n toShortString(): string {\n const str = this.toString();\n return `${str.slice(0, 10)}...${str.slice(-4)}`;\n }\n\n equals(rhs: BaseField): boolean {\n return this.toBuffer().equals(rhs.toBuffer());\n }\n\n lt(rhs: BaseField): boolean {\n return this.toBigInt() < rhs.toBigInt();\n }\n\n cmp(rhs: BaseField): -1 | 0 | 1 {\n const lhsBigInt = this.toBigInt();\n const rhsBigInt = rhs.toBigInt();\n return lhsBigInt === rhsBigInt ? 0 : lhsBigInt < rhsBigInt ? -1 : 1;\n }\n\n isZero(): boolean {\n return this.toBuffer().equals(ZERO_BUFFER);\n }\n\n isEmpty(): boolean {\n return this.isZero();\n }\n\n toFriendlyJSON(): string {\n return this.toString();\n }\n\n toField() {\n return this;\n }\n}\n\n/**\n * Constructs a field from a Buffer of BufferReader.\n * It maybe not read the full 32 bytes if the Buffer is shorter, but it will padded in BaseField constructor.\n */\nexport function fromBuffer<T extends BaseField>(buffer: Buffer | BufferReader, f: DerivedField<T>) {\n const reader = BufferReader.asReader(buffer);\n return new f(reader.readBytes(BaseField.SIZE_IN_BYTES));\n}\n\n/**\n * Constructs a field from a Buffer, but reduces it first, modulo the field modulus.\n * This requires a conversion to a bigint first so the initial underlying representation will be a bigint.\n */\nfunction fromBufferReduce<T extends BaseField>(buffer: Buffer, f: DerivedField<T>) {\n return new f(toBigIntBE(buffer) % f.MODULUS);\n}\n\n/**\n * Constructs a field from a 0x prefixed hex string.\n */\nfunction fromHexString<T extends BaseField>(buf: string, f: DerivedField<T>) {\n const withoutPrefix = buf.replace(/^0x/i, '');\n const checked = withoutPrefix.match(/^[0-9A-F]+$/i)?.[0];\n if (checked === undefined) {\n throw new Error(`Invalid hex-encoded string: \"${buf}\"`);\n }\n\n const buffer = Buffer.from(checked.length % 2 === 1 ? '0' + checked : checked, 'hex');\n\n return new f(buffer);\n}\n\n/** Branding to ensure fields are not interchangeable types. */\nexport interface Fr {\n /** Brand. */\n _branding: 'Fr';\n}\n\n/**\n * Fr field class.\n * @dev This class is used to represent elements of BN254 scalar field or elements in the base field of Grumpkin.\n * (Grumpkin's scalar field corresponds to BN254's base field and vice versa.)\n */\nexport class Fr extends BaseField {\n static ZERO = new Fr(0n);\n static ONE = new Fr(1n);\n static MODULUS = 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001n;\n static MAX_FIELD_VALUE = new Fr(Fr.MODULUS - 1n);\n\n constructor(value: number | bigint | boolean | Fr | Buffer) {\n super(value);\n }\n\n protected modulus() {\n return Fr.MODULUS;\n }\n\n static zero() {\n return Fr.ZERO;\n }\n\n static isZero(value: Fr) {\n return value.isZero();\n }\n\n static fromBuffer(buffer: Buffer | BufferReader) {\n return fromBuffer(buffer, Fr);\n }\n\n static fromBufferReduce(buffer: Buffer) {\n return fromBufferReduce(buffer, Fr);\n }\n\n /**\n * Creates a Fr instance from a string.\n * @param buf - the string to create a Fr from.\n * @returns the Fr instance\n * @remarks if the string only consists of numbers, we assume we are parsing a bigint,\n * otherwise we require the hex string to be prepended with \"0x\", to ensure there is no misunderstanding\n * as to what is being parsed.\n */\n static fromString(buf: string) {\n if (buf.match(/^\\d+$/) !== null) {\n return new Fr(toBufferBE(BigInt(buf), 32));\n }\n if (buf.match(/^0x/i) !== null) {\n return fromHexString(buf, Fr);\n }\n\n throw new Error(`Tried to create a Fr from an invalid string: ${buf}`);\n }\n\n /**\n * Creates a Fr instance from a hex string.\n * @param buf - a hex encoded string.\n * @returns the Fr instance\n */\n static fromHexString(buf: string) {\n return fromHexString(buf, Fr);\n }\n}\n\n\n/**\n * Branding to ensure fields are not interchangeable types.\n */\nexport interface Fq {\n /** Brand. */\n _branding: 'Fq';\n}\n\n/**\n * Fq field class.\n * @dev This class is used to represent elements of BN254 base field or elements in the scalar field of Grumpkin.\n * (Grumpkin's scalar field corresponds to BN254's base field and vice versa.)\n */\nexport class Fq extends BaseField {\n static ZERO = new Fq(0n);\n static MODULUS = 0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47n;\n private static HIGH_SHIFT = BigInt((BaseField.SIZE_IN_BYTES / 2) * 8);\n private static LOW_MASK = (1n << Fq.HIGH_SHIFT) - 1n;\n\n get lo(): Fr {\n return new Fr(this.toBigInt() & Fq.LOW_MASK);\n }\n\n get hi(): Fr {\n return new Fr(this.toBigInt() >> Fq.HIGH_SHIFT);\n }\n\n constructor(value: number | bigint | boolean | Fq | Buffer) {\n super(value);\n }\n\n protected modulus() {\n return Fq.MODULUS;\n }\n\n static zero() {\n return Fq.ZERO;\n }\n\n static fromBuffer(buffer: Buffer | BufferReader) {\n return fromBuffer(buffer, Fq);\n }\n\n static fromBufferReduce(buffer: Buffer) {\n return fromBufferReduce(buffer, Fq);\n }\n\n /**\n * Creates a Fq instance from a string.\n * @param buf - the string to create a Fq from.\n * @returns the Fq instance\n * @remarks if the string only consists of numbers, we assume we are parsing a bigint,\n * otherwise we require the hex string to be prepended with \"0x\", to ensure there is no misunderstanding\n * as to what is being parsed.\n */\n static fromString(buf: string) {\n if (buf.match(/^\\d+$/) !== null) {\n return new Fq(toBufferBE(BigInt(buf), 32));\n }\n if (buf.match(/^0x/i) !== null) {\n return fromHexString(buf, Fq);\n }\n\n throw new Error(`Tried to create a Fq from an invalid string: ${buf}`);\n }\n\n /**\n * Creates a Fq instance from a hex string.\n * @param buf - a hex encoded string.\n * @returns the Fq instance\n */\n static fromHexString(buf: string) {\n return fromHexString(buf, Fq);\n }\n\n static fromHighLow(high: Fr, low: Fr): Fq {\n return new Fq((high.toBigInt() << Fq.HIGH_SHIFT) + low.toBigInt());\n }\n\n add(rhs: Fq) {\n return new Fq((this.toBigInt() + rhs.toBigInt()) % Fq.MODULUS);\n }\n\n toJSON() {\n return this.toString();\n }\n\n toFields() {\n // The following has to match the order of the limbs in EmbeddedCurveScalar struct in noir::std. This is because\n // this function is used when returning Scalar from the getAddressSecret oracle and in Noir the values get deserialized\n // using the intrinsic serialization of Noir (which follows the order of the fields/members in the struct).\n return [this.lo, this.hi];\n }\n}\n\n/**\n * GrumpkinScalar is an Fq.\n * @remarks Called GrumpkinScalar because it is used to represent elements in Grumpkin's scalar field as defined in\n * the Aztec Protocol Specs.\n */\nexport type GrumpkinScalar = Fq;\nexport const GrumpkinScalar = Fq;\n\n/** Wraps a function that returns a buffer so that all results are reduced into a field of the given type. */\nexport function reduceFn<TInput, TField extends BaseField>(fn: (input: TInput) => Buffer, field: DerivedField<TField>) {\n return (input: TInput) => fromBufferReduce(fn(input), field);\n}","// TODO find a new home for this as we move to external bb.js\n// See https://github.com/AztecProtocol/aztec-packages/issues/782\nimport { Buffer } from 'buffer';\n\n/**\n * For serializing an array of fixed length buffers.\n * TODO move to foundation pkg.\n * @param arr - Array of bufffers.\n * @returns The serialized buffers.\n */\nexport function serializeBufferArrayToVector(arr: Buffer[]) {\n const lengthBuf = Buffer.alloc(4);\n lengthBuf.writeUInt32BE(arr.length, 0);\n return Buffer.concat([lengthBuf, ...arr]);\n}\n\n/**\n * Helper function for deserializeArrayFromVector.\n */\ntype DeserializeFn<T> = (\n buf: Buffer,\n offset: number,\n) => {\n /**\n * The deserialized type.\n */\n elem: T;\n /**\n * How many bytes to advance by.\n */\n adv: number;\n};\n\n/**\n * For deserializing numbers to 32-bit little-endian form.\n * TODO move to foundation pkg.\n * @param n - The number.\n * @returns The endian-corrected number.\n */\nexport function deserializeArrayFromVector<T>(deserialize: DeserializeFn<T>, vector: Buffer, offset = 0) {\n let pos = offset;\n const size = vector.readUInt32BE(pos);\n pos += 4;\n const arr = new Array<T>(size);\n for (let i = 0; i < size; ++i) {\n const { elem, adv } = deserialize(vector, pos);\n pos += adv;\n arr[i] = elem;\n }\n return { elem: arr, adv: pos - offset };\n}\n\n/**\n * For serializing numbers to 32 bit little-endian form.\n * TODO move to foundation pkg.\n * @param n - The number.\n * @returns The endian-corrected number.\n */\nexport function numToUInt32LE(n: number, bufferSize = 4) {\n const buf = Buffer.alloc(bufferSize);\n buf.writeUInt32LE(n, bufferSize - 4);\n return buf;\n}\n\n/**\n * Deserialize the 256-bit number at address `offset`.\n * @param buf - The buffer.\n * @param offset - The address.\n * @returns The derserialized 256-bit field.\n */\nexport function deserializeField(buf: Buffer, offset = 0) {\n const adv = 32;\n return { elem: buf.slice(offset, offset + adv), adv };\n}\n\nexport function concatenateUint8Arrays(arrayOfUint8Arrays: Uint8Array[]) {\n const totalLength = arrayOfUint8Arrays.reduce((prev, curr) => prev + curr.length, 0);\n const result = new Uint8Array(totalLength);\n let length = 0;\n for (const array of arrayOfUint8Arrays) {\n result.set(array, length);\n length += array.length;\n }\n return result;\n}","\n/**\n * Annoying, mapping a tuple does not preserve length.\n * This is a helper to preserve length during a map operation.\n * @typeparam T - The original array type.\n */\ntype MapTuple<T extends any[], F extends (item: any) => any> = {\n [K in keyof T]: T[K] extends infer U ? (F extends (item: U) => infer V ? V : never) : never;\n};\n\n/**\n * Annoyingly, mapping a tuple does not preserve length.\n * This is a helper to preserve length during a map operation.\n * @see https://github.com/microsoft/TypeScript/issues/29841.\n * @param array - A tuple array.\n */\nexport function mapTuple<T extends any[], F extends (item: T[number]) => any>(tuple: T, fn: F): MapTuple<T, F> {\n return tuple.map(fn) as MapTuple<T, F>;\n}","import type { Signature } from '../signature';\nimport { Fr } from '../../fields/fields';\nimport { BufferReader } from '../../serialize/buffer_reader';\nimport { mapTuple } from '../../serialize/types';\n\n/**\n * Schnorr signature used for transactions.\n * @see cpp/barretenberg/cpp/src/barretenberg/crypto/schnorr/schnorr.hpp\n */\nexport class SchnorrSignature implements Signature {\n /**\n * The size of the signature in bytes.\n */\n public static SIZE = 64;\n\n /**\n * An empty signature.\n */\n public static EMPTY = new SchnorrSignature(Buffer.alloc(64));\n\n constructor(private buffer: Buffer) {\n if (buffer.length !== SchnorrSignature.SIZE) {\n throw new Error(`Invalid signature buffer of length ${buffer.length}.`);\n }\n }\n\n /**\n * Determines if the provided signature is valid or not.\n * @param signature - The data to be checked.\n * @returns Boolean indicating if the provided data is a valid schnorr signature.\n */\n public static isSignature(signature: string) {\n return /^(0x)?[0-9a-f]{128}$/i.test(signature);\n }\n\n /**\n * Constructs a SchnorrSignature from the provided string.\n * @param signature - The string to be converted to a schnorr signature.\n * @returns The constructed schnorr signature.\n */\n public static fromString(signature: string) {\n if (!SchnorrSignature.isSignature(signature)) {\n throw new Error(`Invalid signature string: ${signature}`);\n }\n return new SchnorrSignature(Buffer.from(signature.replace(/^0x/i, ''), 'hex'));\n }\n\n /**\n * Returns the 's' component of the signature.\n * @returns A buffer containing the signature's 's' component.\n */\n get s() {\n return this.buffer.subarray(0, 32);\n }\n\n /**\n * Returns the 'e' component of the signature.\n * @returns A buffer containing the signature's 'e' component.\n */\n get e() {\n return this.buffer.subarray(32);\n }\n\n /**\n * Returns the full signature as a buffer.\n * @returns A buffer containing the signature.\n */\n toBuffer() {\n return this.buffer;\n }\n\n /**\n * Deserializes from a buffer.\n * @param buffer - The buffer representation of the object.\n * @returns The new object.\n */\n static fromBuffer(buffer: Buffer | BufferReader): SchnorrSignature {\n const reader = BufferReader.asReader(buffer);\n return new SchnorrSignature(reader.readBytes(SchnorrSignature.SIZE));\n }\n\n /**\n * Returns the full signature as a hex string.\n * @returns A string containing the signature in hex format.\n */\n toString() {\n return `0x${this.buffer.toString('hex')}`;\n }\n\n /**\n * Converts the signature to an array of three fields.\n * @returns The signature components as an array of three fields\n */\n toFields(): Fr[] {\n const sig = this.toBuffer();\n\n const buf1 = Buffer.alloc(32);\n const buf2 = Buffer.alloc(32);\n const buf3 = Buffer.alloc(32);\n\n sig.copy(buf1, 1, 0, 31);\n sig.copy(buf2, 1, 31, 62);\n sig.copy(buf3, 1, 62, 64);\n\n return mapTuple([buf1, buf2, buf3], Fr.fromBuffer);\n }\n}","import { toBufferBE } from '../bigint-buffer';\nimport { Fr } from '../fields/fields';\n\n/**\n * Convert a boolean value to its corresponding byte representation in a Buffer of size 1.\n * The function takes a boolean value and writes it into a new buffer as either 1 (true) or 0 (false).\n * This method is useful for converting a boolean value into a binary format that can be stored or transmitted easily.\n *\n * @param b - The boolean value to be converted.\n * @returns A Buffer containing the byte representation of the input boolean value.\n */\nexport function boolToByte(b: boolean) {\n const buf = Buffer.alloc(1);\n buf.writeUInt8(b ? 1 : 0);\n return buf;\n}\n\n/**\n * @param n - The input number to be converted to a big-endian unsigned 16-bit integer Buffer.\n * @param bufferSize - Optional, the size of the output Buffer (default is 2).\n * @returns A Buffer containing the big-endian unsigned 16-bit integer representation of the input number.\n */\nexport function numToUInt16BE(n: number, bufferSize = 2) {\n const buf = Buffer.alloc(bufferSize);\n buf.writeUInt16BE(n, bufferSize - 2);\n return buf;\n}\n\n/**\n * Convert a number into a 4-byte little-endian unsigned integer buffer.\n * The input number is serialized as an unsigned 32-bit integer in little-endian byte order,\n * and returned as a Buffer of specified size (defaults to 4).\n * If the provided bufferSize is greater than 4, the additional bytes will be padded with zeros.\n *\n * @param n - The number to be converted into a little-endian unsigned integer buffer.\n * @param bufferSize - Optional, the size of the output buffer (default value is 4).\n * @returns A Buffer containing the serialized little-endian unsigned integer representation of the input number.\n */\nexport function numToUInt32LE(n: number, bufferSize = 4) {\n const buf = Buffer.alloc(bufferSize);\n buf.writeUInt32LE(n, bufferSize - 4);\n return buf;\n}\n\n/**\n * Convert a number to a big-endian unsigned 32-bit integer Buffer.\n * This function takes a number and an optional buffer size as input and creates a Buffer with the specified size (defaults to 4) containing the big-endian representation of the input number as an unsigned 32-bit integer. Note that the bufferSize should be greater than or equal to 4, otherwise the output Buffer might truncate the serialized value.\n *\n * @param n - The input number to be converted to a big-endian unsigned 32-bit integer Buffer.\n * @param bufferSize - Optional, the size of the output Buffer (default is 4).\n * @returns A Buffer containing the big-endian unsigned 32-bit integer representation of the input number.\n */\nexport function numToUInt32BE(n: number, bufferSize = 4) {\n const buf = Buffer.alloc(bufferSize);\n buf.writeUInt32BE(n, bufferSize - 4);\n return buf;\n}\n\n/**\n * Convert a bigint to a big-endian unsigned 64-bit integer Buffer.\n *\n * @param n - The bigint to be converted to a big-endian unsigned 64-bit integer Buffer.\n * @param bufferSize - Optional, the size of the output Buffer (default is 8).\n * @returns A Buffer containing the big-endian unsigned 64-bit integer representation of the input number.\n */\nexport function bigintToUInt64BE(n: bigint, bufferSize = 8) {\n const buf = Buffer.alloc(bufferSize);\n buf.writeBigUInt64BE(n, bufferSize - 8);\n return buf;\n}\n\n/**\n * Convert a bigint to a big-endian unsigned 128-bit integer Buffer.\n *\n * @param n - The bigint to be converted to a big-endian unsigned 128-bit integer Buffer.\n * @param bufferSize - Optional, the size of the output Buffer (default is 16).\n * @returns A Buffer containing the big-endian unsigned 128-bit integer representation of the input number.\n */\nexport function bigintToUInt128BE(n: bigint, bufferSize = 16) {\n return toBufferBE(n, bufferSize);\n}\n\n/**\n * Serialize a number into a big-endian signed 32-bit integer Buffer with the specified buffer size.\n * This function converts the input number into its binary representation and stores it in a Buffer\n * with the provided buffer size. By default, the buffer size is set to 4 bytes which represents a 32-bit integer.\n * The function will use the last 4 bytes of the buffer to store the serialized number. If the input number\n * is outside the range of a 32-bit signed integer, the resulting serialization may be incorrect due to truncation.\n *\n * @param n - The number to be serialized as a signed 32-bit integer.\n * @param bufferSize - Optional, the size of the output Buffer (default is 4 bytes).\n * @returns A Buffer containing the serialized big-endian signed 32-bit integer.\n */\nexport function numToInt32BE(n: number, bufferSize = 4) {\n const buf = Buffer.alloc(bufferSize);\n buf.writeInt32BE(n, bufferSize - 4);\n return buf;\n}\n\n/**\n * Convert a number to an 8-bit unsigned integer and return it as a Buffer of length 1.\n * The input number is written as an 8-bit unsigned integer into the buffer. This function\n * is useful for converting small numeric values to a standardized binary format that can be\n * easily stored or transmitted.\n *\n * @param n - The number to be converted to an 8-bit unsigned integer.\n * @returns A Buffer containing the 8-bit unsigned integer representation of the input number.\n */\nexport function numToUInt8(n: number) {\n const bufferSize = 1;\n const buf = Buffer.alloc(bufferSize);\n buf.writeUInt8(n, 0);\n return buf;\n}\n\n/**\n * Adds a 4-byte byte-length prefix to a buffer.\n * @param buf - The input Buffer to be prefixed\n * @returns A Buffer with 4-byte byte-length prefix.\n */\nexport function prefixBufferWithLength(buf: Buffer) {\n const lengthBuf = Buffer.alloc(4);\n lengthBuf.writeUInt32BE(buf.length, 0);\n return Buffer.concat([lengthBuf, buf]);\n}\n\n/**\n * Parse a buffer as a big integer.\n */\nexport function toBigInt(buf: Buffer): bigint {\n const hex = buf.toString('hex');\n if (hex.length === 0) {\n return BigInt(0);\n }\n return BigInt(`0x${hex}`);\n}\n\n/**\n * Stores full 256 bits of information in 2 fields.\n * @param buf - 32 bytes of data\n * @returns 2 field elements\n */\nexport function to2Fields(buf: Buffer): [Fr, Fr] {\n if (buf.length !== 32) {\n throw new Error('Buffer must be 32 bytes');\n }\n\n // Split the hash into two fields, a high and a low\n const buf1 = Buffer.concat([Buffer.alloc(16), buf.subarray(0, 16)]);\n const buf2 = Buffer.concat([Buffer.alloc(16), buf.subarray(16, 32)]);\n\n return [Fr.fromBuffer(buf1), Fr.fromBuffer(buf2)];\n}\n\n/**\n * Reconstructs the original 32 bytes of data from 2 field elements.\n * @param field1 - First field element\n * @param field2 - Second field element\n * @returns 32 bytes of data as a Buffer\n */\nexport function from2Fields(field1: Fr, field2: Fr): Buffer {\n // Convert the field elements back to buffers\n const buf1 = field1.toBuffer();\n const buf2 = field2.toBuffer();\n\n // Remove the padding (first 16 bytes) from each buffer\n const originalPart1 = buf1.subarray(Fr.SIZE_IN_BYTES / 2, Fr.SIZE_IN_BYTES);\n const originalPart2 = buf2.subarray(Fr.SIZE_IN_BYTES / 2, Fr.SIZE_IN_BYTES);\n\n // Concatenate the two parts to form the original buffer\n return Buffer.concat([originalPart1, originalPart2]);\n}\n\n/**\n * Truncates SHA hashes to match Noir's truncated version\n * @param buf - 32 bytes of data\n * @returns 31 bytes of data padded to 32\n */\nexport function truncateAndPad(buf: Buffer): Buffer {\n // Note that we always truncate here, to match solidity's sha256ToField()\n if (buf.length !== 32) {\n throw new Error('Buffer to truncate must be 32 bytes');\n }\n return Buffer.concat([Buffer.alloc(1), buf.subarray(0, 31)]);\n}\n\nexport function toHumanReadable(buf: Buffer, maxLen?: number): string {\n const result = buf.every(byte => byte >= 32 && byte <= 126) ? buf.toString('ascii') : `0x${buf.toString('hex')}`;\n if (maxLen && result.length > maxLen) {\n return result.slice(0, maxLen) + '...';\n }\n return result;\n}","import { toBigIntBE, toBufferBE } from '../bigint-buffer';\nimport { Fr } from '../fields/fields';\nimport { numToUInt32BE } from './free_funcs';\n\n/**\n * For serializing an array of fixed length buffers.\n * @param arr - Array of bufferable.\n * @param prefixLength - The length of the prefix (denominated in bytes).\n * @returns The serialized buffers.\n */\nexport function serializeArrayOfBufferableToVector(objs: Bufferable[], prefixLength = 4): Buffer {\n const arr = serializeToBufferArray(objs);\n let lengthBuf: Buffer;\n if (prefixLength === 1) {\n lengthBuf = Buffer.alloc(1);\n lengthBuf.writeUInt8(arr.length, 0);\n } else if (prefixLength === 4) {\n lengthBuf = Buffer.alloc(4);\n lengthBuf.writeUInt32BE(arr.length, 0);\n } else {\n throw new Error(`Unsupported prefix length. Got ${prefixLength}, expected 1 or 4`);\n }\n return Buffer.concat([lengthBuf, ...arr]);\n}\n\n/**\n * Helper function for deserializeArrayFromVector.\n */\ntype DeserializeFn<T> = (\n buf: Buffer,\n offset: number,\n) => {\n /**\n * The deserialized type.\n */\n elem: T;\n /**\n * How many bytes to advance by.\n */\n adv: number;\n};\n\n/**\n * Deserializes an array from a vector on an element-by-element basis.\n * @param deserialize - A function used to deserialize each element of the vector.\n * @param vector - The vector to deserialize.\n * @param offset - The position in the vector to start deserializing from.\n * @returns Deserialized array and how many bytes we advanced by.\n */\nexport function deserializeArrayFromVector<T>(\n deserialize: DeserializeFn<T>,\n vector: Buffer,\n offset = 0,\n): {\n /**\n * The deserialized array.\n */\n elem: T[];\n /**\n * How many bytes we advanced by.\n */\n adv: number;\n} {\n let pos = offset;\n const size = vector.readUInt32BE(pos);\n pos += 4;\n const arr = new Array<T>(size);\n for (let i = 0; i < size; ++i) {\n const { elem, adv } = deserialize(vector, pos);\n pos += adv;\n arr[i] = elem;\n }\n return { elem: arr, adv: pos - offset };\n}\n\n/**\n * Cast a uint8 array to a number.\n * @param array - The uint8 array.\n * @returns The number.\n */\nexport function uint8ArrayToNum(array: Uint8Array): number {\n const buf = Buffer.from(array);\n return buf.readUint32LE();\n}\n\n/**\n * Serializes a boolean to a buffer.\n * @param value - Value to serialize.\n * @returns The serialized boolean.\n */\nexport function boolToBuffer(value: boolean, bufferSize = 1): Buffer {\n const buf = Buffer.alloc(bufferSize);\n buf.writeUInt8(value ? 1 : 0, bufferSize - 1);\n return buf;\n}\n\n/**\n * Deserialize the 256-bit number at address `offset`.\n * @param buf - The buffer.\n * @param offset - The address.\n * @returns The deserialized 256-bit field.\n */\nexport function deserializeField(buf: Buffer, offset = 0) {\n const adv = 32;\n return { elem: buf.slice(offset, offset + adv), adv };\n}\n\n/** A type that can be written to a buffer. */\nexport type Bufferable =\n | boolean\n | Buffer\n | Uint8Array\n | number\n | bigint\n | string\n | {\n /**\n * Serialize to a buffer.\n */\n toBuffer: () => Buffer;\n }\n | Bufferable[];\n\n/** A type that can be converted to a Field or a Field array. */\nexport type Fieldable =\n | Fr\n | boolean\n | number\n | bigint\n | Buffer\n | {\n /**\n * Serialize to a field.\n * @dev Duplicate to `toField` but left as is as it is used in AVM codebase.\n */\n toFr: () => Fr;\n }\n | {\n /** Serialize to a field. */\n toField: () => Fr;\n }\n | {\n /** Serialize to an array of fields. */\n toFields: () => Fr[];\n }\n | Fieldable[];\n\n/**\n * Serializes a list of objects contiguously.\n * @param objs - Objects to serialize.\n * @returns A buffer list with the concatenation of all fields.\n */\nexport function serializeToBufferArray(...objs: Bufferable[]): Buffer[] {\n const ret: Buffer[] = [];\n for (const obj of objs) {\n if (Array.isArray(obj)) {\n ret.push(...serializeToBufferArray(...obj));\n } else if (Buffer.isBuffer(obj)) {\n ret.push(obj);\n } else if (typeof obj === 'boolean') {\n ret.push(boolToBuffer(obj));\n } else if (typeof obj === 'bigint') {\n // Throw if bigint does not fit into 32 bytes\n if (obj > BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')) {\n throw new Error(`BigInt ${obj} does not fit into 32 bytes`);\n }\n ret.push(serializeBigInt(obj));\n } else if (typeof obj === 'number') {\n // Note: barretenberg assumes everything is big-endian\n ret.push(numToUInt32BE(obj)); // TODO: Are we always passing numbers as UInt32?\n } else if (typeof obj === 'string') {\n ret.push(numToUInt32BE(obj.length));\n ret.push(Buffer.from(obj));\n } else if ('toBuffer' in obj) {\n ret.push(obj.toBuffer());\n } else {\n throw new Error(`Cannot serialize input to buffer: ${typeof obj} ${(obj as any).constructor?.name}`);\n }\n }\n return ret;\n}\n\n/**\n * Serializes a list of objects contiguously.\n * @param objs - Objects to serialize.\n * @returns An array of fields with the concatenation of all fields.\n */\nexport function serializeToFields(...objs: Fieldable[]): Fr[] {\n const ret: Fr[] = [];\n for (const obj of objs) {\n if (Array.isArray(obj)) {\n ret.push(...serializeToFields(...obj));\n } else if (obj instanceof Fr) {\n ret.push(obj);\n } else if (typeof obj === 'boolean' || typeof obj === 'number' || typeof obj === 'bigint') {\n ret.push(new Fr(obj));\n } else if ('toFields' in obj) {\n ret.push(...obj.toFields());\n } else if ('toFr' in obj) {\n ret.push(obj.toFr());\n } else if ('toField' in obj) {\n ret.push(obj.toField());\n } else if (Buffer.isBuffer(obj)) {\n ret.push(Fr.fromBuffer(obj));\n } else {\n throw new Error(`Cannot serialize input to field: ${typeof obj} ${(obj as any).constructor?.name}`);\n }\n }\n return ret;\n}\n\n/**\n * Serializes a list of objects contiguously.\n * @param objs - Objects to serialize.\n * @returns A single buffer with the concatenation of all fields.\n */\nexport function serializeToBuffer(...objs: Bufferable[]): Buffer {\n return Buffer.concat(serializeToBufferArray(...objs));\n}\n\n/**\n * Returns a user-friendly JSON representation of an object, showing buffers as hex strings.\n * @param obj - Object to json-stringify.\n * @returns A JSON string.\n */\nexport function toFriendlyJSON(obj: object): string {\n return JSON.stringify(\n obj,\n (_key, value) => {\n if (value !== null && typeof value === 'object' && value.type === 'Buffer' && Array.isArray(value.data)) {\n return '0x' + Buffer.from(value.data).toString('hex');\n } else if (typeof value === 'bigint') {\n return value.toString();\n } else if (\n value &&\n (\n value as {\n /**\n * Signature of the target serialization function.\n */\n toFriendlyJSON: () => string;\n }\n ).toFriendlyJSON\n ) {\n return value.toFriendlyJSON();\n } else if (value && value.type && ['Fr', 'Fq', 'AztecAddress', 'EthAddress'].includes(value.type)) {\n return value.value;\n } else {\n return value;\n }\n },\n 2,\n );\n}\n\n/**\n * Serialize a BigInt value into a Buffer of specified width.\n * The function converts the input BigInt into its big-endian representation and stores it in a Buffer of the given width.\n * If the width is not provided, a default value of 32 bytes will be used. It is important to provide an appropriate width\n * to avoid truncation or incorrect serialization of large BigInt values.\n *\n * @param n - The BigInt value to be serialized.\n * @param width - The width (in bytes) of the output Buffer, optional with default value 32.\n * @returns A Buffer containing the serialized BigInt value in big-endian format.\n */\nexport function serializeBigInt(n: bigint, width = 32) {\n return toBufferBE(n, width);\n}\n\n/**\n * Deserialize a big integer from a buffer, given an offset and width.\n * Reads the specified number of bytes from the buffer starting at the offset, converts it to a big integer, and returns the deserialized result along with the number of bytes read (advanced).\n *\n * @param buf - The buffer containing the big integer to be deserialized.\n * @param offset - The position in the buffer where the big integer starts. Defaults to 0.\n * @param width - The number of bytes to read from the buffer for the big integer. Defaults to 32.\n * @returns An object containing the deserialized big integer value ('elem') and the number of bytes advanced ('adv').\n */\nexport function deserializeBigInt(buf: Buffer, offset = 0, width = 32) {\n return { elem: toBigIntBE(buf.subarray(offset, offset + width)), adv: width };\n}\n\n/**\n * Serializes a Date object into a Buffer containing its timestamp as a big integer value.\n * The resulting Buffer has a fixed width of 8 bytes, representing a 64-bit big-endian integer.\n * This function is useful for converting date values into a binary format that can be stored or transmitted easily.\n *\n * @param date - The Date object to be serialized.\n * @returns A Buffer containing the serialized timestamp of the input Date object.\n */\nexport function serializeDate(date: Date) {\n return serializeBigInt(BigInt(date.getTime()), 8);\n}\n\n/**\n * Deserialize a boolean value from a given buffer at the specified offset.\n * Reads a single byte at the provided offset in the buffer and returns\n * the deserialized boolean value along with the number of bytes read (adv).\n *\n * @param buf - The buffer containing the serialized boolean value.\n * @param offset - The position in the buffer to start reading the boolean value.\n * @returns An object containing the deserialized boolean value (elem) and the number of bytes read (adv).\n */\nexport function deserializeBool(buf: Buffer, offset = 0) {\n const adv = 1;\n return { elem: buf.readUInt8(offset), adv };\n}\n\n/**\n * Deserialize a 4-byte unsigned integer from a buffer, starting at the specified offset.\n * The deserialization reads 4 bytes from the given buffer and converts it into a number.\n * Returns an object containing the deserialized unsigned integer and the number of bytes advanced (4).\n *\n * @param buf - The buffer containing the serialized unsigned integer.\n * @param offset - The starting position in the buffer to deserialize from (default is 0).\n * @returns An object with the deserialized unsigned integer as 'elem' and the number of bytes advanced ('adv') as 4.\n */\nexport function deserializeUInt32(buf: Buffer, offset = 0) {\n const adv = 4;\n return { elem: buf.readUInt32BE(offset), adv };\n}\n\n/**\n * Deserialize a signed 32-bit integer from a buffer at the given offset.\n * The input 'buf' should be a Buffer containing binary data, and 'offset' should be the position in the buffer\n * where the signed 32-bit integer starts. Returns an object with both the deserialized integer (elem) and the\n * number of bytes advanced in the buffer (adv, always equal to 4).\n *\n * @param buf - The buffer containing the binary data.\n * @param offset - Optional, the position in the buffer where the signed 32-bit integer starts (default is 0).\n * @returns An object with the deserialized integer as 'elem' and the number of bytes advanced as 'adv'.\n */\nexport function deserializeInt32(buf: Buffer, offset = 0) {\n const adv = 4;\n return { elem: buf.readInt32BE(offset), adv };\n}","import { BarretenbergSync, Fr as FrBarretenberg } from '@aztec/bb.js';\n\nimport { Fr } from '../../fields/fields';\nimport { Fieldable, serializeToFields } from '../../serialize/serialize';\n\n/**\n * Create a poseidon hash (field) from an array of input fields.\n * @param input - The input fields to hash.\n * @returns The poseidon hash.\n */\nexport async function poseidon2Hash(input: Fieldable[]): Promise<Fr> {\n const inputFields = serializeToFields(input);\n const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);\n const hash = api.poseidon2Hash(\n inputFields.map(i => new FrBarretenberg(i.toBuffer())), // TODO(#4189): remove this stupid conversion\n );\n return Fr.fromBuffer(Buffer.from(hash.toBuffer()));\n}","import { Fq, Fr } from '../fields/fields';\n\n/**\n * The FieldReader class provides a utility for reading various data types from a field array.\n *\n * Usage:\n * Create a new instance of FieldReader with an array of fields and an optional offset.\n * Use the provided methods to read desired data types from the field array.\n * The reading methods automatically advance the internal index.\n */\nexport class FieldReader {\n private index: number;\n private readonly length: number;\n\n constructor(\n private fields: Fr[],\n offset = 0,\n ) {\n this.index = offset;\n this.length = fields.length;\n if (offset > this.length) {\n throw new Error('Offset out of bounds.');\n }\n }\n\n /**\n * Creates a FieldReader instance from either a field array or an existing FieldReader.\n *\n * @param fields - A field array or FieldReader to initialize the FieldReader.\n * @returns An instance of FieldReader.\n */\n public static asReader(fields: Fr[] | FieldReader): FieldReader {\n if (fields instanceof FieldReader) {\n return fields;\n }\n\n return new FieldReader(fields);\n }\n\n /**\n * Returns the current cursor position.\n *\n * @returns The current cursor position.\n */\n public get cursor() {\n return this.index;\n }\n\n public remainingFields(): number {\n return this.length - this.index;\n }\n\n /**\n * Skips the next n fields.\n *\n * @param n - The number of fields to skip.\n */\n public skip(n: number) {\n if (this.index + n > this.length) {\n throw new Error('Not enough fields to be consumed.');\n }\n this.index += n;\n }\n\n /**\n * Reads a single field from the array.\n *\n * @returns A field.\n */\n public readField(): Fr {\n if (this.index === this.length) {\n throw new Error('Not enough fields to be consumed.');\n }\n return this.fields[this.index++];\n }\n\n /**\n * Peeks at the next field without advancing the cursor.\n *\n * @returns A field.\n */\n public peekField(): Fr {\n if (this.index === this.length) {\n throw new Error('Not enough fields to be consumed.');\n }\n return this.fields[this.index];\n }\n\n /**\n * Reads a Fq from the array.\n *\n * @returns An Fq.\n */\n public readFq(): Fq {\n return Fq.fromHighLow(this.readField(), this.readField());\n }\n\n /**\n * Reads and returns the next boolean value from the field array.\n * Advances the internal index by 1, treating the field at the current index as a boolean value.\n * Returns true if the field is non-zero, false otherwise.\n * Throw if the value is not 0 or 1.\n *\n * @returns A boolean value representing the field at the current index.\n */\n public readBoolean(): boolean {\n const field = this.readField();\n const value = field.toBigInt();\n if (value > 1n) {\n throw new Error('Field is not a boolean.');\n }\n return value == 1n;\n }\n\n /**\n * Reads a 32-bit unsigned integer from the field array at the current index position.\n * Updates the index position by 1 after reading the number.\n * Throw if the value is greater than 2 ** 32.\n *\n * @returns The read 32-bit unsigned integer value.\n */\n public readU32(): number {\n const field = this.readField();\n const value = field.toBigInt();\n if (value >= 1n << 32n) {\n throw new Error('Field is not a u32.');\n }\n return Number(value);\n }\n\n /**\n * Reads a serialized object from a field array and returns the deserialized object using the given deserializer.\n *\n * @typeparam T - The type of the deserialized object.\n * @param deserializer - An object with a 'fromFields' method that takes a FieldReader instance and returns an instance of the deserialized object.\n * @returns The deserialized object of type T.\n */\n public readObject<T>(deserializer: {\n /**\n * A method that takes a FieldReader instance and returns an instance of the deserialized data type.\n */\n fromFields: (reader: FieldReader) => T;\n }): T {\n return deserializer.fromFields(this);\n }\n\n /**\n * Returns whether the reader has finished reading all fields.\n * @returns A bool.\n */\n public isFinished(): boolean {\n return this.index >= this.length;\n }\n}","export function hasHexPrefix(str: string): boolean {\n return str.startsWith('0x');\n}\n\nexport function withoutHexPrefix(str: string): string {\n return hasHexPrefix(str) ? str.slice(2) : str;\n}\n\nexport function isHex(str: string): boolean {\n return /^(0x)?[0-9a-fA-F]*$/.test(str);\n}\n\nexport function hexToBuffer(str: string): Buffer {\n return Buffer.from(withoutHexPrefix(str), 'hex');\n}\n\nexport function bufferToHex(buffer: Buffer): string {\n return `0x${buffer.toString('hex')}`;\n}\n\nexport function pluralize(str: string, count: number | bigint, plural?: string): string {\n return count === 1 || count === 1n ? str : (plural ?? `${str}s`);\n}\n\nexport function count(count: number | bigint, str: string, plural?: string): string {\n return `${count} ${pluralize(str, count, plural)}`;\n}\n\nexport function truncate(str: string, length: number = 64): string {\n return str.length > length ? str.slice(0, length) + '...' : str;\n}\n\nexport function isoDate(date?: Date) {\n return (date ?? new Date()).toISOString().replace(/[-:T]/g, '').replace(/\\..+$/, '');\n}\n\nexport function urlJoin(...args: string[]): string {\n return args.map(arg => arg.replace(/\\/+$/, '').replace(/^\\/+/, '')).join('/');\n}","import { poseidon2Hash } from '../crypto/poseidon';\nimport { BufferReader } from '../serialize/buffer_reader';\nimport { FieldReader } from '../serialize/field_reader';\nimport { serializeToBuffer } from '../serialize/serialize';\nimport { bufferToHex, hexToBuffer } from '../string';\nimport { Fr } from './fields';\n\n/**\n * Represents a Point on an elliptic curve with x and y coordinates.\n * The Point class provides methods for creating instances from different input types,\n * converting instances to various output formats, and checking the equality of points.\n * TODO(#7386): Clean up this class.\n */\nexport class Point {\n static ZERO = new Point(Fr.ZERO, Fr.ZERO, false);\n static SIZE_IN_BYTES = Fr.SIZE_IN_BYTES * 2;\n static COMPRESSED_SIZE_IN_BYTES = Fr.SIZE_IN_BYTES;\n\n /** Used to differentiate this class from AztecAddress */\n public readonly kind = 'point';\n\n constructor(\n /**\n * The point's x coordinate\n */\n public readonly x: Fr,\n /**\n * The point's y coordinate\n */\n public readonly y: Fr,\n /**\n * Whether the point is at infinity\n */\n public readonly isInfinite: boolean,\n ) {\n // TODO(#7386): check if on curve\n }\n\n toJSON() {\n return this.toString();\n }\n\n /**\n * Create a Point instance from a given buffer or BufferReader.\n * The input 'buffer' should have exactly 64 bytes representing the x and y coordinates.\n *\n * @param buffer - The buffer or BufferReader containing the x and y coordinates of the point.\n * @returns A Point instance.\n */\n static fromBuffer(buffer: Buffer | BufferReader) {\n const reader = BufferReader.asReader(buffer);\n return new this(Fr.fromBuffer(reader), Fr.fromBuffer(reader), false);\n }\n\n /**\n * Create a Point instance from a hex-encoded string.\n * The input should be prefixed with '0x' or not, and have exactly 128 hex characters representing the x and y coordinates.\n * Throws an error if the input length is invalid or coordinate values are out of range.\n *\n * @param str - The hex-encoded string representing the Point coordinates.\n * @returns A Point instance.\n */\n static fromString(str: string) {\n return this.fromBuffer(hexToBuffer(str));\n }\n\n /**\n * Returns the contents of the point as an array of 2 fields.\n * @returns The point as an array of 2 fields\n */\n toFields() {\n return [this.x, this.y, new Fr(this.isInfinite)];\n }\n\n static fromFields(fields: Fr[] | FieldReader) {\n const reader = FieldReader.asReader(fields);\n return new this(reader.readField(), reader.readField(), reader.readBoolean());\n }\n\n\n /**\n * Returns the x coordinate and the sign of the y coordinate.\n * @dev The y sign can be determined by checking if the y coordinate is greater than half of the modulus.\n * @returns The x coordinate and the sign of the y coordinate.\n */\n toXAndSign(): [Fr, boolean] {\n return [this.x, this.y.toBigInt() <= (Fr.MODULUS - 1n) / 2n];\n }\n\n /**\n * Returns the contents of the point as BigInts.\n * @returns The point as BigInts\n */\n toBigInts() {\n return {\n x: this.x.toBigInt(),\n y: this.y.toBigInt(),\n isInfinite: this.isInfinite ? 1n : 0n,\n };\n }\n\n /**\n * Converts the Point instance to a Buffer representation of the coordinates.\n * @returns A Buffer representation of the Point instance.\n * @dev Note that toBuffer does not include the isInfinite flag and other serialization methods do (e.g. toFields).\n * This is because currently when we work with point as bytes we don't want to populate the extra bytes for\n * isInfinite flag because:\n * 1. Our Grumpkin BB API currently does not handle point at infinity,\n * 2. we use toBuffer when serializing notes and events and there we only work with public keys and point at infinity\n * is not considered a valid public key and the extra byte would raise DA cost.\n */\n toBuffer() {\n if (this.isInfinite) {\n throw new Error('Cannot serialize infinite point with isInfinite flag');\n }\n const buf = serializeToBuffer([this.x, this.y]);\n if (buf.length !== Point.SIZE_IN_BYTES) {\n throw new Error(`Invalid buffer length for Point: ${buf.length}`);\n }\n return buf;\n }\n\n /**\n * Converts the Point instance to a compressed Buffer representation of the coordinates.\n * @returns A Buffer representation of the Point instance\n */\n toCompressedBuffer() {\n const [x, sign] = this.toXAndSign();\n // Here we leverage that Fr fits into 254 bits (log2(Fr.MODULUS) < 254) and given that we serialize Fr to 32 bytes\n // and we use big-endian the 2 most significant bits are never populated. Hence we can use one of the bits as\n // a sign bit.\n const compressedValue = x.toBigInt() + (sign ? 2n ** 255n : 0n);\n const buf = serializeToBuffer(compressedValue);\n if (buf.length !== Point.COMPRESSED_SIZE_IN_BYTES) {\n throw new Error(`Invalid buffer length for compressed Point: ${buf.length}`);\n }\n return buf;\n }\n\n /**\n * Convert the Point instance to a hexadecimal string representation.\n * The output string is prefixed with '0x' and consists of exactly 128 hex characters,\n * representing the concatenated x and y coordinates of the point.\n *\n * @returns A hex-encoded string representing the Point instance.\n */\n toString() {\n return bufferToHex(this.toBuffer());\n }\n\n /**\n * Generate a short string representation of the Point instance.\n * The returned string includes the first 10 and last 4 characters of the full string representation,\n * with '...' in between to indicate truncation. This is useful for displaying or logging purposes\n * when the full string representation may be too long.\n *\n * @returns A truncated string representation of the Point instance.\n */\n toShortString() {\n const str = this.toString();\n return `${str.slice(0, 10)}...${str.slice(-4)}`;\n }\n\n toNoirStruct() {\n /* eslint-disable camelcase */\n return { x: this.x, y: this.y, is_infinite: this.isInfinite };\n /* eslint-enable camelcase */\n }\n\n // Used for IvpkM, OvpkM, NpkM and TpkM. TODO(#8124): Consider removing this method.\n toWrappedNoirStruct() {\n return { inner: this.toNoirStruct() };\n }\n\n /**\n * Check if two Point instances are equal by comparing their buffer values.\n * Returns true if the buffer values are the same, and false otherwise.\n *\n * @param rhs - The Point instance to compare with the current instance.\n * @returns A boolean indicating whether the two Point instances are equal.\n */\n equals(rhs: Point) {\n return this.x.equals(rhs.x) && this.y.equals(rhs.y);\n }\n\n isZero() {\n return this.x.isZero() && this.y.isZero();\n }\n\n hash() {\n return poseidon2Hash(this.toFields());\n }\n\n /**\n * Check if this is point at infinity.\n * Check this is consistent with how bb is encoding the point at infinity\n */\n public get inf() {\n return this.isInfinite;\n }\n}\n\nexport class NotOnCurveError extends Error {\n constructor(x: Fr) {\n super('The given x-coordinate is not on the Grumpkin curve: ' + x.toString());\n this.name = 'NotOnCurveError';\n }\n}","import { BarretenbergSync } from '@aztec/bb.js';\n\nimport { concatenateUint8Arrays } from '../serialize';\nimport { SchnorrSignature } from './signature';\nimport { GrumpkinScalar } from '../../fields/fields';\nimport { Point } from '../../fields/point';\nimport { numToInt32BE } from '../../serialize/free_funcs';\n\nexport * from './signature';\n\n/**\n * Schnorr signature construction and helper operations.\n */\nexport class Schnorr {\n /**\n * Computes a grumpkin public key from a private key.\n * @param privateKey - The private key.\n * @returns A grumpkin public key.\n */\n public async computePublicKey(privateKey: GrumpkinScalar): Promise<Point> {\n const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);\n const [result] = api.getWasm().callWasmExport('schnorr_compute_public_key', [privateKey.toBuffer()], [64]);\n return Point.fromBuffer(Buffer.from(result));\n }\n\n /**\n * Constructs a Schnorr signature given a msg and a private key.\n * @param msg - Message over which the signature is constructed.\n * @param privateKey - The private key of the signer.\n * @returns A Schnorr signature of the form (s, e).\n */\n public async constructSignature(msg: Uint8Array, privateKey: GrumpkinScalar) {\n const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);\n const messageArray = concatenateUint8Arrays([numToInt32BE(msg.length), msg]);\n const [s, e] = api\n .getWasm()\n .callWasmExport('schnorr_construct_signature', [messageArray, privateKey.toBuffer()], [32, 32]);\n \n return new SchnorrSignature(Buffer.from(concatenateUint8Arrays([s,e])));\n }\n}","import { Fq, Fr } from \"../aztec/fields/fields\";\nimport { Schnorr } from \"../aztec/crypto/schnorr\";\n\nexport async function generateKeyPair(signature: string): Promise<[[Fr, Fr], Fr]> {\n const privateKey = Fr.fromBufferReduce(Buffer.from(signature.replace(\"0x\", \"\"), \"hex\"));\n const schnorr = new Schnorr();\n const publicKey = await schnorr.computePublicKey(Fq.fromBufferReduce(privateKey.toBuffer()));\n return [[publicKey.x, publicKey.y], privateKey];\n}","import { hexlify32 } from '../utils/util';\nimport { ethers } from 'ethers';\nimport MerkleAbi from '../abis/MerkleTreeOperator.json';\nimport { NoteOnChainStatus } from '../entities';\nimport { DarkSwap } from '../darkSwap';\nimport { DarkSwapNote } from '../types';\nimport { calcNullifier } from '../proof/noteService';\nimport { generateKeyPair } from '../proof/keyService';\nimport { Fr } from '../aztec/fields/fields';\n\nfunction getContract(address: string, darkSwap: DarkSwap) {\n const provider = darkSwap.provider;\n return new ethers.Contract(address, MerkleAbi.abi, provider);\n}\n\nasync function getNoteOnChainStatus(darkSwap: DarkSwap, note: string, nullifier: string) {\n const contract = getContract(darkSwap.contracts.merkleTreeOperator, darkSwap);\n const isNotCreated = (await contract.noteIsNotCreated(note)) as boolean;\n if (isNotCreated) {\n return NoteOnChainStatus.UNKNOWN;\n }\n const isSpent = (await contract.nullifiersUsed(nullifier)) as boolean;\n if (isSpent) {\n return NoteOnChainStatus.SPENT;\n }\n const isLocked = (await contract.nullifiersLocked(nullifier)) as boolean;\n if (isLocked) {\n return NoteOnChainStatus.LOCKED;\n }\n return NoteOnChainStatus.ACTIVE;\n}\n\nexport async function getNoteOnChainStatusByPublicKey(\n darkSwap: DarkSwap,\n note: DarkSwapNote,\n publicKey: [Fr, Fr]\n): Promise<NoteOnChainStatus> {\n const nullifier = calcNullifier(note.rho, publicKey);\n const onChainStatus = await getNoteOnChainStatus(darkSwap, hexlify32(note.note), hexlify32(nullifier));\n return onChainStatus;\n}\n\nexport async function getNoteOnChainStatusBySignature(\n darkSwap: DarkSwap,\n note: DarkSwapNote,\n signature: string\n): Promise<NoteOnChainStatus> {\n const [publicKey] = await generateKeyPair(signature);\n const nullifier = calcNullifier(note.rho, publicKey);\n const onChainStatus = await getNoteOnChainStatus(darkSwap, hexlify32(note.note), hexlify32(nullifier));\n return onChainStatus;\n}\n\nexport async function isNoteActive(darkSwap: DarkSwap, note: DarkSwapNote, publicKey: [Fr, Fr]): Promise<boolean> {\n const nullifier = calcNullifier(note.rho, publicKey);\n const onChainStatus = await getNoteOnChainStatus(darkSwap, hexlify32(note.note), hexlify32(nullifier));\n return onChainStatus === NoteOnChainStatus.ACTIVE;\n}\n\nexport async function isNoteSpent(darkSwap: DarkSwap, note: DarkSwapNote, publicKey: [Fr, Fr]) {\n const nullifier = calcNullifier(note.rho, publicKey);\n const onChainStatus = await getNoteOnChainStatus(darkSwap, hexlify32(note.note), hexlify32(nullifier));\n return onChainStatus === NoteOnChainStatus.SPENT;\n}\n\nexport async function isNoteValid(darkSwap: DarkSwap, note: DarkSwapNote, publicKey: [Fr, Fr]) {\n const nullifier = calcNullifier(note.rho, publicKey);\n const onChainStatus = await getNoteOnChainStatus(darkSwap, hexlify32(note.note), hexlify32(nullifier));\n return onChainStatus === NoteOnChainStatus.ACTIVE;\n}\n\nexport async function getNullifierBySignature(note: DarkSwapNote, signature: string): Promise<string> {\n const [publicKey] = await generateKeyPair(signature);\n return hexlify32(calcNullifier(note.rho, publicKey));\n}\n\nexport async function isNoteCreated(darkSwap: DarkSwap, note: bigint) {\n const contract = getContract(darkSwap.contracts.merkleTreeOperator, darkSwap);\n const isNotCreated = (await contract.noteIsNotCreated(hexlify32(note))) as boolean;\n return !isNotCreated;\n}\n","export enum ChainId {\n HARDHAT = 31337,\n HARDHAT_ARBITRUM = 31338,\n HARDHAT_BASE = 31339,\n MAINNET = 1,\n SEPOLIA = 11155111,\n BASE_SEPOLIA = 84532,\n HORIZEN_TESTNET = 845320009,\n ARBITRUM_ONE = 42161,\n BASE = 8453,\n}\n","import { ChainId } from './chain';\n\nexport const legacyTokenConfig: { [chainId: number]: string[] } = {\n [ChainId.MAINNET]: ['0xdac17f958d2ee523a2206206994597c13d831ec7'],\n [ChainId.HARDHAT]: ['0xdac17f958d2ee523a2206206994597c13d831ec7']\n};\n\nconst confirmationsConfig: { [chainId: number]: number } = {\n [ChainId.MAINNET]: 3,\n [ChainId.ARBITRUM_ONE]: 3,\n [ChainId.BASE]: 3,\n [ChainId.SEPOLIA]: 3,\n [ChainId.HARDHAT]: 3,\n}\n\nconst DEFAULT_CONFIRMATIONS = 3;\n\nexport const getConfirmations = (chainId: number) => confirmationsConfig[chainId] || DEFAULT_CONFIRMATIONS;\n\nexport const DEFAULT_FEE_RATIO = 300n;\n\nexport const GAS_LIMIT_MULTIPLIER = 120n;\nexport const GAS_LIMIT_PRECISION = 100n;","import { Fr } from \"./aztec/fields/fields\";\n\nexport type Hex = string;\n\nexport enum PROOF_DOMAIN {\n DEPOSIT = 10001,\n WITHDRAW = 10002,\n RETAIL_CREATE_ORDER = 10003,\n PRO_CREATE_ORDER = 10004,\n PRO_SWAP = 10005,\n PRO_CANCEL_ORDER = 10006,\n RETAIL_CANCEL_ORDER = 10007,\n JOIN = 10008,\n TRIPLE_JOIN = 10009,\n RETAIL_SWAP = 10010,\n RETAIL_BRIDGE_ORDER = 20003,\n}\n\nexport const EMPTY_NULLIFIER = 0n;\nexport const EMPTY_FOOTER = 0n;\n\nexport const FEE_RATIO_PRECISION = 1000000n;\n\nexport class DarkSwapProofError extends Error {\n constructor(message: string) {\n super(message)\n this.name = 'DarkSwapProofError'\n Object.setPrototypeOf(this, DarkSwapProofError.prototype)\n }\n}\n\nexport type DarkSwapNote = CreateNoteParam & {\n note: bigint,\n}\nexport type DarkSwapOrderNote = DarkSwapNote & {\n feeRatio: bigint,\n}\n\nexport type DarkSwapOrderNoteExt = DarkSwapOrderNote & {\n nullifier: string,\n}\n\nexport type CreateNoteParam = {\n address: string,\n rho: bigint,\n amount: bigint,\n asset: string,\n}\n\nexport type DarkSwapNoteExt = DarkSwapNote & { footer: bigint }\n\n\nexport type BaseProofParam = {\n address: string,\n signedMessage: string,\n}\n\nexport type BaseProofResult = {\n proof: string,\n verifyInputs: string[],\n}\n\nexport type BaseProofInput = {\n address: string,\n pub_key: [string, string],\n signature: any\n}\n\nexport type DarkSwapMessage = {\n address: string,\n orderNote: DarkSwapOrderNote,\n orderNullifier: string,\n inNote: DarkSwapNote,\n feeAmount: bigint,\n publicKey: [Fr, Fr],\n signature: string,\n}","export function bn_to_hex(n: bigint) {\n return n.toString(16).padStart(64, \"0\");\n}\n\nexport function bn_to_0xhex(n: bigint) {\n return \"0x\" + bn_to_hex(n);\n}\n\nexport function bn_to_0xAddress(n: bigint) {\n return \"0x\" + n.toString(16).padStart(40, \"0\");\n}","\n\nexport function mergeUnit8Array(arr1: Uint8Array, arr2: Uint8Array) {\n return Array.from(arr1).concat(Array.from(arr2));\n}\n\n\nexport function signatureToHexString(sig: Buffer): string {\n return '0x' + sig.toString('hex');\n}\n\nexport function hexStringToSignature(hex: string): Uint8Array {\n return Buffer.from(hex.replace(/^0x/i, ''), 'hex')\n}\n\nexport function uint8ArrayToNumberArray(uint8Array: Uint8Array): number[] {\n return Array.from(uint8Array).map((x) => x);\n}\n","import { UltraHonkBackend } from \"@aztec/bb.js\";\nimport { Schnorr } from \"../aztec/crypto/schnorr\";\nimport { Fq, Fr } from \"../aztec/fields/fields\";\nimport { Noir } from \"@noir-lang/noir_js\";\nimport { hexlify } from \"ethers\";\n\nexport async function generateProof(\n circuit: any,\n inputs: any,\n) {\n\n const start_time = new Date().getTime();\n const backend = new UltraHonkBackend(circuit.bytecode);\n\n const noir = new Noir(circuit);\n try {\n const { witness } = await noir.execute(inputs);\n const proof = await backend.generateProof(witness, { keccak: true });\n console.log(\"Proof generated in \" + (new Date().getTime() - start_time) + \"ms\");\n\n return { proof: hexlify(proof.proof), verifyInputs: proof.publicInputs };\n } finally {\n const destroy_start_time = new Date().getTime();\n await backend.destroy();\n console.log(\"Destroyed in \" + (new Date().getTime() - destroy_start_time) + \"ms\");\n }\n}\n\n\nexport async function signMessage(message: string, fuzkPriKey: Fr) {\n const schnorr = new Schnorr();\n const signature = await schnorr.constructSignature(Buffer.from(message, \"hex\").reverse(), Fq.fromBufferReduce(fuzkPriKey.toBuffer()));\n return signature.toBuffer();\n}","import depositCircuit from \"../../circuits/pro/dark_swap_deposit_compiled_circuit.json\";\nimport { BaseProofParam, BaseProofResult, DarkSwapNote, DarkSwapProofError, EMPTY_NULLIFIER, PROOF_DOMAIN } from \"../../types\";\nimport { encodeAddress } from \"../../utils/encoders\";\nimport { bn_to_0xhex, bn_to_hex } from \"../../utils/formatters\";\nimport { mimc_bn254 } from \"../../utils/mimc\";\nimport { uint8ArrayToNumberArray } from \"../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../baseProofService\";\nimport { generateKeyPair } from \"../keyService\";\nimport { calcNullifier, getNoteFooter } from \"../noteService\";\n\ntype DepositProofInput = {\n merkle_root: string,\n merkle_index: number[],\n merkle_path: string[],\n\n address: string,\n asset: string,\n\n in_amount: string,\n\n existing_note: string,\n existing_amount: string,\n existing_rho: string,\n existing_nullifier: string,\n\n account_note: string,\n account_rho: string,\n account_note_footer: string,\n\n pub_key: [string, string],\n signature: any\n}\n\nexport type DepositProofParam = BaseProofParam & {\n merkleRoot: string,\n merkleIndex: number[],\n merklePath: string[],\n oldBalanceNote: DarkSwapNote,\n newBalanceNote: DarkSwapNote,\n}\n\nexport type DepositProofResult = BaseProofResult & {\n oldBalanceNullifier: string,\n newBalanceFooter: string,\n}\n\nexport async function generateDepositProof(param: DepositProofParam): Promise<DepositProofResult> {\n const depositAmount = param.newBalanceNote.amount - param.oldBalanceNote.amount;\n if (depositAmount <= 0) {\n throw new DarkSwapProofError(\"Deposit amount must be greater than 0\");\n }\n\n if (param.oldBalanceNote.amount < 0n) {\n throw new DarkSwapProofError(\"Old balance note amount must be greater or equal to 0\");\n }\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.signedMessage);\n\n let oldBalanceNullifier = EMPTY_NULLIFIER;\n if (param.oldBalanceNote.amount != 0n) {\n oldBalanceNullifier = calcNullifier(param.oldBalanceNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n }\n\n const newBalanceFooter = getNoteFooter(param.newBalanceNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n\n const addressMod = encodeAddress(param.address);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.DEPOSIT),\n oldBalanceNullifier,\n addressMod,\n param.newBalanceNote.note,\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: DepositProofInput = {\n merkle_root: param.merkleRoot,\n merkle_index: param.merkleIndex,\n merkle_path: param.merklePath.map((x) => bn_to_0xhex(BigInt(x))),\n\n address: bn_to_0xhex(addressMod),\n asset: bn_to_0xhex(encodeAddress(param.newBalanceNote.asset)),\n in_amount: bn_to_0xhex(depositAmount),\n existing_note: bn_to_0xhex(param.oldBalanceNote.note),\n existing_amount: bn_to_0xhex(param.oldBalanceNote.amount),\n existing_rho: bn_to_0xhex(param.oldBalanceNote.rho),\n existing_nullifier: bn_to_0xhex(oldBalanceNullifier),\n\n account_note: bn_to_0xhex(param.newBalanceNote.note),\n account_rho: bn_to_0xhex(param.newBalanceNote.rho),\n account_note_footer: bn_to_0xhex(newBalanceFooter),\n\n pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n signature: uint8ArrayToNumberArray(signature),\n };\n const proof = await generateProof(depositCircuit, inputs);\n return {\n ...proof,\n oldBalanceNullifier: inputs.existing_nullifier,\n newBalanceFooter: inputs.account_note_footer,\n }\n};","import { DarkSwap } from '../darkSwap';\n\nexport class BaseContext {\n private _address?: string;\n private _signature: string;\n private _merkleRoot?: string;\n private _tx?: string;\n\n constructor(signature: string) {\n this._signature = signature;\n }\n\n set address(address: string | undefined) {\n this._address = address;\n }\n\n get address(): string | undefined {\n return this._address;\n }\n\n get signature(): string {\n return this._signature;\n }\n\n set merkleRoot(merkleRoot: string | undefined) {\n this._merkleRoot = merkleRoot;\n }\n\n get merkleRoot(): string | undefined {\n return this._merkleRoot;\n }\n\n set tx(tx: string | undefined) {\n this._tx = tx;\n }\n\n get tx(): string | undefined {\n return this._tx;\n }\n}\n\n\nexport abstract class BaseContractService {\n protected _darkSwap: DarkSwap;\n\n constructor(_darkSwap: DarkSwap) {\n this._darkSwap = _darkSwap;\n }\n}","import { ethers } from 'ethers';\nimport MerkleAbi from '../abis/MerkleTreeOperator.json';\nimport { hexlify32 } from '../utils/util';\nimport { DarkSwap } from '../darkSwap';\n\n\nexport interface MerklePath {\n noteCommitment: bigint;\n path: string[];\n index: number[];\n root: string;\n}\n\nexport const EMPTY_PATH: MerklePath = {\n noteCommitment: 0n,\n path: Array(32).fill('0x0000000000000000000000000000000000000000000000000000000000000000'),\n index: Array(32).fill(0),\n root: '0x0000000000000000000000000000000000000000000000000000000000000000'\n}\n\nfunction getContract(address: string, darkSwap: DarkSwap) {\n const provider = darkSwap.provider;\n return new ethers.Contract(address, MerkleAbi.abi, provider);\n}\n\nexport async function getMerklePathAndRoot(note: bigint, darkSwap: DarkSwap): Promise<MerklePath> {\n const result = await multiGetMerklePathAndRoot([note], darkSwap);\n return result[0];\n}\n\nexport async function multiGetMerklePathAndRoot(notes: bigint[], darkSwap: DarkSwap): Promise<MerklePath[]> {\n const contract = getContract(darkSwap.contracts.merkleTreeOperator, darkSwap);\n\n const [root, paths, indexes] = await contract.getMultiMerklePaths(notes.map(note => hexlify32(note)));\n const results: MerklePath[] = [];\n for (let i = 0; i < notes.length; i++) {\n results.push({\n noteCommitment: notes[i],\n path: paths[i],\n index: indexes[i].map((x: boolean) => (x ? 1 : 0)),\n root\n });\n }\n\n return results;\n}\n","import { ChainId } from './chain';\n\nexport type ContractConfiguartion = {\n priceOracle: string;\n ethAddress: string;\n nativeWrapper: string;\n merkleTreeOperator: string;\n darkSwapAssetManager: string;\n darkSwapFeeAssetManager: string;\n synaraDarkSwapOnBridgeAssetManager: string;\n synaraBridge: string;\n synaraCanonicalTokenRegistry: string;\n zkverifyRelayerUrls: string[];\n};\n\nexport const contractConfig: { [chainId: number]: ContractConfiguartion } = {\n [ChainId.MAINNET]: {\n priceOracle: '0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8',\n ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',\n nativeWrapper: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',\n merkleTreeOperator: '0x0', //FIXME\n darkSwapAssetManager: '0x0', //FIXME\n darkSwapFeeAssetManager: '0x0', //FIXME\n synaraDarkSwapOnBridgeAssetManager: '0x0', //FIXME\n synaraBridge: '0x0', //FIXME\n synaraCanonicalTokenRegistry: '0x0', //FIXME\n zkverifyRelayerUrls: [],//FIXME\n },\n [ChainId.ARBITRUM_ONE]: {\n priceOracle: '0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8',\n ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',\n nativeWrapper: '0x82af49447d8a07e3bd95bd0d56f35241523fbab1',\n merkleTreeOperator: '0x0', //FIXME\n darkSwapAssetManager: '0x0', //FIXME\n darkSwapFeeAssetManager: '0x0', //FIXME\n synaraDarkSwapOnBridgeAssetManager: '0x0', //FIXME\n synaraBridge: '0x0', //FIXME\n synaraCanonicalTokenRegistry: '0x0', //FIXME\n zkverifyRelayerUrls: [],//FIXME\n },\n [ChainId.BASE]: {\n priceOracle: '0xf224a25453D76A41c4427DD1C05369BC9f498444',\n ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',\n nativeWrapper: '0x4200000000000000000000000000000000000006',\n merkleTreeOperator: '0x918B4F76CAE5F67A3818D8eD3d0e11D9888684E9',\n darkSwapAssetManager: '0x6fbA1F1aAb8449b7ba576E41F4617d918391b7cF',\n darkSwapFeeAssetManager: '0xfde341e63EB2f25A32D353d58C2DAd7f91c8Bd57',\n synaraDarkSwapOnBridgeAssetManager: '0x0', //FIXME\n synaraBridge: '0x0', //FIXME\n synaraCanonicalTokenRegistry: '0x0', //FIXME\n zkverifyRelayerUrls: [],//FIXME\n },\n [ChainId.SEPOLIA]: {\n priceOracle: '0x4Fe44a9aC8Ef059Be2dB97f9e3bcA32Ab698C2f2',\n ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',\n nativeWrapper: '0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14',\n merkleTreeOperator: '0xbeCd9FD715d131F8E897095Ef008BB4d9325B744',\n darkSwapAssetManager: '0x6E56b48361aD94Cb67EB5aA9182b2813bC76E6C0',\n darkSwapFeeAssetManager: '0x5C550CE1F4a02865F0f59d839D86807C75A6ddE0',\n synaraDarkSwapOnBridgeAssetManager: '0xEAC8292c1ef7b112Ccd5B3CB16E587E1799358db',\n synaraBridge: '0x2a9569b5df66B7E24B4FdC2B91d19E4C1C02F2D3',\n synaraCanonicalTokenRegistry: '0xD35264a934b5b7b8b3507b1d073e29EeBa4Dc754',\n zkverifyRelayerUrls: [],//FIXME\n },\n [ChainId.BASE_SEPOLIA]: {\n priceOracle: '0x4Fe44a9aC8Ef059Be2dB97f9e3bcA32Ab698C2f2',\n ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',\n nativeWrapper: '0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14',\n merkleTreeOperator: '0xC486e448e068A888AF09c386337E3C3C4812569b',\n darkSwapAssetManager: '0xEd349302ff6C2527be9555Fa386061652EAC712D',\n darkSwapFeeAssetManager: '0xa62C0693296f64eb9BA29ff2E41E96749c18de0F',\n synaraDarkSwapOnBridgeAssetManager: '0x0aAd845E874F0007e328862A3C455CB2D6625660',\n synaraBridge: '0xda348F7dEAeE972D8a5B4D4D182EF0273aDd3E2c',\n synaraCanonicalTokenRegistry: '0x016C6334d644E0B21aD5c6e91083Dd2f22739eB6',\n zkverifyRelayerUrls: [],//FIXME\n },\n [ChainId.HORIZEN_TESTNET]: {\n priceOracle: '0x54c375f28ce4B0c2B986D6256E4Bc75d242A8793',\n ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',\n nativeWrapper: '0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14',\n merkleTreeOperator: '0x8Cd4061C8b3743810B811E1F4A0B597D79225f4E',\n darkSwapAssetManager: '0xEBeD6c7C2189bf8ad6687D3A4cf4b83fB4D1a3D2',\n darkSwapFeeAssetManager: '0x8CF86856Bd7dE95b4ba33DCae4cd5Ec02542Bf5b',\n synaraDarkSwapOnBridgeAssetManager: '0x0', //FIXME\n synaraBridge: '0x0', //FIXME\n synaraCanonicalTokenRegistry: '0x0', //FIXME\n zkverifyRelayerUrls: [],//FIXME\n },\n [ChainId.HARDHAT]: {\n priceOracle: '0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8',\n ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',\n nativeWrapper: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',\n merkleTreeOperator: '0xEd8D7d3A98CB4ea6C91a80dcd2220719c264531f',\n darkSwapAssetManager: '0x6D39d71fF4ab56a4873febd34e1a3BDefc01b41e',\n darkSwapFeeAssetManager: '0xb9b0c96e4E7181926D2A7ed331C9C346dfa59b4D',\n synaraDarkSwapOnBridgeAssetManager: '0x0', //FIXME\n synaraBridge: '0x0', //FIXME\n synaraCanonicalTokenRegistry: '0x0', //FIXME\n zkverifyRelayerUrls: [],//FIXME\n },\n [ChainId.HARDHAT_BASE]: {\n priceOracle: '0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8',\n ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',\n nativeWrapper: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',\n merkleTreeOperator: '0xEd8D7d3A98CB4ea6C91a80dcd2220719c264531f',\n darkSwapAssetManager: '0x6D39d71fF4ab56a4873febd34e1a3BDefc01b41e',\n darkSwapFeeAssetManager: '0xb9b0c96e4E7181926D2A7ed331C9C346dfa59b4D',\n synaraDarkSwapOnBridgeAssetManager: '0x0', //FIXME\n synaraBridge: '0x0', //FIXME\n synaraCanonicalTokenRegistry: '0x0', //FIXME\n zkverifyRelayerUrls: [],//FIXME\n }\n};\n","import { GAS_LIMIT_MULTIPLIER, GAS_LIMIT_PRECISION } from \"../config\";\n\nexport function refineGasLimit(estimatedGas: bigint){\n return (estimatedGas * GAS_LIMIT_MULTIPLIER) / GAS_LIMIT_PRECISION;\n}","import { ethers } from 'ethers';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport ERC20Abi from '../../abis/IERC20.json';\nimport ERC20_USDT from '../../abis/IERC20_USDT.json';\nimport { getConfirmations, legacyTokenConfig } from '../../config/config';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { DepositProofResult, generateDepositProof } from '../../proof/basic/depositProof';\nimport { generateKeyPair } from '../../proof/keyService';\nimport { createNote } from '../../proof/noteService';\nimport { DarkSwapNote } from '../../types';\nimport { MAX_ALLOWANCE } from '../../utils/constants';\nimport { hexlify32, isNativeAsset } from '../../utils/util';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { EMPTY_PATH, getMerklePathAndRoot } from '../merkletree';\nimport { refineGasLimit } from '../../utils/gasUtil';\n\nexport class DepositContext extends BaseContext {\n private _currentBalance?: DarkSwapNote;\n private _newBalance?: DarkSwapNote;\n private _proof?: DepositProofResult;\n private _depositAmount?: bigint;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set currentBalance(currentBalance: DarkSwapNote | undefined) {\n this._currentBalance = currentBalance;\n }\n\n get currentBalance(): DarkSwapNote | undefined {\n return this._currentBalance;\n }\n\n set newBalance(newBalance: DarkSwapNote | undefined) {\n this._newBalance = newBalance;\n }\n\n get newBalance(): DarkSwapNote | undefined {\n return this._newBalance;\n }\n\n set proof(proof: DepositProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): DepositProofResult | undefined {\n return this._proof;\n }\n\n set depositAmount(depositAmount: bigint | undefined) {\n this._depositAmount = depositAmount;\n }\n\n get depositAmount(): bigint | undefined {\n return this._depositAmount;\n }\n}\n\nexport class DepositService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public async prepare(\n currentBalance: DarkSwapNote,\n depositAsset: string,\n depositAmount: bigint,\n walletAddress: string,\n signature: string,\n ): Promise<{ context: DepositContext; newBalanceNote: DarkSwapNote }> {\n const [pubKey] = await generateKeyPair(signature);\n const newBalanceAmount = depositAmount + currentBalance.amount;\n const newBalance = createNote(walletAddress, depositAsset, newBalanceAmount, pubKey);\n const context = new DepositContext(signature);\n context.currentBalance = currentBalance;\n context.newBalance = newBalance;\n context.address = walletAddress;\n context.depositAmount = depositAmount;\n return { context, newBalanceNote: newBalance };\n }\n\n private async generateProof(context: DepositContext): Promise<void> {\n if (!context || !context.currentBalance || !context.newBalance || !context.address || !context.signature) {\n throw new DarkSwapError('Invalid context');\n }\n\n const path = context.currentBalance.amount === 0n ?\n EMPTY_PATH :\n await getMerklePathAndRoot(context.currentBalance.note, this._darkSwap);\n context.merkleRoot = path.root;\n\n const proof = await generateDepositProof({\n merkleRoot: path.root,\n merkleIndex: path.index,\n merklePath: path.path,\n oldBalanceNote: context.currentBalance,\n newBalanceNote: context.newBalance,\n signedMessage: context.signature,\n address: context.address,\n });\n context.proof = proof;\n }\n\n public async execute(context: DepositContext): Promise<string> {\n await this.generateProof(context);\n\n if (!context\n || !context.currentBalance\n || !context.newBalance\n || !context.address\n || !context.signature\n || !context.proof\n || !context.depositAmount\n ) {\n throw new DarkSwapError('Invalid context');\n }\n const signer = this._darkSwap.signer;\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n signer\n );\n\n if (!isNativeAsset(context.newBalance.asset)) {\n await this.allowance(context);\n const depositArgs = [\n context.merkleRoot,\n context.newBalance.asset,\n hexlify32(context.depositAmount),\n context.proof.oldBalanceNullifier,\n hexlify32(context.newBalance.note),\n context.proof.newBalanceFooter,\n context.proof.proof];\n const estimatedGas = await contract.deposit.estimateGas(\n ...depositArgs,\n { value: 0n }\n );\n const gasLimit = refineGasLimit(estimatedGas);\n const tx = await contract.deposit(\n ...depositArgs,\n { value: 0n, gasLimit }\n );\n await tx.wait();\n return tx.hash;\n } else {\n const depositArgs = [\n context.merkleRoot,\n context.newBalance.asset,\n hexlify32(context.depositAmount),\n context.proof.oldBalanceNullifier,\n hexlify32(context.newBalance.note),\n context.proof.newBalanceFooter,\n context.proof.proof\n ];\n const estimatedGas = await contract.deposit.estimateGas(\n ...depositArgs,\n { value: context.depositAmount }\n );\n const tx = await contract.deposit(\n ...depositArgs,\n { value: context.depositAmount, gasLimit: refineGasLimit(estimatedGas) }\n );\n await tx.wait();\n return tx.hash;\n }\n }\n\n protected async allowance(context: DepositContext) {\n if (!context || !context.newBalance || !context.address || !context.signature || !context.proof) {\n throw new DarkSwapError('Invalid context');\n }\n const signer = this._darkSwap.signer;\n const allowanceContract = new ethers.Contract(context.newBalance.asset, ERC20Abi.abi, this._darkSwap);\n const allowance = await allowanceContract.allowance(\n signer.getAddress(),\n this._darkSwap.contracts.darkSwapAssetManager\n );\n if (BigInt(allowance) < context.newBalance.amount) {\n const isLegacy =\n legacyTokenConfig.hasOwnProperty(this._darkSwap.chainId) &&\n legacyTokenConfig[this._darkSwap.chainId].includes(context.newBalance.asset.toLowerCase());\n const contract = new ethers.Contract(context.newBalance.asset, isLegacy ? ERC20_USDT.abi : ERC20Abi.abi, signer);\n const tx = await contract.approve(this._darkSwap.contracts.darkSwapAssetManager, hexlify32(MAX_ALLOWANCE));\n await tx.wait(getConfirmations(this._darkSwap.chainId));\n }\n }\n}\n","import withdrawCircuit from \"../../circuits/pro/dark_swap_withdraw_compiled_circuit.json\";\nimport { BaseProofInput, BaseProofParam, BaseProofResult, DarkSwapNote, DarkSwapProofError, EMPTY_FOOTER, PROOF_DOMAIN } from \"../../types\";\nimport { encodeAddress } from \"../../utils/encoders\";\nimport { bn_to_0xhex, bn_to_hex } from \"../../utils/formatters\";\nimport { mimc_bn254 } from \"../../utils/mimc\";\nimport { uint8ArrayToNumberArray } from \"../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../baseProofService\";\nimport { generateKeyPair } from \"../keyService\";\nimport { calcNullifier, getNoteFooter } from \"../noteService\";\n\ntype WithdrawProofInput = BaseProofInput & {\n merkle_root: string,\n merkle_index: number[],\n merkle_path: string[],\n\n note: string,\n asset: string,\n rho: string,\n out_amount: string,\n nullifier: string,\n\n remaining_note: string,\n remaining_rho: string,\n remaining_note_footer: string,\n remaining_amount: string,\n}\n\nexport type WithdrawProofParam = BaseProofParam & {\n merkleRoot: string,\n merkleIndex: number[],\n merklePath: string[],\n oldBalance: DarkSwapNote,\n newBalance: DarkSwapNote,\n}\n\nexport type WithdrawProofResult = BaseProofResult & {\n oldBalanceNullifier: string,\n newBalanceFooter: string,\n}\n\nexport async function generateWithdrawProof(param: WithdrawProofParam): Promise<WithdrawProofResult> {\n const withdrawAmount = param.oldBalance.amount - param.newBalance.amount;\n if (param.oldBalance.amount <= 0n\n || param.newBalance.amount < 0n\n || withdrawAmount <= 0n\n ) {\n throw new DarkSwapProofError(\"Invalid withdraw amount\");\n }\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.signedMessage);\n\n const oldBalanceNullifier = calcNullifier(param.oldBalance.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n\n //new balance note could be empty note\n let newBalanceFooter = EMPTY_FOOTER;\n if (param.newBalance.amount != 0n) {\n newBalanceFooter = getNoteFooter(param.newBalance.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n }\n\n const addressMod = encodeAddress(param.address);\n const assetMod = encodeAddress(param.oldBalance.asset);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.WITHDRAW),\n addressMod,\n oldBalanceNullifier,\n param.newBalance.note,\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: WithdrawProofInput = {\n merkle_root: param.merkleRoot,\n merkle_index: param.merkleIndex,\n merkle_path: param.merklePath.map((x) => bn_to_0xhex(BigInt(x))),\n\n address: bn_to_0xhex(addressMod),\n asset: bn_to_0xhex(assetMod),\n rho: bn_to_0xhex(param.oldBalance.rho),\n out_amount: bn_to_0xhex(withdrawAmount),\n nullifier: bn_to_0xhex(oldBalanceNullifier),\n\n note: bn_to_0xhex(param.oldBalance.note),\n\n remaining_note: bn_to_0xhex(param.newBalance.note),\n remaining_rho: bn_to_0xhex(param.newBalance.rho),\n remaining_note_footer: bn_to_0xhex(newBalanceFooter),\n remaining_amount: bn_to_0xhex(param.newBalance.amount),\n\n pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n signature: uint8ArrayToNumberArray(signature),\n };\n const proof = await generateProof(withdrawCircuit, inputs);\n return {\n ...proof,\n oldBalanceNullifier: inputs.nullifier,\n newBalanceFooter: inputs.remaining_note_footer,\n }\n};","import { ethers } from 'ethers';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateWithdrawProof, WithdrawProofResult } from '../../proof/basic/withdrawProof';\nimport { generateKeyPair } from '../../proof/keyService';\nimport { createNote } from '../../proof/noteService';\nimport { DarkSwapNote } from '../../types';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { getMerklePathAndRoot } from '../merkletree';\nimport { hexlify32 } from '../../utils/util';\n\nclass WithdrawContext extends BaseContext {\n private _currentBalance?: DarkSwapNote;\n private _newBalance?: DarkSwapNote;\n private _withdrawAmount?: bigint;\n private _proof?: WithdrawProofResult;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set currentBalance(note: DarkSwapNote | undefined) {\n this._currentBalance = note;\n }\n\n get currentBalance(): DarkSwapNote | undefined {\n return this._currentBalance;\n }\n\n set newBalance(note: DarkSwapNote | undefined) {\n this._newBalance = note;\n }\n\n get newBalance(): DarkSwapNote | undefined {\n return this._newBalance;\n }\n\n set withdrawAmount(amount: bigint | undefined) {\n this._withdrawAmount = amount;\n }\n\n get withdrawAmount(): bigint | undefined {\n return this._withdrawAmount;\n }\n\n set proof(proof: WithdrawProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): WithdrawProofResult | undefined {\n return this._proof;\n }\n}\n\nexport class WithdrawService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public async prepare(\n address: string,\n currentBalance: DarkSwapNote,\n withdrawAmount: bigint,\n signature: string\n ): Promise<{ context: WithdrawContext; newBalanceNote: DarkSwapNote }> {\n const [pubKey] = await generateKeyPair(signature);\n const newBalanceNote = createNote(address, currentBalance.asset, currentBalance.amount - withdrawAmount, pubKey);\n\n const context = new WithdrawContext(signature);\n context.currentBalance = currentBalance;\n context.newBalance = newBalanceNote;\n context.withdrawAmount = withdrawAmount;\n context.address = address;\n return { context, newBalanceNote };\n }\n\n private async generateProof(context: WithdrawContext): Promise<void> {\n if (!context || !context.currentBalance || !context.newBalance || !context.withdrawAmount || !context.address) {\n throw new DarkSwapError('Invalid context');\n }\n\n const path = await getMerklePathAndRoot(context.currentBalance.note, this._darkSwap);\n context.merkleRoot = path.root;\n\n const proof = await generateWithdrawProof({\n oldBalance: context.currentBalance,\n newBalance: context.newBalance,\n address: context.address,\n merkleRoot: path.root,\n merklePath: path.path,\n merkleIndex: path.index,\n signedMessage: context.signature,\n });\n context.proof = proof;\n }\n\n public async execute(context: WithdrawContext): Promise<string> {\n await this.generateProof(context);\n\n if (!context || !context.currentBalance || !context.newBalance || !context.proof || !context.merkleRoot) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n this._darkSwap.signer\n );\n\n const tx = await contract.withdraw(\n context.merkleRoot,\n context.currentBalance.asset,\n context.withdrawAmount,\n context.proof.oldBalanceNullifier,\n hexlify32(context.newBalance.note),\n context.proof.newBalanceFooter,\n context.proof.proof\n );\n await tx.wait();\n return tx.hash;\n }\n}\n","import joinCircuit from \"../../circuits/pro/dark_swap_join_compiled_circuit.json\";\nimport { BaseProofParam, BaseProofResult, DarkSwapNote, DarkSwapProofError, PROOF_DOMAIN } from \"../../types\";\nimport { encodeAddress } from \"../../utils/encoders\";\nimport { bn_to_0xhex, bn_to_hex } from \"../../utils/formatters\";\nimport { mimc_bn254 } from \"../../utils/mimc\";\nimport { uint8ArrayToNumberArray } from \"../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../baseProofService\";\nimport { generateKeyPair } from \"../keyService\";\nimport { calcNullifier, getNoteFooter } from \"../noteService\";\n\ntype JoinProofInput = {\n merkle_root: string,\n in_merkle_index_1: number[],\n in_merkle_index_2: number[],\n in_merkle_path_1: string[],\n in_merkle_path_2: string[],\n address: string,\n in_note_1: string,\n in_note_2: string,\n asset: string,\n in_amount_1: string,\n in_amount_2: string,\n in_rho_1: string,\n in_rho_2: string,\n in_nullifier_1: string,\n in_nullifier_2: string,\n\n out_note: string,\n out_rho: string,\n out_note_footer: string,\n\n pub_key: [string, string],\n signature: any\n}\n\nexport type JoinProofParam = BaseProofParam & {\n merkleRoot: string,\n inMerkleIndex1: number[],\n inMerkleIndex2: number[],\n inMerklePath1: string[],\n inMerklePath2: string[],\n inNote1: DarkSwapNote,\n inNote2: DarkSwapNote,\n outNote: DarkSwapNote,\n}\n\nexport type JoinProofResult = BaseProofResult & {\n inNullifier1: string,\n inNullifier2: string,\n outNoteFooter: string,\n}\n\nexport async function generateJoinProof(param: JoinProofParam): Promise<JoinProofResult> {\n if (param.inNote1.amount <= 0n\n || param.inNote2.amount <= 0n\n || param.outNote.amount != param.inNote1.amount + param.inNote2.amount) {\n throw new DarkSwapProofError(\"Invalid join amount\");\n }\n\n if (param.inNote1.asset.toLowerCase() !== param.inNote2.asset.toLowerCase()\n || param.inNote1.asset.toLowerCase() !== param.outNote.asset.toLowerCase()) {\n throw new DarkSwapProofError(\"Invalid join asset\");\n }\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.signedMessage);\n\n const inNullifier1 = calcNullifier(param.inNote1.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const inNullifier2 = calcNullifier(param.inNote2.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const outNoteFooter = getNoteFooter(param.outNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n\n const addressMod = encodeAddress(param.address);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.JOIN),\n inNullifier1,\n inNullifier2,\n param.outNote.note,\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: JoinProofInput = {\n merkle_root: param.merkleRoot,\n in_merkle_index_1: param.inMerkleIndex1,\n in_merkle_index_2: param.inMerkleIndex2,\n in_merkle_path_1: param.inMerklePath1.map((x) => bn_to_0xhex(BigInt(x))),\n in_merkle_path_2: param.inMerklePath2.map((x) => bn_to_0xhex(BigInt(x))),\n\n address: bn_to_0xhex(addressMod),\n asset: bn_to_0xhex(encodeAddress(param.outNote.asset)),\n in_amount_1: bn_to_0xhex(param.inNote1.amount),\n in_amount_2: bn_to_0xhex(param.inNote2.amount),\n in_rho_1: bn_to_0xhex(param.inNote1.rho),\n in_rho_2: bn_to_0xhex(param.inNote2.rho),\n in_nullifier_1: bn_to_0xhex(inNullifier1),\n in_nullifier_2: bn_to_0xhex(inNullifier2),\n in_note_1: bn_to_0xhex(param.inNote1.note),\n in_note_2: bn_to_0xhex(param.inNote2.note),\n\n out_note: bn_to_0xhex(param.outNote.note),\n out_rho: bn_to_0xhex(param.outNote.rho),\n out_note_footer: bn_to_0xhex(outNoteFooter),\n\n pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n signature: uint8ArrayToNumberArray(signature),\n };\n const proof = await generateProof(joinCircuit, inputs);\n return {\n ...proof,\n inNullifier1: inputs.in_nullifier_1,\n inNullifier2: inputs.in_nullifier_2,\n outNoteFooter: inputs.out_note_footer,\n }\n};","import { ethers } from 'ethers';\nimport { generateJoinProof, JoinProofResult } from '../../proof/basic/joinProof';\nimport { DarkSwapNote, EMPTY_NULLIFIER } from '../../types';\nimport { hexlify32, isAddressEquals } from '../../utils/util';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { multiGetMerklePathAndRoot } from '../merkletree';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateKeyPair } from '../../proof/keyService';\nimport { createNote } from '../../proof/noteService';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport { refineGasLimit } from '../../utils/gasUtil';\n\nclass JoinContext extends BaseContext {\n private _inNote1?: DarkSwapNote;\n private _inNote2?: DarkSwapNote;\n private _outNote?: DarkSwapNote;\n private _proof?: JoinProofResult;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set inNote1(note: DarkSwapNote | undefined) {\n this._inNote1 = note;\n }\n\n get inNote1(): DarkSwapNote | undefined {\n return this._inNote1;\n }\n\n set inNote2(note: DarkSwapNote | undefined) {\n this._inNote2 = note;\n }\n\n get inNote2(): DarkSwapNote | undefined {\n return this._inNote2;\n }\n\n set outNote(note: DarkSwapNote | undefined) {\n this._outNote = note;\n }\n\n get outNote(): DarkSwapNote | undefined {\n return this._outNote;\n }\n\n set proof(proof: JoinProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): JoinProofResult | undefined {\n return this._proof;\n }\n}\n\nexport class JoinService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public async prepare(\n address: string,\n inNote1: DarkSwapNote,\n inNote2: DarkSwapNote,\n signature: string\n ): Promise<{ context: JoinContext; outNote: DarkSwapNote }> {\n if (!isAddressEquals(inNote1.asset, inNote2.asset)) {\n throw new DarkSwapError('inNote1 and inNote2 must have the same asset');\n }\n\n if (inNote1.note === inNote2.note) {\n throw new DarkSwapError('inNote1 and inNote2 must have different note');\n }\n\n const [pubKey] = await generateKeyPair(signature);\n const outNote = createNote(address, inNote1.asset, inNote1.amount + inNote2.amount, pubKey);\n const context = new JoinContext(signature);\n context.inNote1 = inNote1;\n context.inNote2 = inNote2;\n context.outNote = outNote;\n context.address = address;\n return { context, outNote };\n }\n\n private async generateProof(context: JoinContext): Promise<void> {\n if (!context || !context.inNote1 || !context.inNote2 || !context.outNote || !context.address) {\n throw new DarkSwapError('Invalid context');\n }\n\n const merklePathes = await multiGetMerklePathAndRoot([context.inNote1.note, context.inNote2.note], this._darkSwap);\n const path1 = merklePathes[0];\n const path2 = merklePathes[1];\n\n const proof = await generateJoinProof({\n inNote1: context.inNote1,\n inNote2: context.inNote2,\n outNote: context.outNote,\n merkleRoot: path1.root,\n inMerklePath1: path1.path,\n inMerkleIndex1: path1.index,\n inMerklePath2: path2.path,\n inMerkleIndex2: path2.index,\n signedMessage: context.signature,\n address: context.address,\n });\n context.merkleRoot = path1.root;\n context.proof = proof;\n }\n\n public async execute(context: JoinContext): Promise<string> {\n await this.generateProof(context);\n if (!context || !context.inNote1 || !context.inNote2 || !context.outNote || !context.proof || !context.merkleRoot) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n this._darkSwap.signer\n );\n\n const joinArgs = [\n context.merkleRoot,\n [\n context.proof.inNullifier1,\n context.proof.inNullifier2,\n hexlify32(EMPTY_NULLIFIER)\n ],\n hexlify32(context.outNote.note),\n context.proof.outNoteFooter,\n context.proof.proof\n ];\n\n const estimatedGas = await contract.join.estimateGas(...joinArgs);\n const gasLimit = refineGasLimit(estimatedGas);\n\n const tx = await contract.join(...joinArgs, { gasLimit });\n await tx.wait();\n return tx.hash;\n }\n}\n","import tripleJoinCircuit from \"../../circuits/pro/dark_swap_triple_join_compiled_circuit.json\";\nimport { BaseProofInput, BaseProofParam, BaseProofResult, DarkSwapNote, DarkSwapProofError, PROOF_DOMAIN } from \"../../types\";\nimport { encodeAddress } from \"../../utils/encoders\";\nimport { bn_to_0xhex, bn_to_hex } from \"../../utils/formatters\";\nimport { mimc_bn254 } from \"../../utils/mimc\";\nimport { uint8ArrayToNumberArray } from \"../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../baseProofService\";\nimport { generateKeyPair } from \"../keyService\";\nimport { calcNullifier, getNoteFooter } from \"../noteService\";\n\ntype TripleJoinProofInput = BaseProofInput & {\n merkle_root: string,\n in_merkle_index_1: number[],\n in_merkle_index_2: number[],\n in_merkle_index_3: number[],\n in_merkle_path_1: string[],\n in_merkle_path_2: string[],\n in_merkle_path_3: string[],\n in_note_1: string,\n in_note_2: string,\n in_note_3: string,\n asset: string,\n in_amount_1: string,\n in_amount_2: string,\n in_amount_3: string,\n in_rho_1: string,\n in_rho_2: string,\n in_rho_3: string,\n in_nullifier_1: string,\n in_nullifier_2: string,\n in_nullifier_3: string,\n out_note: string,\n out_rho: string,\n out_note_footer: string,\n}\n\nexport type TripleJoinProofParam = BaseProofParam & {\n merkleRoot: string,\n inMerkleIndex1: number[],\n inMerkleIndex2: number[],\n inMerkleIndex3: number[],\n inMerklePath1: string[],\n inMerklePath2: string[],\n inMerklePath3: string[],\n inNote1: DarkSwapNote,\n inNote2: DarkSwapNote,\n inNote3: DarkSwapNote,\n outNote: DarkSwapNote,\n}\n\nexport type TripleJoinProofResult = BaseProofResult & {\n inNullifier1: string,\n inNullifier2: string,\n inNullifier3: string,\n outNoteFooter: string,\n}\n\nexport async function generateTripleJoinProof(param: TripleJoinProofParam): Promise<TripleJoinProofResult> {\n if (param.inNote1.amount <= 0n\n || param.inNote2.amount <= 0n\n || param.inNote3.amount <= 0n\n || param.outNote.amount != param.inNote1.amount + param.inNote2.amount + param.inNote3.amount) {\n throw new DarkSwapProofError(\"Invalid triple join amount\");\n }\n\n if (param.inNote1.asset.toLowerCase() !== param.inNote2.asset.toLowerCase()\n || param.inNote1.asset.toLowerCase() !== param.inNote3.asset.toLowerCase()\n || param.inNote1.asset.toLowerCase() !== param.outNote.asset.toLowerCase()) {\n throw new DarkSwapProofError(\"Invalid triple join asset\");\n }\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.signedMessage);\n\n const inNullifier1 = calcNullifier(param.inNote1.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const inNullifier2 = calcNullifier(param.inNote2.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const inNullifier3 = calcNullifier(param.inNote3.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const outNoteFooter = getNoteFooter(param.outNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n\n const addressMod = encodeAddress(param.address);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.TRIPLE_JOIN),\n inNullifier1,\n inNullifier2,\n inNullifier3,\n param.outNote.note,\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: TripleJoinProofInput = {\n merkle_root: param.merkleRoot,\n in_merkle_index_1: param.inMerkleIndex1,\n in_merkle_index_2: param.inMerkleIndex2,\n in_merkle_index_3: param.inMerkleIndex3,\n in_merkle_path_1: param.inMerklePath1.map((x) => bn_to_0xhex(BigInt(x))),\n in_merkle_path_2: param.inMerklePath2.map((x) => bn_to_0xhex(BigInt(x))),\n in_merkle_path_3: param.inMerklePath3.map((x) => bn_to_0xhex(BigInt(x))),\n\n address: bn_to_0xhex(addressMod),\n asset: bn_to_0xhex(encodeAddress(param.outNote.asset)),\n in_amount_1: bn_to_0xhex(param.inNote1.amount),\n in_amount_2: bn_to_0xhex(param.inNote2.amount),\n in_amount_3: bn_to_0xhex(param.inNote3.amount),\n in_rho_1: bn_to_0xhex(param.inNote1.rho),\n in_rho_2: bn_to_0xhex(param.inNote2.rho),\n in_rho_3: bn_to_0xhex(param.inNote3.rho),\n\n in_nullifier_1: bn_to_0xhex(inNullifier1),\n in_nullifier_2: bn_to_0xhex(inNullifier2),\n in_nullifier_3: bn_to_0xhex(inNullifier3),\n\n in_note_1: bn_to_0xhex(param.inNote1.note),\n in_note_2: bn_to_0xhex(param.inNote2.note),\n in_note_3: bn_to_0xhex(param.inNote3.note),\n\n out_note: bn_to_0xhex(param.outNote.note),\n out_rho: bn_to_0xhex(param.outNote.rho),\n out_note_footer: bn_to_0xhex(outNoteFooter),\n\n pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n signature: uint8ArrayToNumberArray(signature),\n };\n const proof = await generateProof(tripleJoinCircuit, inputs);\n return {\n ...proof,\n inNullifier1: inputs.in_nullifier_1,\n inNullifier2: inputs.in_nullifier_2,\n inNullifier3: inputs.in_nullifier_3,\n outNoteFooter: inputs.out_note_footer,\n }\n};","import { ethers } from 'ethers';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateTripleJoinProof, TripleJoinProofResult } from '../../proof/basic/tripleJoinProof';\nimport { generateKeyPair } from '../../proof/keyService';\nimport { createNote } from '../../proof/noteService';\nimport { DarkSwapNote } from '../../types';\nimport { hexlify32, isAddressEquals } from '../../utils/util';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { multiGetMerklePathAndRoot } from '../merkletree';\nimport { refineGasLimit } from '../../utils/gasUtil';\n\nclass TripleJoinContext extends BaseContext {\n private _inNote1?: DarkSwapNote;\n private _inNote2?: DarkSwapNote;\n private _inNote3?: DarkSwapNote;\n private _outNote?: DarkSwapNote;\n private _proof?: TripleJoinProofResult;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set inNote1(note: DarkSwapNote | undefined) {\n this._inNote1 = note;\n }\n\n get inNote1(): DarkSwapNote | undefined {\n return this._inNote1;\n }\n\n set inNote2(note: DarkSwapNote | undefined) {\n this._inNote2 = note;\n }\n\n get inNote2(): DarkSwapNote | undefined {\n return this._inNote2;\n }\n\n set inNote3(note: DarkSwapNote | undefined) {\n this._inNote3 = note;\n }\n\n get inNote3(): DarkSwapNote | undefined {\n return this._inNote3;\n }\n\n\n set outNote(note: DarkSwapNote | undefined) {\n this._outNote = note;\n }\n\n get outNote(): DarkSwapNote | undefined {\n return this._outNote;\n }\n\n set proof(proof: TripleJoinProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): TripleJoinProofResult | undefined {\n return this._proof;\n }\n}\n\nexport class TripleJoinService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public async prepare(\n address: string,\n inNote1: DarkSwapNote,\n inNote2: DarkSwapNote,\n inNote3: DarkSwapNote,\n signature: string\n ): Promise<{ context: TripleJoinContext; outNote: DarkSwapNote }> {\n if (!isAddressEquals(inNote1.asset, inNote2.asset)) {\n throw new DarkSwapError('inNote1 and inNote2 must have the same asset');\n }\n\n if (inNote1.note === inNote2.note) {\n throw new DarkSwapError('inNote1 and inNote2 must have different note');\n }\n\n const [pubKey] = await generateKeyPair(signature);\n const outNote = createNote(address, inNote1.asset, inNote1.amount + inNote2.amount + inNote3.amount, pubKey);\n const context = new TripleJoinContext(signature);\n context.inNote1 = inNote1;\n context.inNote2 = inNote2;\n context.inNote3 = inNote3;\n context.outNote = outNote;\n context.address = address;\n return { context, outNote };\n }\n\n private async generateProof(context: TripleJoinContext): Promise<void> {\n if (!context\n || !context.inNote1\n || !context.inNote2\n || !context.inNote3\n || !context.outNote\n || !context.address) {\n throw new DarkSwapError('Invalid context');\n }\n\n const merklePathes = await multiGetMerklePathAndRoot([context.inNote1.note, context.inNote2.note, context.inNote3.note], this._darkSwap);\n const path1 = merklePathes[0];\n const path2 = merklePathes[1];\n const path3 = merklePathes[2];\n\n const proof = await generateTripleJoinProof({\n inNote1: context.inNote1,\n inNote2: context.inNote2,\n inNote3: context.inNote3,\n outNote: context.outNote,\n merkleRoot: path1.root,\n inMerklePath1: path1.path,\n inMerkleIndex1: path1.index,\n inMerklePath2: path2.path,\n inMerkleIndex2: path2.index,\n inMerklePath3: path3.path,\n inMerkleIndex3: path3.index,\n signedMessage: context.signature,\n address: context.address,\n });\n context.merkleRoot = path1.root;\n context.proof = proof;\n }\n\n public async execute(context: TripleJoinContext): Promise<string> {\n await this.generateProof(context);\n if (!context\n || !context.inNote1\n || !context.inNote2\n || !context.inNote3\n || !context.outNote\n || !context.proof\n || !context.merkleRoot) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n this._darkSwap.signer\n );\n\n const joinArgs = [\n context.merkleRoot,\n [\n context.proof.inNullifier1,\n context.proof.inNullifier2,\n context.proof.inNullifier3\n ],\n hexlify32(context.outNote.note),\n context.proof.outNoteFooter,\n context.proof.proof\n ];\n\n const estimatedGas = await contract.join.estimateGas(...joinArgs);\n const gasLimit = refineGasLimit(estimatedGas);\n const tx = await contract.join(...joinArgs, { gasLimit });\n return tx.hash;\n }\n}\n","import { ethers } from 'ethers';\nimport DarkSwapFeeAssetManagerAbi from '../abis/DarkSwapFeeAssetManager.json';\nimport { DarkSwap } from '../darkSwap';\nimport { FEE_RATIO_PRECISION } from '../types';\n\nfunction getContract(address: string, darkSwap: DarkSwap) {\n const provider = darkSwap.provider;\n return new ethers.Contract(address, DarkSwapFeeAssetManagerAbi.abi, provider);\n}\n\nexport async function getFeeRatio(wallet: string, darkSwap: DarkSwap) {\n const contract = getContract(darkSwap.contracts.darkSwapFeeAssetManager, darkSwap);\n return await contract.getServiceFeePercentage(wallet);\n}\n\nexport function calcFeeAmount(amount: bigint, feeRatio: bigint) {\n return (amount * feeRatio + FEE_RATIO_PRECISION - 1n) / FEE_RATIO_PRECISION;\n}","import proCreateOrderCircuit from \"../../../circuits/pro/dark_swap_pro_create_order_compiled_circuit.json\";\nimport { calcFeeAmount } from \"../../../services/feeRatioService\";\nimport { BaseProofInput, BaseProofParam, BaseProofResult, DarkSwapNote, DarkSwapOrderNote, DarkSwapProofError, EMPTY_FOOTER, PROOF_DOMAIN } from \"../../../types\";\nimport { encodeAddress } from \"../../../utils/encoders\";\nimport { bn_to_0xhex, bn_to_hex } from \"../../../utils/formatters\";\nimport { mimc_bn254 } from \"../../../utils/mimc\";\nimport { uint8ArrayToNumberArray } from \"../../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../../baseProofService\";\nimport { generateKeyPair } from \"../../keyService\";\nimport { calcNullifier, getNoteFooter } from \"../../noteService\";\n\ntype ProCreateOrderProofInput = BaseProofInput & {\n merkle_root: string,\n merkle_index: number[],\n merkle_path: string[],\n\n out_note: string,\n out_rho: string,\n out_nullifier: string,\n out_amount: string,\n\n //fee\n fee_ratio: string,\n fee_amount: string,\n\n //new balance note\n change_note: string,\n change_rho: string,\n change_note_footer: string,\n change_amount: string,\n\n //order note swap out\n order_note: string,\n order_rho: string,\n order_note_footer: string,\n\n //note swap in\n order_asset: string,\n order_amount: string,\n in_asset: string,\n in_amount: string,\n}\n\nexport type ProCreateOrderProofParam = BaseProofParam & {\n merkleRoot: string,\n merkleIndex: number[],\n merklePath: string[],\n oldBalanceNote: DarkSwapNote,\n newBalanceNote: DarkSwapNote,\n orderNote: DarkSwapOrderNote,\n inAsset: string,\n inAmount: bigint,\n}\n\nexport type ProCreateOrderProofResult = BaseProofResult & {\n oldBalanceNullifier: string,\n newBalanceFooter: string,\n orderNoteFooter: string,\n}\n\nexport async function generateProCreateOrderProof(param: ProCreateOrderProofParam): Promise<ProCreateOrderProofResult> {\n if (param.orderNote.feeRatio < 0n) {\n throw new DarkSwapProofError(\"Invalid fee ratio\");\n }\n\n if (param.newBalanceNote.amount < 0n\n || param.oldBalanceNote.amount <= 0n\n || param.inAmount <= 0n\n || param.orderNote.amount <= 0n) {\n throw new DarkSwapProofError(\"Invalid note amount\");\n }\n\n if (param.orderNote.amount != param.oldBalanceNote.amount - param.newBalanceNote.amount) {\n throw new DarkSwapProofError(\"Invalid order amount\");\n }\n\n const feeAmount = calcFeeAmount(param.inAmount, param.orderNote.feeRatio);\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.signedMessage);\n\n let newBalanceFooter = EMPTY_FOOTER;\n if (param.newBalanceNote.amount != 0n) {\n newBalanceFooter = getNoteFooter(param.newBalanceNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n }\n\n const oldBalanceNullifier = calcNullifier(param.oldBalanceNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const orderNoteFooter = getNoteFooter(param.orderNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n\n const addressMod = encodeAddress(param.address);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.PRO_CREATE_ORDER),\n oldBalanceNullifier,\n param.orderNote.feeRatio,\n param.newBalanceNote.note,\n param.orderNote.note,\n encodeAddress(param.inAsset),\n param.inAmount\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: ProCreateOrderProofInput = {\n merkle_root: param.merkleRoot,\n merkle_index: param.merkleIndex,\n merkle_path: param.merklePath,\n\n address: bn_to_0xhex(addressMod),\n out_note: bn_to_0xhex(param.oldBalanceNote.note),\n out_rho: bn_to_0xhex(param.oldBalanceNote.rho),\n out_nullifier: bn_to_0xhex(oldBalanceNullifier),\n out_amount: bn_to_0xhex(param.oldBalanceNote.amount),\n fee_ratio: bn_to_0xhex(param.orderNote.feeRatio),\n fee_amount: bn_to_0xhex(feeAmount),\n\n change_note: bn_to_0xhex(param.newBalanceNote.note),\n change_rho: bn_to_0xhex(param.newBalanceNote.rho),\n change_note_footer: bn_to_0xhex(newBalanceFooter),\n change_amount: bn_to_0xhex(param.newBalanceNote.amount),\n\n order_note: bn_to_0xhex(param.orderNote.note),\n order_rho: bn_to_0xhex(param.orderNote.rho),\n order_note_footer: bn_to_0xhex(orderNoteFooter),\n order_asset: bn_to_0xhex(encodeAddress(param.orderNote.asset)),\n order_amount: bn_to_0xhex(param.orderNote.amount),\n in_asset: bn_to_0xhex(encodeAddress(param.inAsset)),\n in_amount: bn_to_0xhex(param.inAmount),\n\n pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n signature: uint8ArrayToNumberArray(signature),\n };\n const proof = await generateProof(proCreateOrderCircuit, inputs);\n return {\n ...proof,\n oldBalanceNullifier: inputs.out_nullifier,\n newBalanceFooter: inputs.change_note_footer,\n orderNoteFooter: inputs.order_note_footer,\n }\n};","import { ethers } from 'ethers';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateKeyPair } from '../../proof/keyService';\nimport { calcNullifier, createNote, createOrderNoteExt } from '../../proof/noteService';\nimport { generateProCreateOrderProof, ProCreateOrderProofResult } from '../../proof/pro/orders/createOrderProof';\nimport { DarkSwapMessage, DarkSwapNote, DarkSwapOrderNote, DarkSwapOrderNoteExt } from '../../types';\nimport { hexlify32 } from '../../utils/util';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { getFeeRatio } from '../feeRatioService';\nimport { getMerklePathAndRoot } from '../merkletree';\nimport { refineGasLimit } from '../../utils/gasUtil';\n\nclass ProCreateOrderContext extends BaseContext {\n private _orderNote?: DarkSwapOrderNote;\n private _oldBalance?: DarkSwapNote;\n private _newBalance?: DarkSwapNote;\n private _swapInAsset?: string;\n private _swapInAmount?: bigint;\n private _proof?: ProCreateOrderProofResult;\n private _feeAmount?: bigint;\n private _swapMessage?: DarkSwapMessage;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set orderNote(orderNote: DarkSwapOrderNote | undefined) {\n this._orderNote = orderNote;\n }\n\n get orderNote(): DarkSwapOrderNote | undefined {\n return this._orderNote;\n }\n\n set swapInAsset(swapInAsset: string | undefined) {\n this._swapInAsset = swapInAsset;\n }\n\n get swapInAsset(): string | undefined {\n return this._swapInAsset;\n }\n\n set swapInAmount(swapInAmount: bigint | undefined) {\n this._swapInAmount = swapInAmount;\n }\n\n get swapInAmount(): bigint | undefined {\n return this._swapInAmount;\n }\n\n set oldBalance(oldBalance: DarkSwapNote | undefined) {\n this._oldBalance = oldBalance;\n }\n\n get oldBalance(): DarkSwapNote | undefined {\n return this._oldBalance;\n }\n\n set newBalance(newBalance: DarkSwapNote | undefined) {\n this._newBalance = newBalance;\n }\n\n get newBalance(): DarkSwapNote | undefined {\n return this._newBalance;\n }\n\n set feeAmount(feeAmount: bigint | undefined) {\n this._feeAmount = feeAmount;\n }\n\n get feeAmount(): bigint | undefined {\n return this._feeAmount;\n }\n\n set proof(proof: ProCreateOrderProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): ProCreateOrderProofResult | undefined {\n return this._proof;\n }\n\n set swapMessage(swapMessage: DarkSwapMessage | undefined) {\n this._swapMessage = swapMessage;\n }\n\n get swapMessage(): DarkSwapMessage | undefined {\n return this._swapMessage;\n }\n}\n\nexport class ProCreateOrderService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public async prepare(\n address: string,\n orderAsset: string,\n orderAmount: bigint,\n swapInAsset: string,\n swapInAmount: bigint,\n balanceNote: DarkSwapNote,\n signature: string\n ): Promise<{ context: ProCreateOrderContext; orderNote: DarkSwapOrderNoteExt, newBalance: DarkSwapNote }> {\n const [pubKey] = await generateKeyPair(signature);\n const feeRatio = BigInt(await getFeeRatio(address, this._darkSwap));\n const orderNote = createOrderNoteExt(address, orderAsset, orderAmount, feeRatio, pubKey);\n const orderNullifier = hexlify32(calcNullifier(orderNote.rho, pubKey));\n const newBalance = createNote(address, orderAsset, balanceNote.amount - orderAmount, pubKey);\n const context = new ProCreateOrderContext(signature);\n context.orderNote = orderNote;\n context.swapInAsset = swapInAsset;\n context.swapInAmount = swapInAmount;\n context.oldBalance = balanceNote;\n context.newBalance = newBalance;\n context.address = address;\n return { context, orderNote: { ...orderNote, nullifier: orderNullifier }, newBalance };\n }\n\n private async generateProof(context: ProCreateOrderContext): Promise<void> {\n if (!context\n || !context.orderNote\n || !context.swapInAsset\n || !context.swapInAmount\n || !context.oldBalance\n || !context.newBalance\n || !context.address\n || !context.signature) {\n throw new DarkSwapError('Invalid context');\n }\n\n const { root, index, path } = await getMerklePathAndRoot(context.oldBalance.note, this._darkSwap);\n\n const proof = await generateProCreateOrderProof({\n merkleRoot: root,\n merkleIndex: index,\n merklePath: path,\n orderNote: context.orderNote,\n oldBalanceNote: context.oldBalance,\n newBalanceNote: context.newBalance,\n inAsset: context.swapInAsset,\n inAmount: context.swapInAmount,\n address: context.address,\n signedMessage: context.signature\n });\n context.merkleRoot = root;\n context.proof = proof;\n }\n\n public async execute(context: ProCreateOrderContext): Promise<string> {\n await this.generateProof(context);\n if (!context\n || !context.orderNote\n || !context.swapInAsset\n || !context.swapInAmount\n || !context.oldBalance\n || !context.newBalance\n || !context.proof) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n this._darkSwap.signer\n );\n\n const txData = [\n context.merkleRoot,\n context.proof.oldBalanceNullifier,\n hexlify32(context.newBalance.note),\n context.proof.newBalanceFooter,\n hexlify32(context.orderNote.note),\n context.proof.orderNoteFooter\n ];\n\n const estimatedGas = await contract.proCreateOrder.estimateGas(\n txData,\n context.proof.proof\n );\n\n const gasLimit = refineGasLimit(estimatedGas);\n \n const tx = await contract.proCreateOrder(\n txData,\n context.proof.proof,\n { gasLimit }\n );\n await tx.wait();\n return tx.hash;\n }\n}\n","import proCancelOrderCircuit from \"../../../circuits/pro/dark_swap_cancel_order_compiled_circuit.json\";\nimport { BaseProofInput, BaseProofParam, BaseProofResult, DarkSwapNote, DarkSwapOrderNote, DarkSwapProofError, EMPTY_NULLIFIER, PROOF_DOMAIN } from \"../../../types\";\nimport { encodeAddress } from \"../../../utils/encoders\";\nimport { bn_to_0xhex, bn_to_hex } from \"../../../utils/formatters\";\nimport { mimc_bn254 } from \"../../../utils/mimc\";\nimport { uint8ArrayToNumberArray } from \"../../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../../baseProofService\";\nimport { generateKeyPair } from \"../../keyService\";\nimport { calcNullifier, getNoteFooter } from \"../../noteService\";\n\n\ntype ProCancelOrderProofInput = BaseProofInput & {\n merkle_root: string,\n merkle_index: number[],\n merkle_path: string[],\n merkle_index_remaining: number[],\n merkle_path_remaining: string[],\n\n asset: string,\n\n //order note\n order_note: string,\n order_rho: string,\n order_nullifier: string,\n order_amount: string,\n fee_ratio: string,\n\n //account remaining note\n remaining_note: string,\n remaining_rho: string,\n remaining_nullifier: string,\n remaining_amount: string,\n\n //account available note after cancel\n account_note: string,\n account_rho: string,\n account_note_footer: string,\n}\n\nexport type ProCancelOrderProofParam = BaseProofParam & {\n merkleRoot: string,\n merkleIndex: number[],\n merklePath: string[],\n merkleIndexRemaining: number[],\n merklePathRemaining: string[],\n orderNote: DarkSwapOrderNote,\n oldBalanceNote: DarkSwapNote,\n newBalanceNote: DarkSwapNote,\n}\n\nexport type ProCancelOrderProofResult = BaseProofResult & {\n orderNullifier: string,\n oldBalanceNullifier: string,\n newBalanceNoteFooter: string,\n}\n\nexport async function generateProCancelOrderProof(param: ProCancelOrderProofParam): Promise<ProCancelOrderProofResult> {\n if (param.orderNote.amount <= 0n) {\n throw new DarkSwapProofError(\"Invalid order amount\");\n }\n\n if (param.oldBalanceNote.amount < 0n) {\n throw new DarkSwapProofError(\"Invalid old balance amount\");\n }\n if (param.newBalanceNote.amount < 0n) {\n throw new DarkSwapProofError(\"Invalid new balance amount\");\n }\n\n if (param.orderNote.amount != param.newBalanceNote.amount - param.oldBalanceNote.amount) {\n throw new DarkSwapProofError(\"Invalid order amount\");\n }\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.signedMessage);\n\n const orderNullifier = calcNullifier(param.orderNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n let oldBalanceNullifier = EMPTY_NULLIFIER;\n if (param.oldBalanceNote.amount != 0n) {\n oldBalanceNullifier = calcNullifier(param.oldBalanceNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n }\n const newBalanceNoteFooter = getNoteFooter(param.newBalanceNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n\n const addressMod = encodeAddress(param.address);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.PRO_CANCEL_ORDER),\n orderNullifier,\n param.orderNote.feeRatio,\n oldBalanceNullifier,\n param.newBalanceNote.note,\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: ProCancelOrderProofInput = {\n address: bn_to_0xhex(addressMod),\n merkle_root: param.merkleRoot,\n merkle_index: param.merkleIndex,\n merkle_path: param.merklePath.map((x) => bn_to_0xhex(BigInt(x))),\n merkle_index_remaining: param.merkleIndexRemaining,\n merkle_path_remaining: param.merklePathRemaining.map((x) => bn_to_0xhex(BigInt(x))),\n order_note: bn_to_0xhex(param.orderNote.note),\n order_rho: bn_to_0xhex(param.orderNote.rho),\n order_nullifier: bn_to_0xhex(orderNullifier),\n order_amount: bn_to_0xhex(param.orderNote.amount),\n fee_ratio: bn_to_0xhex(param.orderNote.feeRatio),\n\n remaining_note: bn_to_0xhex(param.oldBalanceNote.note),\n remaining_rho: bn_to_0xhex(param.oldBalanceNote.rho),\n remaining_nullifier: bn_to_0xhex(oldBalanceNullifier),\n remaining_amount: bn_to_0xhex(param.oldBalanceNote.amount),\n\n account_note: bn_to_0xhex(param.newBalanceNote.note),\n account_rho: bn_to_0xhex(param.newBalanceNote.rho),\n account_note_footer: bn_to_0xhex(newBalanceNoteFooter),\n\n asset: bn_to_0xhex(encodeAddress(param.orderNote.asset)),\n\n pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n signature: uint8ArrayToNumberArray(signature),\n };\n const proof = await generateProof(proCancelOrderCircuit, inputs);\n return {\n ...proof,\n orderNullifier: inputs.order_nullifier,\n oldBalanceNullifier: inputs.remaining_nullifier,\n newBalanceNoteFooter: inputs.account_note_footer,\n }\n};","import { ethers } from 'ethers';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateKeyPair } from '../../proof/keyService';\nimport { createNote } from '../../proof/noteService';\nimport { generateProCancelOrderProof, ProCancelOrderProofResult } from '../../proof/pro/orders/cancelOrderProof';\nimport { DarkSwapNote, DarkSwapOrderNote } from '../../types';\nimport { hexlify32 } from '../../utils/util';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { EMPTY_PATH, getMerklePathAndRoot, MerklePath, multiGetMerklePathAndRoot } from '../merkletree';\n\nclass ProCancelOrderContext extends BaseContext {\n private _orderNote?: DarkSwapOrderNote;\n private _oldBalance?: DarkSwapNote;\n private _newBalance?: DarkSwapNote;\n private _proof?: ProCancelOrderProofResult;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set orderNote(orderNote: DarkSwapOrderNote | undefined) {\n this._orderNote = orderNote;\n }\n\n get orderNote(): DarkSwapOrderNote | undefined {\n return this._orderNote;\n }\n\n set oldBalance(oldBalance: DarkSwapNote | undefined) {\n this._oldBalance = oldBalance;\n }\n\n get oldBalance(): DarkSwapNote | undefined {\n return this._oldBalance;\n }\n\n set newBalance(newBalance: DarkSwapNote | undefined) {\n this._newBalance = newBalance;\n }\n\n get newBalance(): DarkSwapNote | undefined {\n return this._newBalance;\n }\n\n set proof(proof: ProCancelOrderProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): ProCancelOrderProofResult | undefined {\n return this._proof;\n }\n}\n\nexport class ProCancelOrderService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public async prepare(\n address: string,\n orderNote: DarkSwapOrderNote,\n balanceNote: DarkSwapNote,\n signature: string\n ): Promise<{ context: ProCancelOrderContext; newBalance: DarkSwapNote }> {\n const [pubKey] = await generateKeyPair(signature);\n const newBalance = createNote(address, orderNote.asset, balanceNote.amount + orderNote.amount, pubKey);\n const context = new ProCancelOrderContext(signature);\n context.orderNote = orderNote;\n context.oldBalance = balanceNote;\n context.newBalance = newBalance;\n context.address = address;\n return { context, newBalance };\n }\n\n private async generateProof(context: ProCancelOrderContext): Promise<void> {\n if (!context\n || !context.orderNote\n || !context.oldBalance\n || !context.newBalance\n || !context.address\n || !context.signature) {\n throw new DarkSwapError('Invalid context');\n }\n\n let orderPath: MerklePath;\n let oldBalancePath: MerklePath;\n if (context.oldBalance.amount === 0n) {\n const path1 = await getMerklePathAndRoot(context.orderNote.note, this._darkSwap);\n orderPath = path1;\n oldBalancePath = EMPTY_PATH;\n } else {\n const merklePathes = await multiGetMerklePathAndRoot([context.orderNote.note, context.oldBalance.note], this._darkSwap);\n orderPath = merklePathes[0];\n oldBalancePath = merklePathes[1];\n }\n\n const proof = await generateProCancelOrderProof({\n merkleRoot: orderPath.root,\n merkleIndex: orderPath.index,\n merklePath: orderPath.path,\n merkleIndexRemaining: oldBalancePath.index,\n merklePathRemaining: oldBalancePath.path,\n orderNote: context.orderNote,\n oldBalanceNote: context.oldBalance,\n newBalanceNote: context.newBalance,\n address: context.address,\n signedMessage: context.signature,\n });\n context.merkleRoot = orderPath.root;\n context.proof = proof;\n }\n\n public async execute(context: ProCancelOrderContext): Promise<string> {\n await this.generateProof(context);\n if (!context\n || !context.orderNote\n || !context.oldBalance\n || !context.newBalance\n || !context.proof\n || !context.merkleRoot) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n this._darkSwap.signer\n );\n const tx = await contract.cancelOrder(\n context.merkleRoot,\n context.proof.orderNullifier,\n context.proof.oldBalanceNullifier,\n hexlify32(context.newBalance.note),\n context.proof.newBalanceNoteFooter,\n context.proof.proof\n );\n await tx.wait();\n return tx.hash;\n }\n}\n","import swapCircuit from \"../../../circuits/pro/dark_swap_pro_swap_compiled_circuit.json\";\nimport { BaseProofResult, DarkSwapMessage, DarkSwapNote, DarkSwapOrderNote, DarkSwapProofError, EMPTY_FOOTER, PROOF_DOMAIN } from \"../../../types\";\nimport { encodeAddress } from \"../../../utils/encoders\";\nimport { bn_to_0xhex, bn_to_hex } from \"../../../utils/formatters\";\nimport { mimc_bn254 } from \"../../../utils/mimc\";\nimport { hexStringToSignature, uint8ArrayToNumberArray } from \"../../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../../baseProofService\";\nimport { generateKeyPair } from \"../../keyService\";\nimport { calcNullifier, getNoteFooter } from \"../../noteService\";\n\ntype ProSwapProofInput = {\n merkle_root: string,\n\n // Alice input\n alice_merkle_index: number[],\n alice_merkle_path: string[],\n alice_address: string,\n alice_out_note: string,\n alice_out_amount: string,\n alice_out_rho: string,\n alice_out_nullifier: string,\n\n //Alice fee\n alice_fee_ratio: string,\n alice_fee_amount: string,\n\n // Alice output\n alice_in_note: string,\n alice_in_rho: string,\n alice_in_note_footer: string,\n\n alice_change_note: string,\n alice_change_rho: string,\n alice_change_note_footer: string,\n\n // Alice pub key and signature\n alice_pub_key: string[],\n alice_signature: any,\n\n //Bob order\n bob_out_asset: string,\n bob_out_amount: string,\n bob_in_asset: string,\n bob_in_amount: string,\n\n // Bob input\n bob_merkle_index: number[],\n bob_merkle_path: string[],\n bob_address: string,\n bob_out_note: string,\n\n bob_out_rho: string,\n bob_out_nullifier: string,\n\n //bob fee\n bob_fee_ratio: string,\n bob_fee_amount: string,\n\n // Bob output\n bob_in_note: string,\n bob_in_rho: string,\n bob_in_note_footer: string,\n\n // Bob pub key and signature\n bob_pub_key: string[],\n bob_signature: any,\n}\n\nexport type ProSwapProofParam = {\n merkleRoot: string,\n aliceMerkleIndex: number[],\n aliceMerklePath: string[],\n aliceAddress: string,\n aliceOrderNote: DarkSwapOrderNote,\n aliceFeeAmount: bigint,\n aliceInNote: DarkSwapNote,\n aliceChangeNote: DarkSwapNote,\n aliceSignedMessage: string,\n\n bobMerkleIndex: number[],\n bobMerklePath: string[],\n bobAddress: string,\n bobMessage: DarkSwapMessage,\n}\n\nexport type ProSwapProofResult = BaseProofResult & {\n aliceOutNullifier: string,\n aliceInNoteFooter: string,\n aliceChangeNoteFooter: string,\n bobOutNullifier: string,\n bobInNoteFooter: string,\n}\n\nexport async function generateProSwapProof(param: ProSwapProofParam): Promise<ProSwapProofResult> {\n if (param.aliceOrderNote.feeRatio < 0n\n || param.bobMessage.orderNote.feeRatio < 0n) {\n throw new DarkSwapProofError(\"Invalid fee ratio\");\n }\n\n if (param.aliceChangeNote.amount < 0n\n || param.aliceOrderNote.amount <= 0n\n || param.aliceInNote.amount <= 0n\n || param.bobMessage.inNote.amount <= 0n\n || param.bobMessage.orderNote.amount <= 0n) {\n throw new DarkSwapProofError(\"Invalid note amount\");\n }\n\n if (param.aliceOrderNote.amount != param.aliceChangeNote.amount + param.bobMessage.inNote.amount + param.bobMessage.feeAmount\n || param.bobMessage.orderNote.amount != param.aliceInNote.amount + param.aliceFeeAmount) {\n throw new DarkSwapProofError(\"Invalid order amount\");\n }\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.aliceSignedMessage);\n\n const aliceOrderNoteNullifier = calcNullifier(param.aliceOrderNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const aliceInNoteFooter = getNoteFooter(param.aliceInNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const aliceChangeNoteFooter = param.aliceChangeNote.amount == 0n ? EMPTY_FOOTER : getNoteFooter(param.aliceChangeNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const bobOrderNoteNullifier = calcNullifier(param.bobMessage.orderNote.rho, param.bobMessage.publicKey);\n const bobInNoteFooter = getNoteFooter(param.bobMessage.inNote.rho, param.bobMessage.publicKey);\n\n const aliceAddressMod = encodeAddress(param.aliceAddress);\n const bobAddressMod = encodeAddress(param.bobAddress);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.PRO_SWAP),\n aliceOrderNoteNullifier,\n param.aliceOrderNote.feeRatio,\n param.bobMessage.orderNote.feeRatio,\n bobOrderNoteNullifier,\n param.aliceInNote.note,\n param.aliceChangeNote.note,\n param.bobMessage.inNote.note\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: ProSwapProofInput = {\n merkle_root: param.merkleRoot,\n alice_merkle_index: param.aliceMerkleIndex,\n alice_merkle_path: param.aliceMerklePath,\n alice_address: bn_to_0xhex(aliceAddressMod),\n alice_out_note: bn_to_0xhex(param.aliceOrderNote.note),\n alice_out_rho: bn_to_0xhex(param.aliceOrderNote.rho),\n alice_out_nullifier: bn_to_0xhex(aliceOrderNoteNullifier),\n alice_out_amount: bn_to_0xhex(param.aliceOrderNote.amount),\n alice_fee_ratio: bn_to_0xhex(param.aliceOrderNote.feeRatio),\n alice_fee_amount: bn_to_0xhex(param.aliceFeeAmount),\n\n alice_in_note: bn_to_0xhex(param.aliceInNote.note),\n alice_in_rho: bn_to_0xhex(param.aliceInNote.rho),\n alice_in_note_footer: bn_to_0xhex(aliceInNoteFooter),\n\n alice_change_note: bn_to_0xhex(param.aliceChangeNote.note),\n alice_change_rho: bn_to_0xhex(param.aliceChangeNote.rho),\n alice_change_note_footer: bn_to_0xhex(aliceChangeNoteFooter),\n\n alice_pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n alice_signature: uint8ArrayToNumberArray(signature),\n\n bob_out_asset: bn_to_0xhex(encodeAddress(param.bobMessage.orderNote.asset)),\n bob_out_amount: bn_to_0xhex(param.bobMessage.orderNote.amount),\n bob_in_asset: bn_to_0xhex(encodeAddress(param.bobMessage.inNote.asset)),\n bob_in_amount: bn_to_0xhex(param.bobMessage.inNote.amount + param.bobMessage.feeAmount),\n\n bob_merkle_index: param.bobMerkleIndex,\n bob_merkle_path: param.bobMerklePath,\n bob_address: bn_to_0xhex(bobAddressMod),\n\n bob_out_note: bn_to_0xhex(param.bobMessage.orderNote.note),\n bob_out_rho: bn_to_0xhex(param.bobMessage.orderNote.rho),\n bob_out_nullifier: bn_to_0xhex(bobOrderNoteNullifier),\n bob_fee_ratio: bn_to_0xhex(param.bobMessage.orderNote.feeRatio),\n bob_fee_amount: bn_to_0xhex(param.bobMessage.feeAmount),\n\n bob_in_note: bn_to_0xhex(param.bobMessage.inNote.note),\n bob_in_rho: bn_to_0xhex(param.bobMessage.inNote.rho),\n bob_in_note_footer: bn_to_0xhex(bobInNoteFooter),\n\n bob_pub_key: [param.bobMessage.publicKey[0].toString(), param.bobMessage.publicKey[1].toString()],\n bob_signature: uint8ArrayToNumberArray(hexStringToSignature(param.bobMessage.signature)),\n };\n const proof = await generateProof(swapCircuit, inputs);\n return {\n ...proof,\n aliceOutNullifier: inputs.alice_out_nullifier,\n aliceInNoteFooter: inputs.alice_in_note_footer,\n aliceChangeNoteFooter: inputs.alice_change_note_footer,\n bobOutNullifier: inputs.bob_out_nullifier,\n bobInNoteFooter: inputs.bob_in_note_footer,\n }\n};","import { BaseProofInput, BaseProofParam, BaseProofResult, DarkSwapMessage, DarkSwapNote, DarkSwapOrderNote, DarkSwapProofError, PROOF_DOMAIN } from \"../../types\";\nimport { encodeAddress } from \"../../utils/encoders\";\nimport { bn_to_0xhex } from \"../../utils/formatters\";\nimport { bn_to_hex } from \"../../utils/formatters\";\nimport { mimc_bn254 } from \"../../utils/mimc\";\nimport { signatureToHexString, uint8ArrayToNumberArray } from \"../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../baseProofService\";\nimport { generateKeyPair } from \"../keyService\";\nimport { calcNullifier, getNoteFooter } from \"../noteService\";\nimport retailCreateOrderCircuit from \"../../circuits/retail/dark_swap_retail_deposit_create_order_compiled_circuit.json\";\nimport { Fr } from \"../../aztec/fields/fields\";\n\ntype RetailCreateOrderProofInput = BaseProofInput & {\n deposit_out_note: string,\n deposit_out_nullifier: string,\n deposit_out_note_footer: string,\n deposit_out_rho: string,\n\n //order\n out_asset: string,\n out_amount: string,\n in_asset: string,\n in_amount: string,\n\n //fee\n fee_ratio: string,\n fee_amount: string,\n\n //swap in \n in_note: string,\n in_note_footer: string,\n in_rho: string,\n}\n\nexport type RetailCreateOrderProofParam = BaseProofParam & {\n depositNote: DarkSwapOrderNote,\n swapInNote: DarkSwapNote,\n feeAmount: bigint\n}\n\nexport type RetailCreateOrderProofResult = BaseProofResult & {\n depositNullifier: string,\n depositFooter: string,\n swapInNoteFooter: string,\n}\n\nexport async function generateRetailSwapMessage(\n address: string,\n orderNote: DarkSwapOrderNote,\n swapInNote: DarkSwapNote,\n feeAmount: bigint,\n pubKey: [Fr, Fr],\n privKey: Fr\n): Promise<DarkSwapMessage> {\n\n const addressMod = encodeAddress(address);\n const orderNoteNullifier = calcNullifier(orderNote.rho, pubKey);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.RETAIL_CREATE_ORDER),\n addressMod,\n orderNoteNullifier,\n orderNote.feeRatio,\n swapInNote.note,\n ]));\n const signature = await signMessage(message, privKey);\n\n return {\n address: address,\n orderNote: orderNote,\n orderNullifier: bn_to_0xhex(orderNoteNullifier),\n inNote: swapInNote,\n feeAmount: feeAmount,\n publicKey: pubKey,\n signature: signatureToHexString(signature),\n }\n}\n\nexport async function generateRetailCreateOrderProof(param: RetailCreateOrderProofParam): Promise<RetailCreateOrderProofResult> {\n if (param.depositNote.amount <= 0n) {\n throw new DarkSwapProofError(\"Deposit amount must be greater than 0\");\n }\n\n if (param.depositNote.feeRatio < 0n) {\n throw new DarkSwapProofError(\"Fee ratio must be greater or equal to 0\");\n }\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.signedMessage);\n\n const depositNullifier = calcNullifier(param.depositNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const depositFooter = getNoteFooter(param.depositNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const inAmount = param.feeAmount + param.swapInNote.amount;\n\n const swapInNoteFooter = getNoteFooter(param.swapInNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n\n const addressMod = encodeAddress(param.address);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.RETAIL_CREATE_ORDER),\n addressMod,\n param.depositNote.note,\n param.depositNote.feeRatio,\n param.swapInNote.note,\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: RetailCreateOrderProofInput = {\n address: bn_to_0xhex(addressMod),\n deposit_out_note: bn_to_0xhex(param.depositNote.note),\n deposit_out_nullifier: bn_to_0xhex(depositNullifier),\n deposit_out_note_footer: bn_to_0xhex(depositFooter),\n deposit_out_rho: bn_to_0xhex(param.depositNote.rho),\n\n out_asset: bn_to_0xhex(encodeAddress(param.depositNote.asset)),\n out_amount: bn_to_0xhex(param.depositNote.amount),\n in_asset: bn_to_0xhex(encodeAddress(param.swapInNote.asset)),\n in_amount: bn_to_0xhex(inAmount),\n\n in_note: bn_to_0xhex(param.swapInNote.note),\n in_note_footer: bn_to_0xhex(swapInNoteFooter),\n in_rho: bn_to_0xhex(param.swapInNote.rho),\n fee_ratio: bn_to_0xhex(param.depositNote.feeRatio),\n fee_amount: bn_to_0xhex(param.feeAmount),\n\n pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n signature: uint8ArrayToNumberArray(signature),\n };\n const proof = await generateProof(retailCreateOrderCircuit, inputs);\n return {\n ...proof,\n depositNullifier: inputs.deposit_out_nullifier,\n depositFooter: inputs.deposit_out_note_footer,\n swapInNoteFooter: inputs.in_note_footer,\n }\n};","import { ethers } from 'ethers';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateKeyPair } from '../../proof/keyService';\nimport { createNote, EMPTY_NOTE } from '../../proof/noteService';\nimport { generateProSwapProof, ProSwapProofResult } from '../../proof/pro/orders/swapProof';\nimport { DarkSwapMessage, DarkSwapNote, DarkSwapOrderNote } from '../../types';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { multiGetMerklePathAndRoot } from '../merkletree';\nimport { hexlify32 } from '../../utils/util';\nimport { generateRetailSwapMessage } from '../../proof/retail/depositOrderProof';\nimport { calcFeeAmount } from '../feeRatioService';\n\nclass ProSwapContext extends BaseContext {\n private _orderNote?: DarkSwapOrderNote;\n private _changeNote?: DarkSwapNote;\n private _swapInNote?: DarkSwapNote;\n private _proof?: ProSwapProofResult;\n private _bobAddress?: string;\n private _bobSwapMessage?: DarkSwapMessage;\n private _aliceFeeAmount?: bigint;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set orderNote(orderNote: DarkSwapOrderNote | undefined) {\n this._orderNote = orderNote;\n }\n\n get orderNote(): DarkSwapOrderNote | undefined {\n return this._orderNote;\n }\n\n set changeNote(changeNote: DarkSwapNote | undefined) {\n this._changeNote = changeNote;\n }\n\n get changeNote(): DarkSwapNote | undefined {\n return this._changeNote;\n }\n\n set swapInNote(swapInNote: DarkSwapNote | undefined) {\n this._swapInNote = swapInNote;\n }\n\n get swapInNote(): DarkSwapNote | undefined {\n return this._swapInNote;\n }\n\n set aliceFeeAmount(aliceFeeAmount: bigint | undefined) {\n this._aliceFeeAmount = aliceFeeAmount;\n }\n\n get aliceFeeAmount(): bigint | undefined {\n return this._aliceFeeAmount;\n }\n\n set proof(proof: ProSwapProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): ProSwapProofResult | undefined {\n return this._proof;\n }\n\n set bobSwapMessage(bobSwapMessage: DarkSwapMessage | undefined) {\n this._bobSwapMessage = bobSwapMessage;\n }\n\n get bobSwapMessage(): DarkSwapMessage | undefined {\n return this._bobSwapMessage;\n }\n\n set bobAddress(bobAddress: string | undefined) {\n this._bobAddress = bobAddress;\n }\n\n get bobAddress(): string | undefined {\n return this._bobAddress;\n }\n}\n\nexport class ProSwapService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public static async prepareProSwapMessageForBob(\n address: string,\n orderNote: DarkSwapOrderNote,\n swapInAmount: bigint,\n swapInAsset: string,\n signature: string\n ): Promise<DarkSwapMessage> {\n const [pubKey, privKey] = await generateKeyPair(signature);\n const feeAmount = calcFeeAmount(swapInAmount, orderNote.feeRatio);\n const swapInNote = createNote(address, swapInAsset, swapInAmount - feeAmount, pubKey);\n const darkSwapMessage = await generateRetailSwapMessage(address, orderNote, swapInNote, feeAmount, pubKey, privKey);\n return darkSwapMessage;\n }\n\n public async prepare(\n address: string,\n orderNote: DarkSwapOrderNote,\n bobAddress: string,\n bobSwapMessage: DarkSwapMessage,\n signature: string\n ): Promise<{ context: ProSwapContext; swapInNote: DarkSwapNote, changeNote: DarkSwapNote, feeAmount: bigint }> {\n const [pubKey] = await generateKeyPair(signature);\n const swapOutAmount = bobSwapMessage.feeAmount + bobSwapMessage.inNote.amount;\n const swapInAmount = bobSwapMessage.orderNote.amount;\n const aliceFeeAmount = calcFeeAmount(swapInAmount, orderNote.feeRatio);\n const changeAmount = orderNote.amount - swapOutAmount;\n const changeNote = changeAmount == 0n ? EMPTY_NOTE : createNote(address, orderNote.asset, changeAmount, pubKey);\n const swapInNote = createNote(address, bobSwapMessage.orderNote.asset, swapInAmount - aliceFeeAmount, pubKey);\n\n const context = new ProSwapContext(signature);\n context.orderNote = orderNote;\n context.swapInNote = swapInNote;\n context.changeNote = changeNote;\n context.aliceFeeAmount = aliceFeeAmount;\n context.address = address;\n context.bobAddress = bobAddress;\n context.bobSwapMessage = bobSwapMessage;\n return { context, swapInNote, changeNote, feeAmount: aliceFeeAmount };\n }\n\n private async generateProof(context: ProSwapContext): Promise<void> {\n if (!context\n || !context.orderNote\n || !context.swapInNote\n || !context.changeNote\n || !context.address\n || !context.signature\n || !context.bobSwapMessage\n || !context.bobAddress) {\n throw new DarkSwapError('Invalid context');\n }\n\n const merklePathes = await multiGetMerklePathAndRoot([context.orderNote.note, context.bobSwapMessage.orderNote.note], this._darkSwap);\n const orderNotePath = merklePathes[0];\n const bobOrderNotePath = merklePathes[1];\n\n const proof = await generateProSwapProof({\n merkleRoot: orderNotePath.root,\n aliceAddress: context.address,\n aliceMerkleIndex: orderNotePath.index,\n aliceMerklePath: orderNotePath.path,\n aliceOrderNote: context.orderNote,\n aliceChangeNote: context.changeNote,\n aliceInNote: context.swapInNote,\n aliceFeeAmount: context.aliceFeeAmount!,\n aliceSignedMessage: context.signature,\n bobAddress: context.bobAddress,\n bobMerkleIndex: bobOrderNotePath.index,\n bobMerklePath: bobOrderNotePath.path,\n bobMessage: context.bobSwapMessage,\n });\n context.merkleRoot = orderNotePath.root;\n context.proof = proof;\n }\n\n public async execute(context: ProSwapContext): Promise<string> {\n await this.generateProof(context);\n if (!context\n || !context.orderNote\n || !context.swapInNote\n || !context.changeNote\n || !context.proof\n || !context.bobSwapMessage\n || !context.bobAddress) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n this._darkSwap.signer\n );\n\n const swapArgs = [\n context.merkleRoot,\n context.proof.aliceOutNullifier,\n hexlify32(context.orderNote.feeRatio),\n hexlify32(context.swapInNote.note),\n context.proof.aliceInNoteFooter,\n hexlify32(context.changeNote.note),\n context.proof.aliceChangeNoteFooter,\n context.proof.bobOutNullifier,\n hexlify32(context.bobSwapMessage.orderNote.feeRatio),\n hexlify32(context.bobSwapMessage.inNote.note),\n context.proof.bobInNoteFooter\n ];\n\n const estimatedGas = await contract.proSwap.estimateGas(\n swapArgs,\n context.proof.proof\n );\n\n const tx = await contract.proSwap(\n swapArgs,\n context.proof.proof,\n { gasLimit: estimatedGas }\n );\n await tx.wait();\n return tx.hash;\n }\n}\n","import retailCancelOrderCircuit from \"../../circuits/retail/dark_swap_cancel_order_withdraw_compiled_circuit.json\";\nimport { BaseProofInput, BaseProofParam, BaseProofResult, DarkSwapOrderNote, DarkSwapProofError, PROOF_DOMAIN } from \"../../types\";\nimport { encodeAddress } from \"../../utils/encoders\";\nimport { bn_to_0xhex, bn_to_hex } from \"../../utils/formatters\";\nimport { mimc_bn254 } from \"../../utils/mimc\";\nimport { uint8ArrayToNumberArray } from \"../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../baseProofService\";\nimport { generateKeyPair } from \"../keyService\";\nimport { calcNullifier } from \"../noteService\";\n\n\ntype RetailCancelOrderProofInput = BaseProofInput & {\n merkle_root: string,\n merkle_index: number[],\n merkle_path: string[],\n //order note\n out_note: string,\n out_asset: string,\n out_amount: string,\n out_rho: string,\n out_nullifier: string,\n fee_ratio: string,\n}\n\nexport type RetailCancelOrderProofParam = BaseProofParam & {\n merkleRoot: string,\n merkleIndex: number[],\n merklePath: string[],\n orderNote: DarkSwapOrderNote,\n}\n\nexport type RetailCancelOrderProofResult = BaseProofResult & {\n nullifier: string,\n}\n\nexport async function generateRetailCancelOrderProof(param: RetailCancelOrderProofParam): Promise<RetailCancelOrderProofResult> {\n if (param.orderNote.amount <= 0n) {\n throw new DarkSwapProofError(\"Order amount must be greater than 0\");\n }\n\n if (param.orderNote.feeRatio < 0n) {\n throw new DarkSwapProofError(\"Fee ratio must be greater or equal to 0\");\n }\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.signedMessage);\n\n const nullifier = calcNullifier(param.orderNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n\n const addressMod = encodeAddress(param.address);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.RETAIL_CANCEL_ORDER),\n addressMod,\n nullifier,\n param.orderNote.feeRatio,\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: RetailCancelOrderProofInput = {\n address: bn_to_0xhex(addressMod),\n merkle_root: param.merkleRoot,\n merkle_index: param.merkleIndex,\n merkle_path: param.merklePath.map((x) => bn_to_0xhex(BigInt(x))),\n out_note: bn_to_0xhex(param.orderNote.note),\n out_asset: bn_to_0xhex(encodeAddress(param.orderNote.asset)),\n out_amount: bn_to_0xhex(param.orderNote.amount),\n out_rho: bn_to_0xhex(param.orderNote.rho),\n out_nullifier: bn_to_0xhex(nullifier),\n fee_ratio: bn_to_0xhex(param.orderNote.feeRatio),\n\n pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n signature: uint8ArrayToNumberArray(signature),\n };\n const proof = await generateProof(retailCancelOrderCircuit, inputs);\n return {\n ...proof,\n nullifier: inputs.out_nullifier,\n }\n};","import { ethers } from 'ethers';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateRetailCancelOrderProof, RetailCancelOrderProofResult } from '../../proof/retail/cancelOrderProof';\nimport { DarkSwapOrderNote } from '../../types';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { getMerklePathAndRoot } from '../merkletree';\nimport { hexlify32 } from '../../utils/util';\n\nclass RetailCancelOrderContext extends BaseContext {\n private _orderNote?: DarkSwapOrderNote;\n private _proof?: RetailCancelOrderProofResult;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set orderNote(orderNote: DarkSwapOrderNote | undefined) {\n this._orderNote = orderNote;\n }\n\n get orderNote(): DarkSwapOrderNote | undefined {\n return this._orderNote;\n }\n\n set proof(proof: RetailCancelOrderProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): RetailCancelOrderProofResult | undefined {\n return this._proof;\n }\n}\n\nexport class RetailCancelOrderService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public async prepare(\n address: string,\n orderNote: DarkSwapOrderNote,\n signature: string\n ): Promise<{ context: RetailCancelOrderContext }> {\n const context = new RetailCancelOrderContext(signature);\n context.orderNote = orderNote;\n context.address = address;\n return { context };\n }\n\n private async generateProof(context: RetailCancelOrderContext): Promise<void> {\n if (!context\n || !context.orderNote\n || !context.address\n || !context.signature) {\n throw new DarkSwapError('Invalid context');\n }\n\n const { root, index, path } = await getMerklePathAndRoot(context.orderNote.note, this._darkSwap);\n\n const proof = await generateRetailCancelOrderProof({\n merkleRoot: root,\n merkleIndex: index,\n merklePath: path,\n orderNote: context.orderNote,\n address: context.address,\n signedMessage: context.signature,\n });\n context.merkleRoot = root;\n context.proof = proof;\n }\n\n public async execute(context: RetailCancelOrderContext): Promise<string> {\n await this.generateProof(context);\n if (!context || !context.orderNote || !context.proof) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n this._darkSwap.signer\n );\n const tx = await contract.cancelOrderWithdraw(\n context.merkleRoot,\n context.orderNote.asset,\n hexlify32(context.orderNote.amount),\n context.proof.nullifier,\n context.proof.proof\n );\n await tx.wait();\n return tx.hash;\n }\n}\n","import { ethers } from 'ethers';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateKeyPair } from '../../proof/keyService';\nimport { createNote, createOrderNoteExt, validateOrderNoteWithPubKey } from '../../proof/noteService';\nimport { generateRetailCreateOrderProof, generateRetailSwapMessage, RetailCreateOrderProofResult } from '../../proof/retail/depositOrderProof';\nimport { DarkSwapMessage, DarkSwapNote, DarkSwapOrderNote } from '../../types';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { calcFeeAmount, getFeeRatio } from '../feeRatioService';\nimport { hexlify32 } from '../../utils/util';\nimport { bn_to_0xhex } from '../../utils/formatters';\nimport { isNativeAsset } from '../../utils/util';\nimport { getConfirmations, legacyTokenConfig } from '../../config';\nimport { MAX_ALLOWANCE } from '../../utils/constants';\nimport ERC20Abi from '../../abis/IERC20.json';\nimport ERC20_USDT from '../../abis/IERC20_USDT.json';\n\nclass RetailCreateOrderContext extends BaseContext {\n private _orderNote?: DarkSwapOrderNote;\n private _swapInNote?: DarkSwapNote;\n private _proof?: RetailCreateOrderProofResult;\n private _feeAmount?: bigint;\n private _swapMessage?: DarkSwapMessage;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set orderNote(orderNote: DarkSwapOrderNote | undefined) {\n this._orderNote = orderNote;\n }\n\n get orderNote(): DarkSwapOrderNote | undefined {\n return this._orderNote;\n }\n\n set swapInNote(swapInNote: DarkSwapNote | undefined) {\n this._swapInNote = swapInNote;\n }\n\n get swapInNote(): DarkSwapNote | undefined {\n return this._swapInNote;\n }\n\n set feeAmount(feeAmount: bigint | undefined) {\n this._feeAmount = feeAmount;\n }\n\n get feeAmount(): bigint | undefined {\n return this._feeAmount;\n }\n\n set proof(proof: RetailCreateOrderProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): RetailCreateOrderProofResult | undefined {\n return this._proof;\n }\n\n set swapMessage(swapMessage: DarkSwapMessage | undefined) {\n this._swapMessage = swapMessage;\n }\n\n get swapMessage(): DarkSwapMessage | undefined {\n return this._swapMessage;\n }\n}\n\nexport class RetailCreateOrderService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public async rebuildContextFromSwapMessage(swapMessage: DarkSwapMessage, signature: string) {\n const [pubKey] = await generateKeyPair(signature);\n //validate the swapMessage is by this signature\n if(!validateOrderNoteWithPubKey(swapMessage.orderNote, pubKey)) {\n throw new DarkSwapError('SwapMessage does not belong to this wallet');\n }\n const context = new RetailCreateOrderContext(signature);\n context.orderNote = swapMessage.orderNote;\n context.swapInNote = swapMessage.inNote;\n context.feeAmount = swapMessage.feeAmount;\n context.address = swapMessage.address;\n await this.generateProof(context);\n return context;\n }\n\n public async prepare(\n address: string,\n depositAsset: string,\n depositAmount: bigint,\n swapInAsset: string,\n swapInAmount: bigint,\n signature: string\n ): Promise<{ context: RetailCreateOrderContext; swapMessage: DarkSwapMessage }> {\n const [pubKey, privKey] = await generateKeyPair(signature);\n const feeRatio = BigInt(await getFeeRatio(address, this._darkSwap));\n const orderNote = createOrderNoteExt(address, depositAsset, depositAmount, feeRatio, pubKey);\n const feeAmount = calcFeeAmount(swapInAmount, feeRatio);\n const realSwapInAmount = swapInAmount - feeAmount\n const swapInNote = createNote(address, swapInAsset, realSwapInAmount, pubKey);\n const context = new RetailCreateOrderContext(signature);\n context.orderNote = orderNote;\n context.swapInNote = swapInNote;\n context.feeAmount = feeAmount;\n context.address = address;\n\n const swapMessage = await generateRetailSwapMessage(address, orderNote, swapInNote, feeAmount, pubKey, privKey);\n context.swapMessage = swapMessage;\n return { context, swapMessage };\n }\n\n private async generateProof(context: RetailCreateOrderContext): Promise<void> {\n if (!context\n || !context.orderNote\n || !context.swapInNote\n || !context.address\n || !context.feeAmount\n || !context.signature) {\n throw new DarkSwapError('Invalid context');\n }\n\n const proof = await generateRetailCreateOrderProof({\n depositNote: context.orderNote,\n swapInNote: context.swapInNote,\n address: context.address,\n signedMessage: context.signature,\n feeAmount: context.feeAmount\n });\n context.proof = proof;\n }\n\n public async allowance(context: RetailCreateOrderContext) {\n if (!context || !context.orderNote || !context.address || !context.signature || !context.proof) {\n throw new DarkSwapError('Invalid context');\n }\n if (isNativeAsset(context.orderNote.asset)) {\n return;\n }\n const signer = this._darkSwap.signer;\n const asset = context.orderNote.asset;\n const amount = context.orderNote.amount;\n const allowanceContract = new ethers.Contract(asset, ERC20Abi.abi, this._darkSwap);\n const allowance = await allowanceContract.allowance(\n signer.getAddress(),\n this._darkSwap.contracts.darkSwapAssetManager\n );\n if (BigInt(allowance) < amount) {\n const isLegacy =\n legacyTokenConfig.hasOwnProperty(this._darkSwap.chainId) &&\n legacyTokenConfig[this._darkSwap.chainId].includes(asset.toLowerCase());\n const contract = new ethers.Contract(asset, isLegacy ? ERC20_USDT.abi : ERC20Abi.abi, signer);\n const tx = await contract.approve(this._darkSwap.contracts.darkSwapAssetManager, hexlify32(MAX_ALLOWANCE));\n await tx.wait(getConfirmations(this._darkSwap.chainId));\n }\n }\n\n public async execute(context: RetailCreateOrderContext): Promise<string> {\n await this.generateProof(context);\n if (!context || !context.orderNote || !context.swapInNote || !context.proof) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n this._darkSwap.signer\n );\n let ethAmount = 0n;\n if (isNativeAsset(context.orderNote.asset)) {\n ethAmount = context.orderNote.amount;\n } else {\n await this.allowance(context);\n }\n const tx = await contract.retailDepositCreateOrder(\n [\n hexlify32(context.orderNote.note),\n context.proof.depositFooter,\n context.orderNote.asset,\n bn_to_0xhex(context.orderNote.amount),\n hexlify32(context.swapInNote.note),\n context.proof.swapInNoteFooter\n ],\n context.proof.proof,\n {\n value: bn_to_0xhex(ethAmount)\n }\n );\n await tx.wait();\n return tx.hash;\n }\n}\n","import retailSwapCircuit from \"../../circuits/retail/dark_swap_retail_swap_compiled_circuit.json\";\nimport { BaseProofResult, DarkSwapMessage, DarkSwapProofError } from \"../../types\";\nimport { encodeAddress } from \"../../utils/encoders\";\nimport { bn_to_0xhex } from \"../../utils/formatters\";\nimport { hexStringToSignature, uint8ArrayToNumberArray } from \"../../utils/proofUtils\";\nimport { generateProof } from \"../baseProofService\";\nimport { calcNullifier, getNoteFooter } from \"../noteService\";\n\ntype RetailSwapProofInput = {\n merkle_root: string,\n\n // Alice input\n alice_merkle_index: number[],\n alice_merkle_path: string[],\n alice_address: string,\n alice_out_note: string,\n alice_out_rho: string,\n alice_out_nullifier: string,\n\n //Alice fee\n alice_fee_ratio: string,\n alice_fee_amount: string,\n\n // Alice output\n alice_in_note: string,\n alice_in_rho: string,\n alice_in_note_footer: string,\n\n // Alice pub key and signature\n alice_pub_key: string[],\n alice_signature: any,\n\n //order\n alice_out_asset: string,\n alice_out_amount: string,\n alice_in_asset: string,\n alice_in_amount: string,\n\n // Bob input\n bob_merkle_index: number[],\n bob_merkle_path: string[],\n bob_address: string,\n bob_out_note: string,\n bob_out_rho: string,\n bob_out_nullifier: string,\n\n //bob fee\n bob_fee_ratio: string,\n bob_fee_amount: string,\n\n // Bob output\n bob_in_note: string,\n bob_in_rho: string,\n bob_in_note_footer: string,\n\n // Bob pub key and signature\n bob_pub_key: string[],\n bob_signature: any,\n}\n\nexport type RetailSwapProofParam = {\n merkleRoot: string,\n aliceMerkleIndex: number[],\n aliceMerklePath: string[],\n aliceMessage: DarkSwapMessage,\n\n bobMerkleIndex: number[],\n bobMerklePath: string[],\n bobMessage: DarkSwapMessage,\n}\n\nexport type RetailSwapProofResult = BaseProofResult & {\n aliceOrderNullifier: string,\n aliceInNoteFooter: string,\n bobOrderNullifier: string,\n bobInNoteFooter: string,\n}\n\nexport async function generateRetailSwapProof(param: RetailSwapProofParam): Promise<RetailSwapProofResult> {\n if (param.aliceMessage.orderNote.feeRatio < 0n\n || param.bobMessage.orderNote.feeRatio < 0n) {\n throw new DarkSwapProofError(\"Invalid fee ratio\");\n }\n\n if (param.aliceMessage.inNote.amount <= 0n\n || param.aliceMessage.orderNote.amount <= 0n\n || param.aliceMessage.inNote.amount <= 0n\n || param.bobMessage.inNote.amount <= 0n\n || param.bobMessage.orderNote.amount <= 0n) {\n throw new DarkSwapProofError(\"Invalid note amount\");\n }\n\n if (param.aliceMessage.orderNote.amount != param.bobMessage.inNote.amount + param.bobMessage.feeAmount\n || param.bobMessage.orderNote.amount != param.aliceMessage.inNote.amount + param.aliceMessage.feeAmount) {\n throw new DarkSwapProofError(\"Invalid order amount\");\n }\n\n const aliceOrderNoteNullifier = calcNullifier(param.aliceMessage.orderNote.rho, param.aliceMessage.publicKey);\n const aliceInNoteFooter = getNoteFooter(param.aliceMessage.inNote.rho, param.aliceMessage.publicKey);\n const bobOrderNoteNullifier = calcNullifier(param.bobMessage.orderNote.rho, param.bobMessage.publicKey);\n const bobInNoteFooter = getNoteFooter(param.bobMessage.inNote.rho, param.bobMessage.publicKey);\n\n const aliceAddressMod = encodeAddress(param.aliceMessage.address);\n const bobAddressMod = encodeAddress(param.bobMessage.address);\n\n const inputs: RetailSwapProofInput = {\n merkle_root: param.merkleRoot,\n\n alice_merkle_index: param.aliceMerkleIndex,\n alice_merkle_path: param.aliceMerklePath.map((x) => bn_to_0xhex(BigInt(x))),\n alice_address: bn_to_0xhex(aliceAddressMod),\n\n alice_out_rho: bn_to_0xhex(param.aliceMessage.orderNote.rho),\n alice_out_asset: bn_to_0xhex(encodeAddress(param.aliceMessage.orderNote.asset)),\n alice_out_amount: bn_to_0xhex(param.aliceMessage.orderNote.amount),\n alice_out_note: bn_to_0xhex(param.aliceMessage.orderNote.note),\n alice_out_nullifier: bn_to_0xhex(aliceOrderNoteNullifier),\n alice_fee_ratio: bn_to_0xhex(param.aliceMessage.orderNote.feeRatio),\n alice_fee_amount: bn_to_0xhex(param.aliceMessage.feeAmount),\n\n alice_in_rho: bn_to_0xhex(param.aliceMessage.inNote.rho),\n alice_in_asset: bn_to_0xhex(encodeAddress(param.aliceMessage.inNote.asset)),\n alice_in_amount: bn_to_0xhex(param.aliceMessage.inNote.amount + param.aliceMessage.feeAmount),\n alice_in_note: bn_to_0xhex(param.aliceMessage.inNote.note),\n alice_in_note_footer: bn_to_0xhex(aliceInNoteFooter),\n\n alice_pub_key: [param.aliceMessage.publicKey[0].toString(), param.aliceMessage.publicKey[1].toString()],\n alice_signature: uint8ArrayToNumberArray(hexStringToSignature(param.aliceMessage.signature)),\n\n bob_merkle_index: param.bobMerkleIndex,\n bob_merkle_path: param.bobMerklePath.map((x) => bn_to_0xhex(BigInt(x))),\n bob_address: bn_to_0xhex(bobAddressMod),\n\n bob_out_note: bn_to_0xhex(param.bobMessage.orderNote.note),\n bob_out_rho: bn_to_0xhex(param.bobMessage.orderNote.rho),\n bob_out_nullifier: bn_to_0xhex(bobOrderNoteNullifier),\n bob_fee_ratio: bn_to_0xhex(param.bobMessage.orderNote.feeRatio),\n bob_fee_amount: bn_to_0xhex(param.bobMessage.feeAmount),\n\n bob_in_note: bn_to_0xhex(param.bobMessage.inNote.note),\n bob_in_rho: bn_to_0xhex(param.bobMessage.inNote.rho),\n bob_in_note_footer: bn_to_0xhex(bobInNoteFooter),\n\n bob_pub_key: [param.bobMessage.publicKey[0].toString(), param.bobMessage.publicKey[1].toString()],\n bob_signature: uint8ArrayToNumberArray(hexStringToSignature(param.bobMessage.signature)),\n };\n const proof = await generateProof(retailSwapCircuit, inputs);\n return {\n ...proof,\n aliceOrderNullifier: inputs.alice_out_nullifier,\n aliceInNoteFooter: inputs.alice_in_note_footer,\n bobOrderNullifier: inputs.bob_out_nullifier,\n bobInNoteFooter: inputs.bob_in_note_footer,\n }\n};","import { ethers } from 'ethers';\nimport DarkSwapAssetManagerAbi from '../../abis/DarkSwapAssetManager.json';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateRetailSwapProof, RetailSwapProofResult } from '../../proof/retail/swapProof';\nimport { DarkSwapMessage } from '../../types';\nimport { hexlify32 } from '../../utils/util';\nimport { BaseContext, BaseContractService } from '../BaseService';\nimport { multiGetMerklePathAndRoot } from '../merkletree';\n\nclass RetailSwapContext extends BaseContext {\n private _aliceSwapMessage?: DarkSwapMessage;\n private _bobSwapMessage?: DarkSwapMessage;\n private _proof?: RetailSwapProofResult;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set aliceSwapMessage(aliceSwapMessage: DarkSwapMessage | undefined) {\n this._aliceSwapMessage = aliceSwapMessage;\n }\n\n get aliceSwapMessage(): DarkSwapMessage | undefined {\n return this._aliceSwapMessage;\n }\n\n set bobSwapMessage(bobSwapMessage: DarkSwapMessage | undefined) {\n this._bobSwapMessage = bobSwapMessage;\n }\n\n get bobSwapMessage(): DarkSwapMessage | undefined {\n return this._bobSwapMessage;\n }\n\n set proof(proof: RetailSwapProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): RetailSwapProofResult | undefined {\n return this._proof;\n }\n}\n\nexport class RetailSwapService extends BaseContractService {\n constructor(_darkSwap: DarkSwap) {\n super(_darkSwap);\n }\n\n public async prepare(\n aliceSwapMessage: DarkSwapMessage,\n bobSwapMessage: DarkSwapMessage\n ): Promise<{ context: RetailSwapContext }> {\n const context = new RetailSwapContext(aliceSwapMessage.signature);\n context.aliceSwapMessage = aliceSwapMessage;\n context.bobSwapMessage = bobSwapMessage;\n return { context };\n }\n\n private async generateProof(context: RetailSwapContext): Promise<void> {\n if (!context\n || !context.aliceSwapMessage\n || !context.bobSwapMessage) {\n throw new DarkSwapError('Invalid context');\n }\n\n const merklePathes = await multiGetMerklePathAndRoot([context.aliceSwapMessage.orderNote.note, context.bobSwapMessage.orderNote.note], this._darkSwap);\n const aliceOrderNotePath = merklePathes[0];\n const bobOrderNotePath = merklePathes[1];\n\n const proof = await generateRetailSwapProof({\n merkleRoot: aliceOrderNotePath.root,\n aliceMerkleIndex: aliceOrderNotePath.index,\n aliceMerklePath: aliceOrderNotePath.path,\n aliceMessage: context.aliceSwapMessage,\n bobMerkleIndex: bobOrderNotePath.index,\n bobMerklePath: bobOrderNotePath.path,\n bobMessage: context.bobSwapMessage,\n });\n context.merkleRoot = aliceOrderNotePath.root;\n context.proof = proof;\n }\n\n public async execute(context: RetailSwapContext): Promise<string> {\n await this.generateProof(context);\n if (!context\n || !context.merkleRoot\n || !context.aliceSwapMessage\n || !context.bobSwapMessage\n || !context.proof) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwap.contracts.darkSwapAssetManager,\n DarkSwapAssetManagerAbi.abi,\n this._darkSwap.signer\n );\n const tx = await contract.retailSwap(\n [\n context.merkleRoot,\n hexlify32(context.aliceSwapMessage.orderNote.feeRatio),\n context.proof.aliceOrderNullifier,\n hexlify32(context.aliceSwapMessage.inNote.note),\n context.proof.aliceInNoteFooter,\n hexlify32(context.bobSwapMessage.orderNote.feeRatio),\n context.proof.bobOrderNullifier,\n hexlify32(context.bobSwapMessage.inNote.note),\n context.proof.bobInNoteFooter\n ],\n context.proof.proof\n );\n await tx.wait();\n return tx.hash;\n }\n}\n","import retailBridgeOrderCircuit from \"../../circuits/synara/synara_dark_swap_retail_deposit_bridge_create_order_compiled_circuit.json\";\nimport { BaseProofInput, BaseProofParam, BaseProofResult, DarkSwapNote, DarkSwapOrderNote, DarkSwapProofError, PROOF_DOMAIN } from \"../../types\";\nimport { encodeAddress } from \"../../utils/encoders\";\nimport { bn_to_0xhex, bn_to_hex } from \"../../utils/formatters\";\nimport { mimc_bn254 } from \"../../utils/mimc\";\nimport { uint8ArrayToNumberArray } from \"../../utils/proofUtils\";\nimport { generateProof, signMessage } from \"../baseProofService\";\nimport { generateKeyPair } from \"../keyService\";\nimport { getNoteFooter } from \"../noteService\";\n\ntype RetailDepositBridgeOrderProofInput = BaseProofInput & {\n dest_chain: string,\n //bridge fee\n bridge_fee_amount: string,\n\n deposit_out_note: string,\n deposit_out_note_footer: string,\n deposit_out_rho: string,\n\n //order\n out_asset_a: string,\n out_asset_b: string,\n out_amount: string,\n in_asset: string,\n in_amount: string,\n\n //fee\n fee_ratio: string,\n fee_amount: string,\n\n //swap in \n in_note: string,\n in_note_footer: string,\n in_rho: string,\n}\n\nexport type RetailBridgeOrderProofParam = BaseProofParam & {\n depositSourceAsset: string,\n depositNote: DarkSwapOrderNote,\n swapInNote: DarkSwapNote,\n feeRatio: bigint,\n feeAmount: bigint,\n destChain: number,\n bridgeFeeAmount: bigint,\n}\n\nexport type RetailBridgeOrderProofResult = BaseProofResult & {\n depositFooter: string,\n swapInNoteFooter: string,\n}\n\nexport async function generateRetailBridgeOrderProof(param: RetailBridgeOrderProofParam): Promise<RetailBridgeOrderProofResult> {\n if (param.depositNote.amount <= 0n) {\n throw new DarkSwapProofError(\"Deposit amount must be greater than 0\");\n }\n\n if (param.depositNote.feeRatio < 0n) {\n throw new DarkSwapProofError(\"Fee ratio must be greater or equal to 0\");\n }\n\n const [[fuzkPubKeyX, fuzkPubKeyY], fuzkPriKey] = await generateKeyPair(param.signedMessage);\n\n const depositFooter = getNoteFooter(param.depositNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n const inAmount = param.feeAmount + param.swapInNote.amount;\n\n const swapInNoteFooter = getNoteFooter(param.swapInNote.rho, [fuzkPubKeyX, fuzkPubKeyY]);\n\n const addressMod = encodeAddress(param.address);\n const depositSourceAssetMod = encodeAddress(param.depositSourceAsset);\n const message = bn_to_hex(mimc_bn254([\n BigInt(PROOF_DOMAIN.RETAIL_BRIDGE_ORDER),\n BigInt(param.destChain),\n addressMod,\n depositSourceAssetMod,\n param.depositNote.note,\n param.depositNote.feeRatio,\n param.swapInNote.note,\n ]));\n const signature = await signMessage(message, fuzkPriKey);\n\n const inputs: RetailDepositBridgeOrderProofInput = {\n address: bn_to_0xhex(addressMod),\n dest_chain: bn_to_0xhex(BigInt(param.destChain)),\n bridge_fee_amount: bn_to_0xhex(param.bridgeFeeAmount),\n deposit_out_note: bn_to_0xhex(param.depositNote.note),\n deposit_out_note_footer: bn_to_0xhex(depositFooter),\n deposit_out_rho: bn_to_0xhex(param.depositNote.rho),\n\n out_asset_a: bn_to_0xhex(depositSourceAssetMod),\n out_asset_b: bn_to_0xhex(encodeAddress(param.depositNote.asset)),\n out_amount: bn_to_0xhex(param.depositNote.amount + param.bridgeFeeAmount),\n in_asset: bn_to_0xhex(encodeAddress(param.swapInNote.asset)),\n in_amount: bn_to_0xhex(inAmount),\n\n fee_ratio: bn_to_0xhex(param.feeRatio),\n fee_amount: bn_to_0xhex(param.feeAmount),\n\n in_note: bn_to_0xhex(param.swapInNote.note),\n in_note_footer: bn_to_0xhex(swapInNoteFooter),\n in_rho: bn_to_0xhex(param.swapInNote.rho),\n\n pub_key: [fuzkPubKeyX.toString(), fuzkPubKeyY.toString()],\n signature: uint8ArrayToNumberArray(signature),\n };\n const proof = await generateProof(retailBridgeOrderCircuit, inputs);\n return {\n ...proof,\n depositFooter: inputs.deposit_out_note_footer,\n swapInNoteFooter: inputs.in_note_footer,\n }\n};","import { PROOF_DOMAIN } from \"../types\";\n\nexport const VK_HASH_CONFIG = {\n [PROOF_DOMAIN.RETAIL_BRIDGE_ORDER]: '0x0ca4f42da1fbc3e0f0b6b715f2b5458e41ff6c91f0a0c4b035cd64243c2661d6',\n}\n","import { ethers, keccak256, solidityPacked } from 'ethers';\nimport { DarkSwap } from '../../darkSwap';\nimport { DarkSwapError } from '../../entities';\nimport { generateKeyPair } from '../../proof/keyService';\nimport { createNote, createOrderNoteExt } from '../../proof/noteService';\nimport { generateRetailSwapMessage } from '../../proof/retail/depositOrderProof';\nimport { generateRetailBridgeOrderProof, RetailBridgeOrderProofResult } from '../../proof/synara/bridgeOrderProof';\nimport {\n DarkSwapMessage, DarkSwapNote, DarkSwapOrderNote,\n PROOF_DOMAIN\n} from '../../types';\nimport { BaseContext } from '../BaseService';\nimport { calcFeeAmount, getFeeRatio } from '../feeRatioService';\nimport {\n hexlify32,\n isNativeAsset\n} from '../../utils/util';\nimport axios from 'axios';\nimport { VK_HASH_CONFIG } from '../../config/zkverifyConfig';\nimport { legacyTokenConfig } from '../../config';\nimport ERC20Abi from '../../abis/IERC20.json';\nimport ERC20_USDT from '../../abis/IERC20_USDT.json';\nimport SynaraDarkSwapOnBridgeAssetManagerAbi from '../../abis/SynaraDarkSwapOnBridgeAssetManager.json';\nimport CanonicalTokenRegistryAbi from '../../abis/CanonicalTokenRegistry.json';\nimport BridgeAbi from '../../abis/Bridge.json';\nimport { bn_to_0xhex } from '../../utils/formatters';\nimport { MAX_ALLOWANCE } from '../../utils/constants';\n\nconst _DOMAIN_PREFIX = \"0x191253796e6172614272696467654465706f7369740a\";\n\ninterface RetailDepositBridgeCreateOrderArgs {\n destChain: bigint;\n bridgeFee: bigint;\n owner: string;\n depositOutNote: string;\n depositOutNoteFooter: string;\n outAssetSource: string;\n outAssetDest: string;\n outAmount: bigint;\n feeRatio: bigint;\n inNote: string;\n inNoteFooter: string;\n destContractAddress: string;\n}\n\ninterface AttestationDetails {\n attestationId: bigint;\n merklePath: string[];\n leafCount: bigint;\n index: bigint;\n}\n\nclass BridgeCreateOrderContext extends BaseContext {\n private _orderNote?: DarkSwapOrderNote;\n private _swapInNote?: DarkSwapNote;\n private _proof?: RetailBridgeOrderProofResult;\n private _feeAmount?: bigint;\n private _swapMessage?: DarkSwapMessage;\n private _sourceChainId?: number;\n private _destChainId?: number;\n private _sourceAsset?: string;\n private _sourceAmount?: bigint;\n private _bridgeFeeAmount?: bigint;\n private _depositId?: string;\n private _attestationDetails?: AttestationDetails;\n private _relayer?: string;\n private _jobId?: string;\n private _canonicalId?: string;\n private _callDataHash?: string;\n private _nonce?: bigint;\n private _callData?: string;\n\n constructor(signature: string) {\n super(signature);\n }\n\n set orderNote(orderNote: DarkSwapOrderNote | undefined) {\n this._orderNote = orderNote;\n }\n\n get orderNote(): DarkSwapOrderNote | undefined {\n return this._orderNote;\n }\n\n set swapInNote(swapInNote: DarkSwapNote | undefined) {\n this._swapInNote = swapInNote;\n }\n\n get swapInNote(): DarkSwapNote | undefined {\n return this._swapInNote;\n }\n\n set feeAmount(feeAmount: bigint | undefined) {\n this._feeAmount = feeAmount;\n }\n\n get feeAmount(): bigint | undefined {\n return this._feeAmount;\n }\n\n set proof(proof: RetailBridgeOrderProofResult | undefined) {\n this._proof = proof;\n }\n\n get proof(): RetailBridgeOrderProofResult | undefined {\n return this._proof;\n }\n\n set swapMessage(swapMessage: DarkSwapMessage | undefined) {\n this._swapMessage = swapMessage;\n }\n\n get swapMessage(): DarkSwapMessage | undefined {\n return this._swapMessage;\n }\n\n set sourceChainId(sourceChainId: number | undefined) {\n this._sourceChainId = sourceChainId;\n }\n\n get sourceChainId(): number | undefined {\n return this._sourceChainId;\n }\n\n set destChainId(destChainId: number | undefined) {\n this._destChainId = destChainId;\n }\n\n get destChainId(): number | undefined {\n return this._destChainId;\n }\n\n set sourceAsset(sourceAsset: string | undefined) {\n this._sourceAsset = sourceAsset;\n }\n\n get sourceAsset(): string | undefined {\n return this._sourceAsset;\n }\n\n set sourceAmount(sourceAmount: bigint | undefined) {\n this._sourceAmount = sourceAmount;\n }\n\n get sourceAmount(): bigint | undefined {\n return this._sourceAmount;\n }\n\n set bridgeFeeAmount(bridgeFeeAmount: bigint | undefined) {\n this._bridgeFeeAmount = bridgeFeeAmount;\n }\n\n get bridgeFeeAmount(): bigint | undefined {\n return this._bridgeFeeAmount;\n }\n\n set depositId(depositId: string | undefined) {\n this._depositId = depositId;\n }\n\n get depositId(): string | undefined {\n return this._depositId;\n }\n\n set attestationDetails(attestationDetails: AttestationDetails | undefined) {\n this._attestationDetails = attestationDetails;\n }\n\n get attestationDetails(): AttestationDetails | undefined {\n return this._attestationDetails;\n }\n\n set relayer(relayer: string | undefined) {\n this._relayer = relayer;\n }\n\n get relayer(): string | undefined {\n return this._relayer;\n }\n\n set jobId(jobId: string | undefined) {\n this._jobId = jobId;\n }\n\n get jobId(): string | undefined {\n return this._jobId;\n }\n\n set canonicalId(canonicalId: string | undefined) {\n this._canonicalId = canonicalId;\n }\n\n get canonicalId(): string | undefined {\n return this._canonicalId;\n }\n\n set callDataHash(callDataHash: string | undefined) {\n this._callDataHash = callDataHash;\n }\n\n get callDataHash(): string | undefined {\n return this._callDataHash;\n }\n\n set nonce(nonce: bigint | undefined) {\n this._nonce = nonce;\n }\n\n get nonce(): bigint | undefined {\n return this._nonce;\n }\n\n set callData(callData: string | undefined) {\n this._callData = callData;\n }\n\n get callData(): string | undefined {\n return this._callData;\n }\n}\n\nexport type SubmitProofRelayerRequest = {\n proof: string;\n publicSignals: string[];\n vkHash: string;\n};\n\nexport class BridgeCreateOrderService {\n protected _darkSwapOfSourceChain: DarkSwap;\n protected _darkSwapOfDestChain: DarkSwap;\n\n constructor(_darkSwapOfSourceChain: DarkSwap, _darkSwapOfDestChain: DarkSwap) {\n this._darkSwapOfSourceChain = _darkSwapOfSourceChain;\n this._darkSwapOfDestChain = _darkSwapOfDestChain;\n }\n\n private async getCanonicalTokenAddress(sourceAsset: string): Promise<string> {\n const canonicalTokenRegistry = new ethers.Contract(\n this._darkSwapOfSourceChain.contracts.synaraCanonicalTokenRegistry,\n CanonicalTokenRegistryAbi,\n this._darkSwapOfSourceChain.provider,\n );\n return await canonicalTokenRegistry.getCanonicalId(sourceAsset);\n }\n\n private async getBridgeFee(canonicalId: string, wallet: string, amount: bigint): Promise<bigint> {\n const bridge = new ethers.Contract(\n this._darkSwapOfSourceChain.contracts.synaraBridge,\n BridgeAbi.abi,\n this._darkSwapOfSourceChain.provider,\n );\n return await bridge.getBridgeFee(canonicalId, wallet, amount);\n }\n\n public async prepare(\n address: string,\n sourceChainId: number,\n sourceAsset: string,\n sourceAmount: bigint,\n canonicalId: string,\n bridgeFee: bigint,\n destChainId: number,\n depositAsset: string,\n depositAmount: bigint,\n swapInAsset: string,\n swapInAmount: bigint,\n signature: string\n ): Promise<{ context: BridgeCreateOrderContext; swapMessage: DarkSwapMessage }> {\n const [pubKey, privKey] = await generateKeyPair(signature);\n const feeRatio = BigInt(await getFeeRatio(address, this._darkSwapOfDestChain));\n const canonicalIdFromContract = await this.getCanonicalTokenAddress(sourceAsset);\n if (canonicalIdFromContract !== canonicalId) {\n throw new DarkSwapError('CanonicalId not match');\n }\n const bridgeFeeAmountFromContract = await this.getBridgeFee(canonicalId, address, sourceAmount);\n if (bridgeFeeAmountFromContract !== bridgeFee) {\n throw new DarkSwapError('BridgeFee not match');\n }\n const orderNote = createOrderNoteExt(address, depositAsset, depositAmount, feeRatio, pubKey);\n const feeAmount = calcFeeAmount(swapInAmount, feeRatio);\n const realSwapInAmount = swapInAmount - feeAmount\n const swapInNote = createNote(address, swapInAsset, realSwapInAmount, pubKey);\n const context = new BridgeCreateOrderContext(signature);\n context.orderNote = orderNote;\n context.swapInNote = swapInNote;\n context.feeAmount = feeAmount;\n context.address = address;\n context.sourceChainId = sourceChainId;\n context.destChainId = destChainId;\n context.sourceAsset = sourceAsset;\n context.sourceAmount = sourceAmount;\n context.bridgeFeeAmount = bridgeFee;\n context.canonicalId = canonicalId;\n\n const swapMessage = await generateRetailSwapMessage(address, orderNote, swapInNote, feeAmount, pubKey, privKey);\n context.swapMessage = swapMessage;\n return { context, swapMessage };\n }\n\n private pickRelayer() {\n return this._darkSwapOfSourceChain.contracts.zkverifyRelayerUrls[0];\n }\n\n private async submitProof(context: BridgeCreateOrderContext): Promise<void> {\n if (!context) {\n throw new DarkSwapError('Invalid context');\n }\n context.proof = await this.generateProof(context);\n\n const relayerRequest: SubmitProofRelayerRequest = {\n proof: context.proof.proof,\n publicSignals: context.proof.verifyInputs,\n vkHash: VK_HASH_CONFIG[PROOF_DOMAIN.RETAIL_BRIDGE_ORDER],\n }\n context.relayer = this.pickRelayer();\n const response = await axios.post(context.relayer + '/v1/zkVerifySubmitProof', relayerRequest);\n if (response.status == 200) {\n context.jobId = response.data.id;\n } else if (response.status == 400) {\n throw new Error('Request error' + response.data.error);\n } else {\n throw new Error('Relayer not asscessable');\n }\n\n const { error, result } = await this.pollJobStatus(context);\n if (error) {\n throw new DarkSwapError(error);\n }\n context.attestationDetails = result;\n }\n\n private async pollJobStatus(context: BridgeCreateOrderContext): Promise<{ error: string | undefined; result: AttestationDetails | undefined }> {\n let tries = 1;\n while (tries <= 100) {\n if (tries >= 100) {\n break;\n }\n try {\n const response = await axios.get(`${context.relayer}/v1/jobs/${context.jobId}`);\n if (response.status === 400) {\n const { error } = response.data;\n console.log(error);\n return {\n error: 'Failed to submit proof to relayer:' + error,\n result: undefined\n };\n }\n if (response.status === 200) {\n const { status, failedReason, result } = response.data;\n\n if (status === 'FAILED') {\n return {\n error: failedReason ?? 'Transaction failed.',\n result: undefined\n };\n }\n if (status === 'CONFIRMED' || status === 'MINED') {\n return {\n error: undefined,\n result: {\n attestationId: BigInt(result.attestationId),\n merklePath: result.merklePath,\n leafCount: BigInt(result.leafCount),\n index: BigInt(result.index),\n }\n };\n }\n }\n await new Promise(resolve => setTimeout(resolve, 5000));\n } catch (error) {\n console.log(error);\n }\n tries++;\n }\n\n return {\n error: 'Waited too long for getting attestation details.',\n result: undefined\n };\n }\n\n private async generateProof(context: BridgeCreateOrderContext): Promise<RetailBridgeOrderProofResult> {\n if (!context\n || !context.orderNote\n || !context.swapInNote\n || !context.address\n || context.feeAmount === undefined\n || !context.signature\n || !context.sourceChainId\n || !context.destChainId\n || !context.sourceAsset\n || !context.sourceAmount\n || context.bridgeFeeAmount === undefined) {\n throw new DarkSwapError('Invalid context');\n }\n\n const proof = await generateRetailBridgeOrderProof({\n depositSourceAsset: context.sourceAsset,\n depositNote: context.orderNote,\n swapInNote: context.swapInNote,\n feeRatio: context.orderNote.feeRatio,\n feeAmount: context.feeAmount,\n destChain: context.destChainId,\n bridgeFeeAmount: context.bridgeFeeAmount,\n address: context.address,\n signedMessage: context.signature,\n });\n return proof;\n }\n\n private async computeDepositId(context: BridgeCreateOrderContext): Promise<string> {\n if (!context\n || !context.callData\n || !context.orderNote\n || !context.swapInNote\n || !context.address\n || context.feeAmount === undefined\n || !context.signature\n || !context.sourceChainId\n || !context.destChainId\n || !context.sourceAsset\n || context.bridgeFeeAmount === undefined) {\n throw new DarkSwapError('Invalid context');\n }\n\n const callDataHash = ethers.solidityPackedKeccak256(\n ['address', 'bytes'],\n [this._darkSwapOfDestChain.contracts.synaraDarkSwapOnBridgeAssetManager, context.callData]\n );\n context.callDataHash = callDataHash;\n const currentNonce = await this.getCurrentNonce(context) as bigint;\n context.nonce = currentNonce;\n\n const packedData = solidityPacked(\n [\n \"bytes\", // _DOMAIN_PREFIX\n \"address\", // bridge\n \"bytes32\", // canonicalId\n \"address\", // synaraDarkSwapOnBridgeAssetManager\n \"address\", // userWallet\n \"bytes32\", // amount\n \"bytes32\", // destinationChainId\n \"bytes32\", // nonce\n \"bytes32\", // block.chainid\n \"bytes32\" // _computeCallDataHash(call)\n ],\n [\n _DOMAIN_PREFIX,\n this._darkSwapOfSourceChain.contracts.synaraBridge,\n context.canonicalId,\n this._darkSwapOfSourceChain.contracts.synaraDarkSwapOnBridgeAssetManager,\n context.address,\n hexlify32(context.orderNote.amount),\n hexlify32(context.destChainId),\n hexlify32(context.nonce),\n hexlify32(context.sourceChainId),\n context.callDataHash,\n ]\n );\n const depositCommitment = keccak256(packedData);\n return depositCommitment;\n }\n\n private async getCurrentNonce(context: BridgeCreateOrderContext) {\n const provider = this._darkSwapOfSourceChain.provider;\n const contract = new ethers.Contract(\n this._darkSwapOfSourceChain.contracts.synaraDarkSwapOnBridgeAssetManager,\n SynaraDarkSwapOnBridgeAssetManagerAbi.abi,\n provider);\n return await contract.currentNonce({ from: context.address });\n }\n\n private async composeCallData(context: BridgeCreateOrderContext): Promise<string> {\n if (!context\n || !context.orderNote\n || !context.swapInNote\n || !context.address\n || !context.destChainId\n || !context.sourceAsset\n || context.bridgeFeeAmount === undefined\n || !context.proof\n || !context.attestationDetails) {\n throw new DarkSwapError('Invalid context');\n }\n const functionSignature = \"_retailBridgeCreateOrder((uint256,uint256,address,bytes32,bytes32,address,address,uint256,uint256,bytes32,bytes32,address),(uint256,bytes32[],uint256,uint256))\";\n\n const args: RetailDepositBridgeCreateOrderArgs = {\n destChain: BigInt(context.destChainId),\n bridgeFee: context.bridgeFeeAmount,\n owner: context.address,\n depositOutNote: hexlify32(context.orderNote.note),\n depositOutNoteFooter: context.proof.depositFooter,\n outAssetSource: context.sourceAsset,\n outAssetDest: context.orderNote.asset,\n outAmount: context.orderNote.amount,\n feeRatio: context.orderNote.feeRatio,\n inNote: hexlify32(context.swapInNote.note),\n inNoteFooter: context.proof.swapInNoteFooter,\n destContractAddress: this._darkSwapOfDestChain.contracts.synaraDarkSwapOnBridgeAssetManager,\n };\n\n const iface = new ethers.Interface([`function ${functionSignature}`]);\n const fullData = iface.encodeFunctionData('_retailBridgeCreateOrder', [\n [\n args.destChain,\n args.bridgeFee,\n args.owner,\n args.depositOutNote,\n args.depositOutNoteFooter,\n args.outAssetSource,\n args.outAssetDest,\n args.outAmount,\n args.feeRatio,\n args.inNote,\n args.inNoteFooter,\n args.destContractAddress\n ],\n [\n context.attestationDetails.attestationId,\n context.attestationDetails.merklePath,\n context.attestationDetails.leafCount,\n context.attestationDetails.index\n ]\n ]);\n return fullData;\n }\n\n protected async allowance(context: BridgeCreateOrderContext) {\n if (!context || !context.orderNote || !context.address || !context.signature || !context.proof) {\n throw new DarkSwapError('Invalid context');\n }\n const signer = this._darkSwapOfSourceChain.signer;\n const asset = context.orderNote.asset;\n const amount = context.orderNote.amount;\n const allowanceContract = new ethers.Contract(asset, ERC20Abi.abi, this._darkSwapOfSourceChain);\n const allowance = await allowanceContract.allowance(\n signer.getAddress(),\n this._darkSwapOfSourceChain.contracts.darkSwapAssetManager\n );\n if (BigInt(allowance) < amount) {\n const isLegacy =\n legacyTokenConfig.hasOwnProperty(this._darkSwapOfSourceChain.chainId) &&\n legacyTokenConfig[this._darkSwapOfSourceChain.chainId].includes(asset.toLowerCase());\n const contract = new ethers.Contract(asset, isLegacy ? ERC20_USDT.abi : ERC20Abi.abi, signer);\n const tx = await contract.approve(this._darkSwapOfSourceChain.contracts.darkSwapAssetManager, hexlify32(MAX_ALLOWANCE));\n await tx.wait();\n }\n }\n\n public async execute(context: BridgeCreateOrderContext): Promise<{ depositId: string, txHash: string }> {\n await this.submitProof(context);\n const callData = await this.composeCallData(context);\n context.callData = callData;\n context.depositId = await this.computeDepositId(context);\n const txHash = await this._execute(context);\n return {\n depositId: context.depositId,\n txHash,\n };\n }\n\n private async _execute(context: BridgeCreateOrderContext): Promise<string> {\n if (!context\n || !context.destChainId\n || !context.attestationDetails\n || !context.orderNote\n || !context.swapInNote\n || !context.sourceAsset\n || !context.sourceAmount\n || context.bridgeFeeAmount === undefined\n || !context.depositId\n || !context.proof) {\n throw new DarkSwapError('Invalid context');\n }\n\n const contract = new ethers.Contract(\n this._darkSwapOfSourceChain.contracts.synaraDarkSwapOnBridgeAssetManager,\n SynaraDarkSwapOnBridgeAssetManagerAbi.abi,\n this._darkSwapOfSourceChain.signer\n );\n let ethAmount = 0n;\n if (isNativeAsset(context.sourceAsset)) {\n ethAmount = context.sourceAmount;\n } else {\n await this.allowance(context);\n }\n const tx = await contract.retailDepositBridge(\n context.depositId,\n [\n hexlify32(BigInt(context.destChainId)),\n hexlify32(context.bridgeFeeAmount),\n context.address,\n hexlify32(context.orderNote.note),\n context.proof.depositFooter,\n context.sourceAsset,\n context.orderNote.asset,\n hexlify32(context.sourceAmount),\n hexlify32(context.orderNote.feeRatio),\n hexlify32(context.swapInNote.note),\n context.proof.swapInNoteFooter,\n this._darkSwapOfDestChain.contracts.synaraDarkSwapOnBridgeAssetManager\n ],\n [\n hexlify32(context.attestationDetails.attestationId),\n context.attestationDetails.merklePath,\n hexlify32(context.attestationDetails.leafCount),\n hexlify32(context.attestationDetails.index)\n ],\n {\n value: bn_to_0xhex(ethAmount)\n }\n );\n await tx.wait();\n return tx.hash;\n }\n}","import { ethers } from 'ethers';\nimport { ContractConfiguartion, contractConfig } from './config/contractConfig';\nimport { DarkSwapError } from './entities';\n\nexport class DarkSwap {\n signer: ethers.Signer;\n provider: ethers.Provider;\n chainId: number;\n contracts: ContractConfiguartion;\n\n constructor(\n signer: ethers.Signer,\n chainId: number,\n provider?: ethers.Provider,\n contracts?: ContractConfiguartion,\n ) {\n // @ts-ignore\n this.signer = signer;\n // @ts-ignore\n this.provider = provider || signer.provider;\n this.chainId = chainId;\n if (contracts) {\n this.contracts = contracts;\n } else {\n if (contractConfig[chainId]) {\n this.contracts = contractConfig[chainId];\n } else {\n throw new DarkSwapError('There is no default contract configuration for the provided chainId');\n }\n }\n }\n}\n","import { DarkSwapMessage } from \"../types\";\nimport { Fr } from \"../aztec/fields/fields\";\n\nexport function serializeDarkSwapMessage(swapMessage: DarkSwapMessage): string {\n return JSON.stringify({\n address: swapMessage.address,\n orderNote: {\n rho: swapMessage.orderNote.rho.toString(),\n amount: swapMessage.orderNote.amount.toString(),\n asset: swapMessage.orderNote.asset,\n note: swapMessage.orderNote.note.toString(),\n feeRatio: swapMessage.orderNote.feeRatio.toString(),\n },\n orderNullifier: swapMessage.orderNullifier,\n inNote: {\n rho: swapMessage.inNote.rho.toString(),\n amount: swapMessage.inNote.amount.toString(),\n asset: swapMessage.inNote.asset,\n note: swapMessage.inNote.note.toString(),\n },\n feeAmount: swapMessage.feeAmount.toString(),\n pubKey: [swapMessage.publicKey[0].toString(), swapMessage.publicKey[1].toString()],\n signature: swapMessage.signature,\n });\n}\n\nfunction deserializePublicKey(publicKeyString: string[]): [Fr, Fr] {\n return [Fr.fromHexString(publicKeyString[0]), Fr.fromHexString(publicKeyString[1])];\n}\n\nexport function deserializeDarkSwapMessage(serializedMessage: string): DarkSwapMessage {\n const message = JSON.parse(serializedMessage);\n return {\n address: message.address,\n orderNote: {\n address: message.orderNote.address,\n rho: BigInt(message.orderNote.rho),\n amount: BigInt(message.orderNote.amount),\n asset: message.orderNote.asset,\n note: BigInt(message.orderNote.note),\n feeRatio: BigInt(message.orderNote.feeRatio),\n },\n feeAmount: BigInt(message.feeAmount),\n inNote: {\n address: message.inNote.address,\n rho: BigInt(message.inNote.rho),\n amount: BigInt(message.inNote.amount),\n asset: message.inNote.asset,\n note: BigInt(message.inNote.note),\n },\n signature: message.signature,\n publicKey: deserializePublicKey(message.pubKey),\n orderNullifier: message.orderNullifier,\n };\n}"],"names":["NATIVE_ASSETS","isNativeAsset","asset","toLowerCase","isAddressEquals","address1","address2","hexlify32","value","ethers","zeroPadValue","toBeHex","isHexEquals","hex1","hex2","DarkSwapError","_Error","message","_this","call","name","_inheritsLoose","_wrapNativeSuper","Error","NoteOnChainStatus","P","BigInt","MAX_ALLOWANCE","defaultAbiCoder","AbiCoder","encodeAddress","address","encoder","encodedAddress","encode","hashedAddress","ripemd160","toBits","x","bits","push","length","pow32","exponent","r","b","i","mimc","k","constants","exp","t","h","mimc_bn254","array","_iterator","_createForOfIteratorHelperLoose","_step","done","elem","getRandomValues","window","crypto","buf","nodeCrypto","require","randomBytes","set","DOMAIN_NOTE","DOMAIN_ORDER_NOTE","EMPTY_NOTE","rho","note","amount","createNote","fuzkPubKey","generateRho","footer","getNoteFooter","addressMod","assetMod","publicKey","toString","securityLevel","primeByteLength","Math","ceil","totalBytes","ab","ArrayBuffer","Uint8Array","hexlify","calcNullifier","createOrderNoteExt","feeRatio","noteCommitment","validateNoteWithPubKey","validateOrderNoteWithPubKey","toBigIntBE","hex","toBufferBE","num","width","buffer","Buffer","from","padStart","slice","BufferReader","offset","index","asReader","bufferOrReader","isBuffer","byteOffset","byteLength","_proto","prototype","isEmpty","readNumber","rangeCheck","readUint32BE","readUInt64","result","readBigUInt64BE","readUInt128","readUInt256","readUInt16","readUInt16BE","readUInt8","readBoolean","Boolean","at","readBytes","n","subarray","readToEnd","readNumberVector","readVector","fromBuffer","reader","readUint256Vector","itemDeserializer","size","Array","readVectorUint8Prefix","readBufferArray","end","item","readBuffer","readObject","deserializer","peekBytes","undefined","readString","readUint8Array","readMap","numEntries","map","key","getLength","remainingBytes","numBytes","ZERO_BUFFER","alloc","BaseField","SIZE_IN_BYTES","asBuffer","concat","asBigInt","modulus","toBuffer","toBigInt","toBool","toNumber","Number","MAX_SAFE_INTEGER","toNumberUnsafe","toShortString","str","equals","rhs","lt","cmp","lhsBigInt","rhsBigInt","isZero","toFriendlyJSON","toField","_createClass","get","f","fromBufferReduce","MODULUS","fromHexString","withoutPrefix","replace","checked","_withoutPrefix$match","match","Fr","_BaseField","_proto2","zero","ZERO","fromString","Fq","_BaseField2","_proto3","fromHighLow","high","low","HIGH_SHIFT","add","toJSON","toFields","lo","hi","LOW_MASK","concatenateUint8Arrays","arrayOfUint8Arrays","totalLength","reduce","prev","curr","mapTuple","tuple","fn","SchnorrSignature","SIZE","isSignature","signature","test","sig","buf1","buf2","buf3","copy","numToUInt32BE","bufferSize","writeUInt32BE","numToInt32BE","writeInt32BE","boolToBuffer","writeUInt8","serializeToBufferArray","ret","_len","arguments","objs","_key2","_i","_objs","obj","isArray","apply","serializeBigInt","_obj$constructor","constructor","serializeToFields","_len2","_key3","_i2","_objs2","toFr","_obj$constructor2","serializeToBuffer","poseidon2Hash","_x","_poseidon2Hash","_asyncToGenerator","_regenerator","m","_callee","input","inputFields","api","hash","w","_context","BarretenbergSync","initSingleton","process","env","BB_WASM_PATH","v","FrBarretenberg","a","FieldReader","fields","remainingFields","skip","readField","peekField","readFq","field","readU32","fromFields","isFinished","hasHexPrefix","startsWith","withoutHexPrefix","hexToBuffer","bufferToHex","Point","y","isInfinite","toXAndSign","toBigInts","toCompressedBuffer","_this$toXAndSign","sign","compressedValue","pow","COMPRESSED_SIZE_IN_BYTES","toNoirStruct","is_infinite","toWrappedNoirStruct","inner","Schnorr","computePublicKey","_computePublicKey","privateKey","_api$getWasm$callWasm","getWasm","callWasmExport","constructSignature","_constructSignature","_callee2","msg","messageArray","_api$getWasm$callWasm2","s","e","_context2","_x2","_x3","generateKeyPair","_generateKeyPair","schnorr","getContract","darkSwap","provider","Contract","MerkleAbi","abi","getNoteOnChainStatus","_getNoteOnChainStatus","nullifier","contract","isNotCreated","isSpent","isLocked","contracts","merkleTreeOperator","noteIsNotCreated","UNKNOWN","nullifiersUsed","SPENT","nullifiersLocked","LOCKED","ACTIVE","getNoteOnChainStatusByPublicKey","_x4","_x5","_x6","_getNoteOnChainStatusByPublicKey","onChainStatus","getNoteOnChainStatusBySignature","_x7","_x8","_x9","_getNoteOnChainStatusBySignature","_callee3","_yield$generateKeyPai","_context3","isNoteActive","_x0","_x1","_x10","_isNoteActive","_callee4","_context4","isNoteSpent","_x11","_x12","_x13","_isNoteSpent","_callee5","_context5","isNoteValid","_x14","_x15","_x16","_isNoteValid","_callee6","_context6","getNullifierBySignature","_x17","_x18","_getNullifierBySignature","_callee7","_yield$generateKeyPai2","_context7","isNoteCreated","_x19","_x20","_isNoteCreated","_callee8","_context8","ChainId","legacyTokenConfig","_legacyTokenConfig","MAINNET","HARDHAT","confirmationsConfig","_confirmationsConfig","ARBITRUM_ONE","BASE","SEPOLIA","DEFAULT_CONFIRMATIONS","getConfirmations","chainId","DEFAULT_FEE_RATIO","GAS_LIMIT_MULTIPLIER","GAS_LIMIT_PRECISION","PROOF_DOMAIN","EMPTY_NULLIFIER","EMPTY_FOOTER","FEE_RATIO_PRECISION","DarkSwapProofError","Object","setPrototypeOf","bn_to_hex","bn_to_0xhex","signatureToHexString","hexStringToSignature","uint8ArrayToNumberArray","uint8Array","generateProof","_generateProof","circuit","inputs","start_time","backend","noir","_yield$noir$execute","witness","proof","destroy_start_time","Date","getTime","UltraHonkBackend","bytecode","Noir","p","execute","keccak","console","log","verifyInputs","publicInputs","destroy","signMessage","_signMessage","fuzkPriKey","reverse","generateDepositProof","_generateDepositProof","param","depositAmount","fuzkPubKeyX","fuzkPubKeyY","oldBalanceNullifier","newBalanceFooter","newBalanceNote","oldBalanceNote","signedMessage","DEPOSIT","merkle_root","merkleRoot","merkle_index","merkleIndex","merkle_path","merklePath","in_amount","existing_note","existing_amount","existing_rho","existing_nullifier","account_note","account_rho","account_note_footer","pub_key","depositCircuit","_extends","BaseContext","_signature","_address","_merkleRoot","_tx","tx","BaseContractService","_darkSwap","EMPTY_PATH","path","fill","root","getMerklePathAndRoot","_getMerklePathAndRoot","multiGetMerklePathAndRoot","_multiGetMerklePathAndRoot","notes","_yield$contract$getMu","paths","indexes","results","getMultiMerklePaths","contractConfig","_contractConfig","priceOracle","ethAddress","nativeWrapper","darkSwapAssetManager","darkSwapFeeAssetManager","synaraDarkSwapOnBridgeAssetManager","synaraBridge","synaraCanonicalTokenRegistry","zkverifyRelayerUrls","BASE_SEPOLIA","HORIZEN_TESTNET","HARDHAT_BASE","refineGasLimit","estimatedGas","DepositContext","_BaseContext","_currentBalance","currentBalance","_newBalance","newBalance","_proof","_depositAmount","DepositService","_BaseContractService","prepare","_prepare","depositAsset","walletAddress","pubKey","newBalanceAmount","context","_t","_execute","signer","_contract$deposit","depositArgs","gasLimit","_contract$deposit2","_depositArgs","_estimatedGas","DarkSwapAssetManagerAbi","allowance","deposit","estimateGas","wait","_allowance","allowanceContract","isLegacy","ERC20Abi","getAddress","hasOwnProperty","includes","ERC20_USDT","approve","generateWithdrawProof","_generateWithdrawProof","withdrawAmount","oldBalance","WITHDRAW","out_amount","remaining_note","remaining_rho","remaining_note_footer","remaining_amount","withdrawCircuit","WithdrawContext","_withdrawAmount","WithdrawService","withdraw","generateJoinProof","_generateJoinProof","inNullifier1","inNullifier2","outNoteFooter","inNote1","inNote2","outNote","JOIN","in_merkle_index_1","inMerkleIndex1","in_merkle_index_2","inMerkleIndex2","in_merkle_path_1","inMerklePath1","in_merkle_path_2","inMerklePath2","in_amount_1","in_amount_2","in_rho_1","in_rho_2","in_nullifier_1","in_nullifier_2","in_note_1","in_note_2","out_note","out_rho","out_note_footer","joinCircuit","JoinContext","_inNote1","_inNote2","_outNote","JoinService","merklePathes","path1","path2","_contract$join","joinArgs","join","generateTripleJoinProof","_generateTripleJoinProof","inNullifier3","inNote3","TRIPLE_JOIN","in_merkle_index_3","inMerkleIndex3","in_merkle_path_3","inMerklePath3","in_amount_3","in_rho_3","in_nullifier_3","in_note_3","tripleJoinCircuit","TripleJoinContext","_inNote3","TripleJoinService","path3","DarkSwapFeeAssetManagerAbi","getFeeRatio","_getFeeRatio","wallet","getServiceFeePercentage","calcFeeAmount","generateProCreateOrderProof","_generateProCreateOrderProof","feeAmount","orderNoteFooter","orderNote","inAmount","PRO_CREATE_ORDER","inAsset","out_nullifier","fee_ratio","fee_amount","change_note","change_rho","change_note_footer","change_amount","order_note","order_rho","order_note_footer","order_asset","order_amount","in_asset","proCreateOrderCircuit","ProCreateOrderContext","_orderNote","_swapInAsset","swapInAsset","_swapInAmount","swapInAmount","_oldBalance","_feeAmount","_swapMessage","swapMessage","ProCreateOrderService","orderAsset","orderAmount","balanceNote","orderNullifier","_t2","_yield$getMerklePathA","txData","proCreateOrder","generateProCancelOrderProof","_generateProCancelOrderProof","newBalanceNoteFooter","PRO_CANCEL_ORDER","merkle_index_remaining","merkleIndexRemaining","merkle_path_remaining","merklePathRemaining","order_nullifier","remaining_nullifier","proCancelOrderCircuit","ProCancelOrderContext","ProCancelOrderService","orderPath","oldBalancePath","cancelOrder","generateProSwapProof","_generateProSwapProof","aliceOrderNoteNullifier","aliceInNoteFooter","aliceChangeNoteFooter","bobOrderNoteNullifier","bobInNoteFooter","aliceAddressMod","bobAddressMod","aliceOrderNote","bobMessage","aliceChangeNote","aliceInNote","inNote","aliceFeeAmount","aliceSignedMessage","aliceAddress","bobAddress","PRO_SWAP","alice_merkle_index","aliceMerkleIndex","alice_merkle_path","aliceMerklePath","alice_address","alice_out_note","alice_out_rho","alice_out_nullifier","alice_out_amount","alice_fee_ratio","alice_fee_amount","alice_in_note","alice_in_rho","alice_in_note_footer","alice_change_note","alice_change_rho","alice_change_note_footer","alice_pub_key","alice_signature","bob_out_asset","bob_out_amount","bob_in_asset","bob_in_amount","bob_merkle_index","bobMerkleIndex","bob_merkle_path","bobMerklePath","bob_address","bob_out_note","bob_out_rho","bob_out_nullifier","bob_fee_ratio","bob_fee_amount","bob_in_note","bob_in_rho","bob_in_note_footer","bob_pub_key","bob_signature","swapCircuit","aliceOutNullifier","bobOutNullifier","generateRetailSwapMessage","_generateRetailSwapMessage","swapInNote","privKey","orderNoteNullifier","RETAIL_CREATE_ORDER","generateRetailCreateOrderProof","_generateRetailCreateOrderProof","depositNullifier","depositFooter","swapInNoteFooter","depositNote","deposit_out_note","deposit_out_nullifier","deposit_out_note_footer","deposit_out_rho","out_asset","in_note","in_note_footer","in_rho","retailCreateOrderCircuit","ProSwapContext","_changeNote","changeNote","_swapInNote","_aliceFeeAmount","_bobSwapMessage","bobSwapMessage","_bobAddress","ProSwapService","prepareProSwapMessageForBob","_prepareProSwapMessageForBob","darkSwapMessage","swapOutAmount","changeAmount","orderNotePath","bobOrderNotePath","swapArgs","proSwap","generateRetailCancelOrderProof","_generateRetailCancelOrderProof","RETAIL_CANCEL_ORDER","retailCancelOrderCircuit","RetailCancelOrderContext","RetailCancelOrderService","cancelOrderWithdraw","RetailCreateOrderContext","RetailCreateOrderService","rebuildContextFromSwapMessage","_rebuildContextFromSwapMessage","realSwapInAmount","ethAmount","retailDepositCreateOrder","generateRetailSwapProof","_generateRetailSwapProof","aliceMessage","alice_out_asset","alice_in_asset","alice_in_amount","retailSwapCircuit","aliceOrderNullifier","bobOrderNullifier","RetailSwapContext","_aliceSwapMessage","aliceSwapMessage","RetailSwapService","aliceOrderNotePath","retailSwap","generateRetailBridgeOrderProof","_generateRetailBridgeOrderProof","depositSourceAssetMod","depositSourceAsset","RETAIL_BRIDGE_ORDER","destChain","dest_chain","bridge_fee_amount","bridgeFeeAmount","out_asset_a","out_asset_b","retailBridgeOrderCircuit","VK_HASH_CONFIG","_VK_HASH_CONFIG","_DOMAIN_PREFIX","BridgeCreateOrderContext","_sourceChainId","sourceChainId","_destChainId","destChainId","_sourceAsset","sourceAsset","_sourceAmount","sourceAmount","_bridgeFeeAmount","_depositId","depositId","_attestationDetails","attestationDetails","_relayer","relayer","_jobId","jobId","_canonicalId","canonicalId","_callDataHash","callDataHash","_nonce","nonce","_callData","callData","BridgeCreateOrderService","_darkSwapOfSourceChain","_darkSwapOfDestChain","getCanonicalTokenAddress","_getCanonicalTokenAddress","canonicalTokenRegistry","CanonicalTokenRegistryAbi","getCanonicalId","getBridgeFee","_getBridgeFee","bridge","BridgeAbi","bridgeFee","canonicalIdFromContract","bridgeFeeAmountFromContract","pickRelayer","submitProof","_submitProof","relayerRequest","response","_yield$this$pollJobSt","error","publicSignals","vkHash","axios","post","status","data","id","pollJobStatus","_pollJobStatus","tries","_response$data","failedReason","_t3","attestationId","leafCount","Promise","resolve","setTimeout","computeDepositId","_computeDepositId","currentNonce","packedData","depositCommitment","solidityPackedKeccak256","getCurrentNonce","solidityPacked","keccak256","_getCurrentNonce","SynaraDarkSwapOnBridgeAssetManagerAbi","composeCallData","_composeCallData","_callee9","functionSignature","args","iface","fullData","_context9","owner","depositOutNote","depositOutNoteFooter","outAssetSource","outAssetDest","outAmount","inNoteFooter","destContractAddress","Interface","encodeFunctionData","_callee0","_context0","_x21","_execute2","_callee1","txHash","_context1","_x22","_execute3","_callee10","_context10","retailDepositBridge","_x23","DarkSwap","serializeDarkSwapMessage","JSON","stringify","deserializePublicKey","publicKeyString","deserializeDarkSwapMessage","serializedMessage","parse"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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