0

I create a dapp using Solidity,Web3Js,Javascript and Html with metamask i always getting this error when i am trying to submit my transition i am getting this error

at c (inpage.js:1)
    at inputTransactionFormatter (inpage.js:1)
    at inpage.js:1
    at Array.map (<anonymous>)
    at i.formatInput (inpage.js:1)
    at i.toPayload (inpage.js:1)
    at n.e [as sendTransaction] (inpage.js:1)
    at u.sendTransaction (inpage.js:1)
    at u.execute (inpage.js:1)
    at index.html:143

so please help me to solve this error.

code:

<script>
    if (typeof web3 !== 'undefined') {
           web3 = new Web3(web3.currentProvider);
       } else {
           web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
       }
       web3.eth.defaultAccount = web3.eth.getAccounts[0];
       var dairyindustryContract = web3.eth.contract([{
        "constant": false,
        "inputs": [
            {
                "name": "_producerid",
                "type": "uint256"
            },
            {
                "name": "_name",
                "type": "string"
            },
            {
                "name": "_place",
                "type": "string"
            }
        ],
        "name": "producerdetails",
        "outputs": [],
        "payable": false,
        "stateMutability": "nonpayable",
        "type": "function"
    }]);
        var dairyindustry= dairyindustryContract.at('0x8879ab5cf518e1cddffe4cb71d74c309ba1a03f6');
        console.log(dairyindustry);
        $("#is_button").click(function(){
        dairyindustry.producerdetails($("#producerid").val(),$("#name").val(),$("#place").val(),(err,res)=>{
            if(err){
                alert('Erroe');
            }
        })
        });
    </script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.