pragma solidity ^0.5.2;

contract Bill {

    string filehash;
    string locker;
    address userwallet;
    uint256 amount;

    event isDeposit(
       string filehash,
       string locker,
       address userwallet,
       uint256 amount

    function Deposit(string memory _filehash, string memory _locker) public payable{
        filehash = _filehash;
        locker = _locker;
        amount = msg.value;
        userwallet = msg.sender;
        emit isDeposit(filehash, locker, userwallet, amount);  


Why I see warning?

Gas requirement of function Bill.Deposit(string,string) high: infinite.

1 Answer 1


This warning is because you're using strings. There's no way to know how long they are, so the amount of gas required to run the function is unbounded.

It's safe to ignore this warning.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.