UNPKG

descent-js

Version:

A Typescript library for interacting with the Descent Protocol

424 lines (416 loc) 14.7 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 { Feed, FeedInterface } from '../Feed'; const _abi = [ { inputs: [ { internalType: 'contract Vault', name: '_vault', type: 'address', }, ], stateMutability: 'nonpayable', type: 'constructor', }, { inputs: [], name: 'AccessControlBadConfirmation', type: 'error', }, { inputs: [ { internalType: 'address', name: 'account', type: 'address', }, { internalType: 'bytes32', name: 'neededRole', type: 'bytes32', }, ], name: 'AccessControlUnauthorizedAccount', type: 'error', }, { inputs: [], name: 'Paused', type: 'error', }, { anonymous: false, inputs: [ { indexed: false, internalType: 'address', name: 'collateral', type: 'address', }, { indexed: false, internalType: 'uint256', name: 'price', type: 'uint256', }, ], name: 'Read', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'bytes32', name: 'role', type: 'bytes32', }, { indexed: true, internalType: 'bytes32', name: 'previousAdminRole', type: 'bytes32', }, { indexed: true, internalType: 'bytes32', name: 'newAdminRole', type: 'bytes32', }, ], name: 'RoleAdminChanged', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'bytes32', name: 'role', type: 'bytes32', }, { indexed: true, internalType: 'address', name: 'account', type: 'address', }, { indexed: true, internalType: 'address', name: 'sender', type: 'address', }, ], name: 'RoleGranted', type: 'event', }, { anonymous: false, inputs: [ { indexed: true, internalType: 'bytes32', name: 'role', type: 'bytes32', }, { indexed: true, internalType: 'address', name: 'account', type: 'address', }, { indexed: true, internalType: 'address', name: 'sender', type: 'address', }, ], name: 'RoleRevoked', type: 'event', }, { inputs: [], name: 'DEFAULT_ADMIN_ROLE', outputs: [ { internalType: 'bytes32', name: '', type: 'bytes32', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address', name: '', type: 'address', }, ], name: 'collaterals', outputs: [ { internalType: 'contract IMedian', name: '', type: 'address', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'bytes32', name: 'role', type: 'bytes32', }, ], name: 'getRoleAdmin', outputs: [ { internalType: 'bytes32', name: '', type: 'bytes32', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'bytes32', name: 'role', type: 'bytes32', }, { internalType: 'address', name: 'account', type: 'address', }, ], name: 'grantRole', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'bytes32', name: 'role', type: 'bytes32', }, { internalType: 'address', name: 'account', type: 'address', }, ], name: 'hasRole', outputs: [ { internalType: 'bool', name: '', type: 'bool', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address', name: 'collateral', type: 'address', }, { internalType: 'uint256', name: 'price', type: 'uint256', }, ], name: 'mockUpdatePrice', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'pause', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'bytes32', name: 'role', type: 'bytes32', }, { internalType: 'address', name: 'callerConfirmation', type: 'address', }, ], name: 'renounceRole', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'bytes32', name: 'role', type: 'bytes32', }, { internalType: 'address', name: 'account', type: 'address', }, ], name: 'revokeRole', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'address', name: 'oracle', type: 'address', }, { internalType: 'address', name: 'collateral', type: 'address', }, ], name: 'setPriceOracleContract', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'status', outputs: [ { internalType: 'uint256', name: '', type: 'uint256', }, ], stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'bytes4', name: 'interfaceId', type: 'bytes4', }, ], name: 'supportsInterface', outputs: [ { internalType: 'bool', name: '', type: 'bool', }, ], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'unpause', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { internalType: 'address', name: 'collateral', type: 'address', }, ], name: 'updatePrice', outputs: [], stateMutability: 'nonpayable', type: 'function', }, { inputs: [], name: 'vault', outputs: [ { internalType: 'contract Vault', name: '', type: 'address', }, ], stateMutability: 'view', type: 'function', }, ] as const; const _bytecode = '0x608060405234801561001057600080fd5b50604051610c89380380610c8983398101604081905261002f91610110565b61003a600033610064565b50600180546001600160a01b0319166001600160a01b039290921691909117905560028055610140565b6000828152602081815260408083206001600160a01b038516845290915281205460ff16610106576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556100be3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161010a565b5060005b92915050565b60006020828403121561012257600080fd5b81516001600160a01b038116811461013957600080fd5b9392505050565b610b3a8061014f6000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c80638456cb5911610097578063c7331b0111610066578063c7331b0114610206578063d547741f14610219578063eeb97d3b1461022c578063fbfa77cf1461028757600080fd5b80638456cb591461019f57806391d14854146101a757806396e85ced146101eb578063a217fddf146101fe57600080fd5b80632f2ff15d116100d35780632f2ff15d1461015c57806336568abe146101715780633f4ba83a146101845780635ab68dd81461018c57600080fd5b806301ffc9a7146100fa578063200d2ed214610122578063248a9ca314610139575b600080fd5b61010d6101083660046109f0565b6102a7565b60405190151581526020015b60405180910390f35b61012b60025481565b604051908152602001610119565b61012b610147366004610a39565b60009081526020819052604090206001015490565b61016f61016a366004610a7b565b610340565b005b61016f61017f366004610a7b565b61036b565b61016f6103c9565b61016f61019a366004610aa7565b6103db565b61016f610478565b61010d6101b5366004610a7b565b60009182526020828152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b61016f6101f9366004610ad1565b61048b565b61012b600081565b61016f610214366004610aec565b610659565b61016f610227366004610a7b565b610779565b61026261023a366004610ad1565b60036020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610119565b6001546102629073ffffffffffffffffffffffffffffffffffffffff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061033a57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461035b8161079e565b61036583836107ab565b50505050565b73ffffffffffffffffffffffffffffffffffffffff811633146103ba576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6103c482826108a7565b505050565b60006103d48161079e565b5060028055565b600160025403610417576040517f9e87fac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006104228161079e565b5073ffffffffffffffffffffffffffffffffffffffff90811660009081526003602052604090208054919092167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116179055565b60006104838161079e565b506001600255565b6001600254036104c7576040517f9e87fac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006104d28161079e565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600360205260408082205481517f57de26a40000000000000000000000000000000000000000000000000000000081528251939491909116926357de26a4926004808401939192918290030181865afa158015610550573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105749190610b16565b6001546040517f457972de00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8781166004830152602482018490529294509116915063457972de90604401600060405180830381600087803b1580156105eb57600080fd5b505af11580156105ff573d6000803e3d6000fd5b50506040805173ffffffffffffffffffffffffffffffffffffffff87168152602081018590527feee6047fc5e3ea81b2b940b6b7c0140055ee3f19ba649d78e25718bdf67eae4093500190505b60405180910390a1505050565b600160025403610695576040517f9e87fac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006106a08161079e565b6001546040517f457972de00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152602482018590529091169063457972de90604401600060405180830381600087803b15801561071457600080fd5b505af1158015610728573d6000803e3d6000fd5b50506040805173ffffffffffffffffffffffffffffffffffffffff87168152602081018690527feee6047fc5e3ea81b2b940b6b7c0140055ee3f19ba649d78e25718bdf67eae40935001905061064c565b6000828152602081905260409020600101546107948161079e565b61036583836108a7565b6107a88133610962565b50565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff1661089f5760008381526020818152604080832073ffffffffffffffffffffffffffffffffffffffff86168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561083d3390565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161033a565b50600061033a565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff161561089f5760008381526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8616808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161033a565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166109ec576040517fe2517d3f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024810183905260440160405180910390fd5b5050565b600060208284031215610a0257600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610a3257600080fd5b9392505050565b600060208284031215610a4b57600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610a7657600080fd5b919050565b60008060408385031215610a8e57600080fd5b82359150610a9e60208401610a52565b90509250929050565b60008060408385031215610aba57600080fd5b610ac383610a52565b9150610a9e60208401610a52565b600060208284031215610ae357600080fd5b610a3282610a52565b60008060408385031215610aff57600080fd5b610b0883610a52565b946020939093013593505050565b60008060408385031215610b2957600080fd5b50508051602090910151909290915056'; type FeedConstructorParams = [signer?: Signer] | ConstructorParameters<typeof ContractFactory>; const isSuperArgs = ( xs: FeedConstructorParams, ): xs is ConstructorParameters<typeof ContractFactory> => xs.length > 1; export class Feed__factory extends ContractFactory { constructor(...args: FeedConstructorParams) { if (isSuperArgs(args)) { super(...args); } else { super(_abi, _bytecode, args[0]); } } override getDeployTransaction( _vault: AddressLike, overrides?: NonPayableOverrides & { from?: string }, ): Promise<ContractDeployTransaction> { return super.getDeployTransaction(_vault, overrides || {}); } override deploy(_vault: AddressLike, overrides?: NonPayableOverrides & { from?: string }) { return super.deploy(_vault, overrides || {}) as Promise< Feed & { deploymentTransaction(): ContractTransactionResponse; } >; } override connect(runner: ContractRunner | null): Feed__factory { return super.connect(runner) as Feed__factory; } static readonly bytecode = _bytecode; static readonly abi = _abi; static createInterface(): FeedInterface { return new Interface(_abi) as FeedInterface; } static connect(address: string, runner?: ContractRunner | null): Feed { return new Contract(address, _abi, runner) as unknown as Feed; } }