* Now compiling in a separate directory using truffle 5. * Ported to 0.5.1, now compiling using 0.5.1. * test now also compiles using the truffle 5 hack. * Downgraded to 0.5.0. * Sorted scripts. * Cleaned up the compile script a bit.
43 lines
1014 B
Solidity
43 lines
1014 B
Solidity
pragma solidity ^0.5.0;
|
|
|
|
import "./IERC20.sol";
|
|
|
|
/**
|
|
* @title ERC20Detailed token
|
|
* @dev The decimals are only for visualization purposes.
|
|
* All the operations are done using the smallest and indivisible token unit,
|
|
* just as on Ethereum all the operations are done in wei.
|
|
*/
|
|
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;
|
|
}
|
|
|
|
/**
|
|
* @return the name of the token.
|
|
*/
|
|
function name() public view returns (string memory) {
|
|
return _name;
|
|
}
|
|
|
|
/**
|
|
* @return the symbol of the token.
|
|
*/
|
|
function symbol() public view returns (string memory) {
|
|
return _symbol;
|
|
}
|
|
|
|
/**
|
|
* @return the number of decimals of the token.
|
|
*/
|
|
function decimals() public view returns (uint8) {
|
|
return _decimals;
|
|
}
|
|
}
|