'web3.py LP totalSupply reporting a total supply that's way too small
I'm trying out web3.py to checkout this contract SINGLE/USDT LP on CRONOS: https://cronos.org/explorer/address/0x0fBAB8A90CAC61b481530AAd3a64fE17B322C25d/contracts
From VVS Finance, there should be total liquidity USD1.42mn: https://vvs.finance/info/farm/0x0fbab8a90cac61b481530aad3a64fe17b322c25d
From web3.py, totalSupply is telling me LP size is only 1994692356537712283 wei, or 1.994692356537712283 ETH?! I'm confused what I am reading.
import json
import asyncio
from web3 import Web3
my_wallet_address = "xxxxx"
my_wallet_address = Web3.toChecksumAddress(my_wallet_address)
node_url = "https://evm.cronos.org/" # HTTPS
single_usdc_contract_address = Web3.toChecksumAddress("0x0fbab8a90cac61b481530aad3a64fe17b322c25d")
single_usdc_contract_abi = json.loads('get ABI from contract please')
web3 = Web3(Web3.HTTPProvider(node_url))
contract = web3.eth.contract(address=single_usdc_contract_address, abi=single_usdc_contract_abi)
total_supply = contract.functions.totalSupply().call()
total_supply_eth = web3.fromWei(total_supply, 'ether')
(Need get ABI from https://cronos.org/explorer/address/0x0fBAB8A90CAC61b481530AAd3a64fE17B322C25d/contracts)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|