diff --git a/packages/dev-frontend/src/components/Stability/validation/validateStabilityDepositChange.tsx b/packages/dev-frontend/src/components/Stability/validation/validateStabilityDepositChange.tsx index 3a7b9110d..59c8f7c49 100644 --- a/packages/dev-frontend/src/components/Stability/validation/validateStabilityDepositChange.tsx +++ b/packages/dev-frontend/src/components/Stability/validation/validateStabilityDepositChange.tsx @@ -75,8 +75,7 @@ export const validateStabilityDepositChange = ( ]; } - - if(change && !bammAllowance) { + if(change && change.depositLUSD?.gt(Decimal.fromBigNumberString(bammAllowance.toString()))) { return [ undefined, diff --git a/packages/lib-ethers/etc/lib-ethers.api.md b/packages/lib-ethers/etc/lib-ethers.api.md index ad395e68f..f8026e421 100644 --- a/packages/lib-ethers/etc/lib-ethers.api.md +++ b/packages/lib-ethers/etc/lib-ethers.api.md @@ -61,7 +61,7 @@ export class BlockPolledLiquityStore extends LiquityStore; // (undocumented) - getBammAllowance(overrides?: EthersCallOverrides): Promise; + getBammAllowance(overrides?: EthersCallOverrides): Promise; // @internal (undocumented) _getBlockTimestamp(blockTag?: BlockTag): Promise; // (undocumented) diff --git a/packages/lib-ethers/src/BlockPolledLiquityStore.ts b/packages/lib-ethers/src/BlockPolledLiquityStore.ts index 9344d7bf7..2e155c209 100644 --- a/packages/lib-ethers/src/BlockPolledLiquityStore.ts +++ b/packages/lib-ethers/src/BlockPolledLiquityStore.ts @@ -39,7 +39,7 @@ export interface BlockPolledLiquityStoreExtraState { /** @internal */ _feesFactory: (blockTimestamp: number, recoveryMode: boolean) => Fees; - bammAllowance: boolean; + bammAllowance: any; } /** diff --git a/packages/lib-ethers/src/ReadableEthersLiquity.ts b/packages/lib-ethers/src/ReadableEthersLiquity.ts index 3707fb6a4..003001f52 100644 --- a/packages/lib-ethers/src/ReadableEthersLiquity.ts +++ b/packages/lib-ethers/src/ReadableEthersLiquity.ts @@ -610,14 +610,14 @@ export class ReadableEthersLiquity implements ReadableLiquity { : { status: "unregistered" }; } - async getBammAllowance(overrides?: EthersCallOverrides): Promise { + async getBammAllowance(overrides?: EthersCallOverrides): Promise { const { lusdToken, bamm } = _getContracts(this.connection); const address = _requireAddress(this.connection); const reallyLargeAllowance = BigNumber.from("0x8888888888888888888888888888888888888888888888888888888888888888") const allowance = await lusdToken.allowance(address, bamm.address) console.log({allowance}) - const bammAllowance = allowance.gt(reallyLargeAllowance) + const bammAllowance = allowance return bammAllowance; } }