Im using this function to add tax feature to my contract but remix ide giving me error.
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual override {
uint tax = (amount / 100) * 5; // 5% tax
super._transfer(sender, recipient, amount - tax);
super._transfer(sender, fund, tax);
}
error is :
TypeError: Trying to override non-virtual function. Did you forget to add "virtual"? --> @openzeppelin/contracts/token/ERC20/ERC20.sol:171:5: | 171 | function _transfer(address from, address to, uint256 value) internal { | ^ (Relevant source part starts here and spans across multiple lines). Note: Overriding function is here: --> contracts/1_Storage.sol:15:5: | 15 | function _transfer( | ^ (Relevant source part starts here and spans across multiple lines).