When deploying a contract, my transaction fails (flag status set to 0) and all gas is marked as used. What could be the possible reasons?
Any help appreciated
Edit with the solidity code in question (which is a very simple token contract) :
pragma solidity ^0.4.24;
contract MinimumToken {
// Fields
mapping(address => uint256) balanceOf;
uint256 total;
address[] participants;
// Constructor
constructor (address from, uint256 _total) public {
total = _total;
balanceOf[from] = total;
}
// Public functions
function transferFrom (address from, address to, uint256 amount) public {
require(!(to == address(0)), "error");
require(!(from == to), "error");
require(amount <= balanceOf[from], "error");
balanceOf[from] = balanceOf[from] - amount;
balanceOf[to] = balanceOf[to] + amount;
}
}
NewContractCreation
function in the types package. But will probably create new thread. Thank you for your help. – Solerus Jan 28 '19 at 12:45