mento-protocol / reserve-site

Mento Reserve Website
https://reserve.mento.org
1 stars 4 forks source link

fix: decimal issue that was causing bridged USDC balance error #32

Closed bowd closed 1 year ago

bowd commented 1 year ago

Closes: #31

Overview

This PR tackles two separate but somewhat related issues:

  1. The website doesn't correctly count USDC in the Mento Reserve Multisig
  2. The website doesn't account for Celo or stCelo held directly by the Reserve Multisig

(1) The USDC issue is actually a decimal one. The balance of the ERC20 token was flowing through a formatNumber function that assumed 18 decimals for all values, therefore it was counting the USDC but the value was scaled wrongly so didn't seam to be in the total. Extending the function to support optional number of decimals fixes the issue.

(2) I have manually added the reserve multisig content to the custody calculation logic. To be clear this won't account for Celo/stCelo included in Uniswap pools, just held directly by the address.

Other changes

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
reserve-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 2, 2023 8:18am