furqansiddiqui / erc20-php

Interact with Ethereum ERC20 Tokens
MIT License
163 stars 96 forks source link

I get gmp_init wrong #26

Closed PHPJourney closed 3 years ago

PHPJourney commented 3 years ago

gmp_init(): Unable to convert variable to GMP - string is not an integer

I get this error. this method is balanceOf

PHPJourney commented 3 years ago

Hex callback null. cannot use it.

PHPJourney commented 3 years ago
          $hex = substr($hex, 2);
        }   
       $hex = self::HexitPads($hex);
       return new BcNumber(gmp_strval(gmp_init($hex, 16), 10)); 
   }  
/**     * @param string|int $dec
     * @return string
PHPJourney commented 3 years ago

I think you need check this params be null.

furqansiddiqui commented 3 years ago

Please try upgrading erc20-php lib to 0.2.1