generated from veeso-dev/rust-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ERC20 total supply should be static. Added swappedSupply with ci…
…rculating supply
- Loading branch information
Showing
6 changed files
with
175 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import * as React from 'react'; | ||
import { useConnectedMetaMask, useMetaMask } from 'metamask-react'; | ||
import Web3Client from '../../web3/Web3Client'; | ||
import Container from '../reusable/Container'; | ||
import Heading from '../reusable/Heading'; | ||
import { ChainId } from '../MetamaskConnect'; | ||
|
||
const SwappedSupply = () => { | ||
const { account, ethereum, chainId } = useConnectedMetaMask(); | ||
const [swappedSupply, setSwappedSupply] = React.useState(0); | ||
|
||
React.useEffect(() => { | ||
const client = new Web3Client(account, ethereum, chainId as ChainId); | ||
client.swappedSupply().then((supply) => { | ||
setSwappedSupply(supply); | ||
}); | ||
}); | ||
|
||
return ( | ||
<Container.Container> | ||
<Heading.H2> | ||
Total circulating supply (swapped): {swappedSupply} | ||
</Heading.H2> | ||
</Container.Container> | ||
); | ||
}; | ||
|
||
export default SwappedSupply; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters