I am testing out solidity in remix ide using simple contracts. This is the contract that I wrote:
contract mortal {
address owner;
function mortal() {
owner = msg.sender;
}
function kill(){
if(msg.sender == owner){
selfdestruct(owner);
}
}
}
contract Hello is mortal
{
string public message;
function Hello(){
message = 'This is the initial Message';
}
function getMessage() public constant returns(string){
return message;
}
function setNewMessage(string newMessage) public payable {
message = newMessage;
}
}
On looking at details I am getting infinite gas estimates for each of these functions.
{
"Creation": {
"codeDepositCost": "243200",
"executionCost": "infinite",
"totalCost": "infinite"
},
"External": {
"getMessage()": "infinite",
"kill()": "30636",
"message()": "infinite",
"setNewMessage(string)": "infinite"
}
}
Please elaborate why am I getting infinite gasEstimates for these functions and how can I avoid this mistake ?
mortal
?