โœ๏ธ Providers & Signers

Providers

Providers are your connections to different blockchains. Scaffold-eth uses ethers.js providers.
The frontend has three different providers that provide different levels of access to different chains:
mainnetProvider: (read only) Alchemy or Infura connection to main Ethereum network (and contracts already deployed like DAI or Uniswap).
localProvider: local HardHat accounts, used to read from your contracts (.env file points you at testnet or mainnet). We use ethers.providers.StaticJsonRpcProvider when instantiating providers from RPCs where we are confident that the chainId won't change to save on network calls :)
injectedProvider: your personal MetaMask, WalletConnect via Argent, connected using web3modal.
โ€‹โ€‹
โ€‹
โ€‹
These providers can be found in App.jsx at packages/react-app/src

Signers

From the ethers.js docs.โ€‹
A Signer in ethers is an abstraction of an Ethereum Account, which can be used to sign messages and transactions and send signed transactions to the Ethereum Network to execute state changing operations.
Scaffold-eth now uses signers for user operations, either using injectedProvider.getSigner(), or using a Burner Signer created and stored in localStorage (all handled by the useUserSigner hook!)

When should I use a provider and when should I use a signer?

If you are only reading data, use a provider. If you need to make transactions, or sign things, use a Signer.

Supported Web3 Signers / Providers

Ethers

Metamask

WalletConnect

Coinbase Wallet

Scaffold-eth supports connecting with Coinbase Wallet and signing transactions with it.
See it in action here:
โ€‹