rocketh 0.10.9 → 0.10.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cli.cjs +2 -2
- package/dist/cli.mjs +2 -2
- package/dist/{index-DOSnToHV.mjs → index-Cs7zkNfV.mjs} +23 -12
- package/dist/index-Cs7zkNfV.mjs.map +1 -0
- package/dist/{index-BJlVmvtt.cjs → index-t2GbLf0K.cjs} +24 -13
- package/dist/index-t2GbLf0K.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +12 -11
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/environment/index.ts +18 -8
- package/src/environment/types.ts +8 -6
- package/src/executor/index.ts +24 -12
- package/dist/index-BJlVmvtt.cjs.map +0 -1
- package/dist/index-DOSnToHV.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
package/dist/cli.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var ldenv = require('ldenv');
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-t2GbLf0K.cjs');
|
|
6
6
|
require('node:path');
|
|
7
7
|
require('node:fs');
|
|
8
8
|
require('ethers');
|
|
@@ -16,7 +16,7 @@ require('viem/chains');
|
|
|
16
16
|
require('prompts');
|
|
17
17
|
|
|
18
18
|
var name = "rocketh";
|
|
19
|
-
var version = "0.10.
|
|
19
|
+
var version = "0.10.10";
|
|
20
20
|
var description = "deploy smart contract on ethereum-compatible networks";
|
|
21
21
|
var publishConfig = {
|
|
22
22
|
access: "public"
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { loadEnv } from 'ldenv';
|
|
2
|
-
import { f as loadAndExecuteDeployments } from './index-
|
|
2
|
+
import { f as loadAndExecuteDeployments } from './index-Cs7zkNfV.mjs';
|
|
3
3
|
import 'node:path';
|
|
4
4
|
import 'node:fs';
|
|
5
5
|
import 'ethers';
|
|
@@ -13,7 +13,7 @@ import 'viem/chains';
|
|
|
13
13
|
import 'prompts';
|
|
14
14
|
|
|
15
15
|
var name = "rocketh";
|
|
16
|
-
var version = "0.10.
|
|
16
|
+
var version = "0.10.10";
|
|
17
17
|
var description = "deploy smart contract on ethereum-compatible networks";
|
|
18
18
|
var publishConfig = {
|
|
19
19
|
access: "public"
|
|
@@ -459,6 +459,7 @@ async function createEnvironment(config, providedContext) {
|
|
|
459
459
|
saveDeployments = config.saveDeployments;
|
|
460
460
|
}
|
|
461
461
|
const resolvedAccounts = {};
|
|
462
|
+
const allRemoteAccounts = await provider.request({ method: "eth_accounts" });
|
|
462
463
|
const accountCache = {};
|
|
463
464
|
async function getAccount(name, accounts, accountDef) {
|
|
464
465
|
if (accountCache[name]) {
|
|
@@ -466,8 +467,7 @@ async function createEnvironment(config, providedContext) {
|
|
|
466
467
|
}
|
|
467
468
|
let account;
|
|
468
469
|
if (typeof accountDef === "number") {
|
|
469
|
-
const
|
|
470
|
-
const accountPerIndex = accounts2[accountDef];
|
|
470
|
+
const accountPerIndex = allRemoteAccounts[accountDef];
|
|
471
471
|
if (accountPerIndex) {
|
|
472
472
|
accountCache[name] = account = {
|
|
473
473
|
type: "remote",
|
|
@@ -562,11 +562,19 @@ async function createEnvironment(config, providedContext) {
|
|
|
562
562
|
addressSigners[address] = namedSigner;
|
|
563
563
|
namedSigners[name] = namedSigner;
|
|
564
564
|
}
|
|
565
|
+
const unnamedAccounts = allRemoteAccounts.filter((v) => !addressSigners[v]);
|
|
566
|
+
for (const account of unnamedAccounts) {
|
|
567
|
+
addressSigners[account] = {
|
|
568
|
+
type: "remote",
|
|
569
|
+
signer: provider
|
|
570
|
+
};
|
|
571
|
+
}
|
|
565
572
|
const perliminaryEnvironment = {
|
|
566
573
|
config,
|
|
567
574
|
deployments,
|
|
568
|
-
|
|
569
|
-
|
|
575
|
+
namedAccounts,
|
|
576
|
+
namedSigners,
|
|
577
|
+
unnamedAccounts,
|
|
570
578
|
addressSigners,
|
|
571
579
|
artifacts: context.artifacts,
|
|
572
580
|
network: {
|
|
@@ -1089,11 +1097,11 @@ async function loadEnvironment(options, context) {
|
|
|
1089
1097
|
const { external, internal } = await createEnvironment(resolvedConfig, context);
|
|
1090
1098
|
return external;
|
|
1091
1099
|
}
|
|
1092
|
-
async function loadAndExecuteDeployments(options, args) {
|
|
1100
|
+
async function loadAndExecuteDeployments(options, context, args) {
|
|
1093
1101
|
const resolvedConfig = readAndResolveConfig(options);
|
|
1094
|
-
return executeDeployScripts(resolvedConfig, args);
|
|
1102
|
+
return executeDeployScripts(resolvedConfig, context, args);
|
|
1095
1103
|
}
|
|
1096
|
-
async function executeDeployScripts(config, args) {
|
|
1104
|
+
async function executeDeployScripts(config, context, args) {
|
|
1097
1105
|
setLogLevel(typeof config.logLevel === "undefined" ? 0 : config.logLevel);
|
|
1098
1106
|
let filepaths;
|
|
1099
1107
|
filepaths = traverseMultipleDirectory([config.scripts]);
|
|
@@ -1106,7 +1114,8 @@ async function executeDeployScripts(config, args) {
|
|
|
1106
1114
|
}
|
|
1107
1115
|
return 0;
|
|
1108
1116
|
});
|
|
1109
|
-
let providedContext;
|
|
1117
|
+
let providedContext = context;
|
|
1118
|
+
const providedFromArguments = !!providedContext;
|
|
1110
1119
|
const scriptModuleByFilePath = {};
|
|
1111
1120
|
const scriptPathBags = {};
|
|
1112
1121
|
const scriptFilePaths = [];
|
|
@@ -1126,10 +1135,12 @@ async function executeDeployScripts(config, args) {
|
|
|
1126
1135
|
}
|
|
1127
1136
|
}
|
|
1128
1137
|
scriptModuleByFilePath[scriptFilePath] = scriptModule;
|
|
1129
|
-
if (
|
|
1130
|
-
|
|
1138
|
+
if (!providedFromArguments) {
|
|
1139
|
+
if (providedContext && providedContext !== scriptModule.providedContext) {
|
|
1140
|
+
throw new Error(`context between 2 scripts is different, please share the same across them`);
|
|
1141
|
+
}
|
|
1142
|
+
providedContext = scriptModule.providedContext;
|
|
1131
1143
|
}
|
|
1132
|
-
providedContext = scriptModule.providedContext;
|
|
1133
1144
|
} catch (e) {
|
|
1134
1145
|
logger.error(`could not import ${filepath}`);
|
|
1135
1146
|
throw e;
|
|
@@ -1285,4 +1296,4 @@ Do you want to proceed (note that gas price can change for each tx)`
|
|
|
1285
1296
|
}
|
|
1286
1297
|
|
|
1287
1298
|
export { execute as a, readAndResolveConfig as b, resolveConfig as c, loadEnvironment as d, extendEnvironment as e, loadAndExecuteDeployments as f, executeDeployScripts as g, handleSignerProtocol as h, chainTypes as i, chainById as j, getChain as k, loadDeployments as l, mergeArtifacts as m, getGasPriceEstimate as n, getRoughGasPriceEstimate as o, readConfig as r };
|
|
1288
|
-
//# sourceMappingURL=index-
|
|
1299
|
+
//# sourceMappingURL=index-Cs7zkNfV.mjs.map
|