Skip to content

Commit

Permalink
Merge branch 'master' into features/SMA-99-lint-style
Browse files Browse the repository at this point in the history
  • Loading branch information
livingrockrises committed Sep 14, 2023
2 parents 538c4f5 + daee7f8 commit cb19f1d
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 25 deletions.
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ BSCSCAN_API_KEY=
OPTIMISTIC_API_KEY=
AVALANCHE_API_KEY=
ARBITRUM_API_KEY=
BASE_API_KEY=
ARBITRUM_NOVA_API_KEY=
BASE_GOERLI_API_KEY=
BASE_MAINNET_API_KEY=
LINEA_API_KEY=
ZKEVM_API_KEY=
MOONBEAM_KEY=
# Generate on https://dashboard.nodereal.io/
Expand Down
21 changes: 15 additions & 6 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,13 @@ const config: HardhatUserConfig = {
arbitrumGoerli: process.env.ARBITRUM_API_KEY || "",
arbitrumTestnet: process.env.ARBITRUM_API_KEY || "",
arbitrumOne: process.env.ARBITRUM_API_KEY || "",
arbitrumNova: process.env.ARBITRUM_NOVA_API_KEY || "",
optimisticGoerli: process.env.OPTIMISTIC_API_KEY || "",
optimisticEthereum: process.env.OPTIMISTIC_API_KEY || "",
lineaGoerli: "PLACEHOLDER_STRING",
lineaMainnet: "PLACEHOLDER_STRING",
baseGoerli: process.env.BASE_API_KEY || "",
baseMainnet: process.env.BASE_API_KEY || "",
lineaGoerli: process.env.LINEA_API_KEY || "",
lineaMainnet: process.env.LINEA_API_KEY || "",
baseGoerli: process.env.BASE_GOERI_API_KEY || "",
baseMainnet: process.env.BASE_MAINNET_API_KEY || "",
zkEVMMainnet: process.env.ZKEVM_API_KEY || "",
zkEVMGoerli: process.env.ZKEVM_API_KEY || "",
opBNBTestnet: process.env.OP_BNB_API_KEY || "",
Expand All @@ -306,6 +307,14 @@ const config: HardhatUserConfig = {
comboTestnet: process.env.COMBO_API_KEY || "",
},
customChains: [
{
network: "arbitrumNova",
chainId: 42170,
urls: {
apiURL: "https://api-nova.arbiscan.io/api",
browserURL: "https://nova.arbiscan.io/",
},
},
{
network: "lineaGoerli",
chainId: 59140,
Expand All @@ -318,8 +327,8 @@ const config: HardhatUserConfig = {
network: "lineaMainnet",
chainId: 59144,
urls: {
apiURL: "https://explorer.linea.build/api",
browserURL: "https://explorer.lineascan.build",
apiURL: "https://api.lineascan.build/api",
browserURL: "https://lineascan.build",
},
},
{
Expand Down
36 changes: 22 additions & 14 deletions scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,22 @@ export async function deployGeneric(
bytecode,
deployerInstance
);
try {
await run("verify:verify", {
address: computedAddress,
constructorArguments,
});
} catch (err) {
console.log(err);
}
} else {
console.log(
`${contractName} is Already deployed with address ${computedAddress}`
);
}

try {
console.log(`Attempting to verify ${contractName}...`);
await run("verify:verify", {
address: computedAddress,
constructorArguments,
});
} catch (err) {
console.log("Error while verifying: ", err);
}

contractsDeployed[contractName] = computedAddress;

Check warning on line 89 in scripts/deploy.ts

View workflow job for this annotation

GitHub Actions / Lint sources (18.x)

Generic Object Injection Sink

return computedAddress;
Expand Down Expand Up @@ -152,7 +154,7 @@ async function deployWalletFactoryContract(deployerInstance: Deployer) {
console.log("Checking if Factory is staked...");
const { unstakeDelayInSec, stakeInWei } = factoryStakeConfig[chainId];

Check warning on line 155 in scripts/deploy.ts

View workflow job for this annotation

GitHub Actions / Lint sources (18.x)

Variable Assigned to Object Injection Sink
const entrypoint = EntryPoint__factory.connect(entryPointAddress, signer);
const stake = await entrypoint.getDepositInfo(smartAccountFactoryAddress);
let stake = await entrypoint.getDepositInfo(smartAccountFactoryAddress);
console.log("Current Factory Stake: ", JSON.stringify(stake, null, 2));
if (stake.staked) {
console.log("Factory already staked");
Expand Down Expand Up @@ -182,6 +184,9 @@ async function deployWalletFactoryContract(deployerInstance: Deployer) {
console.log("Factory is not owned by signer, skipping staking...");
}

stake = await entrypoint.getDepositInfo(smartAccountFactoryAddress);
console.log("Updated Factory Stake: ", JSON.stringify(stake, null, 2));

if (contractOwner !== smartAccountFactoryOwnerAddress) {
console.log("Transferring Ownership of SmartAccountFactory...");
const { hash, wait } = await smartAccountFactory.transferOwnership(
Expand Down Expand Up @@ -215,14 +220,14 @@ async function deployVerifySingeltonPaymaster(deployerInstance: Deployer) {
DEPLOYMENT_SALTS.SINGELTON_PAYMASTER,
bytecode,
"VerifyingPaymaster",
[paymasterOwnerAddress, entryPointAddress, verifyingSigner]
[signer.address, entryPointAddress, verifyingSigner]
);

console.log("Checking if VerifyingPaymaster is staked...");
const { unstakeDelayInSec, stakeInWei } = paymasterStakeConfig[chainId];

Check warning on line 227 in scripts/deploy.ts

View workflow job for this annotation

GitHub Actions / Lint sources (18.x)

Variable Assigned to Object Injection Sink
const entrypoint = EntryPoint__factory.connect(entryPointAddress, signer);
const stake = await entrypoint.getDepositInfo(paymasterAddress);
console.log("Current Paymster Stake: ", JSON.stringify(stake, null, 2));
let stake = await entrypoint.getDepositInfo(paymasterAddress);
console.log("Current Paymaster Stake: ", JSON.stringify(stake, null, 2));
if (stake.staked) {
console.log("Paymaster already staked");
return;
Expand All @@ -247,8 +252,11 @@ async function deployVerifySingeltonPaymaster(deployerInstance: Deployer) {
console.log("Paymaster is not owned by signer, skipping staking...");
}

stake = await entrypoint.getDepositInfo(paymasterAddress);
console.log("Updated Paymaster Stake: ", JSON.stringify(stake, null, 2));

if (contractOwner !== paymasterOwnerAddress) {
console.log("Transferring Ownership of SmartAccountFactory...");
console.log("Transferring Ownership of VerifyingPaymaster...");
const { hash, wait } = await paymaster.transferOwnership(
paymasterOwnerAddress,
{
Expand Down Expand Up @@ -426,7 +434,7 @@ export async function mainDeploy(): Promise<Record<string, string>> {

const deployerBalanceAfter = await deployer.getBalance();
console.log(
`Deployer ${deployer.address} initial balance: ${formatEther(
`Deployer ${deployer.address} final balance: ${formatEther(
deployerBalanceAfter
)}`
);
Expand Down
14 changes: 10 additions & 4 deletions scripts/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,15 @@ export const DEPLOYMENT_CHAIN_GAS_PRICES: Record<
},

// Mainnets
137: { maxPriorityFeePerGas: parseUnits("50", "gwei") },
56: { maxPriorityFeePerGas: parseUnits("10", "gwei") },
1: { maxPriorityFeePerGas: parseUnits("30", "gwei") },
137: {
maxPriorityFeePerGas: parseUnits("30", "gwei"),
maxFeePerGas: parseUnits("250", "gwei"),
},
56: { gasPrice: parseUnits("3", "gwei") },
1: {
maxPriorityFeePerGas: parseUnits("1", "gwei"),
maxFeePerGas: parseUnits("15", "gwei"),
},
42161: { gasPrice: parseUnits("1", "gwei") },
42170: {
gasPrice: parseUnits("1", "gwei"),
Expand All @@ -140,7 +146,7 @@ export const DEPLOYMENT_CHAIN_GAS_PRICES: Record<
8453: { gasPrice: parseUnits("1.5", "gwei") },
204: { gasPrice: parseUnits("0.1", "gwei") },
5000: { gasPrice: parseUnits("1", "gwei") },
1284: { gasPrice: parseUnits("200", "gwei") },
1284: { gasPrice: parseUnits("150", "gwei") },
};

export type StakingConfig = {
Expand Down

0 comments on commit cb19f1d

Please sign in to comment.