Issues with Solidity override system

Hello,
Thanks for all the help so far.
I am trying to troubleshoot an override error.

Can someone explain how the override system works in the openzepplin framework in this case?

The error is
expected { but got override
derived from passing 21 of this source code:

// SPDX-License-Identifier: MIT

pragma solidity >=0.4.22 <0.9.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";

import "@openzeppelin/contracts/security/Pausable.sol";

import "@openzeppelin/contracts/access/Ownable.sol";

contract Testing_overrides is ERC20, ERC20Burnable, Pausable, Ownable {

    constructor() ERC20("testing_overrides", "TEST") {}

    function pause() public onlyOwner {

        _pause();

    }

    function unpause() public onlyOwner {

        _unpause();

    }

    function _beforeTokenTransfer(address from, address to, uint256 amount) 

        internal whenNotPaused override {
![bandicam 2021-07-07 18-46-45-941|554x500](upload://tUiNbSHKuVrHt1EMhvRgdC89fzo.jpeg)


        super._beforeTokenTransfer(from, to, amount);

    }

}

Except for the stray ![bandicam 2021-07-07 18-46-45-941|554x500](upload://tUiNbSHKuVrHt1EMhvRgdC89fzo.jpeg) in the middle of the code (that would break it - with a different error though; was it meant to be a screenshot attached to the post?) this compiles fine for me with solc 0.8.6. Same in Remix IDE (both 0.8.6 and the default 0.8.4). How are you compiling it to get that error?

1 Like

No, the bandicam snapshot was not in the source code.

The error sort of fixed itself, I will try not to post questions unless they are more serious in the future.

The real issue is that I am still learning solidity haha.