@@ -13,16 +13,13 @@ import {ERC20BurnableUpgradeable} from
13
13
"@openzeppelin/contracts-upgradeable/contracts/token/ERC20/extensions/ERC20BurnableUpgradeable.sol " ;
14
14
15
15
import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/contracts/utils/PausableUpgradeable.sol " ;
16
- import {ReentrancyGuardUpgradeable} from
17
- "@openzeppelin/contracts-upgradeable/contracts/utils/ReentrancyGuardUpgradeable.sol " ;
18
16
19
17
/// @title Recall Token Contract
20
18
/// @dev Implements an upgradeable ERC20 token with additional features like pausing and minting
21
19
contract Recall is
22
20
ERC20BurnableUpgradeable ,
23
21
AccessControlUpgradeable ,
24
22
PausableUpgradeable ,
25
- ReentrancyGuardUpgradeable ,
26
23
UUPSUpgradeable ,
27
24
InterchainTokenStandard
28
25
{
@@ -48,7 +45,6 @@ contract Recall is
48
45
__ERC20_init ("Recall " , symbol);
49
46
__AccessControl_init ();
50
47
__Pausable_init ();
51
- __ReentrancyGuard_init ();
52
48
__UUPSUpgradeable_init ();
53
49
_interchainTokenService = its;
54
50
_itsSalt = itsSalt;
@@ -114,7 +110,10 @@ contract Recall is
114
110
override (ERC20Upgradeable , InterchainTokenStandard)
115
111
{
116
112
uint256 _allowance = allowance (sender, spender);
117
- if (_allowance != type (uint256 ).max) {
113
+
114
+ if (_allowance < amount) {
115
+ revert ERC20InsufficientAllowance (spender, _allowance, amount);
116
+ } else if (_allowance != type (uint256 ).max) {
118
117
_approve (sender, spender, _allowance - amount, false );
119
118
}
120
119
}
0 commit comments