Make balanceOf virtual in ERC20

Can we make balaceOf() virtual in ERC20.sol ?

There are cases when the balance is changing over time, and to save costs for transactions you can implement the changed balance dynamically. This usually occurs in DeFi when users are getting interests, or there may be cases when the token holders are awarded extra tokens.

I have seen this implementation in aave:

But they are using an older version of OpenZeppelin to override the balanceOf

1 Like

I think you can add your case at here:

1 Like

Hi @drbullock,

Welcome to the community :wave:

As @skyge said, if you can add your use case, that would be appreciated.