diff --git a/app/package.json b/app/package.json index 79e5091b..32ec9c3b 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "@dgrants/app", - "version": "0.2.42-3aadf31.0", + "version": "0.2.43-5b780bb.0", "private": true, "scripts": { "clean": "rimraf dist", @@ -14,9 +14,9 @@ "prettier": "prettier --write ." }, "dependencies": { - "@dgrants/contracts": "^0.2.30-3aadf31.0", - "@dgrants/dcurve": "^0.2.32-3aadf31.0", - "@dgrants/types": "^0.2.30-3aadf31.0", + "@dgrants/contracts": "^0.2.31-5b780bb.0", + "@dgrants/dcurve": "^0.2.33-5b780bb.0", + "@dgrants/types": "^0.2.31-5b780bb.0", "@fusion-icons/vue": "^0.0.0", "@headlessui/vue": "^1.2.0", "@tailwindcss/aspect-ratio": "^0.2.1", diff --git a/app/src/utils/data/grantRounds.ts b/app/src/utils/data/grantRounds.ts index d9c7d787..e76ca04e 100644 --- a/app/src/utils/data/grantRounds.ts +++ b/app/src/utils/data/grantRounds.ts @@ -203,7 +203,15 @@ export async function getGrantRound(blockNumber: number, grantRoundAddress: stri matchingToken = SUPPORTED_TOKENS_MAPPING[matchingTokenAddress]; donationToken = SUPPORTED_TOKENS_MAPPING[donationTokenAddress]; // record the funds as a human readable number - funds = parseFloat(formatUnits(BigNumber.from(funds), SUPPORTED_TOKENS_MAPPING[matchingTokenAddress].decimals)); + try { + funds = parseFloat( + formatUnits(BigNumber.from(funds), SUPPORTED_TOKENS_MAPPING[matchingTokenAddress].decimals) + ); + } catch { + // If parsing funds for the round fails, ignore the round + console.log('Failed to parse funds for round'); + return {}; + } } else if (LocalForageData && _lsBlockNumber < blockNumber) { // get updated metadata const [newMetaPtr, balance] = await Promise.all([ @@ -213,7 +221,13 @@ export async function getGrantRound(blockNumber: number, grantRoundAddress: stri // update to the new metaPtr metaPtr = newMetaPtr; // update to the new balance - funds = parseFloat(formatUnits(balance, SUPPORTED_TOKENS_MAPPING[matchingTokenAddress].decimals)).toString(); + try { + funds = parseFloat(formatUnits(balance, SUPPORTED_TOKENS_MAPPING[matchingTokenAddress].decimals)).toString(); + } catch { + // If parsing funds for the round fails, ignore the round + console.log('Failed to update funds from metadata'); + return {}; + } } // build status against now (unix) const now = Date.now() / 1000; diff --git a/contracts/package.json b/contracts/package.json index f7849982..b0728cf2 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -1,8 +1,8 @@ { "name": "@dgrants/contracts", - "version": "0.2.30-3aadf31.0", + "version": "0.2.31-5b780bb.0", "devDependencies": { - "@dgrants/types": "^0.2.30-3aadf31.0", + "@dgrants/types": "^0.2.31-5b780bb.0", "@nomiclabs/hardhat-ethers": "^2.0.2", "@nomiclabs/hardhat-waffle": "^2.0.1", "@openzeppelin/contracts": "3.4.1-solc-0.7-2", diff --git a/dcurve/package.json b/dcurve/package.json index bb644c44..0fea0d0a 100644 --- a/dcurve/package.json +++ b/dcurve/package.json @@ -1,6 +1,6 @@ { "name": "@dgrants/dcurve", - "version": "0.2.32-3aadf31.0", + "version": "0.2.33-5b780bb.0", "private": true, "description": "distribution generator for GrantCLR in dgrants", "keywords": [ @@ -29,7 +29,7 @@ "extends": "../package.json" }, "dependencies": { - "@dgrants/contracts": "^0.2.30-3aadf31.0", + "@dgrants/contracts": "^0.2.31-5b780bb.0", "@dgrants/utils": "^0.2.15-8a7e113.0", "buffer": "^6.0.3", "ethers": "^5.4.6" diff --git a/types/package.json b/types/package.json index 12600cd4..5150afdc 100644 --- a/types/package.json +++ b/types/package.json @@ -1,6 +1,6 @@ { "name": "@dgrants/types", - "version": "0.2.30-3aadf31.0", + "version": "0.2.31-5b780bb.0", "types": "src/index.d.ts", "scripts": { "build": "tsc -b .",