l1-lottery-contracts
Version:
This repo contains smart contracts and related scripts for ZkNoid L1 Lottery proposed [here](https://forums.minaprotocol.com/t/zknoid-l1-lottery/6269)
82 lines (81 loc) • 2 kB
TypeScript
import { Field, UInt32, Bool, PublicKey, UInt64 } from 'o1js';
declare const Ticket_base: (new (value: {
numbers: UInt32[];
owner: PublicKey;
amount: UInt64;
}) => {
numbers: UInt32[];
owner: PublicKey;
amount: UInt64;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
numbers: UInt32[];
owner: PublicKey;
amount: UInt64;
}, {
numbers: bigint[];
owner: {
x: bigint;
isOdd: boolean;
};
amount: bigint;
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
numbers: UInt32[];
owner: PublicKey;
amount: UInt64;
};
} & {
fromValue: (value: {
numbers: UInt32[] | bigint[];
owner: PublicKey | {
x: Field | bigint;
isOdd: Bool | boolean;
};
amount: bigint | UInt64;
}) => {
numbers: UInt32[];
owner: PublicKey;
amount: UInt64;
};
toInput: (x: {
numbers: UInt32[];
owner: PublicKey;
amount: UInt64;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
numbers: UInt32[];
owner: PublicKey;
amount: UInt64;
}) => {
numbers: string[];
owner: string;
amount: string;
};
fromJSON: (x: {
numbers: string[];
owner: string;
amount: string;
}) => {
numbers: UInt32[];
owner: PublicKey;
amount: UInt64;
};
empty: () => {
numbers: UInt32[];
owner: PublicKey;
amount: UInt64;
};
};
export declare class Ticket extends Ticket_base {
static from(numbers: number[] | UInt32[], owner: PublicKey, amount: number): Ticket;
static random(owner: PublicKey): Ticket;
check(): Bool;
hash(): Field;
getScore(winningCombination: UInt32[]): UInt64;
}
export {};