FUNCTION
require_zero_exclusive_asset_amount_limits
function require_zero_exclusive_asset_amount_limits(value: big_integer, name: text)Ensures that an asset amount is in the interval (0; 2^256) (exclusive)
Throws "INVALID AMOUNT" if value is too high
Throws "INVALID AMOUNT" if value is too low
Should be used inside other functions, and the name parameter should be passed
in a way that the error message is understood by the end users.
Example: require_zero_exclusive_asset_amount_limits(-1, "Amount to mint")
will throw this error:
"INVALID AMOUNT: Amount to mint: value must be non-zero positive, actual: -1"
Parameters
- value — the amount to check
- name — the name of the parameter for nicer error printing
© 2024 Chromia