UNPKG

blocklock-js

Version:

A library for encrypting and decrypting data for the future

594 lines (586 loc) 24.1 kB
/* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ import { Contract, ContractFactory, ContractTransactionResponse, Interface, } from "ethers"; import type { Signer, AddressLike, ContractDeployTransaction, ContractRunner, } from "ethers"; import type { NonPayableOverrides } from "../common"; import type { MockBlocklockRevertingReceiver, MockBlocklockRevertingReceiverInterface, } from "../MockBlocklockRevertingReceiver"; const _abi = [ { type: "constructor", inputs: [ { name: "blocklockContract", type: "address", internalType: "address", }, ], stateMutability: "nonpayable", }, { type: "receive", stateMutability: "payable", }, { type: "function", name: "acceptOwnership", inputs: [], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "blocklock", inputs: [], outputs: [ { name: "", type: "address", internalType: "contract IBlocklockSender", }, ], stateMutability: "view", }, { type: "function", name: "createSubscriptionAndFundNative", inputs: [], outputs: [], stateMutability: "payable", }, { type: "function", name: "createTimelockRequestWithDirectFunding", inputs: [ { name: "callbackGasLimit", type: "uint32", internalType: "uint32", }, { name: "condition", type: "bytes", internalType: "bytes", }, { name: "encryptedData", type: "tuple", internalType: "struct TypesLib.Ciphertext", components: [ { name: "u", type: "tuple", internalType: "struct BLS.PointG2", components: [ { name: "x", type: "uint256[2]", internalType: "uint256[2]", }, { name: "y", type: "uint256[2]", internalType: "uint256[2]", }, ], }, { name: "v", type: "bytes", internalType: "bytes", }, { name: "w", type: "bytes", internalType: "bytes", }, ], }, ], outputs: [ { name: "", type: "uint256", internalType: "uint256", }, { name: "", type: "uint256", internalType: "uint256", }, ], stateMutability: "payable", }, { type: "function", name: "createTimelockRequestWithSubscription", inputs: [ { name: "callbackGasLimit", type: "uint32", internalType: "uint32", }, { name: "condition", type: "bytes", internalType: "bytes", }, { name: "encryptedData", type: "tuple", internalType: "struct TypesLib.Ciphertext", components: [ { name: "u", type: "tuple", internalType: "struct BLS.PointG2", components: [ { name: "x", type: "uint256[2]", internalType: "uint256[2]", }, { name: "y", type: "uint256[2]", internalType: "uint256[2]", }, ], }, { name: "v", type: "bytes", internalType: "bytes", }, { name: "w", type: "bytes", internalType: "bytes", }, ], }, ], outputs: [ { name: "", type: "uint256", internalType: "uint256", }, ], stateMutability: "nonpayable", }, { type: "function", name: "encryptedValue", inputs: [], outputs: [ { name: "u", type: "tuple", internalType: "struct BLS.PointG2", components: [ { name: "x", type: "uint256[2]", internalType: "uint256[2]", }, { name: "y", type: "uint256[2]", internalType: "uint256[2]", }, ], }, { name: "v", type: "bytes", internalType: "bytes", }, { name: "w", type: "bytes", internalType: "bytes", }, ], stateMutability: "view", }, { type: "function", name: "fundContractNative", inputs: [], outputs: [], stateMutability: "payable", }, { type: "function", name: "getBalance", inputs: [], outputs: [ { name: "", type: "uint256", internalType: "uint256", }, ], stateMutability: "view", }, { type: "function", name: "isInFlight", inputs: [ { name: "requestId", type: "uint256", internalType: "uint256", }, ], outputs: [ { name: "", type: "bool", internalType: "bool", }, ], stateMutability: "view", }, { type: "function", name: "owner", inputs: [], outputs: [ { name: "", type: "address", internalType: "address", }, ], stateMutability: "view", }, { type: "function", name: "pendingRequestExists", inputs: [ { name: "subId", type: "uint256", internalType: "uint256", }, ], outputs: [ { name: "", type: "bool", internalType: "bool", }, ], stateMutability: "view", }, { type: "function", name: "plainTextValue", inputs: [], outputs: [ { name: "", type: "uint256", internalType: "uint256", }, ], stateMutability: "view", }, { type: "function", name: "receiveBlocklock", inputs: [ { name: "requestId", type: "uint256", internalType: "uint256", }, { name: "decryptionKey", type: "bytes", internalType: "bytes", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "requestId", inputs: [], outputs: [ { name: "", type: "uint256", internalType: "uint256", }, ], stateMutability: "view", }, { type: "function", name: "setBlocklock", inputs: [ { name: "_blocklock", type: "address", internalType: "address", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "setSubId", inputs: [ { name: "subId", type: "uint256", internalType: "uint256", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "subscriptionId", inputs: [], outputs: [ { name: "", type: "uint256", internalType: "uint256", }, ], stateMutability: "view", }, { type: "function", name: "topUpSubscriptionNative", inputs: [], outputs: [], stateMutability: "payable", }, { type: "function", name: "transferOwnership", inputs: [ { name: "to", type: "address", internalType: "address", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "updateSubscription", inputs: [ { name: "consumers", type: "address[]", internalType: "address[]", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "withdrawNative", inputs: [ { name: "amount", type: "uint256", internalType: "uint256", }, { name: "recipient", type: "address", internalType: "address", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "event", name: "Funded", inputs: [ { name: "sender", type: "address", indexed: true, internalType: "address", }, { name: "amount", type: "uint256", indexed: false, internalType: "uint256", }, ], anonymous: false, }, { type: "event", name: "NewSubscriptionId", inputs: [ { name: "subscriptionId", type: "uint256", indexed: true, internalType: "uint256", }, ], anonymous: false, }, { type: "event", name: "OwnershipTransferRequested", inputs: [ { name: "from", type: "address", indexed: true, internalType: "address", }, { name: "to", type: "address", indexed: true, internalType: "address", }, ], anonymous: false, }, { type: "event", name: "OwnershipTransferred", inputs: [ { name: "from", type: "address", indexed: true, internalType: "address", }, { name: "to", type: "address", indexed: true, internalType: "address", }, ], anonymous: false, }, { type: "event", name: "Received", inputs: [ { name: "", type: "address", indexed: false, internalType: "address", }, { name: "", type: "uint256", indexed: false, internalType: "uint256", }, ], anonymous: false, }, { type: "event", name: "Withdrawn", inputs: [ { name: "recipient", type: "address", indexed: true, internalType: "address", }, { name: "amount", type: "uint256", indexed: false, internalType: "uint256", }, ], anonymous: false, }, ] as const; const _bytecode = "0x608060405234801561000f575f5ffd5b506040516117e43803806117e483398101604081905261002e91610186565b8033805f816100845760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b5f80546001600160a01b0319166001600160a01b03848116919091179091558116156100b3576100b3816100de565b5050600280546001600160a01b0319166001600160a01b039390931692909217909155506101b39050565b336001600160a01b038216036101365760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161007b565b600180546001600160a01b0319166001600160a01b038381169182179092555f8054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b5f60208284031215610196575f5ffd5b81516001600160a01b03811681146101ac575f5ffd5b9392505050565b611624806101c05f395ff3fe608060405260043610610128575f3560e01c806379ba5097116100a857806397a9c2851161006d57806397a9c2851461033c578063b8ca8dd814610351578063b96dbba714610370578063cd802c9114610378578063e64a66ea14610397578063f2fde38b1461039f575f5ffd5b806379ba50971461029757806380980043146102ab57806386e560be146102ca5780638da5cb5b146102ed57806393b9740a1461031d575f5ffd5b806341af6c87116100ee57806341af6c87146101e35780634d3de353146102125780634fa26d401461023157806359608fda146102505780635d94180214610278575f5ffd5b80626d6cae1461016b57806309c1ba2e1461019357806312065fe0146101a85780631d2b2afd146101ba57806336bfffed146101c4575f5ffd5b3661016757604080513381523460208201527f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f88525874910160405180910390a1005b5f5ffd5b348015610176575f5ffd5b5061018060045481565b6040519081526020015b60405180910390f35b34801561019e575f5ffd5b5061018060035481565b3480156101b3575f5ffd5b5047610180565b6101c26103be565b005b3480156101cf575f5ffd5b506101c26101de366004610fbe565b610465565b3480156101ee575f5ffd5b506102026101fd36600461102f565b610562565b604051901515815260200161018a565b34801561021d575f5ffd5b5061018061022c36600461108b565b6105d4565b34801561023c575f5ffd5b506101c261024b36600461112e565b61063a565b61026361025e36600461108b565b6106c4565b6040805192835260208301919091520161018a565b348015610283575f5ffd5b506101c261029236600461114e565b610732565b3480156102a2575f5ffd5b506101c2610793565b3480156102b6575f5ffd5b506101c26102c536600461102f565b61083c565b3480156102d5575f5ffd5b506102de610876565b60405161018a939291906111ec565b3480156102f8575f5ffd5b505f546001600160a01b03165b6040516001600160a01b03909116815260200161018a565b348015610328575f5ffd5b50600254610305906001600160a01b031681565b348015610347575f5ffd5b50610180600b5481565b34801561035c575f5ffd5b506101c261036b36600461123b565b610a02565b6101c2610ad5565b348015610383575f5ffd5b5061020261039236600461102f565b610b1c565b6101c2610b4d565b3480156103aa575f5ffd5b506101c26103b936600461112e565b610bcc565b6003545f036104025760405162461bcd60e51b815260206004820152600b60248201526a1cdd58881b9bdd081cd95d60aa1b60448201526064015b60405180910390fd5b60025460035460405163256d573f60e21b815260048101919091526001600160a01b03909116906395b55cfc9034906024015b5f604051808303818588803b15801561044c575f5ffd5b505af115801561045e573d5f5f3e3d5ffd5b5050505050565b61046d610be0565b6003545f036104ae5760405162461bcd60e51b815260206004820152600d60248201526c1cdd589251081b9bdd081cd95d609a1b60448201526064016103f9565b5f5b8181101561055d576002546003546001600160a01b039091169063bec4c08c908585858181106104e2576104e2611265565b90506020020160208101906104f7919061112e565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b031660248201526044015f604051808303815f87803b15801561053b575f5ffd5b505af115801561054d573d5f5f3e3d5ffd5b5050600190920191506104b09050565b505050565b6002546040516341af6c8760e01b8152600481018390525f916001600160a01b0316906341af6c87906024015b602060405180830381865afa1580156105aa573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105ce9190611279565b92915050565b5f5f6106178686868080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250889250610c34915050565b6004819055905082600561062b8282611425565b50506004549695505050505050565b610642610be0565b6001600160a01b0381166106a25760405162461bcd60e51b815260206004820152602160248201527f43616e6e6f7420736574207a65726f20616464726573732061732073656e64656044820152603960f91b60648201526084016103f9565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b5f5f5f5f6107098888888080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152508a9250610cb2915050565b600482905590925090508460056107208282611425565b50506004549890975095505050505050565b6002546001600160a01b0316331461078c5760405162461bcd60e51b815260206004820181905260248201527f4f6e6c7920626c6f636b6c6f636b20636f6e74726163742063616e2063616c6c60448201526064016103f9565b61055d5f5ffd5b6001546001600160a01b031633146107e65760405162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b60448201526064016103f9565b5f8054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610844610be0565b600381905560405181907f5f479ac993925efae23839aa1c813b6ecb2fe1bbd14dc78295ab267d2fca4368905f90a250565b604080516080810180835260059283918391820190839060029082845b81548152602001906001019080831161089357505050918352505060408051808201918290526020909201919060028481019182845b8154815260200190600101908083116108c957505050505081525050908060040180546108f5906112ef565b80601f0160208091040260200160405190810160405280929190818152602001828054610921906112ef565b801561096c5780601f106109435761010080835404028352916020019161096c565b820191905f5260205f20905b81548152906001019060200180831161094f57829003601f168201915b505050505090806005018054610981906112ef565b80601f01602080910402602001604051908101604052809291908181526020018280546109ad906112ef565b80156109f85780601f106109cf576101008083540402835291602001916109f8565b820191905f5260205f20905b8154815290600101906020018083116109db57829003601f168201915b5050505050905083565b610a0a610be0565b81471015610a5a5760405162461bcd60e51b815260206004820152601e60248201527f496e73756666696369656e742066756e647320696e20636f6e7472616374000060448201526064016103f9565b6040516001600160a01b0382169083156108fc029084905f818181858888f19350505050158015610a8d573d5f5f3e3d5ffd5b50806001600160a01b03167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d583604051610ac991815260200190565b60405180910390a25050565b610add610be0565b610ae5610dec565b600381905560025460405163256d573f60e21b815260048101929092526001600160a01b0316906395b55cfc903490602401610435565b60025460405163cd802c9160e01b8152600481018390525f916001600160a01b03169063cd802c919060240161058f565b5f3411610b955760405162461bcd60e51b81526020600482015260166024820152750b2deea40daeae6e840e6cadcc840e6dedaca408aa8960531b60448201526064016103f9565b60405134815233907f5af8184bef8e4b45eb9f6ed7734d04da38ced226495548f46e0c8ff8d7d9a5249060200160405180910390a2565b610bd4610be0565b610bdd81610f16565b50565b5f546001600160a01b03163314610c325760405162461bcd60e51b815260206004820152601660248201527527b7363c9031b0b63630b1363290313c9037bbb732b960511b60448201526064016103f9565b565b6002546003546040516262b1d960e41b81525f926001600160a01b03169163062b1d9091610c6a91889188908890600401611566565b6020604051808303815f875af1158015610c86573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610caa91906115a7565b949350505050565b600254604051634b16093560e01b815263ffffffff851660048201525f9182916001600160a01b0390911690634b16093590602401602060405180830381865afa158015610d02573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d2691906115a7565b905080341015610d6b5760405162461bcd60e51b815260206004820152601060248201526f092dce6eaccccd2c6d2cadce8408aa8960831b60448201526064016103f9565b600254604051637909dc7b60e01b81526001600160a01b0390911690637909dc7b903490610da1908990899089906004016115be565b60206040518083038185885af1158015610dbd573d5f5f3e3d5ffd5b50505050506040513d601f19601f82011682018060405250810190610de291906115a7565b9150935093915050565b5f6003545f14610e3e5760405162461bcd60e51b815260206004820152601a60248201527f537562736372697074696f6e4964206973206e6f74207a65726f00000000000060448201526064016103f9565b60025f9054906101000a90046001600160a01b03166001600160a01b031663a21a23e46040518163ffffffff1660e01b81526004016020604051808303815f875af1158015610e8f573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610eb391906115a7565b600254604051632fb1302360e21b8152600481018390523060248201529192506001600160a01b03169063bec4c08c906044015f604051808303815f87803b158015610efd575f5ffd5b505af1158015610f0f573d5f5f3e3d5ffd5b5050505090565b336001600160a01b03821603610f6e5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016103f9565b600180546001600160a01b0319166001600160a01b038381169182179092555f8054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b5f5f60208385031215610fcf575f5ffd5b823567ffffffffffffffff811115610fe5575f5ffd5b8301601f81018513610ff5575f5ffd5b803567ffffffffffffffff81111561100b575f5ffd5b8560208260051b840101111561101f575f5ffd5b6020919091019590945092505050565b5f6020828403121561103f575f5ffd5b5035919050565b5f5f83601f840112611056575f5ffd5b50813567ffffffffffffffff81111561106d575f5ffd5b602083019150836020828501011115611084575f5ffd5b9250929050565b5f5f5f5f6060858703121561109e575f5ffd5b843563ffffffff811681146110b1575f5ffd5b9350602085013567ffffffffffffffff8111156110cc575f5ffd5b6110d887828801611046565b909450925050604085013567ffffffffffffffff8111156110f7575f5ffd5b850160c08188031215611108575f5ffd5b939692955090935050565b80356001600160a01b0381168114611129575f5ffd5b919050565b5f6020828403121561113e575f5ffd5b61114782611113565b9392505050565b5f5f5f60408486031215611160575f5ffd5b83359250602084013567ffffffffffffffff81111561117d575f5ffd5b61118986828701611046565b9497909650939450505050565b805f5b60028110156111b8578151845260209384019390910190600101611199565b50505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b6111f7818551611196565b5f602085015161120a6040840182611196565b5060c0608083015261121f60c08301856111be565b82810360a084015261123181856111be565b9695505050505050565b5f5f6040838503121561124c575f5ffd5b8235915061125c60208401611113565b90509250929050565b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215611289575f5ffd5b81518015158114611147575f5ffd5b634e487b7160e01b5f52604160045260245ffd5b5f5f8335601e198436030181126112c1575f5ffd5b83018035915067ffffffffffffffff8211156112db575f5ffd5b602001915036819003821315611084575f5ffd5b600181811c9082168061130357607f821691505b60208210810361132157634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561055d57805f5260205f20601f840160051c8101602085101561134c5750805b601f840160051c820191505b8181101561045e575f8155600101611358565b67ffffffffffffffff83111561138357611383611298565b6113978361139183546112ef565b83611327565b5f601f8411600181146113c8575f85156113b15750838201355b5f19600387901b1c1916600186901b17835561045e565b5f83815260208120601f198716915b828110156113f757868501358255602094850194600190920191016113d7565b5086821015611413575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b815f5b600281101561144557813583820155602090910190600101611428565b5050604082015f5b600281101561146d5781358382016002015560209091019060010161144d565b505061147c60808301836112ac565b61148a81836004860161136b565b505061149960a08301836112ac565b6111b881836005860161136b565b5f5f8335601e198436030181126114bc575f5ffd5b830160208101925035905067ffffffffffffffff8111156114db575f5ffd5b803603821315611084575f5ffd5b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b6040818337604080820160408401375f61152e60808301836114a7565b60c0608086015261154360c0860182846114e9565b91505061155360a08401846114a7565b85830360a08701526112318382846114e9565b63ffffffff85168152836020820152608060408201525f61158a60808301856111be565b828103606084015261159c8185611511565b979650505050505050565b5f602082840312156115b7575f5ffd5b5051919050565b63ffffffff84168152606060208201525f6115dc60608301856111be565b8281036040840152611231818561151156fea2646970667358221220240fb49fdcf854cb4e5764d22b83c281c85e3f757c8e7c7b40875986a10fdc6d64736f6c634300081c0033"; type MockBlocklockRevertingReceiverConstructorParams = | [signer?: Signer] | ConstructorParameters<typeof ContractFactory>; const isSuperArgs = ( xs: MockBlocklockRevertingReceiverConstructorParams ): xs is ConstructorParameters<typeof ContractFactory> => xs.length > 1; export class MockBlocklockRevertingReceiver__factory extends ContractFactory { constructor(...args: MockBlocklockRevertingReceiverConstructorParams) { if (isSuperArgs(args)) { super(...args); } else { super(_abi, _bytecode, args[0]); } } override getDeployTransaction( blocklockContract: AddressLike, overrides?: NonPayableOverrides & { from?: string } ): Promise<ContractDeployTransaction> { return super.getDeployTransaction(blocklockContract, overrides || {}); } override deploy( blocklockContract: AddressLike, overrides?: NonPayableOverrides & { from?: string } ) { return super.deploy(blocklockContract, overrides || {}) as Promise< MockBlocklockRevertingReceiver & { deploymentTransaction(): ContractTransactionResponse; } >; } override connect( runner: ContractRunner | null ): MockBlocklockRevertingReceiver__factory { return super.connect(runner) as MockBlocklockRevertingReceiver__factory; } static readonly bytecode = _bytecode; static readonly abi = _abi; static createInterface(): MockBlocklockRevertingReceiverInterface { return new Interface(_abi) as MockBlocklockRevertingReceiverInterface; } static connect( address: string, runner?: ContractRunner | null ): MockBlocklockRevertingReceiver { return new Contract( address, _abi, runner ) as unknown as MockBlocklockRevertingReceiver; } }