Skip to content

Commit

Permalink
Updated util and config
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jan 3, 2025
1 parent f0b12ce commit 1f768f5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
25 changes: 15 additions & 10 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import "@nomiclabs/hardhat-solhint";
import "hardhat-contract-sizer";


const accounts: string[] = [`0x${process.env.PRIVATE_KEY}`];
const oneGwei: number = 1000000000;

export default {
etherscan: {
apiKey: {
Expand All @@ -32,41 +35,43 @@ export default {
networks: {
goerli: {
url: `https://goerli.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: [`0x${process.env.PRIVATE_KEY}` as string]
accounts
},
ropsten: {
url: `https://ropsten.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: [`0x${process.env.PRIVATE_KEY}` as string]
accounts
},
mainnet: {
url: `https://mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: [`0x${process.env.PRIVATE_KEY}` as string]
accounts
},
optimism: {
url: `https://mainnet.optimism.io`,
accounts: [`0x${process.env.PRIVATE_KEY}` as string],
accounts,
gasPrice: 15000000,
ovm: true
},
optimismgoerli: {
url: `https://goerli.optimism.io`,
accounts: [`0x${process.env.PRIVATE_KEY}` as string],
accounts,
gasPrice: 15000000
},
sepolia: {
url: `https://sepolia.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: [`0x${process.env.PRIVATE_KEY}` as string]
accounts,
chainId: 11155111,
gasPrice: oneGwei,
},
'base-mainnet': {
url: 'https://mainnet.base.org',
accounts: [`0x${process.env.PRIVATE_KEY}` as string],
gasPrice: 1000000000,
accounts,
gasPrice: oneGwei,
},
'base-sepolia': {
url: 'https://sepolia.base.org',
accounts: [`0x${process.env.PRIVATE_KEY}` as string],
gasPrice: 1000000000,
accounts,
chainId: 84532,
gasPrice: oneGwei,
},
hardhat: {
allowUnlimitedContractSize: true,
Expand Down
15 changes: 12 additions & 3 deletions util/UtilEMP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,20 @@ class TransferOpenError extends Error {}
*/
export async function deployContract(_contractFactory: string, params: any[] = []): Promise<Contract>
{
const contractFactory: ContractFactory = await ethers.getContractFactory(_contractFactory);
try
{
const contractFactory: ContractFactory = await ethers.getContractFactory(_contractFactory);

const deployedContract = await contractFactory.deploy(...params);
const deployedContract = await contractFactory.deploy(...params);

return await deployedContract.deployed();
return await deployedContract.deployed();
}
catch (error)
{
console.error("Error deploying contract:", error);

throw error;
}
}

/**
Expand Down

0 comments on commit 1f768f5

Please sign in to comment.