Skip to content

Commit

Permalink
add configs for telos
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickmao93 committed Jul 24, 2023
1 parent 3685bae commit ead34c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ FVM_ENDPOINT=https://filecoin-mainnet.chainstacklabs.com/rpc/v1
CANTO_ENDPOINT=https://canto.slingshot.finance
POLYGON_ZK_EVM_ENDPOINT=https://zkevm-rpc.com
ANTIMATTER_B2_ENDPOINT=https://rpc.antimatter.finance/
TELOS_ENDPOINT=https://mainnet.telos.net/evm

LINEA_ENDPOINT=
LINEA_API_KEY='ABCDEF'
Expand Down
18 changes: 11 additions & 7 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,17 +234,20 @@ const antimatterB2PrivateKey = process.env.ANTIMATTER_B2_PRIVATE_KEY || DEFAULT_
const lineaEndpoint = process.env.LINEA_ENDPOINT || DEFAULT_ENDPOINT;
const lineaPrivateKey = process.env.LINEA_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;

const telosEndpoint = process.env.TELOS_ENDPOINT || DEFAULT_ENDPOINT;
const telosPrivateKey = process.env.TELOS_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;

// use kmsKeyId if it's not empty, otherwise use privateKey
function getNetworkConfig(url: string, kmsKeyId: string, privateKey: string, gasPrice?: number): NetworkUserConfig {
const network: NetworkUserConfig = !kmsKeyId
? {
url: url,
accounts: [`0x${privateKey}`]
}
url: url,
accounts: [`0x${privateKey}`]
}
: {
url: url,
kmsKeyId: kmsKeyId
};
url: url,
kmsKeyId: kmsKeyId
};
if (gasPrice) {
network.gasPrice = gasPrice;
}
Expand Down Expand Up @@ -404,7 +407,8 @@ const config: HardhatUserConfig = {
canto: getNetworkConfig(cantoEndpoint, kmsKeyId, cantoPrivateKey),
polygonZkevm: getNetworkConfig(polygonZkevmEndpoint, kmsKeyId, polygonZkevmPrivateKey),
antimatterB2: getNetworkConfig(antimatterB2Endpoint, kmsKeyId, antimatterB2PrivateKey),
linea: getNetworkConfig(lineaEndpoint, kmsKeyId, lineaPrivateKey)
linea: getNetworkConfig(lineaEndpoint, kmsKeyId, lineaPrivateKey),
telos: getNetworkConfig(telosEndpoint, kmsKeyId, telosPrivateKey)
},
namedAccounts: {
deployer: {
Expand Down

0 comments on commit ead34c2

Please sign in to comment.