diff --git a/packages/common/src/allo/backends/allo-v1.ts b/packages/common/src/allo/backends/allo-v1.ts index b4325129c..30a37906b 100644 --- a/packages/common/src/allo/backends/allo-v1.ts +++ b/packages/common/src/allo/backends/allo-v1.ts @@ -755,10 +755,7 @@ export class AlloV1 implements Allo { const roundAddress = getAddress(args.roundId); let tx; - if ( - args.tokenAddress === zeroAddress || - args.requireTokenApproval === false - ) { + if (args.tokenAddress === zeroAddress || !args.requireTokenApproval) { emit("tokenApprovalStatus", success(null)); } else { const approvalTx = await sendTransaction(this.transactionSender, { diff --git a/packages/common/src/allo/backends/allo-v2.ts b/packages/common/src/allo/backends/allo-v2.ts index fed4deb4d..7bd74818a 100644 --- a/packages/common/src/allo/backends/allo-v2.ts +++ b/packages/common/src/allo/backends/allo-v2.ts @@ -494,7 +494,9 @@ export class AlloV2 implements Allo { factoryType: "DVMDT", }); - const txData = strategyFactory.getCreateStrategyDataByChainId(this.chainId); + const txData = strategyFactory.getCreateStrategyDataByChainId( + this.chainId + ); const txResult = await sendRawTransaction(this.transactionSender, { to: txData.to, @@ -559,8 +561,9 @@ export class AlloV2 implements Allo { factoryType: "DGL", }); - const txData = strategyFactory.getCreateStrategyDataByChainId(this.chainId); - + const txData = strategyFactory.getCreateStrategyDataByChainId( + this.chainId + ); const txResult = await sendRawTransaction(this.transactionSender, { to: txData.to, @@ -571,7 +574,7 @@ export class AlloV2 implements Allo { if (txResult.type === "error") { return txResult; } - + try { const receipt = await this.transactionSender.wait(txResult.value); const strategyCreatedEvent = decodeEventFromReceipt({ @@ -895,7 +898,7 @@ export class AlloV2 implements Allo { tokenAddress: Address; roundId: string; amount: bigint; - requrieTokenApproval?: boolean; + requireTokenApproval?: boolean; }): AlloOperation< Result, { @@ -912,10 +915,7 @@ export class AlloV2 implements Allo { const poolId = BigInt(args.roundId); - if ( - args.tokenAddress === zeroAddress || - args.requrieTokenApproval === false - ) { + if (args.tokenAddress === zeroAddress || !args.requireTokenApproval) { emit("tokenApprovalStatus", success(null)); } else { const approvalTx = await sendTransaction(this.transactionSender, { diff --git a/packages/round-manager/src/features/round/FundContract.tsx b/packages/round-manager/src/features/round/FundContract.tsx index b1790f238..da3ce310a 100644 --- a/packages/round-manager/src/features/round/FundContract.tsx +++ b/packages/round-manager/src/features/round/FundContract.tsx @@ -662,6 +662,11 @@ export default function FundContract(props: { let requireTokenApproval = false; + const amount = ethers.utils.parseUnits( + amountToFund.toString(), + matchingFundPayoutToken.decimal + ); + const alloVersion = props.round?.tags?.includes("allo-v2") ? "v2" : "v1"; const roundAddress = alloVersion === "v1" ? props.round?.id : getAlloAddress(chainId); @@ -679,7 +684,7 @@ export default function FundContract(props: { address as string, roundAddress as string ); - if (tokenAllowance.lt(BigNumber.from(amountToFund))) { + if (tokenAllowance.lt(amount)) { requireTokenApproval = true; } }