-
Notifications
You must be signed in to change notification settings - Fork 1
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
1178873
commit 29761c6
Showing
4 changed files
with
87 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.0; | ||
|
||
import "@openzeppelin/contracts/access/AccessControl.sol"; | ||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
|
||
contract HBRToken is ERC20, AccessControl { | ||
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); // can use mint / burn methods | ||
|
||
constructor(address admin) ERC20("Harbor", "HBR") { | ||
_grantRole(DEFAULT_ADMIN_ROLE, admin); | ||
} | ||
|
||
function mint(address account, uint256 amount) external onlyRole(MINTER_ROLE) { | ||
_mint(account, amount); | ||
} | ||
|
||
function burn(address account, uint256 amount) external onlyRole(MINTER_ROLE) { | ||
_burn(account, amount); | ||
} | ||
} |
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
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,31 @@ | ||
import { ethers } from "hardhat"; | ||
import { ContractNames } from "../../../src"; | ||
import { deploy } from "@airdao/deployments/deploying"; | ||
import { HBRToken__factory } from "../../../typechain-types"; | ||
|
||
async function main() { | ||
const {chainId} = await ethers.provider.getNetwork(); | ||
const [deployer] = await ethers.getSigners(); | ||
|
||
if (chainId == 16718) { | ||
return; | ||
} | ||
|
||
const airBond = await deploy<HBRToken__factory>({ | ||
contractName: ContractNames.Ecosystem_HRBToken, | ||
artifactName: "HBRToken", | ||
deployArgs: [deployer.address], | ||
signer: deployer, | ||
loadIfAlreadyDeployed: true, | ||
}); | ||
|
||
await airBond.grantRole(await airBond.DEFAULT_ADMIN_ROLE(), deployer.address); // | ||
await airBond.grantRole(await airBond.MINTER_ROLE(), deployer.address); | ||
} | ||
|
||
if (require.main === module) { | ||
main().catch((error) => { | ||
console.error(error); | ||
process.exitCode = 1; | ||
}); | ||
} |
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