Skip to content

Commit

Permalink
feat: freeze reducing (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xCardinalError authored May 13, 2024
1 parent 94baf44 commit 595ebfe
Show file tree
Hide file tree
Showing 36 changed files with 4,351 additions and 10,591 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ Feel free to use public RPCs but if you want extra security and speed, feel free

- Run `yarn hardhat deploy` to deploy all contracts on hardhat environment(network).
- To deploy on Ganache (or other networks):

- Add network configuration in your [hardhat.config.ts](./hardhat.config.ts).
```
ganache: {
Expand All @@ -149,6 +150,25 @@ Feel free to use public RPCs but if you want extra security and speed, feel free
```
- To run: `yarn hardhat deploy --network ganache`
#### Light Testnet
- Make a new RC tag and commit to generate new ABI for Bee Node creation
- Make a cluster with minimal required number of nodes (10) all point to that tag
- Latest tag should have all new contracts deployed for SI
- We reuse and share testnet token sBZZ with proper testnet and S3, easier for setup and config
- To have that we need to copy from deployments/testnet directory TestToken.json so "hardhat deploy" reuses it and
doesn't create new contract, with this it will insert this address in all other contract deployments
- We use swarm network 333 ID
- This testnet will probably not be continuosly running
#### Testnet
- Regullar RC tagging for testent
- We have continuos running testnet with deployed contracts on sepolia
- We just deploy changes/new contracts that will go to mainet
- We use swarm net id 10
- As we already have running nodes there, we need to upgrade few/half of those to new node with latest contracts tag so we can have simulation of node upgrades and network working with different node versions
#### Additional commands and flags:
- Make necessary changes to [hardhat.config.ts](./hardhat.config.ts).
Expand Down
8 changes: 7 additions & 1 deletion deploy/local/000_deploy_test_token.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import { DeployFunction } from 'hardhat-deploy/types';
import { networkConfig } from '../../helper-hardhat-config';

const func: DeployFunction = async function ({ deployments, getNamedAccounts }) {
const func: DeployFunction = async function ({ deployments, getNamedAccounts, network, ethers }) {
const { deploy, log } = deployments;
const { deployer } = await getNamedAccounts();

const multisig = networkConfig[network.name];
if (typeof multisig === 'string' && ethers.utils.getAddress(multisig) !== ethers.utils.getAddress(deployer)) {
throw new Error('Multisig is not the same as deployer');
}

let token = null;

const argsToken = ['TEST', 'TST', '1249989122910552325012092'];
Expand Down
1 change: 1 addition & 0 deletions deploy/main/000_deploy_token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const func: DeployFunction = async function ({ deployments, getNamedAccounts })
// We ONLY use already deployed token for MAINNET
if (!(token = await get('Token'))) {
// we have problem as there is not token, error out
throw new Error('Token not available');
} else {
log('Using already deployed Token at', token.address);
}
Expand Down
1 change: 1 addition & 0 deletions deploy/tenderly/000_deploy_token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const func: DeployFunction = async function ({ deployments, getNamedAccounts })
// We ONLY use already deployed token for MAINNET FORKS
if (!(token = await get('Token'))) {
// we have problem as there is not token, error out
throw new Error('Token not available');
} else {
log('Using already deployed Token at', token.address);
}
Expand Down
7 changes: 6 additions & 1 deletion deploy/test/000_deploy_test_token.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { DeployFunction } from 'hardhat-deploy/types';
import { networkConfig } from '../../helper-hardhat-config';

const func: DeployFunction = async function ({ deployments, getNamedAccounts, network }) {
const func: DeployFunction = async function ({ deployments, getNamedAccounts, network, ethers }) {
const { deploy, log, getOrNull } = deployments;
const { deployer } = await getNamedAccounts();

const multisig = networkConfig[network.name];
if (typeof multisig === 'string' && ethers.utils.getAddress(multisig) !== ethers.utils.getAddress(deployer)) {
throw new Error('Multisig is not the same as deployer');
}

log('----------------------------------------------------');
log('Deployer address at ', deployer);
log('----------------------------------------------------');
Expand Down
2 changes: 1 addition & 1 deletion deploy/test/009_deploy_local_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const func: DeployFunction = async function ({ deployments, network, config }) {

if (fileName.length == 0 || !fs.existsSync(fileName)) {
fileName = network.name + '_deployed.json';
if (network.name == 'pretestnet' || network.name == 'testnet') {
if (network.name == 'testnetlight' || network.name == 'testnet') {
fileName = 'testnet_deployed.json';
}
}
Expand Down
1 change: 0 additions & 1 deletion deployments/pretestnet/.chainId

This file was deleted.

Loading

0 comments on commit 595ebfe

Please sign in to comment.