Skip to content

Commit 1694d5c

Browse files
committed
fix: update README, add comment
1 parent 35e266c commit 1694d5c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ At all times, DATAv2 tokens left in the DataTokenMigrator are the unmigrated DAT
5757
Explanations of the origins and intents of all code found in DATAv2.sol:
5858
| Lines | Explanation |
5959
|---------|-------------------------------------------------------------|
60-
| 1...18 | OpenZeppelin and interface imports, DATAv2 token properties |
61-
| 20...47 | Adapted from @openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol to implement the minting feature. The AccessControl.sol is a bit of a can of worms when it comes to state-space: the "role admin" can set up any constellation of roles and grant those roles and their administration to anyone; its implementation is quite elegant though, so it didn't feel very significantly worse than a "brute" `mapping (address => bool) isMinter` type of implementation, especially since it's all library code. |
62-
| 49...75 | Adapted from LINK token to implement the ERC-677 token transfer hook. Recipient smart contracts can now react to DATAv2 token transfer which makes approve+transferFrom two-transaction flow avoidable if not entirely redundant. Decided to go for the simply ERC-677 instead of the ERC-777 because of some misfeatures on ERC-777 (defaultOperators, higher plain transfer gas price) as well as uncertain adoption at this stage. |
60+
| 1...12 | OpenZeppelin and interface imports, DATAv2 token properties |
61+
| 16...46 | Adapted from @openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol to implement the minting feature. The AccessControl.sol is a bit of a can of worms when it comes to state-space: the "role admin" can set up any constellation of roles and grant those roles and their administration to anyone; its implementation is quite elegant though, so it didn't feel very significantly worse than a "brute" `mapping (address => bool) isMinter` type of implementation, especially since it's all library code. Added isMinter convenience function. |
62+
| 48...74 | Adapted from LINK token to implement the ERC-677 token transfer hook. Recipient smart contracts can now react to DATAv2 token transfer which makes approve+transferFrom two-transaction flow avoidable if not entirely redundant. Decided to go for the simply ERC-677 instead of the ERC-777 because of some misfeatures on ERC-777 (defaultOperators, higher plain transfer gas price) as well as uncertain adoption at this stage. |
63+
| 76...98 | Allow the admin to change token symbol and name just in case, e.g. to support token rebranding, and graceful end-of-life after the possible next migration |

contracts/DATAv2.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ contract DATAv2 is ERC20Permit, ERC20Burnable, AccessControl, IERC677 {
7373
return true;
7474
}
7575

76+
// ------------------------------------------------------------------------
77+
// allow admin to change the token name and symbol
78+
7679
function setTokenInformation(string calldata newName, string calldata newSymbol) public {
7780
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "Transaction signer is not an admin");
7881
_name = newName;

0 commit comments

Comments
 (0)