Skip to content

Commit 29761c6

Browse files
Add HBR token
1 parent 1178873 commit 29761c6

File tree

4 files changed

+87
-0
lines changed

4 files changed

+87
-0
lines changed

contracts/staking/token/HBRToken.sol

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// SPDX-License-Identifier: UNLICENSED
2+
pragma solidity ^0.8.0;
3+
4+
import "@openzeppelin/contracts/access/AccessControl.sol";
5+
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
6+
7+
contract HBRToken is ERC20, AccessControl {
8+
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); // can use mint / burn methods
9+
10+
constructor(address admin) ERC20("Harbor", "HBR") {
11+
_grantRole(DEFAULT_ADMIN_ROLE, admin);
12+
}
13+
14+
function mint(address account, uint256 amount) external onlyRole(MINTER_ROLE) {
15+
_mint(account, amount);
16+
}
17+
18+
function burn(address account, uint256 amount) external onlyRole(MINTER_ROLE) {
19+
_burn(account, amount);
20+
}
21+
}

deployments/22040.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,5 +1662,39 @@
16621662
"implementation": "0x7184DD655aacCCb28376Fa1B59e3712566Df670b",
16631663
"fullyQualifiedName": "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol:ERC1967Proxy"
16641664
}
1665+
},
1666+
"Ecosystem_HRBToken": {
1667+
"address": "0xCB856833c615ef09Ba779D35D663b849aD23C957",
1668+
"abi": [
1669+
"constructor(address admin)",
1670+
"event Approval(address indexed owner, address indexed spender, uint256 value)",
1671+
"event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)",
1672+
"event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)",
1673+
"event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)",
1674+
"event Transfer(address indexed from, address indexed to, uint256 value)",
1675+
"function DEFAULT_ADMIN_ROLE() view returns (bytes32)",
1676+
"function MINTER_ROLE() view returns (bytes32)",
1677+
"function allowance(address owner, address spender) view returns (uint256)",
1678+
"function approve(address spender, uint256 amount) returns (bool)",
1679+
"function balanceOf(address account) view returns (uint256)",
1680+
"function burn(address account, uint256 amount)",
1681+
"function decimals() view returns (uint8)",
1682+
"function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool)",
1683+
"function getRoleAdmin(bytes32 role) view returns (bytes32)",
1684+
"function grantRole(bytes32 role, address account)",
1685+
"function hasRole(bytes32 role, address account) view returns (bool)",
1686+
"function increaseAllowance(address spender, uint256 addedValue) returns (bool)",
1687+
"function mint(address account, uint256 amount)",
1688+
"function name() view returns (string)",
1689+
"function renounceRole(bytes32 role, address account)",
1690+
"function revokeRole(bytes32 role, address account)",
1691+
"function supportsInterface(bytes4 interfaceId) view returns (bool)",
1692+
"function symbol() view returns (string)",
1693+
"function totalSupply() view returns (uint256)",
1694+
"function transfer(address to, uint256 amount) returns (bool)",
1695+
"function transferFrom(address from, address to, uint256 amount) returns (bool)"
1696+
],
1697+
"deployTx": "0x1c7a3ff3e00b95e2e01212a0078613ee807a28591b9a2024060e6c6d68fadfe9",
1698+
"fullyQualifiedName": "contracts/staking/token/HBRToken.sol:HBRToken"
16651699
}
16661700
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { ethers } from "hardhat";
2+
import { ContractNames } from "../../../src";
3+
import { deploy } from "@airdao/deployments/deploying";
4+
import { HBRToken__factory } from "../../../typechain-types";
5+
6+
async function main() {
7+
const {chainId} = await ethers.provider.getNetwork();
8+
const [deployer] = await ethers.getSigners();
9+
10+
if (chainId == 16718) {
11+
return;
12+
}
13+
14+
const airBond = await deploy<HBRToken__factory>({
15+
contractName: ContractNames.Ecosystem_HRBToken,
16+
artifactName: "HBRToken",
17+
deployArgs: [deployer.address],
18+
signer: deployer,
19+
loadIfAlreadyDeployed: true,
20+
});
21+
22+
await airBond.grantRole(await airBond.DEFAULT_ADMIN_ROLE(), deployer.address); //
23+
await airBond.grantRole(await airBond.MINTER_ROLE(), deployer.address);
24+
}
25+
26+
if (require.main === module) {
27+
main().catch((error) => {
28+
console.error(error);
29+
process.exitCode = 1;
30+
});
31+
}

src/contracts/names.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export enum ContractNames {
9393
Ecosystem_TokenPoolsManager = "Ecosystem_TokenPoolsManager",
9494
Ecosystem_TokenPoolsManagerMultisig = "Ecosystem_TokenPoolsManager_Multisig",
9595
Ecosystem_TokenPoolsManagerRewardsBank = "Ecosystem_TokenPoolsManager_RewardsBank",
96+
Ecosystem_HRBToken = "Ecosystem_HRBToken",
9697
}
9798

9899
export const MULTISIGS_COMMON = {

0 commit comments

Comments
 (0)