hirosystems / explorer

Explore transactions and accounts on the Stacks blockchain. Clone any contract and experiment in your browser with the Explorer sandbox.
https://explorer.hiro.so/
MIT License
138 stars 100 forks source link

Consider improving post conditions handling #822

Open lgalabru opened 2 years ago

lgalabru commented 2 years ago

It would be interesting to explore ways to improve the support of post conditions on the explorer - a very unique and powerful feature.

1) The wording is not alway clear:

Screen Shot 2022-08-16 at 10 59 27

Is the user receiving 19 DIKO? sending 19 DIKO? The explorer is product designed for end users, not developers, I think it'd be adequate to educate users about this feature. Instead of a title "Post conditions" assuming that users know what this section is about, a sentence like:

This transaction is secured / protected by privileges named post-conditions and it will automatically be cancelled if the contract tries to abuse the following rules and or does not meet the following expectations:

  • User should receive 19 DIKO

The wording should of course be depending on the "Allow mode" / "Deny mode", and help users understand correctly how to read post conditions, and how they'll be applied, without resolving double negations :).

The explorer should also be raising some alarms, so that users can cancel transactions (if this is something we're doing, or planning to do). For instance, in this transaction:

Screen Shot 2022-08-16 at 10 59 08

It makes me think that the post-condition was not correctly set by the developer / wallet / user: there's no upper bound (transfer at least, instead of at most). In this situation, I think it's explorer's duty to alarm users that something is fishy.

andresgalante commented 1 month ago

@ginny-d can we add this one to the redesign bag?