Closed zahhar closed 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");
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);
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: