I am doing the static analysis of the following smart contract (SC) on Remix:
pragma solidity 0.5.1;
contract TxUserWallet {
address owner;
constructor() public {
owner = msg.sender;
}
function transferTo(address payable dest, uint amount) public {
require(tx.origin == owner);
dest.transfer(amount);
}
}
I am getting the message Gas Cost. Somebody please guide me, why I am getting the Gas Cost message? The message is shown below:
Gas costs: Gas requirement of function TxUserWallet.transferTo is infinite: If the gas requirement of a function is higher than the block gas limit, it cannot be executed. Please avoid loops in your functions or actions that modify large areas of storage (this includes clearing or copying arrays in storage) Pos: 8:4: