pragma solidity ^0.5.9;

    contract kyc2{
        bool public isallowed;
        // Structure of customer
        struct customer{
            string custname;
            string custdata;
            bool status;
            uint256 downvote;
            uint256 upvote;
            address custbank;
        mapping(address => customer) public customers;
        address[] public customerarray;
    function addcust(address addr,string memory _custname,string memory _custdata) public returns(bool){
        customer storage cust=customers[addr];

        return true;

Getting warning as: Gas costs: Gas requirement of function kyc2.addcust 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: 21:4:



Your Answer

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

Browse other questions tagged or ask your own question.