Skip to content

Commit 8b5fb95

Browse files
Update deploy script
1 parent effaa10 commit 8b5fb95

File tree

8 files changed

+706
-13
lines changed

8 files changed

+706
-13
lines changed

.openzeppelin/unknown-30746.json

Lines changed: 604 additions & 0 deletions
Large diffs are not rendered by default.

contracts/staking/token/TokenPoolsManager.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,11 @@ contract TokenPoolsManager is AccessControl{
185185

186186
// VIEW METHODS
187187

188-
function getPoolAddress(string memory name) public view returns (address) {
188+
function getTokenPoolAddress(string memory name) public view returns (address) {
189189
return pools[name];
190190
}
191191

192-
function getDepositedPoolAdress(string memory name) public view returns (address) {
192+
function getLimitedTokenPoolAdress(string memory name) public view returns (address) {
193193
return depositedPools[name];
194194
}
195195

deployments/30746.json

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,5 +1721,92 @@
17211721
],
17221722
"deployTx": "0x9ed3d31b3b7615386da8defd5f0ce2ba6a0f209479bded528fc73989765472c1",
17231723
"fullyQualifiedName": "contracts/funds/RewardsBank.sol:RewardsBank"
1724+
},
1725+
"Ecosystem_TokenPoolsManager": {
1726+
"address": "0x3748b64E235A1EAb7c6bdDca706848d8B8a74D06",
1727+
"abi": [
1728+
"constructor(address bank_, address lockKeeper_, address singleSideBeacon_, address doubleSideBeacon_)",
1729+
"event DepositedPoolActivated(string name)",
1730+
"event DepositedPoolCreated(string name, address pool)",
1731+
"event DepositedPoolDeactivated(string name)",
1732+
"event PoolActivated(string name)",
1733+
"event PoolCreated(string name, address pool)",
1734+
"event PoolDeactivated(string name)",
1735+
"event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)",
1736+
"event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)",
1737+
"event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)",
1738+
"function DEFAULT_ADMIN_ROLE() view returns (bytes32)",
1739+
"function activateLimitedTokenPool(string _pool)",
1740+
"function activateTokenPool(string _pool)",
1741+
"function bank() view returns (address)",
1742+
"function configureLimitedTokenPoolLimits(string name, tuple(uint256 minDepositValue, uint256 minStakeValue, uint256 fastUnstakePenalty, uint256 unstakeLockPeriod, uint256 stakeLockPeriod, uint256 maxTotalStakeValue, uint256 maxStakePerUserValue, uint256 stakeLimitsMultiplier) params)",
1743+
"function createLimitedTokenPool(tuple(string name, address limitsMultiplierToken, address profitableToken, address rewardToken, uint256 rewardTokenPrice, uint256 interest, uint256 interestRate) params) returns (address)",
1744+
"function createTokenPool(tuple(address token, string name, address rewardToken, uint256 rewardTokenPrice, uint256 minStakeValue, uint256 fastUnstakePenalty, uint256 interest, uint256 interestRate, uint256 lockPeriod) params) returns (address)",
1745+
"function deactivateLimitedTokenPool(string _pool)",
1746+
"function deactivateTokenPool(string _pool)",
1747+
"function depositedPools(string) view returns (address)",
1748+
"function depositedTokenPoolBeacon() view returns (address)",
1749+
"function getLimitedTokenPoolAdress(string name) view returns (address)",
1750+
"function getRoleAdmin(bytes32 role) view returns (bytes32)",
1751+
"function getTokenPoolAddress(string name) view returns (address)",
1752+
"function grantRole(bytes32 role, address account)",
1753+
"function hasRole(bytes32 role, address account) view returns (bool)",
1754+
"function pools(string) view returns (address)",
1755+
"function renounceRole(bytes32 role, address account)",
1756+
"function revokeRole(bytes32 role, address account)",
1757+
"function setFastUnstakePenalty(string _pool, uint256 penalty)",
1758+
"function setFastUnstakePenaltyL(string _pool, uint256 penalty)",
1759+
"function setInterest(string _pool, uint256 _interest, uint256 _interestRate)",
1760+
"function setInterestL(string _pool, uint256 _interest, uint256 _interestRate)",
1761+
"function setLockPeriod(string _pool, uint256 period)",
1762+
"function setMaxStakePerUserValueL(string _pool, uint256 value)",
1763+
"function setMaxTotalStakeValueL(string _pool, uint256 value)",
1764+
"function setMinDepositValueL(string _pool, uint256 value)",
1765+
"function setMinStakeValue(string _pool, uint256 value)",
1766+
"function setMinStakeValueL(string _pool, uint256 value)",
1767+
"function setRewardTokenPrice(string _pool, uint256 price)",
1768+
"function setRewardTokenPriceL(string _pool, uint256 price)",
1769+
"function setStakeLimitsMultiplierL(string _pool, uint256 value)",
1770+
"function setStakeLockPeriodL(string _pool, uint256 period)",
1771+
"function setUnstakeLockPeriodL(string _pool, uint256 period)",
1772+
"function supportsInterface(bytes4 interfaceId) view returns (bool)",
1773+
"function tokenPoolBeacon() view returns (address)"
1774+
],
1775+
"deployTx": "0xe0778e564cb58711395d6f266b8730121e6461530aa851bba25fbc6db0d0717f",
1776+
"fullyQualifiedName": "contracts/staking/token/TokenPoolsManager.sol:TokenPoolsManager"
1777+
},
1778+
"Ecosystem_HRBToken": {
1779+
"address": "0xbf2B802AbBC4f3aCd2B591FB167a75D8C0145456",
1780+
"abi": [
1781+
"constructor(address admin)",
1782+
"event Approval(address indexed owner, address indexed spender, uint256 value)",
1783+
"event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)",
1784+
"event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)",
1785+
"event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)",
1786+
"event Transfer(address indexed from, address indexed to, uint256 value)",
1787+
"function DEFAULT_ADMIN_ROLE() view returns (bytes32)",
1788+
"function MINTER_ROLE() view returns (bytes32)",
1789+
"function allowance(address owner, address spender) view returns (uint256)",
1790+
"function approve(address spender, uint256 amount) returns (bool)",
1791+
"function balanceOf(address account) view returns (uint256)",
1792+
"function burn(address account, uint256 amount)",
1793+
"function decimals() view returns (uint8)",
1794+
"function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool)",
1795+
"function getRoleAdmin(bytes32 role) view returns (bytes32)",
1796+
"function grantRole(bytes32 role, address account)",
1797+
"function hasRole(bytes32 role, address account) view returns (bool)",
1798+
"function increaseAllowance(address spender, uint256 addedValue) returns (bool)",
1799+
"function mint(address account, uint256 amount)",
1800+
"function name() view returns (string)",
1801+
"function renounceRole(bytes32 role, address account)",
1802+
"function revokeRole(bytes32 role, address account)",
1803+
"function supportsInterface(bytes4 interfaceId) view returns (bool)",
1804+
"function symbol() view returns (string)",
1805+
"function totalSupply() view returns (uint256)",
1806+
"function transfer(address to, uint256 amount) returns (bool)",
1807+
"function transferFrom(address from, address to, uint256 amount) returns (bool)"
1808+
],
1809+
"deployTx": "0x30dbcd1b5e0643e7de2d4e8253cf63a60562033ab8a9b0abe4c90ac3f6969be8",
1810+
"fullyQualifiedName": "contracts/staking/token/HBRToken.sol:HBRToken"
17241811
}
17251812
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"deploy_government": "hardhat run scripts/ecosystem/government/deploy.ts --network dev",
3737
"deploy_liquid_staking": "hardhat run scripts/ecosystem/liquid_staking/deploy.ts --network dev",
3838
"deploy_token_staking": "hardhat run scripts/ecosystem/token_staking/deploy.ts --network dev",
39-
"deploy_hbr_token": "hardhat run scripts/ecosystem/deploy_hbr.ts --network dev",
40-
"create_hbr_amb_pool": "hardhat run scripts/ecosystem/create_hbr_amb_pool.ts --network dev",
39+
"deploy_hbr_token": "hardhat run scripts/ecosystem/token_staking/deploy_hbr.ts --network dev",
40+
"create_hbr_amb_pool": "hardhat run scripts/ecosystem/token_staking/create_hbr_amb.ts --network dev",
4141

4242
"sourcify:dev": "hardhat sourcify --network dev",
4343
"sourcify:test": "hardhat sourcify --network test",

scripts/ecosystem/token_staking/create_hbr_amb.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ async function main() {
1414
const [deployer] = await ethers.getSigners();
1515
wrapProviderToError(deployer.provider!);
1616

17-
const hbrToken = loadDeployment("HBRToken", chainId, deployer);
17+
const hbrToken = loadDeployment("Ecosystem_HRBToken", chainId, deployer);
1818

19-
const poolsManager = loadDeployment("TokenPoolsManager", chainId, deployer);
19+
const poolsManager = loadDeployment("Ecosystem_TokenPoolsManager", chainId, deployer);
2020

2121
const mainConfig: LimitedTokenPool.MainConfigStruct = {
2222
name: "HBR-AMB",
@@ -28,7 +28,7 @@ async function main() {
2828
interestRate: 24 * 60 * 60,
2929
};
3030

31-
const createTx = poolsManager.createLimitedTokenPool(mainConfig);
31+
const createTx = await poolsManager.createLimitedTokenPool(mainConfig);
3232
const createReceipt = await createTx.wait();
3333
console.log("createReceipt", createReceipt);
3434

@@ -43,11 +43,11 @@ async function main() {
4343
stakeLimitsMultiplier: 10,
4444
};
4545

46-
const configureLimitsTx = poolsManager.configureLimitedTokenPoolLimits("HBR-AMB", limitsConfig);
46+
const configureLimitsTx = await poolsManager.configureLimitedTokenPoolLimits("HBR-AMB", limitsConfig);
4747
const configureLimitsReceipt = await configureLimitsTx.wait();
4848
console.log("configureLimitsReceipt", configureLimitsReceipt);
4949

50-
const poolAddress = await poolsManager.getLimitedTokenPoolAddress("HBR-AMB");
50+
const poolAddress = await poolsManager.getLimitedTokenPoolAdress("HBR-AMB");
5151
console.log("poolAddress:", poolAddress);
5252
}
5353

scripts/ecosystem/token_staking/deploy.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ export async function main() {
4141

4242
const tokenPoolFactory = await ethers.getContractFactory("TokenPool");
4343
const tokenPoolBeacon = await upgrades.deployBeacon(tokenPoolFactory);
44+
await tokenPoolBeacon.deployed();
4445
console.log("TokenPool Beacon deployed to:", tokenPoolBeacon.address);
4546

4647
console.log("deploying LimitedTokenPool Beacon");
4748
const limitedTokenPoolFactory = await ethers.getContractFactory("LimitedTokenPool");
4849
const limitedTokenPoolBeacon = await upgrades.deployBeacon(limitedTokenPoolFactory);
50+
await limitedTokenPoolBeacon.deployed();
4951
console.log("LimitedTokenPool Beacon deployed to:", limitedTokenPoolBeacon.address);
5052

5153
console.log("deploying TokenPoolsManager");

scripts/ecosystem/token_staking/deploy_hbr.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ async function main() {
1919
loadIfAlreadyDeployed: true,
2020
});
2121

22-
await airBond.grantRole(await airBond.DEFAULT_ADMIN_ROLE(), deployer.address); //
23-
await airBond.grantRole(await airBond.MINTER_ROLE(), deployer.address);
22+
await (await airBond.grantRole(await airBond.DEFAULT_ADMIN_ROLE(), deployer.address)).wait(); //
23+
await (await airBond.grantRole(await airBond.MINTER_ROLE(), deployer.address)).wait();
2424
}
2525

2626
if (require.main === module) {

0 commit comments

Comments
 (0)