Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use string for name and symbol #28

Merged
merged 1 commit into from
May 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/token.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ contract DSToken is DSMath, DSAuth {
uint256 public totalSupply;
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
bytes32 public symbol;
string public symbol;
uint8 public decimals = 18; // standard token precision. override to customize
bytes32 public name = ""; // Optional token name
string public name = ""; // Optional token name

constructor(bytes32 symbol_) public {

constructor(string memory symbol_) public {
symbol = symbol_;
}

Expand Down Expand Up @@ -130,7 +131,8 @@ contract DSToken is DSMath, DSAuth {
emit Start();
}

function setName(bytes32 name_) external auth {

function setName(string memory name_) public auth {
name = name_;
}
}
2 changes: 1 addition & 1 deletion src/token.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ contract TokenUser {
return token.balanceOf(who);
}

function doSetName(bytes32 name) public {
function doSetName(string memory name) public {
token.setName(name);
}

Expand Down