Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ERC20._spendAllowance in CustomToken #170

Open
SKYBITDev3 opened this issue Feb 18, 2024 · 0 comments
Open

Use ERC20._spendAllowance in CustomToken #170

SKYBITDev3 opened this issue Feb 18, 2024 · 0 comments
Assignees

Comments

@SKYBITDev3
Copy link

Can the code

function _spendAllowance(address sender, address spender, uint256 amount) internal override (ERC20, InterchainTokenStandard) {
uint256 _allowance = allowance(sender, spender);
if (_allowance != UINT256_MAX) {
_approve(sender, spender, _allowance - amount);
}
}

be replaced by

function _spendAllowance(address sender, address spender, uint256 amount) internal override (ERC20, InterchainTokenStandard) {
    ERC20._spendAllowance(sender, spender, amount);
 } 

?

Or was there a reason not to use the built-in _spendAllowance in ERC20?

@Olanetsoft Olanetsoft assigned re1ro and npty and unassigned re1ro Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants