UNPKG

@vocdoni/davinci-contracts

Version:

Smart contracts powering DAVINCI's digital voting protocol

261 lines (260 loc) 14.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StateRootLib__factory = void 0; /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ const ethers_1 = require("ethers"); const _abi = [ { inputs: [], name: "BallotModeGroupSizeExceedsNumFields", type: "error", }, { inputs: [], name: "BallotModeMaxValueSumTooLarge", type: "error", }, { inputs: [], name: "BallotModeMaxValueTooLarge", type: "error", }, { inputs: [], name: "BallotModeMinValueSumTooLarge", type: "error", }, { inputs: [], name: "BallotModeMinValueTooLarge", type: "error", }, { inputs: [ { internalType: "bytes31", name: "processId", type: "bytes31", }, { internalType: "enum DAVINCITypes.CensusOrigin", name: "censusOrigin", type: "DAVINCITypes.CensusOrigin", }, { components: [ { internalType: "bool", name: "uniqueValues", type: "bool", }, { internalType: "uint8", name: "numFields", type: "uint8", }, { internalType: "uint8", name: "groupSize", type: "uint8", }, { internalType: "uint8", name: "costExponent", type: "uint8", }, { internalType: "uint256", name: "maxValue", type: "uint256", }, { internalType: "uint256", name: "minValue", type: "uint256", }, { internalType: "uint256", name: "maxValueSum", type: "uint256", }, { internalType: "uint256", name: "minValueSum", type: "uint256", }, ], internalType: "struct DAVINCITypes.BallotMode", name: "ballotMode", type: "tuple", }, { components: [ { internalType: "uint256", name: "x", type: "uint256", }, { internalType: "uint256", name: "y", type: "uint256", }, ], internalType: "struct DAVINCITypes.EncryptionKey", name: "encryptionKey", type: "tuple", }, ], name: "computeStateRoot", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "pure", type: "function", }, { inputs: [ { internalType: "uint256", name: "expectedRoot", type: "uint256", }, { internalType: "bytes31", name: "processId", type: "bytes31", }, { internalType: "enum DAVINCITypes.CensusOrigin", name: "censusOrigin", type: "DAVINCITypes.CensusOrigin", }, { components: [ { internalType: "bool", name: "uniqueValues", type: "bool", }, { internalType: "uint8", name: "numFields", type: "uint8", }, { internalType: "uint8", name: "groupSize", type: "uint8", }, { internalType: "uint8", name: "costExponent", type: "uint8", }, { internalType: "uint256", name: "maxValue", type: "uint256", }, { internalType: "uint256", name: "minValue", type: "uint256", }, { internalType: "uint256", name: "maxValueSum", type: "uint256", }, { internalType: "uint256", name: "minValueSum", type: "uint256", }, ], internalType: "struct DAVINCITypes.BallotMode", name: "ballotMode", type: "tuple", }, { components: [ { internalType: "uint256", name: "x", type: "uint256", }, { internalType: "uint256", name: "y", type: "uint256", }, ], internalType: "struct DAVINCITypes.EncryptionKey", name: "encryptionKey", type: "tuple", }, ], name: "verifyStateRoot", outputs: [ { internalType: "bool", name: "", type: "bool", }, ], stateMutability: "pure", type: "function", }, ]; const _bytecode = "0x60808060405234601957610c43908161001e823930815050f35b5f80fdfe60806040526004361015610011575f80fd5b5f3560e01c80632089f176146106a157635d3f706a1461002f575f80fd5b6101a03660031901126104755760243560ff198116810361047557604435600581101561047557610100366063190112610475576040366101631901126104755760a4359160ff8316908184036104755760843560ff81169283820361047557831061069257506064358015158103610475571561068b576001935b60c4359160ff831683036104755760e43565ffffffffffff811161067c576101043565ffffffffffff811161066d576101243590677fffffffffffffff821161065e576101443592677fffffffffffffff841161064f576101549673__$75f79a42d9bcbdbb69ad79ebd80f556f39$__9a602060405161012a81610b45565b61016435815261018435828201528d60405180809d8194632b0aac7f60e11b835260048301610bb3565b03915af4988915610481575f99610617575b506101bd979899602073__$fc5a2451f3e054f75c2faf9b3818033d8b$__986040519061019282610b75565b5f825260081c8282015260016040820152604051809b81926320cf0a3760e01b835260048301610be0565b03818b5af4988915610481575f996105ce575b509061024599602097969594939261ff0062ff00006301fe00006040519a6101f78c610b75565b60028c5260b81b9960791b9860491b9760191b9660111b169460101b169260081b16171717171717178282015260016040820152604051809581926320cf0a3760e01b835260048301610be0565b0381845af4928315610481575f93610597575b506020610295946040519061026c82610b75565b600382528282015260016040820152604051809681926320cf0a3760e01b835260048301610be0565b0381845af4938415610481575f94610561575b506102e794602091604051916102bd83610b75565b60068352838301526001604083015260405180809881946320cf0a3760e01b835260048301610be0565b03915af4938415610481575f9461052c575b5092602061034f946040519061030e82610b45565b81527f1f72c52b6e5dedca4f99ecfa24f2776732431e8d544e14c6f78f5042727c46578282015260405180968192632b0aac7f60e11b835260048301610bb3565b0381885af4938415610481575f946104f6575b50610397916020916040519161037783610b45565b82528282015260405180938192632b0aac7f60e11b835260048301610bb3565b0381875af4908115610481575f916104c2575b506103df92602091604051916103bf83610b45565b82528282015260405180948192632b0aac7f60e11b835260048301610bb3565b0381865af4918215610481575f9261048c575b5090610429926020926040519261040884610b45565b8352838301526040518080958194632b0aac7f60e11b835260048301610bb3565b03915af48015610481575f9061044a575b6040516004359091148152602090f35b506020813d602011610479575b8161046460209383610b91565b81010312610475576020905161043a565b5f80fd5b3d9150610457565b6040513d5f823e3d90fd5b91506020823d6020116104ba575b816104a760209383610b91565b81010312610475579051906104296103f2565b3d915061049a565b90506020813d6020116104ee575b816104dd60209383610b91565b8101031261047557516103df6103aa565b3d91506104d0565b9093506020813d602011610524575b8161051260209383610b91565b81010312610475575192610397610362565b3d9150610505565b93506020843d602011610559575b8161054760209383610b91565b810103126104755792519260206102f9565b3d915061053a565b9093506020813d60201161058f575b8161057d60209383610b91565b810103126104755751926102e76102a8565b3d9150610570565b9392506020843d6020116105c6575b816105b360209383610b91565b8101031261047557925191926020610258565b3d91506105a6565b9695949392919098506020873d60201161060f575b816105f060209383610b91565b81010312610475576102459960209751999192939495969750996101d0565b3d91506105e3565b9798506020883d602011610647575b8161063360209383610b91565b81010312610475576101bd97519897610166565b3d9150610626565b63dd6f54df60e01b5f5260045ffd5b63271fb80560e01b5f5260045ffd5b63871a7fa360e01b5f5260045ffd5b63481eb79f60e01b5f5260045ffd5b5f936100ab565b633cf60ff760e21b5f5260045ffd5b6101803660031901126104755760043560ff19811681036104755760243560058110156104755761010036604319011261047557604036610143190112610475576084359160ff8316908184036104755760643560ff811692838203610475578310610692575060443580151581036104755715610b3e576001935b60a4359160ff831683036104755760c43565ffffffffffff811161067c5760e43565ffffffffffff811161066d576101043590677fffffffffffffff821161065e576101243592677fffffffffffffff841161064f576107c59673__$75f79a42d9bcbdbb69ad79ebd80f556f39$__9a602060405161079b81610b45565b61014435815261016435828201528d60405180809d8194632b0aac7f60e11b835260048301610bb3565b03915af4988915610481575f99610b06575b50610803979899602073__$fc5a2451f3e054f75c2faf9b3818033d8b$__986040519061019282610b75565b03818b5af4988915610481575f99610abd575b509061083d99602097969594939261ff0062ff00006301fe00006040519a6101f78c610b75565b0381845af4928315610481575f93610a86575b506020610864946040519061026c82610b75565b0381845af4938415610481575f94610a50575b5061088c94602091604051916102bd83610b75565b03915af4938415610481575f94610a1b575b509260206108b3946040519061030e82610b45565b0381885af4938415610481575f946109e5575b506108db916020916040519161037783610b45565b0381875af4908115610481575f916109b1575b5061090392602091604051916103bf83610b45565b0381865af4918215610481575f9261097b575b509061092c926020926040519261040884610b45565b03915af48015610481575f90610948575b604051908152602090f35b506020813d602011610973575b8161096260209383610b91565b81010312610475576020905161093d565b3d9150610955565b91506020823d6020116109a9575b8161099660209383610b91565b810103126104755790519061092c610916565b3d9150610989565b90506020813d6020116109dd575b816109cc60209383610b91565b8101031261047557516109036108ee565b3d91506109bf565b9093506020813d602011610a13575b81610a0160209383610b91565b810103126104755751926108db6108c6565b3d91506109f4565b93506020843d602011610a48575b81610a3660209383610b91565b8101031261047557925192602061089e565b3d9150610a29565b9093506020813d602011610a7e575b81610a6c60209383610b91565b8101031261047557519261088c610877565b3d9150610a5f565b9392506020843d602011610ab5575b81610aa260209383610b91565b8101031261047557925191926020610850565b3d9150610a95565b9695949392919098506020873d602011610afe575b81610adf60209383610b91565b810103126104755761083d996020975199919293949596975099610816565b3d9150610ad2565b9798506020883d602011610b36575b81610b2260209383610b91565b8101031261047557610803975198976107d7565b3d9150610b15565b5f9361071d565b6040810190811067ffffffffffffffff821117610b6157604052565b634e487b7160e01b5f52604160045260245ffd5b6060810190811067ffffffffffffffff821117610b6157604052565b90601f8019910116810190811067ffffffffffffffff821117610b6157604052565b919060408301925f905b60028210610bca57505050565b6020806001928551815201930191019091610bbd565b919060608301925f905b60038210610bf757505050565b6020806001928551815201930191019091610bea56fea26469706673582212201ff505a245a455508862a63c4d10d9e4edcf0d92127b3f22a09f144079f3bca364736f6c634300081c0033"; const isSuperArgs = (xs) => { return (typeof xs[0] === "string" || Array.isArray(xs[0]) || "_isInterface" in xs[0]); }; class StateRootLib__factory extends ethers_1.ContractFactory { constructor(...args) { if (isSuperArgs(args)) { super(...args); } else { const [linkLibraryAddresses, signer] = args; super(_abi, StateRootLib__factory.linkBytecode(linkLibraryAddresses), signer); } } static linkBytecode(linkLibraryAddresses) { let linkedBytecode = _bytecode; linkedBytecode = linkedBytecode.replace(new RegExp("__\\$75f79a42d9bcbdbb69ad79ebd80f556f39\\$__", "g"), linkLibraryAddresses["poseidon-solidity/PoseidonT3.sol:PoseidonT3"] .replace(/^0x/, "") .toLowerCase()); linkedBytecode = linkedBytecode.replace(new RegExp("__\\$fc5a2451f3e054f75c2faf9b3818033d8b\\$__", "g"), linkLibraryAddresses["poseidon-solidity/PoseidonT4.sol:PoseidonT4"] .replace(/^0x/, "") .toLowerCase()); return linkedBytecode; } getDeployTransaction(overrides) { return super.getDeployTransaction(overrides || {}); } deploy(overrides) { return super.deploy(overrides || {}); } connect(runner) { return super.connect(runner); } static createInterface() { return new ethers_1.Interface(_abi); } static connect(address, runner) { return new ethers_1.Contract(address, _abi, runner); } } exports.StateRootLib__factory = StateRootLib__factory; StateRootLib__factory.bytecode = _bytecode; StateRootLib__factory.abi = _abi;