diff --git a/contracts/src/erc20/mod.rs b/contracts/src/erc20/mod.rs index f9ee24016..deee4f06c 100644 --- a/contracts/src/erc20/mod.rs +++ b/contracts/src/erc20/mod.rs @@ -327,7 +327,11 @@ impl ERC20 { // `_total_supply` never overflows. // TODO: Think about SafeMath library let total_supply = self.total_supply(); - self._total_supply.set(total_supply + value); + self._total_supply.set( + total_supply + .checked_add(value) + .expect("Should not exceed U256::MAX for `_total_supply"), + ); } else { let from_balance = self._balances.get(from); if from_balance < value {