UNPKG

randomness-js

Version:

A library for consuming, verifying and using randomness from the dcipher network

467 lines (459 loc) 20.4 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 { ChainlinkVRFV2PlusWrapperAdapter, ChainlinkVRFV2PlusWrapperAdapterInterface, } from "../ChainlinkVRFV2PlusWrapperAdapter"; const _abi = [ { type: "constructor", inputs: [ { name: "owner", type: "address", internalType: "address", }, { name: "_randomnessSender", type: "address", internalType: "address", }, ], stateMutability: "nonpayable", }, { type: "function", name: "acceptOwnership", inputs: [], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "calculateRequestPriceNative", inputs: [ { name: "_callbackGasLimit", type: "uint32", internalType: "uint32", }, { name: "", type: "uint32", internalType: "uint32", }, ], outputs: [ { name: "", type: "uint256", internalType: "uint256", }, ], stateMutability: "view", }, { type: "function", name: "estimateRequestPriceNative", inputs: [ { name: "_callbackGasLimit", type: "uint32", internalType: "uint32", }, { name: "", type: "uint32", internalType: "uint32", }, { name: "_requestGasPriceWei", type: "uint256", internalType: "uint256", }, ], outputs: [ { name: "", type: "uint256", internalType: "uint256", }, ], stateMutability: "view", }, { type: "function", name: "getConfig", inputs: [], outputs: [ { name: "fallbackWeiPerUnitLink", type: "int256", internalType: "int256", }, { name: "stalenessSeconds", type: "uint32", internalType: "uint32", }, { name: "fulfillmentFlatFeeNativePPM", type: "uint32", internalType: "uint32", }, { name: "fulfillmentFlatFeeLinkDiscountPPM", type: "uint32", internalType: "uint32", }, { name: "wrapperGasOverhead", type: "uint32", internalType: "uint32", }, { name: "coordinatorGasOverheadNative", type: "uint32", internalType: "uint32", }, { name: "coordinatorGasOverheadLink", type: "uint32", internalType: "uint32", }, { name: "coordinatorGasOverheadPerWord", type: "uint16", internalType: "uint16", }, { name: "wrapperNativePremiumPercentage", type: "uint8", internalType: "uint8", }, { name: "wrapperLinkPremiumPercentage", type: "uint8", internalType: "uint8", }, { name: "keyHash", type: "bytes32", internalType: "bytes32", }, { name: "maxNumWords", type: "uint8", internalType: "uint8", }, ], stateMutability: "view", }, { type: "function", name: "lastRequestId", inputs: [], outputs: [ { name: "", type: "uint256", internalType: "uint256", }, ], stateMutability: "view", }, { type: "function", name: "owner", inputs: [], outputs: [ { name: "", type: "address", internalType: "address", }, ], stateMutability: "view", }, { type: "function", name: "randomnessSender", inputs: [], outputs: [ { name: "", type: "address", internalType: "contract IRandomnessSender", }, ], stateMutability: "view", }, { type: "function", name: "receiveRandomness", inputs: [ { name: "requestID", type: "uint256", internalType: "uint256", }, { name: "randomness", type: "bytes32", internalType: "bytes32", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "requestRandomWordsInNative", inputs: [ { name: "_callbackGasLimit", type: "uint32", internalType: "uint32", }, { name: "", type: "uint16", internalType: "uint16", }, { name: "", type: "uint32", internalType: "uint32", }, { name: "", type: "bytes", internalType: "bytes", }, ], outputs: [ { name: "requestId", type: "uint256", internalType: "uint256", }, ], stateMutability: "payable", }, { type: "function", name: "s_callbacks", inputs: [ { name: "", type: "uint256", internalType: "uint256", }, ], outputs: [ { name: "callbackAddress", type: "address", internalType: "address", }, { name: "callbackGasLimit", type: "uint32", internalType: "uint32", }, { name: "requestGasPrice", type: "uint64", internalType: "uint64", }, ], stateMutability: "view", }, { type: "function", name: "setWrapperGasOverhead", inputs: [ { name: "_s_wrapperGasOverhead", type: "uint32", internalType: "uint32", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "transferOwnership", inputs: [ { name: "to", type: "address", internalType: "address", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "typeAndVersion", inputs: [], outputs: [ { name: "", type: "string", internalType: "string", }, ], stateMutability: "pure", }, { 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: "WrapperFulfillmentFailed", inputs: [ { name: "requestId", type: "uint256", indexed: true, internalType: "uint256", }, { name: "consumer", type: "address", indexed: true, internalType: "address", }, ], anonymous: false, }, { type: "event", name: "WrapperGasOverheadUpdated", inputs: [ { name: "newWrapperGasOverhead", type: "uint32", indexed: false, internalType: "uint32", }, ], anonymous: false, }, { type: "error", name: "ReentrancyGuardReentrantCall", inputs: [], }, ] as const; const _bytecode = "0x60806040526003805463ffffffff60a01b1916610c3560a51b179055348015610026575f5ffd5b5060405161151d38038061151d833981016040819052610045916101c9565b60015f908155829081906001600160a01b0382166100aa5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600180546001600160a01b0319166001600160a01b03848116919091179091558116156100da576100da81610105565b5050600380546001600160a01b0319166001600160a01b039390931692909217909155506101fa9050565b336001600160a01b0382160361015d5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016100a1565b600280546001600160a01b0319166001600160a01b03838116918217909255600154604051919216907fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278905f90a350565b80516001600160a01b03811681146101c4575f5ffd5b919050565b5f5f604083850312156101da575f5ffd5b6101e3836101ae565b91506101f1602084016101ae565b90509250929050565b611316806102075f395ff3fe6080604052600436106100ce575f3560e01c80639cfc058e1161007c578063df3fafe811610057578063df3fafe8146102f6578063e1cab74514610322578063f2fde38b14610341578063fc2a88c314610360575f5ffd5b80639cfc058e14610298578063c3f909d4146102ab578063c40684f0146102d7575f5ffd5b806348baa1c5116100ac57806348baa1c51461017057806379ba5097146102395780638da5cb5b1461024d575f5ffd5b806313c34b7f146100d2578063181f5a7714610104578063431ac6571461014f575b5f5ffd5b3480156100dd575f5ffd5b506100f16100ec366004610eb1565b610375565b6040519081526020015b60405180910390f35b34801561010f575f5ffd5b50604080518082018252601681527f5652465632506c75735772617070657220312e302e3000000000000000000000602082015290516100fb9190610ee8565b34801561015a575f5ffd5b5061016e610169366004610f3b565b610445565b005b34801561017b575f5ffd5b506101f861018a366004610f5b565b60056020525f908152604090205473ffffffffffffffffffffffffffffffffffffffff81169074010000000000000000000000000000000000000000810463ffffffff16907801000000000000000000000000000000000000000000000000900467ffffffffffffffff1683565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845263ffffffff909216602084015267ffffffffffffffff16908201526060016100fb565b348015610244575f5ffd5b5061016e6104e3565b348015610258575f5ffd5b5060015473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100fb565b6100f16102a6366004610f72565b6105e3565b3480156102b6575f5ffd5b506102bf6107ad565b6040516100fb9c9b9a9998979695949392919061101a565b3480156102e2575f5ffd5b5061016e6102f136600461109c565b610889565b348015610301575f5ffd5b506003546102739073ffffffffffffffffffffffffffffffffffffffff1681565b34801561032d575f5ffd5b506100f161033c3660046110be565b610917565b34801561034c575f5ffd5b5061016e61035b3660046110fc565b6109ed565b34801561036b575f5ffd5b506100f160045481565b6003545f9073ffffffffffffffffffffffffffffffffffffffff811690634b160935906103c09074010000000000000000000000000000000000000000900463ffffffff168661112f565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815263ffffffff919091166004820152602401602060405180830381865afa158015610418573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061043c9190611170565b90505b92915050565b60035473ffffffffffffffffffffffffffffffffffffffff1633146104cb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f6e6c792072616e646f6d6e65737353656e6465722063616e2063616c6c000060448201526064015b60405180910390fd5b6104df826104da836001610a01565b610aac565b5050565b60025473ffffffffffffffffffffffffffffffffffffffff163314610564576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016104c2565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000008082163390811790935560028054909116905560405173ffffffffffffffffffffffffffffffffffffffff909116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a350565b5f6105ec610ce7565b60035473ffffffffffffffffffffffffffffffffffffffff81169063811ee32a9034906106379074010000000000000000000000000000000000000000900463ffffffff168a61112f565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815263ffffffff91909116600482015260240160206040518083038185885af1158015610690573d5f5f3e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906106b59190611170565b6040805160608101825233815263ffffffff808a16602080840191825267ffffffffffffffff3a81168587019081525f888152600590935295909120935184549251955190911678010000000000000000000000000000000000000000000000000277ffffffffffffffffffffffffffffffffffffffffffffffff9590931674010000000000000000000000000000000000000000027fffffffffffffffff00000000000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff91909116171792909216919091179055600481905590506107a460015f55565b95945050505050565b5f5f5f5f5f5f5f5f5f5f5f5f5f5f60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c3f909d46040518163ffffffff1660e01b815260040160e060405180830381865afa158015610825573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108499190611187565b5095505050935050505f5f835f5f5f5f5f885f5f5f1b60019d509d509d509d509d509d509d509d509d509d509d509d505050909192939495969798999a9b565b610891610d28565b600380547fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000063ffffffff8481168202929092179283905560405192041681527f06072508f4be461bb306c2111807a859ab85e8ae617fbb868cb18a078665072d9060200160405180910390a150565b6003545f9073ffffffffffffffffffffffffffffffffffffffff811690633255c456906109629074010000000000000000000000000000000000000000900463ffffffff168761112f565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815263ffffffff91909116600482015260248101859052604401602060405180830381865afa1580156109c1573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109e59190611170565b949350505050565b6109f5610d28565b6109fe81610dab565b50565b60605f8267ffffffffffffffff811115610a1d57610a1d611223565b604051908082528060200260200182016040528015610a46578160200160208202803683370190505b5090505f5b83811015610aa4576040805160208101879052908101829052606001604051602081830303815290604052805190602001205f1c828281518110610a9157610a91611250565b6020908102919091010152600101610a4b565b509392505050565b5f8281526005602081815260408084208151606081018352815473ffffffffffffffffffffffffffffffffffffffff808216835274010000000000000000000000000000000000000000820463ffffffff1683870152780100000000000000000000000000000000000000000000000090910467ffffffffffffffff169382019390935287865293909252929055805190918116610ba6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e6400000000000000000000000000000060448201526064016104c2565b5f5f631fe543e360e01b8686604051602401610bc392919061127d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090505f8373ffffffffffffffffffffffffffffffffffffffff16856020015163ffffffff1683604051610c5391906112ca565b5f604051808303815f8787f1925050503d805f8114610c8d576040519150601f19603f3d011682016040523d82523d5f602084013e610c92565b606091505b5050905080610cde5760405173ffffffffffffffffffffffffffffffffffffffff85169088907fc551b83c151f2d1c7eeb938ac59008e0409f1c1dc1e2f112449d4d79b4589022905f90a35b50505050505050565b60025f5403610d22576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60025f55565b60015473ffffffffffffffffffffffffffffffffffffffff163314610da9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016104c2565b565b3373ffffffffffffffffffffffffffffffffffffffff821603610e2a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016104c2565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217909255600154604051919216907fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278905f90a350565b63ffffffff811681146109fe575f5ffd5b5f5f60408385031215610ec2575f5ffd5b8235610ecd81610ea0565b91506020830135610edd81610ea0565b809150509250929050565b602081525f82518060208401528060208501604085015e5f6040828501015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011684010191505092915050565b5f5f60408385031215610f4c575f5ffd5b50508035926020909101359150565b5f60208284031215610f6b575f5ffd5b5035919050565b5f5f5f5f5f60808688031215610f86575f5ffd5b8535610f9181610ea0565b9450602086013561ffff81168114610fa7575f5ffd5b93506040860135610fb781610ea0565b9250606086013567ffffffffffffffff811115610fd2575f5ffd5b8601601f81018813610fe2575f5ffd5b803567ffffffffffffffff811115610ff8575f5ffd5b886020828401011115611009575f5ffd5b959894975092955050506020019190565b8c815263ffffffff8c811660208301528b811660408301528a81166060830152898116608083015288811660a0830152871660c0820152610180810161ffff871660e083015260ff861661010083015260ff85166101208301528361014083015261108b61016083018460ff169052565b9d9c50505050505050505050505050565b5f602082840312156110ac575f5ffd5b81356110b781610ea0565b9392505050565b5f5f5f606084860312156110d0575f5ffd5b83356110db81610ea0565b925060208401356110eb81610ea0565b929592945050506040919091013590565b5f6020828403121561110c575f5ffd5b813573ffffffffffffffffffffffffffffffffffffffff811681146110b7575f5ffd5b63ffffffff818116838216019081111561043f577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f60208284031215611180575f5ffd5b5051919050565b5f5f5f5f5f5f5f60e0888a03121561119d575f5ffd5b87516111a881610ea0565b60208901519097506111b981610ea0565b60408901519096506111ca81610ea0565b60608901519095506111db81610ea0565b60808901519094506111ec81610ea0565b60a089015190935060ff81168114611202575f5ffd5b60c089015190925061121381610ea0565b8091505092959891949750929550565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60408201848352604060208401528084518083526060850191506020860192505f5b818110156112be5783518352602093840193909201916001016112a0565b50909695505050505050565b5f82518060208501845e5f92019182525091905056fea264697066735822122076746e941f430c1547198dc6e6e444bf9029a86cf7f7c911b7f9e6dbb75f014f64736f6c634300081c0033"; type ChainlinkVRFV2PlusWrapperAdapterConstructorParams = | [signer?: Signer] | ConstructorParameters<typeof ContractFactory>; const isSuperArgs = ( xs: ChainlinkVRFV2PlusWrapperAdapterConstructorParams ): xs is ConstructorParameters<typeof ContractFactory> => xs.length > 1; export class ChainlinkVRFV2PlusWrapperAdapter__factory extends ContractFactory { constructor(...args: ChainlinkVRFV2PlusWrapperAdapterConstructorParams) { if (isSuperArgs(args)) { super(...args); } else { super(_abi, _bytecode, args[0]); } } override getDeployTransaction( owner: AddressLike, _randomnessSender: AddressLike, overrides?: NonPayableOverrides & { from?: string } ): Promise<ContractDeployTransaction> { return super.getDeployTransaction( owner, _randomnessSender, overrides || {} ); } override deploy( owner: AddressLike, _randomnessSender: AddressLike, overrides?: NonPayableOverrides & { from?: string } ) { return super.deploy(owner, _randomnessSender, overrides || {}) as Promise< ChainlinkVRFV2PlusWrapperAdapter & { deploymentTransaction(): ContractTransactionResponse; } >; } override connect( runner: ContractRunner | null ): ChainlinkVRFV2PlusWrapperAdapter__factory { return super.connect(runner) as ChainlinkVRFV2PlusWrapperAdapter__factory; } static readonly bytecode = _bytecode; static readonly abi = _abi; static createInterface(): ChainlinkVRFV2PlusWrapperAdapterInterface { return new Interface(_abi) as ChainlinkVRFV2PlusWrapperAdapterInterface; } static connect( address: string, runner?: ContractRunner | null ): ChainlinkVRFV2PlusWrapperAdapter { return new Contract( address, _abi, runner ) as unknown as ChainlinkVRFV2PlusWrapperAdapter; } }