August 2019
Intermediate to advanced
486 pages
13h 52m
English
Using the DetailedERC20.sol contract, you can define the optional fields for an ERC20 token; that is, the name, symbol, and decimals of the token.
The OpenZeppelin contract present at Chapter09/openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol is defined as follows:
import "./IERC20.sol";contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function ...