1

When trying to check the transferred value is positive I get an error that TMutez is not TIntOrNat.:

sp.verify(sp.amount > 0, "Amount should be positive")
2

It seems like SmartPy type inference doesn't auto-cast 0 to mutez. We need to do the following:

sp.amount > sp.mutez(0)
1
  • 1
    It's perfectly exact.
    – FFF
    Dec 4 '20 at 19:04

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.