From d191075de7a0cc1517deb711a4fcd423f28524bf Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 20 Nov 2024 10:57:16 -0800 Subject: [PATCH] fixed unnecessary allowance increase --- .../DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts | 2 +- .../DaoProposalSingle/common/hooks/makeUsePublishProposal.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts index a41206407..69725cc9c 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts @@ -274,7 +274,7 @@ export const makeUsePublishProposal = // Request to increase the contract's allowance for the proposal // deposit if needed. - if (remainingAllowanceNeeded) { + if (remainingAllowanceNeeded.isPositive()) { try { await increaseCw20DepositAllowance({ amount: remainingAllowanceNeeded.toString(), diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts index 3d2605c58..0508f0e60 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts @@ -245,7 +245,7 @@ export const makeUsePublishProposal = // Request to increase the contract's allowance for the proposal // deposit if needed. - if (remainingAllowanceNeeded) { + if (remainingAllowanceNeeded.isPositive()) { try { await increaseCw20DepositAllowance({ amount: remainingAllowanceNeeded.toString(),