Closed noushkia closed 1 year ago
You implemented some checks in the burn and mint functions.
if (_amount <= 0) { revert DecentralizedStableCoin__AmountMustBeMoreThanZero(); } if (balance < _amount) { revert DecentralizedStableCoin__BurnAmountExceedsBalance(); }
In the burn function, you check whether the amount is negative or not. Isn't this checked via the type of amount argument i.e. uint256?
How about the DecentralizedStableCoin__BurnAmountExceedsBalance check? This is checked inside the ERC20 implementation as well.
DecentralizedStableCoin__BurnAmountExceedsBalance
uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
Are there any specific reasons for these extra validations?
Thank you for the great content!
What is answer to this? Arent those checks redundant?
You implemented some checks in the burn and mint functions.
In the burn function, you check whether the amount is negative or not. Isn't this checked via the type of amount argument i.e. uint256?
How about the
DecentralizedStableCoin__BurnAmountExceedsBalance
check? This is checked inside the ERC20 implementation as well.Are there any specific reasons for these extra validations?
Thank you for the great content!