async function fetchGreeting() {
    if (typeof window.ethereum !== "undefined") {
      const provider = new ethers.providers.Web3Provider(window.ethereum);
      const contract = new ethers.Contract(
        greeterAddress,
        Greeter.abi,
        provider
      );
      try {
        const data = await contract.greet();
        console.log("data: ", data);
      } catch (err) {
        console.log("Error: ", err);
      }
    }
  }
// call the smart contract, read the current greeting value
call the smart contract, read the current greeting value
call the smart contract read the current greeting value
async function fetchGreeting() {
    if (typeof window.ethereum !== "undefined") {
      const provider = new ethers.providers.Web3Provider(window.ethereum);
      const contract = new ethers.Contract(
        greeterAddress,
        Greeter.abi,
        provider
      );
      try {
        const data = await contract.greet();
        console.log("data: ", data);
      } catch (err) {
        console.log("Error: ", err);
      }
    }
  }
async function fetchGreeting ( ) { if ( typeof window . ethereum !== "undefined" ) { const provider = new ethers . providers . Web3Provider ( window . ethereum ) ; const contract = new ethers . Contract ( greeterAddress , Greeter . abi , provider ) ; try { const data = await contract . greet ( ) ; console . log ( "data: " , data ) ; } catch ( err ) { console . log ( "Error: " , err ) ; } } }
call the smart contract, read the current greeting value
call the smart contract read the current greeting value