@@ -73,29 +73,29 @@ contract ERC20WithPermit is IERC20WithPermit, Ownable {
73
73
return true ;
74
74
}
75
75
76
- /// @notice Moves `amount` tokens from `spender ` to `recipient` using the
76
+ /// @notice Moves `amount` tokens from `owner ` to `recipient` using the
77
77
/// allowance mechanism. `amount` is then deducted from the caller's
78
78
/// allowance unless the allowance was made for `type(uint256).max`.
79
79
/// @return True if the operation succeeded, reverts otherwise.
80
80
/// @dev Requirements:
81
- /// - `spender ` and `recipient` cannot be the zero address,
82
- /// - `spender ` must have a balance of at least `amount`,
83
- /// - the caller must have allowance for `spender `'s tokens of at least
81
+ /// - `owner ` and `recipient` cannot be the zero address,
82
+ /// - `owner ` must have a balance of at least `amount`,
83
+ /// - the caller must have allowance for `owner `'s tokens of at least
84
84
/// `amount`.
85
85
function transferFrom (
86
- address spender ,
86
+ address owner ,
87
87
address recipient ,
88
88
uint256 amount
89
89
) external override returns (bool ) {
90
- uint256 currentAllowance = allowance[spender ][msg .sender ];
90
+ uint256 currentAllowance = allowance[owner ][msg .sender ];
91
91
if (currentAllowance != type (uint256 ).max) {
92
92
require (
93
93
currentAllowance >= amount,
94
94
"Transfer amount exceeds allowance "
95
95
);
96
- _approve (spender , msg .sender , currentAllowance - amount);
96
+ _approve (owner , msg .sender , currentAllowance - amount);
97
97
}
98
- _transfer (spender , recipient, amount);
98
+ _transfer (owner , recipient, amount);
99
99
return true ;
100
100
}
101
101
@@ -289,21 +289,21 @@ contract ERC20WithPermit is IERC20WithPermit, Ownable {
289
289
}
290
290
291
291
function _transfer (
292
- address spender ,
292
+ address owner ,
293
293
address recipient ,
294
294
uint256 amount
295
295
) private {
296
- require (spender != address (0 ), "Transfer from the zero address " );
296
+ require (owner != address (0 ), "Transfer from the zero address " );
297
297
require (recipient != address (0 ), "Transfer to the zero address " );
298
298
require (recipient != address (this ), "Transfer to the token address " );
299
299
300
- beforeTokenTransfer (spender , recipient, amount);
300
+ beforeTokenTransfer (owner , recipient, amount);
301
301
302
- uint256 spenderBalance = balanceOf[spender ];
303
- require (spenderBalance >= amount, "Transfer amount exceeds balance " );
304
- balanceOf[spender ] = spenderBalance - amount;
302
+ uint256 ownerBalance = balanceOf[owner ];
303
+ require (ownerBalance >= amount, "Transfer amount exceeds balance " );
304
+ balanceOf[owner ] = ownerBalance - amount;
305
305
balanceOf[recipient] += amount;
306
- emit Transfer (spender , recipient, amount);
306
+ emit Transfer (owner , recipient, amount);
307
307
}
308
308
309
309
function _approve (
0 commit comments