diff --git a/src/components/projects/FundProject.jsx b/src/components/projects/FundProject.jsx index e21a913..71677b4 100644 --- a/src/components/projects/FundProject.jsx +++ b/src/components/projects/FundProject.jsx @@ -67,10 +67,12 @@ async function stepperProgress(values, projectData, submissionState, currencies) if (submissionState === CONFIRMED) return IS_CONFIRMED if (submissionState === AUTHORIZATION_SUBMITTED) return NOT_APPROVED if (submissionState === SUBMITTED) return IS_SUBMITTED - if (submissionState === APPROVED || fundToken === IS_ETH) return IS_APPROVED + if (fundToken === IS_ETH) return IS_APPROVED if (!projectData.account) return NOT_CONNECTED const { chainReadibleFn, getAllowance } = getTokenByAddress(fundToken, currencies) - const authorization = await getAllowance() + const { manifest: { goalToken } } = projectData + const spender = fundToken.toLowerCase() === goalToken.toLowerCase() ? LiquidPledging._address : SwapProxy._address + const authorization = await getAllowance(spender) const sanitizedAmount = amount.replace(/\D/g,'') const weiAmount = sanitizedAmount ? chainReadibleFn(sanitizedAmount) : '0' const isAuthorized = Number(authorization) >= Number(weiAmount) diff --git a/src/remote/kyber.js b/src/remote/kyber.js index 08b8d57..23d31e8 100644 --- a/src/remote/kyber.js +++ b/src/remote/kyber.js @@ -28,7 +28,7 @@ function mapToCurrencyFormat(currency) { contract, humanReadibleFn: generateHumanReadibleFn(decimals), chainReadibleFn: generateChainReadibleFn(decimals), - getAllowance: () => getLpAllowance(contract), + getAllowance: spender => getLpAllowance(contract, spender), setAllowance: generateSetApprovalFn(contract) } }