0

I made a contract with some functionality using remix IDE and MetaMask. When deployed on rinkeby testnet it is working just fine but when i tray to deploy the contract on Azure private network i get the next massage:

"Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? Invalid JSON RPC response: {"id":72,"jsonrpc":"2.0","error":{"code":-32603}}"

Any help will be appreciated.

the code:

pragma solidity ^0.4.19;

import "browser/SafeMath.sol";
import "browser/ICOFullContract.sol";

contract QAndA {
  using SafeMath for uint256;
  uint256 public price;
  address public qOwner;
  SpitballToken public tokenReward;
  mapping (address => uint256) public balanceOf;
  event AnswerAccepted(address indexed from, address indexed to, uint256 value);
constructor (uint256 _price, address _addressOfTokenUsedAsReward) public {
    price = _price;
    qOwner = msg.sender;
    tokenReward = SpitballToken(_addressOfTokenUsedAsReward);
    tokenReward.approve(msg.sender, SafeMath.mul(price, 10**18));
}


function submit () public
{
    tokenReward.transferFrom(msg.sender, address(this), SafeMath.mul(price, 10**18));
    balanceOf[msg.sender] = SafeMath.add(balanceOf[msg.sender], SafeMath.mul(price, 10**18));
}

function approveAnswer (address _winner) public {
    tokenReward.transfer(_winner, SafeMath.mul(price, 10**18));
    balanceOf[msg.sender] = SafeMath.sub(balanceOf[msg.sender], SafeMath.mul(price, 10**18));
}

function returnFoundsToUser () public {
    require(msg.sender == qOwner);
    tokenReward.transfer(msg.sender, SafeMath.mul(price, 10**18));
    balanceOf[msg.sender] = SafeMath.sub(balanceOf[msg.sender], SafeMath.mul(price, 10**18));
}

function spreadFounds (uint8 percentage) public {
    tokenReward.transfer(msg.sender, SafeMath.mul(SafeMath.mul(price,SafeMath.div(percentage,100)), 10**18));
}

}

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.