Skip to content

Commit 0c301b0

Browse files
authored
fix: miscellaneous (#63)
Fixes recallnet/ipc#488
1 parent f6316ed commit 0c301b0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/token/Recall.sol

+4-5
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@ import {ERC20BurnableUpgradeable} from
1313
"@openzeppelin/contracts-upgradeable/contracts/token/ERC20/extensions/ERC20BurnableUpgradeable.sol";
1414

1515
import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/contracts/utils/PausableUpgradeable.sol";
16-
import {ReentrancyGuardUpgradeable} from
17-
"@openzeppelin/contracts-upgradeable/contracts/utils/ReentrancyGuardUpgradeable.sol";
1816

1917
/// @title Recall Token Contract
2018
/// @dev Implements an upgradeable ERC20 token with additional features like pausing and minting
2119
contract Recall is
2220
ERC20BurnableUpgradeable,
2321
AccessControlUpgradeable,
2422
PausableUpgradeable,
25-
ReentrancyGuardUpgradeable,
2623
UUPSUpgradeable,
2724
InterchainTokenStandard
2825
{
@@ -48,7 +45,6 @@ contract Recall is
4845
__ERC20_init("Recall", symbol);
4946
__AccessControl_init();
5047
__Pausable_init();
51-
__ReentrancyGuard_init();
5248
__UUPSUpgradeable_init();
5349
_interchainTokenService = its;
5450
_itsSalt = itsSalt;
@@ -114,7 +110,10 @@ contract Recall is
114110
override(ERC20Upgradeable, InterchainTokenStandard)
115111
{
116112
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) {
118117
_approve(sender, spender, _allowance - amount, false);
119118
}
120119
}

src/token/ValidatorGater.sol

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ contract ValidatorGater is IValidatorGater, UUPSUpgradeable, OwnableUpgradeable
3535

3636
function initialize() public initializer {
3737
__Ownable_init(msg.sender);
38+
__UUPSUpgradeable_init();
3839
_active = true;
3940
}
4041

0 commit comments

Comments
 (0)