Skip to content

Commit

Permalink
bob blockchain (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
DZariusz authored Oct 16, 2024
1 parent 40d1e53 commit 70af1bb
Show file tree
Hide file tree
Showing 37 changed files with 7,566 additions and 189 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,15 @@ npx hardhat registerReaderFactory --network rootstock_staging
On blockchain with only on-chain data:

```shell
npx hardhat deploy --network rootstock_production
npx hardhat deploy --network bob_production

npx hardhat registerStakingBankStatic --network rootstock_production
npx hardhat registerStakingBankStatic --network bob_production
# remove feed json
npx hardhat deploy --network rootstock_production
npx hardhat deploy --network bob_production

npx hardhat registerUmbrellaFeeds --destroy USDC-USD --network rootstock_production
npx hardhat registerUmbrellaFeeds --network rootstock_production
npx hardhat registerReaderFactory --network rootstock_production
npx hardhat registerUmbrellaFeeds --destroy USDC-USD --network bob_production
npx hardhat registerUmbrellaFeeds --network bob_production
npx hardhat registerReaderFactory --network bob_production
```

#### Code verification on Linea
Expand Down
2 changes: 2 additions & 0 deletions constants/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export const BASE_SANDBOX = 'base_sandbox';
export const BASE_PRODUCTION = 'base_production';
export const LINEA_SANDBOX = 'linea_sandbox';
export const ARBITRUM_STAGING = 'arbitrum_staging';
export const BOB_STAGING = 'bob_staging';
export const BOB_PRODUCTION = 'bob_production';
export const AVALANCHE_STAGING = 'avalanche_staging';
export const BNB_STAGING = 'bnb_staging';
export const ETH_STAGING = 'eth_staging';
Expand Down
4 changes: 3 additions & 1 deletion constants/pk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
AVALANCHE_PRODUCTION,
BASE_PRODUCTION,
BNB_PRODUCTION,
BOB_PRODUCTION,
ETH_PRODUCTION,
LINEA_PRODUCTION,
LOCALHOST,
Expand All @@ -21,7 +22,7 @@ const prodAccounts = PROD_DEPLOYER_PK ? [PROD_DEPLOYER_PK] : [];

export const PROD_PK = 'prod';

export function getPrivteKeys(network = ''): string[] {
export function getPrivateKeys(network = ''): string[] {
if (FORKING_ENV || FAKE_MAINNET) {
return prodAccounts;
}
Expand All @@ -39,6 +40,7 @@ export function getPrivteKeys(network = ''): string[] {
case LINEA_PRODUCTION:
case BASE_PRODUCTION:
case ROOTSTOCK_PRODUCTION:
case BOB_PRODUCTION:
return prodAccounts;

default:
Expand Down
22 changes: 21 additions & 1 deletion constants/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import {
BNB_PRODUCTION,
BNB_SANDBOX,
BNB_STAGING,
BOB_PRODUCTION,
BOB_STAGING,
ETH_PRODUCTION,
ETH_SANDBOX,
ETH_SEPOLIA,
Expand All @@ -37,7 +39,7 @@ import {
ZK_LINK_NOVA_STAGING,
} from './networks';

const { INFURA_ID, FAKE_MAINNET, FORKING_ENV, CHAIN_ID } = process.env;
const { INFURA_ID, BLAST_RPC_ID, FAKE_MAINNET, FORKING_ENV, CHAIN_ID } = process.env;

type ProviderData = { url: string; chainId: number };

Expand Down Expand Up @@ -97,6 +99,18 @@ const astarTestnetProviderData: ProviderData = {
chainId: chainId(1261120),
};

// https://docs.gobob.xyz/docs/build/getting-started/networks
const bobTestnetProviderData: ProviderData = {
url: `https://bob-sepolia.blastapi.io/${BLAST_RPC_ID}`,
chainId: chainId(808813),
};

// https://docs.gobob.xyz/docs/build/getting-started/networks
const bobProductionProviderData: ProviderData = {
url: 'https://rpc.gobob.xyz/',
chainId: chainId(60808),
};

// https://www.okx.com/pl/x1/docs/getting-started/user-guide/network-information
// https://www.okx.com/pl/x1/faucet
const okxTestnetProviderData: ProviderData = {
Expand Down Expand Up @@ -193,6 +207,9 @@ const baseMainnetProviderData: ProviderData = {

const resolveProviderData = (networkName: string): ProviderData => {
switch (networkName) {
case BOB_STAGING:
return bobTestnetProviderData;

case OKX_SANDBOX:
return okxTestnetProviderData;

Expand Down Expand Up @@ -273,6 +290,9 @@ const resolveProviderData = (networkName: string): ProviderData => {

case ZK_LINK_NOVA_PRODUCTION:
return zkLinkNovaMainnetProviderData;

case BOB_PRODUCTION:
return bobProductionProviderData;
}

throw new Error(`${networkName} not supported`);
Expand Down
1 change: 1 addition & 0 deletions deploy/_helpers/onChainSupportedBlockchains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export function onChainSupportedBlockchains(hre: HardhatRuntimeEnvironment): boo
if (hre.network.name.includes('astar_sandbox')) return true;
if (hre.network.name.includes('rootstock_')) return true;
if (hre.network.name.includes('zk_link_')) return true;
if (hre.network.name.includes('bob_')) return true;

return false;
}
3 changes: 2 additions & 1 deletion deploy/evm/Registry.deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import { CHAIN, CHAIN_BYTES32, REGISTRY } from '../../constants';
import { ASTAR_SANDBOX, HARDHAT, LOCALHOST } from '../../constants/networks';
import { verifyCode } from '../../scripts/utils/verifyContract';
import { supportedLayer2Blockchain } from '../_helpers/supportedLayer2Blockchain';
import { onChainSupportedBlockchains } from '../_helpers/onChainSupportedBlockchains';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
if (!supportedLayer2Blockchain(hre)) {
if (!supportedLayer2Blockchain(hre) && !onChainSupportedBlockchains(hre)) {
console.log('-'.repeat(80));
console.log(`${REGISTRY} is not supported on ${hre.network.name}`);
console.log('-'.repeat(80));
Expand Down
3 changes: 2 additions & 1 deletion deploy/evm/StakingBankStatic.deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import { REGISTRY, STAKING_BANK, STAKING_BANK_STATIC } from '../../constants';
import { verifyCode } from '../../scripts/utils/verifyContract';
import { stakingBankStaticDeploymentData } from '../deploymentsData/stakingBankStatic';
import { supportedLayer2Blockchain } from '../_helpers/supportedLayer2Blockchain';
import { onChainSupportedBlockchains } from '../_helpers/onChainSupportedBlockchains';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
if (!supportedLayer2Blockchain(hre)) {
if (!supportedLayer2Blockchain(hre) && !onChainSupportedBlockchains(hre)) {
console.log('-'.repeat(80));
console.log(`${STAKING_BANK} is not supported on ${hre.network.name}`);
console.log('-'.repeat(80));
Expand Down
1 change: 1 addition & 0 deletions deployments/bob_production/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
60808
Loading

0 comments on commit 70af1bb

Please sign in to comment.