current position:Home>Ethers connects the contract, calls name() and reports sending a transaction requires a signer

Ethers connects the contract, calls name() and reports sending a transaction requires a signer

2022-02-04 00:23:44 Q & A of Denglian community

Excuse me, var contract = new ethers.Contract(address, abi, provider);var name = await contract .name(); Here it is sending a transaction requires a signer, Why is that ?name yes view, You don't need a signature if you connect your wallet var contract = new ethers.Contract(address, abi, wallet);var name = await contract .name(); The transaction will be sent directly here






Other answers 1:


Other answers 2:

copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202040023424474.html

Random recommended