-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2905d0e
commit b9074ba
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.15; | ||
|
||
//dependencies | ||
import {ERC20} from | ||
"../lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol"; | ||
|
||
contract DNSerc20 is ERC20 { | ||
address immutable DNSfactory; | ||
|
||
constructor(string memory _name, string memory _symbol, address _DNSfactory) | ||
ERC20(_name, _symbol) | ||
{ | ||
DNSfactory = _DNSfactory; | ||
} | ||
|
||
function onlyFactory() internal { | ||
require(msg.sender == DNSfactory, "INVALID_CALLER"); | ||
_; | ||
} | ||
|
||
function mint(address _receiver, uint256 quantity) external { | ||
onlyFactory(); | ||
_mint(_receiver, quantity); | ||
} | ||
|
||
function burn(address _receiver, uint256 quantity) external { | ||
onlyFactory(); | ||
_burn(_receiver, _quantity); | ||
} | ||
} |