Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Berachain testnet #69

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
eOptimismNetwork,
ePolygonNetwork,
eBaseNetwork,
eBeraNetwork,
} from "./helpers/types";
import { DEFAULT_NAMED_ACCOUNTS } from "./helpers/constants";

Expand Down Expand Up @@ -66,6 +67,7 @@ export default {
url: "http://127.0.0.1:8545",
...hardhatNetworkSettings,
},
bera: getCommonNetworkConfig(eBeraNetwork.bera, 80084),
tenderly: getCommonNetworkConfig("tenderly", 1),
main: getCommonNetworkConfig(eEthereumNetwork.main, 1),
kovan: getCommonNetworkConfig(eEthereumNetwork.kovan, 42),
Expand Down
12 changes: 7 additions & 5 deletions helpers/hardhat-config-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
eFantomNetwork,
eOptimismNetwork,
eBaseNetwork,
eBeraNetwork,
} from "./types";

require("dotenv").config();
Expand Down Expand Up @@ -56,6 +57,7 @@ export const getAlchemyKey = (net: eNetwork) => {
};

export const NETWORKS_RPC_URL: iParamsPerNetwork<string> = {
[eBeraNetwork.bera]: `https://bartio.rpc.berachain.com`,
[eEthereumNetwork.kovan]: `https://eth-kovan.alchemyapi.io/v2/${getAlchemyKey(
eEthereumNetwork.kovan
)}`,
Expand Down Expand Up @@ -183,11 +185,11 @@ export const hardhatNetworkSettings = {
accounts:
FORK && !!MNEMONIC
? {
mnemonic: MNEMONIC,
path: MNEMONIC_PATH,
initialIndex: 0,
count: 10,
}
mnemonic: MNEMONIC,
path: MNEMONIC_PATH,
initialIndex: 0,
count: 10,
}
: undefined,
};

Expand Down
15 changes: 10 additions & 5 deletions helpers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export type eNetwork =
| eFantomNetwork
| eOptimismNetwork
| eTenderlyNetwork
| eBaseNetwork;
| eBaseNetwork
| eBeraNetwork;

type eTenderlyNetwork = "tenderly";

Expand All @@ -45,6 +46,10 @@ export enum eEthereumNetwork {
sepolia = "sepolia",
}

export enum eBeraNetwork {
bera = "bera"
}

export enum eBaseNetwork {
base = "base",
baseGoerli = "base-goerli",
Expand Down Expand Up @@ -385,7 +390,7 @@ export enum TokenContractId {

export interface IReserveParams
extends IReserveBorrowParams,
IReserveCollateralParams {
IReserveCollateralParams {
aTokenImpl: eContractid;
reserveFactor: string;
supplyCap: string;
Expand Down Expand Up @@ -438,8 +443,8 @@ export type iParamsPerNetworkWithDefault<T> = {

export interface iParamsPerNetworkAll<T>
extends iEthereumParamsPerNetwork<T>,
iPolygonParamsPerNetwork<T>,
iXDaiParamsPerNetwork<T> {}
iPolygonParamsPerNetwork<T>,
iXDaiParamsPerNetwork<T> { }

export interface iEthereumParamsPerNetwork<T> {
[eEthereumNetwork.kovan]: T;
Expand Down Expand Up @@ -540,7 +545,7 @@ export interface IBaseConfiguration {
RateStrategies: IStrategy;
}

export interface ICommonConfiguration extends IBaseConfiguration {}
export interface ICommonConfiguration extends IBaseConfiguration { }

export interface IAaveConfiguration extends ICommonConfiguration {
//ReservesConfig: iAavePoolAssets<IReserveParams>;
Expand Down