begin with the Access Control checks. Could you describe how the access control is…
Jump to turn (6)
- 1begin with the Access Control checks. Could you describe how the access control
- 2Given that the burnOldTfi function makes a call to safeTransferFrom, which is an
- 3the contract that might be susceptible to DoS attacks? Or does the simplicity of
- 4Is there anything else you'd like to add regarding the use of safeTransferFrom i
- 5e safeTransferFrom usage thoroughly explained, let's address the next point: Imp
- 6Considering the BurnedOldTfi event seems to cover the necessary information for
- User
begin with the Access Control checks.
Could you describe how the access control is implemented in the TfiBurn contract? Are there any admin roles or functions that should be restricted? // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
/**
-
@title TfiBurn smart contract
-
@author Ryuhei Matsuda
-
@notice Allow users to burn old TFI tokens */ contract TfiBurn { using SafeERC20 for IERC20;
error ZeroAmount();
event BurnedOldTfi(address indexed user, uint256 amount);
address public constant BURN_ADDRESS = 0x000000000000000000000000000000000000dEaD;
IERC20 public immutable oldTfi;
constructor(address _oldTfi) { oldTfi = IERC20(_oldTfi); }
/**
-
Burn Old TFI token
-
@notice Transfer old tfi to burn address
-
@param amount Burn amount */ function burnOldTfi(uint256 amount) external { if (amount == 0) { revert ZeroAmount(); }
-
-