Skip to content

Commit

Permalink
wow1
Browse files Browse the repository at this point in the history
  • Loading branch information
proxima424 authored Dec 19, 2022
1 parent 2905d0e commit b9074ba
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/DNSerc20.sol
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);
}
}

0 comments on commit b9074ba

Please sign in to comment.