@descent-protocol/sdk
Version:
A Typescript library for interacting with the Descent Protocol
368 lines (360 loc) • 11.9 kB
text/typescript
/* 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: "AlreadyInitialized",
type: "error",
},
{
inputs: [],
name: "BadPrice",
type: "error",
},
{
inputs: [],
name: "NewOwnerIsZeroAddress",
type: "error",
},
{
inputs: [],
name: "NoHandoverRequest",
type: "error",
},
{
inputs: [],
name: "NotPaused",
type: "error",
},
{
inputs: [],
name: "Paused",
type: "error",
},
{
inputs: [],
name: "Unauthorized",
type: "error",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "pendingOwner",
type: "address",
},
],
name: "OwnershipHandoverCanceled",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "pendingOwner",
type: "address",
},
],
name: "OwnershipHandoverRequested",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "oldOwner",
type: "address",
},
{
indexed: true,
internalType: "address",
name: "newOwner",
type: "address",
},
],
name: "OwnershipTransferred",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "collateral",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "price",
type: "uint256",
},
],
name: "Read",
type: "event",
},
{
inputs: [],
name: "cancelOwnershipHandover",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
internalType: "contract ERC20Token",
name: "",
type: "address",
},
],
name: "collaterals",
outputs: [
{
internalType: "contract IOSM",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "pendingOwner",
type: "address",
},
],
name: "completeOwnershipHandover",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
internalType: "contract ERC20Token",
name: "collateral",
type: "address",
},
{
internalType: "uint256",
name: "price",
type: "uint256",
},
],
name: "mockUpdatePrice",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "owner",
outputs: [
{
internalType: "address",
name: "result",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "pendingOwner",
type: "address",
},
],
name: "ownershipHandoverExpiresAt",
outputs: [
{
internalType: "uint256",
name: "result",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "pause",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "renounceOwnership",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [],
name: "requestOwnershipHandover",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
internalType: "contract ERC20Token",
name: "collateral",
type: "address",
},
{
internalType: "contract IOSM",
name: "oracle",
type: "address",
},
],
name: "setCollateralOSM",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "status",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "newOwner",
type: "address",
},
],
name: "transferOwnership",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [],
name: "unpause",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "contract ERC20Token",
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 =
"0x608060405234801561001057600080fd5b5060405161097538038061097583398101604081905261002f916100a3565b600260005561003d33610067565b600180546001600160a01b0319166001600160a01b039290921691909117905560026000556100d3565b6001600160a01b0316638b78c6d8198190558060007f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b6000602082840312156100b557600080fd5b81516001600160a01b03811681146100cc57600080fd5b9392505050565b610893806100e26000396000f3fe6080604052600436106100e85760003560e01c80638da5cb5b1161008a578063f04e283e11610059578063f04e283e14610252578063f2fde38b14610265578063fbfa77cf14610278578063fee81cf4146102a557600080fd5b80638da5cb5b1461017a57806396e85ced146101cf578063c7331b01146101ef578063eeb97d3b1461020f57600080fd5b8063425bddcf116100c6578063425bddcf1461013557806354d1f13d14610155578063715018a61461015d5780638456cb591461016557600080fd5b8063200d2ed2146100ed57806325692962146101165780633f4ba83a14610120575b600080fd5b3480156100f957600080fd5b5061010360005481565b6040519081526020015b60405180910390f35b61011e6102d8565b005b34801561012c57600080fd5b5061011e610328565b34801561014157600080fd5b5061011e6101503660046107f1565b610373565b61011e61040a565b61011e610446565b34801561017157600080fd5b5061011e61045a565b34801561018657600080fd5b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927545b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010d565b3480156101db57600080fd5b5061011e6101ea36600461082a565b6104a5565b3480156101fb57600080fd5b5061011e61020a36600461084e565b61064e565b34801561021b57600080fd5b506101aa61022a36600461082a565b60026020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b61011e61026036600461082a565b6106cc565b61011e61027336600461082a565b61070c565b34801561028457600080fd5b506001546101aa9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102b157600080fd5b506101036102c036600461082a565b63389a75e1600c908152600091909152602090205490565b60006202a30067ffffffffffffffff164201905063389a75e1600c5233600052806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d600080a250565b600260005403610364576040517f6cd6020100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61036c610733565b6002600055565b6001600054036103af576040517f9e87fac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6103b7610733565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260026020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909216179055565b63389a75e1600c523360005260006020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92600080a2565b61044e610733565b6104586000610769565b565b600160005403610496576040517f9e87fac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61049e610733565b6001600055565b6001600054036104e1576040517f9e87fac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff80821660009081526002602090815260408083205481517f9fa6a6e3000000000000000000000000000000000000000000000000000000008152915193941692639fa6a6e3926004808401939192918290030181865afa15801561055e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610582919061087a565b9050806000036105be576040517ffd1ee34900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001546040517f457972de00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490529091169063457972de90604401600060405180830381600087803b15801561063257600080fd5b505af1158015610646573d6000803e3d6000fd5b505050505050565b60016000540361068a576040517f9e87fac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610692610733565b806000036105be576040517ffd1ee34900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106d4610733565b63389a75e1600c52806000526020600c2080544211156106fc57636f5e88186000526004601cfd5b6000905561070981610769565b50565b610714610733565b8060601b61072a57637448fbae6000526004601cfd5b61070981610769565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314610458576382b429006000526004601cfd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a355565b73ffffffffffffffffffffffffffffffffffffffff8116811461070957600080fd5b6000806040838503121561080457600080fd5b823561080f816107cf565b9150602083013561081f816107cf565b809150509250929050565b60006020828403121561083c57600080fd5b8135610847816107cf565b9392505050565b6000806040838503121561086157600080fd5b823561086c816107cf565b946020939093013593505050565b60006020828403121561088c57600080fd5b505191905056";
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;
}
}