I am currently building a frontend for my smart contract using ethers and moralis. Part of my dapp functionality requires the creation of a new contract instance using:
const contract = new ethers.Contract(address, abi, provider)
I am using the web3uikit connectbutton which allows users to connect to the dapp, however I'm not able to figure out what to set as the provider. The web3uikit connect button basically takes care of switching chains, using metamask and hardhat, etc, all with just a couple of lines of code.
I have wrapped my component around MoralisProvider like so:
function MyApp({ Component, pageProps }) {
return (
<MoralisProvider initializeOnMount= {false}>
<NotificationProvider>
<Component {...pageProps} />
</NotificationProvider>
</MoralisProvider>
)
}
export default MyApp
I assume I'm supposed to use a the moralis provider but can't find how to use it in their docs. Any help would be appreciated.
Thanks in advance!