From 44ba840bbcc043248761d73f0ef78e25ed19e7ac Mon Sep 17 00:00:00 2001 From: immasandwich Date: Mon, 25 Apr 2022 11:48:36 -0400 Subject: [PATCH] fix(olympus): Add V1 bond depository contract (#258) --- .../abis/olympus-v-1-bond-depository.json | 798 +++++++++++++++ .../ethers/OlympusV1BondDepository.ts | 940 ++++++++++++++++++ .../OlympusV1BondDepository__factory.ts | 816 +++++++++++++++ .../contracts/ethers/factories/index.ts | 1 + src/apps/olympus/contracts/ethers/index.ts | 2 + src/apps/olympus/contracts/index.ts | 5 + src/apps/olympus/index.ts | 1 + 7 files changed, 2563 insertions(+) create mode 100644 src/apps/olympus/contracts/abis/olympus-v-1-bond-depository.json create mode 100644 src/apps/olympus/contracts/ethers/OlympusV1BondDepository.ts create mode 100644 src/apps/olympus/contracts/ethers/factories/OlympusV1BondDepository__factory.ts diff --git a/src/apps/olympus/contracts/abis/olympus-v-1-bond-depository.json b/src/apps/olympus/contracts/abis/olympus-v-1-bond-depository.json new file mode 100644 index 000000000..1b874f87b --- /dev/null +++ b/src/apps/olympus/contracts/abis/olympus-v-1-bond-depository.json @@ -0,0 +1,798 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "_OHM", + "type": "address" + }, + { + "internalType": "address", + "name": "_principle", + "type": "address" + }, + { + "internalType": "address", + "name": "_treasury", + "type": "address" + }, + { + "internalType": "address", + "name": "_DAO", + "type": "address" + }, + { + "internalType": "address", + "name": "_bondCalculator", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "deposit", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "payout", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "expires", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "priceInUSD", + "type": "uint256" + } + ], + "name": "BondCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "priceInUSD", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "internalPrice", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "debtRatio", + "type": "uint256" + } + ], + "name": "BondPriceChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "payout", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "remaining", + "type": "uint256" + } + ], + "name": "BondRedeemed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "initialBCV", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBCV", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "adjustment", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "addition", + "type": "bool" + } + ], + "name": "ControlVariableAdjustment", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipPulled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipPushed", + "type": "event" + }, + { + "inputs": [], + "name": "DAO", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "OHM", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "adjustment", + "outputs": [ + { + "internalType": "bool", + "name": "add", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "rate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "target", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buffer", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastBlock", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "bondCalculator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "bondInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "payout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vesting", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pricePaid", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "bondPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "price_", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "bondPriceInUSD", + "outputs": [ + { + "internalType": "uint256", + "name": "price_", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentDebt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "debtDecay", + "outputs": [ + { + "internalType": "uint256", + "name": "decay_", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "debtRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "debtRatio_", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxPrice", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_depositor", + "type": "address" + } + ], + "name": "deposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_controlVariable", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingTerm", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minimumPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxPayout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxDebt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_initialDebt", + "type": "uint256" + } + ], + "name": "initializeBondTerms", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isLiquidityBond", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastDecay", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxPayout", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + } + ], + "name": "payoutFor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_depositor", + "type": "address" + } + ], + "name": "pendingPayoutFor", + "outputs": [ + { + "internalType": "uint256", + "name": "pendingPayout_", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_depositor", + "type": "address" + } + ], + "name": "percentVestedFor", + "outputs": [ + { + "internalType": "uint256", + "name": "percentVested_", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "policy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "principle", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pullManagement", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner_", + "type": "address" + } + ], + "name": "pushManagement", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "recoverLostToken", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "internalType": "bool", + "name": "_stake", + "type": "bool" + } + ], + "name": "redeem", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceManagement", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_addition", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_increment", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_target", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_buffer", + "type": "uint256" + } + ], + "name": "setAdjustment", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum OlympusBondDepository.PARAMETER", + "name": "_parameter", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "_input", + "type": "uint256" + } + ], + "name": "setBondTerms", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_staking", + "type": "address" + }, + { + "internalType": "bool", + "name": "_helper", + "type": "bool" + } + ], + "name": "setStaking", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "staking", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stakingHelper", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "standardizedDebtRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "terms", + "outputs": [ + { + "internalType": "uint256", + "name": "controlVariable", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vestingTerm", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPayout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "fee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxDebt", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalDebt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "treasury", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "useHelper", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/src/apps/olympus/contracts/ethers/OlympusV1BondDepository.ts b/src/apps/olympus/contracts/ethers/OlympusV1BondDepository.ts new file mode 100644 index 000000000..b12391a8e --- /dev/null +++ b/src/apps/olympus/contracts/ethers/OlympusV1BondDepository.ts @@ -0,0 +1,940 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from './common'; + +export interface OlympusV1BondDepositoryInterface extends utils.Interface { + functions: { + 'DAO()': FunctionFragment; + 'OHM()': FunctionFragment; + 'adjustment()': FunctionFragment; + 'bondCalculator()': FunctionFragment; + 'bondInfo(address)': FunctionFragment; + 'bondPrice()': FunctionFragment; + 'bondPriceInUSD()': FunctionFragment; + 'currentDebt()': FunctionFragment; + 'debtDecay()': FunctionFragment; + 'debtRatio()': FunctionFragment; + 'deposit(uint256,uint256,address)': FunctionFragment; + 'initializeBondTerms(uint256,uint256,uint256,uint256,uint256,uint256,uint256)': FunctionFragment; + 'isLiquidityBond()': FunctionFragment; + 'lastDecay()': FunctionFragment; + 'maxPayout()': FunctionFragment; + 'payoutFor(uint256)': FunctionFragment; + 'pendingPayoutFor(address)': FunctionFragment; + 'percentVestedFor(address)': FunctionFragment; + 'policy()': FunctionFragment; + 'principle()': FunctionFragment; + 'pullManagement()': FunctionFragment; + 'pushManagement(address)': FunctionFragment; + 'recoverLostToken(address)': FunctionFragment; + 'redeem(address,bool)': FunctionFragment; + 'renounceManagement()': FunctionFragment; + 'setAdjustment(bool,uint256,uint256,uint256)': FunctionFragment; + 'setBondTerms(uint8,uint256)': FunctionFragment; + 'setStaking(address,bool)': FunctionFragment; + 'staking()': FunctionFragment; + 'stakingHelper()': FunctionFragment; + 'standardizedDebtRatio()': FunctionFragment; + 'terms()': FunctionFragment; + 'totalDebt()': FunctionFragment; + 'treasury()': FunctionFragment; + 'useHelper()': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'DAO' + | 'OHM' + | 'adjustment' + | 'bondCalculator' + | 'bondInfo' + | 'bondPrice' + | 'bondPriceInUSD' + | 'currentDebt' + | 'debtDecay' + | 'debtRatio' + | 'deposit' + | 'initializeBondTerms' + | 'isLiquidityBond' + | 'lastDecay' + | 'maxPayout' + | 'payoutFor' + | 'pendingPayoutFor' + | 'percentVestedFor' + | 'policy' + | 'principle' + | 'pullManagement' + | 'pushManagement' + | 'recoverLostToken' + | 'redeem' + | 'renounceManagement' + | 'setAdjustment' + | 'setBondTerms' + | 'setStaking' + | 'staking' + | 'stakingHelper' + | 'standardizedDebtRatio' + | 'terms' + | 'totalDebt' + | 'treasury' + | 'useHelper', + ): FunctionFragment; + + encodeFunctionData(functionFragment: 'DAO', values?: undefined): string; + encodeFunctionData(functionFragment: 'OHM', values?: undefined): string; + encodeFunctionData(functionFragment: 'adjustment', values?: undefined): string; + encodeFunctionData(functionFragment: 'bondCalculator', values?: undefined): string; + encodeFunctionData(functionFragment: 'bondInfo', values: [string]): string; + encodeFunctionData(functionFragment: 'bondPrice', values?: undefined): string; + encodeFunctionData(functionFragment: 'bondPriceInUSD', values?: undefined): string; + encodeFunctionData(functionFragment: 'currentDebt', values?: undefined): string; + encodeFunctionData(functionFragment: 'debtDecay', values?: undefined): string; + encodeFunctionData(functionFragment: 'debtRatio', values?: undefined): string; + encodeFunctionData(functionFragment: 'deposit', values: [BigNumberish, BigNumberish, string]): string; + encodeFunctionData( + functionFragment: 'initializeBondTerms', + values: [BigNumberish, BigNumberish, BigNumberish, BigNumberish, BigNumberish, BigNumberish, BigNumberish], + ): string; + encodeFunctionData(functionFragment: 'isLiquidityBond', values?: undefined): string; + encodeFunctionData(functionFragment: 'lastDecay', values?: undefined): string; + encodeFunctionData(functionFragment: 'maxPayout', values?: undefined): string; + encodeFunctionData(functionFragment: 'payoutFor', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'pendingPayoutFor', values: [string]): string; + encodeFunctionData(functionFragment: 'percentVestedFor', values: [string]): string; + encodeFunctionData(functionFragment: 'policy', values?: undefined): string; + encodeFunctionData(functionFragment: 'principle', values?: undefined): string; + encodeFunctionData(functionFragment: 'pullManagement', values?: undefined): string; + encodeFunctionData(functionFragment: 'pushManagement', values: [string]): string; + encodeFunctionData(functionFragment: 'recoverLostToken', values: [string]): string; + encodeFunctionData(functionFragment: 'redeem', values: [string, boolean]): string; + encodeFunctionData(functionFragment: 'renounceManagement', values?: undefined): string; + encodeFunctionData( + functionFragment: 'setAdjustment', + values: [boolean, BigNumberish, BigNumberish, BigNumberish], + ): string; + encodeFunctionData(functionFragment: 'setBondTerms', values: [BigNumberish, BigNumberish]): string; + encodeFunctionData(functionFragment: 'setStaking', values: [string, boolean]): string; + encodeFunctionData(functionFragment: 'staking', values?: undefined): string; + encodeFunctionData(functionFragment: 'stakingHelper', values?: undefined): string; + encodeFunctionData(functionFragment: 'standardizedDebtRatio', values?: undefined): string; + encodeFunctionData(functionFragment: 'terms', values?: undefined): string; + encodeFunctionData(functionFragment: 'totalDebt', values?: undefined): string; + encodeFunctionData(functionFragment: 'treasury', values?: undefined): string; + encodeFunctionData(functionFragment: 'useHelper', values?: undefined): string; + + decodeFunctionResult(functionFragment: 'DAO', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'OHM', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'adjustment', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'bondCalculator', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'bondInfo', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'bondPrice', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'bondPriceInUSD', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'currentDebt', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'debtDecay', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'debtRatio', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'deposit', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'initializeBondTerms', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'isLiquidityBond', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'lastDecay', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'maxPayout', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'payoutFor', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'pendingPayoutFor', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'percentVestedFor', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'policy', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'principle', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'pullManagement', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'pushManagement', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'recoverLostToken', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'redeem', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'renounceManagement', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setAdjustment', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setBondTerms', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setStaking', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'staking', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'stakingHelper', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'standardizedDebtRatio', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'terms', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalDebt', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'treasury', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'useHelper', data: BytesLike): Result; + + events: { + 'BondCreated(uint256,uint256,uint256,uint256)': EventFragment; + 'BondPriceChanged(uint256,uint256,uint256)': EventFragment; + 'BondRedeemed(address,uint256,uint256)': EventFragment; + 'ControlVariableAdjustment(uint256,uint256,uint256,bool)': EventFragment; + 'OwnershipPulled(address,address)': EventFragment; + 'OwnershipPushed(address,address)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'BondCreated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'BondPriceChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'BondRedeemed'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'ControlVariableAdjustment'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnershipPulled'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnershipPushed'): EventFragment; +} + +export interface BondCreatedEventObject { + deposit: BigNumber; + payout: BigNumber; + expires: BigNumber; + priceInUSD: BigNumber; +} +export type BondCreatedEvent = TypedEvent<[BigNumber, BigNumber, BigNumber, BigNumber], BondCreatedEventObject>; + +export type BondCreatedEventFilter = TypedEventFilter; + +export interface BondPriceChangedEventObject { + priceInUSD: BigNumber; + internalPrice: BigNumber; + debtRatio: BigNumber; +} +export type BondPriceChangedEvent = TypedEvent<[BigNumber, BigNumber, BigNumber], BondPriceChangedEventObject>; + +export type BondPriceChangedEventFilter = TypedEventFilter; + +export interface BondRedeemedEventObject { + recipient: string; + payout: BigNumber; + remaining: BigNumber; +} +export type BondRedeemedEvent = TypedEvent<[string, BigNumber, BigNumber], BondRedeemedEventObject>; + +export type BondRedeemedEventFilter = TypedEventFilter; + +export interface ControlVariableAdjustmentEventObject { + initialBCV: BigNumber; + newBCV: BigNumber; + adjustment: BigNumber; + addition: boolean; +} +export type ControlVariableAdjustmentEvent = TypedEvent< + [BigNumber, BigNumber, BigNumber, boolean], + ControlVariableAdjustmentEventObject +>; + +export type ControlVariableAdjustmentEventFilter = TypedEventFilter; + +export interface OwnershipPulledEventObject { + previousOwner: string; + newOwner: string; +} +export type OwnershipPulledEvent = TypedEvent<[string, string], OwnershipPulledEventObject>; + +export type OwnershipPulledEventFilter = TypedEventFilter; + +export interface OwnershipPushedEventObject { + previousOwner: string; + newOwner: string; +} +export type OwnershipPushedEvent = TypedEvent<[string, string], OwnershipPushedEventObject>; + +export type OwnershipPushedEventFilter = TypedEventFilter; + +export interface OlympusV1BondDepository extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: OlympusV1BondDepositoryInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + DAO(overrides?: CallOverrides): Promise<[string]>; + + OHM(overrides?: CallOverrides): Promise<[string]>; + + adjustment(overrides?: CallOverrides): Promise< + [boolean, BigNumber, BigNumber, BigNumber, BigNumber] & { + add: boolean; + rate: BigNumber; + target: BigNumber; + buffer: BigNumber; + lastBlock: BigNumber; + } + >; + + bondCalculator(overrides?: CallOverrides): Promise<[string]>; + + bondInfo( + arg0: string, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + payout: BigNumber; + vesting: BigNumber; + lastBlock: BigNumber; + pricePaid: BigNumber; + } + >; + + bondPrice(overrides?: CallOverrides): Promise<[BigNumber] & { price_: BigNumber }>; + + bondPriceInUSD(overrides?: CallOverrides): Promise<[BigNumber] & { price_: BigNumber }>; + + currentDebt(overrides?: CallOverrides): Promise<[BigNumber]>; + + debtDecay(overrides?: CallOverrides): Promise<[BigNumber] & { decay_: BigNumber }>; + + debtRatio(overrides?: CallOverrides): Promise<[BigNumber] & { debtRatio_: BigNumber }>; + + deposit( + _amount: BigNumberish, + _maxPrice: BigNumberish, + _depositor: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initializeBondTerms( + _controlVariable: BigNumberish, + _vestingTerm: BigNumberish, + _minimumPrice: BigNumberish, + _maxPayout: BigNumberish, + _fee: BigNumberish, + _maxDebt: BigNumberish, + _initialDebt: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + isLiquidityBond(overrides?: CallOverrides): Promise<[boolean]>; + + lastDecay(overrides?: CallOverrides): Promise<[BigNumber]>; + + maxPayout(overrides?: CallOverrides): Promise<[BigNumber]>; + + payoutFor(_value: BigNumberish, overrides?: CallOverrides): Promise<[BigNumber]>; + + pendingPayoutFor( + _depositor: string, + overrides?: CallOverrides, + ): Promise<[BigNumber] & { pendingPayout_: BigNumber }>; + + percentVestedFor( + _depositor: string, + overrides?: CallOverrides, + ): Promise<[BigNumber] & { percentVested_: BigNumber }>; + + policy(overrides?: CallOverrides): Promise<[string]>; + + principle(overrides?: CallOverrides): Promise<[string]>; + + pullManagement(overrides?: Overrides & { from?: string | Promise }): Promise; + + pushManagement( + newOwner_: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + recoverLostToken( + _token: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + redeem( + _recipient: string, + _stake: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + renounceManagement(overrides?: Overrides & { from?: string | Promise }): Promise; + + setAdjustment( + _addition: boolean, + _increment: BigNumberish, + _target: BigNumberish, + _buffer: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setBondTerms( + _parameter: BigNumberish, + _input: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setStaking( + _staking: string, + _helper: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + staking(overrides?: CallOverrides): Promise<[string]>; + + stakingHelper(overrides?: CallOverrides): Promise<[string]>; + + standardizedDebtRatio(overrides?: CallOverrides): Promise<[BigNumber]>; + + terms(overrides?: CallOverrides): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { + controlVariable: BigNumber; + vestingTerm: BigNumber; + minimumPrice: BigNumber; + maxPayout: BigNumber; + fee: BigNumber; + maxDebt: BigNumber; + } + >; + + totalDebt(overrides?: CallOverrides): Promise<[BigNumber]>; + + treasury(overrides?: CallOverrides): Promise<[string]>; + + useHelper(overrides?: CallOverrides): Promise<[boolean]>; + }; + + DAO(overrides?: CallOverrides): Promise; + + OHM(overrides?: CallOverrides): Promise; + + adjustment(overrides?: CallOverrides): Promise< + [boolean, BigNumber, BigNumber, BigNumber, BigNumber] & { + add: boolean; + rate: BigNumber; + target: BigNumber; + buffer: BigNumber; + lastBlock: BigNumber; + } + >; + + bondCalculator(overrides?: CallOverrides): Promise; + + bondInfo( + arg0: string, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + payout: BigNumber; + vesting: BigNumber; + lastBlock: BigNumber; + pricePaid: BigNumber; + } + >; + + bondPrice(overrides?: CallOverrides): Promise; + + bondPriceInUSD(overrides?: CallOverrides): Promise; + + currentDebt(overrides?: CallOverrides): Promise; + + debtDecay(overrides?: CallOverrides): Promise; + + debtRatio(overrides?: CallOverrides): Promise; + + deposit( + _amount: BigNumberish, + _maxPrice: BigNumberish, + _depositor: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initializeBondTerms( + _controlVariable: BigNumberish, + _vestingTerm: BigNumberish, + _minimumPrice: BigNumberish, + _maxPayout: BigNumberish, + _fee: BigNumberish, + _maxDebt: BigNumberish, + _initialDebt: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + isLiquidityBond(overrides?: CallOverrides): Promise; + + lastDecay(overrides?: CallOverrides): Promise; + + maxPayout(overrides?: CallOverrides): Promise; + + payoutFor(_value: BigNumberish, overrides?: CallOverrides): Promise; + + pendingPayoutFor(_depositor: string, overrides?: CallOverrides): Promise; + + percentVestedFor(_depositor: string, overrides?: CallOverrides): Promise; + + policy(overrides?: CallOverrides): Promise; + + principle(overrides?: CallOverrides): Promise; + + pullManagement(overrides?: Overrides & { from?: string | Promise }): Promise; + + pushManagement( + newOwner_: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + recoverLostToken( + _token: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + redeem( + _recipient: string, + _stake: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + renounceManagement(overrides?: Overrides & { from?: string | Promise }): Promise; + + setAdjustment( + _addition: boolean, + _increment: BigNumberish, + _target: BigNumberish, + _buffer: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setBondTerms( + _parameter: BigNumberish, + _input: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setStaking( + _staking: string, + _helper: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + staking(overrides?: CallOverrides): Promise; + + stakingHelper(overrides?: CallOverrides): Promise; + + standardizedDebtRatio(overrides?: CallOverrides): Promise; + + terms(overrides?: CallOverrides): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { + controlVariable: BigNumber; + vestingTerm: BigNumber; + minimumPrice: BigNumber; + maxPayout: BigNumber; + fee: BigNumber; + maxDebt: BigNumber; + } + >; + + totalDebt(overrides?: CallOverrides): Promise; + + treasury(overrides?: CallOverrides): Promise; + + useHelper(overrides?: CallOverrides): Promise; + + callStatic: { + DAO(overrides?: CallOverrides): Promise; + + OHM(overrides?: CallOverrides): Promise; + + adjustment(overrides?: CallOverrides): Promise< + [boolean, BigNumber, BigNumber, BigNumber, BigNumber] & { + add: boolean; + rate: BigNumber; + target: BigNumber; + buffer: BigNumber; + lastBlock: BigNumber; + } + >; + + bondCalculator(overrides?: CallOverrides): Promise; + + bondInfo( + arg0: string, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + payout: BigNumber; + vesting: BigNumber; + lastBlock: BigNumber; + pricePaid: BigNumber; + } + >; + + bondPrice(overrides?: CallOverrides): Promise; + + bondPriceInUSD(overrides?: CallOverrides): Promise; + + currentDebt(overrides?: CallOverrides): Promise; + + debtDecay(overrides?: CallOverrides): Promise; + + debtRatio(overrides?: CallOverrides): Promise; + + deposit( + _amount: BigNumberish, + _maxPrice: BigNumberish, + _depositor: string, + overrides?: CallOverrides, + ): Promise; + + initializeBondTerms( + _controlVariable: BigNumberish, + _vestingTerm: BigNumberish, + _minimumPrice: BigNumberish, + _maxPayout: BigNumberish, + _fee: BigNumberish, + _maxDebt: BigNumberish, + _initialDebt: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + isLiquidityBond(overrides?: CallOverrides): Promise; + + lastDecay(overrides?: CallOverrides): Promise; + + maxPayout(overrides?: CallOverrides): Promise; + + payoutFor(_value: BigNumberish, overrides?: CallOverrides): Promise; + + pendingPayoutFor(_depositor: string, overrides?: CallOverrides): Promise; + + percentVestedFor(_depositor: string, overrides?: CallOverrides): Promise; + + policy(overrides?: CallOverrides): Promise; + + principle(overrides?: CallOverrides): Promise; + + pullManagement(overrides?: CallOverrides): Promise; + + pushManagement(newOwner_: string, overrides?: CallOverrides): Promise; + + recoverLostToken(_token: string, overrides?: CallOverrides): Promise; + + redeem(_recipient: string, _stake: boolean, overrides?: CallOverrides): Promise; + + renounceManagement(overrides?: CallOverrides): Promise; + + setAdjustment( + _addition: boolean, + _increment: BigNumberish, + _target: BigNumberish, + _buffer: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + setBondTerms(_parameter: BigNumberish, _input: BigNumberish, overrides?: CallOverrides): Promise; + + setStaking(_staking: string, _helper: boolean, overrides?: CallOverrides): Promise; + + staking(overrides?: CallOverrides): Promise; + + stakingHelper(overrides?: CallOverrides): Promise; + + standardizedDebtRatio(overrides?: CallOverrides): Promise; + + terms(overrides?: CallOverrides): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { + controlVariable: BigNumber; + vestingTerm: BigNumber; + minimumPrice: BigNumber; + maxPayout: BigNumber; + fee: BigNumber; + maxDebt: BigNumber; + } + >; + + totalDebt(overrides?: CallOverrides): Promise; + + treasury(overrides?: CallOverrides): Promise; + + useHelper(overrides?: CallOverrides): Promise; + }; + + filters: { + 'BondCreated(uint256,uint256,uint256,uint256)'( + deposit?: null, + payout?: BigNumberish | null, + expires?: BigNumberish | null, + priceInUSD?: BigNumberish | null, + ): BondCreatedEventFilter; + BondCreated( + deposit?: null, + payout?: BigNumberish | null, + expires?: BigNumberish | null, + priceInUSD?: BigNumberish | null, + ): BondCreatedEventFilter; + + 'BondPriceChanged(uint256,uint256,uint256)'( + priceInUSD?: BigNumberish | null, + internalPrice?: BigNumberish | null, + debtRatio?: BigNumberish | null, + ): BondPriceChangedEventFilter; + BondPriceChanged( + priceInUSD?: BigNumberish | null, + internalPrice?: BigNumberish | null, + debtRatio?: BigNumberish | null, + ): BondPriceChangedEventFilter; + + 'BondRedeemed(address,uint256,uint256)'( + recipient?: string | null, + payout?: null, + remaining?: null, + ): BondRedeemedEventFilter; + BondRedeemed(recipient?: string | null, payout?: null, remaining?: null): BondRedeemedEventFilter; + + 'ControlVariableAdjustment(uint256,uint256,uint256,bool)'( + initialBCV?: null, + newBCV?: null, + adjustment?: null, + addition?: null, + ): ControlVariableAdjustmentEventFilter; + ControlVariableAdjustment( + initialBCV?: null, + newBCV?: null, + adjustment?: null, + addition?: null, + ): ControlVariableAdjustmentEventFilter; + + 'OwnershipPulled(address,address)'( + previousOwner?: string | null, + newOwner?: string | null, + ): OwnershipPulledEventFilter; + OwnershipPulled(previousOwner?: string | null, newOwner?: string | null): OwnershipPulledEventFilter; + + 'OwnershipPushed(address,address)'( + previousOwner?: string | null, + newOwner?: string | null, + ): OwnershipPushedEventFilter; + OwnershipPushed(previousOwner?: string | null, newOwner?: string | null): OwnershipPushedEventFilter; + }; + + estimateGas: { + DAO(overrides?: CallOverrides): Promise; + + OHM(overrides?: CallOverrides): Promise; + + adjustment(overrides?: CallOverrides): Promise; + + bondCalculator(overrides?: CallOverrides): Promise; + + bondInfo(arg0: string, overrides?: CallOverrides): Promise; + + bondPrice(overrides?: CallOverrides): Promise; + + bondPriceInUSD(overrides?: CallOverrides): Promise; + + currentDebt(overrides?: CallOverrides): Promise; + + debtDecay(overrides?: CallOverrides): Promise; + + debtRatio(overrides?: CallOverrides): Promise; + + deposit( + _amount: BigNumberish, + _maxPrice: BigNumberish, + _depositor: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initializeBondTerms( + _controlVariable: BigNumberish, + _vestingTerm: BigNumberish, + _minimumPrice: BigNumberish, + _maxPayout: BigNumberish, + _fee: BigNumberish, + _maxDebt: BigNumberish, + _initialDebt: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + isLiquidityBond(overrides?: CallOverrides): Promise; + + lastDecay(overrides?: CallOverrides): Promise; + + maxPayout(overrides?: CallOverrides): Promise; + + payoutFor(_value: BigNumberish, overrides?: CallOverrides): Promise; + + pendingPayoutFor(_depositor: string, overrides?: CallOverrides): Promise; + + percentVestedFor(_depositor: string, overrides?: CallOverrides): Promise; + + policy(overrides?: CallOverrides): Promise; + + principle(overrides?: CallOverrides): Promise; + + pullManagement(overrides?: Overrides & { from?: string | Promise }): Promise; + + pushManagement(newOwner_: string, overrides?: Overrides & { from?: string | Promise }): Promise; + + recoverLostToken(_token: string, overrides?: Overrides & { from?: string | Promise }): Promise; + + redeem( + _recipient: string, + _stake: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + renounceManagement(overrides?: Overrides & { from?: string | Promise }): Promise; + + setAdjustment( + _addition: boolean, + _increment: BigNumberish, + _target: BigNumberish, + _buffer: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setBondTerms( + _parameter: BigNumberish, + _input: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setStaking( + _staking: string, + _helper: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + staking(overrides?: CallOverrides): Promise; + + stakingHelper(overrides?: CallOverrides): Promise; + + standardizedDebtRatio(overrides?: CallOverrides): Promise; + + terms(overrides?: CallOverrides): Promise; + + totalDebt(overrides?: CallOverrides): Promise; + + treasury(overrides?: CallOverrides): Promise; + + useHelper(overrides?: CallOverrides): Promise; + }; + + populateTransaction: { + DAO(overrides?: CallOverrides): Promise; + + OHM(overrides?: CallOverrides): Promise; + + adjustment(overrides?: CallOverrides): Promise; + + bondCalculator(overrides?: CallOverrides): Promise; + + bondInfo(arg0: string, overrides?: CallOverrides): Promise; + + bondPrice(overrides?: CallOverrides): Promise; + + bondPriceInUSD(overrides?: CallOverrides): Promise; + + currentDebt(overrides?: CallOverrides): Promise; + + debtDecay(overrides?: CallOverrides): Promise; + + debtRatio(overrides?: CallOverrides): Promise; + + deposit( + _amount: BigNumberish, + _maxPrice: BigNumberish, + _depositor: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initializeBondTerms( + _controlVariable: BigNumberish, + _vestingTerm: BigNumberish, + _minimumPrice: BigNumberish, + _maxPayout: BigNumberish, + _fee: BigNumberish, + _maxDebt: BigNumberish, + _initialDebt: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + isLiquidityBond(overrides?: CallOverrides): Promise; + + lastDecay(overrides?: CallOverrides): Promise; + + maxPayout(overrides?: CallOverrides): Promise; + + payoutFor(_value: BigNumberish, overrides?: CallOverrides): Promise; + + pendingPayoutFor(_depositor: string, overrides?: CallOverrides): Promise; + + percentVestedFor(_depositor: string, overrides?: CallOverrides): Promise; + + policy(overrides?: CallOverrides): Promise; + + principle(overrides?: CallOverrides): Promise; + + pullManagement(overrides?: Overrides & { from?: string | Promise }): Promise; + + pushManagement( + newOwner_: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + recoverLostToken( + _token: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + redeem( + _recipient: string, + _stake: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + renounceManagement(overrides?: Overrides & { from?: string | Promise }): Promise; + + setAdjustment( + _addition: boolean, + _increment: BigNumberish, + _target: BigNumberish, + _buffer: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setBondTerms( + _parameter: BigNumberish, + _input: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setStaking( + _staking: string, + _helper: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + staking(overrides?: CallOverrides): Promise; + + stakingHelper(overrides?: CallOverrides): Promise; + + standardizedDebtRatio(overrides?: CallOverrides): Promise; + + terms(overrides?: CallOverrides): Promise; + + totalDebt(overrides?: CallOverrides): Promise; + + treasury(overrides?: CallOverrides): Promise; + + useHelper(overrides?: CallOverrides): Promise; + }; +} diff --git a/src/apps/olympus/contracts/ethers/factories/OlympusV1BondDepository__factory.ts b/src/apps/olympus/contracts/ethers/factories/OlympusV1BondDepository__factory.ts new file mode 100644 index 000000000..d7e78ba20 --- /dev/null +++ b/src/apps/olympus/contracts/ethers/factories/OlympusV1BondDepository__factory.ts @@ -0,0 +1,816 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { OlympusV1BondDepository, OlympusV1BondDepositoryInterface } from '../OlympusV1BondDepository'; + +const _abi = [ + { + inputs: [ + { + internalType: 'address', + name: '_OHM', + type: 'address', + }, + { + internalType: 'address', + name: '_principle', + type: 'address', + }, + { + internalType: 'address', + name: '_treasury', + type: 'address', + }, + { + internalType: 'address', + name: '_DAO', + type: 'address', + }, + { + internalType: 'address', + name: '_bondCalculator', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'deposit', + type: 'uint256', + }, + { + indexed: true, + internalType: 'uint256', + name: 'payout', + type: 'uint256', + }, + { + indexed: true, + internalType: 'uint256', + name: 'expires', + type: 'uint256', + }, + { + indexed: true, + internalType: 'uint256', + name: 'priceInUSD', + type: 'uint256', + }, + ], + name: 'BondCreated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'priceInUSD', + type: 'uint256', + }, + { + indexed: true, + internalType: 'uint256', + name: 'internalPrice', + type: 'uint256', + }, + { + indexed: true, + internalType: 'uint256', + name: 'debtRatio', + type: 'uint256', + }, + ], + name: 'BondPriceChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'payout', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'remaining', + type: 'uint256', + }, + ], + name: 'BondRedeemed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'initialBCV', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newBCV', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'adjustment', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bool', + name: 'addition', + type: 'bool', + }, + ], + name: 'ControlVariableAdjustment', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipPulled', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipPushed', + type: 'event', + }, + { + inputs: [], + name: 'DAO', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'OHM', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'adjustment', + outputs: [ + { + internalType: 'bool', + name: 'add', + type: 'bool', + }, + { + internalType: 'uint256', + name: 'rate', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'target', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'buffer', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastBlock', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'bondCalculator', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'bondInfo', + outputs: [ + { + internalType: 'uint256', + name: 'payout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'vesting', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastBlock', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'pricePaid', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'bondPrice', + outputs: [ + { + internalType: 'uint256', + name: 'price_', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'bondPriceInUSD', + outputs: [ + { + internalType: 'uint256', + name: 'price_', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'currentDebt', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'debtDecay', + outputs: [ + { + internalType: 'uint256', + name: 'decay_', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'debtRatio', + outputs: [ + { + internalType: 'uint256', + name: 'debtRatio_', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_maxPrice', + type: 'uint256', + }, + { + internalType: 'address', + name: '_depositor', + type: 'address', + }, + ], + name: 'deposit', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_controlVariable', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_vestingTerm', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_minimumPrice', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_maxPayout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_fee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_maxDebt', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_initialDebt', + type: 'uint256', + }, + ], + name: 'initializeBondTerms', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'isLiquidityBond', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'lastDecay', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxPayout', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_value', + type: 'uint256', + }, + ], + name: 'payoutFor', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_depositor', + type: 'address', + }, + ], + name: 'pendingPayoutFor', + outputs: [ + { + internalType: 'uint256', + name: 'pendingPayout_', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_depositor', + type: 'address', + }, + ], + name: 'percentVestedFor', + outputs: [ + { + internalType: 'uint256', + name: 'percentVested_', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'policy', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'principle', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'pullManagement', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner_', + type: 'address', + }, + ], + name: 'pushManagement', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_token', + type: 'address', + }, + ], + name: 'recoverLostToken', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_recipient', + type: 'address', + }, + { + internalType: 'bool', + name: '_stake', + type: 'bool', + }, + ], + name: 'redeem', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'renounceManagement', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bool', + name: '_addition', + type: 'bool', + }, + { + internalType: 'uint256', + name: '_increment', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_target', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_buffer', + type: 'uint256', + }, + ], + name: 'setAdjustment', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'enum OlympusBondDepository.PARAMETER', + name: '_parameter', + type: 'uint8', + }, + { + internalType: 'uint256', + name: '_input', + type: 'uint256', + }, + ], + name: 'setBondTerms', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_staking', + type: 'address', + }, + { + internalType: 'bool', + name: '_helper', + type: 'bool', + }, + ], + name: 'setStaking', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'staking', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'stakingHelper', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'standardizedDebtRatio', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'terms', + outputs: [ + { + internalType: 'uint256', + name: 'controlVariable', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'vestingTerm', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minimumPrice', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxPayout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'fee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxDebt', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalDebt', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'treasury', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'useHelper', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, +]; + +export class OlympusV1BondDepository__factory { + static readonly abi = _abi; + static createInterface(): OlympusV1BondDepositoryInterface { + return new utils.Interface(_abi) as OlympusV1BondDepositoryInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): OlympusV1BondDepository { + return new Contract(address, _abi, signerOrProvider) as OlympusV1BondDepository; + } +} diff --git a/src/apps/olympus/contracts/ethers/factories/index.ts b/src/apps/olympus/contracts/ethers/factories/index.ts index d7c008e17..d3c8b4f9c 100644 --- a/src/apps/olympus/contracts/ethers/factories/index.ts +++ b/src/apps/olympus/contracts/ethers/factories/index.ts @@ -4,6 +4,7 @@ export { OlympusGOhmToken__factory } from './OlympusGOhmToken__factory'; export { OlympusSOhmToken__factory } from './OlympusSOhmToken__factory'; export { OlympusSOhmV1Token__factory } from './OlympusSOhmV1Token__factory'; +export { OlympusV1BondDepository__factory } from './OlympusV1BondDepository__factory'; export { OlympusV2BondDepository__factory } from './OlympusV2BondDepository__factory'; export { OlympusWsOhmV1Token__factory } from './OlympusWsOhmV1Token__factory'; export { OlympusZapperZap__factory } from './OlympusZapperZap__factory'; diff --git a/src/apps/olympus/contracts/ethers/index.ts b/src/apps/olympus/contracts/ethers/index.ts index 3653a4d59..84d6bd74f 100644 --- a/src/apps/olympus/contracts/ethers/index.ts +++ b/src/apps/olympus/contracts/ethers/index.ts @@ -4,6 +4,7 @@ export type { OlympusGOhmToken } from './OlympusGOhmToken'; export type { OlympusSOhmToken } from './OlympusSOhmToken'; export type { OlympusSOhmV1Token } from './OlympusSOhmV1Token'; +export type { OlympusV1BondDepository } from './OlympusV1BondDepository'; export type { OlympusV2BondDepository } from './OlympusV2BondDepository'; export type { OlympusWsOhmV1Token } from './OlympusWsOhmV1Token'; export type { OlympusZapperZap } from './OlympusZapperZap'; @@ -11,6 +12,7 @@ export * as factories from './factories'; export { OlympusGOhmToken__factory } from './factories/OlympusGOhmToken__factory'; export { OlympusSOhmToken__factory } from './factories/OlympusSOhmToken__factory'; export { OlympusSOhmV1Token__factory } from './factories/OlympusSOhmV1Token__factory'; +export { OlympusV1BondDepository__factory } from './factories/OlympusV1BondDepository__factory'; export { OlympusV2BondDepository__factory } from './factories/OlympusV2BondDepository__factory'; export { OlympusWsOhmV1Token__factory } from './factories/OlympusWsOhmV1Token__factory'; export { OlympusZapperZap__factory } from './factories/OlympusZapperZap__factory'; diff --git a/src/apps/olympus/contracts/index.ts b/src/apps/olympus/contracts/index.ts index a1872e5c2..d48bbaf36 100644 --- a/src/apps/olympus/contracts/index.ts +++ b/src/apps/olympus/contracts/index.ts @@ -7,6 +7,7 @@ import { Network } from '~types/network.interface'; import { OlympusGOhmToken__factory } from './ethers'; import { OlympusSOhmToken__factory } from './ethers'; import { OlympusSOhmV1Token__factory } from './ethers'; +import { OlympusV1BondDepository__factory } from './ethers'; import { OlympusV2BondDepository__factory } from './ethers'; import { OlympusWsOhmV1Token__factory } from './ethers'; import { OlympusZapperZap__factory } from './ethers'; @@ -29,6 +30,9 @@ export class OlympusContractFactory extends ContractFactory { olympusSOhmV1Token({ address, network }: ContractOpts) { return OlympusSOhmV1Token__factory.connect(address, this.appToolkit.getNetworkProvider(network)); } + olympusV1BondDepository({ address, network }: ContractOpts) { + return OlympusV1BondDepository__factory.connect(address, this.appToolkit.getNetworkProvider(network)); + } olympusV2BondDepository({ address, network }: ContractOpts) { return OlympusV2BondDepository__factory.connect(address, this.appToolkit.getNetworkProvider(network)); } @@ -43,6 +47,7 @@ export class OlympusContractFactory extends ContractFactory { export type { OlympusGOhmToken } from './ethers'; export type { OlympusSOhmToken } from './ethers'; export type { OlympusSOhmV1Token } from './ethers'; +export type { OlympusV1BondDepository } from './ethers'; export type { OlympusV2BondDepository } from './ethers'; export type { OlympusWsOhmV1Token } from './ethers'; export type { OlympusZapperZap } from './ethers'; diff --git a/src/apps/olympus/index.ts b/src/apps/olympus/index.ts index 723f8af64..93406dada 100644 --- a/src/apps/olympus/index.ts +++ b/src/apps/olympus/index.ts @@ -7,6 +7,7 @@ export { OlympusBondV2ContractPositionBalanceHelper } from './helpers/olympus.bo export { OlympusBondContractPositionHelper } from './helpers/olympus.bond.contract-position-helper'; export { OlympusBridgeTokenHelper } from './helpers/olympus.bridge-token-helper'; +export type { OlympusV1BondDepository } from './contracts'; export type { OlympusV2BondDepository } from './contracts'; export type { OlympusGOhmToken } from './contracts'; export type { OlympusSOhmToken } from './contracts';