mirror of
https://github.com/th30d4y/OpenLearnX.git
synced 2026-05-27 03:36:32 +00:00
Fix .gitignore: stop tracking ignored files
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../ERC20.sol";
|
||||
import "../../../utils/Context.sol";
|
||||
|
||||
/**
|
||||
* @dev Extension of {ERC20} that allows token holders to destroy both their own
|
||||
* tokens and those that they have an allowance for, in a way that can be
|
||||
* recognized off-chain (via event analysis).
|
||||
*/
|
||||
abstract contract ERC20Burnable is Context, ERC20 {
|
||||
/**
|
||||
* @dev Destroys `amount` tokens from the caller.
|
||||
*
|
||||
* See {ERC20-_burn}.
|
||||
*/
|
||||
function burn(uint256 amount) public virtual {
|
||||
_burn(_msgSender(), amount);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Destroys `amount` tokens from `account`, deducting from the caller's
|
||||
* allowance.
|
||||
*
|
||||
* See {ERC20-_burn} and {ERC20-allowance}.
|
||||
*
|
||||
* Requirements:
|
||||
*
|
||||
* - the caller must have allowance for ``accounts``'s tokens of at least
|
||||
* `amount`.
|
||||
*/
|
||||
function burnFrom(address account, uint256 amount) public virtual {
|
||||
_spendAllowance(account, _msgSender(), amount);
|
||||
_burn(account, amount);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user