Skip to content

Commit

Permalink
Update HBR token
Browse files Browse the repository at this point in the history
  • Loading branch information
SigismundSchlomo committed Oct 11, 2024
1 parent 414c1c0 commit 17653aa
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 21 deletions.
23 changes: 15 additions & 8 deletions contracts/staking/token/HBRToken.sol
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Pausable.sol";

contract HBRToken is ERC20, AccessControl {
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); // can use mint / burn methods
contract HBRToken is ERC20Pausable, Ownable {

constructor(address admin) ERC20("Harbor", "HBR") {
_grantRole(DEFAULT_ADMIN_ROLE, admin);
constructor(address admin) ERC20("Harbor", "HBR") Ownable() {
_transferOwnership(admin);
}

function mint(address account, uint256 amount) external onlyRole(MINTER_ROLE) {
function mint(address account, uint256 amount) external onlyOwner {
_mint(account, amount);
}

function burn(address account, uint256 amount) external onlyRole(MINTER_ROLE) {
function burn(address account, uint256 amount) external onlyOwner {
_burn(account, amount);
}

function pause() external onlyOwner {
_pause();
}

function unpause() external onlyOwner {
_unpause();
}
}
15 changes: 4 additions & 11 deletions scripts/ecosystem/token_staking/deploy_hbr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,17 @@ async function main() {
return;
}

const airBond = await deploy<HBRToken__factory>({
const token = await deploy<HBRToken__factory>({
contractName: ContractNames.Ecosystem_HBRToken,
artifactName: "HBRToken",
deployArgs: [deployer.address],
signer: deployer,
loadIfAlreadyDeployed: true,
});

if (chainId != 16718) {
console.log("Granting roles to deployer (dev and test envs only)");
await (await airBond.grantRole(await airBond.DEFAULT_ADMIN_ROLE(), deployer.address)).wait(); //
await (await airBond.grantRole(await airBond.MINTER_ROLE(), deployer.address)).wait();
} else {
console.log("Granting roles to multisig (mainnet only)");
const multisig = await deployMultisig(ContractNames.Ecosystem_LimitedTokenPoolsManagerMultisig, deployer);
await (await airBond.grantRole(await airBond.DEFAULT_ADMIN_ROLE(), multisig.address)).wait();
await (await airBond.grantRole(await airBond.MINTER_ROLE(), multisig.address)).wait();
}
console.log("Granting roles to multisig (mainnet only)");
const multisig = await deployMultisig(ContractNames.Ecosystem_LimitedTokenPoolsManagerMultisig, deployer);
await token.transferOwnership(multisig.address);
}

if (require.main === module) {
Expand Down
3 changes: 1 addition & 2 deletions scripts/ecosystem/token_staking/deploy_limited_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
} from "../../../typechain-types";

import { wrapProviderToError } from "../../../src/utils/AmbErrorProvider";
import { deployMultisig } from "../../utils/deployMultisig";

export async function main() {
const { chainId } = await ethers.provider.getNetwork();
Expand All @@ -19,7 +18,7 @@ export async function main() {
wrapProviderToError(deployer.provider!);

const validatorSet = loadDeployment(ContractNames.ValidatorSet, chainId, deployer);
const multisig = await deployMultisig(ContractNames.Ecosystem_LimitedTokenPoolsManagerMultisig, deployer, "eco");
const multisig = loadDeployment(ContractNames.Ecosystem_LimitedTokenPoolsManagerMultisig, chainId, deployer);

const rewardsBank = await deploy<RewardsBank__factory>({
contractName: ContractNames.Ecosystem_LimitedTokenPoolsManagerRewardsBank,
Expand Down
18 changes: 18 additions & 0 deletions scripts/ecosystem/token_staking/deploy_multisig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { ethers } from "hardhat";
import { ContractNames } from "../../../src";
import { deployMultisig } from "../../utils/deployMultisig";

async function main() {
const [deployer] = await ethers.getSigners();

const multisig = await deployMultisig(ContractNames.Ecosystem_LimitedTokenPoolsManagerMultisig, deployer, "eco");

}

if (require.main === module) {
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
}

0 comments on commit 17653aa

Please sign in to comment.