Skip to content

Commit 3a1eb19

Browse files
committed
cleanup
1 parent 57b9eb3 commit 3a1eb19

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

packages/thirdweb/src/contract/deployment/utils/create-2-factory.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -162,24 +162,22 @@ export async function deployCreate2Factory(options: ClientAndChainAndAccount) {
162162
chain,
163163
});
164164

165-
let deploymentInfo: Create2FactoryDeploymentInfo;
165+
let gasPrice: bigint | undefined;
166+
let gasLimit: bigint | undefined;
166167

167168
if (CUSTOM_GAS_FOR_CHAIN[chainId]) {
168-
const gasPrice = CUSTOM_GAS_FOR_CHAIN[chainId.toString()]?.gasPrice;
169-
const gasLimit = CUSTOM_GAS_FOR_CHAIN[chainId.toString()]?.gasLimit;
170-
171-
deploymentInfo = await _getCreate2FactoryDeploymentInfo(eipChain, {
172-
gasPrice,
173-
gasLimit,
174-
});
169+
gasPrice = CUSTOM_GAS_FOR_CHAIN[chainId.toString()]?.gasPrice;
170+
gasLimit = CUSTOM_GAS_FOR_CHAIN[chainId.toString()]?.gasLimit;
175171
} else {
176172
const gasPriceFetched = await getGasPrice(options);
177-
const bin = _getNearestGasPriceBin(gasPriceFetched);
178-
deploymentInfo = await _getCreate2FactoryDeploymentInfo(eipChain, {
179-
gasPrice: bin,
180-
});
173+
gasPrice = _getNearestGasPriceBin(gasPriceFetched);
181174
}
182175

176+
const deploymentInfo = await _getCreate2FactoryDeploymentInfo(eipChain, {
177+
gasPrice,
178+
gasLimit,
179+
});
180+
183181
const balance = await eth_getBalance(rpcRequest, {
184182
address: deploymentInfo.signerAddress,
185183
});

0 commit comments

Comments
 (0)