is "if (Tezos.amount>Tezos.balance) then" wrong? Oddly, the condition is failwith when i sent more tez compared to the contract balance
1 Answer
Yes, it is wrong.
At that point, the amount
has already been credited to the contract balance
. Meaning that the balance
will never be less than the amount
.
-
Wow! what a cool interface. What do you use? And also how do I compare the amount of tez and the contract balance then? Apr 30 at 10:22
-
The animation above uses visualtez.com with a testing feature coming in May. Looking at what you have above, you probably want something like
Tezos.amount > (Option.unopt (Tezos.balance - Tezos.amount))
. May 1 at 22:16