Ganache does not update account balance after contract deploying

Viewed 215

I work with Ganache and nodeJS. Whenever i effort to deploy my contract with JavaScript the related block is mined, that demonstrate the given contract is deployed, but the balance of the sender account (or deployer account) won't be updated. What is wrong that i can see that.

JavaScript code:

    const Web3 = require("web3");
    web3 = new Web3(new Web3.providers.HttpProvider(Web3.currentProvider));

        .
        .
        .

    const cid = <a value>;
    const pid = <a value>;
    
    
    const source2='path of my solidity file';
    const compiledMyContract = solc.compile(source2);
    const myContractJson="path of json version of my solidity file";
    const myContractJs = JSON.parse(fs.readFileSync(myContractJson));
    const contractByteCode="...";
    const gasEstimate = await web3.eth.estimateGas({data: contractByteCode});
    const myContract = new web3.eth.Contract(myContractJs.abi, null, {data: contractByteCode});
          myContract.deploy().send({from:<address>, gas: gasEstimate, gasPrice: 
    200}).then((instance) => {
        console.log("Contract mined at " + instance.options.address);
        instance.methods.function_A(cid, pid).send({
            from:<address>,
            gas: 2000000,
            gasPrice: 200
        });
        .
        .
        .
0 Answers
Related