Is ERC-20 unalterable?

Hi to all !

Taking this ERC-20 Contract standar structure:

Obviously its a great work ! but i am asking me…
Its it unalterable by developer?

Could I change the name of contract (without ERC20)?
Could I change the name os structure of mappings variables?
Could I change the events structure?
Could I remove the events? Could I change the events name?

What is the EVM real standar and unalterable ERC-20 for proper functioning of a token?

Thnks

1 Like

Hey, welcome!

Emmmm, I think IERC20.sol can not be changed if you want to write a standard ERC20 token: openzeppelin-contracts/IERC20.sol.
As for ERC20.sol, I forget to which released version they published makes changes for your target: rewrite ERC20.sol, just like you mentioned ERC20.sol above, all function can be rewrite because they are marked as virtual, that means you can override this function, as for more details, you can have a look at the Solidity documentation: Function Overriding

1 Like

Why ERC20.sol needs the IERC.sol interface ?? I have declared the function name and executions in ERC20.sol

I cant understand it

1 Like

I think if you want to write a standard ERC20 contract, IERC20.sol is necessary, cause it describes standard functions a token contract can implement. For more details, please check: EIP-20: ERC-20 Token Standard (ethereum.org).

As for ERC20.sol, it is not necessary, you can write a new contract that derivates from ERC20.sol to rewrite it to achieve your own logic or you can write a new contract that directly derivates from IERC20.sol to achieve your logic.

2 Likes

Excuse my clumsiness. I don’t get it yet.

So, can I implement the interface and not use the standar var names or functions names in my ERC20.sol?

For example:

pragma solidity ^0.4.24;

import "./IERC20.sol";
import "../../math/SafeMath.sol";


contract ERC20 is IERC20 {
  using SafeMath for uint256;

  mapping (address => uint256) private _MyBalances;

  mapping (address => mapping (address => uint256)) private _MyAllowed;

  uint256 private _MyTotalSupply;

  function MyTotalSupply() public view returns (uint256) {
    return _MyTotalSupply;
  }
  function MyBalanceOf(address owner) public view returns (uint256) {
    return _MyBalances[owner];
  }
...
1 Like

Nope, if you change the variable and function names then you havent implemented the interface correctly, or the ERC20 standard correctly. Think of the interface as a description of what your contract contains.

2 Likes

Thanks. Ok, i understand. Then, my contract needs to respect function names of eip-20, but i supposed that i can change the mapping names that is not declared in eip-20. Its correct?

1 Like

Hi @JTConsulta,

Welcome to the community :wave:

You may want to look at the new Contracts Wizard to experiment with different ERC20 features: https://blog.openzeppelin.com/wizard

1 Like