Skip to content

Commit 6da4184

Browse files
committed
add admin
1 parent 793e2dd commit 6da4184

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/ShellToken.sol

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,21 @@ import "openzeppelin-contracts/contracts/access/Ownable.sol";
66

77
contract ShellToken is ERC20, Ownable {
88

9+
mapping(address => bool) public isAdmin;
10+
mapping(address => uint) public multipler; //percentage out of 100
11+
912
mapping(address => bool) public allowedToTransfer;
1013

1114
constructor() ERC20("ShellToken", "SHELL") Ownable(msg.sender) {
1215
}
1316

14-
function mintShells(address to, uint256 amount) public onlyOwner {
17+
function mintShells(address to, uint256 amount) public {
18+
require(isAdmin[msg.sender], "Not an admin");
1519
_mint(to, amount);
1620
}
1721

18-
function deleteShells(address from, uint256 amount) public onlyOwner {
22+
function deleteShells(address from, uint256 amount) public {
23+
require(isAdmin[msg.sender], "Not an admin");
1924
_burn(from, amount);
2025
}
2126

@@ -29,5 +34,9 @@ contract ShellToken is ERC20, Ownable {
2934
function updateAllowedToTransfer(address user, bool allowed) public onlyOwner {
3035
allowedToTransfer[user] = allowed;
3136
}
37+
38+
function updateIsAdmin(address user, bool _isAdmin) public onlyOwner {
39+
isAdmin[user] = _isAdmin;
40+
}
3241
}
3342

0 commit comments

Comments
 (0)