Skip to content

Instantly share code, notes, and snippets.

@bhavya2611
Last active May 22, 2021 11:36
Show Gist options
  • Save bhavya2611/a0f2696900f7a6399025f4661beb9a20 to your computer and use it in GitHub Desktop.
Save bhavya2611/a0f2696900f7a6399025f4661beb9a20 to your computer and use it in GitHub Desktop.
const getLpTokenTotalSupply = async () => {
try {
const LpTokenContract = new web3.eth.Contract(
IUniswapV2Pair,
LP_TOKEN_ADDRESS
);
const totalSupply = await LpTokenContract.methods.totalSupply().call();
return totalSupply;
} catch (e) {
console.log(e);
return 0;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment