@0xsequence/catapult 1.3.17 → 1.4.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 +249 -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__/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 +383 -0
- package/dist/lib/core/__tests__/resolver.spec.js.map +1 -1
- package/dist/lib/core/engine.d.ts.map +1 -1
- package/dist/lib/core/engine.js +33 -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/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 +121 -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 +645 -0
- package/dist/lib/provenance.js.map +1 -0
- package/dist/lib/types/actions.d.ts +18 -2
- package/dist/lib/types/actions.d.ts.map +1 -1
- package/dist/lib/types/actions.js +1 -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 +24 -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 +1 -1
- package/src/cli.ts +3 -2
- package/src/commands/index.ts +2 -1
- package/src/commands/list.ts +14 -1
- package/src/commands/provenance.ts +120 -0
- package/src/lib/__tests__/deployer.spec.ts +177 -1
- package/src/lib/__tests__/provenance.spec.ts +208 -0
- package/src/lib/contracts/__tests__/repository.spec.ts +270 -2
- package/src/lib/contracts/repository.ts +112 -14
- package/src/lib/core/__tests__/assert-action.spec.ts +474 -0
- package/src/lib/core/__tests__/engine.spec.ts +116 -0
- package/src/lib/core/__tests__/loader.spec.ts +34 -1
- package/src/lib/core/__tests__/resolver.spec.ts +444 -1
- package/src/lib/core/engine.ts +52 -0
- package/src/lib/core/loader.ts +8 -2
- package/src/lib/core/resolver.ts +116 -0
- package/src/lib/deployer.ts +28 -4
- package/src/lib/index.ts +4 -1
- package/src/lib/parsers/__tests__/job.spec.ts +81 -0
- package/src/lib/parsers/__tests__/source.spec.ts +134 -0
- package/src/lib/parsers/index.ts +1 -0
- package/src/lib/parsers/job.ts +14 -2
- package/src/lib/parsers/source.ts +129 -0
- package/src/lib/provenance.ts +785 -0
- package/src/lib/types/actions.ts +22 -1
- package/src/lib/types/contracts.ts +4 -1
- package/src/lib/types/definitions.ts +7 -0
- package/src/lib/types/index.ts +1 -0
- package/src/lib/types/source.ts +26 -0
- package/src/lib/types/values.ts +71 -0
package/src/lib/types/actions.ts
CHANGED
|
@@ -68,8 +68,28 @@ export interface JsonRequestAction {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
export interface AssertAction {
|
|
72
|
+
type: 'assert';
|
|
73
|
+
arguments: {
|
|
74
|
+
/** Source of the ACTUAL value: either `to`+`signature` (eth_call) or `actual` (a value). */
|
|
75
|
+
to?: AddressValue;
|
|
76
|
+
signature?: string;
|
|
77
|
+
values?: any[];
|
|
78
|
+
actual?: Value<any>;
|
|
79
|
+
/** Exactly one comparator key whose value is the EXPECTED value. */
|
|
80
|
+
eq?: Value<any>;
|
|
81
|
+
neq?: Value<any>;
|
|
82
|
+
gt?: Value<any>;
|
|
83
|
+
lt?: Value<any>;
|
|
84
|
+
gte?: Value<any>;
|
|
85
|
+
lte?: Value<any>;
|
|
86
|
+
/** Optional message for the error. */
|
|
87
|
+
message?: string;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
71
91
|
// A union of all primitive action types.
|
|
72
|
-
export type PrimitiveAction = SendTransactionAction | SendSignedTransactionAction | VerifyContractAction | StaticAction | CreateContractAction | TestNicksMethodAction | JsonRequestAction;
|
|
92
|
+
export type PrimitiveAction = SendTransactionAction | SendSignedTransactionAction | VerifyContractAction | StaticAction | CreateContractAction | TestNicksMethodAction | JsonRequestAction | AssertAction;
|
|
73
93
|
|
|
74
94
|
const primitiveActionTypes = [
|
|
75
95
|
'send-transaction',
|
|
@@ -79,6 +99,7 @@ const primitiveActionTypes = [
|
|
|
79
99
|
'create-contract',
|
|
80
100
|
'test-nicks-method',
|
|
81
101
|
'json-request',
|
|
102
|
+
'assert',
|
|
82
103
|
] as const;
|
|
83
104
|
|
|
84
105
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CompilerInfo } from './artifacts'
|
|
2
|
+
import { SourceProvenance } from './source'
|
|
2
3
|
|
|
3
4
|
export interface Contract {
|
|
4
5
|
// The ultimate, unambiguous identifier
|
|
@@ -17,7 +18,9 @@ export interface Contract {
|
|
|
17
18
|
// Compilation Information
|
|
18
19
|
compiler?: CompilerInfo
|
|
19
20
|
buildInfoId?: string // The ID from the build-info file it was found in
|
|
21
|
+
sourceProvenance?: SourceProvenance // Repository/ref/build metadata for the preferred build-info source
|
|
20
22
|
|
|
21
23
|
// Internal Management - tracks all file paths from which this contract's data was hydrated
|
|
22
24
|
_sources: Set<string>
|
|
23
|
-
|
|
25
|
+
_sourceProvenance?: Map<string, SourceProvenance>
|
|
26
|
+
}
|
|
@@ -55,6 +55,13 @@ export interface Job {
|
|
|
55
55
|
/** Minimum EVM hardfork required to run this job (e.g. "london", "paris", "shanghai", "cancun") */
|
|
56
56
|
min_evm_version?: string
|
|
57
57
|
skip_condition?: Condition[];
|
|
58
|
+
/**
|
|
59
|
+
* Pure gate conditions: if ANY condition is true, the job is skipped BEFORE execution.
|
|
60
|
+
* Unlike skip_condition, these are NOT post-execution-checked. Use this for jobs that
|
|
61
|
+
* generate artifacts (e.g., Safe/multisig transaction payloads) and should skip when
|
|
62
|
+
* already in desired state, without requiring convergence within the run.
|
|
63
|
+
*/
|
|
64
|
+
skip_if?: Condition[];
|
|
58
65
|
constants?: Record<string, Value<any>>; // Optional job-level constants
|
|
59
66
|
deprecated?: boolean; // Optional flag to mark the job as deprecated
|
|
60
67
|
_path?: string; // Path to the job file for relative artifact resolution
|
package/src/lib/types/index.ts
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface SourceProvenance {
|
|
2
|
+
repo: string
|
|
3
|
+
ref?: string
|
|
4
|
+
commit?: string
|
|
5
|
+
build?: string
|
|
6
|
+
sourceDocumentPath?: string
|
|
7
|
+
buildInfoPath?: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface SourceProvenanceOverride {
|
|
11
|
+
repo?: string
|
|
12
|
+
ref?: string
|
|
13
|
+
commit?: string
|
|
14
|
+
build?: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface BuildInfoSourceProvenance extends SourceProvenance {
|
|
18
|
+
contracts?: Record<string, SourceProvenanceOverride>
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface SourceDocument {
|
|
22
|
+
type: 'source'
|
|
23
|
+
build_info: Record<string, BuildInfoSourceProvenance>
|
|
24
|
+
warnings?: string[]
|
|
25
|
+
_path?: string
|
|
26
|
+
}
|
package/src/lib/types/values.ts
CHANGED
|
@@ -56,6 +56,75 @@ export interface ReadBalanceValue {
|
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
export interface GetStorageAtValue {
|
|
60
|
+
type: 'get-storage-at';
|
|
61
|
+
arguments: {
|
|
62
|
+
address: AddressValue;
|
|
63
|
+
slot: Value<string | number>;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Computes EVM storage slots for common Solidity storage layouts.
|
|
69
|
+
*
|
|
70
|
+
* The result is always returned as a 32-byte, 0x-prefixed lowercase hex string,
|
|
71
|
+
* so it can be fed directly into `get-storage-at` or nested as the `slot` of
|
|
72
|
+
* another `compute-slot` (e.g. for nested mappings).
|
|
73
|
+
*/
|
|
74
|
+
export type ComputeSlotArguments =
|
|
75
|
+
| {
|
|
76
|
+
/** Value at `mapping[key]`: keccak256(h(key) . slot). */
|
|
77
|
+
kind: 'mapping';
|
|
78
|
+
/** Declaration slot of the mapping. */
|
|
79
|
+
slot: Value<string | number>;
|
|
80
|
+
/** The mapping key. */
|
|
81
|
+
key: Value<string | number | boolean>;
|
|
82
|
+
/**
|
|
83
|
+
* Solidity type of the key, used to encode it (default: "uint256").
|
|
84
|
+
* Value types (address, uint*, int*, bytes32, bool, ...) are ABI-encoded
|
|
85
|
+
* and left-padded; dynamic types ("string", "bytes") are packed.
|
|
86
|
+
*/
|
|
87
|
+
keyType?: Value<string>;
|
|
88
|
+
}
|
|
89
|
+
| {
|
|
90
|
+
/** Element of a dynamic array: keccak256(slot) + index * elementSize. */
|
|
91
|
+
kind: 'dynamic-array';
|
|
92
|
+
/** Declaration slot of the array (also where its length lives). */
|
|
93
|
+
slot: Value<string | number>;
|
|
94
|
+
/** Element index (default: 0). */
|
|
95
|
+
index?: Value<string | number>;
|
|
96
|
+
/** Number of slots each element occupies (default: 1). */
|
|
97
|
+
elementSize?: Value<string | number>;
|
|
98
|
+
}
|
|
99
|
+
| {
|
|
100
|
+
/** Field of a struct or fixed-size array element: slot + offset. */
|
|
101
|
+
kind: 'struct-field';
|
|
102
|
+
/** Base slot of the struct / array element. */
|
|
103
|
+
slot: Value<string | number>;
|
|
104
|
+
/** Field offset in slots from the base. */
|
|
105
|
+
offset: Value<string | number>;
|
|
106
|
+
}
|
|
107
|
+
| {
|
|
108
|
+
/**
|
|
109
|
+
* ERC-7201 namespaced storage root:
|
|
110
|
+
* keccak256(abi.encode(uint256(keccak256(id)) - 1)) & ~bytes32(uint256(0xff)).
|
|
111
|
+
*/
|
|
112
|
+
kind: 'erc7201';
|
|
113
|
+
/** The namespace id, e.g. "openzeppelin.storage.Ownable". */
|
|
114
|
+
id: Value<string>;
|
|
115
|
+
}
|
|
116
|
+
| {
|
|
117
|
+
/** Well-known EIP-1967 proxy slot: keccak256("eip1967.proxy.<name>") - 1. */
|
|
118
|
+
kind: 'eip1967';
|
|
119
|
+
/** Which proxy slot to compute. */
|
|
120
|
+
name: Value<'implementation' | 'admin' | 'beacon'>;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export interface ComputeSlotValue {
|
|
124
|
+
type: 'compute-slot';
|
|
125
|
+
arguments: ComputeSlotArguments;
|
|
126
|
+
}
|
|
127
|
+
|
|
59
128
|
export interface BasicArithmeticValue {
|
|
60
129
|
type: 'basic-arithmetic';
|
|
61
130
|
arguments: {
|
|
@@ -127,6 +196,8 @@ export type ValueResolver =
|
|
|
127
196
|
| ComputeCreateValue
|
|
128
197
|
| ComputeCreate2Value
|
|
129
198
|
| ReadBalanceValue
|
|
199
|
+
| GetStorageAtValue
|
|
200
|
+
| ComputeSlotValue
|
|
130
201
|
| BasicArithmeticValue
|
|
131
202
|
| CallValue
|
|
132
203
|
| ContractExistsValue
|