tezos-checker / checker

An in-development "robocoin" system for the Tezos blockchain
24 stars 16 forks source link

Ensure the FA2-related entrypoints fail if Tezos.amount > 0 #144

Closed gkaracha closed 3 years ago

gkaracha commented 3 years ago

I am not entirely sure about this one, to be honest. While adding tests I noticed that our FA2-related entrypoints do not fail if Tezos.amount <> 0tez, which is the common practice if no tez is expected, so I added the checks myself (plus unit tests). However, I couldn't find such a restriction in the FA1.2/TZIP7 or the FA2/TZIP12 spec. For what it's worth, ctez which conforms to TZIP7 also performs this check.

Size updates:

Because of the two strict entrypoints (strict_entrypoint_transfer and strict_entrypoint_balance_of) the size of the main contract goes up a little, and the lazy entrypoint update_operators increases slightly in size as well:

Main contract    : ~8875 bytes => ~8987 bytes
update_operators :  ~454 bytes =>  ~487 bytes

I've tested locally and the contract is still deployable though; gas consumption changes must be negligible as well.

gkaracha commented 3 years ago

I agree that these checks are good to have, thanks for merging!