-
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
41ed060
commit 78a78e5
Showing
7 changed files
with
73 additions
and
57 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,6 +1,7 @@ | ||
# Compiler files | ||
cache/ | ||
out/ | ||
src/artifacts | ||
|
||
# Ignores development broadcast logs | ||
!/broadcast | ||
|
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ | ||
ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/ | ||
erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/ | ||
forge-std/=lib/forge-std/src/ | ||
halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/ | ||
openzeppelin-contracts/=lib/openzeppelin-contracts/ |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.28; | ||
|
||
import "@openzeppelin/contracts/utils/Context.sol"; | ||
|
||
|
||
abstract contract AuthorizedMinter is Context { | ||
mapping (address => bool) public authorizedMinters; | ||
|
||
event MinterAuthorized(address minter); | ||
event MinterDeAuthorized(address minter); | ||
|
||
error MinterUnauthorized(address); | ||
|
||
modifier onlyAuthorizedMinter() { | ||
__checkAuthorizedMinter(); | ||
_; | ||
} | ||
|
||
function __checkAuthorizedMinter() internal view virtual { | ||
if (!authorizedMinters[_msgSender()] == true) { | ||
revert MinterUnauthorized(_msgSender()); | ||
} | ||
} | ||
|
||
function _authorizeMinter(address minter) internal { | ||
authorizedMinters[minter] = true; | ||
|
||
emit MinterAuthorized(minter); | ||
} | ||
|
||
function _deAuthorizeMinter(address minter) internal { | ||
authorizedMinters[minter] = false; | ||
|
||
emit MinterDeAuthorized(minter); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.28; | ||
|
||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
import "@openzeppelin/contracts/access/Ownable.sol"; | ||
import "./AuthorizedMinter.sol"; | ||
|
||
contract WrappedReact is ERC20, Ownable, AuthorizedMinter { | ||
constructor() | ||
ERC20("Wrapped REACT", "wREACT") | ||
Ownable(msg.sender) | ||
{} | ||
|
||
function authorizeMinter(address minter) public onlyOwner { | ||
_authorizeMinter(minter); | ||
} | ||
|
||
function deAuthorizeMinter(address minter) public onlyOwner { | ||
_deAuthorizeMinter(minter); | ||
} | ||
|
||
function mint(address to, uint256 amount) public onlyAuthorizedMinter { | ||
_mint(to, amount); | ||
} | ||
|
||
function burn(address from, uint amount) public onlyAuthorizedMinter { | ||
_burn(from, amount); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.