@0xsequence/catapult 1.3.17 → 1.5.0
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/README.md +276 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +1 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +12 -0
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/provenance.d.ts +3 -0
- package/dist/commands/provenance.d.ts.map +1 -0
- package/dist/commands/provenance.js +138 -0
- package/dist/commands/provenance.js.map +1 -0
- package/dist/lib/__tests__/deployer.spec.js +118 -1
- package/dist/lib/__tests__/deployer.spec.js.map +1 -1
- package/dist/lib/__tests__/network-loader.spec.js.map +1 -1
- package/dist/lib/__tests__/provenance.spec.d.ts +2 -0
- package/dist/lib/__tests__/provenance.spec.d.ts.map +1 -0
- package/dist/lib/__tests__/provenance.spec.js +205 -0
- package/dist/lib/__tests__/provenance.spec.js.map +1 -0
- package/dist/lib/contracts/__tests__/repository.spec.js +243 -0
- package/dist/lib/contracts/__tests__/repository.spec.js.map +1 -1
- package/dist/lib/contracts/repository.d.ts +9 -1
- package/dist/lib/contracts/repository.d.ts.map +1 -1
- package/dist/lib/contracts/repository.js +93 -7
- package/dist/lib/contracts/repository.js.map +1 -1
- package/dist/lib/core/__tests__/assert-action.spec.d.ts +2 -0
- package/dist/lib/core/__tests__/assert-action.spec.d.ts.map +1 -0
- package/dist/lib/core/__tests__/assert-action.spec.js +377 -0
- package/dist/lib/core/__tests__/assert-action.spec.js.map +1 -0
- package/dist/lib/core/__tests__/engine.spec.js +80 -0
- package/dist/lib/core/__tests__/engine.spec.js.map +1 -1
- package/dist/lib/core/__tests__/loader.spec.js +29 -0
- package/dist/lib/core/__tests__/loader.spec.js.map +1 -1
- package/dist/lib/core/__tests__/resolver.spec.js +405 -0
- package/dist/lib/core/__tests__/resolver.spec.js.map +1 -1
- package/dist/lib/core/__tests__/sign-actions.spec.d.ts +2 -0
- package/dist/lib/core/__tests__/sign-actions.spec.d.ts.map +1 -0
- package/dist/lib/core/__tests__/sign-actions.spec.js +128 -0
- package/dist/lib/core/__tests__/sign-actions.spec.js.map +1 -0
- package/dist/lib/core/__tests__/signer.spec.d.ts +2 -0
- package/dist/lib/core/__tests__/signer.spec.d.ts.map +1 -0
- package/dist/lib/core/__tests__/signer.spec.js +40 -0
- package/dist/lib/core/__tests__/signer.spec.js.map +1 -0
- package/dist/lib/core/context.d.ts +3 -2
- package/dist/lib/core/context.d.ts.map +1 -1
- package/dist/lib/core/context.js +3 -2
- package/dist/lib/core/context.js.map +1 -1
- package/dist/lib/core/engine.d.ts +4 -0
- package/dist/lib/core/engine.d.ts.map +1 -1
- package/dist/lib/core/engine.js +206 -0
- package/dist/lib/core/engine.js.map +1 -1
- package/dist/lib/core/loader.d.ts +1 -0
- package/dist/lib/core/loader.d.ts.map +1 -1
- package/dist/lib/core/loader.js +6 -1
- package/dist/lib/core/loader.js.map +1 -1
- package/dist/lib/core/resolver.d.ts +2 -0
- package/dist/lib/core/resolver.d.ts.map +1 -1
- package/dist/lib/core/resolver.js +89 -0
- package/dist/lib/core/resolver.js.map +1 -1
- package/dist/lib/core/signer.d.ts +7 -0
- package/dist/lib/core/signer.d.ts.map +1 -0
- package/dist/lib/core/signer.js +60 -0
- package/dist/lib/core/signer.js.map +1 -0
- package/dist/lib/deployer.d.ts.map +1 -1
- package/dist/lib/deployer.js +21 -4
- package/dist/lib/deployer.js.map +1 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/parsers/__tests__/job.spec.js +77 -0
- package/dist/lib/parsers/__tests__/job.spec.js.map +1 -1
- package/dist/lib/parsers/__tests__/source.spec.d.ts +2 -0
- package/dist/lib/parsers/__tests__/source.spec.d.ts.map +1 -0
- package/dist/lib/parsers/__tests__/source.spec.js +158 -0
- package/dist/lib/parsers/__tests__/source.spec.js.map +1 -0
- package/dist/lib/parsers/index.d.ts +1 -0
- package/dist/lib/parsers/index.d.ts.map +1 -1
- package/dist/lib/parsers/index.js +1 -0
- package/dist/lib/parsers/index.js.map +1 -1
- package/dist/lib/parsers/job.d.ts.map +1 -1
- package/dist/lib/parsers/job.js +11 -0
- package/dist/lib/parsers/job.js.map +1 -1
- package/dist/lib/parsers/source.d.ts +4 -0
- package/dist/lib/parsers/source.d.ts.map +1 -0
- package/dist/lib/parsers/source.js +107 -0
- package/dist/lib/parsers/source.js.map +1 -0
- package/dist/lib/provenance.d.ts +34 -0
- package/dist/lib/provenance.d.ts.map +1 -0
- package/dist/lib/provenance.js +694 -0
- package/dist/lib/provenance.js.map +1 -0
- package/dist/lib/types/actions.d.ts +42 -2
- package/dist/lib/types/actions.d.ts.map +1 -1
- package/dist/lib/types/actions.js +4 -0
- package/dist/lib/types/actions.js.map +1 -1
- package/dist/lib/types/contracts.d.ts +3 -0
- package/dist/lib/types/contracts.d.ts.map +1 -1
- package/dist/lib/types/definitions.d.ts +1 -0
- package/dist/lib/types/definitions.d.ts.map +1 -1
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/types/index.d.ts.map +1 -1
- package/dist/lib/types/index.js +1 -0
- package/dist/lib/types/index.js.map +1 -1
- package/dist/lib/types/source.d.ts +26 -0
- package/dist/lib/types/source.d.ts.map +1 -0
- package/dist/lib/types/source.js +3 -0
- package/dist/lib/types/source.js.map +1 -0
- package/dist/lib/types/values.d.ts +33 -1
- package/dist/lib/types/values.d.ts.map +1 -1
- package/package.json +4 -1
- package/.eslintrc.json +0 -29
- package/.github/workflows/ci.yml +0 -181
- package/CONCEPT.md +0 -24
- package/contracts/checked-call.huff +0 -65
- package/eslint.config.js +0 -48
- package/examples/jobs/guards-v1.yaml +0 -17
- package/examples/jobs/sequence-seq-0001-patch.yaml +0 -59
- package/examples/jobs/sequence-v1.yaml +0 -59
- package/examples/templates/sequence-factory-v1.yaml +0 -56
- package/jest.config.js +0 -25
- package/src/cli.ts +0 -17
- package/src/commands/common.ts +0 -61
- package/src/commands/dry.ts +0 -209
- package/src/commands/etherscan.ts +0 -360
- package/src/commands/index.ts +0 -5
- package/src/commands/list.ts +0 -249
- package/src/commands/run.ts +0 -146
- package/src/commands/utils.ts +0 -215
- package/src/index.ts +0 -67
- package/src/lib/__tests__/deployer-events.spec.ts +0 -338
- package/src/lib/__tests__/deployer.spec.ts +0 -2093
- package/src/lib/__tests__/network-loader.spec.ts +0 -150
- package/src/lib/__tests__/network-selection.spec.ts +0 -41
- package/src/lib/__tests__/network-utils.spec.ts +0 -230
- package/src/lib/artifacts/__tests__/fixtures/contract1.json +0 -19
- package/src/lib/artifacts/__tests__/fixtures/contract2.json +0 -19
- package/src/lib/artifacts/__tests__/fixtures/duplicate-name.json +0 -19
- package/src/lib/artifacts/__tests__/fixtures/nested/nested-contract.json +0 -18
- package/src/lib/artifacts/__tests__/fixtures/not-an-artifact.json +0 -8
- package/src/lib/artifacts/__tests__/fixtures/readme.txt +0 -2
- package/src/lib/contracts/__tests__/repository.spec.ts +0 -344
- package/src/lib/contracts/repository.ts +0 -313
- package/src/lib/core/__tests__/context.spec.ts +0 -37
- package/src/lib/core/__tests__/engine.spec.ts +0 -1889
- package/src/lib/core/__tests__/graph.spec.ts +0 -125
- package/src/lib/core/__tests__/json-integration.spec.ts +0 -425
- package/src/lib/core/__tests__/loader.spec.ts +0 -334
- package/src/lib/core/__tests__/multi-platform-verification.spec.ts +0 -406
- package/src/lib/core/__tests__/resolver.spec.ts +0 -2053
- package/src/lib/core/__tests__/static-action.spec.ts +0 -172
- package/src/lib/core/context.ts +0 -127
- package/src/lib/core/engine.ts +0 -1782
- package/src/lib/core/graph.ts +0 -252
- package/src/lib/core/loader.ts +0 -247
- package/src/lib/core/resolver.ts +0 -757
- package/src/lib/deployer.ts +0 -981
- package/src/lib/events/__tests__/event-system.spec.ts +0 -392
- package/src/lib/events/cli-adapter.ts +0 -369
- package/src/lib/events/emitter.ts +0 -62
- package/src/lib/events/index.ts +0 -3
- package/src/lib/events/types.ts +0 -520
- package/src/lib/index.ts +0 -14
- package/src/lib/network-loader.ts +0 -90
- package/src/lib/network-selection.ts +0 -73
- package/src/lib/network-utils.ts +0 -64
- package/src/lib/parsers/__tests__/buildinfo.spec.ts +0 -122
- package/src/lib/parsers/__tests__/fixtures/buildinfo/invalid-bytecode-buildinfo.json +0 -62
- package/src/lib/parsers/__tests__/fixtures/buildinfo/invalid-json.txt +0 -2
- package/src/lib/parsers/__tests__/fixtures/buildinfo/multi-contract-buildinfo.json +0 -89
- package/src/lib/parsers/__tests__/fixtures/buildinfo/no-contracts-buildinfo.json +0 -17
- package/src/lib/parsers/__tests__/fixtures/buildinfo/simple-buildinfo.json +0 -63
- package/src/lib/parsers/__tests__/fixtures/buildinfo/wrong-format.json +0 -4
- package/src/lib/parsers/__tests__/job.spec.ts +0 -358
- package/src/lib/parsers/__tests__/template.spec.ts +0 -111
- package/src/lib/parsers/artifact/__tests__/artifact.spec.ts +0 -117
- package/src/lib/parsers/artifact/__tests__/fixtures/empty-bytecode.json +0 -5
- package/src/lib/parsers/artifact/__tests__/fixtures/hardhat-artifact.json +0 -67
- package/src/lib/parsers/artifact/__tests__/fixtures/invalid-bytecode.json +0 -5
- package/src/lib/parsers/artifact/__tests__/fixtures/invalid-json.txt +0 -11
- package/src/lib/parsers/artifact/__tests__/fixtures/minimal-artifact.json +0 -5
- package/src/lib/parsers/artifact/__tests__/fixtures/missing-abi.json +0 -4
- package/src/lib/parsers/artifact/__tests__/fixtures/missing-bytecode.json +0 -11
- package/src/lib/parsers/artifact/__tests__/fixtures/missing-contract-name.json +0 -11
- package/src/lib/parsers/artifact/__tests__/fixtures/simple-artifact.json +0 -40
- package/src/lib/parsers/artifact/__tests__/fixtures/wrong-types.json +0 -7
- package/src/lib/parsers/artifact/foundry-1.2.ts +0 -72
- package/src/lib/parsers/artifact/index.ts +0 -27
- package/src/lib/parsers/artifact/types.ts +0 -9
- package/src/lib/parsers/buildinfo.ts +0 -127
- package/src/lib/parsers/constants.ts +0 -56
- package/src/lib/parsers/index.ts +0 -5
- package/src/lib/parsers/job.ts +0 -148
- package/src/lib/parsers/template.ts +0 -135
- package/src/lib/std/templates/arachnid-deterministic-deployment-proxy.yaml +0 -68
- package/src/lib/std/templates/assured-deployment.yaml +0 -46
- package/src/lib/std/templates/era-evm-predeploy.yaml +0 -35
- package/src/lib/std/templates/erc-2470.yaml +0 -70
- package/src/lib/std/templates/min-balance.yaml +0 -35
- package/src/lib/std/templates/nano-universal-deployer.yaml +0 -61
- package/src/lib/std/templates/raw-erc-2470.yaml +0 -62
- package/src/lib/std/templates/raw-nano-universal-deployer.yaml +0 -54
- package/src/lib/std/templates/raw-sequence-universal-deployer-2.yaml +0 -52
- package/src/lib/std/templates/sequence-universal-deployer-2.yaml +0 -61
- package/src/lib/types/__tests__/json-request-action.spec.ts +0 -243
- package/src/lib/types/__tests__/read-json-value.spec.ts +0 -278
- package/src/lib/types/__tests__/resolve-json-value.spec.ts +0 -769
- package/src/lib/types/actions.ts +0 -127
- package/src/lib/types/artifacts.ts +0 -21
- package/src/lib/types/buildinfo.ts +0 -116
- package/src/lib/types/conditions.ts +0 -50
- package/src/lib/types/contracts.ts +0 -23
- package/src/lib/types/definitions.ts +0 -70
- package/src/lib/types/index.ts +0 -8
- package/src/lib/types/network.ts +0 -33
- package/src/lib/types/project.ts +0 -9
- package/src/lib/types/task.ts +0 -9
- package/src/lib/types/values.ts +0 -150
- package/src/lib/utils/assertion.ts +0 -24
- package/src/lib/utils/validation.ts +0 -116
- package/src/lib/validation/contract-references.ts +0 -210
- package/src/lib/validation/index.ts +0 -1
- package/src/lib/verification/__tests__/etherscan.spec.ts +0 -710
- package/src/lib/verification/__tests__/sourcify.spec.ts +0 -288
- package/src/lib/verification/etherscan.ts +0 -547
- package/src/lib/verification/sourcify.ts +0 -248
- package/test_validation/artifacts/TestContract.json +0 -9
- package/test_validation/jobs/test-missing.yaml +0 -16
- package/test_validation/networks.yaml +0 -3
- package/tsconfig.json +0 -36
package/src/lib/types/actions.ts
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { AddressValue, BytesValue, Uint256Value, Value } from './values'
|
|
2
|
-
import { Contract } from './contracts'
|
|
3
|
-
import { Condition } from './conditions'
|
|
4
|
-
|
|
5
|
-
// --- Primitive Actions ---
|
|
6
|
-
// These are the basic building blocks that interact with the blockchain.
|
|
7
|
-
|
|
8
|
-
export interface SendTransactionAction {
|
|
9
|
-
type: 'send-transaction';
|
|
10
|
-
arguments: {
|
|
11
|
-
to: AddressValue;
|
|
12
|
-
value?: Uint256Value;
|
|
13
|
-
data?: BytesValue;
|
|
14
|
-
gasMultiplier?: number;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface SendSignedTransactionAction {
|
|
19
|
-
type: 'send-signed-transaction';
|
|
20
|
-
arguments: {
|
|
21
|
-
transaction: BytesValue;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface VerifyContractAction {
|
|
26
|
-
type: 'verify-contract';
|
|
27
|
-
arguments: {
|
|
28
|
-
address: AddressValue;
|
|
29
|
-
contract: Value<Contract>; // The contract to verify
|
|
30
|
-
constructorArguments?: BytesValue; // Optional constructor args as hex string
|
|
31
|
-
platform?: Value<string | string[]>; // Platform(s) to verify on, defaults to "all" (tries all configured platforms)
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface StaticAction {
|
|
36
|
-
type: 'static';
|
|
37
|
-
arguments: {
|
|
38
|
-
value: Value<any>;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface CreateContractAction {
|
|
43
|
-
type: 'create-contract';
|
|
44
|
-
arguments: {
|
|
45
|
-
data: BytesValue; // The contract bytecode (creation code)
|
|
46
|
-
value?: Uint256Value; // ETH to send with the contract creation
|
|
47
|
-
gasMultiplier?: number; // Optional gas multiplier
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface TestNicksMethodAction {
|
|
52
|
-
type: 'test-nicks-method';
|
|
53
|
-
arguments: {
|
|
54
|
-
bytecode?: BytesValue;
|
|
55
|
-
gasPrice?: Uint256Value;
|
|
56
|
-
gasLimit?: Uint256Value;
|
|
57
|
-
fundingAmount?: Uint256Value;
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface JsonRequestAction {
|
|
62
|
-
type: 'json-request';
|
|
63
|
-
arguments: {
|
|
64
|
-
url: Value<string>;
|
|
65
|
-
method?: Value<string>; // GET, POST, PUT, DELETE, etc. Defaults to GET
|
|
66
|
-
headers?: Value<Record<string, string>>; // Optional headers
|
|
67
|
-
body?: Value<any>; // JSON body for POST/PUT requests
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// A union of all primitive action types.
|
|
72
|
-
export type PrimitiveAction = SendTransactionAction | SendSignedTransactionAction | VerifyContractAction | StaticAction | CreateContractAction | TestNicksMethodAction | JsonRequestAction;
|
|
73
|
-
|
|
74
|
-
const primitiveActionTypes = [
|
|
75
|
-
'send-transaction',
|
|
76
|
-
'send-signed-transaction',
|
|
77
|
-
'verify-contract',
|
|
78
|
-
'static',
|
|
79
|
-
'create-contract',
|
|
80
|
-
'test-nicks-method',
|
|
81
|
-
'json-request',
|
|
82
|
-
] as const;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* A set of all built-in primitive action types.
|
|
86
|
-
* This is useful for efficiently checking if an action type is a primitive.
|
|
87
|
-
*/
|
|
88
|
-
export const PRIMITIVE_ACTION_TYPES = new Set<string>(primitiveActionTypes);
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* A type guard to check if a given action `type` corresponds to a primitive action.
|
|
92
|
-
* @param type The action type string.
|
|
93
|
-
* @returns `true` if the type is a primitive action type.
|
|
94
|
-
*/
|
|
95
|
-
export function isPrimitiveActionType(type: string): type is (typeof primitiveActionTypes)[number] {
|
|
96
|
-
return PRIMITIVE_ACTION_TYPES.has(type);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// --- Template Call Action ---
|
|
100
|
-
// In your YAML, using another template as an action is done by specifying its name
|
|
101
|
-
// in the 'type' field (e.g., `type: 'min-balance'`). This type captures that pattern.
|
|
102
|
-
|
|
103
|
-
export interface TemplateCallAction {
|
|
104
|
-
/**
|
|
105
|
-
* The name of the template to call, e.g., 'min-balance'.
|
|
106
|
-
* This property acts as a discriminator.
|
|
107
|
-
*/
|
|
108
|
-
type: string;
|
|
109
|
-
arguments: Record<string, Value<any>>;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* An Action is what appears in a `actions` array in your YAML.
|
|
114
|
-
* It's either a primitive action or a call to another template.
|
|
115
|
-
*
|
|
116
|
-
* The `type` field is used to discriminate. Your parser will need to have a list
|
|
117
|
-
* of known primitive action types (`send-transaction`, etc.) to distinguish them
|
|
118
|
-
* from template names.
|
|
119
|
-
*/
|
|
120
|
-
export type Action = (PrimitiveAction | TemplateCallAction) & {
|
|
121
|
-
/** An optional name for the action, allowing its outputs to be referenced. */
|
|
122
|
-
name?: string;
|
|
123
|
-
/** A list of conditions that, if any are met, will cause this action to be skipped. */
|
|
124
|
-
skip_condition?: Condition[];
|
|
125
|
-
/** A list of action names within the same job/template that must complete first. */
|
|
126
|
-
depends_on?: string[];
|
|
127
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export interface CompilerInfo {
|
|
2
|
-
version: string
|
|
3
|
-
// Future settings like optimizer runs can be added here
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export interface Artifact {
|
|
7
|
-
// --- Core Information ---
|
|
8
|
-
contractName: string
|
|
9
|
-
abi: any[]
|
|
10
|
-
bytecode: string // aka creationCode, initCode
|
|
11
|
-
|
|
12
|
-
// --- Optional Information for Verification & Debugging ---
|
|
13
|
-
deployedBytecode?: string // aka runtimeBytecode
|
|
14
|
-
sourceName?: string // e.g., "contracts/MyContract.sol"
|
|
15
|
-
source?: string // The full source code content for verification
|
|
16
|
-
compiler?: CompilerInfo
|
|
17
|
-
|
|
18
|
-
// --- Internal Management Properties (added by the loader) ---
|
|
19
|
-
_path: string // The absolute path to the artifact file
|
|
20
|
-
_hash: string // A hash of the artifact file's content (e.g., MD5)
|
|
21
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
export interface BuildInfoSource {
|
|
2
|
-
content?: string
|
|
3
|
-
urls?: string[]
|
|
4
|
-
keccak256?: string
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface BuildInfoInput {
|
|
8
|
-
language: string
|
|
9
|
-
sources: Record<string, BuildInfoSource>
|
|
10
|
-
settings: {
|
|
11
|
-
optimizer?: {
|
|
12
|
-
enabled: boolean
|
|
13
|
-
runs: number
|
|
14
|
-
}
|
|
15
|
-
evmVersion?: string
|
|
16
|
-
remappings?: string[]
|
|
17
|
-
viaIR?: boolean
|
|
18
|
-
libraries?: Record<string, Record<string, string>>
|
|
19
|
-
outputSelection: Record<string, Record<string, string[]>>
|
|
20
|
-
[key: string]: any
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface BuildInfoError {
|
|
25
|
-
component?: string
|
|
26
|
-
errorCode?: string
|
|
27
|
-
formattedMessage?: string
|
|
28
|
-
message?: string
|
|
29
|
-
severity?: 'error' | 'warning' | 'info'
|
|
30
|
-
sourceLocation?: {
|
|
31
|
-
file: string
|
|
32
|
-
start: number
|
|
33
|
-
end: number
|
|
34
|
-
}
|
|
35
|
-
type?: string
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface BuildInfoBytecode {
|
|
39
|
-
functionDebugData?: Record<string, any>
|
|
40
|
-
generatedSources?: any[]
|
|
41
|
-
linkReferences?: Record<string, Record<string, Array<{ length: number; start: number }>>>
|
|
42
|
-
object: string
|
|
43
|
-
opcodes?: string
|
|
44
|
-
sourceMap?: string
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface BuildInfoContract {
|
|
48
|
-
abi: any[]
|
|
49
|
-
metadata?: string
|
|
50
|
-
storageLayout?: {
|
|
51
|
-
storage: Array<{
|
|
52
|
-
astId: number
|
|
53
|
-
contract: string
|
|
54
|
-
label: string
|
|
55
|
-
offset: number
|
|
56
|
-
slot: string
|
|
57
|
-
type: string
|
|
58
|
-
}>
|
|
59
|
-
types: Record<string, {
|
|
60
|
-
encoding: string
|
|
61
|
-
label: string
|
|
62
|
-
numberOfBytes: string
|
|
63
|
-
[key: string]: any
|
|
64
|
-
}>
|
|
65
|
-
}
|
|
66
|
-
userdoc?: any
|
|
67
|
-
devdoc?: any
|
|
68
|
-
ir?: string
|
|
69
|
-
irOptimized?: string
|
|
70
|
-
evm: {
|
|
71
|
-
assembly?: string
|
|
72
|
-
legacyAssembly?: any
|
|
73
|
-
bytecode: BuildInfoBytecode
|
|
74
|
-
deployedBytecode: BuildInfoBytecode
|
|
75
|
-
methodIdentifiers?: Record<string, string>
|
|
76
|
-
gasEstimates?: any
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface BuildInfoOutput {
|
|
81
|
-
errors?: BuildInfoError[]
|
|
82
|
-
sources: Record<string, {
|
|
83
|
-
id: number
|
|
84
|
-
ast?: any
|
|
85
|
-
}>
|
|
86
|
-
contracts: Record<string, Record<string, BuildInfoContract>>
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export interface BuildInfo {
|
|
90
|
-
_format?: 'hh-sol-build-info-1' | 'ethers-rs-sol-build-info-1' // Optional for factory-style formats
|
|
91
|
-
id: string
|
|
92
|
-
solcVersion: string
|
|
93
|
-
solcLongVersion?: string // Optional for factory-style formats
|
|
94
|
-
input: BuildInfoInput
|
|
95
|
-
output: BuildInfoOutput
|
|
96
|
-
// Optional extension keys for zkSync/zkEVM
|
|
97
|
-
zksolcVersion?: string
|
|
98
|
-
eraVersion?: string
|
|
99
|
-
zkevmVersion?: string
|
|
100
|
-
[key: string]: any // Allow additional unknown keys for forward compatibility
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export interface ExtractedContract {
|
|
104
|
-
contractName: string
|
|
105
|
-
sourceName: string
|
|
106
|
-
fullyQualifiedName: string // e.g., "src/Counter.sol:Counter"
|
|
107
|
-
abi: any[]
|
|
108
|
-
bytecode: string
|
|
109
|
-
deployedBytecode?: string
|
|
110
|
-
source?: string
|
|
111
|
-
compiler: {
|
|
112
|
-
version: string
|
|
113
|
-
}
|
|
114
|
-
buildInfoId: string
|
|
115
|
-
buildInfoPath?: string
|
|
116
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { AddressValue, BooleanValue, ValueEmptyValue } from './values'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A condition that checks if a contract has code at a given address.
|
|
5
|
-
*/
|
|
6
|
-
export interface ContractExistsCondition {
|
|
7
|
-
type: 'contract-exists';
|
|
8
|
-
arguments: {
|
|
9
|
-
address: AddressValue;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function isContractExistsCondition(obj: any): obj is ContractExistsCondition {
|
|
14
|
-
return (
|
|
15
|
-
obj &&
|
|
16
|
-
typeof obj === 'object' &&
|
|
17
|
-
obj.type === 'contract-exists' &&
|
|
18
|
-
obj.arguments &&
|
|
19
|
-
typeof obj.arguments === 'object' &&
|
|
20
|
-
'address' in obj.arguments
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* A condition that checks if a dependency job has been successfully completed.
|
|
26
|
-
*/
|
|
27
|
-
export interface JobCompletedCondition {
|
|
28
|
-
type: 'job-completed';
|
|
29
|
-
arguments: {
|
|
30
|
-
job: string;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function isJobCompletedCondition(obj: any): obj is JobCompletedCondition {
|
|
35
|
-
return (
|
|
36
|
-
obj &&
|
|
37
|
-
typeof obj === 'object' &&
|
|
38
|
-
obj.type === 'job-completed' &&
|
|
39
|
-
obj.arguments &&
|
|
40
|
-
typeof obj.arguments === 'object' &&
|
|
41
|
-
typeof obj.arguments.job === 'string'
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* A condition is something that resolves to a boolean. It can be a specific
|
|
47
|
-
* check type like 'contract-exists', or any ValueResolver that produces a
|
|
48
|
-
* boolean result (e.g., `basic-arithmetic` with an 'eq' operation).
|
|
49
|
-
*/
|
|
50
|
-
export type Condition = BooleanValue | ContractExistsCondition | JobCompletedCondition | ValueEmptyValue;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { CompilerInfo } from './artifacts'
|
|
2
|
-
|
|
3
|
-
export interface Contract {
|
|
4
|
-
// The ultimate, unambiguous identifier
|
|
5
|
-
uniqueHash: string
|
|
6
|
-
|
|
7
|
-
// Core Information - Only creationCode is truly required
|
|
8
|
-
creationCode: string
|
|
9
|
-
runtimeBytecode?: string
|
|
10
|
-
abi?: any[]
|
|
11
|
-
|
|
12
|
-
// Source Information
|
|
13
|
-
sourceName?: string // e.g., "contracts/MyToken.sol"
|
|
14
|
-
contractName?: string
|
|
15
|
-
source?: string // The full source code
|
|
16
|
-
|
|
17
|
-
// Compilation Information
|
|
18
|
-
compiler?: CompilerInfo
|
|
19
|
-
buildInfoId?: string // The ID from the build-info file it was found in
|
|
20
|
-
|
|
21
|
-
// Internal Management - tracks all file paths from which this contract's data was hydrated
|
|
22
|
-
_sources: Set<string>
|
|
23
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Action } from './actions'
|
|
2
|
-
import { Condition } from './conditions'
|
|
3
|
-
import { Value } from './values'
|
|
4
|
-
|
|
5
|
-
// --- Template Definition ---
|
|
6
|
-
|
|
7
|
-
export interface TemplateArgument {
|
|
8
|
-
type: string; // e.g., 'address', 'bytes32', 'uint256'
|
|
9
|
-
description?: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface Template {
|
|
13
|
-
/** Optional discriminator to explicitly mark this document as a template */
|
|
14
|
-
type?: 'template';
|
|
15
|
-
name: string;
|
|
16
|
-
description?: string;
|
|
17
|
-
arguments?: Record<string, TemplateArgument>;
|
|
18
|
-
returns?: Record<string, TemplateArgument>;
|
|
19
|
-
setup?: {
|
|
20
|
-
skip_condition?: Condition[];
|
|
21
|
-
actions?: Action[];
|
|
22
|
-
};
|
|
23
|
-
actions: Action[];
|
|
24
|
-
skip_condition?: Condition[];
|
|
25
|
-
outputs?: Record<string, Value<any>>;
|
|
26
|
-
_path?: string; // Path to the template file for relative artifact resolution
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// --- Job Definition ---
|
|
30
|
-
|
|
31
|
-
export interface JobAction {
|
|
32
|
-
name: string; // Unique name for this action within the job
|
|
33
|
-
template?: string; // Name of the template to use (for template actions)
|
|
34
|
-
type?: string; // Type of primitive action (for primitive actions)
|
|
35
|
-
arguments: Record<string, Value<any>>;
|
|
36
|
-
skip_condition?: Condition[];
|
|
37
|
-
depends_on?: string[];
|
|
38
|
-
/**
|
|
39
|
-
* Output selection/override for this action when writing job outputs.
|
|
40
|
-
* - boolean: legacy flag. true marks the whole action for inclusion, false excludes.
|
|
41
|
-
* - object: custom output map. Keys become output keys under this action's name,
|
|
42
|
-
* values are Value<any> that will be resolved at job time, overriding template outputs.
|
|
43
|
-
*/
|
|
44
|
-
output?: boolean | Record<string, Value<any>>;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface Job {
|
|
48
|
-
name: string;
|
|
49
|
-
version: string;
|
|
50
|
-
description?: string;
|
|
51
|
-
depends_on?: string[]; // Names of other jobs this job depends on
|
|
52
|
-
actions: JobAction[];
|
|
53
|
-
only_networks?: number[]
|
|
54
|
-
skip_networks?: number[]
|
|
55
|
-
/** Minimum EVM hardfork required to run this job (e.g. "london", "paris", "shanghai", "cancun") */
|
|
56
|
-
min_evm_version?: string
|
|
57
|
-
skip_condition?: Condition[];
|
|
58
|
-
constants?: Record<string, Value<any>>; // Optional job-level constants
|
|
59
|
-
deprecated?: boolean; // Optional flag to mark the job as deprecated
|
|
60
|
-
_path?: string; // Path to the job file for relative artifact resolution
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// --- Constants Definition (top-level documents) ---
|
|
64
|
-
|
|
65
|
-
export interface ConstantsDocument {
|
|
66
|
-
type: 'constants';
|
|
67
|
-
name?: string;
|
|
68
|
-
constants: Record<string, Value<any>>;
|
|
69
|
-
_path?: string; // Source file path
|
|
70
|
-
}
|
package/src/lib/types/index.ts
DELETED
package/src/lib/types/network.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents a blockchain network configuration
|
|
3
|
-
*/
|
|
4
|
-
export interface Network {
|
|
5
|
-
/** The human-readable name of the network */
|
|
6
|
-
name: string
|
|
7
|
-
|
|
8
|
-
/** The chain ID of the network */
|
|
9
|
-
chainId: number
|
|
10
|
-
|
|
11
|
-
/** The RPC URL endpoint for the network */
|
|
12
|
-
rpcUrl: string
|
|
13
|
-
|
|
14
|
-
/** Supported verification platforms */
|
|
15
|
-
supports?: string[]
|
|
16
|
-
|
|
17
|
-
/** Optional gas limit to use for all transactions on this network */
|
|
18
|
-
gasLimit?: number
|
|
19
|
-
|
|
20
|
-
/** Whether this is a test network */
|
|
21
|
-
testnet?: boolean
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* The EVM hardfork version supported by this network, e.g. "istanbul", "berlin", "london",
|
|
25
|
-
* "paris", "shanghai", "cancun". Used to filter jobs that require a minimum EVM version.
|
|
26
|
-
*/
|
|
27
|
-
evmVersion?: string
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Integrator-owned metadata bag. Keys are not validated by Catapult.
|
|
31
|
-
*/
|
|
32
|
-
params?: Record<string, unknown>
|
|
33
|
-
}
|
package/src/lib/types/project.ts
DELETED
package/src/lib/types/task.ts
DELETED
package/src/lib/types/values.ts
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents a reference to another value in the scope, e.g., "{{var.name}}".
|
|
3
|
-
* The parser will be responsible for resolving this string into a concrete value.
|
|
4
|
-
*/
|
|
5
|
-
export type Reference = string;
|
|
6
|
-
|
|
7
|
-
// --- Value Resolver Types ---
|
|
8
|
-
// These are declarative objects that describe how to compute a value at runtime.
|
|
9
|
-
|
|
10
|
-
export interface AbiEncodeValue {
|
|
11
|
-
type: 'abi-encode';
|
|
12
|
-
arguments: {
|
|
13
|
-
signature: Value<string>;
|
|
14
|
-
values: Value<any>[];
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface AbiPackValue {
|
|
19
|
-
type: 'abi-pack';
|
|
20
|
-
arguments: {
|
|
21
|
-
types: Value<string>[];
|
|
22
|
-
values: Value<any>[];
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface ConstructorEncodeValue {
|
|
27
|
-
type: 'constructor-encode';
|
|
28
|
-
arguments: {
|
|
29
|
-
creationCode?: Value<string>;
|
|
30
|
-
types: Value<string>[];
|
|
31
|
-
values: Value<any>[];
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface ComputeCreateValue {
|
|
36
|
-
type: 'compute-create';
|
|
37
|
-
arguments: {
|
|
38
|
-
deployerAddress: AddressValue;
|
|
39
|
-
nonce: Uint256Value;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface ComputeCreate2Value {
|
|
44
|
-
type: 'compute-create2';
|
|
45
|
-
arguments: {
|
|
46
|
-
deployerAddress: AddressValue;
|
|
47
|
-
salt: BytesValue;
|
|
48
|
-
initCode: BytesValue;
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface ReadBalanceValue {
|
|
53
|
-
type: 'read-balance';
|
|
54
|
-
arguments: {
|
|
55
|
-
address: AddressValue;
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface BasicArithmeticValue {
|
|
60
|
-
type: 'basic-arithmetic';
|
|
61
|
-
arguments: {
|
|
62
|
-
operation: 'add' | 'sub' | 'mul' | 'div' | 'eq' | 'neq' | 'gt' | 'lt' | 'gte' | 'lte';
|
|
63
|
-
values: Value<any>[];
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface CallValue {
|
|
68
|
-
type: 'call';
|
|
69
|
-
arguments: {
|
|
70
|
-
to?: AddressValue; // Optional, can be inferred from context by the parser
|
|
71
|
-
signature: Value<string>;
|
|
72
|
-
values: Value<any>[];
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export interface ContractExistsValue {
|
|
77
|
-
type: 'contract-exists';
|
|
78
|
-
arguments: {
|
|
79
|
-
address: AddressValue;
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export interface JobCompletedValue {
|
|
84
|
-
type: 'job-completed';
|
|
85
|
-
arguments: {
|
|
86
|
-
job: Value<string>;
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export interface ReadJsonValue {
|
|
91
|
-
type: 'read-json';
|
|
92
|
-
arguments: {
|
|
93
|
-
json: Value<any>; // The JSON object to read from
|
|
94
|
-
path: Value<string | number>; // The path to the value (e.g., "txs.data", 1, or "user.profile.name")
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export interface ResolveJsonValue {
|
|
99
|
-
type: 'resolve-json';
|
|
100
|
-
arguments: Value<any>;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export interface ValueEmptyValue {
|
|
104
|
-
type: 'value-empty';
|
|
105
|
-
arguments: {
|
|
106
|
-
value: Value<any>;
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export interface SliceBytesValue {
|
|
111
|
-
type: 'slice-bytes';
|
|
112
|
-
arguments: {
|
|
113
|
-
value: BytesValue;
|
|
114
|
-
start?: Value<number | string>;
|
|
115
|
-
end?: Value<number | string>;
|
|
116
|
-
range?: Value<string>;
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* A union of all possible value-resolver objects.
|
|
122
|
-
*/
|
|
123
|
-
export type ValueResolver =
|
|
124
|
-
| AbiEncodeValue
|
|
125
|
-
| AbiPackValue
|
|
126
|
-
| ConstructorEncodeValue
|
|
127
|
-
| ComputeCreateValue
|
|
128
|
-
| ComputeCreate2Value
|
|
129
|
-
| ReadBalanceValue
|
|
130
|
-
| BasicArithmeticValue
|
|
131
|
-
| CallValue
|
|
132
|
-
| ContractExistsValue
|
|
133
|
-
| JobCompletedValue
|
|
134
|
-
| ReadJsonValue
|
|
135
|
-
| ResolveJsonValue
|
|
136
|
-
| ValueEmptyValue
|
|
137
|
-
| SliceBytesValue;
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* A generic value type that can be a primitive literal (string, number, boolean),
|
|
141
|
-
* a reference to another value, or a value-resolver object.
|
|
142
|
-
* This accurately models the flexibility of your YAML arguments.
|
|
143
|
-
*/
|
|
144
|
-
export type Value<T = string | number | boolean> = T | Reference | ValueResolver;
|
|
145
|
-
|
|
146
|
-
// --- Specific Value Types for clarity and type-safety ---
|
|
147
|
-
export type BytesValue = Value<string>;
|
|
148
|
-
export type AddressValue = Value<string>;
|
|
149
|
-
export type Uint256Value = Value<string | number>;
|
|
150
|
-
export type BooleanValue = Value<boolean>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ethers } from "ethers";
|
|
2
|
-
|
|
3
|
-
export function isAddress(value: unknown): value is string {
|
|
4
|
-
return ethers.isAddress(value)
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export function isBytesLike(value: unknown): value is string {
|
|
8
|
-
return ethers.isBytesLike(value)
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function isBigNumberish(value: unknown): value is string | number | bigint {
|
|
12
|
-
try {
|
|
13
|
-
switch (typeof(value)) {
|
|
14
|
-
case "bigint":
|
|
15
|
-
case "number":
|
|
16
|
-
case "string":
|
|
17
|
-
ethers.toBigInt(value)
|
|
18
|
-
return true
|
|
19
|
-
}
|
|
20
|
-
} catch (error) {
|
|
21
|
-
// Fail out
|
|
22
|
-
}
|
|
23
|
-
return false
|
|
24
|
-
}
|