sol-dbg 0.7.17 → 0.8.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/dist/debug/abi.d.ts +10 -3
- package/dist/debug/abi.d.ts.map +1 -1
- package/dist/debug/abi.js +5 -4
- package/dist/debug/abi.js.map +1 -1
- package/dist/debug/decoding/calldata/view.d.ts +15 -16
- package/dist/debug/decoding/calldata/view.d.ts.map +1 -1
- package/dist/debug/decoding/calldata/view.js +47 -47
- package/dist/debug/decoding/calldata/view.js.map +1 -1
- package/dist/debug/decoding/index.d.ts +1 -2
- package/dist/debug/decoding/index.d.ts.map +1 -1
- package/dist/debug/decoding/index.js +2 -2
- package/dist/debug/decoding/index.js.map +1 -1
- package/dist/debug/decoding/memory/view.d.ts +14 -15
- package/dist/debug/decoding/memory/view.d.ts.map +1 -1
- package/dist/debug/decoding/memory/view.js +27 -27
- package/dist/debug/decoding/memory/view.js.map +1 -1
- package/dist/debug/decoding/stack/view.d.ts +4 -4
- package/dist/debug/decoding/stack/view.d.ts.map +1 -1
- package/dist/debug/decoding/stack/view.js +20 -19
- package/dist/debug/decoding/stack/view.js.map +1 -1
- package/dist/debug/decoding/storage/view.d.ts +18 -19
- package/dist/debug/decoding/storage/view.d.ts.map +1 -1
- package/dist/debug/decoding/storage/view.js +67 -65
- package/dist/debug/decoding/storage/view.js.map +1 -1
- package/dist/debug/decoding/utils.d.ts +20 -2
- package/dist/debug/decoding/utils.d.ts.map +1 -1
- package/dist/debug/decoding/utils.js +119 -3
- package/dist/debug/decoding/utils.js.map +1 -1
- package/dist/debug/decoding/view.d.ts +2 -2
- package/dist/debug/decoding/view.d.ts.map +1 -1
- package/dist/debug/index.d.ts +1 -0
- package/dist/debug/index.d.ts.map +1 -1
- package/dist/debug/index.js +1 -0
- package/dist/debug/index.js.map +1 -1
- package/dist/debug/layout.d.ts.map +1 -1
- package/dist/debug/layout.js +2 -1
- package/dist/debug/layout.js.map +1 -1
- package/dist/debug/runtime_types/ast/address_type.d.ts +5 -0
- package/dist/debug/runtime_types/ast/address_type.d.ts.map +1 -0
- package/dist/debug/runtime_types/ast/address_type.js +11 -0
- package/dist/debug/runtime_types/ast/address_type.js.map +1 -0
- package/dist/debug/runtime_types/ast/array_type.d.ts +8 -0
- package/dist/debug/runtime_types/ast/array_type.d.ts.map +1 -0
- package/dist/debug/runtime_types/ast/array_type.js +16 -0
- package/dist/debug/runtime_types/ast/array_type.js.map +1 -0
- package/dist/debug/runtime_types/ast/base_type.d.ts +16 -0
- package/dist/debug/runtime_types/ast/base_type.d.ts.map +1 -0
- package/dist/debug/runtime_types/ast/base_type.js +19 -0
- package/dist/debug/runtime_types/ast/base_type.js.map +1 -0
- package/dist/debug/runtime_types/ast/bool_type.d.ts +5 -0
- package/dist/debug/runtime_types/ast/bool_type.d.ts.map +1 -0
- package/dist/debug/runtime_types/ast/bool_type.js +11 -0
- package/dist/debug/runtime_types/ast/bool_type.js.map +1 -0
- package/dist/debug/runtime_types/ast/bytes_type.d.ts +5 -0
- package/dist/debug/runtime_types/ast/bytes_type.d.ts.map +1 -0
- package/dist/debug/runtime_types/ast/bytes_type.js +11 -0
- package/dist/debug/runtime_types/ast/bytes_type.js.map +1 -0
- package/dist/debug/runtime_types/ast/fixed_bytes_type.d.ts +7 -0
- package/dist/debug/runtime_types/ast/fixed_bytes_type.d.ts.map +1 -0
- package/dist/debug/runtime_types/ast/fixed_bytes_type.js +15 -0
- package/dist/debug/runtime_types/ast/fixed_bytes_type.js.map +1 -0
- package/dist/debug/runtime_types/ast/function_type.d.ts +11 -0
- package/dist/debug/runtime_types/ast/function_type.d.ts.map +1 -0
- package/dist/debug/runtime_types/ast/function_type.js +22 -0
- package/dist/debug/runtime_types/ast/function_type.js.map +1 -0
- package/dist/debug/runtime_types/ast/index.d.ts +16 -0
- package/dist/debug/runtime_types/ast/index.d.ts.map +1 -0
- package/dist/debug/runtime_types/ast/index.js +32 -0
- package/dist/debug/runtime_types/ast/index.js.map +1 -0
- package/dist/debug/runtime_types/ast/int_type.d.ts +10 -0
- package/dist/debug/runtime_types/ast/int_type.d.ts.map +1 -0
- package/dist/debug/runtime_types/ast/int_type.js +24 -0
- package/dist/debug/runtime_types/ast/int_type.js.map +1 -0
- package/dist/debug/runtime_types/ast/mapping_type.d.ts +8 -0
- package/dist/debug/runtime_types/ast/mapping_type.d.ts.map +1 -0
- package/dist/debug/runtime_types/ast/mapping_type.js +16 -0
- package/dist/debug/runtime_types/ast/mapping_type.js.map +1 -0
- package/dist/debug/runtime_types/ast/missing_type.d.ts +11 -0
- package/dist/debug/runtime_types/ast/missing_type.d.ts.map +1 -0
- package/dist/debug/runtime_types/ast/missing_type.js +19 -0
- package/dist/debug/runtime_types/ast/missing_type.js.map +1 -0
- package/dist/debug/runtime_types/ast/pointer_type.d.ts +9 -0
- package/dist/debug/runtime_types/ast/pointer_type.d.ts.map +1 -0
- package/dist/debug/runtime_types/ast/pointer_type.js +51 -0
- package/dist/debug/runtime_types/ast/pointer_type.js.map +1 -0
- package/dist/debug/runtime_types/ast/string_type.d.ts +5 -0
- package/dist/debug/runtime_types/ast/string_type.d.ts.map +1 -0
- package/dist/debug/runtime_types/ast/string_type.js +11 -0
- package/dist/debug/runtime_types/ast/string_type.js.map +1 -0
- package/dist/debug/runtime_types/ast/struct_type.d.ts +8 -0
- package/dist/debug/runtime_types/ast/struct_type.d.ts.map +1 -0
- package/dist/debug/runtime_types/ast/struct_type.js +16 -0
- package/dist/debug/runtime_types/ast/struct_type.js.map +1 -0
- package/dist/debug/runtime_types/ast/tuple_type.d.ts +7 -0
- package/dist/debug/runtime_types/ast/tuple_type.d.ts.map +1 -0
- package/dist/debug/runtime_types/ast/tuple_type.js +15 -0
- package/dist/debug/runtime_types/ast/tuple_type.js.map +1 -0
- package/dist/debug/runtime_types/ast/type_type.d.ts +12 -0
- package/dist/debug/runtime_types/ast/type_type.d.ts.map +1 -0
- package/dist/debug/runtime_types/ast/type_type.js +19 -0
- package/dist/debug/runtime_types/ast/type_type.js.map +1 -0
- package/dist/debug/runtime_types/index.d.ts +3 -0
- package/dist/debug/runtime_types/index.d.ts.map +1 -0
- package/dist/debug/runtime_types/index.js +19 -0
- package/dist/debug/runtime_types/index.js.map +1 -0
- package/dist/debug/runtime_types/utils.d.ts +32 -0
- package/dist/debug/runtime_types/utils.d.ts.map +1 -0
- package/dist/debug/runtime_types/utils.js +213 -0
- package/dist/debug/runtime_types/utils.js.map +1 -0
- package/dist/debug/tracers/transformers/int_stack.d.ts.map +1 -1
- package/dist/debug/tracers/transformers/int_stack.js +4 -2
- package/dist/debug/tracers/transformers/int_stack.js.map +1 -1
- package/dist/debug/tracers/transformers/ret_info.js +2 -2
- package/dist/debug/tracers/transformers/ret_info.js.map +1 -1
- package/dist/utils/misc.d.ts +3 -1
- package/dist/utils/misc.d.ts.map +1 -1
- package/dist/utils/misc.js +11 -9
- package/dist/utils/misc.js.map +1 -1
- package/dist/utils/pp.d.ts.map +1 -1
- package/dist/utils/pp.js +13 -12
- package/dist/utils/pp.js.map +1 -1
- package/dist/utils/solidity.d.ts +1 -0
- package/dist/utils/solidity.d.ts.map +1 -1
- package/dist/utils/solidity.js +8 -0
- package/dist/utils/solidity.js.map +1 -1
- package/package.json +1 -1
- package/dist/debug/decoding/exp_types.d.ts +0 -46
- package/dist/debug/decoding/exp_types.d.ts.map +0 -1
- package/dist/debug/decoding/exp_types.js +0 -202
- package/dist/debug/decoding/exp_types.js.map +0 -1
|
@@ -1,4 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.isCalldataArrayType = isCalldataArrayType;
|
|
4
37
|
exports.inRange = inRange;
|
|
@@ -8,16 +41,22 @@ exports.isTypeStringMapping = isTypeStringMapping;
|
|
|
8
41
|
exports.isTypeStringStruct = isTypeStringStruct;
|
|
9
42
|
exports.isTypeStringStatic32BytesInStorage = isTypeStringStatic32BytesInStorage;
|
|
10
43
|
exports.isPointerView = isPointerView;
|
|
44
|
+
exports.getContractLayoutType = getContractLayoutType;
|
|
11
45
|
const solc_typed_ast_1 = require("solc-typed-ast");
|
|
12
46
|
const value_1 = require("./value");
|
|
13
47
|
const calldata_1 = require("./calldata");
|
|
14
48
|
const memory_1 = require("./memory");
|
|
15
49
|
const storage_1 = require("./storage");
|
|
16
50
|
const stack_1 = require("./stack");
|
|
51
|
+
const runtime_types_1 = require("../runtime_types");
|
|
52
|
+
const sol = __importStar(require("solc-typed-ast"));
|
|
53
|
+
const rtt = __importStar(require("../runtime_types/ast"));
|
|
54
|
+
const utils_1 = require("../../utils");
|
|
17
55
|
function isCalldataArrayType(typ) {
|
|
18
|
-
return (typ instanceof
|
|
19
|
-
((typ.
|
|
20
|
-
typ.
|
|
56
|
+
return (typ instanceof runtime_types_1.PointerType &&
|
|
57
|
+
((typ.toType instanceof runtime_types_1.ArrayType && typ.toType.size === undefined) ||
|
|
58
|
+
typ.toType instanceof runtime_types_1.BytesType ||
|
|
59
|
+
typ.toType instanceof runtime_types_1.StringType) &&
|
|
21
60
|
typ.location === solc_typed_ast_1.DataLocation.CallData);
|
|
22
61
|
}
|
|
23
62
|
/**
|
|
@@ -51,4 +90,81 @@ function isPointerView(v) {
|
|
|
51
90
|
v instanceof storage_1.PointerStorageView ||
|
|
52
91
|
v instanceof stack_1.PointerStackView);
|
|
53
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Helper for converting `VariableDeclartaion`s to `TypeNode`s. In some cases when solc-typed-ast conversion fails,
|
|
95
|
+
* it can try and guess the correct simplified type from the typeString
|
|
96
|
+
*
|
|
97
|
+
* - unknown contracts - retun address
|
|
98
|
+
*/
|
|
99
|
+
function variableDeclarationToTypeNode(v, infer) {
|
|
100
|
+
try {
|
|
101
|
+
return infer.variableDeclarationToTypeNode(v);
|
|
102
|
+
}
|
|
103
|
+
catch (e) {
|
|
104
|
+
if (v.vType && (0, utils_1.isTypeUnknownContract)(v.vType)) {
|
|
105
|
+
return new sol.AddressType(false);
|
|
106
|
+
}
|
|
107
|
+
throw e;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Given a `ContractDefinition` try and compute an `ExpStructType` struct that
|
|
112
|
+
* describes the layout of the class. This takes into account all base classes,
|
|
113
|
+
* and simplifies types using `simplifyType`.
|
|
114
|
+
*
|
|
115
|
+
* Since we may be missing AST information for some user-defined types, or even
|
|
116
|
+
* entire bases, the layout may be partial. It may be only up to a given base,
|
|
117
|
+
* and it may be missing exact type information for certain fields.
|
|
118
|
+
*
|
|
119
|
+
* We return a tuple with the resulting layout, and a boolean specifying whether
|
|
120
|
+
* the layout is complete.
|
|
121
|
+
*
|
|
122
|
+
* @param def
|
|
123
|
+
* @param infer
|
|
124
|
+
*/
|
|
125
|
+
function getContractLayoutType(contract, infer) {
|
|
126
|
+
const stateVars = [];
|
|
127
|
+
let complete = true;
|
|
128
|
+
for (const base of [...contract.vLinearizedBaseContracts].reverse()) {
|
|
129
|
+
if (base === null || base === undefined) {
|
|
130
|
+
complete = false;
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
for (const varDecl of base.vStateVariables) {
|
|
134
|
+
// Not part of layout
|
|
135
|
+
if (varDecl.mutability === sol.Mutability.Constant ||
|
|
136
|
+
varDecl.mutability === sol.Mutability.Immutable ||
|
|
137
|
+
varDecl.storageLocation === sol.DataLocation.Transient) {
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
let typeNode;
|
|
141
|
+
try {
|
|
142
|
+
typeNode = variableDeclarationToTypeNode(varDecl, infer);
|
|
143
|
+
}
|
|
144
|
+
catch (e) {
|
|
145
|
+
/**
|
|
146
|
+
* Missing type info. If this is a:
|
|
147
|
+
* - map type
|
|
148
|
+
* - array type
|
|
149
|
+
*
|
|
150
|
+
* then we can continue decoding as it takes exactly 32 bytes
|
|
151
|
+
* statically in the layout. Otherwise we have to abort decoding
|
|
152
|
+
*/
|
|
153
|
+
complete = false;
|
|
154
|
+
if (isTypeStringStatic32BytesInStorage(varDecl.typeString)) {
|
|
155
|
+
stateVars.push([varDecl.name, new rtt.MissingType(varDecl.typeString)]);
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
stateVars.push([
|
|
163
|
+
varDecl.name,
|
|
164
|
+
(0, runtime_types_1.astToRuntimeType)(typeNode, infer, sol.DataLocation.Storage)
|
|
165
|
+
]);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return [new rtt.StructType(contract.name, stateVars), complete];
|
|
169
|
+
}
|
|
54
170
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/debug/decoding/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/debug/decoding/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,kDAQC;AASD,0BAEC;AAED,8BAEC;AAED,4DAEC;AAED,kDAEC;AAED,gDAEC;AAED,gFAEC;AAED,sCAOC;AAsCD,sDAqDC;AA9JD,mDAAiE;AACjE,mCAAiD;AAEjD,yCAAiD;AACjD,qCAA0C;AAC1C,uCAA+C;AAC/C,mCAA2C;AAC3C,oDAO0B;AAC1B,oDAAsC;AACtC,0DAA4C;AAC5C,uCAAoD;AAEpD,SAAgB,mBAAmB,CAAC,GAAoB;IACpD,OAAO,CACH,GAAG,YAAY,2BAAW;QAC1B,CAAC,CAAC,GAAG,CAAC,MAAM,YAAY,yBAAS,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC;YAC/D,GAAG,CAAC,MAAM,YAAY,yBAAS;YAC/B,GAAG,CAAC,MAAM,YAAY,0BAAU,CAAC;QACrC,GAAG,CAAC,QAAQ,KAAK,6BAAe,CAAC,QAAQ,CAC5C,CAAC;AACN,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,OAAO,CAAC,CAAkB,EAAE,GAAoB,EAAE,GAAoB;IAClF,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC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,CAAC;IAED,OAAO,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TypeNode } from "solc-typed-ast";
|
|
2
1
|
import { DecodingFailure, Struct, Value } from "./value";
|
|
3
2
|
import { Memory, Stack, Storage } from "../types";
|
|
3
|
+
import { BaseRuntimeType } from "../runtime_types";
|
|
4
4
|
export type StateArea = Memory | Stack | Storage;
|
|
5
5
|
export declare class EncodingError extends Error {
|
|
6
6
|
readonly reason: string;
|
|
@@ -10,7 +10,7 @@ export declare class EncodingError extends Error {
|
|
|
10
10
|
* Base class for all data {@link View}s. Views are parametrized by the {@link State} they project from (e.g. Memory, Storage, Calldata),
|
|
11
11
|
* the Solidity {@link Type} of the element they are decoding as well as Typescript type of the {@link Value} they decode.
|
|
12
12
|
*/
|
|
13
|
-
export declare abstract class View<State = StateArea, Val extends Value = Value, Loc = any, Type extends
|
|
13
|
+
export declare abstract class View<State = StateArea, Val extends Value = Value, Loc = any, Type extends BaseRuntimeType = BaseRuntimeType> {
|
|
14
14
|
readonly type: Type;
|
|
15
15
|
protected loc: Loc;
|
|
16
16
|
constructor(type: Type, loc: Loc);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/debug/decoding/view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/debug/decoding/view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,SA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,CAAC,CAAE,SAAQ,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC;IAC3F,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,eAAe,CAAC;CACzD;AAED,MAAM,WAAW,WAAW,CAAC,KAAK,EAAE,OAAO,SAAS,IAAI,CAAC,KAAK,CAAC,CAAE,SAAQ,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC;IACxF,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,GAAG,eAAe,CAAC;CACnD"}
|
package/dist/debug/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/debug/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/debug/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC"}
|
package/dist/debug/index.js
CHANGED
|
@@ -21,4 +21,5 @@ __exportStar(require("./layout"), exports);
|
|
|
21
21
|
__exportStar(require("./opcodes"), exports);
|
|
22
22
|
__exportStar(require("./tracers"), exports);
|
|
23
23
|
__exportStar(require("./types"), exports);
|
|
24
|
+
__exportStar(require("./runtime_types"), exports);
|
|
24
25
|
//# sourceMappingURL=index.js.map
|
package/dist/debug/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/debug/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,qDAAmC;AACnC,6CAA2B;AAC3B,2CAAyB;AACzB,4CAA0B;AAC1B,4CAA0B;AAC1B,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/debug/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,qDAAmC;AACnC,6CAA2B;AAC3B,2CAAyB;AACzB,4CAA0B;AAC1B,4CAA0B;AAC1B,0CAAwB;AACxB,kDAAgC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/debug/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAU,kBAAkB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAc,iBAAiB,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/debug/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAU,kBAAkB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAc,iBAAiB,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAIlC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,MAAM,cAAc,GAAG;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAE1D,wBAAsB,oBAAoB,CACtC,eAAe,EAAE,gBAAgB,EACjC,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,EAC5B,KAAK,EAAE,qBAAqB,EAC5B,SAAS,EAAE,iBAAiB,GAC7B,OAAO,CAAC,cAAc,CAAC,CAuBzB;AAED,wBAAgB,mBAAmB,CAC/B,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,OAAO,GAClB,MAAM,CAQR"}
|
package/dist/debug/layout.js
CHANGED
|
@@ -6,6 +6,7 @@ const solc_typed_ast_1 = require("solc-typed-ast");
|
|
|
6
6
|
const basic_info_1 = require("./tracers/transformers/basic_info");
|
|
7
7
|
const keccak256_invert_1 = require("./tracers/transformers/keccak256_invert");
|
|
8
8
|
const decoding_1 = require("./decoding");
|
|
9
|
+
const decoding_2 = require("./decoding");
|
|
9
10
|
const utils_1 = require("./decoding/utils");
|
|
10
11
|
const value_1 = require("./decoding/value");
|
|
11
12
|
async function decodeContractStates(artifactManager, contracts, state, preimages) {
|
|
@@ -28,7 +29,7 @@ async function decodeContractStates(artifactManager, contracts, state, preimages
|
|
|
28
29
|
}
|
|
29
30
|
function decodeContractState(infer, contract, storage, mapKeys) {
|
|
30
31
|
const [layout] = (0, decoding_1.getContractLayoutType)(contract, infer);
|
|
31
|
-
const view = (0,
|
|
32
|
+
const view = (0, decoding_2.makeStorageView)(layout, [0n, 32]);
|
|
32
33
|
const structState = view.decode(storage, mapKeys);
|
|
33
34
|
(0, solc_typed_ast_1.assert)(!(0, utils_1.isFailure)(structState) && structState instanceof value_1.Struct, ``);
|
|
34
35
|
return structState;
|
package/dist/debug/layout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/debug/layout.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/debug/layout.ts"],"names":[],"mappings":";;AAcA,oDA4BC;AAED,kDAaC;AAvDD,mDAAuE;AAEvE,kEAA+D;AAC/D,8EAAiG;AAEjG,yCAAmD;AACnD,yCAA6C;AAC7C,4CAA6C;AAC7C,4CAA0C;AAInC,KAAK,UAAU,oBAAoB,CACtC,eAAiC,EACjC,SAA4B,EAC5B,KAA4B,EAC5B,SAA4B;IAE5B,MAAM,GAAG,GAAmB,EAAE,CAAC;IAC/B,MAAM,OAAO,GAAG,IAAA,6BAAU,EAAC,SAAS,CAAC,CAAC;IAEtC,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACvC,MAAM,IAAI,GAAG,eAAe,CAAC,+BAA+B,CAAC,IAAI,CAAC,CAAC;QAEnE,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YACrB,SAAS;QACb,CAAC;QAED,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QACnE,MAAM,OAAO,GAAG,MAAM,IAAA,uBAAU,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAE9C,MAAM,aAAa,GAAG,mBAAmB,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAE7E,IAAI,aAAa,EAAE,CAAC;YAChB,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,GAAG,aAAa,CAAC;QACzC,CAAC;IACL,CAAC;IAED,OAAO,GAAG,CAAC;AACf,CAAC;AAED,SAAgB,mBAAmB,CAC/B,KAAgB,EAChB,QAA4B,EAC5B,OAAgB,EAChB,OAAiB;IAEjB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAA,gCAAqB,EAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACxD,MAAM,IAAI,GAAG,IAAA,0BAAe,EAAC,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAC/C,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAElD,IAAA,uBAAM,EAAC,CAAC,IAAA,iBAAS,EAAC,WAAW,CAAC,IAAI,WAAW,YAAY,cAAM,EAAE,EAAE,CAAC,CAAC;IAErE,OAAO,WAAW,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address_type.d.ts","sourceRoot":"","sources":["../../../../src/debug/runtime_types/ast/address_type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,qBAAa,WAAY,SAAQ,eAAe;IAC5C,EAAE,IAAI,MAAM;CAGf"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddressType = void 0;
|
|
4
|
+
const base_type_1 = require("./base_type");
|
|
5
|
+
class AddressType extends base_type_1.BaseRuntimeType {
|
|
6
|
+
pp() {
|
|
7
|
+
return "address";
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.AddressType = AddressType;
|
|
11
|
+
//# sourceMappingURL=address_type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address_type.js","sourceRoot":"","sources":["../../../../src/debug/runtime_types/ast/address_type.ts"],"names":[],"mappings":";;;AAAA,2CAA8C;AAE9C,MAAa,WAAY,SAAQ,2BAAe;IAC5C,EAAE;QACE,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AAJD,kCAIC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseRuntimeType } from "./base_type";
|
|
2
|
+
export declare class ArrayType extends BaseRuntimeType {
|
|
3
|
+
readonly elementT: BaseRuntimeType;
|
|
4
|
+
readonly size?: bigint | undefined;
|
|
5
|
+
constructor(elementT: BaseRuntimeType, size?: bigint | undefined);
|
|
6
|
+
pp(): string;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=array_type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array_type.d.ts","sourceRoot":"","sources":["../../../../src/debug/runtime_types/ast/array_type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,qBAAa,SAAU,SAAQ,eAAe;aAEtB,QAAQ,EAAE,eAAe;aACzB,IAAI,CAAC,EAAE,MAAM;gBADb,QAAQ,EAAE,eAAe,EACzB,IAAI,CAAC,EAAE,MAAM,YAAA;IAKjC,EAAE,IAAI,MAAM;CAGf"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArrayType = void 0;
|
|
4
|
+
const base_type_1 = require("./base_type");
|
|
5
|
+
class ArrayType extends base_type_1.BaseRuntimeType {
|
|
6
|
+
constructor(elementT, size) {
|
|
7
|
+
super();
|
|
8
|
+
this.elementT = elementT;
|
|
9
|
+
this.size = size;
|
|
10
|
+
}
|
|
11
|
+
pp() {
|
|
12
|
+
return `${this.elementT.pp()}[${this.size !== undefined ? this.size : ""}]`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.ArrayType = ArrayType;
|
|
16
|
+
//# sourceMappingURL=array_type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array_type.js","sourceRoot":"","sources":["../../../../src/debug/runtime_types/ast/array_type.ts"],"names":[],"mappings":";;;AAAA,2CAA8C;AAE9C,MAAa,SAAU,SAAQ,2BAAe;IAC1C,YACoB,QAAyB,EACzB,IAAa;QAE7B,KAAK,EAAE,CAAC;QAHQ,aAAQ,GAAR,QAAQ,CAAiB;QACzB,SAAI,GAAJ,IAAI,CAAS;IAGjC,CAAC;IAED,EAAE;QACE,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;IAChF,CAAC;CACJ;AAXD,8BAWC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class for runtime types. Runtime Types are a more convenient
|
|
3
|
+
* set of types for representing runtime values in memory/storage/stack than raw Solidity types.
|
|
4
|
+
*
|
|
5
|
+
* They replace high-level types with their simplified lower-level version:
|
|
6
|
+
* - contracts -> address
|
|
7
|
+
* - enums -> int
|
|
8
|
+
* - user-defined value types -> underyling value type
|
|
9
|
+
* - user-defined structs -> structs with fields expanded
|
|
10
|
+
*
|
|
11
|
+
* Also they explicitly account for missing typing information.
|
|
12
|
+
*/
|
|
13
|
+
export declare abstract class BaseRuntimeType {
|
|
14
|
+
abstract pp(): string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=base_type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base_type.d.ts","sourceRoot":"","sources":["../../../../src/debug/runtime_types/ast/base_type.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,8BAAsB,eAAe;IACjC,QAAQ,CAAC,EAAE,IAAI,MAAM;CACxB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseRuntimeType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Base class for runtime types. Runtime Types are a more convenient
|
|
6
|
+
* set of types for representing runtime values in memory/storage/stack than raw Solidity types.
|
|
7
|
+
*
|
|
8
|
+
* They replace high-level types with their simplified lower-level version:
|
|
9
|
+
* - contracts -> address
|
|
10
|
+
* - enums -> int
|
|
11
|
+
* - user-defined value types -> underyling value type
|
|
12
|
+
* - user-defined structs -> structs with fields expanded
|
|
13
|
+
*
|
|
14
|
+
* Also they explicitly account for missing typing information.
|
|
15
|
+
*/
|
|
16
|
+
class BaseRuntimeType {
|
|
17
|
+
}
|
|
18
|
+
exports.BaseRuntimeType = BaseRuntimeType;
|
|
19
|
+
//# sourceMappingURL=base_type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base_type.js","sourceRoot":"","sources":["../../../../src/debug/runtime_types/ast/base_type.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;GAWG;AACH,MAAsB,eAAe;CAEpC;AAFD,0CAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bool_type.d.ts","sourceRoot":"","sources":["../../../../src/debug/runtime_types/ast/bool_type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,qBAAa,QAAS,SAAQ,eAAe;IACzC,EAAE,IAAI,MAAM;CAGf"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BoolType = void 0;
|
|
4
|
+
const base_type_1 = require("./base_type");
|
|
5
|
+
class BoolType extends base_type_1.BaseRuntimeType {
|
|
6
|
+
pp() {
|
|
7
|
+
return "bool";
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.BoolType = BoolType;
|
|
11
|
+
//# sourceMappingURL=bool_type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bool_type.js","sourceRoot":"","sources":["../../../../src/debug/runtime_types/ast/bool_type.ts"],"names":[],"mappings":";;;AAAA,2CAA8C;AAE9C,MAAa,QAAS,SAAQ,2BAAe;IACzC,EAAE;QACE,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAJD,4BAIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bytes_type.d.ts","sourceRoot":"","sources":["../../../../src/debug/runtime_types/ast/bytes_type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,qBAAa,SAAU,SAAQ,eAAe;IAC1C,EAAE,IAAI,MAAM;CAGf"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BytesType = void 0;
|
|
4
|
+
const base_type_1 = require("./base_type");
|
|
5
|
+
class BytesType extends base_type_1.BaseRuntimeType {
|
|
6
|
+
pp() {
|
|
7
|
+
return `bytes`;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.BytesType = BytesType;
|
|
11
|
+
//# sourceMappingURL=bytes_type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bytes_type.js","sourceRoot":"","sources":["../../../../src/debug/runtime_types/ast/bytes_type.ts"],"names":[],"mappings":";;;AAAA,2CAA8C;AAE9C,MAAa,SAAU,SAAQ,2BAAe;IAC1C,EAAE;QACE,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AAJD,8BAIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixed_bytes_type.d.ts","sourceRoot":"","sources":["../../../../src/debug/runtime_types/ast/fixed_bytes_type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,qBAAa,cAAe,SAAQ,eAAe;aACnB,QAAQ,EAAE,MAAM;gBAAhB,QAAQ,EAAE,MAAM;IAI5C,EAAE,IAAI,MAAM;CAGf"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FixedBytesType = void 0;
|
|
4
|
+
const base_type_1 = require("./base_type");
|
|
5
|
+
class FixedBytesType extends base_type_1.BaseRuntimeType {
|
|
6
|
+
constructor(numBytes) {
|
|
7
|
+
super();
|
|
8
|
+
this.numBytes = numBytes;
|
|
9
|
+
}
|
|
10
|
+
pp() {
|
|
11
|
+
return `bytes${this.numBytes}`;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.FixedBytesType = FixedBytesType;
|
|
15
|
+
//# sourceMappingURL=fixed_bytes_type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixed_bytes_type.js","sourceRoot":"","sources":["../../../../src/debug/runtime_types/ast/fixed_bytes_type.ts"],"names":[],"mappings":";;;AAAA,2CAA8C;AAE9C,MAAa,cAAe,SAAQ,2BAAe;IAC/C,YAA4B,QAAgB;QACxC,KAAK,EAAE,CAAC;QADgB,aAAQ,GAAR,QAAQ,CAAQ;IAE5C,CAAC;IAED,EAAE;QACE,OAAO,QAAQ,IAAI,CAAC,QAAQ,EAAE,CAAC;IACnC,CAAC;CACJ;AARD,wCAQC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FunctionStateMutability } from "solc-typed-ast";
|
|
2
|
+
import { BaseRuntimeType } from "./base_type";
|
|
3
|
+
export declare class FunctionType extends BaseRuntimeType {
|
|
4
|
+
readonly argTs: BaseRuntimeType[];
|
|
5
|
+
readonly external: boolean;
|
|
6
|
+
readonly mutability: FunctionStateMutability;
|
|
7
|
+
readonly retTs: BaseRuntimeType[];
|
|
8
|
+
constructor(argTs: BaseRuntimeType[], external: boolean, mutability: FunctionStateMutability, retTs: BaseRuntimeType[]);
|
|
9
|
+
pp(): string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=function_type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function_type.d.ts","sourceRoot":"","sources":["../../../../src/debug/runtime_types/ast/function_type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,qBAAa,YAAa,SAAQ,eAAe;aAEzB,KAAK,EAAE,eAAe,EAAE;aACxB,QAAQ,EAAE,OAAO;aACjB,UAAU,EAAE,uBAAuB;aACnC,KAAK,EAAE,eAAe,EAAE;gBAHxB,KAAK,EAAE,eAAe,EAAE,EACxB,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,uBAAuB,EACnC,KAAK,EAAE,eAAe,EAAE;IAK5C,EAAE,IAAI,MAAM;CAQf"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FunctionType = void 0;
|
|
4
|
+
const base_type_1 = require("./base_type");
|
|
5
|
+
class FunctionType extends base_type_1.BaseRuntimeType {
|
|
6
|
+
constructor(argTs, external, mutability, retTs) {
|
|
7
|
+
super();
|
|
8
|
+
this.argTs = argTs;
|
|
9
|
+
this.external = external;
|
|
10
|
+
this.mutability = mutability;
|
|
11
|
+
this.retTs = retTs;
|
|
12
|
+
}
|
|
13
|
+
pp() {
|
|
14
|
+
const argStr = this.argTs.map((argT) => argT.pp()).join(", ");
|
|
15
|
+
const retStr = this.retTs.length > 0
|
|
16
|
+
? `returns (${this.retTs.map((retT) => retT.pp()).join(", ")})`
|
|
17
|
+
: "";
|
|
18
|
+
return `function (${argStr})${this.external ? " external " : " "}${this.mutability} ${retStr}`;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.FunctionType = FunctionType;
|
|
22
|
+
//# sourceMappingURL=function_type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function_type.js","sourceRoot":"","sources":["../../../../src/debug/runtime_types/ast/function_type.ts"],"names":[],"mappings":";;;AACA,2CAA8C;AAE9C,MAAa,YAAa,SAAQ,2BAAe;IAC7C,YACoB,KAAwB,EACxB,QAAiB,EACjB,UAAmC,EACnC,KAAwB;QAExC,KAAK,EAAE,CAAC;QALQ,UAAK,GAAL,KAAK,CAAmB;QACxB,aAAQ,GAAR,QAAQ,CAAS;QACjB,eAAU,GAAV,UAAU,CAAyB;QACnC,UAAK,GAAL,KAAK,CAAmB;IAG5C,CAAC;IAED,EAAE;QACE,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9D,MAAM,MAAM,GACR,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;YACjB,CAAC,CAAC,YAAY,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;YAC/D,CAAC,CAAC,EAAE,CAAC;QACb,OAAO,aAAa,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,UAAU,IAAI,MAAM,EAAE,CAAC;IACnG,CAAC;CACJ;AAlBD,oCAkBC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from "./address_type";
|
|
2
|
+
export * from "./array_type";
|
|
3
|
+
export * from "./base_type";
|
|
4
|
+
export * from "./bool_type";
|
|
5
|
+
export * from "./bytes_type";
|
|
6
|
+
export * from "./fixed_bytes_type";
|
|
7
|
+
export * from "./int_type";
|
|
8
|
+
export * from "./mapping_type";
|
|
9
|
+
export * from "./missing_type";
|
|
10
|
+
export * from "./pointer_type";
|
|
11
|
+
export * from "./string_type";
|
|
12
|
+
export * from "./struct_type";
|
|
13
|
+
export * from "./tuple_type";
|
|
14
|
+
export * from "./function_type";
|
|
15
|
+
export * from "./type_type";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/debug/runtime_types/ast/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./address_type"), exports);
|
|
18
|
+
__exportStar(require("./array_type"), exports);
|
|
19
|
+
__exportStar(require("./base_type"), exports);
|
|
20
|
+
__exportStar(require("./bool_type"), exports);
|
|
21
|
+
__exportStar(require("./bytes_type"), exports);
|
|
22
|
+
__exportStar(require("./fixed_bytes_type"), exports);
|
|
23
|
+
__exportStar(require("./int_type"), exports);
|
|
24
|
+
__exportStar(require("./mapping_type"), exports);
|
|
25
|
+
__exportStar(require("./missing_type"), exports);
|
|
26
|
+
__exportStar(require("./pointer_type"), exports);
|
|
27
|
+
__exportStar(require("./string_type"), exports);
|
|
28
|
+
__exportStar(require("./struct_type"), exports);
|
|
29
|
+
__exportStar(require("./tuple_type"), exports);
|
|
30
|
+
__exportStar(require("./function_type"), exports);
|
|
31
|
+
__exportStar(require("./type_type"), exports);
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/debug/runtime_types/ast/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,+CAA6B;AAC7B,8CAA4B;AAC5B,8CAA4B;AAC5B,+CAA6B;AAC7B,qDAAmC;AACnC,6CAA2B;AAC3B,iDAA+B;AAC/B,iDAA+B;AAC/B,iDAA+B;AAC/B,gDAA8B;AAC9B,gDAA8B;AAC9B,+CAA6B;AAC7B,kDAAgC;AAChC,8CAA4B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseRuntimeType } from "./base_type";
|
|
2
|
+
export declare class IntType extends BaseRuntimeType {
|
|
3
|
+
readonly numBits: number;
|
|
4
|
+
readonly signed: boolean;
|
|
5
|
+
constructor(numBits: number, signed: boolean);
|
|
6
|
+
pp(): string;
|
|
7
|
+
max(): bigint;
|
|
8
|
+
min(): bigint;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=int_type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"int_type.d.ts","sourceRoot":"","sources":["../../../../src/debug/runtime_types/ast/int_type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,qBAAa,OAAQ,SAAQ,eAAe;aAEpB,OAAO,EAAE,MAAM;aACf,MAAM,EAAE,OAAO;gBADf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,OAAO;IAKnC,EAAE,IAAI,MAAM;IAKZ,GAAG,IAAI,MAAM;IAKb,GAAG,IAAI,MAAM;CAGhB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IntType = void 0;
|
|
4
|
+
const base_type_1 = require("./base_type");
|
|
5
|
+
class IntType extends base_type_1.BaseRuntimeType {
|
|
6
|
+
constructor(numBits, signed) {
|
|
7
|
+
super();
|
|
8
|
+
this.numBits = numBits;
|
|
9
|
+
this.signed = signed;
|
|
10
|
+
}
|
|
11
|
+
pp() {
|
|
12
|
+
return `${this.signed ? "" : "u"}int${this.numBits}`;
|
|
13
|
+
}
|
|
14
|
+
/// Maximum value (inclusive) representable by this int type.
|
|
15
|
+
max() {
|
|
16
|
+
return 2n ** BigInt(this.signed ? this.numBits - 1 : this.numBits) - 1n;
|
|
17
|
+
}
|
|
18
|
+
/// Minimum value (inclusive) representable by this int type.
|
|
19
|
+
min() {
|
|
20
|
+
return this.signed ? -(2n ** BigInt(this.numBits - 1)) : 0n;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.IntType = IntType;
|
|
24
|
+
//# sourceMappingURL=int_type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"int_type.js","sourceRoot":"","sources":["../../../../src/debug/runtime_types/ast/int_type.ts"],"names":[],"mappings":";;;AAAA,2CAA8C;AAE9C,MAAa,OAAQ,SAAQ,2BAAe;IACxC,YACoB,OAAe,EACf,MAAe;QAE/B,KAAK,EAAE,CAAC;QAHQ,YAAO,GAAP,OAAO,CAAQ;QACf,WAAM,GAAN,MAAM,CAAS;IAGnC,CAAC;IAED,EAAE;QACE,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IACzD,CAAC;IAED,6DAA6D;IAC7D,GAAG;QACC,OAAO,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;IAC5E,CAAC;IAED,6DAA6D;IAC7D,GAAG;QACC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAChE,CAAC;CACJ;AArBD,0BAqBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseRuntimeType } from "./base_type";
|
|
2
|
+
export declare class MappingType extends BaseRuntimeType {
|
|
3
|
+
readonly keyType: BaseRuntimeType;
|
|
4
|
+
readonly valueType: BaseRuntimeType;
|
|
5
|
+
constructor(keyType: BaseRuntimeType, valueType: BaseRuntimeType);
|
|
6
|
+
pp(): string;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=mapping_type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapping_type.d.ts","sourceRoot":"","sources":["../../../../src/debug/runtime_types/ast/mapping_type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,qBAAa,WAAY,SAAQ,eAAe;aAExB,OAAO,EAAE,eAAe;aACxB,SAAS,EAAE,eAAe;gBAD1B,OAAO,EAAE,eAAe,EACxB,SAAS,EAAE,eAAe;IAK9C,EAAE,IAAI,MAAM;CAGf"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MappingType = void 0;
|
|
4
|
+
const base_type_1 = require("./base_type");
|
|
5
|
+
class MappingType extends base_type_1.BaseRuntimeType {
|
|
6
|
+
constructor(keyType, valueType) {
|
|
7
|
+
super();
|
|
8
|
+
this.keyType = keyType;
|
|
9
|
+
this.valueType = valueType;
|
|
10
|
+
}
|
|
11
|
+
pp() {
|
|
12
|
+
return `mapping(${this.keyType.pp()} => ${this.valueType.pp()})`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.MappingType = MappingType;
|
|
16
|
+
//# sourceMappingURL=mapping_type.js.map
|