epam / mintgate

1 stars 2 forks source link

M1 demo feedback: improve error messages #48

Closed zahhar closed 3 years ago

zahhar commented 3 years ago

We need to rely on sort of error code, not the free-text description.

Suggestion - Error code comes first, separated by pipe from free-text message; env::panic(b"E1|Total supply limit reached");

Improvement - move all error message to constants stored separately outside of the contract, and reuse them:

const ERR_TOTAL_SUPPLY_REACHED: &[u8] =b"E1|Total supply limit reached";
env::panic(ERR_TOTAL_SUPPLY_REACHED);