stablecoin icon indicating copy to clipboard operation
stablecoin copied to clipboard

Add dynamic errors to metadata

Open dcastro opened this issue 5 years ago • 0 comments

Clarification and motivation

In #124, we added support for TZIP-16. However, we don't yet support dynamic errors.

TZIP-16 distinguishes between:

  1. Static errors: errors that contain only an hardcoded value, like "NOT_CONTRACT_OWNER"
  2. Dynamic errors: errors that contain non-hardcoded values, like ("MISSIGNED", <bytes>)"

We should add support for these:

  • MISSIGNED
  • NotEnoughBalance (in the fa1.2 version of the contract)
  • UnsafeAllowanceChange (in the fa1.2 version of the contract)

Because the metadata is already too big to fit in stablecoin's storage, we should wait for #138 before doing this.

It would also be nice to do morley-metadata/#2 first, but that's not strictly necessary.

Acceptance criteria

The stablecoin contract's metadata contains 1 dynamic error for 'MISSIGNED', and the FA1.2 stablecoin's metadata contains 3 dynamic errors for MISSIGNED/NotEnoughBalance/UnsafeAllowanceChange

dcastro avatar Nov 27 '20 09:11 dcastro