//link to smart contract https://ethfiddle.com/Q4mg9xHlzR let address = "0x03b6b93cf23f04a32aa94fe1ef96cae383900ea7"; let abi = [ { "constant": false, "inputs": [ { "name": "newMessage", "type": "string" } ], "name": "update", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "name": "initMessage", "type": "string" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "constant": true, "inputs": [], "name": "message", "outputs": [ { "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" } ] provider = ethers.getDefaultProvider('ropsten'); wallet = ethers.Wallet.createRandom(); contract = new ethers.Contract(address, abi, provider); contractWithSigner = contract.connect(wallet); await contractWithSigner.update('msgString');