any one have idea about this :
I am trying to send the args on function from owner account but getting Returned error.
I am using web3 1.0 .(https://github.com/ethereum/web3.js/blob/1.0/dist/web3.min.js)
Function in contract :
/**
* @dev Adds single address to whitelist.
* @param trusted Address to be added to the whitelist
*/
function addToWhiteList(address trusted) public onlyOwner {
require(!whitelist[trusted]);
whitelist[trusted] = true;
emit UserWhitelist(true);
}Code on index.html :
// Add user on whitelist
abc.methods.addToWhiteList("0x9DA80947ACf5Fc16299311EdAabc37fF7d201C95")
.send({ from: "0x61A44075419C4402f6DE631341d875Ece6A3922e" })
.on("receipt", function(receipt) {
console.log(receipt);
})
.on("error", function(error) {
console.error(error);
});ERROR : Returned error: The method eth_sendTransaction does not exist/is not available
Note : I add web3 in script tag :
and init. like this :
web3 = new Web3(new Web3.providers.WebsocketProvider("wss://ropsten.infura.io/ws"));
May 16, 2018, 11:19 AM