From 0e8bfe71d7294cc73e895a44db9eef0b9daa2277 Mon Sep 17 00:00:00 2001 From: brucedonovan Date: Fri, 17 Sep 2021 17:07:34 +0100 Subject: [PATCH 1/5] lend position spacing --- src/views/LendPosition.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/LendPosition.tsx b/src/views/LendPosition.tsx index 23fe1b24f..46e0c0e25 100644 --- a/src/views/LendPosition.tsx +++ b/src/views/LendPosition.tsx @@ -253,7 +253,7 @@ const LendPosition = () => { {actionActive.index === 1 && ( <> {stepPosition[actionActive.index] === 0 && ( - + console.log('maxAction')} isError={closeError} From 97230b339f3298d41451c18aedb9e9b44d4070a1 Mon Sep 17 00:00:00 2001 From: brucedonovan Date: Fri, 17 Sep 2021 17:30:59 +0100 Subject: [PATCH 2/5] addLiquidityHook check --- src/hooks/actionHooks/useAddLiquidity.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hooks/actionHooks/useAddLiquidity.ts b/src/hooks/actionHooks/useAddLiquidity.ts index 66c9a3453..d498189df 100644 --- a/src/hooks/actionHooks/useAddLiquidity.ts +++ b/src/hooks/actionHooks/useAddLiquidity.ts @@ -89,11 +89,11 @@ export const useAddLiquidity = () => { args: [selectedSeriesId, selectedIlkId, '0'] as LadleActions.Args.BUILD, ignoreIf: method !== 'BORROW', // TODO exclude if vault is Provided. }, - { - operation: LadleActions.Fn.TRANSFER, - args: [base.address, base.joinAddress, _baseToFyToken] as LadleActions.Args.TRANSFER, - ignoreIf: method !== 'BORROW', - }, + // { + // operation: LadleActions.Fn.TRANSFER, + // args: [base.address, base.joinAddress, _baseToFyToken] as LadleActions.Args.TRANSFER, + // ignoreIf: method !== 'BORROW', + // }, { operation: LadleActions.Fn.TRANSFER, args: [base.address, series.poolAddress, _baseToPool] as LadleActions.Args.TRANSFER, @@ -101,7 +101,7 @@ export const useAddLiquidity = () => { }, { operation: LadleActions.Fn.POUR, - args: [BLANK_VAULT, series.poolAddress, _baseToFyToken, _baseToFyToken] as LadleActions.Args.POUR, + args: [BLANK_VAULT, series.poolAddress, '0', _baseToFyToken] as LadleActions.Args.POUR, ignoreIf: method !== 'BORROW', }, { From c7634dfd910341e69e65aae4ebade7f1869f8f1e Mon Sep 17 00:00:00 2001 From: brucedonovan Date: Fri, 17 Sep 2021 18:07:02 +0100 Subject: [PATCH 3/5] New pool contract typings/factory/json --- src/contracts/Pool.d.ts | 196 +++++++---------------- src/contracts/abis/Pool.json | 148 ++++++----------- src/contracts/factories/Pool__factory.ts | 148 ++++++----------- 3 files changed, 153 insertions(+), 339 deletions(-) diff --git a/src/contracts/Pool.d.ts b/src/contracts/Pool.d.ts index 78a5cdd37..df2e5bd67 100644 --- a/src/contracts/Pool.d.ts +++ b/src/contracts/Pool.d.ts @@ -37,32 +37,31 @@ interface PoolInterface extends ethers.utils.Interface { "decimals()": FunctionFragment; "deploymentChainId()": FunctionFragment; "fyToken()": FunctionFragment; + "g1()": FunctionFragment; + "g2()": FunctionFragment; "getBaseBalance()": FunctionFragment; "getCache()": FunctionFragment; "getFYTokenBalance()": FunctionFragment; - "getG1()": FunctionFragment; - "getG2()": FunctionFragment; - "getK()": FunctionFragment; + "invariant()": FunctionFragment; "maturity()": FunctionFragment; "mint(address,bool,uint256)": FunctionFragment; "mintWithBase(address,uint256,uint256)": FunctionFragment; "name()": FunctionFragment; "nonces(address)": FunctionFragment; - "owner()": FunctionFragment; "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": FunctionFragment; "retrieveBase(address)": FunctionFragment; "retrieveFYToken(address)": FunctionFragment; + "scaleFactor()": FunctionFragment; "sellBase(address,uint128)": FunctionFragment; "sellBasePreview(uint128)": FunctionFragment; "sellFYToken(address,uint128)": FunctionFragment; "sellFYTokenPreview(uint128)": FunctionFragment; - "setParameter(bytes32,int128)": FunctionFragment; "symbol()": FunctionFragment; "sync()": FunctionFragment; "totalSupply()": FunctionFragment; "transfer(address,uint256)": FunctionFragment; "transferFrom(address,address,uint256)": FunctionFragment; - "transferOwnership(address)": FunctionFragment; + "ts()": FunctionFragment; "version()": FunctionFragment; }; @@ -118,6 +117,8 @@ interface PoolInterface extends ethers.utils.Interface { values?: undefined ): string; encodeFunctionData(functionFragment: "fyToken", values?: undefined): string; + encodeFunctionData(functionFragment: "g1", values?: undefined): string; + encodeFunctionData(functionFragment: "g2", values?: undefined): string; encodeFunctionData( functionFragment: "getBaseBalance", values?: undefined @@ -127,9 +128,7 @@ interface PoolInterface extends ethers.utils.Interface { functionFragment: "getFYTokenBalance", values?: undefined ): string; - encodeFunctionData(functionFragment: "getG1", values?: undefined): string; - encodeFunctionData(functionFragment: "getG2", values?: undefined): string; - encodeFunctionData(functionFragment: "getK", values?: undefined): string; + encodeFunctionData(functionFragment: "invariant", values?: undefined): string; encodeFunctionData(functionFragment: "maturity", values?: undefined): string; encodeFunctionData( functionFragment: "mint", @@ -141,7 +140,6 @@ interface PoolInterface extends ethers.utils.Interface { ): string; encodeFunctionData(functionFragment: "name", values?: undefined): string; encodeFunctionData(functionFragment: "nonces", values: [string]): string; - encodeFunctionData(functionFragment: "owner", values?: undefined): string; encodeFunctionData( functionFragment: "permit", values: [ @@ -162,6 +160,10 @@ interface PoolInterface extends ethers.utils.Interface { functionFragment: "retrieveFYToken", values: [string] ): string; + encodeFunctionData( + functionFragment: "scaleFactor", + values?: undefined + ): string; encodeFunctionData( functionFragment: "sellBase", values: [string, BigNumberish] @@ -178,10 +180,6 @@ interface PoolInterface extends ethers.utils.Interface { functionFragment: "sellFYTokenPreview", values: [BigNumberish] ): string; - encodeFunctionData( - functionFragment: "setParameter", - values: [BytesLike, BigNumberish] - ): string; encodeFunctionData(functionFragment: "symbol", values?: undefined): string; encodeFunctionData(functionFragment: "sync", values?: undefined): string; encodeFunctionData( @@ -196,10 +194,7 @@ interface PoolInterface extends ethers.utils.Interface { functionFragment: "transferFrom", values: [string, string, BigNumberish] ): string; - encodeFunctionData( - functionFragment: "transferOwnership", - values: [string] - ): string; + encodeFunctionData(functionFragment: "ts", values?: undefined): string; encodeFunctionData(functionFragment: "version", values?: undefined): string; decodeFunctionResult( @@ -239,6 +234,8 @@ interface PoolInterface extends ethers.utils.Interface { data: BytesLike ): Result; decodeFunctionResult(functionFragment: "fyToken", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "g1", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "g2", data: BytesLike): Result; decodeFunctionResult( functionFragment: "getBaseBalance", data: BytesLike @@ -248,9 +245,7 @@ interface PoolInterface extends ethers.utils.Interface { functionFragment: "getFYTokenBalance", data: BytesLike ): Result; - decodeFunctionResult(functionFragment: "getG1", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "getG2", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "getK", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "invariant", data: BytesLike): Result; decodeFunctionResult(functionFragment: "maturity", data: BytesLike): Result; decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; decodeFunctionResult( @@ -259,7 +254,6 @@ interface PoolInterface extends ethers.utils.Interface { ): Result; decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; decodeFunctionResult(functionFragment: "nonces", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; decodeFunctionResult(functionFragment: "permit", data: BytesLike): Result; decodeFunctionResult( functionFragment: "retrieveBase", @@ -269,6 +263,10 @@ interface PoolInterface extends ethers.utils.Interface { functionFragment: "retrieveFYToken", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "scaleFactor", + data: BytesLike + ): Result; decodeFunctionResult(functionFragment: "sellBase", data: BytesLike): Result; decodeFunctionResult( functionFragment: "sellBasePreview", @@ -282,10 +280,6 @@ interface PoolInterface extends ethers.utils.Interface { functionFragment: "sellFYTokenPreview", data: BytesLike ): Result; - decodeFunctionResult( - functionFragment: "setParameter", - data: BytesLike - ): Result; decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; decodeFunctionResult(functionFragment: "sync", data: BytesLike): Result; decodeFunctionResult( @@ -297,17 +291,12 @@ interface PoolInterface extends ethers.utils.Interface { functionFragment: "transferFrom", data: BytesLike ): Result; - decodeFunctionResult( - functionFragment: "transferOwnership", - data: BytesLike - ): Result; + decodeFunctionResult(functionFragment: "ts", data: BytesLike): Result; decodeFunctionResult(functionFragment: "version", data: BytesLike): Result; events: { "Approval(address,address,uint256)": EventFragment; "Liquidity(uint32,address,address,address,int256,int256,int256)": EventFragment; - "OwnershipTransferred(address,address)": EventFragment; - "ParameterSet(bytes32,int128)": EventFragment; "Sync(uint112,uint112,uint256)": EventFragment; "Trade(uint32,address,address,int256,int256)": EventFragment; "Transfer(address,address,uint256)": EventFragment; @@ -315,8 +304,6 @@ interface PoolInterface extends ethers.utils.Interface { getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; getEvent(nameOrSignatureOrTopic: "Liquidity"): EventFragment; - getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; - getEvent(nameOrSignatureOrTopic: "ParameterSet"): EventFragment; getEvent(nameOrSignatureOrTopic: "Sync"): EventFragment; getEvent(nameOrSignatureOrTopic: "Trade"): EventFragment; getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; @@ -432,6 +419,10 @@ export class Pool extends BaseContract { fyToken(overrides?: CallOverrides): Promise<[string]>; + g1(overrides?: CallOverrides): Promise<[BigNumber]>; + + g2(overrides?: CallOverrides): Promise<[BigNumber]>; + getBaseBalance(overrides?: CallOverrides): Promise<[BigNumber]>; getCache( @@ -440,11 +431,7 @@ export class Pool extends BaseContract { getFYTokenBalance(overrides?: CallOverrides): Promise<[BigNumber]>; - getG1(overrides?: CallOverrides): Promise<[BigNumber]>; - - getG2(overrides?: CallOverrides): Promise<[BigNumber]>; - - getK(overrides?: CallOverrides): Promise<[BigNumber]>; + invariant(overrides?: CallOverrides): Promise<[BigNumber]>; maturity(overrides?: CallOverrides): Promise<[number]>; @@ -466,8 +453,6 @@ export class Pool extends BaseContract { nonces(arg0: string, overrides?: CallOverrides): Promise<[BigNumber]>; - owner(overrides?: CallOverrides): Promise<[string]>; - permit( owner: string, spender: string, @@ -489,6 +474,8 @@ export class Pool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + scaleFactor(overrides?: CallOverrides): Promise<[BigNumber]>; + sellBase( to: string, min: BigNumberish, @@ -511,12 +498,6 @@ export class Pool extends BaseContract { overrides?: CallOverrides ): Promise<[BigNumber]>; - setParameter( - parameter: BytesLike, - value: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - symbol(overrides?: CallOverrides): Promise<[string]>; sync( @@ -538,10 +519,7 @@ export class Pool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; - transferOwnership( - newOwner: string, - overrides?: Overrides & { from?: string | Promise } - ): Promise; + ts(overrides?: CallOverrides): Promise<[BigNumber]>; version(overrides?: CallOverrides): Promise<[string]>; }; @@ -612,17 +590,17 @@ export class Pool extends BaseContract { fyToken(overrides?: CallOverrides): Promise; + g1(overrides?: CallOverrides): Promise; + + g2(overrides?: CallOverrides): Promise; + getBaseBalance(overrides?: CallOverrides): Promise; getCache(overrides?: CallOverrides): Promise<[BigNumber, BigNumber, number]>; getFYTokenBalance(overrides?: CallOverrides): Promise; - getG1(overrides?: CallOverrides): Promise; - - getG2(overrides?: CallOverrides): Promise; - - getK(overrides?: CallOverrides): Promise; + invariant(overrides?: CallOverrides): Promise; maturity(overrides?: CallOverrides): Promise; @@ -644,8 +622,6 @@ export class Pool extends BaseContract { nonces(arg0: string, overrides?: CallOverrides): Promise; - owner(overrides?: CallOverrides): Promise; - permit( owner: string, spender: string, @@ -667,6 +643,8 @@ export class Pool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + scaleFactor(overrides?: CallOverrides): Promise; + sellBase( to: string, min: BigNumberish, @@ -689,12 +667,6 @@ export class Pool extends BaseContract { overrides?: CallOverrides ): Promise; - setParameter( - parameter: BytesLike, - value: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - symbol(overrides?: CallOverrides): Promise; sync( @@ -716,10 +688,7 @@ export class Pool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; - transferOwnership( - newOwner: string, - overrides?: Overrides & { from?: string | Promise } - ): Promise; + ts(overrides?: CallOverrides): Promise; version(overrides?: CallOverrides): Promise; @@ -792,6 +761,10 @@ export class Pool extends BaseContract { fyToken(overrides?: CallOverrides): Promise; + g1(overrides?: CallOverrides): Promise; + + g2(overrides?: CallOverrides): Promise; + getBaseBalance(overrides?: CallOverrides): Promise; getCache( @@ -800,11 +773,7 @@ export class Pool extends BaseContract { getFYTokenBalance(overrides?: CallOverrides): Promise; - getG1(overrides?: CallOverrides): Promise; - - getG2(overrides?: CallOverrides): Promise; - - getK(overrides?: CallOverrides): Promise; + invariant(overrides?: CallOverrides): Promise; maturity(overrides?: CallOverrides): Promise; @@ -826,8 +795,6 @@ export class Pool extends BaseContract { nonces(arg0: string, overrides?: CallOverrides): Promise; - owner(overrides?: CallOverrides): Promise; - permit( owner: string, spender: string, @@ -843,6 +810,8 @@ export class Pool extends BaseContract { retrieveFYToken(to: string, overrides?: CallOverrides): Promise; + scaleFactor(overrides?: CallOverrides): Promise; + sellBase( to: string, min: BigNumberish, @@ -865,12 +834,6 @@ export class Pool extends BaseContract { overrides?: CallOverrides ): Promise; - setParameter( - parameter: BytesLike, - value: BigNumberish, - overrides?: CallOverrides - ): Promise; - symbol(overrides?: CallOverrides): Promise; sync(overrides?: CallOverrides): Promise; @@ -890,10 +853,7 @@ export class Pool extends BaseContract { overrides?: CallOverrides ): Promise; - transferOwnership( - newOwner: string, - overrides?: CallOverrides - ): Promise; + ts(overrides?: CallOverrides): Promise; version(overrides?: CallOverrides): Promise; }; @@ -929,22 +889,6 @@ export class Pool extends BaseContract { } >; - OwnershipTransferred( - oldOwner?: string | null, - newOwner?: string | null - ): TypedEventFilter< - [string, string], - { oldOwner: string; newOwner: string } - >; - - ParameterSet( - parameter?: null, - k?: null - ): TypedEventFilter< - [string, BigNumber], - { parameter: string; k: BigNumber } - >; - Sync( baseCached?: null, fyTokenCached?: null, @@ -1052,17 +996,17 @@ export class Pool extends BaseContract { fyToken(overrides?: CallOverrides): Promise; + g1(overrides?: CallOverrides): Promise; + + g2(overrides?: CallOverrides): Promise; + getBaseBalance(overrides?: CallOverrides): Promise; getCache(overrides?: CallOverrides): Promise; getFYTokenBalance(overrides?: CallOverrides): Promise; - getG1(overrides?: CallOverrides): Promise; - - getG2(overrides?: CallOverrides): Promise; - - getK(overrides?: CallOverrides): Promise; + invariant(overrides?: CallOverrides): Promise; maturity(overrides?: CallOverrides): Promise; @@ -1084,8 +1028,6 @@ export class Pool extends BaseContract { nonces(arg0: string, overrides?: CallOverrides): Promise; - owner(overrides?: CallOverrides): Promise; - permit( owner: string, spender: string, @@ -1107,6 +1049,8 @@ export class Pool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + scaleFactor(overrides?: CallOverrides): Promise; + sellBase( to: string, min: BigNumberish, @@ -1129,12 +1073,6 @@ export class Pool extends BaseContract { overrides?: CallOverrides ): Promise; - setParameter( - parameter: BytesLike, - value: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - symbol(overrides?: CallOverrides): Promise; sync( @@ -1156,10 +1094,7 @@ export class Pool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; - transferOwnership( - newOwner: string, - overrides?: Overrides & { from?: string | Promise } - ): Promise; + ts(overrides?: CallOverrides): Promise; version(overrides?: CallOverrides): Promise; }; @@ -1236,17 +1171,17 @@ export class Pool extends BaseContract { fyToken(overrides?: CallOverrides): Promise; + g1(overrides?: CallOverrides): Promise; + + g2(overrides?: CallOverrides): Promise; + getBaseBalance(overrides?: CallOverrides): Promise; getCache(overrides?: CallOverrides): Promise; getFYTokenBalance(overrides?: CallOverrides): Promise; - getG1(overrides?: CallOverrides): Promise; - - getG2(overrides?: CallOverrides): Promise; - - getK(overrides?: CallOverrides): Promise; + invariant(overrides?: CallOverrides): Promise; maturity(overrides?: CallOverrides): Promise; @@ -1271,8 +1206,6 @@ export class Pool extends BaseContract { overrides?: CallOverrides ): Promise; - owner(overrides?: CallOverrides): Promise; - permit( owner: string, spender: string, @@ -1294,6 +1227,8 @@ export class Pool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + scaleFactor(overrides?: CallOverrides): Promise; + sellBase( to: string, min: BigNumberish, @@ -1316,12 +1251,6 @@ export class Pool extends BaseContract { overrides?: CallOverrides ): Promise; - setParameter( - parameter: BytesLike, - value: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - symbol(overrides?: CallOverrides): Promise; sync( @@ -1343,10 +1272,7 @@ export class Pool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; - transferOwnership( - newOwner: string, - overrides?: Overrides & { from?: string | Promise } - ): Promise; + ts(overrides?: CallOverrides): Promise; version(overrides?: CallOverrides): Promise; }; diff --git a/src/contracts/abis/Pool.json b/src/contracts/abis/Pool.json index 2a98898e0..ceb53d3b4 100644 --- a/src/contracts/abis/Pool.json +++ b/src/contracts/abis/Pool.json @@ -78,44 +78,6 @@ "name": "Liquidity", "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": "bytes32", - "name": "parameter", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "int128", - "name": "k", - "type": "int128" - } - ], - "name": "ParameterSet", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -532,12 +494,12 @@ }, { "inputs": [], - "name": "getBaseBalance", + "name": "g1", "outputs": [ { - "internalType": "uint112", + "internalType": "int128", "name": "", - "type": "uint112" + "type": "int128" } ], "stateMutability": "view", @@ -545,22 +507,12 @@ }, { "inputs": [], - "name": "getCache", + "name": "g2", "outputs": [ { - "internalType": "uint112", - "name": "", - "type": "uint112" - }, - { - "internalType": "uint112", - "name": "", - "type": "uint112" - }, - { - "internalType": "uint32", + "internalType": "int128", "name": "", - "type": "uint32" + "type": "int128" } ], "stateMutability": "view", @@ -568,7 +520,7 @@ }, { "inputs": [], - "name": "getFYTokenBalance", + "name": "getBaseBalance", "outputs": [ { "internalType": "uint112", @@ -581,12 +533,22 @@ }, { "inputs": [], - "name": "getG1", + "name": "getCache", "outputs": [ { - "internalType": "int128", + "internalType": "uint112", "name": "", - "type": "int128" + "type": "uint112" + }, + { + "internalType": "uint112", + "name": "", + "type": "uint112" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" } ], "stateMutability": "view", @@ -594,12 +556,12 @@ }, { "inputs": [], - "name": "getG2", + "name": "getFYTokenBalance", "outputs": [ { - "internalType": "int128", + "internalType": "uint112", "name": "", - "type": "int128" + "type": "uint112" } ], "stateMutability": "view", @@ -607,12 +569,12 @@ }, { "inputs": [], - "name": "getK", + "name": "invariant", "outputs": [ { - "internalType": "int128", + "internalType": "uint128", "name": "", - "type": "int128" + "type": "uint128" } ], "stateMutability": "view", @@ -741,19 +703,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -835,6 +784,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "scaleFactor", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -921,24 +883,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "parameter", - "type": "bytes32" - }, - { - "internalType": "int128", - "name": "value", - "type": "int128" - } - ], - "name": "setParameter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [], "name": "symbol", @@ -1026,16 +970,16 @@ "type": "function" }, { - "inputs": [ + "inputs": [], + "name": "ts", + "outputs": [ { - "internalType": "address", - "name": "newOwner", - "type": "address" + "internalType": "int128", + "name": "", + "type": "int128" } ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { diff --git a/src/contracts/factories/Pool__factory.ts b/src/contracts/factories/Pool__factory.ts index b82311af0..15ca9792c 100644 --- a/src/contracts/factories/Pool__factory.ts +++ b/src/contracts/factories/Pool__factory.ts @@ -86,44 +86,6 @@ const _abi = [ name: "Liquidity", 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: "bytes32", - name: "parameter", - type: "bytes32", - }, - { - indexed: false, - internalType: "int128", - name: "k", - type: "int128", - }, - ], - name: "ParameterSet", - type: "event", - }, { anonymous: false, inputs: [ @@ -540,12 +502,12 @@ const _abi = [ }, { inputs: [], - name: "getBaseBalance", + name: "g1", outputs: [ { - internalType: "uint112", + internalType: "int128", name: "", - type: "uint112", + type: "int128", }, ], stateMutability: "view", @@ -553,22 +515,12 @@ const _abi = [ }, { inputs: [], - name: "getCache", + name: "g2", outputs: [ { - internalType: "uint112", - name: "", - type: "uint112", - }, - { - internalType: "uint112", - name: "", - type: "uint112", - }, - { - internalType: "uint32", + internalType: "int128", name: "", - type: "uint32", + type: "int128", }, ], stateMutability: "view", @@ -576,7 +528,7 @@ const _abi = [ }, { inputs: [], - name: "getFYTokenBalance", + name: "getBaseBalance", outputs: [ { internalType: "uint112", @@ -589,12 +541,22 @@ const _abi = [ }, { inputs: [], - name: "getG1", + name: "getCache", outputs: [ { - internalType: "int128", + internalType: "uint112", name: "", - type: "int128", + type: "uint112", + }, + { + internalType: "uint112", + name: "", + type: "uint112", + }, + { + internalType: "uint32", + name: "", + type: "uint32", }, ], stateMutability: "view", @@ -602,12 +564,12 @@ const _abi = [ }, { inputs: [], - name: "getG2", + name: "getFYTokenBalance", outputs: [ { - internalType: "int128", + internalType: "uint112", name: "", - type: "int128", + type: "uint112", }, ], stateMutability: "view", @@ -615,12 +577,12 @@ const _abi = [ }, { inputs: [], - name: "getK", + name: "invariant", outputs: [ { - internalType: "int128", + internalType: "uint128", name: "", - type: "int128", + type: "uint128", }, ], stateMutability: "view", @@ -749,19 +711,6 @@ const _abi = [ stateMutability: "view", type: "function", }, - { - inputs: [], - name: "owner", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, { inputs: [ { @@ -843,6 +792,19 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, + { + inputs: [], + name: "scaleFactor", + outputs: [ + { + internalType: "uint96", + name: "", + type: "uint96", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [ { @@ -929,24 +891,6 @@ const _abi = [ stateMutability: "view", type: "function", }, - { - inputs: [ - { - internalType: "bytes32", - name: "parameter", - type: "bytes32", - }, - { - internalType: "int128", - name: "value", - type: "int128", - }, - ], - name: "setParameter", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, { inputs: [], name: "symbol", @@ -1034,16 +978,16 @@ const _abi = [ type: "function", }, { - inputs: [ + inputs: [], + name: "ts", + outputs: [ { - internalType: "address", - name: "newOwner", - type: "address", + internalType: "int128", + name: "", + type: "int128", }, ], - name: "transferOwnership", - outputs: [], - stateMutability: "nonpayable", + stateMutability: "view", type: "function", }, { From 69920d3b988de96e7c42db77a5ceabce17fde91c Mon Sep 17 00:00:00 2001 From: brucedonovan Date: Fri, 17 Sep 2021 18:09:38 +0100 Subject: [PATCH 4/5] new stragey contract typings/json/factory --- src/contracts/Strategy.d.ts | 110 +++++++++++-------- src/contracts/abis/Strategy.json | 105 ++++++++---------- src/contracts/factories/Strategy__factory.ts | 105 ++++++++---------- 3 files changed, 154 insertions(+), 166 deletions(-) diff --git a/src/contracts/Strategy.d.ts b/src/contracts/Strategy.d.ts index 00503418d..7d9656f56 100644 --- a/src/contracts/Strategy.d.ts +++ b/src/contracts/Strategy.d.ts @@ -44,6 +44,7 @@ interface StrategyInterface extends ethers.utils.Interface { "grantRole(bytes4,address)": FunctionFragment; "grantRoles(bytes4[],address)": FunctionFragment; "hasRole(bytes4,address)": FunctionFragment; + "invariants(address)": FunctionFragment; "ladle()": FunctionFragment; "lockRole(bytes4)": FunctionFragment; "mint(address)": FunctionFragment; @@ -63,16 +64,16 @@ interface StrategyInterface extends ethers.utils.Interface { "rewardsToken()": FunctionFragment; "seriesId()": FunctionFragment; "setNextPool(address,bytes6)": FunctionFragment; - "setRewards(address,uint32,uint32,uint96)": FunctionFragment; + "setRewards(uint32,uint32,uint96)": FunctionFragment; + "setRewardsToken(address)": FunctionFragment; "setRoleAdmin(bytes4,bytes4)": FunctionFragment; "setTokenId(bytes6)": FunctionFragment; - "setYield(address,address)": FunctionFragment; + "setYield(address)": FunctionFragment; "startPool()": FunctionFragment; "symbol()": FunctionFragment; "totalSupply()": FunctionFragment; "transfer(address,uint256)": FunctionFragment; "transferFrom(address,address,uint256)": FunctionFragment; - "vaultId()": FunctionFragment; "version()": FunctionFragment; }; @@ -126,6 +127,7 @@ interface StrategyInterface extends ethers.utils.Interface { functionFragment: "hasRole", values: [BytesLike, string] ): string; + encodeFunctionData(functionFragment: "invariants", values: [string]): string; encodeFunctionData(functionFragment: "ladle", values?: undefined): string; encodeFunctionData(functionFragment: "lockRole", values: [BytesLike]): string; encodeFunctionData(functionFragment: "mint", values: [string]): string; @@ -185,7 +187,11 @@ interface StrategyInterface extends ethers.utils.Interface { ): string; encodeFunctionData( functionFragment: "setRewards", - values: [string, BigNumberish, BigNumberish, BigNumberish] + values: [BigNumberish, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setRewardsToken", + values: [string] ): string; encodeFunctionData( functionFragment: "setRoleAdmin", @@ -195,10 +201,7 @@ interface StrategyInterface extends ethers.utils.Interface { functionFragment: "setTokenId", values: [BytesLike] ): string; - encodeFunctionData( - functionFragment: "setYield", - values: [string, string] - ): string; + encodeFunctionData(functionFragment: "setYield", values: [string]): string; encodeFunctionData(functionFragment: "startPool", values?: undefined): string; encodeFunctionData(functionFragment: "symbol", values?: undefined): string; encodeFunctionData( @@ -213,7 +216,6 @@ interface StrategyInterface extends ethers.utils.Interface { functionFragment: "transferFrom", values: [string, string, BigNumberish] ): string; - encodeFunctionData(functionFragment: "vaultId", values?: undefined): string; encodeFunctionData(functionFragment: "version", values?: undefined): string; decodeFunctionResult( @@ -254,6 +256,7 @@ interface StrategyInterface extends ethers.utils.Interface { decodeFunctionResult(functionFragment: "grantRole", data: BytesLike): Result; decodeFunctionResult(functionFragment: "grantRoles", data: BytesLike): Result; decodeFunctionResult(functionFragment: "hasRole", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "invariants", data: BytesLike): Result; decodeFunctionResult(functionFragment: "ladle", data: BytesLike): Result; decodeFunctionResult(functionFragment: "lockRole", data: BytesLike): Result; decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; @@ -298,6 +301,10 @@ interface StrategyInterface extends ethers.utils.Interface { data: BytesLike ): Result; decodeFunctionResult(functionFragment: "setRewards", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setRewardsToken", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "setRoleAdmin", data: BytesLike @@ -315,19 +322,17 @@ interface StrategyInterface extends ethers.utils.Interface { functionFragment: "transferFrom", data: BytesLike ): Result; - decodeFunctionResult(functionFragment: "vaultId", data: BytesLike): Result; decodeFunctionResult(functionFragment: "version", data: BytesLike): Result; events: { "Approval(address,address,uint256)": EventFragment; "Claimed(address,uint256)": EventFragment; - "Divest(uint256)": EventFragment; - "Invest(uint256)": EventFragment; "NextPoolSet(address,bytes6)": EventFragment; "PoolEnded(address)": EventFragment; "PoolStarted(address)": EventFragment; "RewardsPerTokenUpdated(uint256)": EventFragment; - "RewardsSet(address,uint32,uint32,uint256)": EventFragment; + "RewardsSet(uint32,uint32,uint256)": EventFragment; + "RewardsTokenSet(address)": EventFragment; "RoleAdminChanged(bytes4,bytes4)": EventFragment; "RoleGranted(bytes4,address,address)": EventFragment; "RoleRevoked(bytes4,address,address)": EventFragment; @@ -340,13 +345,12 @@ interface StrategyInterface extends ethers.utils.Interface { getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; getEvent(nameOrSignatureOrTopic: "Claimed"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Divest"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Invest"): EventFragment; getEvent(nameOrSignatureOrTopic: "NextPoolSet"): EventFragment; getEvent(nameOrSignatureOrTopic: "PoolEnded"): EventFragment; getEvent(nameOrSignatureOrTopic: "PoolStarted"): EventFragment; getEvent(nameOrSignatureOrTopic: "RewardsPerTokenUpdated"): EventFragment; getEvent(nameOrSignatureOrTopic: "RewardsSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "RewardsTokenSet"): EventFragment; getEvent(nameOrSignatureOrTopic: "RoleAdminChanged"): EventFragment; getEvent(nameOrSignatureOrTopic: "RoleGranted"): EventFragment; getEvent(nameOrSignatureOrTopic: "RoleRevoked"): EventFragment; @@ -478,6 +482,8 @@ export class Strategy extends BaseContract { overrides?: CallOverrides ): Promise<[boolean]>; + invariants(arg0: string, overrides?: CallOverrides): Promise<[BigNumber]>; + ladle(overrides?: CallOverrides): Promise<[string]>; lockRole( @@ -565,13 +571,17 @@ export class Strategy extends BaseContract { ): Promise; setRewards( - rewardsToken_: string, start: BigNumberish, end: BigNumberish, rate: BigNumberish, overrides?: Overrides & { from?: string | Promise } ): Promise; + setRewardsToken( + rewardsToken_: string, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + setRoleAdmin( role: BytesLike, adminRole: BytesLike, @@ -585,7 +595,6 @@ export class Strategy extends BaseContract { setYield( ladle_: string, - cauldron_: string, overrides?: Overrides & { from?: string | Promise } ): Promise; @@ -610,8 +619,6 @@ export class Strategy extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; - vaultId(overrides?: CallOverrides): Promise<[string]>; - version(overrides?: CallOverrides): Promise<[string]>; }; @@ -692,6 +699,8 @@ export class Strategy extends BaseContract { overrides?: CallOverrides ): Promise; + invariants(arg0: string, overrides?: CallOverrides): Promise; + ladle(overrides?: CallOverrides): Promise; lockRole( @@ -779,13 +788,17 @@ export class Strategy extends BaseContract { ): Promise; setRewards( - rewardsToken_: string, start: BigNumberish, end: BigNumberish, rate: BigNumberish, overrides?: Overrides & { from?: string | Promise } ): Promise; + setRewardsToken( + rewardsToken_: string, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + setRoleAdmin( role: BytesLike, adminRole: BytesLike, @@ -799,7 +812,6 @@ export class Strategy extends BaseContract { setYield( ladle_: string, - cauldron_: string, overrides?: Overrides & { from?: string | Promise } ): Promise; @@ -824,8 +836,6 @@ export class Strategy extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; - vaultId(overrides?: CallOverrides): Promise; - version(overrides?: CallOverrides): Promise; callStatic: { @@ -895,6 +905,8 @@ export class Strategy extends BaseContract { overrides?: CallOverrides ): Promise; + invariants(arg0: string, overrides?: CallOverrides): Promise; + ladle(overrides?: CallOverrides): Promise; lockRole(role: BytesLike, overrides?: CallOverrides): Promise; @@ -974,13 +986,17 @@ export class Strategy extends BaseContract { ): Promise; setRewards( - rewardsToken_: string, start: BigNumberish, end: BigNumberish, rate: BigNumberish, overrides?: CallOverrides ): Promise; + setRewardsToken( + rewardsToken_: string, + overrides?: CallOverrides + ): Promise; + setRoleAdmin( role: BytesLike, adminRole: BytesLike, @@ -989,11 +1005,7 @@ export class Strategy extends BaseContract { setTokenId(baseId_: BytesLike, overrides?: CallOverrides): Promise; - setYield( - ladle_: string, - cauldron_: string, - overrides?: CallOverrides - ): Promise; + setYield(ladle_: string, overrides?: CallOverrides): Promise; startPool(overrides?: CallOverrides): Promise; @@ -1014,8 +1026,6 @@ export class Strategy extends BaseContract { overrides?: CallOverrides ): Promise; - vaultId(overrides?: CallOverrides): Promise; - version(overrides?: CallOverrides): Promise; }; @@ -1037,10 +1047,6 @@ export class Strategy extends BaseContract { { receiver: string; claimed: BigNumber } >; - Divest(burnt?: null): TypedEventFilter<[BigNumber], { burnt: BigNumber }>; - - Invest(minted?: null): TypedEventFilter<[BigNumber], { minted: BigNumber }>; - NextPoolSet( pool?: string | null, seriesId?: BytesLike | null @@ -1055,15 +1061,18 @@ export class Strategy extends BaseContract { ): TypedEventFilter<[BigNumber], { accumulated: BigNumber }>; RewardsSet( - rewardsToken?: null, start?: null, end?: null, rate?: null ): TypedEventFilter< - [string, number, number, BigNumber], - { rewardsToken: string; start: number; end: number; rate: BigNumber } + [number, number, BigNumber], + { start: number; end: number; rate: BigNumber } >; + RewardsTokenSet( + token?: null + ): TypedEventFilter<[string], { token: string }>; + RoleAdminChanged( role?: BytesLike | null, newAdminRole?: BytesLike | null @@ -1199,6 +1208,8 @@ export class Strategy extends BaseContract { overrides?: CallOverrides ): Promise; + invariants(arg0: string, overrides?: CallOverrides): Promise; + ladle(overrides?: CallOverrides): Promise; lockRole( @@ -1271,13 +1282,17 @@ export class Strategy extends BaseContract { ): Promise; setRewards( - rewardsToken_: string, start: BigNumberish, end: BigNumberish, rate: BigNumberish, overrides?: Overrides & { from?: string | Promise } ): Promise; + setRewardsToken( + rewardsToken_: string, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + setRoleAdmin( role: BytesLike, adminRole: BytesLike, @@ -1291,7 +1306,6 @@ export class Strategy extends BaseContract { setYield( ladle_: string, - cauldron_: string, overrides?: Overrides & { from?: string | Promise } ): Promise; @@ -1316,8 +1330,6 @@ export class Strategy extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; - vaultId(overrides?: CallOverrides): Promise; - version(overrides?: CallOverrides): Promise; }; @@ -1405,6 +1417,11 @@ export class Strategy extends BaseContract { overrides?: CallOverrides ): Promise; + invariants( + arg0: string, + overrides?: CallOverrides + ): Promise; + ladle(overrides?: CallOverrides): Promise; lockRole( @@ -1483,13 +1500,17 @@ export class Strategy extends BaseContract { ): Promise; setRewards( - rewardsToken_: string, start: BigNumberish, end: BigNumberish, rate: BigNumberish, overrides?: Overrides & { from?: string | Promise } ): Promise; + setRewardsToken( + rewardsToken_: string, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + setRoleAdmin( role: BytesLike, adminRole: BytesLike, @@ -1503,7 +1524,6 @@ export class Strategy extends BaseContract { setYield( ladle_: string, - cauldron_: string, overrides?: Overrides & { from?: string | Promise } ): Promise; @@ -1528,8 +1548,6 @@ export class Strategy extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; - vaultId(overrides?: CallOverrides): Promise; - version(overrides?: CallOverrides): Promise; }; } diff --git a/src/contracts/abis/Strategy.json b/src/contracts/abis/Strategy.json index 945e461f6..53461c4f2 100644 --- a/src/contracts/abis/Strategy.json +++ b/src/contracts/abis/Strategy.json @@ -11,11 +11,6 @@ "name": "symbol", "type": "string" }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - }, { "internalType": "contract ILadle", "name": "ladle_", @@ -79,32 +74,6 @@ "name": "Claimed", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "burnt", - "type": "uint256" - } - ], - "name": "Divest", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "minted", - "type": "uint256" - } - ], - "name": "Invest", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -166,12 +135,6 @@ { "anonymous": false, "inputs": [ - { - "indexed": false, - "internalType": "contract IERC20", - "name": "rewardsToken", - "type": "address" - }, { "indexed": false, "internalType": "uint32", @@ -194,6 +157,19 @@ "name": "RewardsSet", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract IERC20", + "name": "token", + "type": "address" + } + ], + "name": "RewardsTokenSet", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -724,6 +700,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "invariants", + "outputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "ladle", @@ -1055,11 +1050,6 @@ }, { "inputs": [ - { - "internalType": "contract IERC20", - "name": "rewardsToken_", - "type": "address" - }, { "internalType": "uint32", "name": "start", @@ -1081,6 +1071,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "rewardsToken_", + "type": "address" + } + ], + "name": "setRewardsToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -1118,11 +1121,6 @@ "internalType": "contract ILadle", "name": "ladle_", "type": "address" - }, - { - "internalType": "contract ICauldron", - "name": "cauldron_", - "type": "address" } ], "name": "setYield", @@ -1216,19 +1214,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "vaultId", - "outputs": [ - { - "internalType": "bytes12", - "name": "", - "type": "bytes12" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "version", diff --git a/src/contracts/factories/Strategy__factory.ts b/src/contracts/factories/Strategy__factory.ts index 01fd11b8a..d84040f07 100644 --- a/src/contracts/factories/Strategy__factory.ts +++ b/src/contracts/factories/Strategy__factory.ts @@ -19,11 +19,6 @@ const _abi = [ name: "symbol", type: "string", }, - { - internalType: "uint8", - name: "decimals", - type: "uint8", - }, { internalType: "contract ILadle", name: "ladle_", @@ -87,32 +82,6 @@ const _abi = [ name: "Claimed", type: "event", }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "burnt", - type: "uint256", - }, - ], - name: "Divest", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "minted", - type: "uint256", - }, - ], - name: "Invest", - type: "event", - }, { anonymous: false, inputs: [ @@ -174,12 +143,6 @@ const _abi = [ { anonymous: false, inputs: [ - { - indexed: false, - internalType: "contract IERC20", - name: "rewardsToken", - type: "address", - }, { indexed: false, internalType: "uint32", @@ -202,6 +165,19 @@ const _abi = [ name: "RewardsSet", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "contract IERC20", + name: "token", + type: "address", + }, + ], + name: "RewardsTokenSet", + type: "event", + }, { anonymous: false, inputs: [ @@ -732,6 +708,25 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "invariants", + outputs: [ + { + internalType: "uint128", + name: "", + type: "uint128", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [], name: "ladle", @@ -1063,11 +1058,6 @@ const _abi = [ }, { inputs: [ - { - internalType: "contract IERC20", - name: "rewardsToken_", - type: "address", - }, { internalType: "uint32", name: "start", @@ -1089,6 +1079,19 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, + { + inputs: [ + { + internalType: "contract IERC20", + name: "rewardsToken_", + type: "address", + }, + ], + name: "setRewardsToken", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [ { @@ -1127,11 +1130,6 @@ const _abi = [ name: "ladle_", type: "address", }, - { - internalType: "contract ICauldron", - name: "cauldron_", - type: "address", - }, ], name: "setYield", outputs: [], @@ -1224,19 +1222,6 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, - { - inputs: [], - name: "vaultId", - outputs: [ - { - internalType: "bytes12", - name: "", - type: "bytes12", - }, - ], - stateMutability: "view", - type: "function", - }, { inputs: [], name: "version", From 3ede98ec87d5535cefd905b61dccd70e0253da93 Mon Sep 17 00:00:00 2001 From: brucedonovan Date: Fri, 17 Sep 2021 18:24:03 +0100 Subject: [PATCH 5/5] add in invariant --- src/contexts/UserContext.tsx | 4 +++- src/types/index.ts | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/contexts/UserContext.tsx b/src/contexts/UserContext.tsx index 506092a12..682ddcd04 100644 --- a/src/contexts/UserContext.tsx +++ b/src/contexts/UserContext.tsx @@ -474,12 +474,13 @@ const UserProvider = ({ children }: any) => { _publicData = await Promise.all( strategyList.map(async (_strategy: IStrategyRoot): Promise => { /* Get all the data simultanenously in a promise.all */ - const [strategyTotalSupply, currentSeriesId, currentPoolAddr, nextSeriesId] = await Promise.all([ + const [strategyTotalSupply, currentSeriesId, currentPoolAddr, nextSeriesId, ] = await Promise.all([ _strategy.strategyContract.totalSupply(), _strategy.strategyContract.seriesId(), _strategy.strategyContract.pool(), _strategy.strategyContract.nextSeriesId(), ]); + const currentInvariant = await _strategy.strategyContract.invariants(currentPoolAddr); if (seriesRootMap.has(currentSeriesId)) { const currentSeries = seriesRootMap.get(currentSeriesId); @@ -505,6 +506,7 @@ const UserProvider = ({ children }: any) => { nextSeriesId, currentSeries, nextSeries, + currentInvariant, active: true, }; } diff --git a/src/types/index.ts b/src/types/index.ts index 6b13e54d3..9dfffc01a 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -191,6 +191,8 @@ export interface IStrategy extends IStrategyRoot { nextSeries: ISeries | undefined; active: boolean; + currentInvariant?: BigNumber; + strategyTotalSupply?: BigNumber; strategyTotalSupply_?: string; @@ -208,6 +210,7 @@ export interface IStrategy extends IStrategyRoot { accountPoolBalance?: BigNumber; accountPoolBalance_?: string; accountPoolPercent?: string | undefined; + } export interface IPool extends IPoolRoot {}