Transactions not happening in Ropsten Test Network

By May 9, 2020Ethereum
Click here to view original web page at

I'm learning to set up a simple front-end website that executes smart contract methods in a testing environment, but even though MetaMask confirms the deployment of the contract, the transaction is not being executed.

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Deploy a Remix Contract</title>

    <link rel="stylesheet" type="text/css" href="main.css" />

    <script src=""></script>

      <h1>Ethereum Secret Messenger</h1>
      <hr />

      <label for="message"
        >This site writes a secret message to the Ethereum blockchain!</label
      <input id="userInput" type="text" />

      <button id="setMessageButton">Set secret message</button>

    <script src=""></script>

      // Connect a the web3 provider
      if (typeof web3 !== "undefined") {
        web3 = new Web3(web3.currentProvider);
      } else {
        web3 = new Web3(
          new Web3.providers.HttpProvider(

      // Set a default account
      web3.eth.defaultAccount = web3.eth.accounts[0];

      // Get the contract address
      var RemixContract = new web3.eth.Contract([
          constant: false,
          inputs: [
              name: "x",
              type: "string",
          name: "setMessage",
          outputs: [],
          payable: false,
          stateMutability: "nonpayable",
          type: "function",
          constant: true,
          inputs: [],
          name: "getMessage",
          outputs: [
              name: "",
              type: "string",
          payable: false,
          stateMutability: "view",
          type: "function",

      // Get the contract abi
      RemixContract.options.address =

      $("#setMessageButton").click(function () {
        message = $("#userInput").val();
  1. I've obtained the ether from MetaMask faucet into the Ropsten Test Network.
  2. Set the network to Ropsten Test Network on MetaMask.
  3. Deployed the smart contract on Remix IDE through the injected web3 environment
  4. Pointed the endpoint of Web3 in the front-end website's code to Infura's Ropsten address
  5. Set the Remix's contract address as well as the ABI in the front-end code

As mentioned previously, MetaMask shows the log of the Contract Deployment being confirmed, but when I try to use the method setMessage, the MetaMask pop up doesn't appear and nothing else happens. The website is running on the local port 5500 through the VSC's Live Server extension and shows no error in the log.

Leave a Reply