@rocketh/deploy 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/src/index.ts DELETED
@@ -1,606 +0,0 @@
1
- import {Abi} from 'abitype';
2
- import {EIP1193DATA, EIP1193TransactionData} from 'eip-1193';
3
- import type {
4
- Artifact,
5
- DeploymentConstruction,
6
- Deployment,
7
- Environment,
8
- PendingDeployment,
9
- PartialDeployment,
10
- PendingExecution,
11
- Signer,
12
- } from 'rocketh';
13
- import {extendEnvironment} from 'rocketh';
14
- import {
15
- Address,
16
- Chain,
17
- ContractFunctionArgs,
18
- ContractFunctionName,
19
- DecodeFunctionResultReturnType,
20
- EncodeDeployDataParameters,
21
- ReadContractParameters,
22
- WriteContractParameters,
23
- decodeFunctionResult,
24
- encodeFunctionData,
25
- encodePacked,
26
- keccak256,
27
- } from 'viem';
28
- import {DeployContractParameters, encodeDeployData} from 'viem';
29
- import {logs} from 'named-logs';
30
-
31
- const logger = logs('rocketh-deploy');
32
-
33
- declare module 'rocketh' {
34
- interface Environment {
35
- deploy: DeployFunction;
36
- execute: ExecuteFunction;
37
- read: ReadFunction;
38
- executeByName: ExecuteFunctionByName;
39
- readByName: ReadFunctionByName;
40
- }
41
- }
42
-
43
- export type DeployFunction = <TAbi extends Abi, TChain extends Chain = Chain>(
44
- name: string,
45
- args: DeploymentConstruction<TAbi>,
46
- options?: DeployOptions
47
- ) => Promise<Deployment<TAbi> & {updated: boolean}>;
48
-
49
- export type ExecuteFunction = <
50
- TAbi extends Abi,
51
- TFunctionName extends ContractFunctionName<TAbi, 'nonpayable' | 'payable'>,
52
- TArgs extends ContractFunctionArgs<TAbi, 'nonpayable' | 'payable', TFunctionName> = ContractFunctionArgs<
53
- TAbi,
54
- 'nonpayable' | 'payable',
55
- TFunctionName
56
- >
57
- >(
58
- deployment: Deployment<TAbi>,
59
- args: ExecutionArgs<TAbi, TFunctionName, TArgs>
60
- ) => Promise<EIP1193DATA>;
61
-
62
- export type ExecuteFunctionByName = <
63
- TAbi extends Abi,
64
- TFunctionName extends ContractFunctionName<TAbi, 'nonpayable' | 'payable'>,
65
- TArgs extends ContractFunctionArgs<TAbi, 'nonpayable' | 'payable', TFunctionName> = ContractFunctionArgs<
66
- TAbi,
67
- 'nonpayable' | 'payable',
68
- TFunctionName
69
- >
70
- >(
71
- name: string,
72
- args: ExecutionArgs<TAbi, TFunctionName, TArgs>
73
- ) => Promise<EIP1193DATA>;
74
-
75
- export type ReadFunction = <
76
- TAbi extends Abi,
77
- TFunctionName extends ContractFunctionName<TAbi, 'pure' | 'view'>,
78
- TArgs extends ContractFunctionArgs<TAbi, 'pure' | 'view', TFunctionName> = ContractFunctionArgs<
79
- TAbi,
80
- 'pure' | 'view',
81
- TFunctionName
82
- >
83
- >(
84
- deployment: Deployment<TAbi>,
85
- args: ReadingArgs<TAbi, TFunctionName, TArgs>
86
- ) => Promise<DecodeFunctionResultReturnType<TAbi, TFunctionName>>;
87
-
88
- export type ReadFunctionByName = <
89
- TAbi extends Abi,
90
- TFunctionName extends ContractFunctionName<TAbi, 'pure' | 'view'>,
91
- TArgs extends ContractFunctionArgs<TAbi, 'pure' | 'view', TFunctionName> = ContractFunctionArgs<
92
- TAbi,
93
- 'pure' | 'view',
94
- TFunctionName
95
- >
96
- >(
97
- name: string,
98
- args: ReadingArgs<TAbi, TFunctionName, TArgs>
99
- ) => Promise<DecodeFunctionResultReturnType<TAbi, TFunctionName>>;
100
-
101
- export type ExecutionArgs<
102
- TAbi extends Abi,
103
- TFunctionName extends ContractFunctionName<TAbi, 'nonpayable' | 'payable'>,
104
- TArgs extends ContractFunctionArgs<TAbi, 'nonpayable' | 'payable', TFunctionName> = ContractFunctionArgs<
105
- TAbi,
106
- 'nonpayable' | 'payable',
107
- TFunctionName
108
- >
109
- > = Omit<WriteContractParameters<TAbi, TFunctionName, TArgs>, 'address' | 'abi' | 'account' | 'nonce' | 'chain'> & {
110
- account: string;
111
- };
112
-
113
- export type ReadingArgs<
114
- TAbi extends Abi,
115
- TFunctionName extends ContractFunctionName<TAbi, 'pure' | 'view'>,
116
- TArgs extends ContractFunctionArgs<TAbi, 'pure' | 'view', TFunctionName> = ContractFunctionArgs<
117
- TAbi,
118
- 'pure' | 'view',
119
- TFunctionName
120
- >
121
- > = Omit<ReadContractParameters<TAbi, TFunctionName, TArgs>, 'address' | 'abi' | 'account' | 'nonce'> & {
122
- account?: string;
123
- };
124
-
125
- export type DeployOptions = {
126
- linkedData?: any;
127
- deterministic?: boolean | `0x${string}`;
128
- libraries?: {[name: string]: Address};
129
- } & (
130
- | {
131
- skipIfAlreadyDeployed?: boolean;
132
- }
133
- | {
134
- alwaysOverride?: boolean;
135
- }
136
- );
137
-
138
- async function broadcastTransaction(
139
- env: Environment,
140
- signer: Signer,
141
- params: [EIP1193TransactionData]
142
- ): Promise<`0x${string}`> {
143
- if (signer.type === 'wallet' || signer.type === 'remote') {
144
- return signer.signer.request({
145
- method: 'eth_sendTransaction',
146
- params,
147
- });
148
- } else {
149
- const rawTx = await signer.signer.request({
150
- method: 'eth_signTransaction',
151
- params,
152
- });
153
-
154
- return env.network.provider.request({
155
- method: 'eth_sendRawTransaction',
156
- params: [rawTx],
157
- });
158
- }
159
- }
160
-
161
- function linkRawLibrary(bytecode: string, libraryName: string, libraryAddress: string): string {
162
- const address = libraryAddress.replace('0x', '');
163
- let encodedLibraryName;
164
- if (libraryName.startsWith('$') && libraryName.endsWith('$')) {
165
- encodedLibraryName = libraryName.slice(1, libraryName.length - 1);
166
- } else {
167
- encodedLibraryName = keccak256(encodePacked(['string'], [libraryName])).slice(2, 36);
168
- }
169
- const pattern = new RegExp(`_+\\$${encodedLibraryName}\\$_+`, 'g');
170
- if (!pattern.exec(bytecode)) {
171
- throw new Error(`Can't link '${libraryName}' (${encodedLibraryName}) in \n----\n ${bytecode}\n----\n`);
172
- }
173
- return bytecode.replace(pattern, address);
174
- }
175
-
176
- function linkRawLibraries(bytecode: string, libraries: {[libraryName: string]: Address}): string {
177
- for (const libName of Object.keys(libraries)) {
178
- const libAddress = libraries[libName];
179
- bytecode = linkRawLibrary(bytecode, libName, libAddress);
180
- }
181
- return bytecode;
182
- }
183
-
184
- function linkLibraries(
185
- artifact: {
186
- bytecode: string;
187
- linkReferences?: {
188
- [libraryFileName: string]: {
189
- [libraryName: string]: Array<{length: number; start: number}>;
190
- };
191
- };
192
- },
193
- libraries?: {[libraryName: string]: Address}
194
- ) {
195
- let bytecode = artifact.bytecode;
196
-
197
- if (libraries) {
198
- if (artifact.linkReferences) {
199
- for (const [fileName, fileReferences] of Object.entries(artifact.linkReferences)) {
200
- for (const [libName, fixups] of Object.entries(fileReferences)) {
201
- const addr = libraries[libName];
202
- if (addr === undefined) {
203
- continue;
204
- }
205
-
206
- for (const fixup of fixups) {
207
- bytecode =
208
- bytecode.substring(0, 2 + fixup.start * 2) +
209
- addr.substring(2) +
210
- bytecode.substring(2 + (fixup.start + fixup.length) * 2);
211
- }
212
- }
213
- }
214
- } else {
215
- bytecode = linkRawLibraries(bytecode, libraries);
216
- }
217
- }
218
-
219
- // TODO return libraries object with path name <filepath.sol>:<name> for names
220
-
221
- return bytecode;
222
- }
223
-
224
- extendEnvironment((env: Environment) => {
225
- async function execute<
226
- TAbi extends Abi,
227
- TFunctionName extends ContractFunctionName<TAbi, 'nonpayable' | 'payable'>,
228
- TArgs extends ContractFunctionArgs<TAbi, 'nonpayable' | 'payable', TFunctionName> = ContractFunctionArgs<
229
- TAbi,
230
- 'nonpayable' | 'payable',
231
- TFunctionName
232
- >
233
- >(deployment: Deployment<TAbi>, args: ExecutionArgs<TAbi, TFunctionName, TArgs>) {
234
- const {account, ...viemArgs} = args;
235
- let address: `0x${string}`;
236
- if (account.startsWith('0x')) {
237
- address = account as `0x${string}`;
238
- } else {
239
- if (env.namedAccounts) {
240
- address = env.namedAccounts[account];
241
- if (!address) {
242
- throw new Error(`no address for ${account}`);
243
- }
244
- } else {
245
- throw new Error(`no accounts setup, cannot get address for ${account}`);
246
- }
247
- }
248
-
249
- const artifactToUse = deployment as unknown as Artifact<TAbi>;
250
- const abi = artifactToUse.abi;
251
- const calldata = encodeFunctionData<TAbi, TFunctionName>({
252
- abi,
253
- functionName: viemArgs.functionName,
254
- args: viemArgs.args,
255
- } as any);
256
-
257
- const signer = env.addressSigners[address];
258
-
259
- const txParam: EIP1193TransactionData = {
260
- to: deployment.address,
261
- type: '0x2',
262
- from: address,
263
- chainId: `0x${env.network.chain.id.toString(16)}` as `0x${string}`,
264
- data: calldata,
265
- gas: viemArgs.gas && (`0x${viemArgs.gas.toString(16)}` as `0x${string}`),
266
- // gasPrice: viemArgs.gasPrice && `0x${viemArgs.gasPrice.toString(16)}` as `0x${string}`,
267
- maxFeePerGas: viemArgs.maxFeePerGas && (`0x${viemArgs.maxFeePerGas.toString(16)}` as `0x${string}`),
268
- maxPriorityFeePerGas:
269
- viemArgs.maxPriorityFeePerGas && (`0x${viemArgs.maxPriorityFeePerGas.toString(16)}` as `0x${string}`),
270
- // nonce: viemArgs.nonce && (`0x${viemArgs.nonce.toString(16)}` as `0x${string}`),
271
- };
272
- if (viemArgs.value) {
273
- txParam.value = `0x${viemArgs.value?.toString(16)}` as `0x${string}`;
274
- }
275
-
276
- let txHash: `0x${string}`;
277
- if (signer.type === 'wallet' || signer.type === 'remote') {
278
- txHash = await signer.signer.request({
279
- method: 'eth_sendTransaction',
280
- params: [txParam],
281
- });
282
- } else {
283
- const rawTx = await signer.signer.request({
284
- method: 'eth_signTransaction',
285
- params: [txParam],
286
- });
287
-
288
- txHash = await env.network.provider.request({
289
- method: 'eth_sendRawTransaction',
290
- params: [rawTx],
291
- });
292
- }
293
-
294
- const pendingExecution: PendingExecution = {
295
- type: 'execution',
296
- transaction: {hash: txHash, origin: address},
297
- // description, // TODO
298
- // TODO we should have the nonce, except for wallet like metamask where it is not usre you get the nonce you start with
299
- };
300
- await env.savePendingExecution(pendingExecution);
301
- return txHash;
302
- }
303
-
304
- async function executeByName<
305
- TAbi extends Abi,
306
- TFunctionName extends ContractFunctionName<TAbi, 'nonpayable' | 'payable'>,
307
- TArgs extends ContractFunctionArgs<TAbi, 'nonpayable' | 'payable', TFunctionName> = ContractFunctionArgs<
308
- TAbi,
309
- 'nonpayable' | 'payable',
310
- TFunctionName
311
- >
312
- >(name: string, args: ExecutionArgs<TAbi, TFunctionName, TArgs>) {
313
- const deployment = env.getOrNull<TAbi>(name);
314
- if (!deployment) {
315
- throw new Error(`no deployment named ${name}`);
316
- }
317
-
318
- return execute(deployment, args);
319
- }
320
-
321
- async function read<
322
- TAbi extends Abi,
323
- TFunctionName extends ContractFunctionName<TAbi, 'pure' | 'view'>,
324
- TArgs extends ContractFunctionArgs<TAbi, 'pure' | 'view', TFunctionName> = ContractFunctionArgs<
325
- TAbi,
326
- 'pure' | 'view',
327
- TFunctionName
328
- >
329
- >(
330
- deployment: Deployment<TAbi>,
331
- args: ReadingArgs<TAbi, TFunctionName, TArgs>
332
- ): Promise<DecodeFunctionResultReturnType<TAbi, TFunctionName>> {
333
- const {account, ...viemArgs} = args;
334
- let address: `0x${string}` | undefined;
335
- if (account) {
336
- if (account.startsWith('0x')) {
337
- address = account as `0x${string}`;
338
- } else {
339
- if (env.namedAccounts) {
340
- address = env.namedAccounts[account];
341
- if (!address) {
342
- throw new Error(`no address for ${account}`);
343
- }
344
- } else {
345
- throw new Error(`no accounts setup, cannot get address for ${account}`);
346
- }
347
- }
348
- }
349
-
350
- const artifactToUse = deployment as unknown as Artifact<TAbi>;
351
- const abi = artifactToUse.abi;
352
- const calldata = encodeFunctionData<TAbi, TFunctionName>({
353
- abi,
354
- functionName: viemArgs.functionName,
355
- args: viemArgs.args,
356
- } as any);
357
-
358
- const result: `0x${string}` = (await env.network.provider.request({
359
- method: 'eth_call',
360
- params: [
361
- {
362
- to: deployment.address,
363
- type: '0x2',
364
- from: address,
365
- chainId: `0x${env.network.chain.id.toString(16)}` as `0x${string}`,
366
- data: calldata,
367
- // value: `0x${viemArgs.value?.toString(16)}` as `0x${string}`,
368
- },
369
- ],
370
- })) as `0x${string}`;
371
-
372
- const parsed = decodeFunctionResult<TAbi, TFunctionName>({
373
- abi,
374
- functionName: viemArgs.functionName,
375
- data: result,
376
- args: viemArgs.args,
377
- } as any);
378
-
379
- return parsed as DecodeFunctionResultReturnType<TAbi, TFunctionName>;
380
- }
381
-
382
- async function readByName<
383
- TAbi extends Abi,
384
- TFunctionName extends ContractFunctionName<TAbi, 'pure' | 'view'>,
385
- TArgs extends ContractFunctionArgs<TAbi, 'pure' | 'view', TFunctionName> = ContractFunctionArgs<
386
- TAbi,
387
- 'pure' | 'view',
388
- TFunctionName
389
- >
390
- >(
391
- name: string,
392
- args: ReadingArgs<TAbi, TFunctionName, TArgs>
393
- ): Promise<DecodeFunctionResultReturnType<TAbi, TFunctionName>> {
394
- const deployment = env.getOrNull<TAbi>(name);
395
- if (!deployment) {
396
- throw new Error(`no deployment named ${name}`);
397
- }
398
-
399
- return read(deployment, args);
400
- }
401
- async function deploy<TAbi extends Abi>(
402
- name: string,
403
- args: DeploymentConstruction<TAbi>,
404
- options?: DeployOptions
405
- ): Promise<Deployment<TAbi> & {updated: boolean}> {
406
- const skipIfAlreadyDeployed = options && 'skipIfAlreadyDeployed' in options && options.skipIfAlreadyDeployed;
407
- const allwaysOverride = options && 'allwaysOverride' in options && options.allwaysOverride;
408
-
409
- if (allwaysOverride && skipIfAlreadyDeployed) {
410
- throw new Error(`conflicting options: "allwaysOverride" and "skipIfAlreadyDeployed"`);
411
- }
412
-
413
- const existingDeployment = env.getOrNull(name);
414
- if (existingDeployment && skipIfAlreadyDeployed) {
415
- logger.info(`deployment for ${name} at ${existingDeployment.address}, skipIfAlreadyDeployed: true => we skip`);
416
- return {...(existingDeployment as Deployment<TAbi>), updated: false};
417
- }
418
-
419
- const {account, artifact, ...viemArgs} = args;
420
- let address: `0x${string}`;
421
- if (account.startsWith('0x')) {
422
- address = account as `0x${string}`;
423
- } else {
424
- if (env.namedAccounts) {
425
- address = env.namedAccounts[account];
426
- if (!address) {
427
- throw new Error(`no address for ${account}`);
428
- }
429
- } else {
430
- throw new Error(`no accounts setup, cannot get address for ${account}`);
431
- }
432
- }
433
-
434
- // TODO throw specific error if artifact not found
435
- const artifactToUse = (typeof artifact === 'string' ? env.artifacts[artifact] : artifact) as Artifact<TAbi>;
436
-
437
- const bytecode = linkLibraries(artifactToUse, options?.libraries);
438
-
439
- const abi = artifactToUse.abi;
440
-
441
- const argsToUse = {
442
- ...viemArgs,
443
- account,
444
- abi,
445
- bytecode,
446
- };
447
-
448
- const calldata = encodeDeployData(argsToUse as any); // TODO any
449
- const argsData = `0x${calldata.replace(bytecode, '')}` as `0x${string}`;
450
-
451
- if (existingDeployment) {
452
- logger.info(`existing deployment for ${name} at ${existingDeployment.address}`);
453
- }
454
-
455
- if (existingDeployment && !allwaysOverride) {
456
- const previousBytecode = existingDeployment.bytecode;
457
- const previousArgsData = existingDeployment.argsData;
458
- // we assume cbor encoding of hash at the end
459
- // TODO option to remove it, can parse metadata but would rather avoid this here
460
- const last2Bytes = previousBytecode.slice(-4);
461
- const cborLength = parseInt(last2Bytes, 16);
462
- const previousBytecodeWithoutCBOR = previousBytecode.slice(0, -cborLength * 2);
463
- const newBytecodeWithoutCBOR = bytecode.slice(0, -cborLength * 2);
464
- if (previousBytecodeWithoutCBOR === newBytecodeWithoutCBOR && previousArgsData === argsData) {
465
- return {...(existingDeployment as Deployment<TAbi>), updated: false};
466
- } else {
467
- // logger.info(`-------------- WITHOUT CBOR---------------------`);
468
- // logger.info(previousBytecodeWithoutCBOR);
469
- // logger.info(newBytecodeWithoutCBOR);
470
- // logger.info(`-----------------------------------`);
471
- // logger.info(`-------------- ARGS DATA ---------------------`);
472
- // logger.info(previousArgsData);
473
- // logger.info(argsData);
474
- // logger.info(`-----------------------------------`);
475
- }
476
- }
477
-
478
- const partialDeployment: PartialDeployment<TAbi> = {
479
- ...artifactToUse,
480
- argsData,
481
- linkedData: options?.linkedData,
482
- };
483
-
484
- const signer = env.addressSigners[address];
485
-
486
- const chainId = `0x${env.network.chain.id.toString(16)}` as `0x${string}`;
487
- const maxFeePerGas = viemArgs.maxFeePerGas && (`0x${viemArgs.maxFeePerGas.toString(16)}` as `0x${string}`);
488
- const maxPriorityFeePerGas =
489
- viemArgs.maxPriorityFeePerGas && (`0x${viemArgs.maxPriorityFeePerGas.toString(16)}` as `0x${string}`);
490
-
491
- const params: [EIP1193TransactionData] = [
492
- {
493
- type: '0x2',
494
- from: address,
495
- chainId,
496
- data: calldata,
497
- gas: viemArgs.gas && (`0x${viemArgs.gas.toString(16)}` as `0x${string}`),
498
- maxFeePerGas,
499
- maxPriorityFeePerGas,
500
- // gasPrice: viemArgs.gasPrice && `0x${viemArgs.gasPrice.toString(16)}` as `0x${string}`,
501
- // value: `0x${viemArgs.value?.toString(16)}` as `0x${string}`,
502
- // nonce: viemArgs.nonce && (`0x${viemArgs.nonce.toString(16)}` as `0x${string}`),
503
- },
504
- ];
505
-
506
- let expectedAddress: `0x${string}` | undefined = undefined;
507
- if (options?.deterministic) {
508
- // TODO make these configurable
509
- const deterministicFactoryAddress = `0x4e59b44847b379578588920ca78fbf26c0b4956c`;
510
- const deterministicFactoryDeployerAddress = `0x3fab184622dc19b6109349b94811493bf2a45362`;
511
- const factoryDeploymentData = `0xf8a58085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222`;
512
-
513
- const code = await env.network.provider.request({
514
- method: 'eth_getCode',
515
- params: [deterministicFactoryAddress, 'latest'],
516
- });
517
- if (code === '0x') {
518
- const balanceHexString = await env.network.provider.request({
519
- method: 'eth_getBalance',
520
- params: [deterministicFactoryDeployerAddress, 'latest'],
521
- });
522
- const balance = BigInt(balanceHexString);
523
- if (balance < 10000000000000000n) {
524
- const need = 10000000000000000n - balance;
525
- const balanceToSend = `0x${need.toString(16)}` as `0x${string}`;
526
- const txHash = await broadcastTransaction(env, signer, [
527
- {
528
- type: '0x2',
529
- chainId,
530
- from: address,
531
- to: deterministicFactoryDeployerAddress,
532
- value: balanceToSend,
533
- gas: `0x${BigInt(21000).toString(16)}`,
534
- maxFeePerGas,
535
- maxPriorityFeePerGas,
536
- },
537
- ]);
538
- await env.savePendingExecution({
539
- type: 'execution', // TODO different type ?
540
- transaction: {hash: txHash, origin: address},
541
- });
542
- }
543
-
544
- const txHash = await env.network.provider.request({
545
- method: 'eth_sendRawTransaction',
546
- params: [factoryDeploymentData],
547
- });
548
- await env.savePendingExecution({
549
- type: 'execution', // TODO different type ?
550
- transaction: {hash: txHash, origin: address},
551
- });
552
- }
553
-
554
- // prepending the salt
555
- const salt = (
556
- typeof options.deterministic === 'string'
557
- ? `0x${options.deterministic.slice(2).padStart(64, '0')}`
558
- : '0x0000000000000000000000000000000000000000000000000000000000000000'
559
- ) as `0x${string}`;
560
-
561
- const bytecode = params[0].data || '0x';
562
-
563
- expectedAddress = ('0x' +
564
- keccak256(`0xff${deterministicFactoryAddress.slice(2)}${salt.slice(2)}${keccak256(bytecode).slice(2)}`).slice(
565
- -40
566
- )) as `0x${string}`;
567
-
568
- const codeAlreadyDeployed = await env.network.provider.request({
569
- method: 'eth_getCode',
570
- params: [expectedAddress, 'latest'],
571
- });
572
-
573
- if (codeAlreadyDeployed !== '0x') {
574
- env.showMessage(`contract was already deterministically deployed at ${expectedAddress}`);
575
- const deployment = await env.save(name, {
576
- address: expectedAddress,
577
- ...partialDeployment,
578
- });
579
- return {...(deployment as Deployment<TAbi>), updated: true};
580
- }
581
-
582
- params[0].data = (salt + (bytecode.slice(2) || '')) as `0x${string}`;
583
- params[0].to = deterministicFactoryAddress;
584
- }
585
-
586
- const txHash = await broadcastTransaction(env, signer, params);
587
-
588
- const pendingDeployment: PendingDeployment<TAbi> = {
589
- type: 'deployment',
590
- expectedAddress,
591
- partialDeployment,
592
- transaction: {hash: txHash, origin: address},
593
- name,
594
- // TODO we should have the nonce, except for wallet like metamask where it is not usre you get the nonce you start with
595
- };
596
- const deployment = await env.savePendingDeployment(pendingDeployment);
597
- return {...(deployment as Deployment<TAbi>), updated: true};
598
- }
599
-
600
- env.deploy = deploy;
601
- env.execute = execute;
602
- env.executeByName = executeByName;
603
- env.read = read;
604
- env.readByName = readByName;
605
- return env;
606
- });
package/tsconfig.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "strict": true,
4
- "strictNullChecks": true,
5
- "target": "ESNext",
6
- "module": "NodeNext",
7
- "lib": ["ESNext", "dom"],
8
- "moduleResolution": "NodeNext",
9
- "resolveJsonModule": true,
10
- "skipLibCheck": true,
11
- "sourceMap": true,
12
- "declaration": true,
13
- "declarationMap": true,
14
- "rootDir": "./src",
15
- "outDir": "./dist/esm"
16
- },
17
- "include": ["src/**/*.ts"]
18
- }