0
 function allowance (address _owner, address _spender) constant returns (uint remaining )
      if **(__allowances[_owner][msg.sender])**{
          **^-------------------------------^**
            return __allowances[_owner][msg.sender];
      }
            return 0;
   }
  • 3
    Well if it's not implicitly convertible, then convert it explicitly! And BTW, your "question" is very badly phrased. – goodvibration Oct 10 '18 at 6:51
  • To avoid some type of errors that are hard to debug Solidity forbid implicit conversion. And some like bool <-> uint256 are not possible at all. It is better if you explictely check for __allowances[_owner][msg.sender] > 0. – Ismael Oct 10 '18 at 21:08
0

The "if statement" returns a bool condition,(being true or false), and likely should have a comparison going on..

In your case there is no comparison (> == etc) going on, and just returning a number.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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