diff --git a/CHANGELOG.md b/CHANGELOG.md index 443a323e4..18a355440 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The `replace` and `replaceGet` methods for the `Map` type: PR [#941](https://github.com/tact-lang/tact/pull/941) - Utility for logging errors in code that was supposed to be unreachable: PR [#991](https://github.com/tact-lang/tact/pull/991) - Ability to specify a compile-time message opcode expression: PR [#1188](https://github.com/tact-lang/tact/pull/1188) +- The `VarInt16`, `VarInt32`, `VarUint16`, `VarUint32` integer serialization types: PR [#1186](https://github.com/tact-lang/tact/pull/1186) ### Changed @@ -38,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Type checking for `foreach` loops in trait methods: PR [#1017](https://github.com/tact-lang/tact/pull/1017) - The `sha256()` function no longer throws on statically known strings of any length: PR [#907](https://github.com/tact-lang/tact/pull/907) - TypeScript wrappers generation for messages with single quote: PR [#1106](https://github.com/tact-lang/tact/pull/1106) +- `foreach` loops now properly handle `as coins` map value serialization type: PR [#1186](https://github.com/tact-lang/tact/pull/1186) ### Docs diff --git a/cspell.json b/cspell.json index 761007fc5..650ee7101 100644 --- a/cspell.json +++ b/cspell.json @@ -124,6 +124,9 @@ "unixfs", "untypable", "varuint", + "varint", + "storer", + "Ints", "workchain", "xffff", "привет" diff --git a/src/abi/map.ts b/src/abi/map.ts index 0a8c0ea3a..2c0332b1f 100644 --- a/src/abi/map.ts +++ b/src/abi/map.ts @@ -164,6 +164,10 @@ export const MapFunctions: Map = new Map([ vKind = "coins"; ctx.used(`__tact_dict_set_${kind}_${vKind}`); return `${resolved[0]}~__tact_dict_set_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]})`; + } else if (self.valueAs?.startsWith("var")) { + vKind = self.valueAs; + ctx.used(`__tact_dict_set_${kind}_${vKind}`); + return `${resolved[0]}~__tact_dict_set_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]})`; } ctx.used(`__tact_dict_set_${kind}_${vKind}`); return `${resolved[0]}~__tact_dict_set_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]}, ${vBits})`; @@ -234,6 +238,10 @@ export const MapFunctions: Map = new Map([ vKind = "coins"; ctx.used(`__tact_dict_get_${kind}_${vKind}`); return `__tact_dict_get_${kind}_${vKind}(${resolved[0]}, ${bits}, ${resolved[1]})`; + } else if (self.valueAs?.startsWith("var")) { + vKind = self.valueAs; + ctx.used(`__tact_dict_get_${kind}_${vKind}`); + return `__tact_dict_get_${kind}_${vKind}(${resolved[0]}, ${bits}, ${resolved[1]})`; } ctx.used(`__tact_dict_get_${kind}_${vKind}`); return `__tact_dict_get_${kind}_${vKind}(${resolved[0]}, ${bits}, ${resolved[1]}, ${vBits})`; @@ -583,6 +591,10 @@ export const MapFunctions: Map = new Map([ vKind = "coins"; ctx.used(`__tact_dict_replace_${kind}_${vKind}`); return `${resolved[0]}~__tact_dict_replace_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]})`; + } else if (self.valueAs?.startsWith("var")) { + vKind = self.valueAs; + ctx.used(`__tact_dict_replace_${kind}_${vKind}`); + return `${resolved[0]}~__tact_dict_replace_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]})`; } ctx.used(`__tact_dict_replace_${kind}_${vKind}`); return `${resolved[0]}~__tact_dict_replace_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]}, ${vBits})`; @@ -665,6 +677,10 @@ export const MapFunctions: Map = new Map([ vKind = "coins"; ctx.used(`__tact_dict_replaceget_${kind}_${vKind}`); return `${resolved[0]}~__tact_dict_replaceget_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]})`; + } else if (self.valueAs?.startsWith("var")) { + vKind = self.valueAs; + ctx.used(`__tact_dict_replaceget_${kind}_${vKind}`); + return `${resolved[0]}~__tact_dict_replaceget_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]})`; } ctx.used(`__tact_dict_replaceget_${kind}_${vKind}`); return `${resolved[0]}~__tact_dict_replaceget_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]}, ${vBits})`; diff --git a/src/bindings/typescript/serializers.ts b/src/bindings/typescript/serializers.ts index 2f23a8583..268ae6474 100644 --- a/src/bindings/typescript/serializers.ts +++ b/src/bindings/typescript/serializers.ts @@ -192,6 +192,77 @@ const coinsSerializer: Serializer<{ optional: boolean }> = { }, }; +const varIntSerializer: Serializer<{ + format: "varint16" | "varint32" | "varuint16" | "varuint32"; + optional: boolean; +}> = { + tsType(v) { + if (v.optional) { + return "bigint | null"; + } else { + return "bigint"; + } + }, + tsLoad(v, slice, field, w) { + const loader = + v.format === "varint16" || v.format === "varint32" + ? "loadVarIntBig" + : "loadVarUintBig"; + const length = + v.format === "varint16" || v.format === "varuint16" ? 2 : 4; + if (v.optional) { + w.append( + `let ${field} = ${slice}.loadBit() ? ${slice}.${loader}(${length}) : null;`, + ); + } else { + w.append(`let ${field} = ${slice}.${loader}(${length});`); + } + }, + tsLoadTuple(v, reader, field, w) { + if (v.optional) { + w.append(`let ${field} = ${reader}.readBigNumberOpt();`); + } else { + w.append(`let ${field} = ${reader}.readBigNumber();`); + } + }, + tsStore(v, builder, field, w) { + const storer = + v.format === "varint16" || v.format === "varint32" + ? "storeVarInt" + : "storeVarUint"; + const length = + v.format === "varint16" || v.format === "varuint16" ? 2 : 4; + if (v.optional) { + w.append( + `if (${field} !== null && ${field} !== undefined) { ${builder}.storeBit(true).${storer}(${field}, ${length}); } else { ${builder}.storeBit(false); }`, + ); + } else { + w.append(`${builder}.${storer}(${field}, ${length});`); + } + }, + tsStoreTuple(v, to, field, w) { + w.append(`${to}.writeNumber(${field});`); + }, + abiMatcher(src) { + if (src.kind === "simple") { + if (src.type === "int" || src.type === "uint") { + if ( + src.format === "varint16" || + src.format === "varint32" || + src.format === "varuint16" || + src.format === "varuint32" + ) { + return { + format: src.format, + optional: src.optional ? src.optional : false, + }; + } + } + } + return null; + }, +}; + const boolSerializer: Serializer<{ optional: boolean }> = { tsType(v) { if (v.optional) { @@ -621,6 +692,7 @@ type MapSerializerDescrKey = type MapSerializerDescrValue = | { kind: "int" | "uint"; bits: number } | { kind: "varuint"; length: number } + | { kind: "varint"; length: number } | { kind: "boolean" } | { kind: "address" } | { kind: "cell" } @@ -669,6 +741,9 @@ function getValueParser(src: MapSerializerDescrValue) { case "varuint": { return `Dictionary.Values.BigVarUint(${src.length})`; } + case "varint": { + return `Dictionary.Values.BigVarInt(${src.length})`; + } case "address": { return "Dictionary.Values.Address()"; } @@ -732,6 +807,10 @@ const map: Serializer = { src.valueFormat === undefined ) { value = { kind: "int", bits: 257 }; + } else if (src.valueFormat === "varint16") { + value = { kind: "varint", length: 4 }; + } else if (src.valueFormat === "varint32") { + value = { kind: "varint", length: 5 }; } } if (src.value === "uint") { @@ -744,6 +823,10 @@ const map: Serializer = { value = { kind: "uint", bits: 256 }; } else if (src.valueFormat === "coins") { value = { kind: "varuint", length: 4 }; + } else if (src.valueFormat === "varuint16") { + value = { kind: "varuint", length: 4 }; + } else if (src.valueFormat === "varuint32") { + value = { kind: "varuint", length: 5 }; } } if (src.value === "address") { @@ -813,7 +896,8 @@ const map: Serializer = { } } break; - case "varuint": { + case "varuint": + case "varint": { valueT = `bigint`; break; } @@ -869,6 +953,7 @@ export const serializers: Serializer[] = [ intSerializer, uintSerializer, coinsSerializer, + varIntSerializer, boolSerializer, addressSerializer, cellSerializer, diff --git a/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap b/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap index 10b4a432c..9ce27496c 100644 --- a/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap +++ b/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap @@ -2344,9 +2344,9 @@ if (ok) { }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); + "code": "var (r, ok) = __tact_dict_get(d, kl, k); if (ok) { - return r; + return r~load_varint16(); } else { return null(); }", @@ -2354,18 +2354,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_slice", - "signature": "slice __tact_dict_get_uint_slice(cell d, int kl, int k)", + "name": "__tact_dict_get_slice_varint16", + "signature": "int __tact_dict_get_slice_varint16(cell d, int kl, slice k)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); + "code": "var (key, value, flag) = __tact_dict_min(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_varint16(), flag); } else { return (null(), null(), flag); }", @@ -2373,18 +2375,20 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_slice", - "signature": "(int, slice, int) __tact_dict_min_uint_slice(cell d, int kl)", + "name": "__tact_dict_min_slice_varint16", + "signature": "(slice, int, int) __tact_dict_min_slice_varint16(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); if (flag) { - return (key, value, flag); + return (key, value~load_varint16(), flag); } else { return (null(), null(), flag); }", @@ -2392,56 +2396,62 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_slice", - "signature": "(int, slice, int) __tact_dict_next_uint_slice(cell d, int kl, int pivot)", + "name": "__tact_dict_next_slice_varint16", + "signature": "(slice, int, int) __tact_dict_next_slice_varint16(cell d, int kl, slice pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, ()); } else { - return (udict_set(d, kl, k, v), ()); + return (dict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_slice", - "signature": "(cell, ()) __tact_dict_set_uint_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_set_slice_varint16", + "signature": "(cell, ()) __tact_dict_set_slice_varint16(cell d, int kl, slice k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, (ok)); } else { - return udict_replace?(d, kl, k, v); + return dict_replace_builder?(d, kl, k, begin_cell().store_varint16(v)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_slice", - "signature": "(cell, (int)) __tact_dict_replace_uint_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_replace_slice_varint16", + "signature": "(cell, (int)) __tact_dict_replace_slice_varint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_varint16()); } else { return (d, null()); }", @@ -2449,18 +2459,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_slice", - "signature": "(cell, (slice)) __tact_dict_replaceget_uint_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_replaceget_slice_varint16", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); + "code": "var (r, ok) = __tact_dict_get(d, kl, k); if (ok) { - return r~load_int(vl); + return r~load_varint32(); } else { return null(); }", @@ -2468,18 +2480,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_int", - "signature": "int __tact_dict_get_uint_int(cell d, int kl, int k, int vl)", + "name": "__tact_dict_get_slice_varint32", + "signature": "int __tact_dict_get_slice_varint32(cell d, int kl, slice k)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); + "code": "var (key, value, flag) = __tact_dict_min(d, kl); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value~load_varint32(), flag); } else { return (null(), null(), flag); }", @@ -2487,18 +2501,20 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_int", - "signature": "(int, int, int) __tact_dict_min_uint_int(cell d, int kl, int vl)", + "name": "__tact_dict_min_slice_varint32", + "signature": "(slice, int, int) __tact_dict_min_slice_varint32(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value~load_varint32(), flag); } else { return (null(), null(), flag); }", @@ -2506,56 +2522,62 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_int", - "signature": "(int, int, int) __tact_dict_next_uint_int(cell d, int kl, int pivot, int vl)", + "name": "__tact_dict_next_slice_varint32", + "signature": "(slice, int, int) __tact_dict_next_slice_varint32(cell d, int kl, slice pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, ()); } else { - return (udict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); + return (dict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_int", - "signature": "(cell, ()) __tact_dict_set_uint_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_set_slice_varint32", + "signature": "(cell, ()) __tact_dict_set_slice_varint32(cell d, int kl, slice k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, (ok)); } else { - return udict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); + return dict_replace_builder?(d, kl, k, begin_cell().store_varint32(v)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_int", - "signature": "(cell, (int)) __tact_dict_replace_uint_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_slice_varint32", + "signature": "(cell, (int)) __tact_dict_replace_slice_varint32(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_int(vl)); + return (d, old~load_varint32()); } else { return (d, null()); }", @@ -2563,18 +2585,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_int", - "signature": "(cell, (int)) __tact_dict_replaceget_uint_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_slice_varint32", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varint32(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); + "code": "var (r, ok) = __tact_dict_get(d, kl, k); if (ok) { - return r~load_uint(vl); + return r~load_varuint16(); } else { return null(); }", @@ -2582,18 +2606,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_uint", - "signature": "int __tact_dict_get_uint_uint(cell d, int kl, int k, int vl)", + "name": "__tact_dict_get_slice_varuint16", + "signature": "int __tact_dict_get_slice_varuint16(cell d, int kl, slice k)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); + "code": "var (key, value, flag) = __tact_dict_min(d, kl); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value~load_varuint16(), flag); } else { return (null(), null(), flag); }", @@ -2601,18 +2627,20 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_uint", - "signature": "(int, int, int) __tact_dict_min_uint_uint(cell d, int kl, int vl)", + "name": "__tact_dict_min_slice_varuint16", + "signature": "(slice, int, int) __tact_dict_min_slice_varuint16(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value~load_varuint16(), flag); } else { return (null(), null(), flag); }", @@ -2620,56 +2648,62 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_uint", - "signature": "(int, int, int) __tact_dict_next_uint_uint(cell d, int kl, int pivot, int vl)", + "name": "__tact_dict_next_slice_varuint16", + "signature": "(slice, int, int) __tact_dict_next_slice_varuint16(cell d, int kl, slice pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, ()); } else { - return (udict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); + return (dict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_uint", - "signature": "(cell, ()) __tact_dict_set_uint_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_set_slice_varuint16", + "signature": "(cell, ()) __tact_dict_set_slice_varuint16(cell d, int kl, slice k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, (ok)); } else { - return udict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); + return dict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_uint", - "signature": "(cell, (int)) __tact_dict_replace_uint_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_slice_varuint16", + "signature": "(cell, (int)) __tact_dict_replace_slice_varuint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_uint(vl)); + return (d, old~load_varuint16()); } else { return (d, null()); }", @@ -2677,18 +2711,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_uint", - "signature": "(cell, (int)) __tact_dict_replaceget_uint_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_slice_varuint16", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varuint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (r, ok) = udict_get_ref?(d, kl, k); + "code": "var (r, ok) = __tact_dict_get(d, kl, k); if (ok) { - return r; + return r~load_varuint32(); } else { return null(); }", @@ -2696,18 +2732,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_cell", - "signature": "cell __tact_dict_get_uint_cell(cell d, int kl, int k)", + "name": "__tact_dict_get_slice_varuint32", + "signature": "int __tact_dict_get_slice_varuint32(cell d, int kl, slice k)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min_ref?(d, kl); + "code": "var (key, value, flag) = __tact_dict_min(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_varuint32(), flag); } else { return (null(), null(), flag); }", @@ -2715,18 +2753,20 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_cell", - "signature": "(int, cell, int) __tact_dict_min_uint_cell(cell d, int kl)", + "name": "__tact_dict_min_slice_varuint32", + "signature": "(slice, int, int) __tact_dict_min_slice_varuint32(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); if (flag) { - return (key, value~load_ref(), flag); + return (key, value~load_varuint32(), flag); } else { return (null(), null(), flag); }", @@ -2734,56 +2774,62 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_cell", - "signature": "(int, cell, int) __tact_dict_next_uint_cell(cell d, int kl, int pivot)", + "name": "__tact_dict_next_slice_varuint32", + "signature": "(slice, int, int) __tact_dict_next_slice_varuint32(cell d, int kl, slice pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, ()); } else { - return (udict_set_ref(d, kl, k, v), ()); + return (dict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_cell", - "signature": "(cell, ()) __tact_dict_set_uint_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_set_slice_varuint32", + "signature": "(cell, ()) __tact_dict_set_slice_varuint32(cell d, int kl, slice k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, (ok)); } else { - return udict_replace_ref?(d, kl, k, v); + return dict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_cell", - "signature": "(cell, (int)) __tact_dict_replace_uint_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replace_slice_varuint32", + "signature": "(cell, (int)) __tact_dict_replace_slice_varuint32(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get_ref?(kl, k) : d~udict_replaceget_ref?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_varuint32()); } else { return (d, null()); }", @@ -2791,18 +2837,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_cell", - "signature": "(cell, (cell)) __tact_dict_replaceget_uint_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replaceget_slice_varuint32", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varuint32(cell d, int kl, slice k, int v)", }, { "code": { "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r~load_coins(); + return r; } else { return null(); }", @@ -2814,14 +2862,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_coins", - "signature": "int __tact_dict_get_uint_coins(cell d, int kl, int k)", + "name": "__tact_dict_get_uint_slice", + "signature": "slice __tact_dict_get_uint_slice(cell d, int kl, int k)", }, { "code": { "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value~load_coins(), flag); + return (key, value, flag); } else { return (null(), null(), flag); }", @@ -2833,14 +2881,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_coins", - "signature": "(int, int, int) __tact_dict_min_uint_coins(cell d, int kl)", + "name": "__tact_dict_min_uint_slice", + "signature": "(int, slice, int) __tact_dict_min_uint_slice(cell d, int kl)", }, { "code": { "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_coins(), flag); + return (key, value, flag); } else { return (null(), null(), flag); }", @@ -2852,8 +2900,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_coins", - "signature": "(int, int, int) __tact_dict_next_uint_coins(cell d, int kl, int pivot)", + "name": "__tact_dict_next_uint_slice", + "signature": "(int, slice, int) __tact_dict_next_uint_slice(cell d, int kl, int pivot)", }, { "code": { @@ -2861,7 +2909,7 @@ if (flag) { var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (udict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); + return (udict_set(d, kl, k, v), ()); }", "kind": "generic", }, @@ -2871,8 +2919,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_coins", - "signature": "(cell, ()) __tact_dict_set_uint_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_set_uint_slice", + "signature": "(cell, ()) __tact_dict_set_uint_slice(cell d, int kl, int k, slice v)", }, { "code": { @@ -2880,7 +2928,7 @@ if (flag) { var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return udict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); + return udict_replace?(d, kl, k, v); }", "kind": "generic", }, @@ -2890,14 +2938,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_coins", - "signature": "(cell, (int)) __tact_dict_replace_uint_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replace_uint_slice", + "signature": "(cell, (int)) __tact_dict_replace_uint_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, v); if (ok) { - return (d, old~load_coins()); + return (d, old); } else { return (d, null()); }", @@ -2909,14 +2957,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_coins", - "signature": "(cell, (int)) __tact_dict_replaceget_uint_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replaceget_uint_slice", + "signature": "(cell, (slice)) __tact_dict_replaceget_uint_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); + "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r; + return r~load_int(vl); } else { return null(); }", @@ -2928,14 +2976,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_slice", - "signature": "slice __tact_dict_get_int_slice(cell d, int kl, int k)", + "name": "__tact_dict_get_uint_int", + "signature": "int __tact_dict_get_uint_int(cell d, int kl, int k, int vl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min?(d, kl); + "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_int(vl), flag); } else { return (null(), null(), flag); }", @@ -2947,14 +2995,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_slice", - "signature": "(int, slice, int) __tact_dict_min_int_slice(cell d, int kl)", + "name": "__tact_dict_min_uint_int", + "signature": "(int, int, int) __tact_dict_min_uint_int(cell d, int kl, int vl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value, flag); + return (key, value~load_int(vl), flag); } else { return (null(), null(), flag); }", @@ -2966,16 +3014,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_slice", - "signature": "(int, slice, int) __tact_dict_next_int_slice(cell d, int kl, int pivot)", + "name": "__tact_dict_next_uint_int", + "signature": "(int, int, int) __tact_dict_next_uint_int(cell d, int kl, int pivot, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set(d, kl, k, v), ()); + return (udict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); }", "kind": "generic", }, @@ -2985,16 +3033,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_slice", - "signature": "(cell, ()) __tact_dict_set_int_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_set_uint_int", + "signature": "(cell, ()) __tact_dict_set_uint_int(cell d, int kl, int k, int v, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace?(d, kl, k, v); + return udict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); }", "kind": "generic", }, @@ -3004,14 +3052,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_slice", - "signature": "(cell, (int)) __tact_dict_replace_int_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_replace_uint_int", + "signature": "(cell, (int)) __tact_dict_replace_uint_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_int(vl)); } else { return (d, null()); }", @@ -3023,14 +3071,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_slice", - "signature": "(cell, (slice)) __tact_dict_replaceget_int_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_replaceget_uint_int", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); + "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r~load_int(vl); + return r~load_uint(vl); } else { return null(); }", @@ -3042,14 +3090,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_int", - "signature": "int __tact_dict_get_int_int(cell d, int kl, int k, int vl)", + "name": "__tact_dict_get_uint_uint", + "signature": "int __tact_dict_get_uint_uint(cell d, int kl, int k, int vl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min?(d, kl); + "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value~load_uint(vl), flag); } else { return (null(), null(), flag); }", @@ -3061,14 +3109,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_int", - "signature": "(int, int, int) __tact_dict_min_int_int(cell d, int kl, int vl)", + "name": "__tact_dict_min_uint_uint", + "signature": "(int, int, int) __tact_dict_min_uint_uint(cell d, int kl, int vl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value~load_uint(vl), flag); } else { return (null(), null(), flag); }", @@ -3080,16 +3128,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_int", - "signature": "(int, int, int) __tact_dict_next_int_int(cell d, int kl, int pivot, int vl)", + "name": "__tact_dict_next_uint_uint", + "signature": "(int, int, int) __tact_dict_next_uint_uint(cell d, int kl, int pivot, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); + return (udict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); }", "kind": "generic", }, @@ -3099,16 +3147,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_int", - "signature": "(cell, ()) __tact_dict_set_int_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_set_uint_uint", + "signature": "(cell, ()) __tact_dict_set_uint_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); + return udict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); }", "kind": "generic", }, @@ -3118,14 +3166,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_int", - "signature": "(cell, (int)) __tact_dict_replace_int_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_uint_uint", + "signature": "(cell, (int)) __tact_dict_replace_uint_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); if (ok) { - return (d, old~load_int(vl)); + return (d, old~load_uint(vl)); } else { return (d, null()); }", @@ -3137,14 +3185,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_int", - "signature": "(cell, (int)) __tact_dict_replaceget_int_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_uint_uint", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); + "code": "var (r, ok) = udict_get_ref?(d, kl, k); if (ok) { - return r~load_uint(vl); + return r; } else { return null(); }", @@ -3156,14 +3204,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_uint", - "signature": "int __tact_dict_get_int_uint(cell d, int kl, int k, int vl)", + "name": "__tact_dict_get_uint_cell", + "signature": "cell __tact_dict_get_uint_cell(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min?(d, kl); + "code": "var (key, value, flag) = udict_get_min_ref?(d, kl); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value, flag); } else { return (null(), null(), flag); }", @@ -3175,14 +3223,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_uint", - "signature": "(int, int, int) __tact_dict_min_int_uint(cell d, int kl, int vl)", + "name": "__tact_dict_min_uint_cell", + "signature": "(int, cell, int) __tact_dict_min_uint_cell(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value~load_ref(), flag); } else { return (null(), null(), flag); }", @@ -3194,16 +3242,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_uint", - "signature": "(int, int, int) __tact_dict_next_int_uint(cell d, int kl, int pivot, int vl)", + "name": "__tact_dict_next_uint_cell", + "signature": "(int, cell, int) __tact_dict_next_uint_cell(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); + return (udict_set_ref(d, kl, k, v), ()); }", "kind": "generic", }, @@ -3213,16 +3261,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_uint", - "signature": "(cell, ()) __tact_dict_set_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_set_uint_cell", + "signature": "(cell, ()) __tact_dict_set_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); + return udict_replace_ref?(d, kl, k, v); }", "kind": "generic", }, @@ -3232,14 +3280,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_uint", - "signature": "(cell, (int)) __tact_dict_replace_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_uint_cell", + "signature": "(cell, (int)) __tact_dict_replace_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get_ref?(kl, k) : d~udict_replaceget_ref?(kl, k, v); if (ok) { - return (d, old~load_uint(vl)); + return (d, old); } else { return (d, null()); }", @@ -3251,14 +3299,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_uint", - "signature": "(cell, (int)) __tact_dict_replaceget_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_uint_cell", + "signature": "(cell, (cell)) __tact_dict_replaceget_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (r, ok) = idict_get_ref?(d, kl, k); + "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r; + return r~load_coins(); } else { return null(); }", @@ -3270,14 +3318,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_cell", - "signature": "cell __tact_dict_get_int_cell(cell d, int kl, int k)", + "name": "__tact_dict_get_uint_coins", + "signature": "int __tact_dict_get_uint_coins(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min_ref?(d, kl); + "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_coins(), flag); } else { return (null(), null(), flag); }", @@ -3289,14 +3337,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_cell", - "signature": "(int, cell, int) __tact_dict_min_int_cell(cell d, int kl)", + "name": "__tact_dict_min_uint_coins", + "signature": "(int, int, int) __tact_dict_min_uint_coins(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_ref(), flag); + return (key, value~load_coins(), flag); } else { return (null(), null(), flag); }", @@ -3308,16 +3356,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_cell", - "signature": "(int, cell, int) __tact_dict_next_int_cell(cell d, int kl, int pivot)", + "name": "__tact_dict_next_uint_coins", + "signature": "(int, int, int) __tact_dict_next_uint_coins(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set_ref(d, kl, k, v), ()); + return (udict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); }", "kind": "generic", }, @@ -3327,16 +3375,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_cell", - "signature": "(cell, ()) __tact_dict_set_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_set_uint_coins", + "signature": "(cell, ()) __tact_dict_set_uint_coins(cell d, int kl, int k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace_ref?(d, kl, k, v); + return udict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); }", "kind": "generic", }, @@ -3346,14 +3394,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_cell", - "signature": "(cell, (int)) __tact_dict_replace_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replace_uint_coins", + "signature": "(cell, (int)) __tact_dict_replace_uint_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get_ref?(kl, k) : d~idict_replaceget_ref?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_coins()); } else { return (d, null()); }", @@ -3365,14 +3413,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_cell", - "signature": "(cell, (cell)) __tact_dict_replaceget_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replaceget_uint_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); + "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r~load_coins(); + return r~load_varint16(); } else { return null(); }", @@ -3384,14 +3432,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_coins", - "signature": "int __tact_dict_get_int_coins(cell d, int kl, int k)", + "name": "__tact_dict_get_uint_varint16", + "signature": "int __tact_dict_get_uint_varint16(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min?(d, kl); + "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value~load_coins(), flag); + return (key, value~load_varint16(), flag); } else { return (null(), null(), flag); }", @@ -3403,14 +3451,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_coins", - "signature": "(int, int, int) __tact_dict_min_int_coins(cell d, int kl)", + "name": "__tact_dict_min_uint_varint16", + "signature": "(int, int, int) __tact_dict_min_uint_varint16(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_coins(), flag); + return (key, value~load_varint16(), flag); } else { return (null(), null(), flag); }", @@ -3422,16 +3470,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_coins", - "signature": "(int, int, int) __tact_dict_next_int_coins(cell d, int kl, int pivot)", + "name": "__tact_dict_next_uint_varint16", + "signature": "(int, int, int) __tact_dict_next_uint_varint16(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); + return (udict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ()); }", "kind": "generic", }, @@ -3441,16 +3489,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_coins", - "signature": "(cell, ()) __tact_dict_set_int_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_set_uint_varint16", + "signature": "(cell, ()) __tact_dict_set_uint_varint16(cell d, int kl, int k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); + return udict_replace_builder?(d, kl, k, begin_cell().store_varint16(v)); }", "kind": "generic", }, @@ -3460,14 +3508,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_coins", - "signature": "(cell, (int)) __tact_dict_replace_int_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replace_uint_varint16", + "signature": "(cell, (int)) __tact_dict_replace_uint_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_coins()); + return (d, old~load_varint16()); } else { return (d, null()); }", @@ -3479,30 +3527,36 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_coins", - "signature": "(cell, (int)) __tact_dict_replaceget_int_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replaceget_uint_varint16", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); -return ok;", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_varint32(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_exists_slice", - "signature": "int __tact_dict_exists_slice(cell d, int kl, slice k)", + "name": "__tact_dict_get_uint_varint32", + "signature": "int __tact_dict_get_uint_varint32(cell d, int kl, int k)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); -return ok;", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -3511,13 +3565,17 @@ return ok;", "flags": Set { "inline", }, - "name": "__tact_dict_exists_uint", - "signature": "int __tact_dict_exists_uint(cell d, int kl, int k)", + "name": "__tact_dict_min_uint_varint32", + "signature": "(int, int, int) __tact_dict_min_uint_varint32(cell d, int kl)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); -return ok;", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -3526,939 +3584,1100 @@ return ok;", "flags": Set { "inline", }, - "name": "__tact_dict_exists_int", - "signature": "int __tact_dict_exists_int(cell d, int kl, int k)", + "name": "__tact_dict_next_uint_varint32", + "signature": "(int, int, int) __tact_dict_next_uint_varint32(cell d, int kl, int pivot)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -build_0 = build_0.store_int(v'a, 257); -build_0 = build_0.store_int(v'b, 257); -build_0 = ~ null?(v'c) ? build_0.store_int(true, 1).store_int(v'c, 257) : build_0.store_int(false, 1); -build_0 = build_0.store_int(v'd, 1); -build_0 = ~ null?(v'e) ? build_0.store_int(true, 1).store_int(v'e, 1) : build_0.store_int(false, 1); -var build_1 = begin_cell(); -build_1 = build_1.store_int(v'f, 257); -build_1 = build_1.store_int(v'g, 257); -build_0 = store_ref(build_0, build_1.end_cell()); -return build_0;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "$A$_store", - "signature": "builder $A$_store(builder build_0, (int, int, int, int, int, int, int) v)", - }, - { - "code": { - "code": "return $A$_store(begin_cell(), v).end_cell();", - "kind": "generic", - }, - "comment": null, - "context": "type:A", - "depends": Set { - "$A$_store", - }, "flags": Set { "inline", }, - "name": "$A$_store_cell", - "signature": "cell $A$_store_cell((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_set_uint_varint32", + "signature": "(cell, ()) __tact_dict_set_uint_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'a;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_varint32(v)); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_get_a", - "signature": "_ $A$_get_a((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replace_uint_varint32", + "signature": "(cell, (int)) __tact_dict_replace_uint_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'b;", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint32()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_get_b", - "signature": "_ $A$_get_b((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replaceget_uint_varint32", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'c;", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_varuint16(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_get_c", - "signature": "_ $A$_get_c((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_get_uint_varuint16", + "signature": "int __tact_dict_get_uint_varuint16(cell d, int kl, int k)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'd;", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_get_d", - "signature": "_ $A$_get_d((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_min_uint_varuint16", + "signature": "(int, int, int) __tact_dict_min_uint_varuint16(cell d, int kl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'e;", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_get_e", - "signature": "_ $A$_get_e((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_next_uint_varuint16", + "signature": "(int, int, int) __tact_dict_next_uint_varuint16(cell d, int kl, int pivot)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'f;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_get_f", - "signature": "_ $A$_get_f((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_set_uint_varuint16", + "signature": "(cell, ()) __tact_dict_set_uint_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'g;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v)); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_get_g", - "signature": "_ $A$_get_g((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replace_uint_varuint16", + "signature": "(cell, (int)) __tact_dict_replace_uint_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint16()); +} else { + return (d, null()); +}", + "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "$A$_tensor_cast", - "signature": "((int, int, int, int, int, int, int)) $A$_tensor_cast((int, int, int, int, int, int, int) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_uint_varuint16", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "throw_if(128, null?(v)); -var (int vvv'a, int vvv'b, int vvv'c, int vvv'd, int vvv'e, int vvv'f, int vvv'g) = __tact_tuple_destroy_7(v); -return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g);", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_varuint32(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set { - "__tact_tuple_destroy_7", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_not_null", - "signature": "((int, int, int, int, int, int, int)) $A$_not_null(tuple v)", + "name": "__tact_dict_get_uint_varuint32", + "signature": "int __tact_dict_get_uint_varuint32(cell d, int kl, int k)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set { - "__tact_tuple_create_7", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_as_optional", - "signature": "tuple $A$_as_optional((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_min_uint_varuint32", + "signature": "(int, int, int) __tact_dict_min_uint_varuint32(cell d, int kl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set { - "__tact_tuple_create_7", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_to_tuple", - "signature": "tuple $A$_to_tuple(((int, int, int, int, int, int, int)) v)", + "name": "__tact_dict_next_uint_varuint32", + "signature": "(int, int, int) __tact_dict_next_uint_varuint32(cell d, int kl, int pivot)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $A$_to_tuple($A$_not_null(v)); ", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set { - "$A$_to_tuple", - "$A$_not_null", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_to_opt_tuple", - "signature": "tuple $A$_to_opt_tuple(tuple v)", + "name": "__tact_dict_set_uint_varuint32", + "signature": "(cell, ()) __tact_dict_set_uint_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (int v'a, int v'b, int v'c, int v'd, int v'e, int v'f, int v'g) = __tact_tuple_destroy_7(v); -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v)); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set { - "__tact_tuple_destroy_7", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_from_tuple", - "signature": "(int, int, int, int, int, int, int) $A$_from_tuple(tuple v)", + "name": "__tact_dict_replace_uint_varuint32", + "signature": "(cell, (int)) __tact_dict_replace_uint_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $A$_as_optional($A$_from_tuple(v));", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint32()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set { - "$A$_as_optional", - "$A$_from_tuple", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_from_opt_tuple", - "signature": "tuple $A$_from_opt_tuple(tuple v)", + "name": "__tact_dict_replaceget_uint_varuint32", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_to_external", - "signature": "(int, int, int, int, int, int, int) $A$_to_external(((int, int, int, int, int, int, int)) v)", + "name": "__tact_dict_get_int_slice", + "signature": "slice __tact_dict_get_int_slice(cell d, int kl, int k)", }, { "code": { - "code": "var loaded = $A$_to_opt_tuple(v); -if (null?(loaded)) { - return null(); + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value, flag); } else { - return (loaded); + return (null(), null(), flag); }", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set { - "$A$_to_opt_tuple", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_to_opt_external", - "signature": "tuple $A$_to_opt_external(tuple v)", + "name": "__tact_dict_min_int_slice", + "signature": "(int, slice, int) __tact_dict_min_int_slice(cell d, int kl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'a;", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_get_a", - "signature": "_ $B$_get_a((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_next_int_slice", + "signature": "(int, slice, int) __tact_dict_next_int_slice(cell d, int kl, int pivot)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'b;", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set(d, kl, k, v), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_get_b", - "signature": "_ $B$_get_b((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_set_int_slice", + "signature": "(cell, ()) __tact_dict_set_int_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'c;", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace?(d, kl, k, v); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_get_c", - "signature": "_ $B$_get_c((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replace_int_slice", + "signature": "(cell, (int)) __tact_dict_replace_int_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'd;", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, v); +if (ok) { + return (d, old); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_get_d", - "signature": "_ $B$_get_d((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replaceget_int_slice", + "signature": "(cell, (slice)) __tact_dict_replaceget_int_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'e;", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_int(vl); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_get_e", - "signature": "_ $B$_get_e((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_get_int_int", + "signature": "int __tact_dict_get_int_int(cell d, int kl, int k, int vl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'f;", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_get_f", - "signature": "_ $B$_get_f((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_min_int_int", + "signature": "(int, int, int) __tact_dict_min_int_int(cell d, int kl, int vl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'g;", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_get_g", - "signature": "_ $B$_get_g((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_next_int_int", + "signature": "(int, int, int) __tact_dict_next_int_int(cell d, int kl, int pivot, int vl)", }, { "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); +}", + "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "$B$_tensor_cast", - "signature": "((int, int, int, int, int, int, int)) $B$_tensor_cast((int, int, int, int, int, int, int) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_int_int", + "signature": "(cell, ()) __tact_dict_set_int_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "throw_if(128, null?(v)); -var (int vvv'a, int vvv'b, int vvv'c, int vvv'd, int vvv'e, int vvv'f, int vvv'g) = __tact_tuple_destroy_7(v); -return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g);", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set { - "__tact_tuple_destroy_7", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_not_null", - "signature": "((int, int, int, int, int, int, int)) $B$_not_null(tuple v)", + "name": "__tact_dict_replace_int_int", + "signature": "(cell, (int)) __tact_dict_replace_int_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_int(vl)); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set { - "__tact_tuple_create_7", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_as_optional", - "signature": "tuple $B$_as_optional((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replaceget_int_int", + "signature": "(cell, (int)) __tact_dict_replaceget_int_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_uint(vl); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set { - "__tact_tuple_create_7", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_to_tuple", - "signature": "tuple $B$_to_tuple(((int, int, int, int, int, int, int)) v)", + "name": "__tact_dict_get_int_uint", + "signature": "int __tact_dict_get_int_uint(cell d, int kl, int k, int vl)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $B$_to_tuple($B$_not_null(v)); ", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_uint(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set { - "$B$_to_tuple", - "$B$_not_null", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_to_opt_tuple", - "signature": "tuple $B$_to_opt_tuple(tuple v)", + "name": "__tact_dict_min_int_uint", + "signature": "(int, int, int) __tact_dict_min_int_uint(cell d, int kl, int vl)", }, { "code": { - "code": "var (int v'a, int v'b, int v'c, int v'd, int v'e, int v'f, int v'g) = __tact_tuple_destroy_7(v); -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_uint(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set { - "__tact_tuple_destroy_7", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_from_tuple", - "signature": "(int, int, int, int, int, int, int) $B$_from_tuple(tuple v)", + "name": "__tact_dict_next_int_uint", + "signature": "(int, int, int) __tact_dict_next_int_uint(cell d, int kl, int pivot, int vl)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $B$_as_optional($B$_from_tuple(v));", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set { - "$B$_as_optional", - "$B$_from_tuple", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_from_opt_tuple", - "signature": "tuple $B$_from_opt_tuple(tuple v)", + "name": "__tact_dict_set_int_uint", + "signature": "(cell, ()) __tact_dict_set_int_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_to_external", - "signature": "(int, int, int, int, int, int, int) $B$_to_external(((int, int, int, int, int, int, int)) v)", + "name": "__tact_dict_replace_int_uint", + "signature": "(cell, (int)) __tact_dict_replace_int_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var loaded = $B$_to_opt_tuple(v); -if (null?(loaded)) { - return null(); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_uint(vl)); } else { - return (loaded); + return (d, null()); }", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set { - "$B$_to_opt_tuple", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_to_opt_external", - "signature": "tuple $B$_to_opt_external(tuple v)", + "name": "__tact_dict_replaceget_int_uint", + "signature": "(cell, (int)) __tact_dict_replaceget_int_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'a;", + "code": "var (r, ok) = idict_get_ref?(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_a", - "signature": "_ $C$_get_a((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_get_int_cell", + "signature": "cell __tact_dict_get_int_cell(cell d, int kl, int k)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'b;", + "code": "var (key, value, flag) = idict_get_min_ref?(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_b", - "signature": "_ $C$_get_b((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_min_int_cell", + "signature": "(int, cell, int) __tact_dict_min_int_cell(cell d, int kl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'c;", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_ref(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_c", - "signature": "_ $C$_get_c((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_next_int_cell", + "signature": "(int, cell, int) __tact_dict_next_int_cell(cell d, int kl, int pivot)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'd;", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_ref(d, kl, k, v), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_d", - "signature": "_ $C$_get_d((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_set_int_cell", + "signature": "(cell, ()) __tact_dict_set_int_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'e;", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_ref?(d, kl, k, v); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_e", - "signature": "_ $C$_get_e((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_replace_int_cell", + "signature": "(cell, (int)) __tact_dict_replace_int_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'f;", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get_ref?(kl, k) : d~idict_replaceget_ref?(kl, k, v); +if (ok) { + return (d, old); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_f", - "signature": "_ $C$_get_f((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_replaceget_int_cell", + "signature": "(cell, (cell)) __tact_dict_replaceget_int_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'g;", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_coins(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_g", - "signature": "_ $C$_get_g((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_get_int_coins", + "signature": "int __tact_dict_get_int_coins(cell d, int kl, int k)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'h;", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_h", - "signature": "_ $C$_get_h((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_min_int_coins", + "signature": "(int, int, int) __tact_dict_min_int_coins(cell d, int kl)", }, { "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "$C$_tensor_cast", - "signature": "((cell, cell, slice, slice, int, int, int, slice)) $C$_tensor_cast((cell, cell, slice, slice, int, int, int, slice) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_int_coins", + "signature": "(int, int, int) __tact_dict_next_int_coins(cell d, int kl, int pivot)", }, { "code": { - "code": "throw_if(128, null?(v)); -var (cell vvv'a, cell vvv'b, slice vvv'c, slice vvv'd, int vvv'e, int vvv'f, int vvv'g, slice vvv'h) = __tact_tuple_destroy_8(v); -return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g, vvv'h);", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "__tact_tuple_destroy_8", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_not_null", - "signature": "((cell, cell, slice, slice, int, int, int, slice)) $C$_not_null(tuple v)", + "name": "__tact_dict_set_int_coins", + "signature": "(cell, ()) __tact_dict_set_int_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return __tact_tuple_create_8(v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "__tact_tuple_create_8", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_as_optional", - "signature": "tuple $C$_as_optional((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_replace_int_coins", + "signature": "(cell, (int)) __tact_dict_replace_int_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return __tact_tuple_create_8(v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_coins()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "__tact_tuple_create_8", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_to_tuple", - "signature": "tuple $C$_to_tuple(((cell, cell, slice, slice, int, int, int, slice)) v)", + "name": "__tact_dict_replaceget_int_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_int_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $C$_to_tuple($C$_not_null(v)); ", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_varint16(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "$C$_to_tuple", - "$C$_not_null", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_to_opt_tuple", - "signature": "tuple $C$_to_opt_tuple(tuple v)", + "name": "__tact_dict_get_int_varint16", + "signature": "int __tact_dict_get_int_varint16(cell d, int kl, int k)", }, { "code": { - "code": "var (cell v'a, cell v'b, slice v'c, slice v'd, int v'e, int v'f, int v'g, slice v'h) = __tact_tuple_destroy_8(v); -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "__tact_tuple_destroy_8", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_from_tuple", - "signature": "(cell, cell, slice, slice, int, int, int, slice) $C$_from_tuple(tuple v)", + "name": "__tact_dict_min_int_varint16", + "signature": "(int, int, int) __tact_dict_min_int_varint16(cell d, int kl)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $C$_as_optional($C$_from_tuple(v));", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "$C$_as_optional", - "$C$_from_tuple", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_from_opt_tuple", - "signature": "tuple $C$_from_opt_tuple(tuple v)", + "name": "__tact_dict_next_int_varint16", + "signature": "(int, int, int) __tact_dict_next_int_varint16(cell d, int kl, int pivot)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_to_external", - "signature": "(cell, cell, slice, slice, int, int, int, slice) $C$_to_external(((cell, cell, slice, slice, int, int, int, slice)) v)", + "name": "__tact_dict_set_int_varint16", + "signature": "(cell, ()) __tact_dict_set_int_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var loaded = $C$_to_opt_tuple(v); -if (null?(loaded)) { - return null(); + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); } else { - return (loaded); + return idict_replace_builder?(d, kl, k, begin_cell().store_varint16(v)); }", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "$C$_to_opt_tuple", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_to_opt_external", - "signature": "tuple $C$_to_opt_external(tuple v)", + "name": "__tact_dict_replace_int_varint16", + "signature": "(cell, (int)) __tact_dict_replace_int_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var v'a = sc_0~load_int(257); -var v'b = sc_0~load_int(257); -var v'c = sc_0~load_int(1) ? sc_0~load_int(257) : null(); -var v'd = sc_0~load_int(1); -var v'e = sc_0~load_int(1) ? sc_0~load_int(1) : null(); -slice sc_1 = sc_0~load_ref().begin_parse(); -var v'f = sc_1~load_int(257); -var v'g = sc_1~load_int(257); -return (sc_0, (v'a, v'b, v'c, v'd, v'e, v'f, v'g));", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint16()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "$A$_load", - "signature": "(slice, ((int, int, int, int, int, int, int))) $A$_load(slice sc_0)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_int_varint16", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var r = sc_0~$A$_load(); -sc_0.end_parse(); -return r;", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_varint32(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set { - "$A$_load", + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", }, - "flags": Set {}, - "name": "$A$_load_not_mut", - "signature": "((int, int, int, int, int, int, int)) $A$_load_not_mut(slice sc_0)", + "name": "__tact_dict_get_int_varint32", + "signature": "int __tact_dict_get_int_varint32(cell d, int kl, int k)", }, -] -`; - -exports[`writeSerialization should write serializer for B 1`] = ` -[ { "code": { - "kind": "skip", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_set", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_int_varint32", + "signature": "(int, int, int) __tact_dict_min_int_varint32(cell d, int kl)", }, { "code": { - "kind": "skip", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_nop", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_int_varint32", + "signature": "(int, int, int) __tact_dict_next_int_varint32(cell d, int kl, int pivot)", }, { "code": { - "kind": "skip", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_str_to_slice", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_int_varint32", + "signature": "(cell, ()) __tact_dict_set_int_varint32(cell d, int kl, int k, int v)", }, { "code": { - "kind": "skip", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_varint32(v)); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_slice_to_str", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_int_varint32", + "signature": "(cell, (int)) __tact_dict_replace_int_varint32(cell d, int kl, int k, int v)", }, { "code": { - "kind": "skip", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint32()); +} else { + return (d, null()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_address_to_slice", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_int_varint32", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "slice raw = cs~load_msg_addr(); -return (cs, raw);", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_varuint16(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, @@ -4467,17 +4686,16 @@ return (cs, raw);", "flags": Set { "inline", }, - "name": "__tact_load_address", - "signature": "(slice, slice) __tact_load_address(slice cs)", + "name": "__tact_dict_get_int_varuint16", + "signature": "int __tact_dict_get_int_varuint16(cell d, int kl, int k)", }, { "code": { - "code": "if (cs.preload_uint(2) != 0) { - slice raw = cs~load_msg_addr(); - return (cs, raw); + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_varuint16(), flag); } else { - cs~skip_bits(2); - return (cs, null()); + return (null(), null(), flag); }", "kind": "generic", }, @@ -4487,12 +4705,17 @@ return (cs, raw);", "flags": Set { "inline", }, - "name": "__tact_load_address_opt", - "signature": "(slice, slice) __tact_load_address_opt(slice cs)", + "name": "__tact_dict_min_int_varuint16", + "signature": "(int, int, int) __tact_dict_min_int_varuint16(cell d, int kl)", }, { "code": { - "code": "return b.store_slice(address);", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -4501,39 +4724,36 @@ return (cs, raw);", "flags": Set { "inline", }, - "name": "__tact_store_address", - "signature": "builder __tact_store_address(builder b, slice address)", + "name": "__tact_dict_next_int_varuint16", + "signature": "(int, int, int) __tact_dict_next_int_varuint16(cell d, int kl, int pivot)", }, { "code": { - "code": "if (null?(address)) { - b = b.store_uint(0, 2); - return b; + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); } else { - return __tact_store_address(b, address); + return (idict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_store_address", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_store_address_opt", - "signature": "builder __tact_store_address_opt(builder b, slice address)", + "name": "__tact_dict_set_int_varuint16", + "signature": "(cell, ()) __tact_dict_set_int_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var b = begin_cell(); -b = b.store_uint(2, 2); -b = b.store_uint(0, 1); -b = b.store_int(chain, 8); -b = b.store_uint(hash, 256); -var addr = b.end_cell().begin_parse(); -return addr;", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v)); +}", "kind": "generic", }, "comment": null, @@ -4542,1342 +4762,1486 @@ return addr;", "flags": Set { "inline", }, - "name": "__tact_create_address", - "signature": "slice __tact_create_address(int chain, int hash)", + "name": "__tact_dict_replace_int_varuint16", + "signature": "(cell, (int)) __tact_dict_replace_int_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var b = begin_cell(); -b = b.store_uint(0, 2); -b = b.store_uint(3, 2); -b = b.store_uint(0, 1); -b = b.store_ref(code); -b = b.store_ref(data); -var hash = cell_hash(b.end_cell()); -return __tact_create_address(chain, hash);", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint16()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_create_address", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_compute_contract_address", - "signature": "slice __tact_compute_contract_address(int chain, cell code, cell data)", + "name": "__tact_dict_replaceget_int_varuint16", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "throw_if(128, null?(x)); return x;", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_varuint32(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set { - "impure", "inline", }, - "name": "__tact_not_null", - "signature": "forall X -> X __tact_not_null(X x)", + "name": "__tact_dict_get_int_varuint32", + "signature": "int __tact_dict_get_int_varuint32(cell d, int kl, int k)", }, { "code": { - "code": "DICTDEL", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_delete", - "signature": "(cell, int) __tact_dict_delete(cell dict, int key_len, slice index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_int_varuint32", + "signature": "(int, int, int) __tact_dict_min_int_varuint32(cell d, int kl)", }, { "code": { - "code": "DICTIDEL", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_delete_int", - "signature": "(cell, int) __tact_dict_delete_int(cell dict, int key_len, int index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_int_varuint32", + "signature": "(int, int, int) __tact_dict_next_int_varuint32(cell d, int kl, int pivot)", }, { "code": { - "code": "DICTUDEL", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_delete_uint", - "signature": "(cell, int) __tact_dict_delete_uint(cell dict, int key_len, int index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_int_varuint32", + "signature": "(cell, ()) __tact_dict_set_int_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "DICTSETREF", - "kind": "asm", - "shuffle": "(value index dict key_len)", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v)); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_set_ref", - "signature": "((cell), ()) __tact_dict_set_ref(cell dict, int key_len, slice index, cell value)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_int_varuint32", + "signature": "(cell, (int)) __tact_dict_replace_int_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "DICTREPLACEREF", - "kind": "asm", - "shuffle": "(value index dict key_len)", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint32()); +} else { + return (d, null()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_replace_ref", - "signature": "((cell), (int)) __tact_dict_replace_ref(cell dict, int key_len, slice index, cell value)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_int_varuint32", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "DICTREPLACEGETREF NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(value index dict key_len)", + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +return ok;", + "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_replaceget_ref", - "signature": "((cell), (cell, int)) __tact_dict_replaceget_ref(cell dict, int key_len, slice index, cell value)", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_exists_slice", + "signature": "int __tact_dict_exists_slice(cell d, int kl, slice k)", }, { "code": { - "code": "DICTGET NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (r, ok) = udict_get?(d, kl, k); +return ok;", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_get", - "signature": "(slice, int) __tact_dict_get(cell dict, int key_len, slice index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_exists_uint", + "signature": "int __tact_dict_exists_uint(cell d, int kl, int k)", }, { "code": { - "code": "DICTDELGET NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (r, ok) = idict_get?(d, kl, k); +return ok;", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_delete_get", - "signature": "(cell, (slice, int)) __tact_dict_delete_get(cell dict, int key_len, slice index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_exists_int", + "signature": "int __tact_dict_exists_int(cell d, int kl, int k)", }, { "code": { - "code": "DICTDELGETREF NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +build_0 = build_0.store_int(v'a, 257); +build_0 = build_0.store_int(v'b, 257); +build_0 = ~ null?(v'c) ? build_0.store_int(true, 1).store_int(v'c, 257) : build_0.store_int(false, 1); +build_0 = build_0.store_int(v'd, 1); +build_0 = ~ null?(v'e) ? build_0.store_int(true, 1).store_int(v'e, 1) : build_0.store_int(false, 1); +var build_1 = begin_cell(); +build_1 = build_1.store_int(v'f, 257); +build_1 = build_1.store_int(v'g, 257); +build_0 = store_ref(build_0, build_1.end_cell()); +return build_0;", + "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set {}, "flags": Set {}, - "name": "__tact_dict_delete_get_ref", - "signature": "(cell, (cell, int)) __tact_dict_delete_get_ref(cell dict, int key_len, slice index)", + "name": "$A$_store", + "signature": "builder $A$_store(builder build_0, (int, int, int, int, int, int, int) v)", }, { "code": { - "code": "DICTGETREF NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "return $A$_store(begin_cell(), v).end_cell();", + "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_get_ref", - "signature": "(cell, int) __tact_dict_get_ref(cell dict, int key_len, slice index)", + "context": "type:A", + "depends": Set { + "$A$_store", + }, + "flags": Set { + "inline", + }, + "name": "$A$_store_cell", + "signature": "cell $A$_store_cell((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "DICTMIN NULLSWAPIFNOT2", - "kind": "asm", - "shuffle": "(dict key_len -> 1 0 2)", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'a;", + "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_min", - "signature": "(slice, slice, int) __tact_dict_min(cell dict, int key_len)", + "flags": Set { + "inline", + }, + "name": "$A$_get_a", + "signature": "_ $A$_get_a((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "DICTMINREF NULLSWAPIFNOT2", - "kind": "asm", - "shuffle": "(dict key_len -> 1 0 2)", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'b;", + "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_min_ref", - "signature": "(slice, cell, int) __tact_dict_min_ref(cell dict, int key_len)", + "flags": Set { + "inline", + }, + "name": "$A$_get_b", + "signature": "_ $A$_get_b((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "DICTGETNEXT NULLSWAPIFNOT2", - "kind": "asm", - "shuffle": "(pivot dict key_len -> 1 0 2)", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'c;", + "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_next", - "signature": "(slice, slice, int) __tact_dict_next(cell dict, int key_len, slice pivot)", + "flags": Set { + "inline", + }, + "name": "$A$_get_c", + "signature": "_ $A$_get_c((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(dict, key_len, pivot); -if (flag) { - return (key, value~load_ref(), flag); -} else { - return (null(), null(), flag); -}", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'd;", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set { - "__tact_dict_next", + "context": "type:A", + "depends": Set {}, + "flags": Set { + "inline", }, - "flags": Set {}, - "name": "__tact_dict_next_ref", - "signature": "(slice, cell, int) __tact_dict_next_ref(cell dict, int key_len, slice pivot)", + "name": "$A$_get_d", + "signature": "_ $A$_get_d((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "STRDUMP DROP STRDUMP DROP s0 DUMP DROP", - "kind": "asm", - "shuffle": "", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'e;", + "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set {}, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug", - "signature": "forall X -> () __tact_debug(X value, slice debug_print_1, slice debug_print_2)", + "name": "$A$_get_e", + "signature": "_ $A$_get_e((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "STRDUMP DROP STRDUMP DROP STRDUMP DROP", - "kind": "asm", - "shuffle": "", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'f;", + "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set {}, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug_str", - "signature": "() __tact_debug_str(slice value, slice debug_print_1, slice debug_print_2)", + "name": "$A$_get_f", + "signature": "_ $A$_get_f((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "if (value) { - __tact_debug_str("true", debug_print_1, debug_print_2); -} else { - __tact_debug_str("false", debug_print_1, debug_print_2); -}", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'g;", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set { - "__tact_debug_str", - }, + "context": "type:A", + "depends": Set {}, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug_bool", - "signature": "() __tact_debug_bool(int value, slice debug_print_1, slice debug_print_2)", + "name": "$A$_get_g", + "signature": "_ $A$_get_g((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "SDSUBSTR", + "code": "NOP", "kind": "asm", "shuffle": "", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_preload_offset", - "signature": "(slice) __tact_preload_offset(slice s, int offset, int bits)", + "flags": Set {}, + "name": "$A$_tensor_cast", + "signature": "((int, int, int, int, int, int, int)) $A$_tensor_cast((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "slice new_data = begin_cell() - .store_slice(data) - .store_slice("0000"s) -.end_cell().begin_parse(); -int reg = 0; -while (~ new_data.slice_data_empty?()) { - int byte = new_data~load_uint(8); - int mask = 0x80; - while (mask > 0) { - reg <<= 1; - if (byte & mask) { - reg += 1; - } - mask >>= 1; - if (reg > 0xffff) { - reg &= 0xffff; - reg ^= 0x1021; - } - } -} -(int q, int r) = divmod(reg, 256); -return begin_cell() - .store_uint(q, 8) - .store_uint(r, 8) -.end_cell().begin_parse();", + "code": "throw_if(128, null?(v)); +var (int vvv'a, int vvv'b, int vvv'c, int vvv'd, int vvv'e, int vvv'f, int vvv'g) = __tact_tuple_destroy_7(v); +return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g);", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:A", + "depends": Set { + "__tact_tuple_destroy_7", + }, "flags": Set { - "inline_ref", + "inline", }, - "name": "__tact_crc16", - "signature": "(slice) __tact_crc16(slice data)", + "name": "$A$_not_null", + "signature": "((int, int, int, int, int, int, int)) $A$_not_null(tuple v)", }, { "code": { - "code": "slice chars = "4142434445464748494A4B4C4D4E4F505152535455565758595A6162636465666768696A6B6C6D6E6F707172737475767778797A303132333435363738392D5F"s; -builder res = begin_cell(); - -while (data.slice_bits() >= 24) { - (int bs1, int bs2, int bs3) = (data~load_uint(8), data~load_uint(8), data~load_uint(8)); - - int n = (bs1 << 16) | (bs2 << 8) | bs3; - - res = res - .store_slice(__tact_preload_offset(chars, ((n >> 18) & 63) * 8, 8)) - .store_slice(__tact_preload_offset(chars, ((n >> 12) & 63) * 8, 8)) - .store_slice(__tact_preload_offset(chars, ((n >> 6) & 63) * 8, 8)) - .store_slice(__tact_preload_offset(chars, ((n ) & 63) * 8, 8)); -} - -return res.end_cell().begin_parse();", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set { - "__tact_preload_offset", + "__tact_tuple_create_7", }, - "flags": Set {}, - "name": "__tact_base64_encode", - "signature": "(slice) __tact_base64_encode(slice data)", + "flags": Set { + "inline", + }, + "name": "$A$_as_optional", + "signature": "tuple $A$_as_optional((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "(int wc, int hash) = address.parse_std_addr(); - -slice user_friendly_address = begin_cell() - .store_slice("11"s) - .store_uint((wc + 0x100) % 0x100, 8) - .store_uint(hash, 256) -.end_cell().begin_parse(); - -slice checksum = __tact_crc16(user_friendly_address); -slice user_friendly_address_with_checksum = begin_cell() - .store_slice(user_friendly_address) - .store_slice(checksum) -.end_cell().begin_parse(); - -return __tact_base64_encode(user_friendly_address_with_checksum);", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set { - "__tact_crc16", - "__tact_base64_encode", + "__tact_tuple_create_7", }, - "flags": Set {}, - "name": "__tact_address_to_user_friendly", - "signature": "(slice) __tact_address_to_user_friendly(slice address)", + "flags": Set { + "inline", + }, + "name": "$A$_to_tuple", + "signature": "tuple $A$_to_tuple(((int, int, int, int, int, int, int)) v)", }, { "code": { - "code": "__tact_debug_str(__tact_address_to_user_friendly(address), debug_print_1, debug_print_2);", + "code": "if (null?(v)) { return null(); } +return $A$_to_tuple($A$_not_null(v)); ", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set { - "__tact_debug_str", - "__tact_address_to_user_friendly", + "$A$_to_tuple", + "$A$_not_null", }, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug_address", - "signature": "() __tact_debug_address(slice address, slice debug_print_1, slice debug_print_2)", + "name": "$A$_to_opt_tuple", + "signature": "tuple $A$_to_opt_tuple(tuple v)", }, { "code": { - "code": "STRDUMP DROP STRDUMP DROP DUMPSTK", - "kind": "asm", - "shuffle": "", + "code": "var (int v'a, int v'b, int v'c, int v'd, int v'e, int v'f, int v'g) = __tact_tuple_destroy_7(v); +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:A", + "depends": Set { + "__tact_tuple_destroy_7", + }, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug_stack", - "signature": "() __tact_debug_stack(slice debug_print_1, slice debug_print_2)", + "name": "$A$_from_tuple", + "signature": "(int, int, int, int, int, int, int) $A$_from_tuple(tuple v)", }, { "code": { - "code": "return __tact_context;", + "code": "if (null?(v)) { return null(); } +return $A$_as_optional($A$_from_tuple(v));", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:A", + "depends": Set { + "$A$_as_optional", + "$A$_from_tuple", + }, "flags": Set { "inline", }, - "name": "__tact_context_get", - "signature": "(int, slice, int, slice) __tact_context_get()", + "name": "$A$_from_opt_tuple", + "signature": "tuple $A$_from_opt_tuple(tuple v)", }, { "code": { - "code": "return __tact_context_sender;", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_context_get_sender", - "signature": "slice __tact_context_get_sender()", + "name": "$A$_to_external", + "signature": "(int, int, int, int, int, int, int) $A$_to_external(((int, int, int, int, int, int, int)) v)", }, { "code": { - "code": "if (null?(__tact_randomized)) { - randomize_lt(); - __tact_randomized = true; + "code": "var loaded = $A$_to_opt_tuple(v); +if (null?(loaded)) { + return null(); +} else { + return (loaded); }", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:A", + "depends": Set { + "$A$_to_opt_tuple", + }, "flags": Set { - "impure", "inline", }, - "name": "__tact_prepare_random", - "signature": "() __tact_prepare_random()", + "name": "$A$_to_opt_external", + "signature": "tuple $A$_to_opt_external(tuple v)", }, { "code": { - "code": "return b.store_int(v, 1);", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'a;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:B", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_store_bool", - "signature": "builder __tact_store_bool(builder b, int v)", + "name": "$B$_get_a", + "signature": "_ $B$_get_a((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'b;", + "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:B", "depends": Set {}, - "flags": Set {}, - "name": "__tact_to_tuple", - "signature": "forall X -> tuple __tact_to_tuple(X x)", - }, - { - "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", + "flags": Set { + "inline", }, - "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_from_tuple", - "signature": "forall X -> X __tact_from_tuple(tuple x)", + "name": "$B$_get_b", + "signature": "_ $B$_get_b((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "return equal_slices_bits(a, b);", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'c;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:B", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_slice_eq_bits", - "signature": "int __tact_slice_eq_bits(slice a, slice b)", + "name": "$B$_get_c", + "signature": "_ $B$_get_c((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "return (null?(a)) ? (false) : (equal_slices_bits(a, b));", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'd;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:B", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_slice_eq_bits_nullable_one", - "signature": "int __tact_slice_eq_bits_nullable_one(slice a, slice b)", + "name": "$B$_get_d", + "signature": "_ $B$_get_d((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( equal_slices_bits(a, b) ) : ( false ) );", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'e;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:B", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_slice_eq_bits_nullable", - "signature": "int __tact_slice_eq_bits_nullable(slice a, slice b)", + "name": "$B$_get_e", + "signature": "_ $B$_get_e((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "(slice key, slice value, int flag) = __tact_dict_min(a, kl); -while (flag) { - (slice value_b, int flag_b) = b~__tact_dict_delete_get(kl, key); - ifnot (flag_b) { - return 0; - } - ifnot (value.slice_hash() == value_b.slice_hash()) { - return 0; - } - (key, value, flag) = __tact_dict_next(a, kl, key); -} -return null?(b);", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'f;", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set { - "__tact_dict_min", - "__tact_dict_delete_get", - "__tact_dict_next", - }, + "context": "type:B", + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_eq", - "signature": "int __tact_dict_eq(cell a, cell b, int kl)", + "name": "$B$_get_f", + "signature": "_ $B$_get_f((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "return (null?(a)) ? (false) : (a == b);", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'g;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:B", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_int_eq_nullable_one", - "signature": "int __tact_int_eq_nullable_one(int a, int b)", + "name": "$B$_get_g", + "signature": "_ $B$_get_g((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "return (null?(a)) ? (true) : (a != b);", - "kind": "generic", + "code": "NOP", + "kind": "asm", + "shuffle": "", }, "comment": null, - "context": "stdlib", + "context": "type:B", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_int_neq_nullable_one", - "signature": "int __tact_int_neq_nullable_one(int a, int b)", + "flags": Set {}, + "name": "$B$_tensor_cast", + "signature": "((int, int, int, int, int, int, int)) $B$_tensor_cast((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a == b ) : ( false ) );", + "code": "throw_if(128, null?(v)); +var (int vvv'a, int vvv'b, int vvv'c, int vvv'd, int vvv'e, int vvv'f, int vvv'g) = __tact_tuple_destroy_7(v); +return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g);", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set { + "context": "type:B", + "depends": Set { + "__tact_tuple_destroy_7", + }, + "flags": Set { "inline", }, - "name": "__tact_int_eq_nullable", - "signature": "int __tact_int_eq_nullable(int a, int b)", + "name": "$B$_not_null", + "signature": "((int, int, int, int, int, int, int)) $B$_not_null(tuple v)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a != b ) : ( true ) );", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:B", + "depends": Set { + "__tact_tuple_create_7", + }, "flags": Set { "inline", }, - "name": "__tact_int_neq_nullable", - "signature": "int __tact_int_neq_nullable(int a, int b)", + "name": "$B$_as_optional", + "signature": "tuple $B$_as_optional((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "return (a.cell_hash() == b.cell_hash());", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:B", + "depends": Set { + "__tact_tuple_create_7", + }, "flags": Set { "inline", }, - "name": "__tact_cell_eq", - "signature": "int __tact_cell_eq(cell a, cell b)", + "name": "$B$_to_tuple", + "signature": "tuple $B$_to_tuple(((int, int, int, int, int, int, int)) v)", }, { "code": { - "code": "return (a.cell_hash() != b.cell_hash());", + "code": "if (null?(v)) { return null(); } +return $B$_to_tuple($B$_not_null(v)); ", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:B", + "depends": Set { + "$B$_to_tuple", + "$B$_not_null", + }, "flags": Set { "inline", }, - "name": "__tact_cell_neq", - "signature": "int __tact_cell_neq(cell a, cell b)", + "name": "$B$_to_opt_tuple", + "signature": "tuple $B$_to_opt_tuple(tuple v)", }, { "code": { - "code": "return (null?(a)) ? (false) : (a.cell_hash() == b.cell_hash());", + "code": "var (int v'a, int v'b, int v'c, int v'd, int v'e, int v'f, int v'g) = __tact_tuple_destroy_7(v); +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:B", + "depends": Set { + "__tact_tuple_destroy_7", + }, "flags": Set { "inline", }, - "name": "__tact_cell_eq_nullable_one", - "signature": "int __tact_cell_eq_nullable_one(cell a, cell b)", + "name": "$B$_from_tuple", + "signature": "(int, int, int, int, int, int, int) $B$_from_tuple(tuple v)", }, { "code": { - "code": "return (null?(a)) ? (true) : (a.cell_hash() != b.cell_hash());", + "code": "if (null?(v)) { return null(); } +return $B$_as_optional($B$_from_tuple(v));", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:B", + "depends": Set { + "$B$_as_optional", + "$B$_from_tuple", + }, "flags": Set { "inline", }, - "name": "__tact_cell_neq_nullable_one", - "signature": "int __tact_cell_neq_nullable_one(cell a, cell b)", + "name": "$B$_from_opt_tuple", + "signature": "tuple $B$_from_opt_tuple(tuple v)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.cell_hash() == b.cell_hash() ) : ( false ) );", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:B", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_cell_eq_nullable", - "signature": "int __tact_cell_eq_nullable(cell a, cell b)", + "name": "$B$_to_external", + "signature": "(int, int, int, int, int, int, int) $B$_to_external(((int, int, int, int, int, int, int)) v)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.cell_hash() != b.cell_hash() ) : ( true ) );", + "code": "var loaded = $B$_to_opt_tuple(v); +if (null?(loaded)) { + return null(); +} else { + return (loaded); +}", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:B", + "depends": Set { + "$B$_to_opt_tuple", + }, "flags": Set { "inline", }, - "name": "__tact_cell_neq_nullable", - "signature": "int __tact_cell_neq_nullable(cell a, cell b)", + "name": "$B$_to_opt_external", + "signature": "tuple $B$_to_opt_external(tuple v)", }, { "code": { - "code": "return (a.slice_hash() == b.slice_hash());", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'a;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_slice_eq", - "signature": "int __tact_slice_eq(slice a, slice b)", + "name": "$C$_get_a", + "signature": "_ $C$_get_a((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "return (a.slice_hash() != b.slice_hash());", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'b;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_slice_neq", - "signature": "int __tact_slice_neq(slice a, slice b)", + "name": "$C$_get_b", + "signature": "_ $C$_get_b((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "return (null?(a)) ? (false) : (a.slice_hash() == b.slice_hash());", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'c;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_slice_eq_nullable_one", - "signature": "int __tact_slice_eq_nullable_one(slice a, slice b)", + "name": "$C$_get_c", + "signature": "_ $C$_get_c((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "return (null?(a)) ? (true) : (a.slice_hash() != b.slice_hash());", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'd;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_slice_neq_nullable_one", - "signature": "int __tact_slice_neq_nullable_one(slice a, slice b)", + "name": "$C$_get_d", + "signature": "_ $C$_get_d((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.slice_hash() == b.slice_hash() ) : ( false ) );", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'e;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_slice_eq_nullable", - "signature": "int __tact_slice_eq_nullable(slice a, slice b)", + "name": "$C$_get_e", + "signature": "_ $C$_get_e((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.slice_hash() != b.slice_hash() ) : ( true ) );", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'f;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_slice_neq_nullable", - "signature": "int __tact_slice_neq_nullable(slice a, slice b)", + "name": "$C$_get_f", + "signature": "_ $C$_get_f((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "return udict_set_ref(dict, 16, id, code);", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'g;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_set_code", - "signature": "cell __tact_dict_set_code(cell dict, int id, cell code)", + "name": "$C$_get_g", + "signature": "_ $C$_get_g((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "var (data, ok) = udict_get_ref?(dict, 16, id); -throw_unless(135, ok); -return data;", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'h;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_code", - "signature": "cell __tact_dict_get_code(cell dict, int id)", + "name": "$C$_get_h", + "signature": "_ $C$_get_h((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "NIL", + "code": "NOP", "kind": "asm", "shuffle": "", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_create_0", - "signature": "tuple __tact_tuple_create_0()", + "name": "$C$_tensor_cast", + "signature": "((cell, cell, slice, slice, int, int, int, slice)) $C$_tensor_cast((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "return ();", + "code": "throw_if(128, null?(v)); +var (cell vvv'a, cell vvv'b, slice vvv'c, slice vvv'd, int vvv'e, int vvv'f, int vvv'g, slice vvv'h) = __tact_tuple_destroy_8(v); +return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g, vvv'h);", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:C", + "depends": Set { + "__tact_tuple_destroy_8", + }, "flags": Set { "inline", }, - "name": "__tact_tuple_destroy_0", - "signature": "() __tact_tuple_destroy_0()", + "name": "$C$_not_null", + "signature": "((cell, cell, slice, slice, int, int, int, slice)) $C$_not_null(tuple v)", }, { "code": { - "code": "1 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return __tact_tuple_create_8(v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_1", - "signature": "forall X0 -> tuple __tact_tuple_create_1((X0) v)", + "context": "type:C", + "depends": Set { + "__tact_tuple_create_8", + }, + "flags": Set { + "inline", + }, + "name": "$C$_as_optional", + "signature": "tuple $C$_as_optional((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "1 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return __tact_tuple_create_8(v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_1", - "signature": "forall X0 -> (X0) __tact_tuple_destroy_1(tuple v)", + "context": "type:C", + "depends": Set { + "__tact_tuple_create_8", + }, + "flags": Set { + "inline", + }, + "name": "$C$_to_tuple", + "signature": "tuple $C$_to_tuple(((cell, cell, slice, slice, int, int, int, slice)) v)", }, { "code": { - "code": "2 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { return null(); } +return $C$_to_tuple($C$_not_null(v)); ", + "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_2", - "signature": "forall X0, X1 -> tuple __tact_tuple_create_2((X0, X1) v)", + "context": "type:C", + "depends": Set { + "$C$_to_tuple", + "$C$_not_null", + }, + "flags": Set { + "inline", + }, + "name": "$C$_to_opt_tuple", + "signature": "tuple $C$_to_opt_tuple(tuple v)", }, { "code": { - "code": "2 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (cell v'a, cell v'b, slice v'c, slice v'd, int v'e, int v'f, int v'g, slice v'h) = __tact_tuple_destroy_8(v); +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_2", - "signature": "forall X0, X1 -> (X0, X1) __tact_tuple_destroy_2(tuple v)", + "context": "type:C", + "depends": Set { + "__tact_tuple_destroy_8", + }, + "flags": Set { + "inline", + }, + "name": "$C$_from_tuple", + "signature": "(cell, cell, slice, slice, int, int, int, slice) $C$_from_tuple(tuple v)", }, { "code": { - "code": "3 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { return null(); } +return $C$_as_optional($C$_from_tuple(v));", + "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_3", - "signature": "forall X0, X1, X2 -> tuple __tact_tuple_create_3((X0, X1, X2) v)", + "context": "type:C", + "depends": Set { + "$C$_as_optional", + "$C$_from_tuple", + }, + "flags": Set { + "inline", + }, + "name": "$C$_from_opt_tuple", + "signature": "tuple $C$_from_opt_tuple(tuple v)", }, { "code": { - "code": "3 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_3", - "signature": "forall X0, X1, X2 -> (X0, X1, X2) __tact_tuple_destroy_3(tuple v)", + "flags": Set { + "inline", + }, + "name": "$C$_to_external", + "signature": "(cell, cell, slice, slice, int, int, int, slice) $C$_to_external(((cell, cell, slice, slice, int, int, int, slice)) v)", }, { "code": { - "code": "4 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var loaded = $C$_to_opt_tuple(v); +if (null?(loaded)) { + return null(); +} else { + return (loaded); +}", + "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_4", - "signature": "forall X0, X1, X2, X3 -> tuple __tact_tuple_create_4((X0, X1, X2, X3) v)", + "context": "type:C", + "depends": Set { + "$C$_to_opt_tuple", + }, + "flags": Set { + "inline", + }, + "name": "$C$_to_opt_external", + "signature": "tuple $C$_to_opt_external(tuple v)", }, { "code": { - "code": "4 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var v'a = sc_0~load_int(257); +var v'b = sc_0~load_int(257); +var v'c = sc_0~load_int(1) ? sc_0~load_int(257) : null(); +var v'd = sc_0~load_int(1); +var v'e = sc_0~load_int(1) ? sc_0~load_int(1) : null(); +slice sc_1 = sc_0~load_ref().begin_parse(); +var v'f = sc_1~load_int(257); +var v'g = sc_1~load_int(257); +return (sc_0, (v'a, v'b, v'c, v'd, v'e, v'f, v'g));", + "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_4", - "signature": "forall X0, X1, X2, X3 -> (X0, X1, X2, X3) __tact_tuple_destroy_4(tuple v)", + "name": "$A$_load", + "signature": "(slice, ((int, int, int, int, int, int, int))) $A$_load(slice sc_0)", }, { "code": { - "code": "5 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var r = sc_0~$A$_load(); +sc_0.end_parse(); +return r;", + "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:A", + "depends": Set { + "$A$_load", + }, "flags": Set {}, - "name": "__tact_tuple_create_5", - "signature": "forall X0, X1, X2, X3, X4 -> tuple __tact_tuple_create_5((X0, X1, X2, X3, X4) v)", + "name": "$A$_load_not_mut", + "signature": "((int, int, int, int, int, int, int)) $A$_load_not_mut(slice sc_0)", }, +] +`; + +exports[`writeSerialization should write serializer for B 1`] = ` +[ { "code": { - "code": "5 UNTUPLE", - "kind": "asm", - "shuffle": "", + "kind": "skip", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_5", - "signature": "forall X0, X1, X2, X3, X4 -> (X0, X1, X2, X3, X4) __tact_tuple_destroy_5(tuple v)", + "name": "__tact_set", + "signature": "", }, { "code": { - "code": "6 TUPLE", - "kind": "asm", - "shuffle": "", + "kind": "skip", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_create_6", - "signature": "forall X0, X1, X2, X3, X4, X5 -> tuple __tact_tuple_create_6((X0, X1, X2, X3, X4, X5) v)", + "name": "__tact_nop", + "signature": "", }, { "code": { - "code": "6 UNTUPLE", - "kind": "asm", - "shuffle": "", + "kind": "skip", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_6", - "signature": "forall X0, X1, X2, X3, X4, X5 -> (X0, X1, X2, X3, X4, X5) __tact_tuple_destroy_6(tuple v)", + "name": "__tact_str_to_slice", + "signature": "", }, { "code": { - "code": "7 TUPLE", - "kind": "asm", - "shuffle": "", + "kind": "skip", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_create_7", - "signature": "forall X0, X1, X2, X3, X4, X5, X6 -> tuple __tact_tuple_create_7((X0, X1, X2, X3, X4, X5, X6) v)", + "name": "__tact_slice_to_str", + "signature": "", }, { "code": { - "code": "7 UNTUPLE", - "kind": "asm", - "shuffle": "", + "kind": "skip", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_7", - "signature": "forall X0, X1, X2, X3, X4, X5, X6 -> (X0, X1, X2, X3, X4, X5, X6) __tact_tuple_destroy_7(tuple v)", + "name": "__tact_address_to_slice", + "signature": "", }, { "code": { - "code": "8 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "slice raw = cs~load_msg_addr(); +return (cs, raw);", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_8", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7 -> tuple __tact_tuple_create_8((X0, X1, X2, X3, X4, X5, X6, X7) v)", + "flags": Set { + "inline", + }, + "name": "__tact_load_address", + "signature": "(slice, slice) __tact_load_address(slice cs)", }, { "code": { - "code": "8 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (cs.preload_uint(2) != 0) { + slice raw = cs~load_msg_addr(); + return (cs, raw); +} else { + cs~skip_bits(2); + return (cs, null()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_8", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7 -> (X0, X1, X2, X3, X4, X5, X6, X7) __tact_tuple_destroy_8(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_load_address_opt", + "signature": "(slice, slice) __tact_load_address_opt(slice cs)", }, { "code": { - "code": "9 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "return b.store_slice(address);", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_9", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8 -> tuple __tact_tuple_create_9((X0, X1, X2, X3, X4, X5, X6, X7, X8) v)", + "flags": Set { + "inline", + }, + "name": "__tact_store_address", + "signature": "builder __tact_store_address(builder b, slice address)", }, { "code": { - "code": "9 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(address)) { + b = b.store_uint(0, 2); + return b; +} else { + return __tact_store_address(b, address); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_9", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8) __tact_tuple_destroy_9(tuple v)", + "depends": Set { + "__tact_store_address", + }, + "flags": Set { + "inline", + }, + "name": "__tact_store_address_opt", + "signature": "builder __tact_store_address_opt(builder b, slice address)", }, { "code": { - "code": "10 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var b = begin_cell(); +b = b.store_uint(2, 2); +b = b.store_uint(0, 1); +b = b.store_int(chain, 8); +b = b.store_uint(hash, 256); +var addr = b.end_cell().begin_parse(); +return addr;", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_10", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9 -> tuple __tact_tuple_create_10((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) v)", + "flags": Set { + "inline", + }, + "name": "__tact_create_address", + "signature": "slice __tact_create_address(int chain, int hash)", }, { "code": { - "code": "10 UNTUPLE", + "code": "var b = begin_cell(); +b = b.store_uint(0, 2); +b = b.store_uint(3, 2); +b = b.store_uint(0, 1); +b = b.store_ref(code); +b = b.store_ref(data); +var hash = cell_hash(b.end_cell()); +return __tact_create_address(chain, hash);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_create_address", + }, + "flags": Set { + "inline", + }, + "name": "__tact_compute_contract_address", + "signature": "slice __tact_compute_contract_address(int chain, cell code, cell data)", + }, + { + "code": { + "code": "throw_if(128, null?(x)); return x;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "impure", + "inline", + }, + "name": "__tact_not_null", + "signature": "forall X -> X __tact_not_null(X x)", + }, + { + "code": { + "code": "DICTDEL", "kind": "asm", - "shuffle": "", + "shuffle": "(index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_10", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) __tact_tuple_destroy_10(tuple v)", + "name": "__tact_dict_delete", + "signature": "(cell, int) __tact_dict_delete(cell dict, int key_len, slice index)", }, { "code": { - "code": "11 TUPLE", + "code": "DICTIDEL", "kind": "asm", - "shuffle": "", + "shuffle": "(index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_create_11", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10 -> tuple __tact_tuple_create_11((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) v)", + "name": "__tact_dict_delete_int", + "signature": "(cell, int) __tact_dict_delete_int(cell dict, int key_len, int index)", }, { "code": { - "code": "11 UNTUPLE", + "code": "DICTUDEL", "kind": "asm", - "shuffle": "", + "shuffle": "(index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_11", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) __tact_tuple_destroy_11(tuple v)", + "name": "__tact_dict_delete_uint", + "signature": "(cell, int) __tact_dict_delete_uint(cell dict, int key_len, int index)", }, { "code": { - "code": "12 TUPLE", + "code": "DICTSETREF", "kind": "asm", - "shuffle": "", + "shuffle": "(value index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_create_12", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11 -> tuple __tact_tuple_create_12((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) v)", + "name": "__tact_dict_set_ref", + "signature": "((cell), ()) __tact_dict_set_ref(cell dict, int key_len, slice index, cell value)", }, { "code": { - "code": "12 UNTUPLE", + "code": "DICTREPLACEREF", "kind": "asm", - "shuffle": "", + "shuffle": "(value index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_12", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) __tact_tuple_destroy_12(tuple v)", + "name": "__tact_dict_replace_ref", + "signature": "((cell), (int)) __tact_dict_replace_ref(cell dict, int key_len, slice index, cell value)", }, { "code": { - "code": "13 TUPLE", + "code": "DICTREPLACEGETREF NULLSWAPIFNOT", "kind": "asm", - "shuffle": "", + "shuffle": "(value index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_create_13", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12 -> tuple __tact_tuple_create_13((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) v)", + "name": "__tact_dict_replaceget_ref", + "signature": "((cell), (cell, int)) __tact_dict_replaceget_ref(cell dict, int key_len, slice index, cell value)", }, { "code": { - "code": "13 UNTUPLE", + "code": "DICTGET NULLSWAPIFNOT", "kind": "asm", - "shuffle": "", + "shuffle": "(index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_13", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) __tact_tuple_destroy_13(tuple v)", + "name": "__tact_dict_get", + "signature": "(slice, int) __tact_dict_get(cell dict, int key_len, slice index)", }, { "code": { - "code": "14 TUPLE", + "code": "DICTDELGET NULLSWAPIFNOT", "kind": "asm", - "shuffle": "", + "shuffle": "(index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_create_14", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13 -> tuple __tact_tuple_create_14((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) v)", + "name": "__tact_dict_delete_get", + "signature": "(cell, (slice, int)) __tact_dict_delete_get(cell dict, int key_len, slice index)", }, { "code": { - "code": "14 UNTUPLE", + "code": "DICTDELGETREF NULLSWAPIFNOT", "kind": "asm", - "shuffle": "", + "shuffle": "(index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_14", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) __tact_tuple_destroy_14(tuple v)", + "name": "__tact_dict_delete_get_ref", + "signature": "(cell, (cell, int)) __tact_dict_delete_get_ref(cell dict, int key_len, slice index)", }, { "code": { - "code": "15 TUPLE", + "code": "DICTGETREF NULLSWAPIFNOT", "kind": "asm", - "shuffle": "", + "shuffle": "(index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_create_15", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14 -> tuple __tact_tuple_create_15((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) v)", + "name": "__tact_dict_get_ref", + "signature": "(cell, int) __tact_dict_get_ref(cell dict, int key_len, slice index)", }, { "code": { - "code": "15 UNTUPLE", + "code": "DICTMIN NULLSWAPIFNOT2", "kind": "asm", - "shuffle": "", + "shuffle": "(dict key_len -> 1 0 2)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_15", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) __tact_tuple_destroy_15(tuple v)", + "name": "__tact_dict_min", + "signature": "(slice, slice, int) __tact_dict_min(cell dict, int key_len)", }, { "code": { - "code": "return tpush(tpush(empty_tuple(), b), null());", - "kind": "generic", + "code": "DICTMINREF NULLSWAPIFNOT2", + "kind": "asm", + "shuffle": "(dict key_len -> 1 0 2)", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", + "flags": Set {}, + "name": "__tact_dict_min_ref", + "signature": "(slice, cell, int) __tact_dict_min_ref(cell dict, int key_len)", + }, + { + "code": { + "code": "DICTGETNEXT NULLSWAPIFNOT2", + "kind": "asm", + "shuffle": "(pivot dict key_len -> 1 0 2)", }, - "name": "__tact_string_builder_start", - "signature": "tuple __tact_string_builder_start(builder b)", + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_next", + "signature": "(slice, slice, int) __tact_dict_next(cell dict, int key_len, slice pivot)", }, { "code": { - "code": "return __tact_string_builder_start(begin_cell().store_uint(0, 32));", + "code": "var (key, value, flag) = __tact_dict_next(dict, key_len, pivot); +if (flag) { + return (key, value~load_ref(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set { - "__tact_string_builder_start", + "__tact_dict_next", + }, + "flags": Set {}, + "name": "__tact_dict_next_ref", + "signature": "(slice, cell, int) __tact_dict_next_ref(cell dict, int key_len, slice pivot)", + }, + { + "code": { + "code": "STRDUMP DROP STRDUMP DROP s0 DUMP DROP", + "kind": "asm", + "shuffle": "", }, + "comment": null, + "context": "stdlib", + "depends": Set {}, "flags": Set { - "inline", + "impure", }, - "name": "__tact_string_builder_start_comment", - "signature": "tuple __tact_string_builder_start_comment()", + "name": "__tact_debug", + "signature": "forall X -> () __tact_debug(X value, slice debug_print_1, slice debug_print_2)", }, { "code": { - "code": "return __tact_string_builder_start(begin_cell().store_uint(0, 8));", - "kind": "generic", + "code": "STRDUMP DROP STRDUMP DROP STRDUMP DROP", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_string_builder_start", - }, + "depends": Set {}, "flags": Set { - "inline", + "impure", }, - "name": "__tact_string_builder_start_tail_string", - "signature": "tuple __tact_string_builder_start_tail_string()", + "name": "__tact_debug_str", + "signature": "() __tact_debug_str(slice value, slice debug_print_1, slice debug_print_2)", }, { "code": { - "code": "return __tact_string_builder_start(begin_cell());", + "code": "if (value) { + __tact_debug_str("true", debug_print_1, debug_print_2); +} else { + __tact_debug_str("false", debug_print_1, debug_print_2); +}", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set { - "__tact_string_builder_start", + "__tact_debug_str", }, "flags": Set { - "inline", + "impure", }, - "name": "__tact_string_builder_start_string", - "signature": "tuple __tact_string_builder_start_string()", + "name": "__tact_debug_bool", + "signature": "() __tact_debug_bool(int value, slice debug_print_1, slice debug_print_2)", }, { "code": { - "code": "(builder b, tuple tail) = uncons(builders); -cell c = b.end_cell(); -while(~ null?(tail)) { - (b, tail) = uncons(tail); - c = b.store_ref(c).end_cell(); -} -return c;", - "kind": "generic", + "code": "SDSUBSTR", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", @@ -5885,222 +6249,140 @@ return c;", "flags": Set { "inline", }, - "name": "__tact_string_builder_end", - "signature": "cell __tact_string_builder_end(tuple builders)", + "name": "__tact_preload_offset", + "signature": "(slice) __tact_preload_offset(slice s, int offset, int bits)", }, { "code": { - "code": "return __tact_string_builder_end(builders).begin_parse();", + "code": "slice new_data = begin_cell() + .store_slice(data) + .store_slice("0000"s) +.end_cell().begin_parse(); +int reg = 0; +while (~ new_data.slice_data_empty?()) { + int byte = new_data~load_uint(8); + int mask = 0x80; + while (mask > 0) { + reg <<= 1; + if (byte & mask) { + reg += 1; + } + mask >>= 1; + if (reg > 0xffff) { + reg &= 0xffff; + reg ^= 0x1021; + } + } +} +(int q, int r) = divmod(reg, 256); +return begin_cell() + .store_uint(q, 8) + .store_uint(r, 8) +.end_cell().begin_parse();", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_string_builder_end", - }, + "depends": Set {}, "flags": Set { - "inline", + "inline_ref", }, - "name": "__tact_string_builder_end_slice", - "signature": "slice __tact_string_builder_end_slice(tuple builders)", + "name": "__tact_crc16", + "signature": "(slice) __tact_crc16(slice data)", }, { "code": { - "code": "int sliceRefs = slice_refs(sc); -int sliceBits = slice_bits(sc); - -while((sliceBits > 0) | (sliceRefs > 0)) { - - ;; Load the current builder - (builder b, tuple tail) = uncons(builders); - int remBytes = 127 - (builder_bits(b) / 8); - int exBytes = sliceBits / 8; + "code": "slice chars = "4142434445464748494A4B4C4D4E4F505152535455565758595A6162636465666768696A6B6C6D6E6F707172737475767778797A303132333435363738392D5F"s; +builder res = begin_cell(); - ;; Append bits - int amount = min(remBytes, exBytes); - if (amount > 0) { - slice read = sc~load_bits(amount * 8); - b = b.store_slice(read); - } +while (data.slice_bits() >= 24) { + (int bs1, int bs2, int bs3) = (data~load_uint(8), data~load_uint(8), data~load_uint(8)); - ;; Update builders - builders = cons(b, tail); + int n = (bs1 << 16) | (bs2 << 8) | bs3; - ;; Check if we need to add a new cell and continue - if (exBytes - amount > 0) { - var bb = begin_cell(); - builders = cons(bb, builders); - sliceBits = (exBytes - amount) * 8; - } elseif (sliceRefs > 0) { - sc = sc~load_ref().begin_parse(); - sliceRefs = slice_refs(sc); - sliceBits = slice_bits(sc); - } else { - sliceBits = 0; - sliceRefs = 0; - } + res = res + .store_slice(__tact_preload_offset(chars, ((n >> 18) & 63) * 8, 8)) + .store_slice(__tact_preload_offset(chars, ((n >> 12) & 63) * 8, 8)) + .store_slice(__tact_preload_offset(chars, ((n >> 6) & 63) * 8, 8)) + .store_slice(__tact_preload_offset(chars, ((n ) & 63) * 8, 8)); } -return ((builders), ());", - "kind": "generic", - }, - "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_string_builder_append", - "signature": "((tuple), ()) __tact_string_builder_append(tuple builders, slice sc)", - }, - { - "code": { - "code": "builders~__tact_string_builder_append(sc); -return builders;", +return res.end_cell().begin_parse();", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set { - "__tact_string_builder_append", + "__tact_preload_offset", }, "flags": Set {}, - "name": "__tact_string_builder_append_not_mut", - "signature": "(tuple) __tact_string_builder_append_not_mut(tuple builders, slice sc)", + "name": "__tact_base64_encode", + "signature": "(slice) __tact_base64_encode(slice data)", }, { "code": { - "code": "var b = begin_cell(); -if (src < 0) { - b = b.store_uint(45, 8); - src = - src; -} + "code": "(int wc, int hash) = address.parse_std_addr(); -if (src < 1000000000000000000000000000000) { - int len = 0; - int value = 0; - int mult = 1; - do { - (src, int res) = src.divmod(10); - value = value + (res + 48) * mult; - mult = mult * 256; - len = len + 1; - } until (src == 0); +slice user_friendly_address = begin_cell() + .store_slice("11"s) + .store_uint((wc + 0x100) % 0x100, 8) + .store_uint(hash, 256) +.end_cell().begin_parse(); - b = b.store_uint(value, len * 8); -} else { - tuple t = empty_tuple(); - int len = 0; - do { - int digit = src % 10; - t~tpush(digit); - len = len + 1; - src = src / 10; - } until (src == 0); +slice checksum = __tact_crc16(user_friendly_address); +slice user_friendly_address_with_checksum = begin_cell() + .store_slice(user_friendly_address) + .store_slice(checksum) +.end_cell().begin_parse(); - int c = len - 1; - repeat(len) { - int v = t.at(c); - b = b.store_uint(v + 48, 8); - c = c - 1; - } -} -return b.end_cell().begin_parse();", +return __tact_base64_encode(user_friendly_address_with_checksum);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_crc16", + "__tact_base64_encode", + }, "flags": Set {}, - "name": "__tact_int_to_string", - "signature": "slice __tact_int_to_string(int src)", + "name": "__tact_address_to_user_friendly", + "signature": "(slice) __tact_address_to_user_friendly(slice address)", }, { "code": { - "code": "throw_if(134, (digits <= 0) | (digits > 77)); -builder b = begin_cell(); - -if (src < 0) { - b = b.store_uint(45, 8); - src = - src; -} - -;; Process rem part -int skip = true; -int len = 0; -int rem = 0; -tuple t = empty_tuple(); -repeat(digits) { - (src, rem) = src.divmod(10); - if ( ~ ( skip & ( rem == 0 ) ) ) { - skip = false; - t~tpush(rem + 48); - len = len + 1; - } -} - -;; Process dot -if (~ skip) { - t~tpush(46); - len = len + 1; -} - -;; Main -do { - (src, rem) = src.divmod(10); - t~tpush(rem + 48); - len = len + 1; -} until (src == 0); - -;; Assemble -int c = len - 1; -repeat(len) { - int v = t.at(c); - b = b.store_uint(v, 8); - c = c - 1; -} - -;; Result -return b.end_cell().begin_parse();", + "code": "__tact_debug_str(__tact_address_to_user_friendly(address), debug_print_1, debug_print_2);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_float_to_string", - "signature": "slice __tact_float_to_string(int src, int digits)", + "depends": Set { + "__tact_debug_str", + "__tact_address_to_user_friendly", + }, + "flags": Set { + "impure", + }, + "name": "__tact_debug_address", + "signature": "() __tact_debug_address(slice address, slice debug_print_1, slice debug_print_2)", }, { "code": { - "code": "throw_unless(5, num > 0); -throw_unless(5, base > 1); -if (num < base) { - return 0; -} -int result = 0; -while (num >= base) { - num /= base; - result += 1; -} -return result;", - "kind": "generic", + "code": "STRDUMP DROP STRDUMP DROP DUMPSTK", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set { - "inline", + "impure", }, - "name": "__tact_log", - "signature": "int __tact_log(int num, int base)", + "name": "__tact_debug_stack", + "signature": "() __tact_debug_stack(slice debug_print_1, slice debug_print_2)", }, { "code": { - "code": "throw_unless(5, exp >= 0); -int result = 1; -repeat (exp) { - result *= base; -} -return result;", + "code": "return __tact_context;", "kind": "generic", }, "comment": null, @@ -6109,1196 +6391,840 @@ return result;", "flags": Set { "inline", }, - "name": "__tact_pow", - "signature": "int __tact_pow(int base, int exp)", + "name": "__tact_context_get", + "signature": "(int, slice, int, slice) __tact_context_get()", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); -if (ok) { - return r; -} else { - return null(); -}", + "code": "return __tact_context_sender;", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_slice", - "signature": "slice __tact_dict_get_slice_slice(cell d, int kl, slice k)", + "name": "__tact_context_get_sender", + "signature": "slice __tact_context_get_sender()", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min(d, kl); -if (flag) { - return (key, value, flag); -} else { - return (null(), null(), flag); + "code": "if (null?(__tact_randomized)) { + randomize_lt(); + __tact_randomized = true; }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min", - }, + "depends": Set {}, "flags": Set { + "impure", "inline", }, - "name": "__tact_dict_min_slice_slice", - "signature": "(slice, slice, int) __tact_dict_min_slice_slice(cell d, int kl)", + "name": "__tact_prepare_random", + "signature": "() __tact_prepare_random()", }, { "code": { - "code": "return __tact_dict_next(d, kl, pivot);", + "code": "return b.store_int(v, 1);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_slice", - "signature": "(slice, slice, int) __tact_dict_next_slice_slice(cell d, int kl, slice pivot)", + "name": "__tact_store_bool", + "signature": "builder __tact_store_bool(builder b, int v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, ()); -} else { - return (dict_set_builder(d, kl, k, begin_cell().store_slice(v)), ()); -}", - "kind": "generic", + "code": "NOP", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, - "flags": Set { - "inline", - }, - "name": "__tact_dict_set_slice_slice", - "signature": "(cell, ()) __tact_dict_set_slice_slice(cell d, int kl, slice k, slice v)", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_to_tuple", + "signature": "forall X -> tuple __tact_to_tuple(X x)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, (ok)); -} else { - return dict_replace_builder?(d, kl, k, begin_cell().store_slice(v)); -}", - "kind": "generic", + "code": "NOP", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replace_slice_slice", - "signature": "(cell, (int)) __tact_dict_replace_slice_slice(cell d, int kl, slice k, slice v)", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_from_tuple", + "signature": "forall X -> X __tact_from_tuple(tuple x)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_slice(v).end_cell().begin_parse()); -if (ok) { - return (d, old); -} else { - return (d, null()); -}", + "code": "return equal_slices_bits(a, b);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_slice", - "signature": "(cell, (slice)) __tact_dict_replaceget_slice_slice(cell d, int kl, slice k, slice v)", + "name": "__tact_slice_eq_bits", + "signature": "int __tact_slice_eq_bits(slice a, slice b)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); -if (ok) { - return r~load_int(vl); -} else { - return null(); -}", + "code": "return (null?(a)) ? (false) : (equal_slices_bits(a, b));", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_int", - "signature": "int __tact_dict_get_slice_int(cell d, int kl, slice k, int vl)", + "name": "__tact_slice_eq_bits_nullable_one", + "signature": "int __tact_slice_eq_bits_nullable_one(slice a, slice b)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min(d, kl); -if (flag) { - return (key, value~load_int(vl), flag); -} else { - return (null(), null(), flag); -}", + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( equal_slices_bits(a, b) ) : ( false ) );", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_min_slice_int", - "signature": "(slice, int, int) __tact_dict_min_slice_int(cell d, int kl, int vl)", + "name": "__tact_slice_eq_bits_nullable", + "signature": "int __tact_slice_eq_bits_nullable(slice a, slice b)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); -if (flag) { - return (key, value~load_int(vl), flag); -} else { - return (null(), null(), flag); -}", + "code": "(slice key, slice value, int flag) = __tact_dict_min(a, kl); +while (flag) { + (slice value_b, int flag_b) = b~__tact_dict_delete_get(kl, key); + ifnot (flag_b) { + return 0; + } + ifnot (value.slice_hash() == value_b.slice_hash()) { + return 0; + } + (key, value, flag) = __tact_dict_next(a, kl, key); +} +return null?(b);", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set { + "__tact_dict_min", + "__tact_dict_delete_get", "__tact_dict_next", }, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_int", - "signature": "(slice, int, int) __tact_dict_next_slice_int(cell d, int kl, slice pivot, int vl)", + "name": "__tact_dict_eq", + "signature": "int __tact_dict_eq(cell a, cell b, int kl)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, ()); -} else { - return (dict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); -}", + "code": "return (null?(a)) ? (false) : (a == b);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_set_slice_int", - "signature": "(cell, ()) __tact_dict_set_slice_int(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_int_eq_nullable_one", + "signature": "int __tact_int_eq_nullable_one(int a, int b)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, (ok)); -} else { - return dict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); -}", + "code": "return (null?(a)) ? (true) : (a != b);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_int", - "signature": "(cell, (int)) __tact_dict_replace_slice_int(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_int_neq_nullable_one", + "signature": "int __tact_int_neq_nullable_one(int a, int b)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); -if (ok) { - return (d, old~load_int(vl)); -} else { - return (d, null()); -}", + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a == b ) : ( false ) );", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_int", - "signature": "(cell, (int)) __tact_dict_replaceget_slice_int(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_int_eq_nullable", + "signature": "int __tact_int_eq_nullable(int a, int b)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); -if (ok) { - return r~load_uint(vl); -} else { - return null(); -}", + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a != b ) : ( true ) );", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_uint", - "signature": "int __tact_dict_get_slice_uint(cell d, int kl, slice k, int vl)", + "name": "__tact_int_neq_nullable", + "signature": "int __tact_int_neq_nullable(int a, int b)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min(d, kl); -if (flag) { - return (key, value~load_uint(vl), flag); -} else { - return (null(), null(), flag); -}", + "code": "return (a.cell_hash() == b.cell_hash());", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_min_slice_uint", - "signature": "(slice, int, int) __tact_dict_min_slice_uint(cell d, int kl, int vl)", + "name": "__tact_cell_eq", + "signature": "int __tact_cell_eq(cell a, cell b)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); -if (flag) { - return (key, value~load_uint(vl), flag); -} else { - return (null(), null(), flag); -}", + "code": "return (a.cell_hash() != b.cell_hash());", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_uint", - "signature": "(slice, int, int) __tact_dict_next_slice_uint(cell d, int kl, slice pivot, int vl)", + "name": "__tact_cell_neq", + "signature": "int __tact_cell_neq(cell a, cell b)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, ()); -} else { - return (dict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); -}", + "code": "return (null?(a)) ? (false) : (a.cell_hash() == b.cell_hash());", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_set_slice_uint", - "signature": "(cell, ()) __tact_dict_set_slice_uint(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_cell_eq_nullable_one", + "signature": "int __tact_cell_eq_nullable_one(cell a, cell b)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, (ok)); -} else { - return dict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); -}", + "code": "return (null?(a)) ? (true) : (a.cell_hash() != b.cell_hash());", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_uint", - "signature": "(cell, (int)) __tact_dict_replace_slice_uint(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_cell_neq_nullable_one", + "signature": "int __tact_cell_neq_nullable_one(cell a, cell b)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); -if (ok) { - return (d, old~load_uint(vl)); -} else { - return (d, null()); -}", + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.cell_hash() == b.cell_hash() ) : ( false ) );", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_uint", - "signature": "(cell, (int)) __tact_dict_replaceget_slice_uint(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_cell_eq_nullable", + "signature": "int __tact_cell_eq_nullable(cell a, cell b)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get_ref(d, kl, k); -if (ok) { - return r; -} else { - return null(); -}", + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.cell_hash() != b.cell_hash() ) : ( true ) );", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_cell", - "signature": "cell __tact_dict_get_slice_cell(cell d, int kl, slice k)", + "name": "__tact_cell_neq_nullable", + "signature": "int __tact_cell_neq_nullable(cell a, cell b)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min_ref(d, kl); -if (flag) { - return (key, value, flag); -} else { - return (null(), null(), flag); -}", + "code": "return (a.slice_hash() == b.slice_hash());", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_min_slice_cell", - "signature": "(slice, cell, int) __tact_dict_min_slice_cell(cell d, int kl)", + "name": "__tact_slice_eq", + "signature": "int __tact_slice_eq(slice a, slice b)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); -if (flag) { - return (key, value~load_ref(), flag); -} else { - return (null(), null(), flag); -}", + "code": "return (a.slice_hash() != b.slice_hash());", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_cell", - "signature": "(slice, cell, int) __tact_dict_next_slice_cell(cell d, int kl, slice pivot)", + "name": "__tact_slice_neq", + "signature": "int __tact_slice_neq(slice a, slice b)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, ()); -} else { - return __tact_dict_set_ref(d, kl, k, v); -}", + "code": "return (null?(a)) ? (false) : (a.slice_hash() == b.slice_hash());", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - "__tact_dict_set_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_set_slice_cell", - "signature": "(cell, ()) __tact_dict_set_slice_cell(cell d, int kl, slice k, cell v)", + "name": "__tact_slice_eq_nullable_one", + "signature": "int __tact_slice_eq_nullable_one(slice a, slice b)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, (ok)); -} else { - return __tact_dict_replace_ref(d, kl, k, v); -}", + "code": "return (null?(a)) ? (true) : (a.slice_hash() != b.slice_hash());", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - "__tact_dict_replace_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_cell", - "signature": "(cell, (int)) __tact_dict_replace_slice_cell(cell d, int kl, slice k, cell v)", + "name": "__tact_slice_neq_nullable_one", + "signature": "int __tact_slice_neq_nullable_one(slice a, slice b)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get_ref(kl, k) : d~__tact_dict_replaceget_ref(kl, k, v); -if (ok) { - return (d, old); -} else { - return (d, null()); -}", + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.slice_hash() == b.slice_hash() ) : ( false ) );", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get_ref", - "__tact_dict_replaceget_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_cell", - "signature": "(cell, (cell)) __tact_dict_replaceget_slice_cell(cell d, int kl, slice k, cell v)", + "name": "__tact_slice_eq_nullable", + "signature": "int __tact_slice_eq_nullable(slice a, slice b)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); -if (ok) { - return r~load_coins(); -} else { - return null(); -}", + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.slice_hash() != b.slice_hash() ) : ( true ) );", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_coins", - "signature": "int __tact_dict_get_slice_coins(cell d, int kl, slice k)", + "name": "__tact_slice_neq_nullable", + "signature": "int __tact_slice_neq_nullable(slice a, slice b)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min(d, kl); -if (flag) { - return (key, value~load_coins(), flag); -} else { - return (null(), null(), flag); -}", + "code": "return udict_set_ref(dict, 16, id, code);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_min_slice_coins", - "signature": "(slice, int, int) __tact_dict_min_slice_coins(cell d, int kl)", + "name": "__tact_dict_set_code", + "signature": "cell __tact_dict_set_code(cell dict, int id, cell code)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); -if (flag) { - return (key, value~load_coins(), flag); -} else { - return (null(), null(), flag); -}", + "code": "var (data, ok) = udict_get_ref?(dict, 16, id); +throw_unless(135, ok); +return data;", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_coins", - "signature": "(slice, int, int) __tact_dict_next_slice_coins(cell d, int kl, slice pivot)", + "name": "__tact_dict_get_code", + "signature": "cell __tact_dict_get_code(cell dict, int id)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, ()); -} else { - return (dict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); -}", - "kind": "generic", + "code": "NIL", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, - "flags": Set { - "inline", - }, - "name": "__tact_dict_set_slice_coins", - "signature": "(cell, ()) __tact_dict_set_slice_coins(cell d, int kl, slice k, int v)", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_0", + "signature": "tuple __tact_tuple_create_0()", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, (ok)); -} else { - return dict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); -}", + "code": "return ();", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_coins", - "signature": "(cell, (int)) __tact_dict_replace_slice_coins(cell d, int kl, slice k, int v)", + "name": "__tact_tuple_destroy_0", + "signature": "() __tact_tuple_destroy_0()", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); -if (ok) { - return (d, old~load_coins()); -} else { - return (d, null()); -}", - "kind": "generic", + "code": "1 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get", - }, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replaceget_slice_coins", - "signature": "(cell, (int)) __tact_dict_replaceget_slice_coins(cell d, int kl, slice k, int v)", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_1", + "signature": "forall X0 -> tuple __tact_tuple_create_1((X0) v)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); -if (ok) { - return r; -} else { - return null(); -}", - "kind": "generic", + "code": "1 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_get_uint_slice", - "signature": "slice __tact_dict_get_uint_slice(cell d, int kl, int k)", + "flags": Set {}, + "name": "__tact_tuple_destroy_1", + "signature": "forall X0 -> (X0) __tact_tuple_destroy_1(tuple v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); -if (flag) { - return (key, value, flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "2 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_min_uint_slice", - "signature": "(int, slice, int) __tact_dict_min_uint_slice(cell d, int kl)", + "flags": Set {}, + "name": "__tact_tuple_create_2", + "signature": "forall X0, X1 -> tuple __tact_tuple_create_2((X0, X1) v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); -if (flag) { - return (key, value, flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "2 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_next_uint_slice", - "signature": "(int, slice, int) __tact_dict_next_uint_slice(cell d, int kl, int pivot)", + "flags": Set {}, + "name": "__tact_tuple_destroy_2", + "signature": "forall X0, X1 -> (X0, X1) __tact_tuple_destroy_2(tuple v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, ()); -} else { - return (udict_set(d, kl, k, v), ()); -}", - "kind": "generic", + "code": "3 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_set_uint_slice", - "signature": "(cell, ()) __tact_dict_set_uint_slice(cell d, int kl, int k, slice v)", + "flags": Set {}, + "name": "__tact_tuple_create_3", + "signature": "forall X0, X1, X2 -> tuple __tact_tuple_create_3((X0, X1, X2) v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, (ok)); -} else { - return udict_replace?(d, kl, k, v); -}", - "kind": "generic", + "code": "3 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replace_uint_slice", - "signature": "(cell, (int)) __tact_dict_replace_uint_slice(cell d, int kl, int k, slice v)", + "flags": Set {}, + "name": "__tact_tuple_destroy_3", + "signature": "forall X0, X1, X2 -> (X0, X1, X2) __tact_tuple_destroy_3(tuple v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, v); -if (ok) { - return (d, old); -} else { - return (d, null()); -}", - "kind": "generic", + "code": "4 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replaceget_uint_slice", - "signature": "(cell, (slice)) __tact_dict_replaceget_uint_slice(cell d, int kl, int k, slice v)", + "flags": Set {}, + "name": "__tact_tuple_create_4", + "signature": "forall X0, X1, X2, X3 -> tuple __tact_tuple_create_4((X0, X1, X2, X3) v)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); -if (ok) { - return r~load_int(vl); -} else { - return null(); -}", - "kind": "generic", + "code": "4 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_get_uint_int", - "signature": "int __tact_dict_get_uint_int(cell d, int kl, int k, int vl)", + "flags": Set {}, + "name": "__tact_tuple_destroy_4", + "signature": "forall X0, X1, X2, X3 -> (X0, X1, X2, X3) __tact_tuple_destroy_4(tuple v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); -if (flag) { - return (key, value~load_int(vl), flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "5 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_min_uint_int", - "signature": "(int, int, int) __tact_dict_min_uint_int(cell d, int kl, int vl)", + "flags": Set {}, + "name": "__tact_tuple_create_5", + "signature": "forall X0, X1, X2, X3, X4 -> tuple __tact_tuple_create_5((X0, X1, X2, X3, X4) v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); -if (flag) { - return (key, value~load_int(vl), flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "5 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_next_uint_int", - "signature": "(int, int, int) __tact_dict_next_uint_int(cell d, int kl, int pivot, int vl)", + "flags": Set {}, + "name": "__tact_tuple_destroy_5", + "signature": "forall X0, X1, X2, X3, X4 -> (X0, X1, X2, X3, X4) __tact_tuple_destroy_5(tuple v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, ()); -} else { - return (udict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); -}", - "kind": "generic", + "code": "6 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_set_uint_int", - "signature": "(cell, ()) __tact_dict_set_uint_int(cell d, int kl, int k, int v, int vl)", + "flags": Set {}, + "name": "__tact_tuple_create_6", + "signature": "forall X0, X1, X2, X3, X4, X5 -> tuple __tact_tuple_create_6((X0, X1, X2, X3, X4, X5) v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, (ok)); -} else { - return udict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); -}", - "kind": "generic", + "code": "6 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replace_uint_int", - "signature": "(cell, (int)) __tact_dict_replace_uint_int(cell d, int kl, int k, int v, int vl)", + "flags": Set {}, + "name": "__tact_tuple_destroy_6", + "signature": "forall X0, X1, X2, X3, X4, X5 -> (X0, X1, X2, X3, X4, X5) __tact_tuple_destroy_6(tuple v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); -if (ok) { - return (d, old~load_int(vl)); -} else { - return (d, null()); -}", - "kind": "generic", + "code": "7 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replaceget_uint_int", - "signature": "(cell, (int)) __tact_dict_replaceget_uint_int(cell d, int kl, int k, int v, int vl)", + "flags": Set {}, + "name": "__tact_tuple_create_7", + "signature": "forall X0, X1, X2, X3, X4, X5, X6 -> tuple __tact_tuple_create_7((X0, X1, X2, X3, X4, X5, X6) v)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); -if (ok) { - return r~load_uint(vl); -} else { - return null(); -}", - "kind": "generic", + "code": "7 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_get_uint_uint", - "signature": "int __tact_dict_get_uint_uint(cell d, int kl, int k, int vl)", + "flags": Set {}, + "name": "__tact_tuple_destroy_7", + "signature": "forall X0, X1, X2, X3, X4, X5, X6 -> (X0, X1, X2, X3, X4, X5, X6) __tact_tuple_destroy_7(tuple v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); -if (flag) { - return (key, value~load_uint(vl), flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "8 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_min_uint_uint", - "signature": "(int, int, int) __tact_dict_min_uint_uint(cell d, int kl, int vl)", + "flags": Set {}, + "name": "__tact_tuple_create_8", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7 -> tuple __tact_tuple_create_8((X0, X1, X2, X3, X4, X5, X6, X7) v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); -if (flag) { - return (key, value~load_uint(vl), flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "8 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_next_uint_uint", - "signature": "(int, int, int) __tact_dict_next_uint_uint(cell d, int kl, int pivot, int vl)", + "flags": Set {}, + "name": "__tact_tuple_destroy_8", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7 -> (X0, X1, X2, X3, X4, X5, X6, X7) __tact_tuple_destroy_8(tuple v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, ()); -} else { - return (udict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); -}", - "kind": "generic", + "code": "9 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_set_uint_uint", - "signature": "(cell, ()) __tact_dict_set_uint_uint(cell d, int kl, int k, int v, int vl)", + "flags": Set {}, + "name": "__tact_tuple_create_9", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8 -> tuple __tact_tuple_create_9((X0, X1, X2, X3, X4, X5, X6, X7, X8) v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, (ok)); -} else { - return udict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); -}", - "kind": "generic", + "code": "9 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replace_uint_uint", - "signature": "(cell, (int)) __tact_dict_replace_uint_uint(cell d, int kl, int k, int v, int vl)", + "flags": Set {}, + "name": "__tact_tuple_destroy_9", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8) __tact_tuple_destroy_9(tuple v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); -if (ok) { - return (d, old~load_uint(vl)); -} else { - return (d, null()); -}", - "kind": "generic", + "code": "10 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replaceget_uint_uint", - "signature": "(cell, (int)) __tact_dict_replaceget_uint_uint(cell d, int kl, int k, int v, int vl)", + "flags": Set {}, + "name": "__tact_tuple_create_10", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9 -> tuple __tact_tuple_create_10((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) v)", }, { "code": { - "code": "var (r, ok) = udict_get_ref?(d, kl, k); -if (ok) { - return r; -} else { - return null(); -}", - "kind": "generic", + "code": "10 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_get_uint_cell", - "signature": "cell __tact_dict_get_uint_cell(cell d, int kl, int k)", + "flags": Set {}, + "name": "__tact_tuple_destroy_10", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) __tact_tuple_destroy_10(tuple v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min_ref?(d, kl); -if (flag) { - return (key, value, flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "11 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_min_uint_cell", - "signature": "(int, cell, int) __tact_dict_min_uint_cell(cell d, int kl)", + "flags": Set {}, + "name": "__tact_tuple_create_11", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10 -> tuple __tact_tuple_create_11((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); -if (flag) { - return (key, value~load_ref(), flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "11 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_next_uint_cell", - "signature": "(int, cell, int) __tact_dict_next_uint_cell(cell d, int kl, int pivot)", + "flags": Set {}, + "name": "__tact_tuple_destroy_11", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) __tact_tuple_destroy_11(tuple v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, ()); -} else { - return (udict_set_ref(d, kl, k, v), ()); -}", - "kind": "generic", + "code": "12 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_set_uint_cell", - "signature": "(cell, ()) __tact_dict_set_uint_cell(cell d, int kl, int k, cell v)", + "flags": Set {}, + "name": "__tact_tuple_create_12", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11 -> tuple __tact_tuple_create_12((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, (ok)); -} else { - return udict_replace_ref?(d, kl, k, v); -}", - "kind": "generic", + "code": "12 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replace_uint_cell", - "signature": "(cell, (int)) __tact_dict_replace_uint_cell(cell d, int kl, int k, cell v)", + "flags": Set {}, + "name": "__tact_tuple_destroy_12", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) __tact_tuple_destroy_12(tuple v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get_ref?(kl, k) : d~udict_replaceget_ref?(kl, k, v); -if (ok) { - return (d, old); -} else { - return (d, null()); -}", - "kind": "generic", + "code": "13 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replaceget_uint_cell", - "signature": "(cell, (cell)) __tact_dict_replaceget_uint_cell(cell d, int kl, int k, cell v)", + "flags": Set {}, + "name": "__tact_tuple_create_13", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12 -> tuple __tact_tuple_create_13((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) v)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); -if (ok) { - return r~load_coins(); -} else { - return null(); -}", - "kind": "generic", + "code": "13 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_get_uint_coins", - "signature": "int __tact_dict_get_uint_coins(cell d, int kl, int k)", + "flags": Set {}, + "name": "__tact_tuple_destroy_13", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) __tact_tuple_destroy_13(tuple v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); -if (flag) { - return (key, value~load_coins(), flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "14 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_min_uint_coins", - "signature": "(int, int, int) __tact_dict_min_uint_coins(cell d, int kl)", + "flags": Set {}, + "name": "__tact_tuple_create_14", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13 -> tuple __tact_tuple_create_14((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); -if (flag) { - return (key, value~load_coins(), flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "14 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_next_uint_coins", - "signature": "(int, int, int) __tact_dict_next_uint_coins(cell d, int kl, int pivot)", + "flags": Set {}, + "name": "__tact_tuple_destroy_14", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) __tact_tuple_destroy_14(tuple v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, ()); -} else { - return (udict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); -}", - "kind": "generic", + "code": "15 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_set_uint_coins", - "signature": "(cell, ()) __tact_dict_set_uint_coins(cell d, int kl, int k, int v)", + "flags": Set {}, + "name": "__tact_tuple_create_15", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14 -> tuple __tact_tuple_create_15((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, (ok)); -} else { - return udict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); -}", - "kind": "generic", + "code": "15 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replace_uint_coins", - "signature": "(cell, (int)) __tact_dict_replace_uint_coins(cell d, int kl, int k, int v)", + "flags": Set {}, + "name": "__tact_tuple_destroy_15", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) __tact_tuple_destroy_15(tuple v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); -if (ok) { - return (d, old~load_coins()); -} else { - return (d, null()); -}", + "code": "return tpush(tpush(empty_tuple(), b), null());", "kind": "generic", }, "comment": null, @@ -7307,74 +7233,66 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_coins", - "signature": "(cell, (int)) __tact_dict_replaceget_uint_coins(cell d, int kl, int k, int v)", + "name": "__tact_string_builder_start", + "signature": "tuple __tact_string_builder_start(builder b)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); -if (ok) { - return r; -} else { - return null(); -}", + "code": "return __tact_string_builder_start(begin_cell().store_uint(0, 32));", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_string_builder_start", + }, "flags": Set { "inline", }, - "name": "__tact_dict_get_int_slice", - "signature": "slice __tact_dict_get_int_slice(cell d, int kl, int k)", + "name": "__tact_string_builder_start_comment", + "signature": "tuple __tact_string_builder_start_comment()", }, { "code": { - "code": "var (key, value, flag) = idict_get_min?(d, kl); -if (flag) { - return (key, value, flag); -} else { - return (null(), null(), flag); -}", + "code": "return __tact_string_builder_start(begin_cell().store_uint(0, 8));", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_string_builder_start", + }, "flags": Set { "inline", }, - "name": "__tact_dict_min_int_slice", - "signature": "(int, slice, int) __tact_dict_min_int_slice(cell d, int kl)", + "name": "__tact_string_builder_start_tail_string", + "signature": "tuple __tact_string_builder_start_tail_string()", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); -if (flag) { - return (key, value, flag); -} else { - return (null(), null(), flag); -}", + "code": "return __tact_string_builder_start(begin_cell());", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_string_builder_start", + }, "flags": Set { "inline", }, - "name": "__tact_dict_next_int_slice", - "signature": "(int, slice, int) __tact_dict_next_int_slice(cell d, int kl, int pivot)", + "name": "__tact_string_builder_start_string", + "signature": "tuple __tact_string_builder_start_string()", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); - return (r, ()); -} else { - return (idict_set(d, kl, k, v), ()); -}", + "code": "(builder b, tuple tail) = uncons(builders); +cell c = b.end_cell(); +while(~ null?(tail)) { + (b, tail) = uncons(tail); + c = b.store_ref(c).end_cell(); +} +return c;", "kind": "generic", }, "comment": null, @@ -7383,112 +7301,203 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_slice", - "signature": "(cell, ()) __tact_dict_set_int_slice(cell d, int kl, int k, slice v)", + "name": "__tact_string_builder_end", + "signature": "cell __tact_string_builder_end(tuple builders)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); - return (r, (ok)); -} else { - return idict_replace?(d, kl, k, v); -}", + "code": "return __tact_string_builder_end(builders).begin_parse();", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_string_builder_end", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_slice", - "signature": "(cell, (int)) __tact_dict_replace_int_slice(cell d, int kl, int k, slice v)", + "name": "__tact_string_builder_end_slice", + "signature": "slice __tact_string_builder_end_slice(tuple builders)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, v); -if (ok) { - return (d, old); -} else { - return (d, null()); -}", + "code": "int sliceRefs = slice_refs(sc); +int sliceBits = slice_bits(sc); + +while((sliceBits > 0) | (sliceRefs > 0)) { + + ;; Load the current builder + (builder b, tuple tail) = uncons(builders); + int remBytes = 127 - (builder_bits(b) / 8); + int exBytes = sliceBits / 8; + + ;; Append bits + int amount = min(remBytes, exBytes); + if (amount > 0) { + slice read = sc~load_bits(amount * 8); + b = b.store_slice(read); + } + + ;; Update builders + builders = cons(b, tail); + + ;; Check if we need to add a new cell and continue + if (exBytes - amount > 0) { + var bb = begin_cell(); + builders = cons(bb, builders); + sliceBits = (exBytes - amount) * 8; + } elseif (sliceRefs > 0) { + sc = sc~load_ref().begin_parse(); + sliceRefs = slice_refs(sc); + sliceBits = slice_bits(sc); + } else { + sliceBits = 0; + sliceRefs = 0; + } +} + +return ((builders), ());", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replaceget_int_slice", - "signature": "(cell, (slice)) __tact_dict_replaceget_int_slice(cell d, int kl, int k, slice v)", + "flags": Set {}, + "name": "__tact_string_builder_append", + "signature": "((tuple), ()) __tact_string_builder_append(tuple builders, slice sc)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); -if (ok) { - return r~load_int(vl); -} else { - return null(); -}", + "code": "builders~__tact_string_builder_append(sc); +return builders;", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, - "flags": Set { - "inline", + "depends": Set { + "__tact_string_builder_append", }, - "name": "__tact_dict_get_int_int", - "signature": "int __tact_dict_get_int_int(cell d, int kl, int k, int vl)", + "flags": Set {}, + "name": "__tact_string_builder_append_not_mut", + "signature": "(tuple) __tact_string_builder_append_not_mut(tuple builders, slice sc)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min?(d, kl); -if (flag) { - return (key, value~load_int(vl), flag); + "code": "var b = begin_cell(); +if (src < 0) { + b = b.store_uint(45, 8); + src = - src; +} + +if (src < 1000000000000000000000000000000) { + int len = 0; + int value = 0; + int mult = 1; + do { + (src, int res) = src.divmod(10); + value = value + (res + 48) * mult; + mult = mult * 256; + len = len + 1; + } until (src == 0); + + b = b.store_uint(value, len * 8); } else { - return (null(), null(), flag); -}", + tuple t = empty_tuple(); + int len = 0; + do { + int digit = src % 10; + t~tpush(digit); + len = len + 1; + src = src / 10; + } until (src == 0); + + int c = len - 1; + repeat(len) { + int v = t.at(c); + b = b.store_uint(v + 48, 8); + c = c - 1; + } +} +return b.end_cell().begin_parse();", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_min_int_int", - "signature": "(int, int, int) __tact_dict_min_int_int(cell d, int kl, int vl)", + "flags": Set {}, + "name": "__tact_int_to_string", + "signature": "slice __tact_int_to_string(int src)", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); -if (flag) { - return (key, value~load_int(vl), flag); -} else { - return (null(), null(), flag); -}", + "code": "throw_if(134, (digits <= 0) | (digits > 77)); +builder b = begin_cell(); + +if (src < 0) { + b = b.store_uint(45, 8); + src = - src; +} + +;; Process rem part +int skip = true; +int len = 0; +int rem = 0; +tuple t = empty_tuple(); +repeat(digits) { + (src, rem) = src.divmod(10); + if ( ~ ( skip & ( rem == 0 ) ) ) { + skip = false; + t~tpush(rem + 48); + len = len + 1; + } +} + +;; Process dot +if (~ skip) { + t~tpush(46); + len = len + 1; +} + +;; Main +do { + (src, rem) = src.divmod(10); + t~tpush(rem + 48); + len = len + 1; +} until (src == 0); + +;; Assemble +int c = len - 1; +repeat(len) { + int v = t.at(c); + b = b.store_uint(v, 8); + c = c - 1; +} + +;; Result +return b.end_cell().begin_parse();", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_next_int_int", - "signature": "(int, int, int) __tact_dict_next_int_int(cell d, int kl, int pivot, int vl)", + "flags": Set {}, + "name": "__tact_float_to_string", + "signature": "slice __tact_float_to_string(int src, int digits)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); - return (r, ()); -} else { - return (idict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); -}", + "code": "throw_unless(5, num > 0); +throw_unless(5, base > 1); +if (num < base) { + return 0; +} +int result = 0; +while (num >= base) { + num /= base; + result += 1; +} +return result;", "kind": "generic", }, "comment": null, @@ -7497,17 +7506,17 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_int", - "signature": "(cell, ()) __tact_dict_set_int_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_log", + "signature": "int __tact_log(int num, int base)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); - return (r, (ok)); -} else { - return idict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); -}", + "code": "throw_unless(5, exp >= 0); +int result = 1; +repeat (exp) { + result *= base; +} +return result;", "kind": "generic", }, "comment": null, @@ -7516,33 +7525,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_int", - "signature": "(cell, (int)) __tact_dict_replace_int_int(cell d, int kl, int k, int v, int vl)", - }, - { - "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); -if (ok) { - return (d, old~load_int(vl)); -} else { - return (d, null()); -}", - "kind": "generic", - }, - "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replaceget_int_int", - "signature": "(cell, (int)) __tact_dict_replaceget_int_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_pow", + "signature": "int __tact_pow(int base, int exp)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); + "code": "var (r, ok) = __tact_dict_get(d, kl, k); if (ok) { - return r~load_uint(vl); + return r; } else { return null(); }", @@ -7550,18 +7540,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_get_int_uint", - "signature": "int __tact_dict_get_int_uint(cell d, int kl, int k, int vl)", + "name": "__tact_dict_get_slice_slice", + "signature": "slice __tact_dict_get_slice_slice(cell d, int kl, slice k)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min?(d, kl); + "code": "var (key, value, flag) = __tact_dict_min(d, kl); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value, flag); } else { return (null(), null(), flag); }", @@ -7569,75 +7561,78 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "__tact_dict_min_int_uint", - "signature": "(int, int, int) __tact_dict_min_int_uint(cell d, int kl, int vl)", + "name": "__tact_dict_min_slice_slice", + "signature": "(slice, slice, int) __tact_dict_min_slice_slice(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); -if (flag) { - return (key, value~load_uint(vl), flag); -} else { - return (null(), null(), flag); -}", + "code": "return __tact_dict_next(d, kl, pivot);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "__tact_dict_next_int_uint", - "signature": "(int, int, int) __tact_dict_next_int_uint(cell d, int kl, int pivot, int vl)", + "name": "__tact_dict_next_slice_slice", + "signature": "(slice, slice, int) __tact_dict_next_slice_slice(cell d, int kl, slice pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, ()); } else { - return (idict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); + return (dict_set_builder(d, kl, k, begin_cell().store_slice(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_set_int_uint", - "signature": "(cell, ()) __tact_dict_set_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_set_slice_slice", + "signature": "(cell, ()) __tact_dict_set_slice_slice(cell d, int kl, slice k, slice v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, (ok)); } else { - return idict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); + return dict_replace_builder?(d, kl, k, begin_cell().store_slice(v)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_uint", - "signature": "(cell, (int)) __tact_dict_replace_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_slice_slice", + "signature": "(cell, (int)) __tact_dict_replace_slice_slice(cell d, int kl, slice k, slice v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_slice(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_uint(vl)); + return (d, old); } else { return (d, null()); }", @@ -7645,18 +7640,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_uint", - "signature": "(cell, (int)) __tact_dict_replaceget_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_slice_slice", + "signature": "(cell, (slice)) __tact_dict_replaceget_slice_slice(cell d, int kl, slice k, slice v)", }, { "code": { - "code": "var (r, ok) = idict_get_ref?(d, kl, k); + "code": "var (r, ok) = __tact_dict_get(d, kl, k); if (ok) { - return r; + return r~load_int(vl); } else { return null(); }", @@ -7664,18 +7661,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_get_int_cell", - "signature": "cell __tact_dict_get_int_cell(cell d, int kl, int k)", + "name": "__tact_dict_get_slice_int", + "signature": "int __tact_dict_get_slice_int(cell d, int kl, slice k, int vl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min_ref?(d, kl); + "code": "var (key, value, flag) = __tact_dict_min(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_int(vl), flag); } else { return (null(), null(), flag); }", @@ -7683,18 +7682,20 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "__tact_dict_min_int_cell", - "signature": "(int, cell, int) __tact_dict_min_int_cell(cell d, int kl)", + "name": "__tact_dict_min_slice_int", + "signature": "(slice, int, int) __tact_dict_min_slice_int(cell d, int kl, int vl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); if (flag) { - return (key, value~load_ref(), flag); + return (key, value~load_int(vl), flag); } else { return (null(), null(), flag); }", @@ -7702,56 +7703,62 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "__tact_dict_next_int_cell", - "signature": "(int, cell, int) __tact_dict_next_int_cell(cell d, int kl, int pivot)", + "name": "__tact_dict_next_slice_int", + "signature": "(slice, int, int) __tact_dict_next_slice_int(cell d, int kl, slice pivot, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, ()); } else { - return (idict_set_ref(d, kl, k, v), ()); + return (dict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_set_int_cell", - "signature": "(cell, ()) __tact_dict_set_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_set_slice_int", + "signature": "(cell, ()) __tact_dict_set_slice_int(cell d, int kl, slice k, int v, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, (ok)); } else { - return idict_replace_ref?(d, kl, k, v); + return dict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_cell", - "signature": "(cell, (int)) __tact_dict_replace_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replace_slice_int", + "signature": "(cell, (int)) __tact_dict_replace_slice_int(cell d, int kl, slice k, int v, int vl)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get_ref?(kl, k) : d~idict_replaceget_ref?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_int(vl)); } else { return (d, null()); }", @@ -7759,18 +7766,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_cell", - "signature": "(cell, (cell)) __tact_dict_replaceget_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replaceget_slice_int", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_int(cell d, int kl, slice k, int v, int vl)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); + "code": "var (r, ok) = __tact_dict_get(d, kl, k); if (ok) { - return r~load_coins(); + return r~load_uint(vl); } else { return null(); }", @@ -7778,18 +7787,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_get_int_coins", - "signature": "int __tact_dict_get_int_coins(cell d, int kl, int k)", + "name": "__tact_dict_get_slice_uint", + "signature": "int __tact_dict_get_slice_uint(cell d, int kl, slice k, int vl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min?(d, kl); + "code": "var (key, value, flag) = __tact_dict_min(d, kl); if (flag) { - return (key, value~load_coins(), flag); + return (key, value~load_uint(vl), flag); } else { return (null(), null(), flag); }", @@ -7797,18 +7808,20 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "__tact_dict_min_int_coins", - "signature": "(int, int, int) __tact_dict_min_int_coins(cell d, int kl)", + "name": "__tact_dict_min_slice_uint", + "signature": "(slice, int, int) __tact_dict_min_slice_uint(cell d, int kl, int vl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); if (flag) { - return (key, value~load_coins(), flag); + return (key, value~load_uint(vl), flag); } else { return (null(), null(), flag); }", @@ -7816,56 +7829,62 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "__tact_dict_next_int_coins", - "signature": "(int, int, int) __tact_dict_next_int_coins(cell d, int kl, int pivot)", + "name": "__tact_dict_next_slice_uint", + "signature": "(slice, int, int) __tact_dict_next_slice_uint(cell d, int kl, slice pivot, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, ()); } else { - return (idict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); + return (dict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_set_int_coins", - "signature": "(cell, ()) __tact_dict_set_int_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_set_slice_uint", + "signature": "(cell, ()) __tact_dict_set_slice_uint(cell d, int kl, slice k, int v, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, (ok)); } else { - return idict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); + return dict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_coins", - "signature": "(cell, (int)) __tact_dict_replace_int_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replace_slice_uint", + "signature": "(cell, (int)) __tact_dict_replace_slice_uint(cell d, int kl, slice k, int v, int vl)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); if (ok) { - return (d, old~load_coins()); + return (d, old~load_uint(vl)); } else { return (d, null()); }", @@ -7873,990 +7892,1200 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_coins", - "signature": "(cell, (int)) __tact_dict_replaceget_int_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replaceget_slice_uint", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_uint(cell d, int kl, slice k, int v, int vl)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); -return ok;", + "code": "var (r, ok) = __tact_dict_get_ref(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set { - "__tact_dict_get", + "__tact_dict_get_ref", }, "flags": Set { "inline", }, - "name": "__tact_dict_exists_slice", - "signature": "int __tact_dict_exists_slice(cell d, int kl, slice k)", + "name": "__tact_dict_get_slice_cell", + "signature": "cell __tact_dict_get_slice_cell(cell d, int kl, slice k)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); -return ok;", + "code": "var (key, value, flag) = __tact_dict_min_ref(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_min_ref", + }, "flags": Set { "inline", }, - "name": "__tact_dict_exists_uint", - "signature": "int __tact_dict_exists_uint(cell d, int kl, int k)", + "name": "__tact_dict_min_slice_cell", + "signature": "(slice, cell, int) __tact_dict_min_slice_cell(cell d, int kl)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); -return ok;", + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_ref(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "__tact_dict_exists_int", - "signature": "int __tact_dict_exists_int(cell d, int kl, int k)", - }, - { - "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -build_0 = build_0.store_int(v'a, 257); -build_0 = build_0.store_int(v'b, 257); -build_0 = ~ null?(v'c) ? build_0.store_int(true, 1).store_int(v'c, 257) : build_0.store_int(false, 1); -build_0 = build_0.store_int(v'd, 1); -build_0 = ~ null?(v'e) ? build_0.store_int(true, 1).store_int(v'e, 1) : build_0.store_int(false, 1); -var build_1 = begin_cell(); -build_1 = build_1.store_int(v'f, 257); -build_1 = build_1.store_int(v'g, 257); -build_0 = store_ref(build_0, build_1.end_cell()); -return build_0;", - "kind": "generic", - }, - "comment": null, - "context": "type:B", - "depends": Set {}, - "flags": Set {}, - "name": "$B$_store", - "signature": "builder $B$_store(builder build_0, (int, int, int, int, int, int, int) v)", + "name": "__tact_dict_next_slice_cell", + "signature": "(slice, cell, int) __tact_dict_next_slice_cell(cell d, int kl, slice pivot)", }, { "code": { - "code": "return $B$_store(begin_cell(), v).end_cell();", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return __tact_dict_set_ref(d, kl, k, v); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set { - "$B$_store", + "__tact_dict_delete", + "__tact_dict_set_ref", }, "flags": Set { "inline", }, - "name": "$B$_store_cell", - "signature": "cell $B$_store_cell((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_set_slice_cell", + "signature": "(cell, ()) __tact_dict_set_slice_cell(cell d, int kl, slice k, cell v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'a;", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return __tact_dict_replace_ref(d, kl, k, v); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + "__tact_dict_replace_ref", + }, "flags": Set { "inline", }, - "name": "$A$_get_a", - "signature": "_ $A$_get_a((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replace_slice_cell", + "signature": "(cell, (int)) __tact_dict_replace_slice_cell(cell d, int kl, slice k, cell v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'b;", + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get_ref(kl, k) : d~__tact_dict_replaceget_ref(kl, k, v); +if (ok) { + return (d, old); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get_ref", + "__tact_dict_replaceget_ref", + }, "flags": Set { "inline", }, - "name": "$A$_get_b", - "signature": "_ $A$_get_b((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replaceget_slice_cell", + "signature": "(cell, (cell)) __tact_dict_replaceget_slice_cell(cell d, int kl, slice k, cell v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'c;", + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_coins(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, "flags": Set { "inline", }, - "name": "$A$_get_c", - "signature": "_ $A$_get_c((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_get_slice_coins", + "signature": "int __tact_dict_get_slice_coins(cell d, int kl, slice k)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'd;", + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "$A$_get_d", - "signature": "_ $A$_get_d((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_min_slice_coins", + "signature": "(slice, int, int) __tact_dict_min_slice_coins(cell d, int kl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'e;", + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "$A$_get_e", - "signature": "_ $A$_get_e((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_next_slice_coins", + "signature": "(slice, int, int) __tact_dict_next_slice_coins(cell d, int kl, slice pivot)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'f;", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "$A$_get_f", - "signature": "_ $A$_get_f((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_set_slice_coins", + "signature": "(cell, ()) __tact_dict_set_slice_coins(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'g;", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "$A$_get_g", - "signature": "_ $A$_get_g((int, int, int, int, int, int, int) v)", - }, - { - "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", - }, - "comment": null, - "context": "type:A", - "depends": Set {}, - "flags": Set {}, - "name": "$A$_tensor_cast", - "signature": "((int, int, int, int, int, int, int)) $A$_tensor_cast((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replace_slice_coins", + "signature": "(cell, (int)) __tact_dict_replace_slice_coins(cell d, int kl, slice k, int v)", }, { "code": { - "code": "throw_if(128, null?(v)); -var (int vvv'a, int vvv'b, int vvv'c, int vvv'd, int vvv'e, int vvv'f, int vvv'g) = __tact_tuple_destroy_7(v); -return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g);", + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_coins()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set { - "__tact_tuple_destroy_7", + "__tact_dict_delete_get", }, "flags": Set { "inline", }, - "name": "$A$_not_null", - "signature": "((int, int, int, int, int, int, int)) $A$_not_null(tuple v)", + "name": "__tact_dict_replaceget_slice_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_coins(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_varint16(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set { - "__tact_tuple_create_7", + "__tact_dict_get", }, "flags": Set { "inline", }, - "name": "$A$_as_optional", - "signature": "tuple $A$_as_optional((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_get_slice_varint16", + "signature": "int __tact_dict_get_slice_varint16(cell d, int kl, slice k)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set { - "__tact_tuple_create_7", + "__tact_dict_min", }, "flags": Set { "inline", }, - "name": "$A$_to_tuple", - "signature": "tuple $A$_to_tuple(((int, int, int, int, int, int, int)) v)", + "name": "__tact_dict_min_slice_varint16", + "signature": "(slice, int, int) __tact_dict_min_slice_varint16(cell d, int kl)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $A$_to_tuple($A$_not_null(v)); ", - "kind": "generic", + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set { - "$A$_to_tuple", - "$A$_not_null", + "__tact_dict_next", }, "flags": Set { "inline", }, - "name": "$A$_to_opt_tuple", - "signature": "tuple $A$_to_opt_tuple(tuple v)", + "name": "__tact_dict_next_slice_varint16", + "signature": "(slice, int, int) __tact_dict_next_slice_varint16(cell d, int kl, slice pivot)", }, { "code": { - "code": "var (int v'a, int v'b, int v'c, int v'd, int v'e, int v'f, int v'g) = __tact_tuple_destroy_7(v); -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set { - "__tact_tuple_destroy_7", + "__tact_dict_delete", }, "flags": Set { "inline", }, - "name": "$A$_from_tuple", - "signature": "(int, int, int, int, int, int, int) $A$_from_tuple(tuple v)", + "name": "__tact_dict_set_slice_varint16", + "signature": "(cell, ()) __tact_dict_set_slice_varint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $A$_as_optional($A$_from_tuple(v));", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_varint16(v)); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set { - "$A$_as_optional", - "$A$_from_tuple", + "__tact_dict_delete", }, "flags": Set { "inline", }, - "name": "$A$_from_opt_tuple", - "signature": "tuple $A$_from_opt_tuple(tuple v)", + "name": "__tact_dict_replace_slice_varint16", + "signature": "(cell, (int)) __tact_dict_replace_slice_varint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint16()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "$A$_to_external", - "signature": "(int, int, int, int, int, int, int) $A$_to_external(((int, int, int, int, int, int, int)) v)", + "name": "__tact_dict_replaceget_slice_varint16", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var loaded = $A$_to_opt_tuple(v); -if (null?(loaded)) { - return null(); + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_varint32(); } else { - return (loaded); + return null(); }", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set { - "$A$_to_opt_tuple", + "__tact_dict_get", }, "flags": Set { "inline", }, - "name": "$A$_to_opt_external", - "signature": "tuple $A$_to_opt_external(tuple v)", + "name": "__tact_dict_get_slice_varint32", + "signature": "int __tact_dict_get_slice_varint32(cell d, int kl, slice k)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'a;", + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "$B$_get_a", - "signature": "_ $B$_get_a((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_min_slice_varint32", + "signature": "(slice, int, int) __tact_dict_min_slice_varint32(cell d, int kl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'b;", + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "$B$_get_b", - "signature": "_ $B$_get_b((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_next_slice_varint32", + "signature": "(slice, int, int) __tact_dict_next_slice_varint32(cell d, int kl, slice pivot)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'c;", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "$B$_get_c", - "signature": "_ $B$_get_c((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_set_slice_varint32", + "signature": "(cell, ()) __tact_dict_set_slice_varint32(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'd;", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_varint32(v)); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "$B$_get_d", - "signature": "_ $B$_get_d((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replace_slice_varint32", + "signature": "(cell, (int)) __tact_dict_replace_slice_varint32(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'e;", + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint32()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "$B$_get_e", - "signature": "_ $B$_get_e((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replaceget_slice_varint32", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varint32(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'f;", + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_varuint16(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, "flags": Set { "inline", }, - "name": "$B$_get_f", - "signature": "_ $B$_get_f((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_get_slice_varuint16", + "signature": "int __tact_dict_get_slice_varuint16(cell d, int kl, slice k)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'g;", + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "$B$_get_g", - "signature": "_ $B$_get_g((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_min_slice_varuint16", + "signature": "(slice, int, int) __tact_dict_min_slice_varuint16(cell d, int kl)", }, { "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set {}, - "flags": Set {}, - "name": "$B$_tensor_cast", - "signature": "((int, int, int, int, int, int, int)) $B$_tensor_cast((int, int, int, int, int, int, int) v)", + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_varuint16", + "signature": "(slice, int, int) __tact_dict_next_slice_varuint16(cell d, int kl, slice pivot)", }, { "code": { - "code": "throw_if(128, null?(v)); -var (int vvv'a, int vvv'b, int vvv'c, int vvv'd, int vvv'e, int vvv'f, int vvv'g) = __tact_tuple_destroy_7(v); -return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g);", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set { - "__tact_tuple_destroy_7", + "__tact_dict_delete", }, "flags": Set { "inline", }, - "name": "$B$_not_null", - "signature": "((int, int, int, int, int, int, int)) $B$_not_null(tuple v)", + "name": "__tact_dict_set_slice_varuint16", + "signature": "(cell, ()) __tact_dict_set_slice_varuint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v)); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set { - "__tact_tuple_create_7", + "__tact_dict_delete", }, "flags": Set { "inline", }, - "name": "$B$_as_optional", - "signature": "tuple $B$_as_optional((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replace_slice_varuint16", + "signature": "(cell, (int)) __tact_dict_replace_slice_varuint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint16()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set { - "__tact_tuple_create_7", + "__tact_dict_delete_get", }, "flags": Set { "inline", }, - "name": "$B$_to_tuple", - "signature": "tuple $B$_to_tuple(((int, int, int, int, int, int, int)) v)", + "name": "__tact_dict_replaceget_slice_varuint16", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varuint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $B$_to_tuple($B$_not_null(v)); ", + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_varuint32(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set { - "$B$_to_tuple", - "$B$_not_null", + "__tact_dict_get", }, "flags": Set { "inline", }, - "name": "$B$_to_opt_tuple", - "signature": "tuple $B$_to_opt_tuple(tuple v)", + "name": "__tact_dict_get_slice_varuint32", + "signature": "int __tact_dict_get_slice_varuint32(cell d, int kl, slice k)", }, { "code": { - "code": "var (int v'a, int v'b, int v'c, int v'd, int v'e, int v'f, int v'g) = __tact_tuple_destroy_7(v); -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set { - "__tact_tuple_destroy_7", + "__tact_dict_min", }, "flags": Set { "inline", }, - "name": "$B$_from_tuple", - "signature": "(int, int, int, int, int, int, int) $B$_from_tuple(tuple v)", + "name": "__tact_dict_min_slice_varuint32", + "signature": "(slice, int, int) __tact_dict_min_slice_varuint32(cell d, int kl)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $B$_as_optional($B$_from_tuple(v));", + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set { - "$B$_as_optional", - "$B$_from_tuple", + "__tact_dict_next", }, "flags": Set { "inline", }, - "name": "$B$_from_opt_tuple", - "signature": "tuple $B$_from_opt_tuple(tuple v)", + "name": "__tact_dict_next_slice_varuint32", + "signature": "(slice, int, int) __tact_dict_next_slice_varuint32(cell d, int kl, slice pivot)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "$B$_to_external", - "signature": "(int, int, int, int, int, int, int) $B$_to_external(((int, int, int, int, int, int, int)) v)", + "name": "__tact_dict_set_slice_varuint32", + "signature": "(cell, ()) __tact_dict_set_slice_varuint32(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var loaded = $B$_to_opt_tuple(v); -if (null?(loaded)) { - return null(); + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); } else { - return (loaded); + return dict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v)); }", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set { - "$B$_to_opt_tuple", + "__tact_dict_delete", }, "flags": Set { "inline", }, - "name": "$B$_to_opt_external", - "signature": "tuple $B$_to_opt_external(tuple v)", + "name": "__tact_dict_replace_slice_varuint32", + "signature": "(cell, (int)) __tact_dict_replace_slice_varuint32(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'a;", + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint32()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "$C$_get_a", - "signature": "_ $C$_get_a((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_replaceget_slice_varuint32", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varuint32(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'b;", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_b", - "signature": "_ $C$_get_b((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_get_uint_slice", + "signature": "slice __tact_dict_get_uint_slice(cell d, int kl, int k)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'c;", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_c", - "signature": "_ $C$_get_c((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_min_uint_slice", + "signature": "(int, slice, int) __tact_dict_min_uint_slice(cell d, int kl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'd;", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_d", - "signature": "_ $C$_get_d((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_next_uint_slice", + "signature": "(int, slice, int) __tact_dict_next_uint_slice(cell d, int kl, int pivot)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'e;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set(d, kl, k, v), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_e", - "signature": "_ $C$_get_e((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_set_uint_slice", + "signature": "(cell, ()) __tact_dict_set_uint_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'f;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace?(d, kl, k, v); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_f", - "signature": "_ $C$_get_f((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_replace_uint_slice", + "signature": "(cell, (int)) __tact_dict_replace_uint_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'g;", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, v); +if (ok) { + return (d, old); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_g", - "signature": "_ $C$_get_g((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_replaceget_uint_slice", + "signature": "(cell, (slice)) __tact_dict_replaceget_uint_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'h;", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_int(vl); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_h", - "signature": "_ $C$_get_h((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_get_uint_int", + "signature": "int __tact_dict_get_uint_int(cell d, int kl, int k, int vl)", }, { "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "$C$_tensor_cast", - "signature": "((cell, cell, slice, slice, int, int, int, slice)) $C$_tensor_cast((cell, cell, slice, slice, int, int, int, slice) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_uint_int", + "signature": "(int, int, int) __tact_dict_min_uint_int(cell d, int kl, int vl)", }, { "code": { - "code": "throw_if(128, null?(v)); -var (cell vvv'a, cell vvv'b, slice vvv'c, slice vvv'd, int vvv'e, int vvv'f, int vvv'g, slice vvv'h) = __tact_tuple_destroy_8(v); -return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g, vvv'h);", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "__tact_tuple_destroy_8", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_not_null", - "signature": "((cell, cell, slice, slice, int, int, int, slice)) $C$_not_null(tuple v)", + "name": "__tact_dict_next_uint_int", + "signature": "(int, int, int) __tact_dict_next_uint_int(cell d, int kl, int pivot, int vl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return __tact_tuple_create_8(v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "__tact_tuple_create_8", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_as_optional", - "signature": "tuple $C$_as_optional((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_set_uint_int", + "signature": "(cell, ()) __tact_dict_set_uint_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return __tact_tuple_create_8(v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "__tact_tuple_create_8", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_to_tuple", - "signature": "tuple $C$_to_tuple(((cell, cell, slice, slice, int, int, int, slice)) v)", + "name": "__tact_dict_replace_uint_int", + "signature": "(cell, (int)) __tact_dict_replace_uint_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $C$_to_tuple($C$_not_null(v)); ", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_int(vl)); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "$C$_to_tuple", - "$C$_not_null", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_to_opt_tuple", - "signature": "tuple $C$_to_opt_tuple(tuple v)", + "name": "__tact_dict_replaceget_uint_int", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (cell v'a, cell v'b, slice v'c, slice v'd, int v'e, int v'f, int v'g, slice v'h) = __tact_tuple_destroy_8(v); -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", - "kind": "generic", - }, - "comment": null, - "context": "type:C", - "depends": Set { - "__tact_tuple_destroy_8", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_uint(vl); +} else { + return null(); +}", + "kind": "generic", }, + "comment": null, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_from_tuple", - "signature": "(cell, cell, slice, slice, int, int, int, slice) $C$_from_tuple(tuple v)", + "name": "__tact_dict_get_uint_uint", + "signature": "int __tact_dict_get_uint_uint(cell d, int kl, int k, int vl)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $C$_as_optional($C$_from_tuple(v));", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_uint(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "$C$_as_optional", - "$C$_from_tuple", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_from_opt_tuple", - "signature": "tuple $C$_from_opt_tuple(tuple v)", + "name": "__tact_dict_min_uint_uint", + "signature": "(int, int, int) __tact_dict_min_uint_uint(cell d, int kl, int vl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_uint(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_to_external", - "signature": "(cell, cell, slice, slice, int, int, int, slice) $C$_to_external(((cell, cell, slice, slice, int, int, int, slice)) v)", + "name": "__tact_dict_next_uint_uint", + "signature": "(int, int, int) __tact_dict_next_uint_uint(cell d, int kl, int pivot, int vl)", }, { "code": { - "code": "var loaded = $C$_to_opt_tuple(v); -if (null?(loaded)) { - return null(); + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); } else { - return (loaded); + return (udict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); }", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "$C$_to_opt_tuple", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_to_opt_external", - "signature": "tuple $C$_to_opt_external(tuple v)", + "name": "__tact_dict_set_uint_uint", + "signature": "(cell, ()) __tact_dict_set_uint_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var v'a = sc_0~load_int(257); -var v'b = sc_0~load_int(257); -var v'c = sc_0~load_int(1) ? sc_0~load_int(257) : null(); -var v'd = sc_0~load_int(1); -var v'e = sc_0~load_int(1) ? sc_0~load_int(1) : null(); -slice sc_1 = sc_0~load_ref().begin_parse(); -var v'f = sc_1~load_int(257); -var v'g = sc_1~load_int(257); -return (sc_0, (v'a, v'b, v'c, v'd, v'e, v'f, v'g));", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "$B$_load", - "signature": "(slice, ((int, int, int, int, int, int, int))) $B$_load(slice sc_0)", - }, - { - "code": { - "code": "var r = sc_0~$B$_load(); -sc_0.end_parse(); -return r;", - "kind": "generic", - }, - "comment": null, - "context": "type:B", - "depends": Set { - "$B$_load", + "flags": Set { + "inline", }, - "flags": Set {}, - "name": "$B$_load_not_mut", - "signature": "((int, int, int, int, int, int, int)) $B$_load_not_mut(slice sc_0)", + "name": "__tact_dict_replace_uint_uint", + "signature": "(cell, (int)) __tact_dict_replace_uint_uint(cell d, int kl, int k, int v, int vl)", }, -] -`; - -exports[`writeSerialization should write serializer for C 1`] = ` -[ { "code": { - "kind": "skip", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_uint(vl)); +} else { + return (d, null()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_set", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_uint_uint", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "kind": "skip", + "code": "var (r, ok) = udict_get_ref?(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_nop", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_uint_cell", + "signature": "cell __tact_dict_get_uint_cell(cell d, int kl, int k)", }, { "code": { - "kind": "skip", + "code": "var (key, value, flag) = udict_get_min_ref?(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_str_to_slice", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_uint_cell", + "signature": "(int, cell, int) __tact_dict_min_uint_cell(cell d, int kl)", }, { "code": { - "kind": "skip", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_ref(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_slice_to_str", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_uint_cell", + "signature": "(int, cell, int) __tact_dict_next_uint_cell(cell d, int kl, int pivot)", }, { "code": { - "kind": "skip", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_ref(d, kl, k, v), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_address_to_slice", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_uint_cell", + "signature": "(cell, ()) __tact_dict_set_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "slice raw = cs~load_msg_addr(); -return (cs, raw);", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_ref?(d, kl, k, v); +}", "kind": "generic", }, "comment": null, @@ -8865,17 +9094,16 @@ return (cs, raw);", "flags": Set { "inline", }, - "name": "__tact_load_address", - "signature": "(slice, slice) __tact_load_address(slice cs)", + "name": "__tact_dict_replace_uint_cell", + "signature": "(cell, (int)) __tact_dict_replace_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "if (cs.preload_uint(2) != 0) { - slice raw = cs~load_msg_addr(); - return (cs, raw); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get_ref?(kl, k) : d~udict_replaceget_ref?(kl, k, v); +if (ok) { + return (d, old); } else { - cs~skip_bits(2); - return (cs, null()); + return (d, null()); }", "kind": "generic", }, @@ -8885,12 +9113,17 @@ return (cs, raw);", "flags": Set { "inline", }, - "name": "__tact_load_address_opt", - "signature": "(slice, slice) __tact_load_address_opt(slice cs)", + "name": "__tact_dict_replaceget_uint_cell", + "signature": "(cell, (cell)) __tact_dict_replaceget_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "return b.store_slice(address);", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_coins(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, @@ -8899,39 +9132,36 @@ return (cs, raw);", "flags": Set { "inline", }, - "name": "__tact_store_address", - "signature": "builder __tact_store_address(builder b, slice address)", + "name": "__tact_dict_get_uint_coins", + "signature": "int __tact_dict_get_uint_coins(cell d, int kl, int k)", }, { "code": { - "code": "if (null?(address)) { - b = b.store_uint(0, 2); - return b; + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_coins(), flag); } else { - return __tact_store_address(b, address); + return (null(), null(), flag); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_store_address", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_store_address_opt", - "signature": "builder __tact_store_address_opt(builder b, slice address)", + "name": "__tact_dict_min_uint_coins", + "signature": "(int, int, int) __tact_dict_min_uint_coins(cell d, int kl)", }, { "code": { - "code": "var b = begin_cell(); -b = b.store_uint(2, 2); -b = b.store_uint(0, 1); -b = b.store_int(chain, 8); -b = b.store_uint(hash, 256); -var addr = b.end_cell().begin_parse(); -return addr;", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -8940,290 +9170,360 @@ return addr;", "flags": Set { "inline", }, - "name": "__tact_create_address", - "signature": "slice __tact_create_address(int chain, int hash)", + "name": "__tact_dict_next_uint_coins", + "signature": "(int, int, int) __tact_dict_next_uint_coins(cell d, int kl, int pivot)", }, { "code": { - "code": "var b = begin_cell(); -b = b.store_uint(0, 2); -b = b.store_uint(3, 2); -b = b.store_uint(0, 1); -b = b.store_ref(code); -b = b.store_ref(data); -var hash = cell_hash(b.end_cell()); -return __tact_create_address(chain, hash);", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_create_address", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_compute_contract_address", - "signature": "slice __tact_compute_contract_address(int chain, cell code, cell data)", + "name": "__tact_dict_set_uint_coins", + "signature": "(cell, ()) __tact_dict_set_uint_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "throw_if(128, null?(x)); return x;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); +}", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set { - "impure", "inline", }, - "name": "__tact_not_null", - "signature": "forall X -> X __tact_not_null(X x)", + "name": "__tact_dict_replace_uint_coins", + "signature": "(cell, (int)) __tact_dict_replace_uint_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "DICTDEL", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_coins()); +} else { + return (d, null()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_delete", - "signature": "(cell, int) __tact_dict_delete(cell dict, int key_len, slice index)", - }, - { - "code": { - "code": "DICTIDEL", - "kind": "asm", - "shuffle": "(index dict key_len)", + "flags": Set { + "inline", }, - "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_delete_int", - "signature": "(cell, int) __tact_dict_delete_int(cell dict, int key_len, int index)", + "name": "__tact_dict_replaceget_uint_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "DICTUDEL", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_varint16(); +} else { + return null(); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_delete_uint", - "signature": "(cell, int) __tact_dict_delete_uint(cell dict, int key_len, int index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_uint_varint16", + "signature": "int __tact_dict_get_uint_varint16(cell d, int kl, int k)", }, { "code": { - "code": "DICTSETREF", - "kind": "asm", - "shuffle": "(value index dict key_len)", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_set_ref", - "signature": "((cell), ()) __tact_dict_set_ref(cell dict, int key_len, slice index, cell value)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_uint_varint16", + "signature": "(int, int, int) __tact_dict_min_uint_varint16(cell d, int kl)", }, { "code": { - "code": "DICTREPLACEREF", - "kind": "asm", - "shuffle": "(value index dict key_len)", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_replace_ref", - "signature": "((cell), (int)) __tact_dict_replace_ref(cell dict, int key_len, slice index, cell value)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_uint_varint16", + "signature": "(int, int, int) __tact_dict_next_uint_varint16(cell d, int kl, int pivot)", }, { "code": { - "code": "DICTREPLACEGETREF NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(value index dict key_len)", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_replaceget_ref", - "signature": "((cell), (cell, int)) __tact_dict_replaceget_ref(cell dict, int key_len, slice index, cell value)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_uint_varint16", + "signature": "(cell, ()) __tact_dict_set_uint_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "DICTGET NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_varint16(v)); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_get", - "signature": "(slice, int) __tact_dict_get(cell dict, int key_len, slice index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_uint_varint16", + "signature": "(cell, (int)) __tact_dict_replace_uint_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "DICTDELGET NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint16()); +} else { + return (d, null()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_delete_get", - "signature": "(cell, (slice, int)) __tact_dict_delete_get(cell dict, int key_len, slice index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_uint_varint16", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "DICTDELGETREF NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_varint32(); +} else { + return null(); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_delete_get_ref", - "signature": "(cell, (cell, int)) __tact_dict_delete_get_ref(cell dict, int key_len, slice index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_uint_varint32", + "signature": "int __tact_dict_get_uint_varint32(cell d, int kl, int k)", }, { "code": { - "code": "DICTGETREF NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_get_ref", - "signature": "(cell, int) __tact_dict_get_ref(cell dict, int key_len, slice index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_uint_varint32", + "signature": "(int, int, int) __tact_dict_min_uint_varint32(cell d, int kl)", }, { "code": { - "code": "DICTMIN NULLSWAPIFNOT2", - "kind": "asm", - "shuffle": "(dict key_len -> 1 0 2)", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_min", - "signature": "(slice, slice, int) __tact_dict_min(cell dict, int key_len)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_uint_varint32", + "signature": "(int, int, int) __tact_dict_next_uint_varint32(cell d, int kl, int pivot)", }, { "code": { - "code": "DICTMINREF NULLSWAPIFNOT2", - "kind": "asm", - "shuffle": "(dict key_len -> 1 0 2)", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_min_ref", - "signature": "(slice, cell, int) __tact_dict_min_ref(cell dict, int key_len)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_uint_varint32", + "signature": "(cell, ()) __tact_dict_set_uint_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "DICTGETNEXT NULLSWAPIFNOT2", - "kind": "asm", - "shuffle": "(pivot dict key_len -> 1 0 2)", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_varint32(v)); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_next", - "signature": "(slice, slice, int) __tact_dict_next(cell dict, int key_len, slice pivot)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_uint_varint32", + "signature": "(cell, (int)) __tact_dict_replace_uint_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(dict, key_len, pivot); -if (flag) { - return (key, value~load_ref(), flag); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint32()); } else { - return (null(), null(), flag); + return (d, null()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", + "depends": Set {}, + "flags": Set { + "inline", }, - "flags": Set {}, - "name": "__tact_dict_next_ref", - "signature": "(slice, cell, int) __tact_dict_next_ref(cell dict, int key_len, slice pivot)", + "name": "__tact_dict_replaceget_uint_varint32", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "STRDUMP DROP STRDUMP DROP s0 DUMP DROP", - "kind": "asm", - "shuffle": "", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_varuint16(); +} else { + return null(); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug", - "signature": "forall X -> () __tact_debug(X value, slice debug_print_1, slice debug_print_2)", + "name": "__tact_dict_get_uint_varuint16", + "signature": "int __tact_dict_get_uint_varuint16(cell d, int kl, int k)", }, { "code": { - "code": "STRDUMP DROP STRDUMP DROP STRDUMP DROP", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug_str", - "signature": "() __tact_debug_str(slice value, slice debug_print_1, slice debug_print_2)", + "name": "__tact_dict_min_uint_varuint16", + "signature": "(int, int, int) __tact_dict_min_uint_varuint16(cell d, int kl)", }, { "code": { - "code": "if (value) { - __tact_debug_str("true", debug_print_1, debug_print_2); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varuint16(), flag); } else { - __tact_debug_str("false", debug_print_1, debug_print_2); + return (null(), null(), flag); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_debug_str", - }, + "depends": Set {}, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug_bool", - "signature": "() __tact_debug_bool(int value, slice debug_print_1, slice debug_print_2)", + "name": "__tact_dict_next_uint_varuint16", + "signature": "(int, int, int) __tact_dict_next_uint_varuint16(cell d, int kl, int pivot)", }, { "code": { - "code": "SDSUBSTR", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", @@ -9231,140 +9531,112 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_preload_offset", - "signature": "(slice) __tact_preload_offset(slice s, int offset, int bits)", + "name": "__tact_dict_set_uint_varuint16", + "signature": "(cell, ()) __tact_dict_set_uint_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "slice new_data = begin_cell() - .store_slice(data) - .store_slice("0000"s) -.end_cell().begin_parse(); -int reg = 0; -while (~ new_data.slice_data_empty?()) { - int byte = new_data~load_uint(8); - int mask = 0x80; - while (mask > 0) { - reg <<= 1; - if (byte & mask) { - reg += 1; - } - mask >>= 1; - if (reg > 0xffff) { - reg &= 0xffff; - reg ^= 0x1021; - } - } -} -(int q, int r) = divmod(reg, 256); -return begin_cell() - .store_uint(q, 8) - .store_uint(r, 8) -.end_cell().begin_parse();", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v)); +}", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set { - "inline_ref", + "inline", }, - "name": "__tact_crc16", - "signature": "(slice) __tact_crc16(slice data)", + "name": "__tact_dict_replace_uint_varuint16", + "signature": "(cell, (int)) __tact_dict_replace_uint_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "slice chars = "4142434445464748494A4B4C4D4E4F505152535455565758595A6162636465666768696A6B6C6D6E6F707172737475767778797A303132333435363738392D5F"s; -builder res = begin_cell(); - -while (data.slice_bits() >= 24) { - (int bs1, int bs2, int bs3) = (data~load_uint(8), data~load_uint(8), data~load_uint(8)); - - int n = (bs1 << 16) | (bs2 << 8) | bs3; - - res = res - .store_slice(__tact_preload_offset(chars, ((n >> 18) & 63) * 8, 8)) - .store_slice(__tact_preload_offset(chars, ((n >> 12) & 63) * 8, 8)) - .store_slice(__tact_preload_offset(chars, ((n >> 6) & 63) * 8, 8)) - .store_slice(__tact_preload_offset(chars, ((n ) & 63) * 8, 8)); -} - -return res.end_cell().begin_parse();", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint16()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_preload_offset", + "depends": Set {}, + "flags": Set { + "inline", }, - "flags": Set {}, - "name": "__tact_base64_encode", - "signature": "(slice) __tact_base64_encode(slice data)", + "name": "__tact_dict_replaceget_uint_varuint16", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "(int wc, int hash) = address.parse_std_addr(); - -slice user_friendly_address = begin_cell() - .store_slice("11"s) - .store_uint((wc + 0x100) % 0x100, 8) - .store_uint(hash, 256) -.end_cell().begin_parse(); - -slice checksum = __tact_crc16(user_friendly_address); -slice user_friendly_address_with_checksum = begin_cell() - .store_slice(user_friendly_address) - .store_slice(checksum) -.end_cell().begin_parse(); - -return __tact_base64_encode(user_friendly_address_with_checksum);", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_varuint32(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_crc16", - "__tact_base64_encode", + "depends": Set {}, + "flags": Set { + "inline", }, - "flags": Set {}, - "name": "__tact_address_to_user_friendly", - "signature": "(slice) __tact_address_to_user_friendly(slice address)", + "name": "__tact_dict_get_uint_varuint32", + "signature": "int __tact_dict_get_uint_varuint32(cell d, int kl, int k)", }, { "code": { - "code": "__tact_debug_str(__tact_address_to_user_friendly(address), debug_print_1, debug_print_2);", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_debug_str", - "__tact_address_to_user_friendly", - }, + "depends": Set {}, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug_address", - "signature": "() __tact_debug_address(slice address, slice debug_print_1, slice debug_print_2)", + "name": "__tact_dict_min_uint_varuint32", + "signature": "(int, int, int) __tact_dict_min_uint_varuint32(cell d, int kl)", }, { "code": { - "code": "STRDUMP DROP STRDUMP DROP DUMPSTK", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug_stack", - "signature": "() __tact_debug_stack(slice debug_print_1, slice debug_print_2)", + "name": "__tact_dict_next_uint_varuint32", + "signature": "(int, int, int) __tact_dict_next_uint_varuint32(cell d, int kl, int pivot)", }, { "code": { - "code": "return __tact_context;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ()); +}", "kind": "generic", }, "comment": null, @@ -9373,12 +9645,17 @@ return __tact_base64_encode(user_friendly_address_with_checksum);", "flags": Set { "inline", }, - "name": "__tact_context_get", - "signature": "(int, slice, int, slice) __tact_context_get()", + "name": "__tact_dict_set_uint_varuint32", + "signature": "(cell, ()) __tact_dict_set_uint_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "return __tact_context_sender;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v)); +}", "kind": "generic", }, "comment": null, @@ -9387,14 +9664,16 @@ return __tact_base64_encode(user_friendly_address_with_checksum);", "flags": Set { "inline", }, - "name": "__tact_context_get_sender", - "signature": "slice __tact_context_get_sender()", + "name": "__tact_dict_replace_uint_varuint32", + "signature": "(cell, (int)) __tact_dict_replace_uint_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "if (null?(__tact_randomized)) { - randomize_lt(); - __tact_randomized = true; + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint32()); +} else { + return (d, null()); }", "kind": "generic", }, @@ -9402,15 +9681,19 @@ return __tact_base64_encode(user_friendly_address_with_checksum);", "context": "stdlib", "depends": Set {}, "flags": Set { - "impure", "inline", }, - "name": "__tact_prepare_random", - "signature": "() __tact_prepare_random()", + "name": "__tact_dict_replaceget_uint_varuint32", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "return b.store_int(v, 1);", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", "kind": "generic", }, "comment": null, @@ -9419,38 +9702,36 @@ return __tact_base64_encode(user_friendly_address_with_checksum);", "flags": Set { "inline", }, - "name": "__tact_store_bool", - "signature": "builder __tact_store_bool(builder b, int v)", + "name": "__tact_dict_get_int_slice", + "signature": "slice __tact_dict_get_int_slice(cell d, int kl, int k)", }, { "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_to_tuple", - "signature": "forall X -> tuple __tact_to_tuple(X x)", - }, - { - "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", + "flags": Set { + "inline", }, - "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_from_tuple", - "signature": "forall X -> X __tact_from_tuple(tuple x)", + "name": "__tact_dict_min_int_slice", + "signature": "(int, slice, int) __tact_dict_min_int_slice(cell d, int kl)", }, { "code": { - "code": "return equal_slices_bits(a, b);", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -9459,12 +9740,17 @@ return __tact_base64_encode(user_friendly_address_with_checksum);", "flags": Set { "inline", }, - "name": "__tact_slice_eq_bits", - "signature": "int __tact_slice_eq_bits(slice a, slice b)", + "name": "__tact_dict_next_int_slice", + "signature": "(int, slice, int) __tact_dict_next_int_slice(cell d, int kl, int pivot)", }, { "code": { - "code": "return (null?(a)) ? (false) : (equal_slices_bits(a, b));", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set(d, kl, k, v), ()); +}", "kind": "generic", }, "comment": null, @@ -9473,14 +9759,17 @@ return __tact_base64_encode(user_friendly_address_with_checksum);", "flags": Set { "inline", }, - "name": "__tact_slice_eq_bits_nullable_one", - "signature": "int __tact_slice_eq_bits_nullable_one(slice a, slice b)", + "name": "__tact_dict_set_int_slice", + "signature": "(cell, ()) __tact_dict_set_int_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( equal_slices_bits(a, b) ) : ( false ) );", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace?(d, kl, k, v); +}", "kind": "generic", }, "comment": null, @@ -9489,41 +9778,36 @@ return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nul "flags": Set { "inline", }, - "name": "__tact_slice_eq_bits_nullable", - "signature": "int __tact_slice_eq_bits_nullable(slice a, slice b)", + "name": "__tact_dict_replace_int_slice", + "signature": "(cell, (int)) __tact_dict_replace_int_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "(slice key, slice value, int flag) = __tact_dict_min(a, kl); -while (flag) { - (slice value_b, int flag_b) = b~__tact_dict_delete_get(kl, key); - ifnot (flag_b) { - return 0; - } - ifnot (value.slice_hash() == value_b.slice_hash()) { - return 0; - } - (key, value, flag) = __tact_dict_next(a, kl, key); -} -return null?(b);", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, v); +if (ok) { + return (d, old); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min", - "__tact_dict_delete_get", - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_eq", - "signature": "int __tact_dict_eq(cell a, cell b, int kl)", + "name": "__tact_dict_replaceget_int_slice", + "signature": "(cell, (slice)) __tact_dict_replaceget_int_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "return (null?(a)) ? (false) : (a == b);", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_int(vl); +} else { + return null(); +}", "kind": "generic", }, "comment": null, @@ -9532,12 +9816,17 @@ return null?(b);", "flags": Set { "inline", }, - "name": "__tact_int_eq_nullable_one", - "signature": "int __tact_int_eq_nullable_one(int a, int b)", + "name": "__tact_dict_get_int_int", + "signature": "int __tact_dict_get_int_int(cell d, int kl, int k, int vl)", }, { "code": { - "code": "return (null?(a)) ? (true) : (a != b);", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -9546,14 +9835,17 @@ return null?(b);", "flags": Set { "inline", }, - "name": "__tact_int_neq_nullable_one", - "signature": "int __tact_int_neq_nullable_one(int a, int b)", + "name": "__tact_dict_min_int_int", + "signature": "(int, int, int) __tact_dict_min_int_int(cell d, int kl, int vl)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a == b ) : ( false ) );", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -9562,14 +9854,17 @@ return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nul "flags": Set { "inline", }, - "name": "__tact_int_eq_nullable", - "signature": "int __tact_int_eq_nullable(int a, int b)", + "name": "__tact_dict_next_int_int", + "signature": "(int, int, int) __tact_dict_next_int_int(cell d, int kl, int pivot, int vl)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a != b ) : ( true ) );", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); +}", "kind": "generic", }, "comment": null, @@ -9578,12 +9873,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_int_neq_nullable", - "signature": "int __tact_int_neq_nullable(int a, int b)", + "name": "__tact_dict_set_int_int", + "signature": "(cell, ()) __tact_dict_set_int_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "return (a.cell_hash() == b.cell_hash());", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); +}", "kind": "generic", }, "comment": null, @@ -9592,12 +9892,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_cell_eq", - "signature": "int __tact_cell_eq(cell a, cell b)", + "name": "__tact_dict_replace_int_int", + "signature": "(cell, (int)) __tact_dict_replace_int_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "return (a.cell_hash() != b.cell_hash());", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_int(vl)); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, @@ -9606,12 +9911,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_cell_neq", - "signature": "int __tact_cell_neq(cell a, cell b)", + "name": "__tact_dict_replaceget_int_int", + "signature": "(cell, (int)) __tact_dict_replaceget_int_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "return (null?(a)) ? (false) : (a.cell_hash() == b.cell_hash());", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_uint(vl); +} else { + return null(); +}", "kind": "generic", }, "comment": null, @@ -9620,12 +9930,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_cell_eq_nullable_one", - "signature": "int __tact_cell_eq_nullable_one(cell a, cell b)", + "name": "__tact_dict_get_int_uint", + "signature": "int __tact_dict_get_int_uint(cell d, int kl, int k, int vl)", }, { "code": { - "code": "return (null?(a)) ? (true) : (a.cell_hash() != b.cell_hash());", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_uint(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -9634,14 +9949,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_cell_neq_nullable_one", - "signature": "int __tact_cell_neq_nullable_one(cell a, cell b)", + "name": "__tact_dict_min_int_uint", + "signature": "(int, int, int) __tact_dict_min_int_uint(cell d, int kl, int vl)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.cell_hash() == b.cell_hash() ) : ( false ) );", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_uint(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -9650,14 +9968,17 @@ return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nul "flags": Set { "inline", }, - "name": "__tact_cell_eq_nullable", - "signature": "int __tact_cell_eq_nullable(cell a, cell b)", + "name": "__tact_dict_next_int_uint", + "signature": "(int, int, int) __tact_dict_next_int_uint(cell d, int kl, int pivot, int vl)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.cell_hash() != b.cell_hash() ) : ( true ) );", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); +}", "kind": "generic", }, "comment": null, @@ -9666,12 +9987,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_cell_neq_nullable", - "signature": "int __tact_cell_neq_nullable(cell a, cell b)", + "name": "__tact_dict_set_int_uint", + "signature": "(cell, ()) __tact_dict_set_int_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "return (a.slice_hash() == b.slice_hash());", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); +}", "kind": "generic", }, "comment": null, @@ -9680,12 +10006,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_slice_eq", - "signature": "int __tact_slice_eq(slice a, slice b)", + "name": "__tact_dict_replace_int_uint", + "signature": "(cell, (int)) __tact_dict_replace_int_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "return (a.slice_hash() != b.slice_hash());", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_uint(vl)); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, @@ -9694,12 +10025,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_slice_neq", - "signature": "int __tact_slice_neq(slice a, slice b)", + "name": "__tact_dict_replaceget_int_uint", + "signature": "(cell, (int)) __tact_dict_replaceget_int_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "return (null?(a)) ? (false) : (a.slice_hash() == b.slice_hash());", + "code": "var (r, ok) = idict_get_ref?(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", "kind": "generic", }, "comment": null, @@ -9708,12 +10044,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_slice_eq_nullable_one", - "signature": "int __tact_slice_eq_nullable_one(slice a, slice b)", + "name": "__tact_dict_get_int_cell", + "signature": "cell __tact_dict_get_int_cell(cell d, int kl, int k)", }, { "code": { - "code": "return (null?(a)) ? (true) : (a.slice_hash() != b.slice_hash());", + "code": "var (key, value, flag) = idict_get_min_ref?(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -9722,14 +10063,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_slice_neq_nullable_one", - "signature": "int __tact_slice_neq_nullable_one(slice a, slice b)", + "name": "__tact_dict_min_int_cell", + "signature": "(int, cell, int) __tact_dict_min_int_cell(cell d, int kl)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.slice_hash() == b.slice_hash() ) : ( false ) );", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_ref(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -9738,14 +10082,17 @@ return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nul "flags": Set { "inline", }, - "name": "__tact_slice_eq_nullable", - "signature": "int __tact_slice_eq_nullable(slice a, slice b)", + "name": "__tact_dict_next_int_cell", + "signature": "(int, cell, int) __tact_dict_next_int_cell(cell d, int kl, int pivot)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.slice_hash() != b.slice_hash() ) : ( true ) );", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_ref(d, kl, k, v), ()); +}", "kind": "generic", }, "comment": null, @@ -9754,12 +10101,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_slice_neq_nullable", - "signature": "int __tact_slice_neq_nullable(slice a, slice b)", + "name": "__tact_dict_set_int_cell", + "signature": "(cell, ()) __tact_dict_set_int_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "return udict_set_ref(dict, 16, id, code);", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_ref?(d, kl, k, v); +}", "kind": "generic", }, "comment": null, @@ -9768,14 +10120,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_dict_set_code", - "signature": "cell __tact_dict_set_code(cell dict, int id, cell code)", + "name": "__tact_dict_replace_int_cell", + "signature": "(cell, (int)) __tact_dict_replace_int_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (data, ok) = udict_get_ref?(dict, 16, id); -throw_unless(135, ok); -return data;", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get_ref?(kl, k) : d~idict_replaceget_ref?(kl, k, v); +if (ok) { + return (d, old); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, @@ -9784,25 +10139,36 @@ return data;", "flags": Set { "inline", }, - "name": "__tact_dict_get_code", - "signature": "cell __tact_dict_get_code(cell dict, int id)", + "name": "__tact_dict_replaceget_int_cell", + "signature": "(cell, (cell)) __tact_dict_replaceget_int_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "NIL", - "kind": "asm", - "shuffle": "", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_coins(); +} else { + return null(); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_0", - "signature": "tuple __tact_tuple_create_0()", + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_int_coins", + "signature": "int __tact_dict_get_int_coins(cell d, int kl, int k)", }, { "code": { - "code": "return ();", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -9811,402 +10177,4406 @@ return data;", "flags": Set { "inline", }, - "name": "__tact_tuple_destroy_0", - "signature": "() __tact_tuple_destroy_0()", + "name": "__tact_dict_min_int_coins", + "signature": "(int, int, int) __tact_dict_min_int_coins(cell d, int kl)", }, { "code": { - "code": "1 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_1", - "signature": "forall X0 -> tuple __tact_tuple_create_1((X0) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_int_coins", + "signature": "(int, int, int) __tact_dict_next_int_coins(cell d, int kl, int pivot)", }, { "code": { - "code": "1 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_1", - "signature": "forall X0 -> (X0) __tact_tuple_destroy_1(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_int_coins", + "signature": "(cell, ()) __tact_dict_set_int_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "2 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_2", - "signature": "forall X0, X1 -> tuple __tact_tuple_create_2((X0, X1) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_int_coins", + "signature": "(cell, (int)) __tact_dict_replace_int_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "2 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_coins()); +} else { + return (d, null()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_2", - "signature": "forall X0, X1 -> (X0, X1) __tact_tuple_destroy_2(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_int_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_int_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "3 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_varint16(); +} else { + return null(); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_3", - "signature": "forall X0, X1, X2 -> tuple __tact_tuple_create_3((X0, X1, X2) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_int_varint16", + "signature": "int __tact_dict_get_int_varint16(cell d, int kl, int k)", }, { "code": { - "code": "3 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_3", - "signature": "forall X0, X1, X2 -> (X0, X1, X2) __tact_tuple_destroy_3(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_int_varint16", + "signature": "(int, int, int) __tact_dict_min_int_varint16(cell d, int kl)", }, { "code": { - "code": "4 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_4", - "signature": "forall X0, X1, X2, X3 -> tuple __tact_tuple_create_4((X0, X1, X2, X3) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_int_varint16", + "signature": "(int, int, int) __tact_dict_next_int_varint16(cell d, int kl, int pivot)", }, { "code": { - "code": "4 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_4", - "signature": "forall X0, X1, X2, X3 -> (X0, X1, X2, X3) __tact_tuple_destroy_4(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_int_varint16", + "signature": "(cell, ()) __tact_dict_set_int_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "5 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_varint16(v)); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_5", - "signature": "forall X0, X1, X2, X3, X4 -> tuple __tact_tuple_create_5((X0, X1, X2, X3, X4) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_int_varint16", + "signature": "(cell, (int)) __tact_dict_replace_int_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "5 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint16()); +} else { + return (d, null()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_5", - "signature": "forall X0, X1, X2, X3, X4 -> (X0, X1, X2, X3, X4) __tact_tuple_destroy_5(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_int_varint16", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "6 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_varint32(); +} else { + return null(); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_6", - "signature": "forall X0, X1, X2, X3, X4, X5 -> tuple __tact_tuple_create_6((X0, X1, X2, X3, X4, X5) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_int_varint32", + "signature": "int __tact_dict_get_int_varint32(cell d, int kl, int k)", }, { "code": { - "code": "6 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_6", - "signature": "forall X0, X1, X2, X3, X4, X5 -> (X0, X1, X2, X3, X4, X5) __tact_tuple_destroy_6(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_int_varint32", + "signature": "(int, int, int) __tact_dict_min_int_varint32(cell d, int kl)", }, { "code": { - "code": "7 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_7", - "signature": "forall X0, X1, X2, X3, X4, X5, X6 -> tuple __tact_tuple_create_7((X0, X1, X2, X3, X4, X5, X6) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_int_varint32", + "signature": "(int, int, int) __tact_dict_next_int_varint32(cell d, int kl, int pivot)", }, { "code": { - "code": "7 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_7", - "signature": "forall X0, X1, X2, X3, X4, X5, X6 -> (X0, X1, X2, X3, X4, X5, X6) __tact_tuple_destroy_7(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_int_varint32", + "signature": "(cell, ()) __tact_dict_set_int_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "8 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_varint32(v)); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_8", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7 -> tuple __tact_tuple_create_8((X0, X1, X2, X3, X4, X5, X6, X7) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_int_varint32", + "signature": "(cell, (int)) __tact_dict_replace_int_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "8 UNTUPLE", - "kind": "asm", - "shuffle": "", - }, + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint32()); +} else { + return (d, null()); +}", + "kind": "generic", + }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_8", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7 -> (X0, X1, X2, X3, X4, X5, X6, X7) __tact_tuple_destroy_8(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_int_varint32", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "9 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_varuint16(); +} else { + return null(); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_9", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8 -> tuple __tact_tuple_create_9((X0, X1, X2, X3, X4, X5, X6, X7, X8) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_int_varuint16", + "signature": "int __tact_dict_get_int_varuint16(cell d, int kl, int k)", }, { "code": { - "code": "9 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_9", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8) __tact_tuple_destroy_9(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_int_varuint16", + "signature": "(int, int, int) __tact_dict_min_int_varuint16(cell d, int kl)", }, { "code": { - "code": "10 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_10", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9 -> tuple __tact_tuple_create_10((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_int_varuint16", + "signature": "(int, int, int) __tact_dict_next_int_varuint16(cell d, int kl, int pivot)", }, { "code": { - "code": "10 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_10", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) __tact_tuple_destroy_10(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_int_varuint16", + "signature": "(cell, ()) __tact_dict_set_int_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "11 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v)); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_11", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10 -> tuple __tact_tuple_create_11((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_int_varuint16", + "signature": "(cell, (int)) __tact_dict_replace_int_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "11 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint16()); +} else { + return (d, null()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_11", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) __tact_tuple_destroy_11(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_int_varuint16", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "12 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_varuint32(); +} else { + return null(); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_12", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11 -> tuple __tact_tuple_create_12((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_int_varuint32", + "signature": "int __tact_dict_get_int_varuint32(cell d, int kl, int k)", }, { "code": { - "code": "12 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_12", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) __tact_tuple_destroy_12(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_int_varuint32", + "signature": "(int, int, int) __tact_dict_min_int_varuint32(cell d, int kl)", }, { "code": { - "code": "13 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_13", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12 -> tuple __tact_tuple_create_13((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_int_varuint32", + "signature": "(int, int, int) __tact_dict_next_int_varuint32(cell d, int kl, int pivot)", }, { "code": { - "code": "13 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_int_varuint32", + "signature": "(cell, ()) __tact_dict_set_int_varuint32(cell d, int kl, int k, int v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_int_varuint32", + "signature": "(cell, (int)) __tact_dict_replace_int_varuint32(cell d, int kl, int k, int v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint32()); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_int_varuint32", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varuint32(cell d, int kl, int k, int v)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +return ok;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_exists_slice", + "signature": "int __tact_dict_exists_slice(cell d, int kl, slice k)", + }, + { + "code": { + "code": "var (r, ok) = udict_get?(d, kl, k); +return ok;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_exists_uint", + "signature": "int __tact_dict_exists_uint(cell d, int kl, int k)", + }, + { + "code": { + "code": "var (r, ok) = idict_get?(d, kl, k); +return ok;", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_exists_int", + "signature": "int __tact_dict_exists_int(cell d, int kl, int k)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +build_0 = build_0.store_int(v'a, 257); +build_0 = build_0.store_int(v'b, 257); +build_0 = ~ null?(v'c) ? build_0.store_int(true, 1).store_int(v'c, 257) : build_0.store_int(false, 1); +build_0 = build_0.store_int(v'd, 1); +build_0 = ~ null?(v'e) ? build_0.store_int(true, 1).store_int(v'e, 1) : build_0.store_int(false, 1); +var build_1 = begin_cell(); +build_1 = build_1.store_int(v'f, 257); +build_1 = build_1.store_int(v'g, 257); +build_0 = store_ref(build_0, build_1.end_cell()); +return build_0;", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_13", + "name": "$B$_store", + "signature": "builder $B$_store(builder build_0, (int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "return $B$_store(begin_cell(), v).end_cell();", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set { + "$B$_store", + }, + "flags": Set { + "inline", + }, + "name": "$B$_store_cell", + "signature": "cell $B$_store_cell((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'a;", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$A$_get_a", + "signature": "_ $A$_get_a((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'b;", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$A$_get_b", + "signature": "_ $A$_get_b((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'c;", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$A$_get_c", + "signature": "_ $A$_get_c((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'd;", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$A$_get_d", + "signature": "_ $A$_get_d((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'e;", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$A$_get_e", + "signature": "_ $A$_get_e((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'f;", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$A$_get_f", + "signature": "_ $A$_get_f((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'g;", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$A$_get_g", + "signature": "_ $A$_get_g((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "NOP", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "type:A", + "depends": Set {}, + "flags": Set {}, + "name": "$A$_tensor_cast", + "signature": "((int, int, int, int, int, int, int)) $A$_tensor_cast((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "throw_if(128, null?(v)); +var (int vvv'a, int vvv'b, int vvv'c, int vvv'd, int vvv'e, int vvv'f, int vvv'g) = __tact_tuple_destroy_7(v); +return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set { + "__tact_tuple_destroy_7", + }, + "flags": Set { + "inline", + }, + "name": "$A$_not_null", + "signature": "((int, int, int, int, int, int, int)) $A$_not_null(tuple v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set { + "__tact_tuple_create_7", + }, + "flags": Set { + "inline", + }, + "name": "$A$_as_optional", + "signature": "tuple $A$_as_optional((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set { + "__tact_tuple_create_7", + }, + "flags": Set { + "inline", + }, + "name": "$A$_to_tuple", + "signature": "tuple $A$_to_tuple(((int, int, int, int, int, int, int)) v)", + }, + { + "code": { + "code": "if (null?(v)) { return null(); } +return $A$_to_tuple($A$_not_null(v)); ", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set { + "$A$_to_tuple", + "$A$_not_null", + }, + "flags": Set { + "inline", + }, + "name": "$A$_to_opt_tuple", + "signature": "tuple $A$_to_opt_tuple(tuple v)", + }, + { + "code": { + "code": "var (int v'a, int v'b, int v'c, int v'd, int v'e, int v'f, int v'g) = __tact_tuple_destroy_7(v); +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set { + "__tact_tuple_destroy_7", + }, + "flags": Set { + "inline", + }, + "name": "$A$_from_tuple", + "signature": "(int, int, int, int, int, int, int) $A$_from_tuple(tuple v)", + }, + { + "code": { + "code": "if (null?(v)) { return null(); } +return $A$_as_optional($A$_from_tuple(v));", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set { + "$A$_as_optional", + "$A$_from_tuple", + }, + "flags": Set { + "inline", + }, + "name": "$A$_from_opt_tuple", + "signature": "tuple $A$_from_opt_tuple(tuple v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$A$_to_external", + "signature": "(int, int, int, int, int, int, int) $A$_to_external(((int, int, int, int, int, int, int)) v)", + }, + { + "code": { + "code": "var loaded = $A$_to_opt_tuple(v); +if (null?(loaded)) { + return null(); +} else { + return (loaded); +}", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set { + "$A$_to_opt_tuple", + }, + "flags": Set { + "inline", + }, + "name": "$A$_to_opt_external", + "signature": "tuple $A$_to_opt_external(tuple v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'a;", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$B$_get_a", + "signature": "_ $B$_get_a((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'b;", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$B$_get_b", + "signature": "_ $B$_get_b((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'c;", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$B$_get_c", + "signature": "_ $B$_get_c((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'd;", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$B$_get_d", + "signature": "_ $B$_get_d((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'e;", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$B$_get_e", + "signature": "_ $B$_get_e((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'f;", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$B$_get_f", + "signature": "_ $B$_get_f((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'g;", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$B$_get_g", + "signature": "_ $B$_get_g((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "NOP", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set {}, + "name": "$B$_tensor_cast", + "signature": "((int, int, int, int, int, int, int)) $B$_tensor_cast((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "throw_if(128, null?(v)); +var (int vvv'a, int vvv'b, int vvv'c, int vvv'd, int vvv'e, int vvv'f, int vvv'g) = __tact_tuple_destroy_7(v); +return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set { + "__tact_tuple_destroy_7", + }, + "flags": Set { + "inline", + }, + "name": "$B$_not_null", + "signature": "((int, int, int, int, int, int, int)) $B$_not_null(tuple v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set { + "__tact_tuple_create_7", + }, + "flags": Set { + "inline", + }, + "name": "$B$_as_optional", + "signature": "tuple $B$_as_optional((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set { + "__tact_tuple_create_7", + }, + "flags": Set { + "inline", + }, + "name": "$B$_to_tuple", + "signature": "tuple $B$_to_tuple(((int, int, int, int, int, int, int)) v)", + }, + { + "code": { + "code": "if (null?(v)) { return null(); } +return $B$_to_tuple($B$_not_null(v)); ", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set { + "$B$_to_tuple", + "$B$_not_null", + }, + "flags": Set { + "inline", + }, + "name": "$B$_to_opt_tuple", + "signature": "tuple $B$_to_opt_tuple(tuple v)", + }, + { + "code": { + "code": "var (int v'a, int v'b, int v'c, int v'd, int v'e, int v'f, int v'g) = __tact_tuple_destroy_7(v); +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set { + "__tact_tuple_destroy_7", + }, + "flags": Set { + "inline", + }, + "name": "$B$_from_tuple", + "signature": "(int, int, int, int, int, int, int) $B$_from_tuple(tuple v)", + }, + { + "code": { + "code": "if (null?(v)) { return null(); } +return $B$_as_optional($B$_from_tuple(v));", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set { + "$B$_as_optional", + "$B$_from_tuple", + }, + "flags": Set { + "inline", + }, + "name": "$B$_from_opt_tuple", + "signature": "tuple $B$_from_opt_tuple(tuple v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$B$_to_external", + "signature": "(int, int, int, int, int, int, int) $B$_to_external(((int, int, int, int, int, int, int)) v)", + }, + { + "code": { + "code": "var loaded = $B$_to_opt_tuple(v); +if (null?(loaded)) { + return null(); +} else { + return (loaded); +}", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set { + "$B$_to_opt_tuple", + }, + "flags": Set { + "inline", + }, + "name": "$B$_to_opt_external", + "signature": "tuple $B$_to_opt_external(tuple v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'a;", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$C$_get_a", + "signature": "_ $C$_get_a((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'b;", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$C$_get_b", + "signature": "_ $C$_get_b((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'c;", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$C$_get_c", + "signature": "_ $C$_get_c((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'd;", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$C$_get_d", + "signature": "_ $C$_get_d((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'e;", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$C$_get_e", + "signature": "_ $C$_get_e((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'f;", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$C$_get_f", + "signature": "_ $C$_get_f((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'g;", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$C$_get_g", + "signature": "_ $C$_get_g((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'h;", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$C$_get_h", + "signature": "_ $C$_get_h((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "NOP", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set {}, + "name": "$C$_tensor_cast", + "signature": "((cell, cell, slice, slice, int, int, int, slice)) $C$_tensor_cast((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "throw_if(128, null?(v)); +var (cell vvv'a, cell vvv'b, slice vvv'c, slice vvv'd, int vvv'e, int vvv'f, int vvv'g, slice vvv'h) = __tact_tuple_destroy_8(v); +return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g, vvv'h);", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set { + "__tact_tuple_destroy_8", + }, + "flags": Set { + "inline", + }, + "name": "$C$_not_null", + "signature": "((cell, cell, slice, slice, int, int, int, slice)) $C$_not_null(tuple v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return __tact_tuple_create_8(v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set { + "__tact_tuple_create_8", + }, + "flags": Set { + "inline", + }, + "name": "$C$_as_optional", + "signature": "tuple $C$_as_optional((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return __tact_tuple_create_8(v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set { + "__tact_tuple_create_8", + }, + "flags": Set { + "inline", + }, + "name": "$C$_to_tuple", + "signature": "tuple $C$_to_tuple(((cell, cell, slice, slice, int, int, int, slice)) v)", + }, + { + "code": { + "code": "if (null?(v)) { return null(); } +return $C$_to_tuple($C$_not_null(v)); ", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set { + "$C$_to_tuple", + "$C$_not_null", + }, + "flags": Set { + "inline", + }, + "name": "$C$_to_opt_tuple", + "signature": "tuple $C$_to_opt_tuple(tuple v)", + }, + { + "code": { + "code": "var (cell v'a, cell v'b, slice v'c, slice v'd, int v'e, int v'f, int v'g, slice v'h) = __tact_tuple_destroy_8(v); +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set { + "__tact_tuple_destroy_8", + }, + "flags": Set { + "inline", + }, + "name": "$C$_from_tuple", + "signature": "(cell, cell, slice, slice, int, int, int, slice) $C$_from_tuple(tuple v)", + }, + { + "code": { + "code": "if (null?(v)) { return null(); } +return $C$_as_optional($C$_from_tuple(v));", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set { + "$C$_as_optional", + "$C$_from_tuple", + }, + "flags": Set { + "inline", + }, + "name": "$C$_from_opt_tuple", + "signature": "tuple $C$_from_opt_tuple(tuple v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$C$_to_external", + "signature": "(cell, cell, slice, slice, int, int, int, slice) $C$_to_external(((cell, cell, slice, slice, int, int, int, slice)) v)", + }, + { + "code": { + "code": "var loaded = $C$_to_opt_tuple(v); +if (null?(loaded)) { + return null(); +} else { + return (loaded); +}", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set { + "$C$_to_opt_tuple", + }, + "flags": Set { + "inline", + }, + "name": "$C$_to_opt_external", + "signature": "tuple $C$_to_opt_external(tuple v)", + }, + { + "code": { + "code": "var v'a = sc_0~load_int(257); +var v'b = sc_0~load_int(257); +var v'c = sc_0~load_int(1) ? sc_0~load_int(257) : null(); +var v'd = sc_0~load_int(1); +var v'e = sc_0~load_int(1) ? sc_0~load_int(1) : null(); +slice sc_1 = sc_0~load_ref().begin_parse(); +var v'f = sc_1~load_int(257); +var v'g = sc_1~load_int(257); +return (sc_0, (v'a, v'b, v'c, v'd, v'e, v'f, v'g));", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set {}, + "name": "$B$_load", + "signature": "(slice, ((int, int, int, int, int, int, int))) $B$_load(slice sc_0)", + }, + { + "code": { + "code": "var r = sc_0~$B$_load(); +sc_0.end_parse(); +return r;", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set { + "$B$_load", + }, + "flags": Set {}, + "name": "$B$_load_not_mut", + "signature": "((int, int, int, int, int, int, int)) $B$_load_not_mut(slice sc_0)", + }, +] +`; + +exports[`writeSerialization should write serializer for C 1`] = ` +[ + { + "code": { + "kind": "skip", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_set", + "signature": "", + }, + { + "code": { + "kind": "skip", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_nop", + "signature": "", + }, + { + "code": { + "kind": "skip", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_str_to_slice", + "signature": "", + }, + { + "code": { + "kind": "skip", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_slice_to_str", + "signature": "", + }, + { + "code": { + "kind": "skip", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_address_to_slice", + "signature": "", + }, + { + "code": { + "code": "slice raw = cs~load_msg_addr(); +return (cs, raw);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_load_address", + "signature": "(slice, slice) __tact_load_address(slice cs)", + }, + { + "code": { + "code": "if (cs.preload_uint(2) != 0) { + slice raw = cs~load_msg_addr(); + return (cs, raw); +} else { + cs~skip_bits(2); + return (cs, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_load_address_opt", + "signature": "(slice, slice) __tact_load_address_opt(slice cs)", + }, + { + "code": { + "code": "return b.store_slice(address);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_store_address", + "signature": "builder __tact_store_address(builder b, slice address)", + }, + { + "code": { + "code": "if (null?(address)) { + b = b.store_uint(0, 2); + return b; +} else { + return __tact_store_address(b, address); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_store_address", + }, + "flags": Set { + "inline", + }, + "name": "__tact_store_address_opt", + "signature": "builder __tact_store_address_opt(builder b, slice address)", + }, + { + "code": { + "code": "var b = begin_cell(); +b = b.store_uint(2, 2); +b = b.store_uint(0, 1); +b = b.store_int(chain, 8); +b = b.store_uint(hash, 256); +var addr = b.end_cell().begin_parse(); +return addr;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_create_address", + "signature": "slice __tact_create_address(int chain, int hash)", + }, + { + "code": { + "code": "var b = begin_cell(); +b = b.store_uint(0, 2); +b = b.store_uint(3, 2); +b = b.store_uint(0, 1); +b = b.store_ref(code); +b = b.store_ref(data); +var hash = cell_hash(b.end_cell()); +return __tact_create_address(chain, hash);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_create_address", + }, + "flags": Set { + "inline", + }, + "name": "__tact_compute_contract_address", + "signature": "slice __tact_compute_contract_address(int chain, cell code, cell data)", + }, + { + "code": { + "code": "throw_if(128, null?(x)); return x;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "impure", + "inline", + }, + "name": "__tact_not_null", + "signature": "forall X -> X __tact_not_null(X x)", + }, + { + "code": { + "code": "DICTDEL", + "kind": "asm", + "shuffle": "(index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_delete", + "signature": "(cell, int) __tact_dict_delete(cell dict, int key_len, slice index)", + }, + { + "code": { + "code": "DICTIDEL", + "kind": "asm", + "shuffle": "(index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_delete_int", + "signature": "(cell, int) __tact_dict_delete_int(cell dict, int key_len, int index)", + }, + { + "code": { + "code": "DICTUDEL", + "kind": "asm", + "shuffle": "(index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_delete_uint", + "signature": "(cell, int) __tact_dict_delete_uint(cell dict, int key_len, int index)", + }, + { + "code": { + "code": "DICTSETREF", + "kind": "asm", + "shuffle": "(value index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_set_ref", + "signature": "((cell), ()) __tact_dict_set_ref(cell dict, int key_len, slice index, cell value)", + }, + { + "code": { + "code": "DICTREPLACEREF", + "kind": "asm", + "shuffle": "(value index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_replace_ref", + "signature": "((cell), (int)) __tact_dict_replace_ref(cell dict, int key_len, slice index, cell value)", + }, + { + "code": { + "code": "DICTREPLACEGETREF NULLSWAPIFNOT", + "kind": "asm", + "shuffle": "(value index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_replaceget_ref", + "signature": "((cell), (cell, int)) __tact_dict_replaceget_ref(cell dict, int key_len, slice index, cell value)", + }, + { + "code": { + "code": "DICTGET NULLSWAPIFNOT", + "kind": "asm", + "shuffle": "(index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_get", + "signature": "(slice, int) __tact_dict_get(cell dict, int key_len, slice index)", + }, + { + "code": { + "code": "DICTDELGET NULLSWAPIFNOT", + "kind": "asm", + "shuffle": "(index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_delete_get", + "signature": "(cell, (slice, int)) __tact_dict_delete_get(cell dict, int key_len, slice index)", + }, + { + "code": { + "code": "DICTDELGETREF NULLSWAPIFNOT", + "kind": "asm", + "shuffle": "(index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_delete_get_ref", + "signature": "(cell, (cell, int)) __tact_dict_delete_get_ref(cell dict, int key_len, slice index)", + }, + { + "code": { + "code": "DICTGETREF NULLSWAPIFNOT", + "kind": "asm", + "shuffle": "(index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_get_ref", + "signature": "(cell, int) __tact_dict_get_ref(cell dict, int key_len, slice index)", + }, + { + "code": { + "code": "DICTMIN NULLSWAPIFNOT2", + "kind": "asm", + "shuffle": "(dict key_len -> 1 0 2)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_min", + "signature": "(slice, slice, int) __tact_dict_min(cell dict, int key_len)", + }, + { + "code": { + "code": "DICTMINREF NULLSWAPIFNOT2", + "kind": "asm", + "shuffle": "(dict key_len -> 1 0 2)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_min_ref", + "signature": "(slice, cell, int) __tact_dict_min_ref(cell dict, int key_len)", + }, + { + "code": { + "code": "DICTGETNEXT NULLSWAPIFNOT2", + "kind": "asm", + "shuffle": "(pivot dict key_len -> 1 0 2)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_next", + "signature": "(slice, slice, int) __tact_dict_next(cell dict, int key_len, slice pivot)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(dict, key_len, pivot); +if (flag) { + return (key, value~load_ref(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set {}, + "name": "__tact_dict_next_ref", + "signature": "(slice, cell, int) __tact_dict_next_ref(cell dict, int key_len, slice pivot)", + }, + { + "code": { + "code": "STRDUMP DROP STRDUMP DROP s0 DUMP DROP", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "impure", + }, + "name": "__tact_debug", + "signature": "forall X -> () __tact_debug(X value, slice debug_print_1, slice debug_print_2)", + }, + { + "code": { + "code": "STRDUMP DROP STRDUMP DROP STRDUMP DROP", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "impure", + }, + "name": "__tact_debug_str", + "signature": "() __tact_debug_str(slice value, slice debug_print_1, slice debug_print_2)", + }, + { + "code": { + "code": "if (value) { + __tact_debug_str("true", debug_print_1, debug_print_2); +} else { + __tact_debug_str("false", debug_print_1, debug_print_2); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_debug_str", + }, + "flags": Set { + "impure", + }, + "name": "__tact_debug_bool", + "signature": "() __tact_debug_bool(int value, slice debug_print_1, slice debug_print_2)", + }, + { + "code": { + "code": "SDSUBSTR", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_preload_offset", + "signature": "(slice) __tact_preload_offset(slice s, int offset, int bits)", + }, + { + "code": { + "code": "slice new_data = begin_cell() + .store_slice(data) + .store_slice("0000"s) +.end_cell().begin_parse(); +int reg = 0; +while (~ new_data.slice_data_empty?()) { + int byte = new_data~load_uint(8); + int mask = 0x80; + while (mask > 0) { + reg <<= 1; + if (byte & mask) { + reg += 1; + } + mask >>= 1; + if (reg > 0xffff) { + reg &= 0xffff; + reg ^= 0x1021; + } + } +} +(int q, int r) = divmod(reg, 256); +return begin_cell() + .store_uint(q, 8) + .store_uint(r, 8) +.end_cell().begin_parse();", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline_ref", + }, + "name": "__tact_crc16", + "signature": "(slice) __tact_crc16(slice data)", + }, + { + "code": { + "code": "slice chars = "4142434445464748494A4B4C4D4E4F505152535455565758595A6162636465666768696A6B6C6D6E6F707172737475767778797A303132333435363738392D5F"s; +builder res = begin_cell(); + +while (data.slice_bits() >= 24) { + (int bs1, int bs2, int bs3) = (data~load_uint(8), data~load_uint(8), data~load_uint(8)); + + int n = (bs1 << 16) | (bs2 << 8) | bs3; + + res = res + .store_slice(__tact_preload_offset(chars, ((n >> 18) & 63) * 8, 8)) + .store_slice(__tact_preload_offset(chars, ((n >> 12) & 63) * 8, 8)) + .store_slice(__tact_preload_offset(chars, ((n >> 6) & 63) * 8, 8)) + .store_slice(__tact_preload_offset(chars, ((n ) & 63) * 8, 8)); +} + +return res.end_cell().begin_parse();", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_preload_offset", + }, + "flags": Set {}, + "name": "__tact_base64_encode", + "signature": "(slice) __tact_base64_encode(slice data)", + }, + { + "code": { + "code": "(int wc, int hash) = address.parse_std_addr(); + +slice user_friendly_address = begin_cell() + .store_slice("11"s) + .store_uint((wc + 0x100) % 0x100, 8) + .store_uint(hash, 256) +.end_cell().begin_parse(); + +slice checksum = __tact_crc16(user_friendly_address); +slice user_friendly_address_with_checksum = begin_cell() + .store_slice(user_friendly_address) + .store_slice(checksum) +.end_cell().begin_parse(); + +return __tact_base64_encode(user_friendly_address_with_checksum);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_crc16", + "__tact_base64_encode", + }, + "flags": Set {}, + "name": "__tact_address_to_user_friendly", + "signature": "(slice) __tact_address_to_user_friendly(slice address)", + }, + { + "code": { + "code": "__tact_debug_str(__tact_address_to_user_friendly(address), debug_print_1, debug_print_2);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_debug_str", + "__tact_address_to_user_friendly", + }, + "flags": Set { + "impure", + }, + "name": "__tact_debug_address", + "signature": "() __tact_debug_address(slice address, slice debug_print_1, slice debug_print_2)", + }, + { + "code": { + "code": "STRDUMP DROP STRDUMP DROP DUMPSTK", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "impure", + }, + "name": "__tact_debug_stack", + "signature": "() __tact_debug_stack(slice debug_print_1, slice debug_print_2)", + }, + { + "code": { + "code": "return __tact_context;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_context_get", + "signature": "(int, slice, int, slice) __tact_context_get()", + }, + { + "code": { + "code": "return __tact_context_sender;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_context_get_sender", + "signature": "slice __tact_context_get_sender()", + }, + { + "code": { + "code": "if (null?(__tact_randomized)) { + randomize_lt(); + __tact_randomized = true; +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "impure", + "inline", + }, + "name": "__tact_prepare_random", + "signature": "() __tact_prepare_random()", + }, + { + "code": { + "code": "return b.store_int(v, 1);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_store_bool", + "signature": "builder __tact_store_bool(builder b, int v)", + }, + { + "code": { + "code": "NOP", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_to_tuple", + "signature": "forall X -> tuple __tact_to_tuple(X x)", + }, + { + "code": { + "code": "NOP", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_from_tuple", + "signature": "forall X -> X __tact_from_tuple(tuple x)", + }, + { + "code": { + "code": "return equal_slices_bits(a, b);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_slice_eq_bits", + "signature": "int __tact_slice_eq_bits(slice a, slice b)", + }, + { + "code": { + "code": "return (null?(a)) ? (false) : (equal_slices_bits(a, b));", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_slice_eq_bits_nullable_one", + "signature": "int __tact_slice_eq_bits_nullable_one(slice a, slice b)", + }, + { + "code": { + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( equal_slices_bits(a, b) ) : ( false ) );", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_slice_eq_bits_nullable", + "signature": "int __tact_slice_eq_bits_nullable(slice a, slice b)", + }, + { + "code": { + "code": "(slice key, slice value, int flag) = __tact_dict_min(a, kl); +while (flag) { + (slice value_b, int flag_b) = b~__tact_dict_delete_get(kl, key); + ifnot (flag_b) { + return 0; + } + ifnot (value.slice_hash() == value_b.slice_hash()) { + return 0; + } + (key, value, flag) = __tact_dict_next(a, kl, key); +} +return null?(b);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + "__tact_dict_delete_get", + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_eq", + "signature": "int __tact_dict_eq(cell a, cell b, int kl)", + }, + { + "code": { + "code": "return (null?(a)) ? (false) : (a == b);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_int_eq_nullable_one", + "signature": "int __tact_int_eq_nullable_one(int a, int b)", + }, + { + "code": { + "code": "return (null?(a)) ? (true) : (a != b);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_int_neq_nullable_one", + "signature": "int __tact_int_neq_nullable_one(int a, int b)", + }, + { + "code": { + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a == b ) : ( false ) );", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_int_eq_nullable", + "signature": "int __tact_int_eq_nullable(int a, int b)", + }, + { + "code": { + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a != b ) : ( true ) );", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_int_neq_nullable", + "signature": "int __tact_int_neq_nullable(int a, int b)", + }, + { + "code": { + "code": "return (a.cell_hash() == b.cell_hash());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_cell_eq", + "signature": "int __tact_cell_eq(cell a, cell b)", + }, + { + "code": { + "code": "return (a.cell_hash() != b.cell_hash());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_cell_neq", + "signature": "int __tact_cell_neq(cell a, cell b)", + }, + { + "code": { + "code": "return (null?(a)) ? (false) : (a.cell_hash() == b.cell_hash());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_cell_eq_nullable_one", + "signature": "int __tact_cell_eq_nullable_one(cell a, cell b)", + }, + { + "code": { + "code": "return (null?(a)) ? (true) : (a.cell_hash() != b.cell_hash());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_cell_neq_nullable_one", + "signature": "int __tact_cell_neq_nullable_one(cell a, cell b)", + }, + { + "code": { + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.cell_hash() == b.cell_hash() ) : ( false ) );", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_cell_eq_nullable", + "signature": "int __tact_cell_eq_nullable(cell a, cell b)", + }, + { + "code": { + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.cell_hash() != b.cell_hash() ) : ( true ) );", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_cell_neq_nullable", + "signature": "int __tact_cell_neq_nullable(cell a, cell b)", + }, + { + "code": { + "code": "return (a.slice_hash() == b.slice_hash());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_slice_eq", + "signature": "int __tact_slice_eq(slice a, slice b)", + }, + { + "code": { + "code": "return (a.slice_hash() != b.slice_hash());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_slice_neq", + "signature": "int __tact_slice_neq(slice a, slice b)", + }, + { + "code": { + "code": "return (null?(a)) ? (false) : (a.slice_hash() == b.slice_hash());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_slice_eq_nullable_one", + "signature": "int __tact_slice_eq_nullable_one(slice a, slice b)", + }, + { + "code": { + "code": "return (null?(a)) ? (true) : (a.slice_hash() != b.slice_hash());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_slice_neq_nullable_one", + "signature": "int __tact_slice_neq_nullable_one(slice a, slice b)", + }, + { + "code": { + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.slice_hash() == b.slice_hash() ) : ( false ) );", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_slice_eq_nullable", + "signature": "int __tact_slice_eq_nullable(slice a, slice b)", + }, + { + "code": { + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.slice_hash() != b.slice_hash() ) : ( true ) );", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_slice_neq_nullable", + "signature": "int __tact_slice_neq_nullable(slice a, slice b)", + }, + { + "code": { + "code": "return udict_set_ref(dict, 16, id, code);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_code", + "signature": "cell __tact_dict_set_code(cell dict, int id, cell code)", + }, + { + "code": { + "code": "var (data, ok) = udict_get_ref?(dict, 16, id); +throw_unless(135, ok); +return data;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_code", + "signature": "cell __tact_dict_get_code(cell dict, int id)", + }, + { + "code": { + "code": "NIL", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_0", + "signature": "tuple __tact_tuple_create_0()", + }, + { + "code": { + "code": "return ();", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_tuple_destroy_0", + "signature": "() __tact_tuple_destroy_0()", + }, + { + "code": { + "code": "1 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_1", + "signature": "forall X0 -> tuple __tact_tuple_create_1((X0) v)", + }, + { + "code": { + "code": "1 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_1", + "signature": "forall X0 -> (X0) __tact_tuple_destroy_1(tuple v)", + }, + { + "code": { + "code": "2 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_2", + "signature": "forall X0, X1 -> tuple __tact_tuple_create_2((X0, X1) v)", + }, + { + "code": { + "code": "2 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_2", + "signature": "forall X0, X1 -> (X0, X1) __tact_tuple_destroy_2(tuple v)", + }, + { + "code": { + "code": "3 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_3", + "signature": "forall X0, X1, X2 -> tuple __tact_tuple_create_3((X0, X1, X2) v)", + }, + { + "code": { + "code": "3 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_3", + "signature": "forall X0, X1, X2 -> (X0, X1, X2) __tact_tuple_destroy_3(tuple v)", + }, + { + "code": { + "code": "4 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_4", + "signature": "forall X0, X1, X2, X3 -> tuple __tact_tuple_create_4((X0, X1, X2, X3) v)", + }, + { + "code": { + "code": "4 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_4", + "signature": "forall X0, X1, X2, X3 -> (X0, X1, X2, X3) __tact_tuple_destroy_4(tuple v)", + }, + { + "code": { + "code": "5 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_5", + "signature": "forall X0, X1, X2, X3, X4 -> tuple __tact_tuple_create_5((X0, X1, X2, X3, X4) v)", + }, + { + "code": { + "code": "5 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_5", + "signature": "forall X0, X1, X2, X3, X4 -> (X0, X1, X2, X3, X4) __tact_tuple_destroy_5(tuple v)", + }, + { + "code": { + "code": "6 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_6", + "signature": "forall X0, X1, X2, X3, X4, X5 -> tuple __tact_tuple_create_6((X0, X1, X2, X3, X4, X5) v)", + }, + { + "code": { + "code": "6 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_6", + "signature": "forall X0, X1, X2, X3, X4, X5 -> (X0, X1, X2, X3, X4, X5) __tact_tuple_destroy_6(tuple v)", + }, + { + "code": { + "code": "7 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_7", + "signature": "forall X0, X1, X2, X3, X4, X5, X6 -> tuple __tact_tuple_create_7((X0, X1, X2, X3, X4, X5, X6) v)", + }, + { + "code": { + "code": "7 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_7", + "signature": "forall X0, X1, X2, X3, X4, X5, X6 -> (X0, X1, X2, X3, X4, X5, X6) __tact_tuple_destroy_7(tuple v)", + }, + { + "code": { + "code": "8 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_8", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7 -> tuple __tact_tuple_create_8((X0, X1, X2, X3, X4, X5, X6, X7) v)", + }, + { + "code": { + "code": "8 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_8", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7 -> (X0, X1, X2, X3, X4, X5, X6, X7) __tact_tuple_destroy_8(tuple v)", + }, + { + "code": { + "code": "9 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_9", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8 -> tuple __tact_tuple_create_9((X0, X1, X2, X3, X4, X5, X6, X7, X8) v)", + }, + { + "code": { + "code": "9 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_9", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8) __tact_tuple_destroy_9(tuple v)", + }, + { + "code": { + "code": "10 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_10", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9 -> tuple __tact_tuple_create_10((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) v)", + }, + { + "code": { + "code": "10 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_10", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) __tact_tuple_destroy_10(tuple v)", + }, + { + "code": { + "code": "11 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_11", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10 -> tuple __tact_tuple_create_11((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) v)", + }, + { + "code": { + "code": "11 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_11", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) __tact_tuple_destroy_11(tuple v)", + }, + { + "code": { + "code": "12 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_12", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11 -> tuple __tact_tuple_create_12((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) v)", + }, + { + "code": { + "code": "12 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_12", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) __tact_tuple_destroy_12(tuple v)", + }, + { + "code": { + "code": "13 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_13", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12 -> tuple __tact_tuple_create_13((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) v)", + }, + { + "code": { + "code": "13 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_13", "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) __tact_tuple_destroy_13(tuple v)", }, { "code": { - "code": "14 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "14 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_14", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13 -> tuple __tact_tuple_create_14((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) v)", + }, + { + "code": { + "code": "14 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_14", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) __tact_tuple_destroy_14(tuple v)", + }, + { + "code": { + "code": "15 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_15", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14 -> tuple __tact_tuple_create_15((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) v)", + }, + { + "code": { + "code": "15 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_15", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) __tact_tuple_destroy_15(tuple v)", + }, + { + "code": { + "code": "return tpush(tpush(empty_tuple(), b), null());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_string_builder_start", + "signature": "tuple __tact_string_builder_start(builder b)", + }, + { + "code": { + "code": "return __tact_string_builder_start(begin_cell().store_uint(0, 32));", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_string_builder_start", + }, + "flags": Set { + "inline", + }, + "name": "__tact_string_builder_start_comment", + "signature": "tuple __tact_string_builder_start_comment()", + }, + { + "code": { + "code": "return __tact_string_builder_start(begin_cell().store_uint(0, 8));", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_string_builder_start", + }, + "flags": Set { + "inline", + }, + "name": "__tact_string_builder_start_tail_string", + "signature": "tuple __tact_string_builder_start_tail_string()", + }, + { + "code": { + "code": "return __tact_string_builder_start(begin_cell());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_string_builder_start", + }, + "flags": Set { + "inline", + }, + "name": "__tact_string_builder_start_string", + "signature": "tuple __tact_string_builder_start_string()", + }, + { + "code": { + "code": "(builder b, tuple tail) = uncons(builders); +cell c = b.end_cell(); +while(~ null?(tail)) { + (b, tail) = uncons(tail); + c = b.store_ref(c).end_cell(); +} +return c;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_string_builder_end", + "signature": "cell __tact_string_builder_end(tuple builders)", + }, + { + "code": { + "code": "return __tact_string_builder_end(builders).begin_parse();", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_string_builder_end", + }, + "flags": Set { + "inline", + }, + "name": "__tact_string_builder_end_slice", + "signature": "slice __tact_string_builder_end_slice(tuple builders)", + }, + { + "code": { + "code": "int sliceRefs = slice_refs(sc); +int sliceBits = slice_bits(sc); + +while((sliceBits > 0) | (sliceRefs > 0)) { + + ;; Load the current builder + (builder b, tuple tail) = uncons(builders); + int remBytes = 127 - (builder_bits(b) / 8); + int exBytes = sliceBits / 8; + + ;; Append bits + int amount = min(remBytes, exBytes); + if (amount > 0) { + slice read = sc~load_bits(amount * 8); + b = b.store_slice(read); + } + + ;; Update builders + builders = cons(b, tail); + + ;; Check if we need to add a new cell and continue + if (exBytes - amount > 0) { + var bb = begin_cell(); + builders = cons(bb, builders); + sliceBits = (exBytes - amount) * 8; + } elseif (sliceRefs > 0) { + sc = sc~load_ref().begin_parse(); + sliceRefs = slice_refs(sc); + sliceBits = slice_bits(sc); + } else { + sliceBits = 0; + sliceRefs = 0; + } +} + +return ((builders), ());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_string_builder_append", + "signature": "((tuple), ()) __tact_string_builder_append(tuple builders, slice sc)", + }, + { + "code": { + "code": "builders~__tact_string_builder_append(sc); +return builders;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_string_builder_append", + }, + "flags": Set {}, + "name": "__tact_string_builder_append_not_mut", + "signature": "(tuple) __tact_string_builder_append_not_mut(tuple builders, slice sc)", + }, + { + "code": { + "code": "var b = begin_cell(); +if (src < 0) { + b = b.store_uint(45, 8); + src = - src; +} + +if (src < 1000000000000000000000000000000) { + int len = 0; + int value = 0; + int mult = 1; + do { + (src, int res) = src.divmod(10); + value = value + (res + 48) * mult; + mult = mult * 256; + len = len + 1; + } until (src == 0); + + b = b.store_uint(value, len * 8); +} else { + tuple t = empty_tuple(); + int len = 0; + do { + int digit = src % 10; + t~tpush(digit); + len = len + 1; + src = src / 10; + } until (src == 0); + + int c = len - 1; + repeat(len) { + int v = t.at(c); + b = b.store_uint(v + 48, 8); + c = c - 1; + } +} +return b.end_cell().begin_parse();", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_int_to_string", + "signature": "slice __tact_int_to_string(int src)", + }, + { + "code": { + "code": "throw_if(134, (digits <= 0) | (digits > 77)); +builder b = begin_cell(); + +if (src < 0) { + b = b.store_uint(45, 8); + src = - src; +} + +;; Process rem part +int skip = true; +int len = 0; +int rem = 0; +tuple t = empty_tuple(); +repeat(digits) { + (src, rem) = src.divmod(10); + if ( ~ ( skip & ( rem == 0 ) ) ) { + skip = false; + t~tpush(rem + 48); + len = len + 1; + } +} + +;; Process dot +if (~ skip) { + t~tpush(46); + len = len + 1; +} + +;; Main +do { + (src, rem) = src.divmod(10); + t~tpush(rem + 48); + len = len + 1; +} until (src == 0); + +;; Assemble +int c = len - 1; +repeat(len) { + int v = t.at(c); + b = b.store_uint(v, 8); + c = c - 1; +} + +;; Result +return b.end_cell().begin_parse();", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_float_to_string", + "signature": "slice __tact_float_to_string(int src, int digits)", + }, + { + "code": { + "code": "throw_unless(5, num > 0); +throw_unless(5, base > 1); +if (num < base) { + return 0; +} +int result = 0; +while (num >= base) { + num /= base; + result += 1; +} +return result;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_log", + "signature": "int __tact_log(int num, int base)", + }, + { + "code": { + "code": "throw_unless(5, exp >= 0); +int result = 1; +repeat (exp) { + result *= base; +} +return result;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_pow", + "signature": "int __tact_pow(int base, int exp)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_slice", + "signature": "slice __tact_dict_get_slice_slice(cell d, int kl, slice k)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_slice", + "signature": "(slice, slice, int) __tact_dict_min_slice_slice(cell d, int kl)", + }, + { + "code": { + "code": "return __tact_dict_next(d, kl, pivot);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_slice", + "signature": "(slice, slice, int) __tact_dict_next_slice_slice(cell d, int kl, slice pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_slice(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_slice", + "signature": "(cell, ()) __tact_dict_set_slice_slice(cell d, int kl, slice k, slice v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_slice(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_slice", + "signature": "(cell, (int)) __tact_dict_replace_slice_slice(cell d, int kl, slice k, slice v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_slice(v).end_cell().begin_parse()); +if (ok) { + return (d, old); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_slice", + "signature": "(cell, (slice)) __tact_dict_replaceget_slice_slice(cell d, int kl, slice k, slice v)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_int(vl); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_int", + "signature": "int __tact_dict_get_slice_int(cell d, int kl, slice k, int vl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_int", + "signature": "(slice, int, int) __tact_dict_min_slice_int(cell d, int kl, int vl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_int", + "signature": "(slice, int, int) __tact_dict_next_slice_int(cell d, int kl, slice pivot, int vl)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_int", + "signature": "(cell, ()) __tact_dict_set_slice_int(cell d, int kl, slice k, int v, int vl)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_int", + "signature": "(cell, (int)) __tact_dict_replace_slice_int(cell d, int kl, slice k, int v, int vl)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_int(vl)); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_int", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_int(cell d, int kl, slice k, int v, int vl)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_uint(vl); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_uint", + "signature": "int __tact_dict_get_slice_uint(cell d, int kl, slice k, int vl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_uint(vl), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_uint", + "signature": "(slice, int, int) __tact_dict_min_slice_uint(cell d, int kl, int vl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_uint(vl), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_uint", + "signature": "(slice, int, int) __tact_dict_next_slice_uint(cell d, int kl, slice pivot, int vl)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_uint", + "signature": "(cell, ()) __tact_dict_set_slice_uint(cell d, int kl, slice k, int v, int vl)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_uint", + "signature": "(cell, (int)) __tact_dict_replace_slice_uint(cell d, int kl, slice k, int v, int vl)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_uint(vl)); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_uint", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_uint(cell d, int kl, slice k, int v, int vl)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get_ref(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get_ref", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_cell", + "signature": "cell __tact_dict_get_slice_cell(cell d, int kl, slice k)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min_ref(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min_ref", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_cell", + "signature": "(slice, cell, int) __tact_dict_min_slice_cell(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_ref(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_cell", + "signature": "(slice, cell, int) __tact_dict_next_slice_cell(cell d, int kl, slice pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return __tact_dict_set_ref(d, kl, k, v); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + "__tact_dict_set_ref", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_cell", + "signature": "(cell, ()) __tact_dict_set_slice_cell(cell d, int kl, slice k, cell v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return __tact_dict_replace_ref(d, kl, k, v); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + "__tact_dict_replace_ref", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_cell", + "signature": "(cell, (int)) __tact_dict_replace_slice_cell(cell d, int kl, slice k, cell v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get_ref(kl, k) : d~__tact_dict_replaceget_ref(kl, k, v); +if (ok) { + return (d, old); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get_ref", + "__tact_dict_replaceget_ref", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_cell", + "signature": "(cell, (cell)) __tact_dict_replaceget_slice_cell(cell d, int kl, slice k, cell v)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_coins(); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_coins", + "signature": "int __tact_dict_get_slice_coins(cell d, int kl, slice k)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_coins", + "signature": "(slice, int, int) __tact_dict_min_slice_coins(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_coins", + "signature": "(slice, int, int) __tact_dict_next_slice_coins(cell d, int kl, slice pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_coins", + "signature": "(cell, ()) __tact_dict_set_slice_coins(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_coins", + "signature": "(cell, (int)) __tact_dict_replace_slice_coins(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_coins()); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_coins(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_varint16(); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_varint16", + "signature": "int __tact_dict_get_slice_varint16(cell d, int kl, slice k)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_varint16", + "signature": "(slice, int, int) __tact_dict_min_slice_varint16(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_varint16", + "signature": "(slice, int, int) __tact_dict_next_slice_varint16(cell d, int kl, slice pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_varint16", + "signature": "(cell, ()) __tact_dict_set_slice_varint16(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_varint16(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_varint16", + "signature": "(cell, (int)) __tact_dict_replace_slice_varint16(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint16()); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_varint16", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varint16(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_varint32(); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_varint32", + "signature": "int __tact_dict_get_slice_varint32(cell d, int kl, slice k)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_varint32", + "signature": "(slice, int, int) __tact_dict_min_slice_varint32(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_varint32", + "signature": "(slice, int, int) __tact_dict_next_slice_varint32(cell d, int kl, slice pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_varint32", + "signature": "(cell, ()) __tact_dict_set_slice_varint32(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_varint32(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_varint32", + "signature": "(cell, (int)) __tact_dict_replace_slice_varint32(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint32()); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_varint32", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varint32(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_varuint16(); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_varuint16", + "signature": "int __tact_dict_get_slice_varuint16(cell d, int kl, slice k)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_varuint16", + "signature": "(slice, int, int) __tact_dict_min_slice_varuint16(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_varuint16", + "signature": "(slice, int, int) __tact_dict_next_slice_varuint16(cell d, int kl, slice pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_varuint16", + "signature": "(cell, ()) __tact_dict_set_slice_varuint16(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_varuint16", + "signature": "(cell, (int)) __tact_dict_replace_slice_varuint16(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint16()); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_varuint16", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varuint16(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_varuint32(); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_varuint32", + "signature": "int __tact_dict_get_slice_varuint32(cell d, int kl, slice k)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_varuint32", + "signature": "(slice, int, int) __tact_dict_min_slice_varuint32(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_varuint32", + "signature": "(slice, int, int) __tact_dict_next_slice_varuint32(cell d, int kl, slice pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_varuint32", + "signature": "(cell, ()) __tact_dict_set_slice_varuint32(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_varuint32", + "signature": "(cell, (int)) __tact_dict_replace_slice_varuint32(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint32()); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_varuint32", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varuint32(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_uint_slice", + "signature": "slice __tact_dict_get_uint_slice(cell d, int kl, int k)", + }, + { + "code": { + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_14", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13 -> tuple __tact_tuple_create_14((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_uint_slice", + "signature": "(int, slice, int) __tact_dict_min_uint_slice(cell d, int kl)", }, { "code": { - "code": "14 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_14", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) __tact_tuple_destroy_14(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_uint_slice", + "signature": "(int, slice, int) __tact_dict_next_uint_slice(cell d, int kl, int pivot)", }, { "code": { - "code": "15 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set(d, kl, k, v), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_15", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14 -> tuple __tact_tuple_create_15((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_uint_slice", + "signature": "(cell, ()) __tact_dict_set_uint_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "15 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace?(d, kl, k, v); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_15", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) __tact_tuple_destroy_15(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_uint_slice", + "signature": "(cell, (int)) __tact_dict_replace_uint_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "return tpush(tpush(empty_tuple(), b), null());", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, v); +if (ok) { + return (d, old); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, @@ -10215,66 +14585,74 @@ return data;", "flags": Set { "inline", }, - "name": "__tact_string_builder_start", - "signature": "tuple __tact_string_builder_start(builder b)", + "name": "__tact_dict_replaceget_uint_slice", + "signature": "(cell, (slice)) __tact_dict_replaceget_uint_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "return __tact_string_builder_start(begin_cell().store_uint(0, 32));", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_int(vl); +} else { + return null(); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_string_builder_start", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_string_builder_start_comment", - "signature": "tuple __tact_string_builder_start_comment()", + "name": "__tact_dict_get_uint_int", + "signature": "int __tact_dict_get_uint_int(cell d, int kl, int k, int vl)", }, { "code": { - "code": "return __tact_string_builder_start(begin_cell().store_uint(0, 8));", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_string_builder_start", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_string_builder_start_tail_string", - "signature": "tuple __tact_string_builder_start_tail_string()", + "name": "__tact_dict_min_uint_int", + "signature": "(int, int, int) __tact_dict_min_uint_int(cell d, int kl, int vl)", }, { "code": { - "code": "return __tact_string_builder_start(begin_cell());", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_string_builder_start", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_string_builder_start_string", - "signature": "tuple __tact_string_builder_start_string()", + "name": "__tact_dict_next_uint_int", + "signature": "(int, int, int) __tact_dict_next_uint_int(cell d, int kl, int pivot, int vl)", }, { "code": { - "code": "(builder b, tuple tail) = uncons(builders); -cell c = b.end_cell(); -while(~ null?(tail)) { - (b, tail) = uncons(tail); - c = b.store_ref(c).end_cell(); -} -return c;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); +}", "kind": "generic", }, "comment": null, @@ -10283,203 +14661,131 @@ return c;", "flags": Set { "inline", }, - "name": "__tact_string_builder_end", - "signature": "cell __tact_string_builder_end(tuple builders)", + "name": "__tact_dict_set_uint_int", + "signature": "(cell, ()) __tact_dict_set_uint_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "return __tact_string_builder_end(builders).begin_parse();", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_string_builder_end", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_string_builder_end_slice", - "signature": "slice __tact_string_builder_end_slice(tuple builders)", + "name": "__tact_dict_replace_uint_int", + "signature": "(cell, (int)) __tact_dict_replace_uint_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "int sliceRefs = slice_refs(sc); -int sliceBits = slice_bits(sc); - -while((sliceBits > 0) | (sliceRefs > 0)) { - - ;; Load the current builder - (builder b, tuple tail) = uncons(builders); - int remBytes = 127 - (builder_bits(b) / 8); - int exBytes = sliceBits / 8; - - ;; Append bits - int amount = min(remBytes, exBytes); - if (amount > 0) { - slice read = sc~load_bits(amount * 8); - b = b.store_slice(read); - } - - ;; Update builders - builders = cons(b, tail); - - ;; Check if we need to add a new cell and continue - if (exBytes - amount > 0) { - var bb = begin_cell(); - builders = cons(bb, builders); - sliceBits = (exBytes - amount) * 8; - } elseif (sliceRefs > 0) { - sc = sc~load_ref().begin_parse(); - sliceRefs = slice_refs(sc); - sliceBits = slice_bits(sc); - } else { - sliceBits = 0; - sliceRefs = 0; - } -} - -return ((builders), ());", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_int(vl)); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_string_builder_append", - "signature": "((tuple), ()) __tact_string_builder_append(tuple builders, slice sc)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_uint_int", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "builders~__tact_string_builder_append(sc); -return builders;", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_uint(vl); +} else { + return null(); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_string_builder_append", + "depends": Set {}, + "flags": Set { + "inline", }, - "flags": Set {}, - "name": "__tact_string_builder_append_not_mut", - "signature": "(tuple) __tact_string_builder_append_not_mut(tuple builders, slice sc)", + "name": "__tact_dict_get_uint_uint", + "signature": "int __tact_dict_get_uint_uint(cell d, int kl, int k, int vl)", }, { "code": { - "code": "var b = begin_cell(); -if (src < 0) { - b = b.store_uint(45, 8); - src = - src; -} - -if (src < 1000000000000000000000000000000) { - int len = 0; - int value = 0; - int mult = 1; - do { - (src, int res) = src.divmod(10); - value = value + (res + 48) * mult; - mult = mult * 256; - len = len + 1; - } until (src == 0); - - b = b.store_uint(value, len * 8); + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_uint(vl), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_uint_uint", + "signature": "(int, int, int) __tact_dict_min_uint_uint(cell d, int kl, int vl)", + }, + { + "code": { + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_uint(vl), flag); } else { - tuple t = empty_tuple(); - int len = 0; - do { - int digit = src % 10; - t~tpush(digit); - len = len + 1; - src = src / 10; - } until (src == 0); - - int c = len - 1; - repeat(len) { - int v = t.at(c); - b = b.store_uint(v + 48, 8); - c = c - 1; - } -} -return b.end_cell().begin_parse();", + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_int_to_string", - "signature": "slice __tact_int_to_string(int src)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_uint_uint", + "signature": "(int, int, int) __tact_dict_next_uint_uint(cell d, int kl, int pivot, int vl)", }, { "code": { - "code": "throw_if(134, (digits <= 0) | (digits > 77)); -builder b = begin_cell(); - -if (src < 0) { - b = b.store_uint(45, 8); - src = - src; -} - -;; Process rem part -int skip = true; -int len = 0; -int rem = 0; -tuple t = empty_tuple(); -repeat(digits) { - (src, rem) = src.divmod(10); - if ( ~ ( skip & ( rem == 0 ) ) ) { - skip = false; - t~tpush(rem + 48); - len = len + 1; - } -} - -;; Process dot -if (~ skip) { - t~tpush(46); - len = len + 1; -} - -;; Main -do { - (src, rem) = src.divmod(10); - t~tpush(rem + 48); - len = len + 1; -} until (src == 0); - -;; Assemble -int c = len - 1; -repeat(len) { - int v = t.at(c); - b = b.store_uint(v, 8); - c = c - 1; -} - -;; Result -return b.end_cell().begin_parse();", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); +}", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_float_to_string", - "signature": "slice __tact_float_to_string(int src, int digits)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_uint_uint", + "signature": "(cell, ()) __tact_dict_set_uint_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "throw_unless(5, num > 0); -throw_unless(5, base > 1); -if (num < base) { - return 0; -} -int result = 0; -while (num >= base) { - num /= base; - result += 1; -} -return result;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); +}", "kind": "generic", }, "comment": null, @@ -10488,17 +14794,17 @@ return result;", "flags": Set { "inline", }, - "name": "__tact_log", - "signature": "int __tact_log(int num, int base)", + "name": "__tact_dict_replace_uint_uint", + "signature": "(cell, (int)) __tact_dict_replace_uint_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "throw_unless(5, exp >= 0); -int result = 1; -repeat (exp) { - result *= base; -} -return result;", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_uint(vl)); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, @@ -10507,12 +14813,12 @@ return result;", "flags": Set { "inline", }, - "name": "__tact_pow", - "signature": "int __tact_pow(int base, int exp)", + "name": "__tact_dict_replaceget_uint_uint", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); + "code": "var (r, ok) = udict_get_ref?(d, kl, k); if (ok) { return r; } else { @@ -10522,18 +14828,16 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_slice", - "signature": "slice __tact_dict_get_slice_slice(cell d, int kl, slice k)", + "name": "__tact_dict_get_uint_cell", + "signature": "cell __tact_dict_get_uint_cell(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min(d, kl); + "code": "var (key, value, flag) = udict_get_min_ref?(d, kl); if (flag) { return (key, value, flag); } else { @@ -10543,76 +14847,73 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_min_slice_slice", - "signature": "(slice, slice, int) __tact_dict_min_slice_slice(cell d, int kl)", + "name": "__tact_dict_min_uint_cell", + "signature": "(int, cell, int) __tact_dict_min_uint_cell(cell d, int kl)", }, { "code": { - "code": "return __tact_dict_next(d, kl, pivot);", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_ref(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_slice", - "signature": "(slice, slice, int) __tact_dict_next_slice_slice(cell d, int kl, slice pivot)", + "name": "__tact_dict_next_uint_cell", + "signature": "(int, cell, int) __tact_dict_next_uint_cell(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (dict_set_builder(d, kl, k, begin_cell().store_slice(v)), ()); + return (udict_set_ref(d, kl, k, v), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_set_slice_slice", - "signature": "(cell, ()) __tact_dict_set_slice_slice(cell d, int kl, slice k, slice v)", + "name": "__tact_dict_set_uint_cell", + "signature": "(cell, ()) __tact_dict_set_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return dict_replace_builder?(d, kl, k, begin_cell().store_slice(v)); + return udict_replace_ref?(d, kl, k, v); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_slice", - "signature": "(cell, (int)) __tact_dict_replace_slice_slice(cell d, int kl, slice k, slice v)", + "name": "__tact_dict_replace_uint_cell", + "signature": "(cell, (int)) __tact_dict_replace_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_slice(v).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get_ref?(kl, k) : d~udict_replaceget_ref?(kl, k, v); if (ok) { return (d, old); } else { @@ -10622,20 +14923,18 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_slice", - "signature": "(cell, (slice)) __tact_dict_replaceget_slice_slice(cell d, int kl, slice k, slice v)", + "name": "__tact_dict_replaceget_uint_cell", + "signature": "(cell, (cell)) __tact_dict_replaceget_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); + "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r~load_int(vl); + return r~load_coins(); } else { return null(); }", @@ -10643,20 +14942,18 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_int", - "signature": "int __tact_dict_get_slice_int(cell d, int kl, slice k, int vl)", + "name": "__tact_dict_get_uint_coins", + "signature": "int __tact_dict_get_uint_coins(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min(d, kl); + "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value~load_coins(), flag); } else { return (null(), null(), flag); }", @@ -10664,20 +14961,18 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_min_slice_int", - "signature": "(slice, int, int) __tact_dict_min_slice_int(cell d, int kl, int vl)", + "name": "__tact_dict_min_uint_coins", + "signature": "(int, int, int) __tact_dict_min_uint_coins(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value~load_coins(), flag); } else { return (null(), null(), flag); }", @@ -10685,62 +14980,56 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_int", - "signature": "(slice, int, int) __tact_dict_next_slice_int(cell d, int kl, slice pivot, int vl)", + "name": "__tact_dict_next_uint_coins", + "signature": "(int, int, int) __tact_dict_next_uint_coins(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (dict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); + return (udict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_set_slice_int", - "signature": "(cell, ()) __tact_dict_set_slice_int(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_dict_set_uint_coins", + "signature": "(cell, ()) __tact_dict_set_uint_coins(cell d, int kl, int k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return dict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); + return udict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_int", - "signature": "(cell, (int)) __tact_dict_replace_slice_int(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_dict_replace_uint_coins", + "signature": "(cell, (int)) __tact_dict_replace_uint_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_int(vl)); + return (d, old~load_coins()); } else { return (d, null()); }", @@ -10748,20 +15037,18 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_int", - "signature": "(cell, (int)) __tact_dict_replaceget_slice_int(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_dict_replaceget_uint_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); + "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r~load_uint(vl); + return r~load_varint16(); } else { return null(); }", @@ -10769,20 +15056,18 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_uint", - "signature": "int __tact_dict_get_slice_uint(cell d, int kl, slice k, int vl)", + "name": "__tact_dict_get_uint_varint16", + "signature": "int __tact_dict_get_uint_varint16(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min(d, kl); + "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value~load_varint16(), flag); } else { return (null(), null(), flag); }", @@ -10790,20 +15075,18 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_min_slice_uint", - "signature": "(slice, int, int) __tact_dict_min_slice_uint(cell d, int kl, int vl)", + "name": "__tact_dict_min_uint_varint16", + "signature": "(int, int, int) __tact_dict_min_uint_varint16(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value~load_varint16(), flag); } else { return (null(), null(), flag); }", @@ -10811,62 +15094,56 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_uint", - "signature": "(slice, int, int) __tact_dict_next_slice_uint(cell d, int kl, slice pivot, int vl)", + "name": "__tact_dict_next_uint_varint16", + "signature": "(int, int, int) __tact_dict_next_uint_varint16(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (dict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); + return (udict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_set_slice_uint", - "signature": "(cell, ()) __tact_dict_set_slice_uint(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_dict_set_uint_varint16", + "signature": "(cell, ()) __tact_dict_set_uint_varint16(cell d, int kl, int k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return dict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); + return udict_replace_builder?(d, kl, k, begin_cell().store_varint16(v)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_uint", - "signature": "(cell, (int)) __tact_dict_replace_slice_uint(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_dict_replace_uint_varint16", + "signature": "(cell, (int)) __tact_dict_replace_uint_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_uint(vl)); + return (d, old~load_varint16()); } else { return (d, null()); }", @@ -10874,20 +15151,18 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_uint", - "signature": "(cell, (int)) __tact_dict_replaceget_slice_uint(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_dict_replaceget_uint_varint16", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get_ref(d, kl, k); + "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r; + return r~load_varint32(); } else { return null(); }", @@ -10895,20 +15170,18 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_cell", - "signature": "cell __tact_dict_get_slice_cell(cell d, int kl, slice k)", + "name": "__tact_dict_get_uint_varint32", + "signature": "int __tact_dict_get_uint_varint32(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min_ref(d, kl); + "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_varint32(), flag); } else { return (null(), null(), flag); }", @@ -10916,20 +15189,18 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_min_slice_cell", - "signature": "(slice, cell, int) __tact_dict_min_slice_cell(cell d, int kl)", + "name": "__tact_dict_min_uint_varint32", + "signature": "(int, int, int) __tact_dict_min_uint_varint32(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_ref(), flag); + return (key, value~load_varint32(), flag); } else { return (null(), null(), flag); }", @@ -10937,64 +15208,56 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_cell", - "signature": "(slice, cell, int) __tact_dict_next_slice_cell(cell d, int kl, slice pivot)", + "name": "__tact_dict_next_uint_varint32", + "signature": "(int, int, int) __tact_dict_next_uint_varint32(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return __tact_dict_set_ref(d, kl, k, v); + return (udict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - "__tact_dict_set_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_set_slice_cell", - "signature": "(cell, ()) __tact_dict_set_slice_cell(cell d, int kl, slice k, cell v)", + "name": "__tact_dict_set_uint_varint32", + "signature": "(cell, ()) __tact_dict_set_uint_varint32(cell d, int kl, int k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return __tact_dict_replace_ref(d, kl, k, v); + return udict_replace_builder?(d, kl, k, begin_cell().store_varint32(v)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - "__tact_dict_replace_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_cell", - "signature": "(cell, (int)) __tact_dict_replace_slice_cell(cell d, int kl, slice k, cell v)", + "name": "__tact_dict_replace_uint_varint32", + "signature": "(cell, (int)) __tact_dict_replace_uint_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get_ref(kl, k) : d~__tact_dict_replaceget_ref(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_varint32()); } else { return (d, null()); }", @@ -11002,21 +15265,18 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get_ref", - "__tact_dict_replaceget_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_cell", - "signature": "(cell, (cell)) __tact_dict_replaceget_slice_cell(cell d, int kl, slice k, cell v)", + "name": "__tact_dict_replaceget_uint_varint32", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); + "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r~load_coins(); + return r~load_varuint16(); } else { return null(); }", @@ -11024,20 +15284,18 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_coins", - "signature": "int __tact_dict_get_slice_coins(cell d, int kl, slice k)", + "name": "__tact_dict_get_uint_varuint16", + "signature": "int __tact_dict_get_uint_varuint16(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min(d, kl); + "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value~load_coins(), flag); + return (key, value~load_varuint16(), flag); } else { return (null(), null(), flag); }", @@ -11045,20 +15303,18 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_min_slice_coins", - "signature": "(slice, int, int) __tact_dict_min_slice_coins(cell d, int kl)", + "name": "__tact_dict_min_uint_varuint16", + "signature": "(int, int, int) __tact_dict_min_uint_varuint16(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_coins(), flag); + return (key, value~load_varuint16(), flag); } else { return (null(), null(), flag); }", @@ -11066,62 +15322,56 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_coins", - "signature": "(slice, int, int) __tact_dict_next_slice_coins(cell d, int kl, slice pivot)", + "name": "__tact_dict_next_uint_varuint16", + "signature": "(int, int, int) __tact_dict_next_uint_varuint16(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (dict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); + return (udict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_set_slice_coins", - "signature": "(cell, ()) __tact_dict_set_slice_coins(cell d, int kl, slice k, int v)", + "name": "__tact_dict_set_uint_varuint16", + "signature": "(cell, ()) __tact_dict_set_uint_varuint16(cell d, int kl, int k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return dict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); + return udict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_coins", - "signature": "(cell, (int)) __tact_dict_replace_slice_coins(cell d, int kl, slice k, int v)", + "name": "__tact_dict_replace_uint_varuint16", + "signature": "(cell, (int)) __tact_dict_replace_uint_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_coins()); + return (d, old~load_varuint16()); } else { return (d, null()); }", @@ -11129,20 +15379,18 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_coins", - "signature": "(cell, (int)) __tact_dict_replaceget_slice_coins(cell d, int kl, slice k, int v)", + "name": "__tact_dict_replaceget_uint_varuint16", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varuint16(cell d, int kl, int k, int v)", }, { "code": { "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r; + return r~load_varuint32(); } else { return null(); }", @@ -11154,14 +15402,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_slice", - "signature": "slice __tact_dict_get_uint_slice(cell d, int kl, int k)", + "name": "__tact_dict_get_uint_varuint32", + "signature": "int __tact_dict_get_uint_varuint32(cell d, int kl, int k)", }, { "code": { "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_varuint32(), flag); } else { return (null(), null(), flag); }", @@ -11173,14 +15421,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_slice", - "signature": "(int, slice, int) __tact_dict_min_uint_slice(cell d, int kl)", + "name": "__tact_dict_min_uint_varuint32", + "signature": "(int, int, int) __tact_dict_min_uint_varuint32(cell d, int kl)", }, { "code": { "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value, flag); + return (key, value~load_varuint32(), flag); } else { return (null(), null(), flag); }", @@ -11192,8 +15440,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_slice", - "signature": "(int, slice, int) __tact_dict_next_uint_slice(cell d, int kl, int pivot)", + "name": "__tact_dict_next_uint_varuint32", + "signature": "(int, int, int) __tact_dict_next_uint_varuint32(cell d, int kl, int pivot)", }, { "code": { @@ -11201,7 +15449,7 @@ if (flag) { var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (udict_set(d, kl, k, v), ()); + return (udict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ()); }", "kind": "generic", }, @@ -11211,8 +15459,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_slice", - "signature": "(cell, ()) __tact_dict_set_uint_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_set_uint_varuint32", + "signature": "(cell, ()) __tact_dict_set_uint_varuint32(cell d, int kl, int k, int v)", }, { "code": { @@ -11220,7 +15468,7 @@ if (flag) { var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return udict_replace?(d, kl, k, v); + return udict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v)); }", "kind": "generic", }, @@ -11230,14 +15478,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_slice", - "signature": "(cell, (int)) __tact_dict_replace_uint_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_replace_uint_varuint32", + "signature": "(cell, (int)) __tact_dict_replace_uint_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_varuint32()); } else { return (d, null()); }", @@ -11249,14 +15497,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_slice", - "signature": "(cell, (slice)) __tact_dict_replaceget_uint_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_replaceget_uint_varuint32", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); + "code": "var (r, ok) = idict_get?(d, kl, k); if (ok) { - return r~load_int(vl); + return r; } else { return null(); }", @@ -11268,14 +15516,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_int", - "signature": "int __tact_dict_get_uint_int(cell d, int kl, int k, int vl)", + "name": "__tact_dict_get_int_slice", + "signature": "slice __tact_dict_get_int_slice(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); + "code": "var (key, value, flag) = idict_get_min?(d, kl); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value, flag); } else { return (null(), null(), flag); }", @@ -11287,14 +15535,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_int", - "signature": "(int, int, int) __tact_dict_min_uint_int(cell d, int kl, int vl)", + "name": "__tact_dict_min_int_slice", + "signature": "(int, slice, int) __tact_dict_min_int_slice(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value, flag); } else { return (null(), null(), flag); }", @@ -11306,16 +15554,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_int", - "signature": "(int, int, int) __tact_dict_next_uint_int(cell d, int kl, int pivot, int vl)", + "name": "__tact_dict_next_int_slice", + "signature": "(int, slice, int) __tact_dict_next_int_slice(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = idict_delete?(d, kl, k); return (r, ()); } else { - return (udict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); + return (idict_set(d, kl, k, v), ()); }", "kind": "generic", }, @@ -11325,16 +15573,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_int", - "signature": "(cell, ()) __tact_dict_set_uint_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_set_int_slice", + "signature": "(cell, ()) __tact_dict_set_int_slice(cell d, int kl, int k, slice v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = idict_delete?(d, kl, k); return (r, (ok)); } else { - return udict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); + return idict_replace?(d, kl, k, v); }", "kind": "generic", }, @@ -11344,14 +15592,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_int", - "signature": "(cell, (int)) __tact_dict_replace_uint_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_int_slice", + "signature": "(cell, (int)) __tact_dict_replace_int_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, v); if (ok) { - return (d, old~load_int(vl)); + return (d, old); } else { return (d, null()); }", @@ -11363,14 +15611,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_int", - "signature": "(cell, (int)) __tact_dict_replaceget_uint_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_int_slice", + "signature": "(cell, (slice)) __tact_dict_replaceget_int_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); + "code": "var (r, ok) = idict_get?(d, kl, k); if (ok) { - return r~load_uint(vl); + return r~load_int(vl); } else { return null(); }", @@ -11382,14 +15630,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_uint", - "signature": "int __tact_dict_get_uint_uint(cell d, int kl, int k, int vl)", + "name": "__tact_dict_get_int_int", + "signature": "int __tact_dict_get_int_int(cell d, int kl, int k, int vl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); + "code": "var (key, value, flag) = idict_get_min?(d, kl); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value~load_int(vl), flag); } else { return (null(), null(), flag); }", @@ -11401,14 +15649,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_uint", - "signature": "(int, int, int) __tact_dict_min_uint_uint(cell d, int kl, int vl)", + "name": "__tact_dict_min_int_int", + "signature": "(int, int, int) __tact_dict_min_int_int(cell d, int kl, int vl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value~load_int(vl), flag); } else { return (null(), null(), flag); }", @@ -11420,16 +15668,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_uint", - "signature": "(int, int, int) __tact_dict_next_uint_uint(cell d, int kl, int pivot, int vl)", + "name": "__tact_dict_next_int_int", + "signature": "(int, int, int) __tact_dict_next_int_int(cell d, int kl, int pivot, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = idict_delete?(d, kl, k); return (r, ()); } else { - return (udict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); + return (idict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); }", "kind": "generic", }, @@ -11439,16 +15687,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_uint", - "signature": "(cell, ()) __tact_dict_set_uint_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_set_int_int", + "signature": "(cell, ()) __tact_dict_set_int_int(cell d, int kl, int k, int v, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = idict_delete?(d, kl, k); return (r, (ok)); } else { - return udict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); + return idict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); }", "kind": "generic", }, @@ -11458,14 +15706,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_uint", - "signature": "(cell, (int)) __tact_dict_replace_uint_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_int_int", + "signature": "(cell, (int)) __tact_dict_replace_int_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); if (ok) { - return (d, old~load_uint(vl)); + return (d, old~load_int(vl)); } else { return (d, null()); }", @@ -11477,14 +15725,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_uint", - "signature": "(cell, (int)) __tact_dict_replaceget_uint_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_int_int", + "signature": "(cell, (int)) __tact_dict_replaceget_int_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (r, ok) = udict_get_ref?(d, kl, k); + "code": "var (r, ok) = idict_get?(d, kl, k); if (ok) { - return r; + return r~load_uint(vl); } else { return null(); }", @@ -11496,14 +15744,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_cell", - "signature": "cell __tact_dict_get_uint_cell(cell d, int kl, int k)", + "name": "__tact_dict_get_int_uint", + "signature": "int __tact_dict_get_int_uint(cell d, int kl, int k, int vl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min_ref?(d, kl); + "code": "var (key, value, flag) = idict_get_min?(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_uint(vl), flag); } else { return (null(), null(), flag); }", @@ -11515,14 +15763,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_cell", - "signature": "(int, cell, int) __tact_dict_min_uint_cell(cell d, int kl)", + "name": "__tact_dict_min_int_uint", + "signature": "(int, int, int) __tact_dict_min_int_uint(cell d, int kl, int vl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_ref(), flag); + return (key, value~load_uint(vl), flag); } else { return (null(), null(), flag); }", @@ -11534,16 +15782,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_cell", - "signature": "(int, cell, int) __tact_dict_next_uint_cell(cell d, int kl, int pivot)", + "name": "__tact_dict_next_int_uint", + "signature": "(int, int, int) __tact_dict_next_int_uint(cell d, int kl, int pivot, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = idict_delete?(d, kl, k); return (r, ()); } else { - return (udict_set_ref(d, kl, k, v), ()); + return (idict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); }", "kind": "generic", }, @@ -11553,16 +15801,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_cell", - "signature": "(cell, ()) __tact_dict_set_uint_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_set_int_uint", + "signature": "(cell, ()) __tact_dict_set_int_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = idict_delete?(d, kl, k); return (r, (ok)); } else { - return udict_replace_ref?(d, kl, k, v); + return idict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); }", "kind": "generic", }, @@ -11572,14 +15820,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_cell", - "signature": "(cell, (int)) __tact_dict_replace_uint_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replace_int_uint", + "signature": "(cell, (int)) __tact_dict_replace_int_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get_ref?(kl, k) : d~udict_replaceget_ref?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_uint(vl)); } else { return (d, null()); }", @@ -11591,14 +15839,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_cell", - "signature": "(cell, (cell)) __tact_dict_replaceget_uint_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replaceget_int_uint", + "signature": "(cell, (int)) __tact_dict_replaceget_int_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); + "code": "var (r, ok) = idict_get_ref?(d, kl, k); if (ok) { - return r~load_coins(); + return r; } else { return null(); }", @@ -11610,14 +15858,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_coins", - "signature": "int __tact_dict_get_uint_coins(cell d, int kl, int k)", + "name": "__tact_dict_get_int_cell", + "signature": "cell __tact_dict_get_int_cell(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); + "code": "var (key, value, flag) = idict_get_min_ref?(d, kl); if (flag) { - return (key, value~load_coins(), flag); + return (key, value, flag); } else { return (null(), null(), flag); }", @@ -11629,14 +15877,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_coins", - "signature": "(int, int, int) __tact_dict_min_uint_coins(cell d, int kl)", + "name": "__tact_dict_min_int_cell", + "signature": "(int, cell, int) __tact_dict_min_int_cell(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_coins(), flag); + return (key, value~load_ref(), flag); } else { return (null(), null(), flag); }", @@ -11648,16 +15896,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_coins", - "signature": "(int, int, int) __tact_dict_next_uint_coins(cell d, int kl, int pivot)", + "name": "__tact_dict_next_int_cell", + "signature": "(int, cell, int) __tact_dict_next_int_cell(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = idict_delete?(d, kl, k); return (r, ()); } else { - return (udict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); + return (idict_set_ref(d, kl, k, v), ()); }", "kind": "generic", }, @@ -11667,16 +15915,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_coins", - "signature": "(cell, ()) __tact_dict_set_uint_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_set_int_cell", + "signature": "(cell, ()) __tact_dict_set_int_cell(cell d, int kl, int k, cell v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = idict_delete?(d, kl, k); return (r, (ok)); } else { - return udict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); + return idict_replace_ref?(d, kl, k, v); }", "kind": "generic", }, @@ -11686,14 +15934,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_coins", - "signature": "(cell, (int)) __tact_dict_replace_uint_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replace_int_cell", + "signature": "(cell, (int)) __tact_dict_replace_int_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get_ref?(kl, k) : d~idict_replaceget_ref?(kl, k, v); if (ok) { - return (d, old~load_coins()); + return (d, old); } else { return (d, null()); }", @@ -11705,14 +15953,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_coins", - "signature": "(cell, (int)) __tact_dict_replaceget_uint_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replaceget_int_cell", + "signature": "(cell, (cell)) __tact_dict_replaceget_int_cell(cell d, int kl, int k, cell v)", }, { "code": { "code": "var (r, ok) = idict_get?(d, kl, k); if (ok) { - return r; + return r~load_coins(); } else { return null(); }", @@ -11724,14 +15972,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_slice", - "signature": "slice __tact_dict_get_int_slice(cell d, int kl, int k)", + "name": "__tact_dict_get_int_coins", + "signature": "int __tact_dict_get_int_coins(cell d, int kl, int k)", }, { "code": { "code": "var (key, value, flag) = idict_get_min?(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_coins(), flag); } else { return (null(), null(), flag); }", @@ -11743,14 +15991,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_slice", - "signature": "(int, slice, int) __tact_dict_min_int_slice(cell d, int kl)", + "name": "__tact_dict_min_int_coins", + "signature": "(int, int, int) __tact_dict_min_int_coins(cell d, int kl)", }, { "code": { "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); if (flag) { - return (key, value, flag); + return (key, value~load_coins(), flag); } else { return (null(), null(), flag); }", @@ -11762,8 +16010,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_slice", - "signature": "(int, slice, int) __tact_dict_next_int_slice(cell d, int kl, int pivot)", + "name": "__tact_dict_next_int_coins", + "signature": "(int, int, int) __tact_dict_next_int_coins(cell d, int kl, int pivot)", }, { "code": { @@ -11771,7 +16019,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set(d, kl, k, v), ()); + return (idict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); }", "kind": "generic", }, @@ -11781,8 +16029,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_slice", - "signature": "(cell, ()) __tact_dict_set_int_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_set_int_coins", + "signature": "(cell, ()) __tact_dict_set_int_coins(cell d, int kl, int k, int v)", }, { "code": { @@ -11790,7 +16038,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace?(d, kl, k, v); + return idict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); }", "kind": "generic", }, @@ -11800,14 +16048,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_slice", - "signature": "(cell, (int)) __tact_dict_replace_int_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_replace_int_coins", + "signature": "(cell, (int)) __tact_dict_replace_int_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_coins()); } else { return (d, null()); }", @@ -11819,14 +16067,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_slice", - "signature": "(cell, (slice)) __tact_dict_replaceget_int_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_replaceget_int_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_int_coins(cell d, int kl, int k, int v)", }, { "code": { "code": "var (r, ok) = idict_get?(d, kl, k); if (ok) { - return r~load_int(vl); + return r~load_varint16(); } else { return null(); }", @@ -11838,14 +16086,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_int", - "signature": "int __tact_dict_get_int_int(cell d, int kl, int k, int vl)", + "name": "__tact_dict_get_int_varint16", + "signature": "int __tact_dict_get_int_varint16(cell d, int kl, int k)", }, { "code": { "code": "var (key, value, flag) = idict_get_min?(d, kl); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value~load_varint16(), flag); } else { return (null(), null(), flag); }", @@ -11857,14 +16105,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_int", - "signature": "(int, int, int) __tact_dict_min_int_int(cell d, int kl, int vl)", + "name": "__tact_dict_min_int_varint16", + "signature": "(int, int, int) __tact_dict_min_int_varint16(cell d, int kl)", }, { "code": { "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value~load_varint16(), flag); } else { return (null(), null(), flag); }", @@ -11876,8 +16124,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_int", - "signature": "(int, int, int) __tact_dict_next_int_int(cell d, int kl, int pivot, int vl)", + "name": "__tact_dict_next_int_varint16", + "signature": "(int, int, int) __tact_dict_next_int_varint16(cell d, int kl, int pivot)", }, { "code": { @@ -11885,7 +16133,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); + return (idict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ()); }", "kind": "generic", }, @@ -11895,8 +16143,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_int", - "signature": "(cell, ()) __tact_dict_set_int_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_set_int_varint16", + "signature": "(cell, ()) __tact_dict_set_int_varint16(cell d, int kl, int k, int v)", }, { "code": { @@ -11904,7 +16152,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); + return idict_replace_builder?(d, kl, k, begin_cell().store_varint16(v)); }", "kind": "generic", }, @@ -11914,14 +16162,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_int", - "signature": "(cell, (int)) __tact_dict_replace_int_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_int_varint16", + "signature": "(cell, (int)) __tact_dict_replace_int_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_int(vl)); + return (d, old~load_varint16()); } else { return (d, null()); }", @@ -11933,14 +16181,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_int", - "signature": "(cell, (int)) __tact_dict_replaceget_int_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_int_varint16", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varint16(cell d, int kl, int k, int v)", }, { "code": { "code": "var (r, ok) = idict_get?(d, kl, k); if (ok) { - return r~load_uint(vl); + return r~load_varint32(); } else { return null(); }", @@ -11952,14 +16200,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_uint", - "signature": "int __tact_dict_get_int_uint(cell d, int kl, int k, int vl)", + "name": "__tact_dict_get_int_varint32", + "signature": "int __tact_dict_get_int_varint32(cell d, int kl, int k)", }, { "code": { "code": "var (key, value, flag) = idict_get_min?(d, kl); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value~load_varint32(), flag); } else { return (null(), null(), flag); }", @@ -11971,14 +16219,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_uint", - "signature": "(int, int, int) __tact_dict_min_int_uint(cell d, int kl, int vl)", + "name": "__tact_dict_min_int_varint32", + "signature": "(int, int, int) __tact_dict_min_int_varint32(cell d, int kl)", }, { "code": { "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value~load_varint32(), flag); } else { return (null(), null(), flag); }", @@ -11990,8 +16238,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_uint", - "signature": "(int, int, int) __tact_dict_next_int_uint(cell d, int kl, int pivot, int vl)", + "name": "__tact_dict_next_int_varint32", + "signature": "(int, int, int) __tact_dict_next_int_varint32(cell d, int kl, int pivot)", }, { "code": { @@ -11999,7 +16247,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); + return (idict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ()); }", "kind": "generic", }, @@ -12009,8 +16257,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_uint", - "signature": "(cell, ()) __tact_dict_set_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_set_int_varint32", + "signature": "(cell, ()) __tact_dict_set_int_varint32(cell d, int kl, int k, int v)", }, { "code": { @@ -12018,7 +16266,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); + return idict_replace_builder?(d, kl, k, begin_cell().store_varint32(v)); }", "kind": "generic", }, @@ -12028,14 +16276,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_uint", - "signature": "(cell, (int)) __tact_dict_replace_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_int_varint32", + "signature": "(cell, (int)) __tact_dict_replace_int_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_uint(vl)); + return (d, old~load_varint32()); } else { return (d, null()); }", @@ -12047,14 +16295,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_uint", - "signature": "(cell, (int)) __tact_dict_replaceget_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_int_varint32", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (r, ok) = idict_get_ref?(d, kl, k); + "code": "var (r, ok) = idict_get?(d, kl, k); if (ok) { - return r; + return r~load_varuint16(); } else { return null(); }", @@ -12066,14 +16314,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_cell", - "signature": "cell __tact_dict_get_int_cell(cell d, int kl, int k)", + "name": "__tact_dict_get_int_varuint16", + "signature": "int __tact_dict_get_int_varuint16(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min_ref?(d, kl); + "code": "var (key, value, flag) = idict_get_min?(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_varuint16(), flag); } else { return (null(), null(), flag); }", @@ -12085,14 +16333,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_cell", - "signature": "(int, cell, int) __tact_dict_min_int_cell(cell d, int kl)", + "name": "__tact_dict_min_int_varuint16", + "signature": "(int, int, int) __tact_dict_min_int_varuint16(cell d, int kl)", }, { "code": { "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_ref(), flag); + return (key, value~load_varuint16(), flag); } else { return (null(), null(), flag); }", @@ -12104,8 +16352,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_cell", - "signature": "(int, cell, int) __tact_dict_next_int_cell(cell d, int kl, int pivot)", + "name": "__tact_dict_next_int_varuint16", + "signature": "(int, int, int) __tact_dict_next_int_varuint16(cell d, int kl, int pivot)", }, { "code": { @@ -12113,7 +16361,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set_ref(d, kl, k, v), ()); + return (idict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ()); }", "kind": "generic", }, @@ -12123,8 +16371,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_cell", - "signature": "(cell, ()) __tact_dict_set_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_set_int_varuint16", + "signature": "(cell, ()) __tact_dict_set_int_varuint16(cell d, int kl, int k, int v)", }, { "code": { @@ -12132,7 +16380,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace_ref?(d, kl, k, v); + return idict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v)); }", "kind": "generic", }, @@ -12142,14 +16390,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_cell", - "signature": "(cell, (int)) __tact_dict_replace_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replace_int_varuint16", + "signature": "(cell, (int)) __tact_dict_replace_int_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get_ref?(kl, k) : d~idict_replaceget_ref?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_varuint16()); } else { return (d, null()); }", @@ -12161,14 +16409,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_cell", - "signature": "(cell, (cell)) __tact_dict_replaceget_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replaceget_int_varuint16", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varuint16(cell d, int kl, int k, int v)", }, { "code": { "code": "var (r, ok) = idict_get?(d, kl, k); if (ok) { - return r~load_coins(); + return r~load_varuint32(); } else { return null(); }", @@ -12180,14 +16428,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_coins", - "signature": "int __tact_dict_get_int_coins(cell d, int kl, int k)", + "name": "__tact_dict_get_int_varuint32", + "signature": "int __tact_dict_get_int_varuint32(cell d, int kl, int k)", }, { "code": { "code": "var (key, value, flag) = idict_get_min?(d, kl); if (flag) { - return (key, value~load_coins(), flag); + return (key, value~load_varuint32(), flag); } else { return (null(), null(), flag); }", @@ -12199,14 +16447,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_coins", - "signature": "(int, int, int) __tact_dict_min_int_coins(cell d, int kl)", + "name": "__tact_dict_min_int_varuint32", + "signature": "(int, int, int) __tact_dict_min_int_varuint32(cell d, int kl)", }, { "code": { "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_coins(), flag); + return (key, value~load_varuint32(), flag); } else { return (null(), null(), flag); }", @@ -12218,8 +16466,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_coins", - "signature": "(int, int, int) __tact_dict_next_int_coins(cell d, int kl, int pivot)", + "name": "__tact_dict_next_int_varuint32", + "signature": "(int, int, int) __tact_dict_next_int_varuint32(cell d, int kl, int pivot)", }, { "code": { @@ -12227,7 +16475,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); + return (idict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ()); }", "kind": "generic", }, @@ -12237,8 +16485,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_coins", - "signature": "(cell, ()) __tact_dict_set_int_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_set_int_varuint32", + "signature": "(cell, ()) __tact_dict_set_int_varuint32(cell d, int kl, int k, int v)", }, { "code": { @@ -12246,7 +16494,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); + return idict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v)); }", "kind": "generic", }, @@ -12256,14 +16504,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_coins", - "signature": "(cell, (int)) __tact_dict_replace_int_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replace_int_varuint32", + "signature": "(cell, (int)) __tact_dict_replace_int_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_coins()); + return (d, old~load_varuint32()); } else { return (d, null()); }", @@ -12275,8 +16523,8 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_coins", - "signature": "(cell, (int)) __tact_dict_replaceget_int_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replaceget_int_varuint32", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varuint32(cell d, int kl, int k, int v)", }, { "code": { diff --git a/src/generator/writers/writeFunction.ts b/src/generator/writers/writeFunction.ts index a5536b642..5c24f63ed 100644 --- a/src/generator/writers/writeFunction.ts +++ b/src/generator/writers/writeFunction.ts @@ -285,17 +285,23 @@ export function writeStatement( kind = "uint"; } if (t.value === "Int") { - let vBits = 257; + let vBits = ", 257"; let vKind = "int"; if (t.valueAs?.startsWith("int")) { - vBits = parseInt(t.valueAs.slice(3), 10); + vBits = `, ${parseInt(t.valueAs.slice(3), 10)}`; } else if (t.valueAs?.startsWith("uint")) { - vBits = parseInt(t.valueAs.slice(4), 10); + vBits = `, ${parseInt(t.valueAs.slice(4), 10)}`; vKind = "uint"; + } else if (t.valueAs?.startsWith("coins")) { + vBits = ""; + vKind = "coins"; + } else if (t.valueAs?.startsWith("var")) { + vBits = ""; + vKind = t.valueAs; } ctx.append( - `var (${key}, ${value}, ${flag}) = ${ctx.used(`__tact_dict_min_${kind}_${vKind}`)}(${path}, ${bits}, ${vBits});`, + `var (${key}, ${value}, ${flag}) = ${ctx.used(`__tact_dict_min_${kind}_${vKind}`)}(${path}, ${bits}${vBits});`, ); ctx.append(`while (${flag}) {`); ctx.inIndent(() => { @@ -303,7 +309,7 @@ export function writeStatement( writeStatement(s, self, returns, ctx); } ctx.append( - `(${key}, ${value}, ${flag}) = ${ctx.used(`__tact_dict_next_${kind}_${vKind}`)}(${path}, ${bits}, ${key}, ${vBits});`, + `(${key}, ${value}, ${flag}) = ${ctx.used(`__tact_dict_next_${kind}_${vKind}`)}(${path}, ${bits}, ${key}${vBits});`, ); }); ctx.append(`}`); @@ -373,16 +379,22 @@ export function writeStatement( // Handle address key if (t.key === "Address") { if (t.value === "Int") { - let vBits = 257; + let vBits = ", 257"; let vKind = "int"; if (t.valueAs?.startsWith("int")) { - vBits = parseInt(t.valueAs.slice(3), 10); + vBits = `, ${parseInt(t.valueAs.slice(3), 10)}`; } else if (t.valueAs?.startsWith("uint")) { - vBits = parseInt(t.valueAs.slice(4), 10); + vBits = `, ${parseInt(t.valueAs.slice(4), 10)}`; vKind = "uint"; + } else if (t.valueAs?.startsWith("coins")) { + vBits = ""; + vKind = "coins"; + } else if (t.valueAs?.startsWith("var")) { + vBits = ""; + vKind = t.valueAs; } ctx.append( - `var (${key}, ${value}, ${flag}) = ${ctx.used(`__tact_dict_min_slice_${vKind}`)}(${path}, 267, ${vBits});`, + `var (${key}, ${value}, ${flag}) = ${ctx.used(`__tact_dict_min_slice_${vKind}`)}(${path}, 267${vBits});`, ); ctx.append(`while (${flag}) {`); ctx.inIndent(() => { @@ -390,7 +402,7 @@ export function writeStatement( writeStatement(s, self, returns, ctx); } ctx.append( - `(${key}, ${value}, ${flag}) = ${ctx.used(`__tact_dict_next_slice_${vKind}`)}(${path}, 267, ${key}, ${vBits});`, + `(${key}, ${value}, ${flag}) = ${ctx.used(`__tact_dict_next_slice_${vKind}`)}(${path}, 267, ${key}${vBits});`, ); }); ctx.append(`}`); diff --git a/src/generator/writers/writeSerialization.ts b/src/generator/writers/writeSerialization.ts index a51bfba09..a9b593a80 100644 --- a/src/generator/writers/writeSerialization.ts +++ b/src/generator/writers/writeSerialization.ts @@ -143,14 +143,17 @@ function writeSerializerField( } return; } - case "coins": { + case "varint16": + case "varuint16": + case "varint32": + case "varuint32": { if (op.optional) { ctx.append( - `build_${gen} = ~ null?(${fieldName}) ? build_${gen}.store_int(true, 1).store_coins(${fieldName}) : build_${gen}.store_int(false, 1);`, + `build_${gen} = ~ null?(${fieldName}) ? build_${gen}.store_int(true, 1).store_${op.kind}(${fieldName}) : build_${gen}.store_int(false, 1);`, ); } else { ctx.append( - `build_${gen} = build_${gen}.store_coins(${fieldName});`, + `build_${gen} = build_${gen}.store_${op.kind}(${fieldName});`, ); } return; @@ -489,13 +492,16 @@ function writeFieldParser( } return; } - case "coins": { + case "varint16": + case "varint32": + case "varuint16": + case "varuint32": { if (op.optional) { ctx.append( - `${varName} = sc_${gen}~load_int(1) ? sc_${gen}~load_coins() : null();`, + `${varName} = sc_${gen}~load_int(1) ? sc_${gen}~load_${op.kind}() : null();`, ); } else { - ctx.append(`${varName} = sc_${gen}~load_coins();`); + ctx.append(`${varName} = sc_${gen}~load_${op.kind}();`); } return; } diff --git a/src/generator/writers/writeStdlib.ts b/src/generator/writers/writeStdlib.ts index 13e06f807..0872ff474 100644 --- a/src/generator/writers/writeStdlib.ts +++ b/src/generator/writers/writeStdlib.ts @@ -1122,7 +1122,17 @@ export function writeStdlib(ctx: WriterContext): void { const keyTypes = ["slice", "uint", "int"] as const; type KeyType = (typeof keyTypes)[number]; -const valTypes = ["slice", "int", "uint", "cell", "coins"] as const; +const valTypes = [ + "slice", + "int", + "uint", + "cell", + "coins", + "varint16", + "varint32", + "varuint16", + "varuint32", +] as const; type ValType = (typeof valTypes)[number]; function getSignatureKeyType(key: KeyType): KeyType { @@ -1130,7 +1140,7 @@ function getSignatureKeyType(key: KeyType): KeyType { } function getSignatureValueType(value: ValType): ValType { - return value === "uint" || value === "coins" ? "int" : value; + return value === "slice" || value === "cell" ? value : "int"; } function genTactDictGet( @@ -1162,6 +1172,14 @@ function genTactDictGet( return "r~load_int(vl)"; case "coins": return "r~load_coins()"; + case "varint16": + return "r~load_varint16()"; + case "varint32": + return "r~load_varint32()"; + case "varuint16": + return "r~load_varuint16()"; + case "varuint32": + return "r~load_varuint32()"; } }; const valBitsArg = () => { @@ -1169,6 +1187,10 @@ function genTactDictGet( case "slice": case "cell": case "coins": + case "varint16": + case "varint32": + case "varuint16": + case "varuint32": return ""; case "uint": case "int": @@ -1233,6 +1255,10 @@ function genTactDictSet( case "slice": case "cell": case "coins": + case "varint16": + case "varint32": + case "varuint16": + case "varuint32": return ""; case "uint": case "int": @@ -1254,12 +1280,24 @@ function genTactDictSet( .on("int", "int")(() => "(idict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ())") .on("int", "uint")(() => "(idict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ())") .on("int", "coins")(() => "(idict_set_builder(d, kl, k, begin_cell().store_coins(v)), ())") + .on("int", "varint16")(() => "(idict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ())") + .on("int", "varint32")(() => "(idict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ())") + .on("int", "varuint16")(() => "(idict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ())") + .on("int", "varuint32")(() => "(idict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ())") .on("uint", "int")(() => "(udict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ())") .on("uint", "uint")(() => "(udict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ())") .on("uint", "coins")(() => "(udict_set_builder(d, kl, k, begin_cell().store_coins(v)), ())") + .on("uint", "varint16")(() => "(udict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ())") + .on("uint", "varint32")(() => "(udict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ())") + .on("uint", "varuint16")(() => "(udict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ())") + .on("uint", "varuint32")(() => "(udict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ())") .on("slice", "int")(() => "(dict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ())") .on("slice", "uint")(() => "(dict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ())") .on("slice", "coins")(() => "(dict_set_builder(d, kl, k, begin_cell().store_coins(v)), ())") + .on("slice", "varint16")(() => "(dict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ())") + .on("slice", "varint32")(() => "(dict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ())") + .on("slice", "varuint16")(() => "(dict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ())") + .on("slice", "varuint32")(() => "(dict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ())") .on("int", "cell")(() => "(idict_set_ref(d, kl, k, v), ())") .on("uint", "cell")(() => "(udict_set_ref(d, kl, k, v), ())") .on("int", "slice")(() => "(idict_set(d, kl, k, v), ())") @@ -1298,6 +1336,10 @@ function genTactDictGetMin( case "slice": case "cell": case "coins": + case "varint16": + case "varint32": + case "varuint16": + case "varuint32": return ""; case "uint": case "int": @@ -1309,14 +1351,26 @@ function genTactDictGetMin( .on("int", "int")(() => "idict_get_min?") .on("int", "uint")(() => "idict_get_min?") .on("int", "coins")(() => "idict_get_min?") + .on("int", "varint16")(() => "idict_get_min?") + .on("int", "varint32")(() => "idict_get_min?") + .on("int", "varuint16")(() => "idict_get_min?") + .on("int", "varuint32")(() => "idict_get_min?") .on("int", "slice")(() => "idict_get_min?") .on("uint", "int")(() => "udict_get_min?") .on("uint", "uint")(() => "udict_get_min?") .on("uint", "coins")(() => "udict_get_min?") + .on("uint", "varint16")(() => "udict_get_min?") + .on("uint", "varint32")(() => "udict_get_min?") + .on("uint", "varuint16")(() => "udict_get_min?") + .on("uint", "varuint32")(() => "udict_get_min?") .on("uint", "slice")(() => "udict_get_min?") .on("slice", "int")(() => ctx.used("__tact_dict_min")) .on("slice", "uint")(() => ctx.used("__tact_dict_min")) .on("slice", "coins")(() => ctx.used("__tact_dict_min")) + .on("slice", "varint16")(() => ctx.used("__tact_dict_min")) + .on("slice", "varint32")(() => ctx.used("__tact_dict_min")) + .on("slice", "varuint16")(() => ctx.used("__tact_dict_min")) + .on("slice", "varuint32")(() => ctx.used("__tact_dict_min")) .on("slice", "slice")(() => ctx.used("__tact_dict_min")) .on("int", "cell")(() => "idict_get_min_ref?") .on("uint", "cell")(() => "udict_get_min_ref?") @@ -1330,6 +1384,14 @@ function genTactDictGetMin( return "value~load_uint(vl)"; case "coins": return "value~load_coins()"; + case "varint16": + return "value~load_varint16()"; + case "varint32": + return "value~load_varint32()"; + case "varuint16": + return "value~load_varuint16()"; + case "varuint32": + return "value~load_varuint32()"; case "slice": case "cell": return "value"; @@ -1366,6 +1428,10 @@ function genTactDictGetNext( case "slice": case "cell": case "coins": + case "varint16": + case "varint32": + case "varuint16": + case "varuint32": return ""; case "uint": case "int": @@ -1390,6 +1456,14 @@ function genTactDictGetNext( return "value~load_uint(vl)"; case "coins": return "value~load_coins()"; + case "varint16": + return "value~load_varint16()"; + case "varint32": + return "value~load_varint32()"; + case "varuint16": + return "value~load_varuint16()"; + case "varuint32": + return "value~load_varuint32()"; case "slice": return "value"; case "cell": @@ -1433,6 +1507,10 @@ function genTactDictReplace( case "slice": case "cell": case "coins": + case "varint16": + case "varint32": + case "varuint16": + case "varuint32": return ""; case "uint": case "int": @@ -1454,12 +1532,24 @@ function genTactDictReplace( .on("int", "int")(() => "idict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl))") .on("int", "uint")(() => "idict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl))") .on("int", "coins")(() => "idict_replace_builder?(d, kl, k, begin_cell().store_coins(v))") + .on("int", "varint16")(() => "idict_replace_builder?(d, kl, k, begin_cell().store_varint16(v))") + .on("int", "varint32")(() => "idict_replace_builder?(d, kl, k, begin_cell().store_varint32(v))") + .on("int", "varuint16")(() => "idict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v))") + .on("int", "varuint32")(() => "idict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v))") .on("uint", "int")(() => "udict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl))") .on("uint", "uint")(() => "udict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl))") .on("uint", "coins")(() => "udict_replace_builder?(d, kl, k, begin_cell().store_coins(v))") + .on("uint", "varint16")(() => "udict_replace_builder?(d, kl, k, begin_cell().store_varint16(v))") + .on("uint", "varint32")(() => "udict_replace_builder?(d, kl, k, begin_cell().store_varint32(v))") + .on("uint", "varuint16")(() => "udict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v))") + .on("uint", "varuint32")(() => "udict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v))") .on("slice", "int")(() => "dict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl))") .on("slice", "uint")(() => "dict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl))") .on("slice", "coins")(() => "dict_replace_builder?(d, kl, k, begin_cell().store_coins(v))") + .on("slice", "varint16")(() => "dict_replace_builder?(d, kl, k, begin_cell().store_varint16(v))") + .on("slice", "varint32")(() => "dict_replace_builder?(d, kl, k, begin_cell().store_varint32(v))") + .on("slice", "varuint16")(() => "dict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v))") + .on("slice", "varuint32")(() => "dict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v))") .on("int", "cell")(() => "idict_replace_ref?(d, kl, k, v)") .on("uint", "cell")(() => "udict_replace_ref?(d, kl, k, v)") .on("int", "slice")(() => "idict_replace?(d, kl, k, v)") @@ -1498,6 +1588,10 @@ function genTactDictReplaceGet( case "slice": case "cell": case "coins": + case "varint16": + case "varint32": + case "varuint16": + case "varuint32": return ""; case "uint": case "int": @@ -1520,12 +1614,24 @@ function genTactDictReplaceGet( .on("int", "int")(() => "d~idict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse())") .on("int", "uint")(() => "d~idict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse())") .on("int", "coins")(() => "d~idict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse())") + .on("int", "varint16")(() => "d~idict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse())") + .on("int", "varint32")(() => "d~idict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse())") + .on("int", "varuint16")(() => "d~idict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse())") + .on("int", "varuint32")(() => "d~idict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse())") .on("uint", "int")(() => "d~udict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse())") .on("uint", "uint")(() => "d~udict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse())") .on("uint", "coins")(() => "d~udict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse())") + .on("uint", "varint16")(() => "d~udict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse())") + .on("uint", "varint32")(() => "d~udict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse())") + .on("uint", "varuint16")(() => "d~udict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse())") + .on("uint", "varuint32")(() => "d~udict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse())") .on("slice", "int")(() => "d~dict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse())") .on("slice", "uint")(() => "d~dict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse())") .on("slice", "coins")(() => "d~dict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse())") + .on("slice", "varint16")(() => "d~dict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse())") + .on("slice", "varint32")(() => "d~dict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse())") + .on("slice", "varuint16")(() => "d~dict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse())") + .on("slice", "varuint32")(() => "d~dict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse())") .on("int", "cell")(() => "d~idict_replaceget_ref?(kl, k, v)") .on("uint", "cell")(() => "d~udict_replaceget_ref?(kl, k, v)") .on("int", "slice")(() => "d~idict_replaceget?(kl, k, v)") @@ -1544,6 +1650,14 @@ function genTactDictReplaceGet( return "old~load_int(vl)"; case "coins": return "old~load_coins()"; + case "varint16": + return "old~load_varint16()"; + case "varint32": + return "old~load_varint32()"; + case "varuint16": + return "old~load_varuint16()"; + case "varuint32": + return "old~load_varuint32()"; } }; ctx.fun(`__tact_dict_replaceget_${key}_${value}`, () => { diff --git a/src/imports/stdlib.ts b/src/imports/stdlib.ts index f38b5ce7c..27563ec77 100644 --- a/src/imports/stdlib.ts +++ b/src/imports/stdlib.ts @@ -133,64 +133,67 @@ files['std/cells.tact'] = 'PSBiLnN0b3JlQml0KHRydWUpOyAgLy8gd3JpdGVzIDEKLy8vICAgICBsZXQgYnV6ejogQnVpbGRlciA9IGIuc3RvcmVCaXQoZmFsc2UpOyAvLyB3cml0ZXMgMAovLy8g' + 'fQovLy8gYGBgCi8vLwovLy8gU2VlOiBodHRwczovL2RvY3MudGFjdC1sYW5nLm9yZy9yZWYvY29yZS1jZWxscyNidWlsZGVyc3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bSBjNwpjZWxsIG15X2NvZGUoKSBhc20gIk1ZQ09ERSI7Cg=='; files['stdlib.tact'] = 'aW1wb3J0ICIuL3N0ZC9wcmltaXRpdmVzIjsKaW1wb3J0ICIuL3N0ZC9jZWxscyI7CmltcG9ydCAiLi9zdGQvY3J5cHRvIjsKaW1wb3J0ICIuL3N0ZC90ZXh0IjsKaW1w' + 'b3J0ICIuL3N0ZC9tYXRoIjsKaW1wb3J0ICIuL3N0ZC9jb250cmFjdCI7CmltcG9ydCAiLi9zdGQvZGVidWciOwppbXBvcnQgIi4vc3RkL2NvbnRleHQiOwppbXBvcnQg' + diff --git a/src/storage/allocator.ts b/src/storage/allocator.ts index 27ab63d54..d12374389 100644 --- a/src/storage/allocator.ts +++ b/src/storage/allocator.ts @@ -18,9 +18,14 @@ function getOperationSize(src: AllocationOperationType): { case "uint": { return { bits: src.bits + (src.optional ? 1 : 0), refs: 0 }; } - case "coins": { + case "varint16": + case "varuint16": { return { bits: 124 + (src.optional ? 1 : 0), refs: 0 }; } + case "varint32": + case "varuint32": { + return { bits: 253 + (src.optional ? 1 : 0), refs: 0 }; + } case "boolean": { return { bits: 1 + (src.optional ? 1 : 0), refs: 0 }; } @@ -86,6 +91,12 @@ export function getAllocationOperationFromField( optional: src.optional ? src.optional : false, }; } + if (src.format === "varint16" || src.format === "varint32") { + return { + kind: src.format, + optional: src.optional ? src.optional : false, + }; + } if (src.format !== null && src.format !== undefined) { throwInternalCompilerError( `Unsupported int format: ${src.format}`, @@ -112,7 +123,13 @@ export function getAllocationOperationFromField( } if (src.format === "coins") { return { - kind: "coins", + kind: "varuint16", + optional: src.optional ? src.optional : false, + }; + } + if (src.format === "varuint16" || src.format === "varuint32") { + return { + kind: src.format, optional: src.optional ? src.optional : false, }; } diff --git a/src/storage/operation.ts b/src/storage/operation.ts index 7b18fb466..95849dfdc 100644 --- a/src/storage/operation.ts +++ b/src/storage/operation.ts @@ -23,7 +23,7 @@ export type AllocationOperationType = optional: boolean; } | { - kind: "coins"; + kind: "varint16" | "varint32" | "varuint16" | "varuint32"; optional: boolean; } | { diff --git a/src/test/e2e-emulated/contracts/map-traverse.tact b/src/test/e2e-emulated/contracts/map-traverse.tact index d0ddefd86..270a25e25 100644 --- a/src/test/e2e-emulated/contracts/map-traverse.tact +++ b/src/test/e2e-emulated/contracts/map-traverse.tact @@ -41,6 +41,40 @@ contract MapTraverseTestContract { return sum1 + sum2; } + get fun test_int_coins(): Int { + let m: map = emptyMap(); + m.set(1, 100); + m.set(2, 200); + m.set(3, 300); + m.set(4, 400); + + let sum1: Int = 0; + let sum2: Int = 0; + foreach (k, v in m) { + sum1 += k; + sum2 += v; + } + + return sum1 + sum2; + } + + get fun test_int_varint16(): Int { + let m: map = emptyMap(); + m.set(1, 100); + m.set(2, 200); + m.set(3, 300); + m.set(4, 400); + + let sum1: Int = 0; + let sum2: Int = 0; + foreach (k, v in m) { + sum1 += k; + sum2 += v; + } + + return sum1 + sum2; + } + get fun test_int_bool(): Int { let m: map = emptyMap(); m.set(1, true); @@ -143,6 +177,44 @@ contract MapTraverseTestContract { return sum1 + sum2; } + get fun test_address_coins(): Int { + let m: map = emptyMap(); + m.set(newAddress(0, 0x4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76873), 100); + m.set(newAddress(0, 0x4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76874), 200); + m.set(newAddress(0, 0x4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76875), 300); + m.set(newAddress(0, 0x4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76876), 400); + + let sum1: Int = 0; + let sum2: Int = 0; + foreach (k, v in m) { + let s: Slice = beginCell().storeAddress(k).endCell().beginParse(); + s.skipBits(264); + sum1 += s.loadUint(3); + sum2 += v; + } + + return sum1 + sum2; + } + + get fun test_address_varint16(): Int { + let m: map = emptyMap(); + m.set(newAddress(0, 0x4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76873), 100); + m.set(newAddress(0, 0x4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76874), 200); + m.set(newAddress(0, 0x4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76875), 300); + m.set(newAddress(0, 0x4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76876), 400); + + let sum1: Int = 0; + let sum2: Int = 0; + foreach (k, v in m) { + let s: Slice = beginCell().storeAddress(k).endCell().beginParse(); + s.skipBits(264); + sum1 += s.loadUint(3); + sum2 += v; + } + + return sum1 + sum2; + } + get fun test_address_bool(): Int { let m: map = emptyMap(); m.set(newAddress(0, 0x4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76873), true); diff --git a/src/test/e2e-emulated/contracts/maps1.tact b/src/test/e2e-emulated/contracts/maps1.tact new file mode 100644 index 000000000..69b2b3aee --- /dev/null +++ b/src/test/e2e-emulated/contracts/maps1.tact @@ -0,0 +1,1516 @@ +// struct with over 1023 bits so that it is serialized as multiple cells +struct SomeStruct { + int: Int; + bool: Bool; + address: Address; + a: Int; + b: Int; +} + +// =============================== +// Structs For Getters +// =============================== + +struct GetAllMapsResult { + // Integer Key Maps + int_varint16: Int?; + int_varint32: Int?; + int_varuint16: Int?; + int_varuint32: Int?; + int_bool: Bool?; + int_cell: Cell?; + int_address: Address?; + int_struct: SomeStruct?; + + int8_varint16: Int?; + int8_varint32: Int?; + int8_varuint16: Int?; + int8_varuint32: Int?; + int8_bool: Bool?; + int8_cell: Cell?; + int8_address: Address?; + int8_struct: SomeStruct?; + + int42_varint16: Int?; + int42_varint32: Int?; + int42_varuint16: Int?; + int42_varuint32: Int?; + int42_bool: Bool?; + int42_cell: Cell?; + int42_address: Address?; + int42_struct: SomeStruct?; + + int256_varint16: Int?; + int256_varint32: Int?; + int256_varuint16: Int?; + int256_varuint32: Int?; + int256_bool: Bool?; + int256_cell: Cell?; + int256_address: Address?; + int256_struct: SomeStruct?; + + uint8_varint16: Int?; + uint8_varint32: Int?; + uint8_varuint16: Int?; + uint8_varuint32: Int?; + uint8_bool: Bool?; + uint8_cell: Cell?; + uint8_address: Address?; + uint8_struct: SomeStruct?; + + uint42_varint16: Int?; + uint42_varint32: Int?; + uint42_varuint16: Int?; + uint42_varuint32: Int?; + uint42_bool: Bool?; + uint42_cell: Cell?; + uint42_address: Address?; + uint42_struct: SomeStruct?; + + uint256_varint16: Int?; + uint256_varint32: Int?; + uint256_varuint16: Int?; + uint256_varuint32: Int?; + uint256_bool: Bool?; + uint256_cell: Cell?; + uint256_address: Address?; + uint256_struct: SomeStruct?; + + // Address Key Maps + address_varint16: Int?; + address_varint32: Int?; + address_varuint16: Int?; + address_varuint32: Int?; + address_bool: Bool?; + address_cell: Cell?; + address_address: Address?; + address_struct: SomeStruct?; +} + +struct ReplaceAllMapsResult { + // Integer Key Maps + int_varint16: Bool; + int_varint32: Bool; + int_varuint16: Bool; + int_varuint32: Bool; + int_bool: Bool; + int_cell: Bool; + int_address: Bool; + int_struct: Bool; + + int8_varint16: Bool; + int8_varint32: Bool; + int8_varuint16: Bool; + int8_varuint32: Bool; + int8_bool: Bool; + int8_cell: Bool; + int8_address: Bool; + int8_struct: Bool; + + int42_varint16: Bool; + int42_varint32: Bool; + int42_varuint16: Bool; + int42_varuint32: Bool; + int42_bool: Bool; + int42_cell: Bool; + int42_address: Bool; + int42_struct: Bool; + + int256_varint16: Bool; + int256_varint32: Bool; + int256_varuint16: Bool; + int256_varuint32: Bool; + int256_bool: Bool; + int256_cell: Bool; + int256_address: Bool; + int256_struct: Bool; + + uint8_varint16: Bool; + uint8_varint32: Bool; + uint8_varuint16: Bool; + uint8_varuint32: Bool; + uint8_bool: Bool; + uint8_cell: Bool; + uint8_address: Bool; + uint8_struct: Bool; + + uint42_varint16: Bool; + uint42_varint32: Bool; + uint42_varuint16: Bool; + uint42_varuint32: Bool; + uint42_bool: Bool; + uint42_cell: Bool; + uint42_address: Bool; + uint42_struct: Bool; + + uint256_varint16: Bool; + uint256_varint32: Bool; + uint256_varuint16: Bool; + uint256_varuint32: Bool; + uint256_bool: Bool; + uint256_cell: Bool; + uint256_address: Bool; + uint256_struct: Bool; + + // Address Key Maps + address_varint16: Bool; + address_varint32: Bool; + address_varuint16: Bool; + address_varuint32: Bool; + address_bool: Bool; + address_cell: Bool; + address_address: Bool; + address_struct: Bool; +} + +struct ReplaceGetAllMapsResult { + // Integer Key Maps + int_varint16: Int?; + int_varint32: Int?; + int_varuint16: Int?; + int_varuint32: Int?; + int_bool: Bool?; + int_cell: Cell?; + int_address: Address?; + int_struct: SomeStruct?; + + int8_varint16: Int?; + int8_varint32: Int?; + int8_varuint16: Int?; + int8_varuint32: Int?; + int8_bool: Bool?; + int8_cell: Cell?; + int8_address: Address?; + int8_struct: SomeStruct?; + + int42_varint16: Int?; + int42_varint32: Int?; + int42_varuint16: Int?; + int42_varuint32: Int?; + int42_bool: Bool?; + int42_cell: Cell?; + int42_address: Address?; + int42_struct: SomeStruct?; + + int256_varint16: Int?; + int256_varint32: Int?; + int256_varuint16: Int?; + int256_varuint32: Int?; + int256_bool: Bool?; + int256_cell: Cell?; + int256_address: Address?; + int256_struct: SomeStruct?; + + uint8_varint16: Int?; + uint8_varint32: Int?; + uint8_varuint16: Int?; + uint8_varuint32: Int?; + uint8_bool: Bool?; + uint8_cell: Cell?; + uint8_address: Address?; + uint8_struct: SomeStruct?; + + uint42_varint16: Int?; + uint42_varint32: Int?; + uint42_varuint16: Int?; + uint42_varuint32: Int?; + uint42_bool: Bool?; + uint42_cell: Cell?; + uint42_address: Address?; + uint42_struct: SomeStruct?; + + uint256_varint16: Int?; + uint256_varint32: Int?; + uint256_varuint16: Int?; + uint256_varuint32: Int?; + uint256_bool: Bool?; + uint256_cell: Cell?; + uint256_address: Address?; + uint256_struct: SomeStruct?; + + // Address Key Maps + address_varint16: Int?; + address_varint32: Int?; + address_varuint16: Int?; + address_varuint32: Int?; + address_bool: Bool?; + address_cell: Cell?; + address_address: Address?; + address_struct: SomeStruct?; +} + +struct ExistsAllMapsResult { + // Integer Key Maps + int_varint16: Bool; + int_varint32: Bool; + int_varuint16: Bool; + int_varuint32: Bool; + int_bool: Bool; + int_cell: Bool; + int_address: Bool; + int_struct: Bool; + + int8_varint16: Bool; + int8_varint32: Bool; + int8_varuint16: Bool; + int8_varuint32: Bool; + int8_bool: Bool; + int8_cell: Bool; + int8_address: Bool; + int8_struct: Bool; + + int42_varint16: Bool; + int42_varint32: Bool; + int42_varuint16: Bool; + int42_varuint32: Bool; + int42_bool: Bool; + int42_cell: Bool; + int42_address: Bool; + int42_struct: Bool; + + int256_varint16: Bool; + int256_varint32: Bool; + int256_varuint16: Bool; + int256_varuint32: Bool; + int256_bool: Bool; + int256_cell: Bool; + int256_address: Bool; + int256_struct: Bool; + + uint8_varint16: Bool; + uint8_varint32: Bool; + uint8_varuint16: Bool; + uint8_varuint32: Bool; + uint8_bool: Bool; + uint8_cell: Bool; + uint8_address: Bool; + uint8_struct: Bool; + + uint42_varint16: Bool; + uint42_varint32: Bool; + uint42_varuint16: Bool; + uint42_varuint32: Bool; + uint42_bool: Bool; + uint42_cell: Bool; + uint42_address: Bool; + uint42_struct: Bool; + + uint256_varint16: Bool; + uint256_varint32: Bool; + uint256_varuint16: Bool; + uint256_varuint32: Bool; + uint256_bool: Bool; + uint256_cell: Bool; + uint256_address: Bool; + uint256_struct: Bool; + + // Address Key Maps + address_varint16: Bool; + address_varint32: Bool; + address_varuint16: Bool; + address_varuint32: Bool; + address_bool: Bool; + address_cell: Bool; + address_address: Bool; + address_struct: Bool; +} + +struct IsEmptyAllMapsResult { + // Integer Key Maps + int_varint16: Bool; + int_varint32: Bool; + int_varuint16: Bool; + int_varuint32: Bool; + int_bool: Bool; + int_cell: Bool; + int_address: Bool; + int_struct: Bool; + + int8_varint16: Bool; + int8_varint32: Bool; + int8_varuint16: Bool; + int8_varuint32: Bool; + int8_bool: Bool; + int8_cell: Bool; + int8_address: Bool; + int8_struct: Bool; + + int42_varint16: Bool; + int42_varint32: Bool; + int42_varuint16: Bool; + int42_varuint32: Bool; + int42_bool: Bool; + int42_cell: Bool; + int42_address: Bool; + int42_struct: Bool; + + int256_varint16: Bool; + int256_varint32: Bool; + int256_varuint16: Bool; + int256_varuint32: Bool; + int256_bool: Bool; + int256_cell: Bool; + int256_address: Bool; + int256_struct: Bool; + + uint8_varint16: Bool; + uint8_varint32: Bool; + uint8_varuint16: Bool; + uint8_varuint32: Bool; + uint8_bool: Bool; + uint8_cell: Bool; + uint8_address: Bool; + uint8_struct: Bool; + + uint42_varint16: Bool; + uint42_varint32: Bool; + uint42_varuint16: Bool; + uint42_varuint32: Bool; + uint42_bool: Bool; + uint42_cell: Bool; + uint42_address: Bool; + uint42_struct: Bool; + + uint256_varint16: Bool; + uint256_varint32: Bool; + uint256_varuint16: Bool; + uint256_varuint32: Bool; + uint256_bool: Bool; + uint256_cell: Bool; + uint256_address: Bool; + uint256_struct: Bool; + + // Address Key Maps + address_varint16: Bool; + address_varint32: Bool; + address_varuint16: Bool; + address_varuint32: Bool; + address_bool: Bool; + address_cell: Bool; + address_address: Bool; + address_struct: Bool; +} + +struct AsCellAllMapsResult { + // Integer Key Maps + int_varint16: Cell?; + int_varint32: Cell?; + int_varuint16: Cell?; + int_varuint32: Cell?; + int_bool: Cell?; + int_cell: Cell?; + int_address: Cell?; + int_struct: Cell?; + + int8_varint16: Cell?; + int8_varint32: Cell?; + int8_varuint16: Cell?; + int8_varuint32: Cell?; + int8_bool: Cell?; + int8_cell: Cell?; + int8_address: Cell?; + int8_struct: Cell?; + + int42_varint16: Cell?; + int42_varint32: Cell?; + int42_varuint16: Cell?; + int42_varuint32: Cell?; + int42_bool: Cell?; + int42_cell: Cell?; + int42_address: Cell?; + int42_struct: Cell?; + + int256_varint16: Cell?; + int256_varint32: Cell?; + int256_varuint16: Cell?; + int256_varuint32: Cell?; + int256_bool: Cell?; + int256_cell: Cell?; + int256_address: Cell?; + int256_struct: Cell?; + + uint8_varint16: Cell?; + uint8_varint32: Cell?; + uint8_varuint16: Cell?; + uint8_varuint32: Cell?; + uint8_bool: Cell?; + uint8_cell: Cell?; + uint8_address: Cell?; + uint8_struct: Cell?; + + uint42_varint16: Cell?; + uint42_varint32: Cell?; + uint42_varuint16: Cell?; + uint42_varuint32: Cell?; + uint42_bool: Cell?; + uint42_cell: Cell?; + uint42_address: Cell?; + uint42_struct: Cell?; + + uint256_varint16: Cell?; + uint256_varint32: Cell?; + uint256_varuint16: Cell?; + uint256_varuint32: Cell?; + uint256_bool: Cell?; + uint256_cell: Cell?; + uint256_address: Cell?; + uint256_struct: Cell?; + + // Address Key Maps + address_varint16: Cell?; + address_varint32: Cell?; + address_varuint16: Cell?; + address_varuint32: Cell?; + address_bool: Cell?; + address_cell: Cell?; + address_address: Cell?; + address_struct: Cell?; +} + +// =============================== +// Messages For Operations +// =============================== + +message SetAllMaps { + // Key fields + keyInt: Int; + keyInt8: Int; + keyInt42: Int; + keyInt256: Int; + keyUint8: Int; + keyUint42: Int; + keyUint256: Int; + keyAddress: Address; + + // Value fields + valueVarint16: Int?; + valueVarint32: Int?; + valueVaruint16: Int?; + valueVaruint32: Int?; + valueBool: Bool?; + valueCell: Cell?; + valueAddress: Address?; + valueStruct: SomeStruct?; +} + +message DelAllMaps { + // Key fields + keyInt: Int; + keyInt8: Int; + keyInt42: Int; + keyInt256: Int; + keyUint8: Int; + keyUint42: Int; + keyUint256: Int; + keyAddress: Address; +} + +message ReplaceAllMaps { + // Key fields + keyInt: Int; + keyInt8: Int; + keyInt42: Int; + keyInt256: Int; + keyUint8: Int; + keyUint42: Int; + keyUint256: Int; + keyAddress: Address; + + // Value fields + valueVarint16: Int?; + valueVarint32: Int?; + valueVaruint16: Int?; + valueVaruint32: Int?; + valueBool: Bool?; + valueCell: Cell?; + valueAddress: Address?; + valueStruct: SomeStruct?; +} + +message ReplaceGetAllMaps { + // Key fields + keyInt: Int; + keyInt8: Int; + keyInt42: Int; + keyInt256: Int; + keyUint8: Int; + keyUint42: Int; + keyUint256: Int; + keyAddress: Address; + + // Value fields + valueVarint16: Int?; + valueVarint32: Int?; + valueVaruint16: Int?; + valueVaruint32: Int?; + valueBool: Bool?; + valueCell: Cell?; + valueAddress: Address?; + valueStruct: SomeStruct?; +} + +message CheckNullReference { + +} + +// =============================== +// Test Contract +// =============================== + +contract MapTestContract { + receive() {} + + // =============================== + // Integer (`Int`) Key Maps + // =============================== + + int_varint16: map; + int_varint32: map; + int_varuint16: map; + int_varuint32: map; + int_bool: map; + int_cell: map; + int_address: map; + int_struct: map; + + // =============================== + // Integer (`Int as int8`) Key Maps + // =============================== + + int8_varint16: map; + int8_varint32: map; + int8_varuint16: map; + int8_varuint32: map; + int8_bool: map; + int8_cell: map; + int8_address: map; + int8_struct: map; + + // =============================== + // Integer (`Int as int42`) Key Maps + // =============================== + + int42_varint16: map; + int42_varint32: map; + int42_varuint16: map; + int42_varuint32: map; + int42_bool: map; + int42_cell: map; + int42_address: map; + int42_struct: map; + + // =============================== + // Integer (`Int as int256`) Key Maps + // =============================== + + int256_varint16: map; + int256_varint32: map; + int256_varuint16: map; + int256_varuint32: map; + int256_bool: map; + int256_cell: map; + int256_address: map; + int256_struct: map; + + // =============================== + // Unsigned Integer (`Int as uint8`) Key Maps + // =============================== + + uint8_varint16: map; + uint8_varint32: map; + uint8_varuint16: map; + uint8_varuint32: map; + uint8_bool: map; + uint8_cell: map; + uint8_address: map; + uint8_struct: map; + + // =============================== + // Unsigned Integer (`Int as uint42`) Key Maps + // =============================== + + uint42_varint16: map; + uint42_varint32: map; + uint42_varuint16: map; + uint42_varuint32: map; + uint42_bool: map; + uint42_cell: map; + uint42_address: map; + uint42_struct: map; + + // =============================== + // Unsigned Integer (`Int as uint256`) Key Maps + // =============================== + + uint256_varint16: map; + uint256_varint32: map; + uint256_varuint16: map; + uint256_varuint32: map; + uint256_bool: map; + uint256_cell: map; + uint256_address: map; + uint256_struct: map; + + // =============================== + // Address Key Maps + // =============================== + + address_varint16: map; + address_varint32: map; + address_varuint16: map; + address_varuint32: map; + address_bool: map; + address_cell: map; + address_address: map; + address_struct: map; + + // =============================== + // Receivers For Operations + // =============================== + + receive(msg: SetAllMaps) { + // Integer Key Maps + self.int_varint16.set(msg.keyInt, msg.valueVarint16); + self.int_varint32.set(msg.keyInt, msg.valueVarint32); + self.int_varuint16.set(msg.keyInt, msg.valueVaruint16); + self.int_varuint32.set(msg.keyInt, msg.valueVaruint32); + self.int_bool.set(msg.keyInt, msg.valueBool); + self.int_cell.set(msg.keyInt, msg.valueCell); + self.int_address.set(msg.keyInt, msg.valueAddress); + self.int_struct.set(msg.keyInt, msg.valueStruct); + + self.int8_varint16.set(msg.keyInt8, msg.valueVarint16); + self.int8_varint32.set(msg.keyInt8, msg.valueVarint32); + self.int8_varuint16.set(msg.keyInt8, msg.valueVaruint16); + self.int8_varuint32.set(msg.keyInt8, msg.valueVaruint32); + self.int8_bool.set(msg.keyInt8, msg.valueBool); + self.int8_cell.set(msg.keyInt8, msg.valueCell); + self.int8_address.set(msg.keyInt8, msg.valueAddress); + self.int8_struct.set(msg.keyInt8, msg.valueStruct); + + self.int42_varint16.set(msg.keyInt42, msg.valueVarint16); + self.int42_varint32.set(msg.keyInt42, msg.valueVarint32); + self.int42_varuint16.set(msg.keyInt42, msg.valueVaruint16); + self.int42_varuint32.set(msg.keyInt42, msg.valueVaruint32); + self.int42_bool.set(msg.keyInt42, msg.valueBool); + self.int42_cell.set(msg.keyInt42, msg.valueCell); + self.int42_address.set(msg.keyInt42, msg.valueAddress); + self.int42_struct.set(msg.keyInt42, msg.valueStruct); + + self.int256_varint16.set(msg.keyInt256, msg.valueVarint16); + self.int256_varint32.set(msg.keyInt256, msg.valueVarint32); + self.int256_varuint16.set(msg.keyInt256, msg.valueVaruint16); + self.int256_varuint32.set(msg.keyInt256, msg.valueVaruint32); + self.int256_bool.set(msg.keyInt256, msg.valueBool); + self.int256_cell.set(msg.keyInt256, msg.valueCell); + self.int256_address.set(msg.keyInt256, msg.valueAddress); + self.int256_struct.set(msg.keyInt256, msg.valueStruct); + + self.uint8_varint16.set(msg.keyUint8, msg.valueVarint16); + self.uint8_varint32.set(msg.keyUint8, msg.valueVarint32); + self.uint8_varuint16.set(msg.keyUint8, msg.valueVaruint16); + self.uint8_varuint32.set(msg.keyUint8, msg.valueVaruint32); + self.uint8_bool.set(msg.keyUint8, msg.valueBool); + self.uint8_cell.set(msg.keyUint8, msg.valueCell); + self.uint8_address.set(msg.keyUint8, msg.valueAddress); + self.uint8_struct.set(msg.keyUint8, msg.valueStruct); + + self.uint42_varint16.set(msg.keyUint42, msg.valueVarint16); + self.uint42_varint32.set(msg.keyUint42, msg.valueVarint32); + self.uint42_varuint16.set(msg.keyUint42, msg.valueVaruint16); + self.uint42_varuint32.set(msg.keyUint42, msg.valueVaruint32); + self.uint42_bool.set(msg.keyUint42, msg.valueBool); + self.uint42_cell.set(msg.keyUint42, msg.valueCell); + self.uint42_address.set(msg.keyUint42, msg.valueAddress); + self.uint42_struct.set(msg.keyUint42, msg.valueStruct); + + self.uint256_varint16.set(msg.keyUint256, msg.valueVarint16); + self.uint256_varint32.set(msg.keyUint256, msg.valueVarint32); + self.uint256_varuint16.set(msg.keyUint256, msg.valueVaruint16); + self.uint256_varuint32.set(msg.keyUint256, msg.valueVaruint32); + self.uint256_bool.set(msg.keyUint256, msg.valueBool); + self.uint256_cell.set(msg.keyUint256, msg.valueCell); + self.uint256_address.set(msg.keyUint256, msg.valueAddress); + self.uint256_struct.set(msg.keyUint256, msg.valueStruct); + + // Address Key Maps + self.address_varint16.set(msg.keyAddress, msg.valueVarint16); + self.address_varint32.set(msg.keyAddress, msg.valueVarint32); + self.address_varuint16.set(msg.keyAddress, msg.valueVaruint16); + self.address_varuint32.set(msg.keyAddress, msg.valueVaruint32); + self.address_bool.set(msg.keyAddress, msg.valueBool); + self.address_cell.set(msg.keyAddress, msg.valueCell); + self.address_address.set(msg.keyAddress, msg.valueAddress); + self.address_struct.set(msg.keyAddress, msg.valueStruct); + } + + receive(msg: DelAllMaps) { + // Integer Key Maps + self.int_varint16.del(msg.keyInt); + self.int_varint32.del(msg.keyInt); + self.int_varuint16.del(msg.keyInt); + self.int_varuint32.del(msg.keyInt); + self.int_bool.del(msg.keyInt); + self.int_cell.del(msg.keyInt); + self.int_address.del(msg.keyInt); + self.int_struct.del(msg.keyInt); + + self.int8_varint16.del(msg.keyInt8); + self.int8_varint32.del(msg.keyInt8); + self.int8_varuint16.del(msg.keyInt8); + self.int8_varuint32.del(msg.keyInt8); + self.int8_bool.del(msg.keyInt8); + self.int8_cell.del(msg.keyInt8); + self.int8_address.del(msg.keyInt8); + self.int8_struct.del(msg.keyInt8); + + self.int42_varint16.del(msg.keyInt42); + self.int42_varint32.del(msg.keyInt42); + self.int42_varuint16.del(msg.keyInt42); + self.int42_varuint32.del(msg.keyInt42); + self.int42_bool.del(msg.keyInt42); + self.int42_cell.del(msg.keyInt42); + self.int42_address.del(msg.keyInt42); + self.int42_struct.del(msg.keyInt42); + + self.int256_varint16.del(msg.keyInt256); + self.int256_varint32.del(msg.keyInt256); + self.int256_varuint16.del(msg.keyInt256); + self.int256_varuint32.del(msg.keyInt256); + self.int256_bool.del(msg.keyInt256); + self.int256_cell.del(msg.keyInt256); + self.int256_address.del(msg.keyInt256); + self.int256_struct.del(msg.keyInt256); + + self.uint8_varint16.del(msg.keyUint8); + self.uint8_varint32.del(msg.keyUint8); + self.uint8_varuint16.del(msg.keyUint8); + self.uint8_varuint32.del(msg.keyUint8); + self.uint8_bool.del(msg.keyUint8); + self.uint8_cell.del(msg.keyUint8); + self.uint8_address.del(msg.keyUint8); + self.uint8_struct.del(msg.keyUint8); + + self.uint42_varint16.del(msg.keyUint42); + self.uint42_varint32.del(msg.keyUint42); + self.uint42_varuint16.del(msg.keyUint42); + self.uint42_varuint32.del(msg.keyUint42); + self.uint42_bool.del(msg.keyUint42); + self.uint42_cell.del(msg.keyUint42); + self.uint42_address.del(msg.keyUint42); + self.uint42_struct.del(msg.keyUint42); + + self.uint256_varint16.del(msg.keyUint256); + self.uint256_varint32.del(msg.keyUint256); + self.uint256_varuint16.del(msg.keyUint256); + self.uint256_varuint32.del(msg.keyUint256); + self.uint256_bool.del(msg.keyUint256); + self.uint256_cell.del(msg.keyUint256); + self.uint256_address.del(msg.keyUint256); + self.uint256_struct.del(msg.keyUint256); + + // Address Key Maps + self.address_varint16.del(msg.keyAddress); + self.address_varint32.del(msg.keyAddress); + self.address_varuint16.del(msg.keyAddress); + self.address_varuint32.del(msg.keyAddress); + self.address_bool.del(msg.keyAddress); + self.address_cell.del(msg.keyAddress); + self.address_address.del(msg.keyAddress); + self.address_struct.del(msg.keyAddress); + } + + receive(msg: ReplaceAllMaps) { + // Replace operations analogous to coins, now including varint16, varint32, varuint16, varuint32 + self.int_varint16.replace(msg.keyInt, msg.valueVarint16); + self.int_varint32.replace(msg.keyInt, msg.valueVarint32); + self.int_varuint16.replace(msg.keyInt, msg.valueVaruint16); + self.int_varuint32.replace(msg.keyInt, msg.valueVaruint32); + self.int_bool.replace(msg.keyInt, msg.valueBool); + self.int_cell.replace(msg.keyInt, msg.valueCell); + self.int_address.replace(msg.keyInt, msg.valueAddress); + self.int_struct.replace(msg.keyInt, msg.valueStruct); + + self.int8_varint16.replace(msg.keyInt8, msg.valueVarint16); + self.int8_varint32.replace(msg.keyInt8, msg.valueVarint32); + self.int8_varuint16.replace(msg.keyInt8, msg.valueVaruint16); + self.int8_varuint32.replace(msg.keyInt8, msg.valueVaruint32); + self.int8_bool.replace(msg.keyInt8, msg.valueBool); + self.int8_cell.replace(msg.keyInt8, msg.valueCell); + self.int8_address.replace(msg.keyInt8, msg.valueAddress); + self.int8_struct.replace(msg.keyInt8, msg.valueStruct); + + self.int42_varint16.replace(msg.keyInt42, msg.valueVarint16); + self.int42_varint32.replace(msg.keyInt42, msg.valueVarint32); + self.int42_varuint16.replace(msg.keyInt42, msg.valueVaruint16); + self.int42_varuint32.replace(msg.keyInt42, msg.valueVaruint32); + self.int42_bool.replace(msg.keyInt42, msg.valueBool); + self.int42_cell.replace(msg.keyInt42, msg.valueCell); + self.int42_address.replace(msg.keyInt42, msg.valueAddress); + self.int42_struct.replace(msg.keyInt42, msg.valueStruct); + + self.int256_varint16.replace(msg.keyInt256, msg.valueVarint16); + self.int256_varint32.replace(msg.keyInt256, msg.valueVarint32); + self.int256_varuint16.replace(msg.keyInt256, msg.valueVaruint16); + self.int256_varuint32.replace(msg.keyInt256, msg.valueVaruint32); + self.int256_bool.replace(msg.keyInt256, msg.valueBool); + self.int256_cell.replace(msg.keyInt256, msg.valueCell); + self.int256_address.replace(msg.keyInt256, msg.valueAddress); + self.int256_struct.replace(msg.keyInt256, msg.valueStruct); + + self.uint8_varint16.replace(msg.keyUint8, msg.valueVarint16); + self.uint8_varint32.replace(msg.keyUint8, msg.valueVarint32); + self.uint8_varuint16.replace(msg.keyUint8, msg.valueVaruint16); + self.uint8_varuint32.replace(msg.keyUint8, msg.valueVaruint32); + self.uint8_bool.replace(msg.keyUint8, msg.valueBool); + self.uint8_cell.replace(msg.keyUint8, msg.valueCell); + self.uint8_address.replace(msg.keyUint8, msg.valueAddress); + self.uint8_struct.replace(msg.keyUint8, msg.valueStruct); + + self.uint42_varint16.replace(msg.keyUint42, msg.valueVarint16); + self.uint42_varint32.replace(msg.keyUint42, msg.valueVarint32); + self.uint42_varuint16.replace(msg.keyUint42, msg.valueVaruint16); + self.uint42_varuint32.replace(msg.keyUint42, msg.valueVaruint32); + self.uint42_bool.replace(msg.keyUint42, msg.valueBool); + self.uint42_cell.replace(msg.keyUint42, msg.valueCell); + self.uint42_address.replace(msg.keyUint42, msg.valueAddress); + self.uint42_struct.replace(msg.keyUint42, msg.valueStruct); + + self.uint256_varint16.replace(msg.keyUint256, msg.valueVarint16); + self.uint256_varint32.replace(msg.keyUint256, msg.valueVarint32); + self.uint256_varuint16.replace(msg.keyUint256, msg.valueVaruint16); + self.uint256_varuint32.replace(msg.keyUint256, msg.valueVaruint32); + self.uint256_bool.replace(msg.keyUint256, msg.valueBool); + self.uint256_cell.replace(msg.keyUint256, msg.valueCell); + self.uint256_address.replace(msg.keyUint256, msg.valueAddress); + self.uint256_struct.replace(msg.keyUint256, msg.valueStruct); + + // Address Key Maps + self.address_varint16.replace(msg.keyAddress, msg.valueVarint16); + self.address_varint32.replace(msg.keyAddress, msg.valueVarint32); + self.address_varuint16.replace(msg.keyAddress, msg.valueVaruint16); + self.address_varuint32.replace(msg.keyAddress, msg.valueVaruint32); + self.address_bool.replace(msg.keyAddress, msg.valueBool); + self.address_cell.replace(msg.keyAddress, msg.valueCell); + self.address_address.replace(msg.keyAddress, msg.valueAddress); + self.address_struct.replace(msg.keyAddress, msg.valueStruct); + } + + receive(msg: ReplaceGetAllMaps) { + // Similar to above, but calling replaceGet + self.int_varint16.replaceGet(msg.keyInt, msg.valueVarint16); + self.int_varint32.replaceGet(msg.keyInt, msg.valueVarint32); + self.int_varuint16.replaceGet(msg.keyInt, msg.valueVaruint16); + self.int_varuint32.replaceGet(msg.keyInt, msg.valueVaruint32); + self.int_bool.replaceGet(msg.keyInt, msg.valueBool); + self.int_cell.replaceGet(msg.keyInt, msg.valueCell); + self.int_address.replaceGet(msg.keyInt, msg.valueAddress); + self.int_struct.replaceGet(msg.keyInt, msg.valueStruct); + + self.int8_varint16.replaceGet(msg.keyInt8, msg.valueVarint16); + self.int8_varint32.replaceGet(msg.keyInt8, msg.valueVarint32); + self.int8_varuint16.replaceGet(msg.keyInt8, msg.valueVaruint16); + self.int8_varuint32.replaceGet(msg.keyInt8, msg.valueVaruint32); + self.int8_bool.replaceGet(msg.keyInt8, msg.valueBool); + self.int8_cell.replaceGet(msg.keyInt8, msg.valueCell); + self.int8_address.replaceGet(msg.keyInt8, msg.valueAddress); + self.int8_struct.replaceGet(msg.keyInt8, msg.valueStruct); + + self.int42_varint16.replaceGet(msg.keyInt42, msg.valueVarint16); + self.int42_varint32.replaceGet(msg.keyInt42, msg.valueVarint32); + self.int42_varuint16.replaceGet(msg.keyInt42, msg.valueVaruint16); + self.int42_varuint32.replaceGet(msg.keyInt42, msg.valueVaruint32); + self.int42_bool.replaceGet(msg.keyInt42, msg.valueBool); + self.int42_cell.replaceGet(msg.keyInt42, msg.valueCell); + self.int42_address.replaceGet(msg.keyInt42, msg.valueAddress); + self.int42_struct.replaceGet(msg.keyInt42, msg.valueStruct); + + self.int256_varint16.replaceGet(msg.keyInt256, msg.valueVarint16); + self.int256_varint32.replaceGet(msg.keyInt256, msg.valueVarint32); + self.int256_varuint16.replaceGet(msg.keyInt256, msg.valueVaruint16); + self.int256_varuint32.replaceGet(msg.keyInt256, msg.valueVaruint32); + self.int256_bool.replaceGet(msg.keyInt256, msg.valueBool); + self.int256_cell.replaceGet(msg.keyInt256, msg.valueCell); + self.int256_address.replaceGet(msg.keyInt256, msg.valueAddress); + self.int256_struct.replaceGet(msg.keyInt256, msg.valueStruct); + + self.uint8_varint16.replaceGet(msg.keyUint8, msg.valueVarint16); + self.uint8_varint32.replaceGet(msg.keyUint8, msg.valueVarint32); + self.uint8_varuint16.replaceGet(msg.keyUint8, msg.valueVaruint16); + self.uint8_varuint32.replaceGet(msg.keyUint8, msg.valueVaruint32); + self.uint8_bool.replaceGet(msg.keyUint8, msg.valueBool); + self.uint8_cell.replaceGet(msg.keyUint8, msg.valueCell); + self.uint8_address.replaceGet(msg.keyUint8, msg.valueAddress); + self.uint8_struct.replaceGet(msg.keyUint8, msg.valueStruct); + + self.uint42_varint16.replaceGet(msg.keyUint42, msg.valueVarint16); + self.uint42_varint32.replaceGet(msg.keyUint42, msg.valueVarint32); + self.uint42_varuint16.replaceGet(msg.keyUint42, msg.valueVaruint16); + self.uint42_varuint32.replaceGet(msg.keyUint42, msg.valueVaruint32); + self.uint42_bool.replaceGet(msg.keyUint42, msg.valueBool); + self.uint42_cell.replaceGet(msg.keyUint42, msg.valueCell); + self.uint42_address.replaceGet(msg.keyUint42, msg.valueAddress); + self.uint42_struct.replaceGet(msg.keyUint42, msg.valueStruct); + + self.uint256_varint16.replaceGet(msg.keyUint256, msg.valueVarint16); + self.uint256_varint32.replaceGet(msg.keyUint256, msg.valueVarint32); + self.uint256_varuint16.replaceGet(msg.keyUint256, msg.valueVaruint16); + self.uint256_varuint32.replaceGet(msg.keyUint256, msg.valueVaruint32); + self.uint256_bool.replaceGet(msg.keyUint256, msg.valueBool); + self.uint256_cell.replaceGet(msg.keyUint256, msg.valueCell); + self.uint256_address.replaceGet(msg.keyUint256, msg.valueAddress); + self.uint256_struct.replaceGet(msg.keyUint256, msg.valueStruct); + + // Address Key Maps + self.address_varint16.replaceGet(msg.keyAddress, msg.valueVarint16); + self.address_varint32.replaceGet(msg.keyAddress, msg.valueVarint32); + self.address_varuint16.replaceGet(msg.keyAddress, msg.valueVaruint16); + self.address_varuint32.replaceGet(msg.keyAddress, msg.valueVaruint32); + self.address_bool.replaceGet(msg.keyAddress, msg.valueBool); + self.address_cell.replaceGet(msg.keyAddress, msg.valueCell); + self.address_address.replaceGet(msg.keyAddress, msg.valueAddress); + self.address_struct.replaceGet(msg.keyAddress, msg.valueStruct); + } + + // =============================== + // Getters + // =============================== + + get fun allMaps(): MapTestContract { + return self; + } + + get fun getAllMaps( + keyInt: Int, + keyInt8: Int, + keyInt42: Int, + keyInt256: Int, + keyUint8: Int, + keyUint42: Int, + keyUint256: Int, + keyAddress: Address + ): GetAllMapsResult { + return GetAllMapsResult { + // Integer Key Maps + int_varint16: self.int_varint16.get(keyInt), + int_varint32: self.int_varint32.get(keyInt), + int_varuint16: self.int_varuint16.get(keyInt), + int_varuint32: self.int_varuint32.get(keyInt), + int_bool: self.int_bool.get(keyInt), + int_cell: self.int_cell.get(keyInt), + int_address: self.int_address.get(keyInt), + int_struct: self.int_struct.get(keyInt), + + int8_varint16: self.int8_varint16.get(keyInt8), + int8_varint32: self.int8_varint32.get(keyInt8), + int8_varuint16: self.int8_varuint16.get(keyInt8), + int8_varuint32: self.int8_varuint32.get(keyInt8), + int8_bool: self.int8_bool.get(keyInt8), + int8_cell: self.int8_cell.get(keyInt8), + int8_address: self.int8_address.get(keyInt8), + int8_struct: self.int8_struct.get(keyInt8), + + int42_varint16: self.int42_varint16.get(keyInt42), + int42_varint32: self.int42_varint32.get(keyInt42), + int42_varuint16: self.int42_varuint16.get(keyInt42), + int42_varuint32: self.int42_varuint32.get(keyInt42), + int42_bool: self.int42_bool.get(keyInt42), + int42_cell: self.int42_cell.get(keyInt42), + int42_address: self.int42_address.get(keyInt42), + int42_struct: self.int42_struct.get(keyInt42), + + int256_varint16: self.int256_varint16.get(keyInt256), + int256_varint32: self.int256_varint32.get(keyInt256), + int256_varuint16: self.int256_varuint16.get(keyInt256), + int256_varuint32: self.int256_varuint32.get(keyInt256), + int256_bool: self.int256_bool.get(keyInt256), + int256_cell: self.int256_cell.get(keyInt256), + int256_address: self.int256_address.get(keyInt256), + int256_struct: self.int256_struct.get(keyInt256), + + uint8_varint16: self.uint8_varint16.get(keyUint8), + uint8_varint32: self.uint8_varint32.get(keyUint8), + uint8_varuint16: self.uint8_varuint16.get(keyUint8), + uint8_varuint32: self.uint8_varuint32.get(keyUint8), + uint8_bool: self.uint8_bool.get(keyUint8), + uint8_cell: self.uint8_cell.get(keyUint8), + uint8_address: self.uint8_address.get(keyUint8), + uint8_struct: self.uint8_struct.get(keyUint8), + + uint42_varint16: self.uint42_varint16.get(keyUint42), + uint42_varint32: self.uint42_varint32.get(keyUint42), + uint42_varuint16: self.uint42_varuint16.get(keyUint42), + uint42_varuint32: self.uint42_varuint32.get(keyUint42), + uint42_bool: self.uint42_bool.get(keyUint42), + uint42_cell: self.uint42_cell.get(keyUint42), + uint42_address: self.uint42_address.get(keyUint42), + uint42_struct: self.uint42_struct.get(keyUint42), + + uint256_varint16: self.uint256_varint16.get(keyUint256), + uint256_varint32: self.uint256_varint32.get(keyUint256), + uint256_varuint16: self.uint256_varuint16.get(keyUint256), + uint256_varuint32: self.uint256_varuint32.get(keyUint256), + uint256_bool: self.uint256_bool.get(keyUint256), + uint256_cell: self.uint256_cell.get(keyUint256), + uint256_address: self.uint256_address.get(keyUint256), + uint256_struct: self.uint256_struct.get(keyUint256), + + // Address Key Maps + address_varint16: self.address_varint16.get(keyAddress), + address_varint32: self.address_varint32.get(keyAddress), + address_varuint16: self.address_varuint16.get(keyAddress), + address_varuint32: self.address_varuint32.get(keyAddress), + address_bool: self.address_bool.get(keyAddress), + address_cell: self.address_cell.get(keyAddress), + address_address: self.address_address.get(keyAddress), + address_struct: self.address_struct.get(keyAddress) + }; + } + + get fun replaceAllMaps( + keyInt: Int, + keyInt8: Int, + keyInt42: Int, + keyInt256: Int, + keyUint8: Int, + keyUint42: Int, + keyUint256: Int, + keyAddress: Address, + valueVarint16: Int, + valueVarint32: Int, + valueVaruint16: Int, + valueVaruint32: Int, + valueBool: Bool, + valueCell: Cell, + valueAddress: Address, + valueStruct: SomeStruct + ): ReplaceAllMapsResult { + return ReplaceAllMapsResult { + // Integer Key Maps + int_varint16: self.int_varint16.replace(keyInt, valueVarint16), + int_varint32: self.int_varint32.replace(keyInt, valueVarint32), + int_varuint16: self.int_varuint16.replace(keyInt, valueVaruint16), + int_varuint32: self.int_varuint32.replace(keyInt, valueVaruint32), + int_bool: self.int_bool.replace(keyInt, valueBool), + int_cell: self.int_cell.replace(keyInt, valueCell), + int_address: self.int_address.replace(keyInt, valueAddress), + int_struct: self.int_struct.replace(keyInt, valueStruct), + + int8_varint16: self.int8_varint16.replace(keyInt8, valueVarint16), + int8_varint32: self.int8_varint32.replace(keyInt8, valueVarint32), + int8_varuint16: self.int8_varuint16.replace(keyInt8, valueVaruint16), + int8_varuint32: self.int8_varuint32.replace(keyInt8, valueVaruint32), + int8_bool: self.int8_bool.replace(keyInt8, valueBool), + int8_cell: self.int8_cell.replace(keyInt8, valueCell), + int8_address: self.int8_address.replace(keyInt8, valueAddress), + int8_struct: self.int8_struct.replace(keyInt8, valueStruct), + + int42_varint16: self.int42_varint16.replace(keyInt42, valueVarint16), + int42_varint32: self.int42_varint32.replace(keyInt42, valueVarint32), + int42_varuint16: self.int42_varuint16.replace(keyInt42, valueVaruint16), + int42_varuint32: self.int42_varuint32.replace(keyInt42, valueVaruint32), + int42_bool: self.int42_bool.replace(keyInt42, valueBool), + int42_cell: self.int42_cell.replace(keyInt42, valueCell), + int42_address: self.int42_address.replace(keyInt42, valueAddress), + int42_struct: self.int42_struct.replace(keyInt42, valueStruct), + + int256_varint16: self.int256_varint16.replace(keyInt256, valueVarint16), + int256_varint32: self.int256_varint32.replace(keyInt256, valueVarint32), + int256_varuint16: self.int256_varuint16.replace(keyInt256, valueVaruint16), + int256_varuint32: self.int256_varuint32.replace(keyInt256, valueVaruint32), + int256_bool: self.int256_bool.replace(keyInt256, valueBool), + int256_cell: self.int256_cell.replace(keyInt256, valueCell), + int256_address: self.int256_address.replace(keyInt256, valueAddress), + int256_struct: self.int256_struct.replace(keyInt256, valueStruct), + + uint8_varint16: self.uint8_varint16.replace(keyUint8, valueVarint16), + uint8_varint32: self.uint8_varint32.replace(keyUint8, valueVarint32), + uint8_varuint16: self.uint8_varuint16.replace(keyUint8, valueVaruint16), + uint8_varuint32: self.uint8_varuint32.replace(keyUint8, valueVaruint32), + uint8_bool: self.uint8_bool.replace(keyUint8, valueBool), + uint8_cell: self.uint8_cell.replace(keyUint8, valueCell), + uint8_address: self.uint8_address.replace(keyUint8, valueAddress), + uint8_struct: self.uint8_struct.replace(keyUint8, valueStruct), + + uint42_varint16: self.uint42_varint16.replace(keyUint42, valueVarint16), + uint42_varint32: self.uint42_varint32.replace(keyUint42, valueVarint32), + uint42_varuint16: self.uint42_varuint16.replace(keyUint42, valueVaruint16), + uint42_varuint32: self.uint42_varuint32.replace(keyUint42, valueVaruint32), + uint42_bool: self.uint42_bool.replace(keyUint42, valueBool), + uint42_cell: self.uint42_cell.replace(keyUint42, valueCell), + uint42_address: self.uint42_address.replace(keyUint42, valueAddress), + uint42_struct: self.uint42_struct.replace(keyUint42, valueStruct), + + uint256_varint16: self.uint256_varint16.replace(keyUint256, valueVarint16), + uint256_varint32: self.uint256_varint32.replace(keyUint256, valueVarint32), + uint256_varuint16: self.uint256_varuint16.replace(keyUint256, valueVaruint16), + uint256_varuint32: self.uint256_varuint32.replace(keyUint256, valueVaruint32), + uint256_bool: self.uint256_bool.replace(keyUint256, valueBool), + uint256_cell: self.uint256_cell.replace(keyUint256, valueCell), + uint256_address: self.uint256_address.replace(keyUint256, valueAddress), + uint256_struct: self.uint256_struct.replace(keyUint256, valueStruct), + + // Address Key Maps + address_varint16: self.address_varint16.replace(keyAddress, valueVarint16), + address_varint32: self.address_varint32.replace(keyAddress, valueVarint32), + address_varuint16: self.address_varuint16.replace(keyAddress, valueVaruint16), + address_varuint32: self.address_varuint32.replace(keyAddress, valueVaruint32), + address_bool: self.address_bool.replace(keyAddress, valueBool), + address_cell: self.address_cell.replace(keyAddress, valueCell), + address_address: self.address_address.replace(keyAddress, valueAddress), + address_struct: self.address_struct.replace(keyAddress, valueStruct) + }; + } + + get fun replaceGetAllMaps( + keyInt: Int, + keyInt8: Int, + keyInt42: Int, + keyInt256: Int, + keyUint8: Int, + keyUint42: Int, + keyUint256: Int, + keyAddress: Address, + valueVarint16: Int, + valueVarint32: Int, + valueVaruint16: Int, + valueVaruint32: Int, + valueBool: Bool, + valueCell: Cell, + valueAddress: Address, + valueStruct: SomeStruct + ): ReplaceGetAllMapsResult { + return ReplaceGetAllMapsResult { + // Integer Key Maps + int_varint16: self.int_varint16.replaceGet(keyInt, valueVarint16), + int_varint32: self.int_varint32.replaceGet(keyInt, valueVarint32), + int_varuint16: self.int_varuint16.replaceGet(keyInt, valueVaruint16), + int_varuint32: self.int_varuint32.replaceGet(keyInt, valueVaruint32), + int_bool: self.int_bool.replaceGet(keyInt, valueBool), + int_cell: self.int_cell.replaceGet(keyInt, valueCell), + int_address: self.int_address.replaceGet(keyInt, valueAddress), + int_struct: self.int_struct.replaceGet(keyInt, valueStruct), + + int8_varint16: self.int8_varint16.replaceGet(keyInt8, valueVarint16), + int8_varint32: self.int8_varint32.replaceGet(keyInt8, valueVarint32), + int8_varuint16: self.int8_varuint16.replaceGet(keyInt8, valueVaruint16), + int8_varuint32: self.int8_varuint32.replaceGet(keyInt8, valueVaruint32), + int8_bool: self.int8_bool.replaceGet(keyInt8, valueBool), + int8_cell: self.int8_cell.replaceGet(keyInt8, valueCell), + int8_address: self.int8_address.replaceGet(keyInt8, valueAddress), + int8_struct: self.int8_struct.replaceGet(keyInt8, valueStruct), + + int42_varint16: self.int42_varint16.replaceGet(keyInt42, valueVarint16), + int42_varint32: self.int42_varint32.replaceGet(keyInt42, valueVarint32), + int42_varuint16: self.int42_varuint16.replaceGet(keyInt42, valueVaruint16), + int42_varuint32: self.int42_varuint32.replaceGet(keyInt42, valueVaruint32), + int42_bool: self.int42_bool.replaceGet(keyInt42, valueBool), + int42_cell: self.int42_cell.replaceGet(keyInt42, valueCell), + int42_address: self.int42_address.replaceGet(keyInt42, valueAddress), + int42_struct: self.int42_struct.replaceGet(keyInt42, valueStruct), + + int256_varint16: self.int256_varint16.replaceGet(keyInt256, valueVarint16), + int256_varint32: self.int256_varint32.replaceGet(keyInt256, valueVarint32), + int256_varuint16: self.int256_varuint16.replaceGet(keyInt256, valueVaruint16), + int256_varuint32: self.int256_varuint32.replaceGet(keyInt256, valueVaruint32), + int256_bool: self.int256_bool.replaceGet(keyInt256, valueBool), + int256_cell: self.int256_cell.replaceGet(keyInt256, valueCell), + int256_address: self.int256_address.replaceGet(keyInt256, valueAddress), + int256_struct: self.int256_struct.replaceGet(keyInt256, valueStruct), + + uint8_varint16: self.uint8_varint16.replaceGet(keyUint8, valueVarint16), + uint8_varint32: self.uint8_varint32.replaceGet(keyUint8, valueVarint32), + uint8_varuint16: self.uint8_varuint16.replaceGet(keyUint8, valueVaruint16), + uint8_varuint32: self.uint8_varuint32.replaceGet(keyUint8, valueVaruint32), + uint8_bool: self.uint8_bool.replaceGet(keyUint8, valueBool), + uint8_cell: self.uint8_cell.replaceGet(keyUint8, valueCell), + uint8_address: self.uint8_address.replaceGet(keyUint8, valueAddress), + uint8_struct: self.uint8_struct.replaceGet(keyUint8, valueStruct), + + uint42_varint16: self.uint42_varint16.replaceGet(keyUint42, valueVarint16), + uint42_varint32: self.uint42_varint32.replaceGet(keyUint42, valueVarint32), + uint42_varuint16: self.uint42_varuint16.replaceGet(keyUint42, valueVaruint16), + uint42_varuint32: self.uint42_varuint32.replaceGet(keyUint42, valueVaruint32), + uint42_bool: self.uint42_bool.replaceGet(keyUint42, valueBool), + uint42_cell: self.uint42_cell.replaceGet(keyUint42, valueCell), + uint42_address: self.uint42_address.replaceGet(keyUint42, valueAddress), + uint42_struct: self.uint42_struct.replaceGet(keyUint42, valueStruct), + + uint256_varint16: self.uint256_varint16.replaceGet(keyUint256, valueVarint16), + uint256_varint32: self.uint256_varint32.replaceGet(keyUint256, valueVarint32), + uint256_varuint16: self.uint256_varuint16.replaceGet(keyUint256, valueVaruint16), + uint256_varuint32: self.uint256_varuint32.replaceGet(keyUint256, valueVaruint32), + uint256_bool: self.uint256_bool.replaceGet(keyUint256, valueBool), + uint256_cell: self.uint256_cell.replaceGet(keyUint256, valueCell), + uint256_address: self.uint256_address.replaceGet(keyUint256, valueAddress), + uint256_struct: self.uint256_struct.replaceGet(keyUint256, valueStruct), + + // Address Key Maps + address_varint16: self.address_varint16.replaceGet(keyAddress, valueVarint16), + address_varint32: self.address_varint32.replaceGet(keyAddress, valueVarint32), + address_varuint16: self.address_varuint16.replaceGet(keyAddress, valueVaruint16), + address_varuint32: self.address_varuint32.replaceGet(keyAddress, valueVaruint32), + address_bool: self.address_bool.replaceGet(keyAddress, valueBool), + address_cell: self.address_cell.replaceGet(keyAddress, valueCell), + address_address: self.address_address.replaceGet(keyAddress, valueAddress), + address_struct: self.address_struct.replaceGet(keyAddress, valueStruct) + }; + } + + get fun existsAllMaps( + keyInt: Int, + keyInt8: Int, + keyInt42: Int, + keyInt256: Int, + keyUint8: Int, + keyUint42: Int, + keyUint256: Int, + keyAddress: Address + ): ExistsAllMapsResult { + return ExistsAllMapsResult { + // Integer Key Maps + int_varint16: self.int_varint16.exists(keyInt), + int_varint32: self.int_varint32.exists(keyInt), + int_varuint16: self.int_varuint16.exists(keyInt), + int_varuint32: self.int_varuint32.exists(keyInt), + int_bool: self.int_bool.exists(keyInt), + int_cell: self.int_cell.exists(keyInt), + int_address: self.int_address.exists(keyInt), + int_struct: self.int_struct.exists(keyInt), + + int8_varint16: self.int8_varint16.exists(keyInt8), + int8_varint32: self.int8_varint32.exists(keyInt8), + int8_varuint16: self.int8_varuint16.exists(keyInt8), + int8_varuint32: self.int8_varuint32.exists(keyInt8), + int8_bool: self.int8_bool.exists(keyInt8), + int8_cell: self.int8_cell.exists(keyInt8), + int8_address: self.int8_address.exists(keyInt8), + int8_struct: self.int8_struct.exists(keyInt8), + + int42_varint16: self.int42_varint16.exists(keyInt42), + int42_varint32: self.int42_varint32.exists(keyInt42), + int42_varuint16: self.int42_varuint16.exists(keyInt42), + int42_varuint32: self.int42_varuint32.exists(keyInt42), + int42_bool: self.int42_bool.exists(keyInt42), + int42_cell: self.int42_cell.exists(keyInt42), + int42_address: self.int42_address.exists(keyInt42), + int42_struct: self.int42_struct.exists(keyInt42), + + int256_varint16: self.int256_varint16.exists(keyInt256), + int256_varint32: self.int256_varint32.exists(keyInt256), + int256_varuint16: self.int256_varuint16.exists(keyInt256), + int256_varuint32: self.int256_varuint32.exists(keyInt256), + int256_bool: self.int256_bool.exists(keyInt256), + int256_cell: self.int256_cell.exists(keyInt256), + int256_address: self.int256_address.exists(keyInt256), + int256_struct: self.int256_struct.exists(keyInt256), + + uint8_varint16: self.uint8_varint16.exists(keyUint8), + uint8_varint32: self.uint8_varint32.exists(keyUint8), + uint8_varuint16: self.uint8_varuint16.exists(keyUint8), + uint8_varuint32: self.uint8_varuint32.exists(keyUint8), + uint8_bool: self.uint8_bool.exists(keyUint8), + uint8_cell: self.uint8_cell.exists(keyUint8), + uint8_address: self.uint8_address.exists(keyUint8), + uint8_struct: self.uint8_struct.exists(keyUint8), + + uint42_varint16: self.uint42_varint16.exists(keyUint42), + uint42_varint32: self.uint42_varint32.exists(keyUint42), + uint42_varuint16: self.uint42_varuint16.exists(keyUint42), + uint42_varuint32: self.uint42_varuint32.exists(keyUint42), + uint42_bool: self.uint42_bool.exists(keyUint42), + uint42_cell: self.uint42_cell.exists(keyUint42), + uint42_address: self.uint42_address.exists(keyUint42), + uint42_struct: self.uint42_struct.exists(keyUint42), + + uint256_varint16: self.uint256_varint16.exists(keyUint256), + uint256_varint32: self.uint256_varint32.exists(keyUint256), + uint256_varuint16: self.uint256_varuint16.exists(keyUint256), + uint256_varuint32: self.uint256_varuint32.exists(keyUint256), + uint256_bool: self.uint256_bool.exists(keyUint256), + uint256_cell: self.uint256_cell.exists(keyUint256), + uint256_address: self.uint256_address.exists(keyUint256), + uint256_struct: self.uint256_struct.exists(keyUint256), + + // Address Key Maps + address_varint16: self.address_varint16.exists(keyAddress), + address_varint32: self.address_varint32.exists(keyAddress), + address_varuint16: self.address_varuint16.exists(keyAddress), + address_varuint32: self.address_varuint32.exists(keyAddress), + address_bool: self.address_bool.exists(keyAddress), + address_cell: self.address_cell.exists(keyAddress), + address_address: self.address_address.exists(keyAddress), + address_struct: self.address_struct.exists(keyAddress) + }; + } + + get fun isEmptyAllMaps(): IsEmptyAllMapsResult { + return IsEmptyAllMapsResult { + // Integer Key Maps + int_varint16: self.int_varint16.isEmpty(), + int_varint32: self.int_varint32.isEmpty(), + int_varuint16: self.int_varuint16.isEmpty(), + int_varuint32: self.int_varuint32.isEmpty(), + int_bool: self.int_bool.isEmpty(), + int_cell: self.int_cell.isEmpty(), + int_address: self.int_address.isEmpty(), + int_struct: self.int_struct.isEmpty(), + + int8_varint16: self.int8_varint16.isEmpty(), + int8_varint32: self.int8_varint32.isEmpty(), + int8_varuint16: self.int8_varuint16.isEmpty(), + int8_varuint32: self.int8_varuint32.isEmpty(), + int8_bool: self.int8_bool.isEmpty(), + int8_cell: self.int8_cell.isEmpty(), + int8_address: self.int8_address.isEmpty(), + int8_struct: self.int8_struct.isEmpty(), + + int42_varint16: self.int42_varint16.isEmpty(), + int42_varint32: self.int42_varint32.isEmpty(), + int42_varuint16: self.int42_varuint16.isEmpty(), + int42_varuint32: self.int42_varuint32.isEmpty(), + int42_bool: self.int42_bool.isEmpty(), + int42_cell: self.int42_cell.isEmpty(), + int42_address: self.int42_address.isEmpty(), + int42_struct: self.int42_struct.isEmpty(), + + int256_varint16: self.int256_varint16.isEmpty(), + int256_varint32: self.int256_varint32.isEmpty(), + int256_varuint16: self.int256_varuint16.isEmpty(), + int256_varuint32: self.int256_varuint32.isEmpty(), + int256_bool: self.int256_bool.isEmpty(), + int256_cell: self.int256_cell.isEmpty(), + int256_address: self.int256_address.isEmpty(), + int256_struct: self.int256_struct.isEmpty(), + + uint8_varint16: self.uint8_varint16.isEmpty(), + uint8_varint32: self.uint8_varint32.isEmpty(), + uint8_varuint16: self.uint8_varuint16.isEmpty(), + uint8_varuint32: self.uint8_varuint32.isEmpty(), + uint8_bool: self.uint8_bool.isEmpty(), + uint8_cell: self.uint8_cell.isEmpty(), + uint8_address: self.uint8_address.isEmpty(), + uint8_struct: self.uint8_struct.isEmpty(), + + uint42_varint16: self.uint42_varint16.isEmpty(), + uint42_varint32: self.uint42_varint32.isEmpty(), + uint42_varuint16: self.uint42_varuint16.isEmpty(), + uint42_varuint32: self.uint42_varuint32.isEmpty(), + uint42_bool: self.uint42_bool.isEmpty(), + uint42_cell: self.uint42_cell.isEmpty(), + uint42_address: self.uint42_address.isEmpty(), + uint42_struct: self.uint42_struct.isEmpty(), + + uint256_varint16: self.uint256_varint16.isEmpty(), + uint256_varint32: self.uint256_varint32.isEmpty(), + uint256_varuint16: self.uint256_varuint16.isEmpty(), + uint256_varuint32: self.uint256_varuint32.isEmpty(), + uint256_bool: self.uint256_bool.isEmpty(), + uint256_cell: self.uint256_cell.isEmpty(), + uint256_address: self.uint256_address.isEmpty(), + uint256_struct: self.uint256_struct.isEmpty(), + + // Address Key Maps + address_varint16: self.address_varint16.isEmpty(), + address_varint32: self.address_varint32.isEmpty(), + address_varuint16: self.address_varuint16.isEmpty(), + address_varuint32: self.address_varuint32.isEmpty(), + address_bool: self.address_bool.isEmpty(), + address_cell: self.address_cell.isEmpty(), + address_address: self.address_address.isEmpty(), + address_struct: self.address_struct.isEmpty() + }; + } + + get fun asCellAllMaps(): AsCellAllMapsResult { + return AsCellAllMapsResult { + // Integer Key Maps + int_varint16: self.int_varint16.asCell(), + int_varint32: self.int_varint32.asCell(), + int_varuint16: self.int_varuint16.asCell(), + int_varuint32: self.int_varuint32.asCell(), + int_bool: self.int_bool.asCell(), + int_cell: self.int_cell.asCell(), + int_address: self.int_address.asCell(), + int_struct: self.int_struct.asCell(), + + int8_varint16: self.int8_varint16.asCell(), + int8_varint32: self.int8_varint32.asCell(), + int8_varuint16: self.int8_varuint16.asCell(), + int8_varuint32: self.int8_varuint32.asCell(), + int8_bool: self.int8_bool.asCell(), + int8_cell: self.int8_cell.asCell(), + int8_address: self.int8_address.asCell(), + int8_struct: self.int8_struct.asCell(), + + int42_varint16: self.int42_varint16.asCell(), + int42_varint32: self.int42_varint32.asCell(), + int42_varuint16: self.int42_varuint16.asCell(), + int42_varuint32: self.int42_varuint32.asCell(), + int42_bool: self.int42_bool.asCell(), + int42_cell: self.int42_cell.asCell(), + int42_address: self.int42_address.asCell(), + int42_struct: self.int42_struct.asCell(), + + int256_varint16: self.int256_varint16.asCell(), + int256_varint32: self.int256_varint32.asCell(), + int256_varuint16: self.int256_varuint16.asCell(), + int256_varuint32: self.int256_varuint32.asCell(), + int256_bool: self.int256_bool.asCell(), + int256_cell: self.int256_cell.asCell(), + int256_address: self.int256_address.asCell(), + int256_struct: self.int256_struct.asCell(), + + uint8_varint16: self.uint8_varint16.asCell(), + uint8_varint32: self.uint8_varint32.asCell(), + uint8_varuint16: self.uint8_varuint16.asCell(), + uint8_varuint32: self.uint8_varuint32.asCell(), + uint8_bool: self.uint8_bool.asCell(), + uint8_cell: self.uint8_cell.asCell(), + uint8_address: self.uint8_address.asCell(), + uint8_struct: self.uint8_struct.asCell(), + + uint42_varint16: self.uint42_varint16.asCell(), + uint42_varint32: self.uint42_varint32.asCell(), + uint42_varuint16: self.uint42_varuint16.asCell(), + uint42_varuint32: self.uint42_varuint32.asCell(), + uint42_bool: self.uint42_bool.asCell(), + uint42_cell: self.uint42_cell.asCell(), + uint42_address: self.uint42_address.asCell(), + uint42_struct: self.uint42_struct.asCell(), + + uint256_varint16: self.uint256_varint16.asCell(), + uint256_varint32: self.uint256_varint32.asCell(), + uint256_varuint16: self.uint256_varuint16.asCell(), + uint256_varuint32: self.uint256_varuint32.asCell(), + uint256_bool: self.uint256_bool.asCell(), + uint256_cell: self.uint256_cell.asCell(), + uint256_address: self.uint256_address.asCell(), + uint256_struct: self.uint256_struct.asCell(), + + // Address Key Maps + address_varint16: self.address_varint16.asCell(), + address_varint32: self.address_varint32.asCell(), + address_varuint16: self.address_varuint16.asCell(), + address_varuint32: self.address_varuint32.asCell(), + address_bool: self.address_bool.asCell(), + address_cell: self.address_cell.asCell(), + address_address: self.address_address.asCell(), + address_struct: self.address_struct.asCell() + }; + } + + // + // Edge Cases + // + + get fun checkNullReference(): Int { + let m: map = emptyMap(); + return m.get(0)!!; + } + + receive(msg: CheckNullReference) { + let m: map = emptyMap(); + m.get(0)!!; + } +} diff --git a/src/test/e2e-emulated/contracts/maps.tact b/src/test/e2e-emulated/contracts/maps2.tact similarity index 68% rename from src/test/e2e-emulated/contracts/maps.tact rename to src/test/e2e-emulated/contracts/maps2.tact index 2fb55bddc..e14b918e9 100644 --- a/src/test/e2e-emulated/contracts/maps.tact +++ b/src/test/e2e-emulated/contracts/maps2.tact @@ -21,10 +21,6 @@ struct GetAllMapsResult { int_uint42: Int?; int_uint256: Int?; int_coins: Int?; - int_bool: Bool?; - int_cell: Cell?; - int_address: Address?; - int_struct: SomeStruct?; int8_int: Int?; int8_int8: Int?; @@ -34,10 +30,6 @@ struct GetAllMapsResult { int8_uint42: Int?; int8_uint256: Int?; int8_coins: Int?; - int8_bool: Bool?; - int8_cell: Cell?; - int8_address: Address?; - int8_struct: SomeStruct?; int42_int: Int?; int42_int8: Int?; @@ -47,10 +39,6 @@ struct GetAllMapsResult { int42_uint42: Int?; int42_uint256: Int?; int42_coins: Int?; - int42_bool: Bool?; - int42_cell: Cell?; - int42_address: Address?; - int42_struct: SomeStruct?; int256_int: Int?; int256_int8: Int?; @@ -60,10 +48,6 @@ struct GetAllMapsResult { int256_uint42: Int?; int256_uint256: Int?; int256_coins: Int?; - int256_bool: Bool?; - int256_cell: Cell?; - int256_address: Address?; - int256_struct: SomeStruct?; uint8_int: Int?; uint8_int8: Int?; @@ -73,10 +57,6 @@ struct GetAllMapsResult { uint8_uint42: Int?; uint8_uint256: Int?; uint8_coins: Int?; - uint8_bool: Bool?; - uint8_cell: Cell?; - uint8_address: Address?; - uint8_struct: SomeStruct?; uint42_int: Int?; uint42_int8: Int?; @@ -86,10 +66,6 @@ struct GetAllMapsResult { uint42_uint42: Int?; uint42_uint256: Int?; uint42_coins: Int?; - uint42_bool: Bool?; - uint42_cell: Cell?; - uint42_address: Address?; - uint42_struct: SomeStruct?; uint256_int: Int?; uint256_int8: Int?; @@ -99,10 +75,6 @@ struct GetAllMapsResult { uint256_uint42: Int?; uint256_uint256: Int?; uint256_coins: Int?; - uint256_bool: Bool?; - uint256_cell: Cell?; - uint256_address: Address?; - uint256_struct: SomeStruct?; // Address Key Maps address_int: Int?; @@ -113,10 +85,6 @@ struct GetAllMapsResult { address_uint42: Int?; address_uint256: Int?; address_coins: Int?; - address_bool: Bool?; - address_cell: Cell?; - address_address: Address?; - address_struct: SomeStruct?; } struct ReplaceAllMapsResult { @@ -129,10 +97,6 @@ struct ReplaceAllMapsResult { int_uint42: Bool; int_uint256: Bool; int_coins: Bool; - int_bool: Bool; - int_cell: Bool; - int_address: Bool; - int_struct: Bool; int8_int: Bool; int8_int8: Bool; @@ -142,10 +106,6 @@ struct ReplaceAllMapsResult { int8_uint42: Bool; int8_uint256: Bool; int8_coins: Bool; - int8_bool: Bool; - int8_cell: Bool; - int8_address: Bool; - int8_struct: Bool; int42_int: Bool; int42_int8: Bool; @@ -155,10 +115,6 @@ struct ReplaceAllMapsResult { int42_uint42: Bool; int42_uint256: Bool; int42_coins: Bool; - int42_bool: Bool; - int42_cell: Bool; - int42_address: Bool; - int42_struct: Bool; int256_int: Bool; int256_int8: Bool; @@ -168,10 +124,6 @@ struct ReplaceAllMapsResult { int256_uint42: Bool; int256_uint256: Bool; int256_coins: Bool; - int256_bool: Bool; - int256_cell: Bool; - int256_address: Bool; - int256_struct: Bool; uint8_int: Bool; uint8_int8: Bool; @@ -181,10 +133,6 @@ struct ReplaceAllMapsResult { uint8_uint42: Bool; uint8_uint256: Bool; uint8_coins: Bool; - uint8_bool: Bool; - uint8_cell: Bool; - uint8_address: Bool; - uint8_struct: Bool; uint42_int: Bool; uint42_int8: Bool; @@ -194,10 +142,6 @@ struct ReplaceAllMapsResult { uint42_uint42: Bool; uint42_uint256: Bool; uint42_coins: Bool; - uint42_bool: Bool; - uint42_cell: Bool; - uint42_address: Bool; - uint42_struct: Bool; uint256_int: Bool; uint256_int8: Bool; @@ -207,10 +151,6 @@ struct ReplaceAllMapsResult { uint256_uint42: Bool; uint256_uint256: Bool; uint256_coins: Bool; - uint256_bool: Bool; - uint256_cell: Bool; - uint256_address: Bool; - uint256_struct: Bool; // Address Key Maps address_int: Bool; @@ -221,10 +161,6 @@ struct ReplaceAllMapsResult { address_uint42: Bool; address_uint256: Bool; address_coins: Bool; - address_bool: Bool; - address_cell: Bool; - address_address: Bool; - address_struct: Bool; } struct ReplaceGetAllMapsResult { @@ -237,10 +173,6 @@ struct ReplaceGetAllMapsResult { int_uint42: Int?; int_uint256: Int?; int_coins: Int?; - int_bool: Bool?; - int_cell: Cell?; - int_address: Address?; - int_struct: SomeStruct?; int8_int: Int?; int8_int8: Int?; @@ -250,10 +182,6 @@ struct ReplaceGetAllMapsResult { int8_uint42: Int?; int8_uint256: Int?; int8_coins: Int?; - int8_bool: Bool?; - int8_cell: Cell?; - int8_address: Address?; - int8_struct: SomeStruct?; int42_int: Int?; int42_int8: Int?; @@ -263,10 +191,6 @@ struct ReplaceGetAllMapsResult { int42_uint42: Int?; int42_uint256: Int?; int42_coins: Int?; - int42_bool: Bool?; - int42_cell: Cell?; - int42_address: Address?; - int42_struct: SomeStruct?; int256_int: Int?; int256_int8: Int?; @@ -276,10 +200,6 @@ struct ReplaceGetAllMapsResult { int256_uint42: Int?; int256_uint256: Int?; int256_coins: Int?; - int256_bool: Bool?; - int256_cell: Cell?; - int256_address: Address?; - int256_struct: SomeStruct?; uint8_int: Int?; uint8_int8: Int?; @@ -289,10 +209,6 @@ struct ReplaceGetAllMapsResult { uint8_uint42: Int?; uint8_uint256: Int?; uint8_coins: Int?; - uint8_bool: Bool?; - uint8_cell: Cell?; - uint8_address: Address?; - uint8_struct: SomeStruct?; uint42_int: Int?; uint42_int8: Int?; @@ -302,10 +218,6 @@ struct ReplaceGetAllMapsResult { uint42_uint42: Int?; uint42_uint256: Int?; uint42_coins: Int?; - uint42_bool: Bool?; - uint42_cell: Cell?; - uint42_address: Address?; - uint42_struct: SomeStruct?; uint256_int: Int?; uint256_int8: Int?; @@ -315,10 +227,6 @@ struct ReplaceGetAllMapsResult { uint256_uint42: Int?; uint256_uint256: Int?; uint256_coins: Int?; - uint256_bool: Bool?; - uint256_cell: Cell?; - uint256_address: Address?; - uint256_struct: SomeStruct?; // Address Key Maps address_int: Int?; @@ -329,10 +237,6 @@ struct ReplaceGetAllMapsResult { address_uint42: Int?; address_uint256: Int?; address_coins: Int?; - address_bool: Bool?; - address_cell: Cell?; - address_address: Address?; - address_struct: SomeStruct?; } struct ExistsAllMapsResult { @@ -345,10 +249,6 @@ struct ExistsAllMapsResult { int_uint42: Bool; int_uint256: Bool; int_coins: Bool; - int_bool: Bool; - int_cell: Bool; - int_address: Bool; - int_struct: Bool; int8_int: Bool; int8_int8: Bool; @@ -358,10 +258,6 @@ struct ExistsAllMapsResult { int8_uint42: Bool; int8_uint256: Bool; int8_coins: Bool; - int8_bool: Bool; - int8_cell: Bool; - int8_address: Bool; - int8_struct: Bool; int42_int: Bool; int42_int8: Bool; @@ -371,10 +267,6 @@ struct ExistsAllMapsResult { int42_uint42: Bool; int42_uint256: Bool; int42_coins: Bool; - int42_bool: Bool; - int42_cell: Bool; - int42_address: Bool; - int42_struct: Bool; int256_int: Bool; int256_int8: Bool; @@ -384,10 +276,6 @@ struct ExistsAllMapsResult { int256_uint42: Bool; int256_uint256: Bool; int256_coins: Bool; - int256_bool: Bool; - int256_cell: Bool; - int256_address: Bool; - int256_struct: Bool; uint8_int: Bool; uint8_int8: Bool; @@ -397,10 +285,6 @@ struct ExistsAllMapsResult { uint8_uint42: Bool; uint8_uint256: Bool; uint8_coins: Bool; - uint8_bool: Bool; - uint8_cell: Bool; - uint8_address: Bool; - uint8_struct: Bool; uint42_int: Bool; uint42_int8: Bool; @@ -410,10 +294,6 @@ struct ExistsAllMapsResult { uint42_uint42: Bool; uint42_uint256: Bool; uint42_coins: Bool; - uint42_bool: Bool; - uint42_cell: Bool; - uint42_address: Bool; - uint42_struct: Bool; uint256_int: Bool; uint256_int8: Bool; @@ -423,10 +303,6 @@ struct ExistsAllMapsResult { uint256_uint42: Bool; uint256_uint256: Bool; uint256_coins: Bool; - uint256_bool: Bool; - uint256_cell: Bool; - uint256_address: Bool; - uint256_struct: Bool; // Address Key Maps address_int: Bool; @@ -437,10 +313,6 @@ struct ExistsAllMapsResult { address_uint42: Bool; address_uint256: Bool; address_coins: Bool; - address_bool: Bool; - address_cell: Bool; - address_address: Bool; - address_struct: Bool; } struct IsEmptyAllMapsResult { @@ -453,10 +325,6 @@ struct IsEmptyAllMapsResult { int_uint42: Bool; int_uint256: Bool; int_coins: Bool; - int_bool: Bool; - int_cell: Bool; - int_address: Bool; - int_struct: Bool; int8_int: Bool; int8_int8: Bool; @@ -466,10 +334,6 @@ struct IsEmptyAllMapsResult { int8_uint42: Bool; int8_uint256: Bool; int8_coins: Bool; - int8_bool: Bool; - int8_cell: Bool; - int8_address: Bool; - int8_struct: Bool; int42_int: Bool; int42_int8: Bool; @@ -479,10 +343,6 @@ struct IsEmptyAllMapsResult { int42_uint42: Bool; int42_uint256: Bool; int42_coins: Bool; - int42_bool: Bool; - int42_cell: Bool; - int42_address: Bool; - int42_struct: Bool; int256_int: Bool; int256_int8: Bool; @@ -492,10 +352,6 @@ struct IsEmptyAllMapsResult { int256_uint42: Bool; int256_uint256: Bool; int256_coins: Bool; - int256_bool: Bool; - int256_cell: Bool; - int256_address: Bool; - int256_struct: Bool; uint8_int: Bool; uint8_int8: Bool; @@ -505,10 +361,6 @@ struct IsEmptyAllMapsResult { uint8_uint42: Bool; uint8_uint256: Bool; uint8_coins: Bool; - uint8_bool: Bool; - uint8_cell: Bool; - uint8_address: Bool; - uint8_struct: Bool; uint42_int: Bool; uint42_int8: Bool; @@ -518,10 +370,6 @@ struct IsEmptyAllMapsResult { uint42_uint42: Bool; uint42_uint256: Bool; uint42_coins: Bool; - uint42_bool: Bool; - uint42_cell: Bool; - uint42_address: Bool; - uint42_struct: Bool; uint256_int: Bool; uint256_int8: Bool; @@ -531,10 +379,6 @@ struct IsEmptyAllMapsResult { uint256_uint42: Bool; uint256_uint256: Bool; uint256_coins: Bool; - uint256_bool: Bool; - uint256_cell: Bool; - uint256_address: Bool; - uint256_struct: Bool; // Address Key Maps address_int: Bool; @@ -545,10 +389,6 @@ struct IsEmptyAllMapsResult { address_uint42: Bool; address_uint256: Bool; address_coins: Bool; - address_bool: Bool; - address_cell: Bool; - address_address: Bool; - address_struct: Bool; } struct AsCellAllMapsResult { @@ -561,10 +401,6 @@ struct AsCellAllMapsResult { int_uint42: Cell?; int_uint256: Cell?; int_coins: Cell?; - int_bool: Cell?; - int_cell: Cell?; - int_address: Cell?; - int_struct: Cell?; int8_int: Cell?; int8_int8: Cell?; @@ -574,10 +410,6 @@ struct AsCellAllMapsResult { int8_uint42: Cell?; int8_uint256: Cell?; int8_coins: Cell?; - int8_bool: Cell?; - int8_cell: Cell?; - int8_address: Cell?; - int8_struct: Cell?; int42_int: Cell?; int42_int8: Cell?; @@ -587,10 +419,6 @@ struct AsCellAllMapsResult { int42_uint42: Cell?; int42_uint256: Cell?; int42_coins: Cell?; - int42_bool: Cell?; - int42_cell: Cell?; - int42_address: Cell?; - int42_struct: Cell?; int256_int: Cell?; int256_int8: Cell?; @@ -600,10 +428,6 @@ struct AsCellAllMapsResult { int256_uint42: Cell?; int256_uint256: Cell?; int256_coins: Cell?; - int256_bool: Cell?; - int256_cell: Cell?; - int256_address: Cell?; - int256_struct: Cell?; uint8_int: Cell?; uint8_int8: Cell?; @@ -613,10 +437,6 @@ struct AsCellAllMapsResult { uint8_uint42: Cell?; uint8_uint256: Cell?; uint8_coins: Cell?; - uint8_bool: Cell?; - uint8_cell: Cell?; - uint8_address: Cell?; - uint8_struct: Cell?; uint42_int: Cell?; uint42_int8: Cell?; @@ -626,10 +446,6 @@ struct AsCellAllMapsResult { uint42_uint42: Cell?; uint42_uint256: Cell?; uint42_coins: Cell?; - uint42_bool: Cell?; - uint42_cell: Cell?; - uint42_address: Cell?; - uint42_struct: Cell?; uint256_int: Cell?; uint256_int8: Cell?; @@ -639,10 +455,6 @@ struct AsCellAllMapsResult { uint256_uint42: Cell?; uint256_uint256: Cell?; uint256_coins: Cell?; - uint256_bool: Cell?; - uint256_cell: Cell?; - uint256_address: Cell?; - uint256_struct: Cell?; // Address Key Maps address_int: Cell?; @@ -653,10 +465,6 @@ struct AsCellAllMapsResult { address_uint42: Cell?; address_uint256: Cell?; address_coins: Cell?; - address_bool: Cell?; - address_cell: Cell?; - address_address: Cell?; - address_struct: Cell?; } // =============================== @@ -683,10 +491,6 @@ message SetAllMaps { valueUint42: Int?; valueUint256: Int?; valueCoins: Int?; - valueBool: Bool?; - valueCell: Cell?; - valueAddress: Address?; - valueStruct: SomeStruct?; } message DelAllMaps { @@ -721,10 +525,6 @@ message ReplaceAllMaps { valueUint42: Int?; valueUint256: Int?; valueCoins: Int?; - valueBool: Bool?; - valueCell: Cell?; - valueAddress: Address?; - valueStruct: SomeStruct?; } message ReplaceGetAllMaps { @@ -747,10 +547,6 @@ message ReplaceGetAllMaps { valueUint42: Int?; valueUint256: Int?; valueCoins: Int?; - valueBool: Bool?; - valueCell: Cell?; - valueAddress: Address?; - valueStruct: SomeStruct?; } message CheckNullReference { @@ -776,10 +572,6 @@ contract MapTestContract { int_uint42: map; int_uint256: map; int_coins: map; - int_bool: map; - int_cell: map; - int_address: map; - int_struct: map; // =============================== // Integer (`Int as int8`) Key Maps @@ -793,10 +585,6 @@ contract MapTestContract { int8_uint42: map; int8_uint256: map; int8_coins: map; - int8_bool: map; - int8_cell: map; - int8_address: map; - int8_struct: map; // =============================== // Integer (`Int as int42`) Key Maps @@ -810,10 +598,6 @@ contract MapTestContract { int42_uint42: map; int42_uint256: map; int42_coins: map; - int42_bool: map; - int42_cell: map; - int42_address: map; - int42_struct: map; // =============================== // Integer (`Int as int256`) Key Maps @@ -827,10 +611,6 @@ contract MapTestContract { int256_uint42: map; int256_uint256: map; int256_coins: map; - int256_bool: map; - int256_cell: map; - int256_address: map; - int256_struct: map; // =============================== // Unsigned Integer (`Int as uint8`) Key Maps @@ -844,10 +624,6 @@ contract MapTestContract { uint8_uint42: map; uint8_uint256: map; uint8_coins: map; - uint8_bool: map; - uint8_cell: map; - uint8_address: map; - uint8_struct: map; // =============================== // Unsigned Integer (`Int as uint42`) Key Maps @@ -861,10 +637,6 @@ contract MapTestContract { uint42_uint42: map; uint42_uint256: map; uint42_coins: map; - uint42_bool: map; - uint42_cell: map; - uint42_address: map; - uint42_struct: map; // =============================== // Unsigned Integer (`Int as uint256`) Key Maps @@ -878,10 +650,6 @@ contract MapTestContract { uint256_uint42: map; uint256_uint256: map; uint256_coins: map; - uint256_bool: map; - uint256_cell: map; - uint256_address: map; - uint256_struct: map; // =============================== // Address Key Maps @@ -895,10 +663,6 @@ contract MapTestContract { address_uint42: map; address_uint256: map; address_coins: map; - address_bool: map; - address_cell: map; - address_address: map; - address_struct: map; // =============================== // Receivers For Operations @@ -914,10 +678,6 @@ contract MapTestContract { self.int_uint42.set(msg.keyInt, msg.valueUint42); self.int_uint256.set(msg.keyInt, msg.valueUint256); self.int_coins.set(msg.keyInt, msg.valueCoins); - self.int_bool.set(msg.keyInt, msg.valueBool); - self.int_cell.set(msg.keyInt, msg.valueCell); - self.int_address.set(msg.keyInt, msg.valueAddress); - self.int_struct.set(msg.keyInt, msg.valueStruct); self.int8_int.set(msg.keyInt8, msg.valueInt); self.int8_int8.set(msg.keyInt8, msg.valueInt8); @@ -927,10 +687,6 @@ contract MapTestContract { self.int8_uint42.set(msg.keyInt8, msg.valueUint42); self.int8_uint256.set(msg.keyInt8, msg.valueUint256); self.int8_coins.set(msg.keyInt8, msg.valueCoins); - self.int8_bool.set(msg.keyInt8, msg.valueBool); - self.int8_cell.set(msg.keyInt8, msg.valueCell); - self.int8_address.set(msg.keyInt8, msg.valueAddress); - self.int8_struct.set(msg.keyInt8, msg.valueStruct); self.int42_int.set(msg.keyInt42, msg.valueInt); self.int42_int8.set(msg.keyInt42, msg.valueInt8); @@ -940,10 +696,6 @@ contract MapTestContract { self.int42_uint42.set(msg.keyInt42, msg.valueUint42); self.int42_uint256.set(msg.keyInt42, msg.valueUint256); self.int42_coins.set(msg.keyInt42, msg.valueCoins); - self.int42_bool.set(msg.keyInt42, msg.valueBool); - self.int42_cell.set(msg.keyInt42, msg.valueCell); - self.int42_address.set(msg.keyInt42, msg.valueAddress); - self.int42_struct.set(msg.keyInt42, msg.valueStruct); self.int256_int.set(msg.keyInt256, msg.valueInt); self.int256_int8.set(msg.keyInt256, msg.valueInt8); @@ -953,10 +705,6 @@ contract MapTestContract { self.int256_uint42.set(msg.keyInt256, msg.valueUint42); self.int256_uint256.set(msg.keyInt256, msg.valueUint256); self.int256_coins.set(msg.keyInt256, msg.valueCoins); - self.int256_bool.set(msg.keyInt256, msg.valueBool); - self.int256_cell.set(msg.keyInt256, msg.valueCell); - self.int256_address.set(msg.keyInt256, msg.valueAddress); - self.int256_struct.set(msg.keyInt256, msg.valueStruct); self.uint8_int.set(msg.keyUint8, msg.valueInt); self.uint8_int8.set(msg.keyUint8, msg.valueInt8); @@ -966,10 +714,6 @@ contract MapTestContract { self.uint8_uint42.set(msg.keyUint8, msg.valueUint42); self.uint8_uint256.set(msg.keyUint8, msg.valueUint256); self.uint8_coins.set(msg.keyUint8, msg.valueCoins); - self.uint8_bool.set(msg.keyUint8, msg.valueBool); - self.uint8_cell.set(msg.keyUint8, msg.valueCell); - self.uint8_address.set(msg.keyUint8, msg.valueAddress); - self.uint8_struct.set(msg.keyUint8, msg.valueStruct); self.uint42_int.set(msg.keyUint42, msg.valueInt); self.uint42_int8.set(msg.keyUint42, msg.valueInt8); @@ -979,10 +723,6 @@ contract MapTestContract { self.uint42_uint42.set(msg.keyUint42, msg.valueUint42); self.uint42_uint256.set(msg.keyUint42, msg.valueUint256); self.uint42_coins.set(msg.keyUint42, msg.valueCoins); - self.uint42_bool.set(msg.keyUint42, msg.valueBool); - self.uint42_cell.set(msg.keyUint42, msg.valueCell); - self.uint42_address.set(msg.keyUint42, msg.valueAddress); - self.uint42_struct.set(msg.keyUint42, msg.valueStruct); self.uint256_int.set(msg.keyUint256, msg.valueInt); self.uint256_int8.set(msg.keyUint256, msg.valueInt8); @@ -992,10 +732,6 @@ contract MapTestContract { self.uint256_uint42.set(msg.keyUint256, msg.valueUint42); self.uint256_uint256.set(msg.keyUint256, msg.valueUint256); self.uint256_coins.set(msg.keyUint256, msg.valueCoins); - self.uint256_bool.set(msg.keyUint256, msg.valueBool); - self.uint256_cell.set(msg.keyUint256, msg.valueCell); - self.uint256_address.set(msg.keyUint256, msg.valueAddress); - self.uint256_struct.set(msg.keyUint256, msg.valueStruct); // Address Key Maps self.address_int.set(msg.keyAddress, msg.valueInt); @@ -1006,10 +742,6 @@ contract MapTestContract { self.address_uint42.set(msg.keyAddress, msg.valueUint42); self.address_uint256.set(msg.keyAddress, msg.valueUint256); self.address_coins.set(msg.keyAddress, msg.valueCoins); - self.address_bool.set(msg.keyAddress, msg.valueBool); - self.address_cell.set(msg.keyAddress, msg.valueCell); - self.address_address.set(msg.keyAddress, msg.valueAddress); - self.address_struct.set(msg.keyAddress, msg.valueStruct); } receive(msg: DelAllMaps) { @@ -1022,10 +754,6 @@ contract MapTestContract { self.int_uint42.del(msg.keyInt); self.int_uint256.del(msg.keyInt); self.int_coins.del(msg.keyInt); - self.int_bool.del(msg.keyInt); - self.int_cell.del(msg.keyInt); - self.int_address.del(msg.keyInt); - self.int_struct.del(msg.keyInt); self.int8_int.del(msg.keyInt8); self.int8_int8.del(msg.keyInt8); @@ -1035,10 +763,6 @@ contract MapTestContract { self.int8_uint42.del(msg.keyInt8); self.int8_uint256.del(msg.keyInt8); self.int8_coins.del(msg.keyInt8); - self.int8_bool.del(msg.keyInt8); - self.int8_cell.del(msg.keyInt8); - self.int8_address.del(msg.keyInt8); - self.int8_struct.del(msg.keyInt8); self.int42_int.del(msg.keyInt42); self.int42_int8.del(msg.keyInt42); @@ -1048,10 +772,6 @@ contract MapTestContract { self.int42_uint42.del(msg.keyInt42); self.int42_uint256.del(msg.keyInt42); self.int42_coins.del(msg.keyInt42); - self.int42_bool.del(msg.keyInt42); - self.int42_cell.del(msg.keyInt42); - self.int42_address.del(msg.keyInt42); - self.int42_struct.del(msg.keyInt42); self.int256_int.del(msg.keyInt256); self.int256_int8.del(msg.keyInt256); @@ -1061,10 +781,6 @@ contract MapTestContract { self.int256_uint42.del(msg.keyInt256); self.int256_uint256.del(msg.keyInt256); self.int256_coins.del(msg.keyInt256); - self.int256_bool.del(msg.keyInt256); - self.int256_cell.del(msg.keyInt256); - self.int256_address.del(msg.keyInt256); - self.int256_struct.del(msg.keyInt256); self.uint8_int.del(msg.keyUint8); self.uint8_int8.del(msg.keyUint8); @@ -1074,10 +790,6 @@ contract MapTestContract { self.uint8_uint42.del(msg.keyUint8); self.uint8_uint256.del(msg.keyUint8); self.uint8_coins.del(msg.keyUint8); - self.uint8_bool.del(msg.keyUint8); - self.uint8_cell.del(msg.keyUint8); - self.uint8_address.del(msg.keyUint8); - self.uint8_struct.del(msg.keyUint8); self.uint42_int.del(msg.keyUint42); self.uint42_int8.del(msg.keyUint42); @@ -1087,10 +799,6 @@ contract MapTestContract { self.uint42_uint42.del(msg.keyUint42); self.uint42_uint256.del(msg.keyUint42); self.uint42_coins.del(msg.keyUint42); - self.uint42_bool.del(msg.keyUint42); - self.uint42_cell.del(msg.keyUint42); - self.uint42_address.del(msg.keyUint42); - self.uint42_struct.del(msg.keyUint42); self.uint256_int.del(msg.keyUint256); self.uint256_int8.del(msg.keyUint256); @@ -1100,10 +808,6 @@ contract MapTestContract { self.uint256_uint42.del(msg.keyUint256); self.uint256_uint256.del(msg.keyUint256); self.uint256_coins.del(msg.keyUint256); - self.uint256_bool.del(msg.keyUint256); - self.uint256_cell.del(msg.keyUint256); - self.uint256_address.del(msg.keyUint256); - self.uint256_struct.del(msg.keyUint256); // Address Key Maps self.address_int.del(msg.keyAddress); @@ -1114,14 +818,10 @@ contract MapTestContract { self.address_uint42.del(msg.keyAddress); self.address_uint256.del(msg.keyAddress); self.address_coins.del(msg.keyAddress); - self.address_bool.del(msg.keyAddress); - self.address_cell.del(msg.keyAddress); - self.address_address.del(msg.keyAddress); - self.address_struct.del(msg.keyAddress); } receive(msg: ReplaceAllMaps) { - // Integer Key Maps + // Replace operations analogous to coins, now including varint16, varint32, varuint16, varuint32 self.int_int.replace(msg.keyInt, msg.valueInt); self.int_int8.replace(msg.keyInt, msg.valueInt8); self.int_int42.replace(msg.keyInt, msg.valueInt42); @@ -1130,10 +830,6 @@ contract MapTestContract { self.int_uint42.replace(msg.keyInt, msg.valueUint42); self.int_uint256.replace(msg.keyInt, msg.valueUint256); self.int_coins.replace(msg.keyInt, msg.valueCoins); - self.int_bool.replace(msg.keyInt, msg.valueBool); - self.int_cell.replace(msg.keyInt, msg.valueCell); - self.int_address.replace(msg.keyInt, msg.valueAddress); - self.int_struct.replace(msg.keyInt, msg.valueStruct); self.int8_int.replace(msg.keyInt8, msg.valueInt); self.int8_int8.replace(msg.keyInt8, msg.valueInt8); @@ -1143,10 +839,6 @@ contract MapTestContract { self.int8_uint42.replace(msg.keyInt8, msg.valueUint42); self.int8_uint256.replace(msg.keyInt8, msg.valueUint256); self.int8_coins.replace(msg.keyInt8, msg.valueCoins); - self.int8_bool.replace(msg.keyInt8, msg.valueBool); - self.int8_cell.replace(msg.keyInt8, msg.valueCell); - self.int8_address.replace(msg.keyInt8, msg.valueAddress); - self.int8_struct.replace(msg.keyInt8, msg.valueStruct); self.int42_int.replace(msg.keyInt42, msg.valueInt); self.int42_int8.replace(msg.keyInt42, msg.valueInt8); @@ -1156,10 +848,6 @@ contract MapTestContract { self.int42_uint42.replace(msg.keyInt42, msg.valueUint42); self.int42_uint256.replace(msg.keyInt42, msg.valueUint256); self.int42_coins.replace(msg.keyInt42, msg.valueCoins); - self.int42_bool.replace(msg.keyInt42, msg.valueBool); - self.int42_cell.replace(msg.keyInt42, msg.valueCell); - self.int42_address.replace(msg.keyInt42, msg.valueAddress); - self.int42_struct.replace(msg.keyInt42, msg.valueStruct); self.int256_int.replace(msg.keyInt256, msg.valueInt); self.int256_int8.replace(msg.keyInt256, msg.valueInt8); @@ -1169,10 +857,6 @@ contract MapTestContract { self.int256_uint42.replace(msg.keyInt256, msg.valueUint42); self.int256_uint256.replace(msg.keyInt256, msg.valueUint256); self.int256_coins.replace(msg.keyInt256, msg.valueCoins); - self.int256_bool.replace(msg.keyInt256, msg.valueBool); - self.int256_cell.replace(msg.keyInt256, msg.valueCell); - self.int256_address.replace(msg.keyInt256, msg.valueAddress); - self.int256_struct.replace(msg.keyInt256, msg.valueStruct); self.uint8_int.replace(msg.keyUint8, msg.valueInt); self.uint8_int8.replace(msg.keyUint8, msg.valueInt8); @@ -1182,10 +866,6 @@ contract MapTestContract { self.uint8_uint42.replace(msg.keyUint8, msg.valueUint42); self.uint8_uint256.replace(msg.keyUint8, msg.valueUint256); self.uint8_coins.replace(msg.keyUint8, msg.valueCoins); - self.uint8_bool.replace(msg.keyUint8, msg.valueBool); - self.uint8_cell.replace(msg.keyUint8, msg.valueCell); - self.uint8_address.replace(msg.keyUint8, msg.valueAddress); - self.uint8_struct.replace(msg.keyUint8, msg.valueStruct); self.uint42_int.replace(msg.keyUint42, msg.valueInt); self.uint42_int8.replace(msg.keyUint42, msg.valueInt8); @@ -1195,10 +875,6 @@ contract MapTestContract { self.uint42_uint42.replace(msg.keyUint42, msg.valueUint42); self.uint42_uint256.replace(msg.keyUint42, msg.valueUint256); self.uint42_coins.replace(msg.keyUint42, msg.valueCoins); - self.uint42_bool.replace(msg.keyUint42, msg.valueBool); - self.uint42_cell.replace(msg.keyUint42, msg.valueCell); - self.uint42_address.replace(msg.keyUint42, msg.valueAddress); - self.uint42_struct.replace(msg.keyUint42, msg.valueStruct); self.uint256_int.replace(msg.keyUint256, msg.valueInt); self.uint256_int8.replace(msg.keyUint256, msg.valueInt8); @@ -1208,10 +884,6 @@ contract MapTestContract { self.uint256_uint42.replace(msg.keyUint256, msg.valueUint42); self.uint256_uint256.replace(msg.keyUint256, msg.valueUint256); self.uint256_coins.replace(msg.keyUint256, msg.valueCoins); - self.uint256_bool.replace(msg.keyUint256, msg.valueBool); - self.uint256_cell.replace(msg.keyUint256, msg.valueCell); - self.uint256_address.replace(msg.keyUint256, msg.valueAddress); - self.uint256_struct.replace(msg.keyUint256, msg.valueStruct); // Address Key Maps self.address_int.replace(msg.keyAddress, msg.valueInt); @@ -1222,14 +894,10 @@ contract MapTestContract { self.address_uint42.replace(msg.keyAddress, msg.valueUint42); self.address_uint256.replace(msg.keyAddress, msg.valueUint256); self.address_coins.replace(msg.keyAddress, msg.valueCoins); - self.address_bool.replace(msg.keyAddress, msg.valueBool); - self.address_cell.replace(msg.keyAddress, msg.valueCell); - self.address_address.replace(msg.keyAddress, msg.valueAddress); - self.address_struct.replace(msg.keyAddress, msg.valueStruct); } receive(msg: ReplaceGetAllMaps) { - // Integer Key Maps + // Similar to above, but calling replaceGet self.int_int.replaceGet(msg.keyInt, msg.valueInt); self.int_int8.replaceGet(msg.keyInt, msg.valueInt8); self.int_int42.replaceGet(msg.keyInt, msg.valueInt42); @@ -1238,10 +906,6 @@ contract MapTestContract { self.int_uint42.replaceGet(msg.keyInt, msg.valueUint42); self.int_uint256.replaceGet(msg.keyInt, msg.valueUint256); self.int_coins.replaceGet(msg.keyInt, msg.valueCoins); - self.int_bool.replaceGet(msg.keyInt, msg.valueBool); - self.int_cell.replaceGet(msg.keyInt, msg.valueCell); - self.int_address.replaceGet(msg.keyInt, msg.valueAddress); - self.int_struct.replaceGet(msg.keyInt, msg.valueStruct); self.int8_int.replaceGet(msg.keyInt8, msg.valueInt); self.int8_int8.replaceGet(msg.keyInt8, msg.valueInt8); @@ -1251,10 +915,6 @@ contract MapTestContract { self.int8_uint42.replaceGet(msg.keyInt8, msg.valueUint42); self.int8_uint256.replaceGet(msg.keyInt8, msg.valueUint256); self.int8_coins.replaceGet(msg.keyInt8, msg.valueCoins); - self.int8_bool.replaceGet(msg.keyInt8, msg.valueBool); - self.int8_cell.replaceGet(msg.keyInt8, msg.valueCell); - self.int8_address.replaceGet(msg.keyInt8, msg.valueAddress); - self.int8_struct.replaceGet(msg.keyInt8, msg.valueStruct); self.int42_int.replaceGet(msg.keyInt42, msg.valueInt); self.int42_int8.replaceGet(msg.keyInt42, msg.valueInt8); @@ -1264,10 +924,6 @@ contract MapTestContract { self.int42_uint42.replaceGet(msg.keyInt42, msg.valueUint42); self.int42_uint256.replaceGet(msg.keyInt42, msg.valueUint256); self.int42_coins.replaceGet(msg.keyInt42, msg.valueCoins); - self.int42_bool.replaceGet(msg.keyInt42, msg.valueBool); - self.int42_cell.replaceGet(msg.keyInt42, msg.valueCell); - self.int42_address.replaceGet(msg.keyInt42, msg.valueAddress); - self.int42_struct.replaceGet(msg.keyInt42, msg.valueStruct); self.int256_int.replaceGet(msg.keyInt256, msg.valueInt); self.int256_int8.replaceGet(msg.keyInt256, msg.valueInt8); @@ -1277,10 +933,6 @@ contract MapTestContract { self.int256_uint42.replaceGet(msg.keyInt256, msg.valueUint42); self.int256_uint256.replaceGet(msg.keyInt256, msg.valueUint256); self.int256_coins.replaceGet(msg.keyInt256, msg.valueCoins); - self.int256_bool.replaceGet(msg.keyInt256, msg.valueBool); - self.int256_cell.replaceGet(msg.keyInt256, msg.valueCell); - self.int256_address.replaceGet(msg.keyInt256, msg.valueAddress); - self.int256_struct.replaceGet(msg.keyInt256, msg.valueStruct); self.uint8_int.replaceGet(msg.keyUint8, msg.valueInt); self.uint8_int8.replaceGet(msg.keyUint8, msg.valueInt8); @@ -1290,10 +942,6 @@ contract MapTestContract { self.uint8_uint42.replaceGet(msg.keyUint8, msg.valueUint42); self.uint8_uint256.replaceGet(msg.keyUint8, msg.valueUint256); self.uint8_coins.replaceGet(msg.keyUint8, msg.valueCoins); - self.uint8_bool.replaceGet(msg.keyUint8, msg.valueBool); - self.uint8_cell.replaceGet(msg.keyUint8, msg.valueCell); - self.uint8_address.replaceGet(msg.keyUint8, msg.valueAddress); - self.uint8_struct.replaceGet(msg.keyUint8, msg.valueStruct); self.uint42_int.replaceGet(msg.keyUint42, msg.valueInt); self.uint42_int8.replaceGet(msg.keyUint42, msg.valueInt8); @@ -1303,10 +951,6 @@ contract MapTestContract { self.uint42_uint42.replaceGet(msg.keyUint42, msg.valueUint42); self.uint42_uint256.replaceGet(msg.keyUint42, msg.valueUint256); self.uint42_coins.replaceGet(msg.keyUint42, msg.valueCoins); - self.uint42_bool.replaceGet(msg.keyUint42, msg.valueBool); - self.uint42_cell.replaceGet(msg.keyUint42, msg.valueCell); - self.uint42_address.replaceGet(msg.keyUint42, msg.valueAddress); - self.uint42_struct.replaceGet(msg.keyUint42, msg.valueStruct); self.uint256_int.replaceGet(msg.keyUint256, msg.valueInt); self.uint256_int8.replaceGet(msg.keyUint256, msg.valueInt8); @@ -1316,10 +960,6 @@ contract MapTestContract { self.uint256_uint42.replaceGet(msg.keyUint256, msg.valueUint42); self.uint256_uint256.replaceGet(msg.keyUint256, msg.valueUint256); self.uint256_coins.replaceGet(msg.keyUint256, msg.valueCoins); - self.uint256_bool.replaceGet(msg.keyUint256, msg.valueBool); - self.uint256_cell.replaceGet(msg.keyUint256, msg.valueCell); - self.uint256_address.replaceGet(msg.keyUint256, msg.valueAddress); - self.uint256_struct.replaceGet(msg.keyUint256, msg.valueStruct); // Address Key Maps self.address_int.replaceGet(msg.keyAddress, msg.valueInt); @@ -1330,10 +970,6 @@ contract MapTestContract { self.address_uint42.replaceGet(msg.keyAddress, msg.valueUint42); self.address_uint256.replaceGet(msg.keyAddress, msg.valueUint256); self.address_coins.replaceGet(msg.keyAddress, msg.valueCoins); - self.address_bool.replaceGet(msg.keyAddress, msg.valueBool); - self.address_cell.replaceGet(msg.keyAddress, msg.valueCell); - self.address_address.replaceGet(msg.keyAddress, msg.valueAddress); - self.address_struct.replaceGet(msg.keyAddress, msg.valueStruct); } // =============================== @@ -1364,10 +1000,6 @@ contract MapTestContract { int_uint42: self.int_uint42.get(keyInt), int_uint256: self.int_uint256.get(keyInt), int_coins: self.int_coins.get(keyInt), - int_bool: self.int_bool.get(keyInt), - int_cell: self.int_cell.get(keyInt), - int_address: self.int_address.get(keyInt), - int_struct: self.int_struct.get(keyInt), int8_int: self.int8_int.get(keyInt8), int8_int8: self.int8_int8.get(keyInt8), @@ -1377,10 +1009,6 @@ contract MapTestContract { int8_uint42: self.int8_uint42.get(keyInt8), int8_uint256: self.int8_uint256.get(keyInt8), int8_coins: self.int8_coins.get(keyInt8), - int8_bool: self.int8_bool.get(keyInt8), - int8_cell: self.int8_cell.get(keyInt8), - int8_address: self.int8_address.get(keyInt8), - int8_struct: self.int8_struct.get(keyInt8), int42_int: self.int42_int.get(keyInt42), int42_int8: self.int42_int8.get(keyInt42), @@ -1390,10 +1018,6 @@ contract MapTestContract { int42_uint42: self.int42_uint42.get(keyInt42), int42_uint256: self.int42_uint256.get(keyInt42), int42_coins: self.int42_coins.get(keyInt42), - int42_bool: self.int42_bool.get(keyInt42), - int42_cell: self.int42_cell.get(keyInt42), - int42_address: self.int42_address.get(keyInt42), - int42_struct: self.int42_struct.get(keyInt42), int256_int: self.int256_int.get(keyInt256), int256_int8: self.int256_int8.get(keyInt256), @@ -1403,10 +1027,6 @@ contract MapTestContract { int256_uint42: self.int256_uint42.get(keyInt256), int256_uint256: self.int256_uint256.get(keyInt256), int256_coins: self.int256_coins.get(keyInt256), - int256_bool: self.int256_bool.get(keyInt256), - int256_cell: self.int256_cell.get(keyInt256), - int256_address: self.int256_address.get(keyInt256), - int256_struct: self.int256_struct.get(keyInt256), uint8_int: self.uint8_int.get(keyUint8), uint8_int8: self.uint8_int8.get(keyUint8), @@ -1416,10 +1036,6 @@ contract MapTestContract { uint8_uint42: self.uint8_uint42.get(keyUint8), uint8_uint256: self.uint8_uint256.get(keyUint8), uint8_coins: self.uint8_coins.get(keyUint8), - uint8_bool: self.uint8_bool.get(keyUint8), - uint8_cell: self.uint8_cell.get(keyUint8), - uint8_address: self.uint8_address.get(keyUint8), - uint8_struct: self.uint8_struct.get(keyUint8), uint42_int: self.uint42_int.get(keyUint42), uint42_int8: self.uint42_int8.get(keyUint42), @@ -1429,10 +1045,6 @@ contract MapTestContract { uint42_uint42: self.uint42_uint42.get(keyUint42), uint42_uint256: self.uint42_uint256.get(keyUint42), uint42_coins: self.uint42_coins.get(keyUint42), - uint42_bool: self.uint42_bool.get(keyUint42), - uint42_cell: self.uint42_cell.get(keyUint42), - uint42_address: self.uint42_address.get(keyUint42), - uint42_struct: self.uint42_struct.get(keyUint42), uint256_int: self.uint256_int.get(keyUint256), uint256_int8: self.uint256_int8.get(keyUint256), @@ -1442,10 +1054,6 @@ contract MapTestContract { uint256_uint42: self.uint256_uint42.get(keyUint256), uint256_uint256: self.uint256_uint256.get(keyUint256), uint256_coins: self.uint256_coins.get(keyUint256), - uint256_bool: self.uint256_bool.get(keyUint256), - uint256_cell: self.uint256_cell.get(keyUint256), - uint256_address: self.uint256_address.get(keyUint256), - uint256_struct: self.uint256_struct.get(keyUint256), // Address Key Maps address_int: self.address_int.get(keyAddress), @@ -1456,10 +1064,6 @@ contract MapTestContract { address_uint42: self.address_uint42.get(keyAddress), address_uint256: self.address_uint256.get(keyAddress), address_coins: self.address_coins.get(keyAddress), - address_bool: self.address_bool.get(keyAddress), - address_cell: self.address_cell.get(keyAddress), - address_address: self.address_address.get(keyAddress), - address_struct: self.address_struct.get(keyAddress) }; } @@ -1480,10 +1084,6 @@ contract MapTestContract { valueUint42: Int, valueUint256: Int, valueCoins: Int, - valueBool: Bool, - valueCell: Cell, - valueAddress: Address, - valueStruct: SomeStruct ): ReplaceAllMapsResult { return ReplaceAllMapsResult { // Integer Key Maps @@ -1495,10 +1095,6 @@ contract MapTestContract { int_uint42: self.int_uint42.replace(keyInt, valueUint42), int_uint256: self.int_uint256.replace(keyInt, valueUint256), int_coins: self.int_coins.replace(keyInt, valueCoins), - int_bool: self.int_bool.replace(keyInt, valueBool), - int_cell: self.int_cell.replace(keyInt, valueCell), - int_address: self.int_address.replace(keyInt, valueAddress), - int_struct: self.int_struct.replace(keyInt, valueStruct), int8_int: self.int8_int.replace(keyInt8, valueInt), int8_int8: self.int8_int8.replace(keyInt8, valueInt8), @@ -1508,10 +1104,6 @@ contract MapTestContract { int8_uint42: self.int8_uint42.replace(keyInt8, valueUint42), int8_uint256: self.int8_uint256.replace(keyInt8, valueUint256), int8_coins: self.int8_coins.replace(keyInt8, valueCoins), - int8_bool: self.int8_bool.replace(keyInt8, valueBool), - int8_cell: self.int8_cell.replace(keyInt8, valueCell), - int8_address: self.int8_address.replace(keyInt8, valueAddress), - int8_struct: self.int8_struct.replace(keyInt8, valueStruct), int42_int: self.int42_int.replace(keyInt42, valueInt), int42_int8: self.int42_int8.replace(keyInt42, valueInt8), @@ -1521,10 +1113,6 @@ contract MapTestContract { int42_uint42: self.int42_uint42.replace(keyInt42, valueUint42), int42_uint256: self.int42_uint256.replace(keyInt42, valueUint256), int42_coins: self.int42_coins.replace(keyInt42, valueCoins), - int42_bool: self.int42_bool.replace(keyInt42, valueBool), - int42_cell: self.int42_cell.replace(keyInt42, valueCell), - int42_address: self.int42_address.replace(keyInt42, valueAddress), - int42_struct: self.int42_struct.replace(keyInt42, valueStruct), int256_int: self.int256_int.replace(keyInt256, valueInt), int256_int8: self.int256_int8.replace(keyInt256, valueInt8), @@ -1534,10 +1122,6 @@ contract MapTestContract { int256_uint42: self.int256_uint42.replace(keyInt256, valueUint42), int256_uint256: self.int256_uint256.replace(keyInt256, valueUint256), int256_coins: self.int256_coins.replace(keyInt256, valueCoins), - int256_bool: self.int256_bool.replace(keyInt256, valueBool), - int256_cell: self.int256_cell.replace(keyInt256, valueCell), - int256_address: self.int256_address.replace(keyInt256, valueAddress), - int256_struct: self.int256_struct.replace(keyInt256, valueStruct), uint8_int: self.uint8_int.replace(keyUint8, valueInt), uint8_int8: self.uint8_int8.replace(keyUint8, valueInt8), @@ -1547,10 +1131,6 @@ contract MapTestContract { uint8_uint42: self.uint8_uint42.replace(keyUint8, valueUint42), uint8_uint256: self.uint8_uint256.replace(keyUint8, valueUint256), uint8_coins: self.uint8_coins.replace(keyUint8, valueCoins), - uint8_bool: self.uint8_bool.replace(keyUint8, valueBool), - uint8_cell: self.uint8_cell.replace(keyUint8, valueCell), - uint8_address: self.uint8_address.replace(keyUint8, valueAddress), - uint8_struct: self.uint8_struct.replace(keyUint8, valueStruct), uint42_int: self.uint42_int.replace(keyUint42, valueInt), uint42_int8: self.uint42_int8.replace(keyUint42, valueInt8), @@ -1560,10 +1140,6 @@ contract MapTestContract { uint42_uint42: self.uint42_uint42.replace(keyUint42, valueUint42), uint42_uint256: self.uint42_uint256.replace(keyUint42, valueUint256), uint42_coins: self.uint42_coins.replace(keyUint42, valueCoins), - uint42_bool: self.uint42_bool.replace(keyUint42, valueBool), - uint42_cell: self.uint42_cell.replace(keyUint42, valueCell), - uint42_address: self.uint42_address.replace(keyUint42, valueAddress), - uint42_struct: self.uint42_struct.replace(keyUint42, valueStruct), uint256_int: self.uint256_int.replace(keyUint256, valueInt), uint256_int8: self.uint256_int8.replace(keyUint256, valueInt8), @@ -1573,10 +1149,6 @@ contract MapTestContract { uint256_uint42: self.uint256_uint42.replace(keyUint256, valueUint42), uint256_uint256: self.uint256_uint256.replace(keyUint256, valueUint256), uint256_coins: self.uint256_coins.replace(keyUint256, valueCoins), - uint256_bool: self.uint256_bool.replace(keyUint256, valueBool), - uint256_cell: self.uint256_cell.replace(keyUint256, valueCell), - uint256_address: self.uint256_address.replace(keyUint256, valueAddress), - uint256_struct: self.uint256_struct.replace(keyUint256, valueStruct), // Address Key Maps address_int: self.address_int.replace(keyAddress, valueInt), @@ -1587,10 +1159,6 @@ contract MapTestContract { address_uint42: self.address_uint42.replace(keyAddress, valueUint42), address_uint256: self.address_uint256.replace(keyAddress, valueUint256), address_coins: self.address_coins.replace(keyAddress, valueCoins), - address_bool: self.address_bool.replace(keyAddress, valueBool), - address_cell: self.address_cell.replace(keyAddress, valueCell), - address_address: self.address_address.replace(keyAddress, valueAddress), - address_struct: self.address_struct.replace(keyAddress, valueStruct) }; } @@ -1611,10 +1179,6 @@ contract MapTestContract { valueUint42: Int, valueUint256: Int, valueCoins: Int, - valueBool: Bool, - valueCell: Cell, - valueAddress: Address, - valueStruct: SomeStruct ): ReplaceGetAllMapsResult { return ReplaceGetAllMapsResult { // Integer Key Maps @@ -1626,10 +1190,6 @@ contract MapTestContract { int_uint42: self.int_uint42.replaceGet(keyInt, valueUint42), int_uint256: self.int_uint256.replaceGet(keyInt, valueUint256), int_coins: self.int_coins.replaceGet(keyInt, valueCoins), - int_bool: self.int_bool.replaceGet(keyInt, valueBool), - int_cell: self.int_cell.replaceGet(keyInt, valueCell), - int_address: self.int_address.replaceGet(keyInt, valueAddress), - int_struct: self.int_struct.replaceGet(keyInt, valueStruct), int8_int: self.int8_int.replaceGet(keyInt8, valueInt), int8_int8: self.int8_int8.replaceGet(keyInt8, valueInt8), @@ -1639,10 +1199,6 @@ contract MapTestContract { int8_uint42: self.int8_uint42.replaceGet(keyInt8, valueUint42), int8_uint256: self.int8_uint256.replaceGet(keyInt8, valueUint256), int8_coins: self.int8_coins.replaceGet(keyInt8, valueCoins), - int8_bool: self.int8_bool.replaceGet(keyInt8, valueBool), - int8_cell: self.int8_cell.replaceGet(keyInt8, valueCell), - int8_address: self.int8_address.replaceGet(keyInt8, valueAddress), - int8_struct: self.int8_struct.replaceGet(keyInt8, valueStruct), int42_int: self.int42_int.replaceGet(keyInt42, valueInt), int42_int8: self.int42_int8.replaceGet(keyInt42, valueInt8), @@ -1652,10 +1208,6 @@ contract MapTestContract { int42_uint42: self.int42_uint42.replaceGet(keyInt42, valueUint42), int42_uint256: self.int42_uint256.replaceGet(keyInt42, valueUint256), int42_coins: self.int42_coins.replaceGet(keyInt42, valueCoins), - int42_bool: self.int42_bool.replaceGet(keyInt42, valueBool), - int42_cell: self.int42_cell.replaceGet(keyInt42, valueCell), - int42_address: self.int42_address.replaceGet(keyInt42, valueAddress), - int42_struct: self.int42_struct.replaceGet(keyInt42, valueStruct), int256_int: self.int256_int.replaceGet(keyInt256, valueInt), int256_int8: self.int256_int8.replaceGet(keyInt256, valueInt8), @@ -1665,10 +1217,6 @@ contract MapTestContract { int256_uint42: self.int256_uint42.replaceGet(keyInt256, valueUint42), int256_uint256: self.int256_uint256.replaceGet(keyInt256, valueUint256), int256_coins: self.int256_coins.replaceGet(keyInt256, valueCoins), - int256_bool: self.int256_bool.replaceGet(keyInt256, valueBool), - int256_cell: self.int256_cell.replaceGet(keyInt256, valueCell), - int256_address: self.int256_address.replaceGet(keyInt256, valueAddress), - int256_struct: self.int256_struct.replaceGet(keyInt256, valueStruct), uint8_int: self.uint8_int.replaceGet(keyUint8, valueInt), uint8_int8: self.uint8_int8.replaceGet(keyUint8, valueInt8), @@ -1678,10 +1226,6 @@ contract MapTestContract { uint8_uint42: self.uint8_uint42.replaceGet(keyUint8, valueUint42), uint8_uint256: self.uint8_uint256.replaceGet(keyUint8, valueUint256), uint8_coins: self.uint8_coins.replaceGet(keyUint8, valueCoins), - uint8_bool: self.uint8_bool.replaceGet(keyUint8, valueBool), - uint8_cell: self.uint8_cell.replaceGet(keyUint8, valueCell), - uint8_address: self.uint8_address.replaceGet(keyUint8, valueAddress), - uint8_struct: self.uint8_struct.replaceGet(keyUint8, valueStruct), uint42_int: self.uint42_int.replaceGet(keyUint42, valueInt), uint42_int8: self.uint42_int8.replaceGet(keyUint42, valueInt8), @@ -1691,10 +1235,6 @@ contract MapTestContract { uint42_uint42: self.uint42_uint42.replaceGet(keyUint42, valueUint42), uint42_uint256: self.uint42_uint256.replaceGet(keyUint42, valueUint256), uint42_coins: self.uint42_coins.replaceGet(keyUint42, valueCoins), - uint42_bool: self.uint42_bool.replaceGet(keyUint42, valueBool), - uint42_cell: self.uint42_cell.replaceGet(keyUint42, valueCell), - uint42_address: self.uint42_address.replaceGet(keyUint42, valueAddress), - uint42_struct: self.uint42_struct.replaceGet(keyUint42, valueStruct), uint256_int: self.uint256_int.replaceGet(keyUint256, valueInt), uint256_int8: self.uint256_int8.replaceGet(keyUint256, valueInt8), @@ -1704,10 +1244,6 @@ contract MapTestContract { uint256_uint42: self.uint256_uint42.replaceGet(keyUint256, valueUint42), uint256_uint256: self.uint256_uint256.replaceGet(keyUint256, valueUint256), uint256_coins: self.uint256_coins.replaceGet(keyUint256, valueCoins), - uint256_bool: self.uint256_bool.replaceGet(keyUint256, valueBool), - uint256_cell: self.uint256_cell.replaceGet(keyUint256, valueCell), - uint256_address: self.uint256_address.replaceGet(keyUint256, valueAddress), - uint256_struct: self.uint256_struct.replaceGet(keyUint256, valueStruct), // Address Key Maps address_int: self.address_int.replaceGet(keyAddress, valueInt), @@ -1718,10 +1254,6 @@ contract MapTestContract { address_uint42: self.address_uint42.replaceGet(keyAddress, valueUint42), address_uint256: self.address_uint256.replaceGet(keyAddress, valueUint256), address_coins: self.address_coins.replaceGet(keyAddress, valueCoins), - address_bool: self.address_bool.replaceGet(keyAddress, valueBool), - address_cell: self.address_cell.replaceGet(keyAddress, valueCell), - address_address: self.address_address.replaceGet(keyAddress, valueAddress), - address_struct: self.address_struct.replaceGet(keyAddress, valueStruct) }; } @@ -1745,10 +1277,6 @@ contract MapTestContract { int_uint42: self.int_uint42.exists(keyInt), int_uint256: self.int_uint256.exists(keyInt), int_coins: self.int_coins.exists(keyInt), - int_bool: self.int_bool.exists(keyInt), - int_cell: self.int_cell.exists(keyInt), - int_address: self.int_address.exists(keyInt), - int_struct: self.int_struct.exists(keyInt), int8_int: self.int8_int.exists(keyInt8), int8_int8: self.int8_int8.exists(keyInt8), @@ -1758,10 +1286,6 @@ contract MapTestContract { int8_uint42: self.int8_uint42.exists(keyInt8), int8_uint256: self.int8_uint256.exists(keyInt8), int8_coins: self.int8_coins.exists(keyInt8), - int8_bool: self.int8_bool.exists(keyInt8), - int8_cell: self.int8_cell.exists(keyInt8), - int8_address: self.int8_address.exists(keyInt8), - int8_struct: self.int8_struct.exists(keyInt8), int42_int: self.int42_int.exists(keyInt42), int42_int8: self.int42_int8.exists(keyInt42), @@ -1771,10 +1295,6 @@ contract MapTestContract { int42_uint42: self.int42_uint42.exists(keyInt42), int42_uint256: self.int42_uint256.exists(keyInt42), int42_coins: self.int42_coins.exists(keyInt42), - int42_bool: self.int42_bool.exists(keyInt42), - int42_cell: self.int42_cell.exists(keyInt42), - int42_address: self.int42_address.exists(keyInt42), - int42_struct: self.int42_struct.exists(keyInt42), int256_int: self.int256_int.exists(keyInt256), int256_int8: self.int256_int8.exists(keyInt256), @@ -1784,10 +1304,6 @@ contract MapTestContract { int256_uint42: self.int256_uint42.exists(keyInt256), int256_uint256: self.int256_uint256.exists(keyInt256), int256_coins: self.int256_coins.exists(keyInt256), - int256_bool: self.int256_bool.exists(keyInt256), - int256_cell: self.int256_cell.exists(keyInt256), - int256_address: self.int256_address.exists(keyInt256), - int256_struct: self.int256_struct.exists(keyInt256), uint8_int: self.uint8_int.exists(keyUint8), uint8_int8: self.uint8_int8.exists(keyUint8), @@ -1797,10 +1313,6 @@ contract MapTestContract { uint8_uint42: self.uint8_uint42.exists(keyUint8), uint8_uint256: self.uint8_uint256.exists(keyUint8), uint8_coins: self.uint8_coins.exists(keyUint8), - uint8_bool: self.uint8_bool.exists(keyUint8), - uint8_cell: self.uint8_cell.exists(keyUint8), - uint8_address: self.uint8_address.exists(keyUint8), - uint8_struct: self.uint8_struct.exists(keyUint8), uint42_int: self.uint42_int.exists(keyUint42), uint42_int8: self.uint42_int8.exists(keyUint42), @@ -1810,10 +1322,6 @@ contract MapTestContract { uint42_uint42: self.uint42_uint42.exists(keyUint42), uint42_uint256: self.uint42_uint256.exists(keyUint42), uint42_coins: self.uint42_coins.exists(keyUint42), - uint42_bool: self.uint42_bool.exists(keyUint42), - uint42_cell: self.uint42_cell.exists(keyUint42), - uint42_address: self.uint42_address.exists(keyUint42), - uint42_struct: self.uint42_struct.exists(keyUint42), uint256_int: self.uint256_int.exists(keyUint256), uint256_int8: self.uint256_int8.exists(keyUint256), @@ -1823,10 +1331,6 @@ contract MapTestContract { uint256_uint42: self.uint256_uint42.exists(keyUint256), uint256_uint256: self.uint256_uint256.exists(keyUint256), uint256_coins: self.uint256_coins.exists(keyUint256), - uint256_bool: self.uint256_bool.exists(keyUint256), - uint256_cell: self.uint256_cell.exists(keyUint256), - uint256_address: self.uint256_address.exists(keyUint256), - uint256_struct: self.uint256_struct.exists(keyUint256), // Address Key Maps address_int: self.address_int.exists(keyAddress), @@ -1837,10 +1341,6 @@ contract MapTestContract { address_uint42: self.address_uint42.exists(keyAddress), address_uint256: self.address_uint256.exists(keyAddress), address_coins: self.address_coins.exists(keyAddress), - address_bool: self.address_bool.exists(keyAddress), - address_cell: self.address_cell.exists(keyAddress), - address_address: self.address_address.exists(keyAddress), - address_struct: self.address_struct.exists(keyAddress) }; } @@ -1855,10 +1355,6 @@ contract MapTestContract { int_uint42: self.int_uint42.isEmpty(), int_uint256: self.int_uint256.isEmpty(), int_coins: self.int_coins.isEmpty(), - int_bool: self.int_bool.isEmpty(), - int_cell: self.int_cell.isEmpty(), - int_address: self.int_address.isEmpty(), - int_struct: self.int_struct.isEmpty(), int8_int: self.int8_int.isEmpty(), int8_int8: self.int8_int8.isEmpty(), @@ -1868,10 +1364,6 @@ contract MapTestContract { int8_uint42: self.int8_uint42.isEmpty(), int8_uint256: self.int8_uint256.isEmpty(), int8_coins: self.int8_coins.isEmpty(), - int8_bool: self.int8_bool.isEmpty(), - int8_cell: self.int8_cell.isEmpty(), - int8_address: self.int8_address.isEmpty(), - int8_struct: self.int8_struct.isEmpty(), int42_int: self.int42_int.isEmpty(), int42_int8: self.int42_int8.isEmpty(), @@ -1881,10 +1373,6 @@ contract MapTestContract { int42_uint42: self.int42_uint42.isEmpty(), int42_uint256: self.int42_uint256.isEmpty(), int42_coins: self.int42_coins.isEmpty(), - int42_bool: self.int42_bool.isEmpty(), - int42_cell: self.int42_cell.isEmpty(), - int42_address: self.int42_address.isEmpty(), - int42_struct: self.int42_struct.isEmpty(), int256_int: self.int256_int.isEmpty(), int256_int8: self.int256_int8.isEmpty(), @@ -1894,10 +1382,6 @@ contract MapTestContract { int256_uint42: self.int256_uint42.isEmpty(), int256_uint256: self.int256_uint256.isEmpty(), int256_coins: self.int256_coins.isEmpty(), - int256_bool: self.int256_bool.isEmpty(), - int256_cell: self.int256_cell.isEmpty(), - int256_address: self.int256_address.isEmpty(), - int256_struct: self.int256_struct.isEmpty(), uint8_int: self.uint8_int.isEmpty(), uint8_int8: self.uint8_int8.isEmpty(), @@ -1907,10 +1391,6 @@ contract MapTestContract { uint8_uint42: self.uint8_uint42.isEmpty(), uint8_uint256: self.uint8_uint256.isEmpty(), uint8_coins: self.uint8_coins.isEmpty(), - uint8_bool: self.uint8_bool.isEmpty(), - uint8_cell: self.uint8_cell.isEmpty(), - uint8_address: self.uint8_address.isEmpty(), - uint8_struct: self.uint8_struct.isEmpty(), uint42_int: self.uint42_int.isEmpty(), uint42_int8: self.uint42_int8.isEmpty(), @@ -1920,10 +1400,6 @@ contract MapTestContract { uint42_uint42: self.uint42_uint42.isEmpty(), uint42_uint256: self.uint42_uint256.isEmpty(), uint42_coins: self.uint42_coins.isEmpty(), - uint42_bool: self.uint42_bool.isEmpty(), - uint42_cell: self.uint42_cell.isEmpty(), - uint42_address: self.uint42_address.isEmpty(), - uint42_struct: self.uint42_struct.isEmpty(), uint256_int: self.uint256_int.isEmpty(), uint256_int8: self.uint256_int8.isEmpty(), @@ -1933,10 +1409,6 @@ contract MapTestContract { uint256_uint42: self.uint256_uint42.isEmpty(), uint256_uint256: self.uint256_uint256.isEmpty(), uint256_coins: self.uint256_coins.isEmpty(), - uint256_bool: self.uint256_bool.isEmpty(), - uint256_cell: self.uint256_cell.isEmpty(), - uint256_address: self.uint256_address.isEmpty(), - uint256_struct: self.uint256_struct.isEmpty(), // Address Key Maps address_int: self.address_int.isEmpty(), @@ -1947,10 +1419,6 @@ contract MapTestContract { address_uint42: self.address_uint42.isEmpty(), address_uint256: self.address_uint256.isEmpty(), address_coins: self.address_coins.isEmpty(), - address_bool: self.address_bool.isEmpty(), - address_cell: self.address_cell.isEmpty(), - address_address: self.address_address.isEmpty(), - address_struct: self.address_struct.isEmpty() }; } @@ -1965,10 +1433,6 @@ contract MapTestContract { int_uint42: self.int_uint42.asCell(), int_uint256: self.int_uint256.asCell(), int_coins: self.int_coins.asCell(), - int_bool: self.int_bool.asCell(), - int_cell: self.int_cell.asCell(), - int_address: self.int_address.asCell(), - int_struct: self.int_struct.asCell(), int8_int: self.int8_int.asCell(), int8_int8: self.int8_int8.asCell(), @@ -1978,10 +1442,6 @@ contract MapTestContract { int8_uint42: self.int8_uint42.asCell(), int8_uint256: self.int8_uint256.asCell(), int8_coins: self.int8_coins.asCell(), - int8_bool: self.int8_bool.asCell(), - int8_cell: self.int8_cell.asCell(), - int8_address: self.int8_address.asCell(), - int8_struct: self.int8_struct.asCell(), int42_int: self.int42_int.asCell(), int42_int8: self.int42_int8.asCell(), @@ -1991,10 +1451,6 @@ contract MapTestContract { int42_uint42: self.int42_uint42.asCell(), int42_uint256: self.int42_uint256.asCell(), int42_coins: self.int42_coins.asCell(), - int42_bool: self.int42_bool.asCell(), - int42_cell: self.int42_cell.asCell(), - int42_address: self.int42_address.asCell(), - int42_struct: self.int42_struct.asCell(), int256_int: self.int256_int.asCell(), int256_int8: self.int256_int8.asCell(), @@ -2004,10 +1460,6 @@ contract MapTestContract { int256_uint42: self.int256_uint42.asCell(), int256_uint256: self.int256_uint256.asCell(), int256_coins: self.int256_coins.asCell(), - int256_bool: self.int256_bool.asCell(), - int256_cell: self.int256_cell.asCell(), - int256_address: self.int256_address.asCell(), - int256_struct: self.int256_struct.asCell(), uint8_int: self.uint8_int.asCell(), uint8_int8: self.uint8_int8.asCell(), @@ -2017,10 +1469,6 @@ contract MapTestContract { uint8_uint42: self.uint8_uint42.asCell(), uint8_uint256: self.uint8_uint256.asCell(), uint8_coins: self.uint8_coins.asCell(), - uint8_bool: self.uint8_bool.asCell(), - uint8_cell: self.uint8_cell.asCell(), - uint8_address: self.uint8_address.asCell(), - uint8_struct: self.uint8_struct.asCell(), uint42_int: self.uint42_int.asCell(), uint42_int8: self.uint42_int8.asCell(), @@ -2030,10 +1478,6 @@ contract MapTestContract { uint42_uint42: self.uint42_uint42.asCell(), uint42_uint256: self.uint42_uint256.asCell(), uint42_coins: self.uint42_coins.asCell(), - uint42_bool: self.uint42_bool.asCell(), - uint42_cell: self.uint42_cell.asCell(), - uint42_address: self.uint42_address.asCell(), - uint42_struct: self.uint42_struct.asCell(), uint256_int: self.uint256_int.asCell(), uint256_int8: self.uint256_int8.asCell(), @@ -2043,10 +1487,6 @@ contract MapTestContract { uint256_uint42: self.uint256_uint42.asCell(), uint256_uint256: self.uint256_uint256.asCell(), uint256_coins: self.uint256_coins.asCell(), - uint256_bool: self.uint256_bool.asCell(), - uint256_cell: self.uint256_cell.asCell(), - uint256_address: self.uint256_address.asCell(), - uint256_struct: self.uint256_struct.asCell(), // Address Key Maps address_int: self.address_int.asCell(), @@ -2057,10 +1497,6 @@ contract MapTestContract { address_uint42: self.address_uint42.asCell(), address_uint256: self.address_uint256.asCell(), address_coins: self.address_coins.asCell(), - address_bool: self.address_bool.asCell(), - address_cell: self.address_cell.asCell(), - address_address: self.address_address.asCell(), - address_struct: self.address_struct.asCell() }; } diff --git a/src/test/e2e-emulated/contracts/structs.tact b/src/test/e2e-emulated/contracts/structs.tact index af10237e5..75f538ff6 100644 --- a/src/test/e2e-emulated/contracts/structs.tact +++ b/src/test/e2e-emulated/contracts/structs.tact @@ -35,6 +35,13 @@ struct Coin { second: Int as uint32; } +struct VarIntegers { + a: Int as varint16; + b: Int as varint32; + c: Int as varuint16; + d: Int as varuint32; +} + struct IntFields { i1: Int as int1; i2: Int as int2; @@ -57,6 +64,10 @@ fun directParse(payload: Cell): Coin { return Coin.fromCell(payload); } +fun directParseVarIntegers(payload: Cell): VarIntegers { + return VarIntegers.fromCell(payload); +} + struct LongStruct15 { x1: Int; x2: Int; @@ -484,6 +495,21 @@ contract StructsTester { dump(coin.second); } + receive("exampleVarIntegers") { + let varInts = directParseVarIntegers( + beginCell() + .storeVarInt16(1) + .storeVarInt32(2) + .storeVarUint16(3) + .storeVarUint32(4) + .endCell() + ); + dump(varInts.a); + dump(varInts.b); + dump(varInts.c); + dump(varInts.d); + } + get fun longStruct15Test(): LongStruct15 { let s = LongStruct15 { x1: 1, diff --git a/src/test/e2e-emulated/map-traverse.spec.ts b/src/test/e2e-emulated/map-traverse.spec.ts index 14e139ad3..a2338dba8 100644 --- a/src/test/e2e-emulated/map-traverse.spec.ts +++ b/src/test/e2e-emulated/map-traverse.spec.ts @@ -34,12 +34,16 @@ describe("map-traversal", () => { it("should implement map traversal correctly", async () => { // Check methods expect(await contract.getTestIntInt()).toEqual(1010n); + expect(await contract.getTestIntCoins()).toEqual(1010n); + expect(await contract.getTestIntVarint16()).toEqual(1010n); expect(await contract.getTestIntBool()).toEqual(12n); expect(await contract.getTestIntCell()).toEqual(1010n); expect(await contract.getTestIntAddress()).toEqual(28n); expect(await contract.getTestIntStruct()).toEqual(1010n); expect(await contract.getTestAddressInt()).toEqual(1018n); + expect(await contract.getTestAddressCoins()).toEqual(1018n); + expect(await contract.getTestAddressVarint16()).toEqual(1018n); expect(await contract.getTestAddressBool()).toEqual(20n); expect(await contract.getTestAddressCell()).toEqual(1018n); expect(await contract.getTestAddressAddress()).toEqual(26n); diff --git a/src/test/e2e-emulated/map.spec.ts b/src/test/e2e-emulated/map1.spec.ts similarity index 85% rename from src/test/e2e-emulated/map.spec.ts rename to src/test/e2e-emulated/map1.spec.ts index 245196f1e..d7a0d600e 100644 --- a/src/test/e2e-emulated/map.spec.ts +++ b/src/test/e2e-emulated/map1.spec.ts @@ -9,7 +9,7 @@ import { SomeStruct, ReplaceAllMaps, ReplaceGetAllMaps, -} from "./contracts/output/maps_MapTestContract"; +} from "./contracts/output/maps1_MapTestContract"; import { Blockchain, SandboxContract, TreasuryContract } from "@ton/sandbox"; import { Address, beginCell, Cell, Dictionary, toNano } from "@ton/core"; import "@ton/test-utils"; @@ -58,14 +58,10 @@ type TestKeys = { }; type TestValues = { - valueInt: bigint; - valueInt8: bigint; - valueInt42: bigint; - valueInt256: bigint; - valueUint8: bigint; - valueUint42: bigint; - valueUint256: bigint; - valueCoins: bigint; + valueVarint16: bigint; + valueVarint32: bigint; + valueVaruint16: bigint; + valueVaruint32: bigint; valueBool: boolean; valueCell: Cell; valueAddress: Address; @@ -99,14 +95,10 @@ const testCases: TestCase[] = [ keyAddress: randomAddress(0, "address0"), }, values: { - valueInt: 999n, - valueInt8: -128n, - valueInt42: 123_456n, - valueInt256: 789n, - valueUint8: 255n, - valueUint42: 123_456_789n, - valueUint256: 999_999_999_999n, - valueCoins: 100_000_000n, + valueVarint16: 123n, + valueVarint32: 123_456n, + valueVaruint16: 255n, + valueVaruint32: 123_456_789n, valueBool: true, valueCell: beginCell().storeUint(42, 32).endCell(), valueAddress: randomAddress(0, "address"), @@ -132,14 +124,10 @@ const testCases: TestCase[] = [ keyAddress: randomAddress(0, "address1"), }, values: { - valueInt: 2n ** 31n - 1n, // Max 32-bit signed int - valueInt8: 127n, // Max 8-bit signed int - valueInt42: 2n ** 41n - 1n, // Max 42-bit signed int - valueInt256: 2n ** 255n - 1n, // Max 256-bit signed int - valueUint8: 0n, // Min unsigned int - valueUint42: 0n, // Min unsigned int - valueUint256: 0n, // Min unsigned int - valueCoins: 0n, + valueVarint16: -(2n ** 118n), // Min VarInt16 + valueVarint32: -(2n ** 246n), // Min VarInt32 + valueVaruint16: 2n ** 120n - 1n, // Max VarUint16 + valueVaruint32: 2n ** 248n - 1n, // Max VarUint32 valueBool: false, valueCell: beginCell() .storeUint(2n ** 32n - 1n, 32) @@ -167,14 +155,10 @@ const testCases: TestCase[] = [ keyAddress: randomAddress(0, "address2"), }, values: { - valueInt: 1n, - valueInt8: -1n, - valueInt42: -1n, - valueInt256: 1n, - valueUint8: 1n, - valueUint42: 1n, - valueUint256: 1n, - valueCoins: 1n, + valueVarint16: -1n, + valueVarint32: -1n, + valueVaruint16: 1n, + valueVaruint32: 1n, valueBool: false, valueCell: beginCell().storeUint(0, 32).endCell(), valueAddress: randomAddress(0, "address"), @@ -200,14 +184,10 @@ const testCases: TestCase[] = [ keyAddress: randomAddress(0, "address3"), }, values: { - valueInt: -1n, - valueInt8: -127n, // Near min but not quite - valueInt42: 2n ** 40n, // Large power of 2 - valueInt256: -(2n ** 254n), // Large negative power of 2 - valueUint8: 128n, // Middle value - valueUint42: 2n ** 41n, // Large power of 2 - valueUint256: 2n ** 255n, // Large power of 2 - valueCoins: 2n ** 120n - 1n, + valueVarint16: 2n ** 41n, + valueVarint32: -(2n ** 123n), + valueVaruint16: 2n ** 41n, + valueVaruint32: 2n ** 123n, valueBool: true, valueCell: beginCell() .storeUint(2n ** 31n, 32) @@ -228,23 +208,10 @@ const testCases: TestCase[] = [ // Define all 88 map configurations const mapConfigs: MapConfig[] = [ // int_* Maps - { mapName: "int_int", key: "keyInt", value: "valueInt" }, - { - mapName: "int_int8", - key: "keyInt", - value: "valueInt8", - valueTransform: (v: bigint) => Number(v), - }, - { mapName: "int_int42", key: "keyInt", value: "valueInt42" }, - { mapName: "int_int256", key: "keyInt", value: "valueInt256" }, - { - mapName: "int_uint8", - key: "keyInt", - value: "valueUint8", - valueTransform: (v: bigint) => Number(v), - }, - { mapName: "int_uint42", key: "keyInt", value: "valueUint42" }, - { mapName: "int_uint256", key: "keyInt", value: "valueUint256" }, + { mapName: "int_varint16", key: "keyInt", value: "valueVarint16" }, + { mapName: "int_varint32", key: "keyInt", value: "valueVarint32" }, + { mapName: "int_varuint16", key: "keyInt", value: "valueVaruint16" }, + { mapName: "int_varuint32", key: "keyInt", value: "valueVaruint32" }, { mapName: "int_bool", key: "keyInt", value: "valueBool" }, { mapName: "int_cell", key: "keyInt", value: "valueCell" }, { mapName: "int_address", key: "keyInt", value: "valueAddress" }, @@ -252,47 +219,27 @@ const mapConfigs: MapConfig[] = [ // int8_* Maps { - mapName: "int8_int", - key: "keyInt8", - value: "valueInt", - keyTransform: (k: bigint) => Number(k), - }, - { - mapName: "int8_int8", - key: "keyInt8", - value: "valueInt8", - keyTransform: (k: bigint) => Number(k), - valueTransform: (v: bigint) => Number(v), - }, - { - mapName: "int8_int42", - key: "keyInt8", - value: "valueInt42", - keyTransform: (k: bigint) => Number(k), - }, - { - mapName: "int8_int256", + mapName: "int8_varint16", key: "keyInt8", - value: "valueInt256", + value: "valueVarint16", keyTransform: (k: bigint) => Number(k), }, { - mapName: "int8_uint8", + mapName: "int8_varint32", key: "keyInt8", - value: "valueUint8", + value: "valueVarint32", keyTransform: (k: bigint) => Number(k), - valueTransform: (v: bigint) => Number(v), }, { - mapName: "int8_uint42", + mapName: "int8_varuint16", key: "keyInt8", - value: "valueUint42", + value: "valueVaruint16", keyTransform: (k: bigint) => Number(k), }, { - mapName: "int8_uint256", + mapName: "int8_varuint32", key: "keyInt8", - value: "valueUint256", + value: "valueVaruint32", keyTransform: (k: bigint) => Number(k), }, { @@ -321,46 +268,20 @@ const mapConfigs: MapConfig[] = [ }, // int42_* Maps - { mapName: "int42_int", key: "keyInt42", value: "valueInt" }, - { - mapName: "int42_int8", - key: "keyInt42", - value: "valueInt8", - valueTransform: (v: bigint) => Number(v), - }, - { mapName: "int42_int42", key: "keyInt42", value: "valueInt42" }, - { mapName: "int42_int256", key: "keyInt42", value: "valueInt256" }, - { - mapName: "int42_uint8", - key: "keyInt42", - value: "valueUint8", - valueTransform: (v: bigint) => Number(v), - }, - { mapName: "int42_uint42", key: "keyInt42", value: "valueUint42" }, - { mapName: "int42_uint256", key: "keyInt42", value: "valueUint256" }, + { mapName: "int42_varint16", key: "keyInt42", value: "valueVarint16" }, + { mapName: "int42_varint32", key: "keyInt42", value: "valueVarint32" }, + { mapName: "int42_varuint16", key: "keyInt42", value: "valueVaruint16" }, + { mapName: "int42_varuint32", key: "keyInt42", value: "valueVaruint32" }, { mapName: "int42_bool", key: "keyInt42", value: "valueBool" }, { mapName: "int42_cell", key: "keyInt42", value: "valueCell" }, { mapName: "int42_address", key: "keyInt42", value: "valueAddress" }, { mapName: "int42_struct", key: "keyInt42", value: "valueStruct" }, // int256_* Maps - { mapName: "int256_int", key: "keyInt256", value: "valueInt" }, - { - mapName: "int256_int8", - key: "keyInt256", - value: "valueInt8", - valueTransform: (v: bigint) => Number(v), - }, - { mapName: "int256_int42", key: "keyInt256", value: "valueInt42" }, - { mapName: "int256_int256", key: "keyInt256", value: "valueInt256" }, - { - mapName: "int256_uint8", - key: "keyInt256", - value: "valueUint8", - valueTransform: (v: bigint) => Number(v), - }, - { mapName: "int256_uint42", key: "keyInt256", value: "valueUint42" }, - { mapName: "int256_uint256", key: "keyInt256", value: "valueUint256" }, + { mapName: "int256_varint16", key: "keyInt256", value: "valueVarint16" }, + { mapName: "int256_varint32", key: "keyInt256", value: "valueVarint32" }, + { mapName: "int256_varuint16", key: "keyInt256", value: "valueVaruint16" }, + { mapName: "int256_varuint32", key: "keyInt256", value: "valueVaruint32" }, { mapName: "int256_bool", key: "keyInt256", value: "valueBool" }, { mapName: "int256_cell", key: "keyInt256", value: "valueCell" }, { mapName: "int256_address", key: "keyInt256", value: "valueAddress" }, @@ -368,47 +289,27 @@ const mapConfigs: MapConfig[] = [ // uint8_* Maps { - mapName: "uint8_int", - key: "keyUint8", - value: "valueInt", - keyTransform: (k: bigint) => Number(k), - }, - { - mapName: "uint8_int8", - key: "keyUint8", - value: "valueInt8", - keyTransform: (k: bigint) => Number(k), - valueTransform: (v: bigint) => Number(v), - }, - { - mapName: "uint8_int42", - key: "keyUint8", - value: "valueInt42", - keyTransform: (k: bigint) => Number(k), - }, - { - mapName: "uint8_int256", + mapName: "uint8_varint16", key: "keyUint8", - value: "valueInt256", + value: "valueVarint16", keyTransform: (k: bigint) => Number(k), }, { - mapName: "uint8_uint8", + mapName: "uint8_varint32", key: "keyUint8", - value: "valueUint8", + value: "valueVarint32", keyTransform: (k: bigint) => Number(k), - valueTransform: (v: bigint) => Number(v), }, { - mapName: "uint8_uint42", + mapName: "uint8_varuint16", key: "keyUint8", - value: "valueUint42", + value: "valueVaruint16", keyTransform: (k: bigint) => Number(k), }, { - mapName: "uint8_uint256", + mapName: "uint8_varuint32", key: "keyUint8", - value: "valueUint256", + value: "valueVaruint32", keyTransform: (k: bigint) => Number(k), }, { @@ -437,69 +338,46 @@ const mapConfigs: MapConfig[] = [ }, // uint42_* Maps - { mapName: "uint42_int", key: "keyUint42", value: "valueInt" }, - { - mapName: "uint42_int8", - key: "keyUint42", - value: "valueInt8", - valueTransform: (v: bigint) => Number(v), - }, - { mapName: "uint42_int42", key: "keyUint42", value: "valueInt42" }, - { mapName: "uint42_int256", key: "keyUint42", value: "valueInt256" }, - { - mapName: "uint42_uint8", - key: "keyUint42", - value: "valueUint8", - valueTransform: (v: bigint) => Number(v), - }, - { mapName: "uint42_uint42", key: "keyUint42", value: "valueUint42" }, - { mapName: "uint42_uint256", key: "keyUint42", value: "valueUint256" }, + { mapName: "uint42_varint16", key: "keyUint42", value: "valueVarint16" }, + { mapName: "uint42_varint32", key: "keyUint42", value: "valueVarint32" }, + { mapName: "uint42_varuint16", key: "keyUint42", value: "valueVaruint16" }, + { mapName: "uint42_varuint32", key: "keyUint42", value: "valueVaruint32" }, { mapName: "uint42_bool", key: "keyUint42", value: "valueBool" }, { mapName: "uint42_cell", key: "keyUint42", value: "valueCell" }, { mapName: "uint42_address", key: "keyUint42", value: "valueAddress" }, { mapName: "uint42_struct", key: "keyUint42", value: "valueStruct" }, // uint256_* Maps - { mapName: "uint256_int", key: "keyUint256", value: "valueInt" }, + { mapName: "uint256_varint16", key: "keyUint256", value: "valueVarint16" }, + { mapName: "uint256_varint32", key: "keyUint256", value: "valueVarint32" }, { - mapName: "uint256_int8", + mapName: "uint256_varuint16", key: "keyUint256", - value: "valueInt8", - valueTransform: (v: bigint) => Number(v), + value: "valueVaruint16", }, - { mapName: "uint256_int42", key: "keyUint256", value: "valueInt42" }, - { mapName: "uint256_int256", key: "keyUint256", value: "valueInt256" }, { - mapName: "uint256_uint8", + mapName: "uint256_varuint32", key: "keyUint256", - value: "valueUint8", - valueTransform: (v: bigint) => Number(v), + value: "valueVaruint32", }, - { mapName: "uint256_uint42", key: "keyUint256", value: "valueUint42" }, - { mapName: "uint256_uint256", key: "keyUint256", value: "valueUint256" }, { mapName: "uint256_bool", key: "keyUint256", value: "valueBool" }, { mapName: "uint256_cell", key: "keyUint256", value: "valueCell" }, { mapName: "uint256_address", key: "keyUint256", value: "valueAddress" }, { mapName: "uint256_struct", key: "keyUint256", value: "valueStruct" }, // address_* Maps - { mapName: "address_int", key: "keyAddress", value: "valueInt" }, + { mapName: "address_varint16", key: "keyAddress", value: "valueVarint16" }, + { mapName: "address_varint32", key: "keyAddress", value: "valueVarint32" }, { - mapName: "address_int8", + mapName: "address_varuint16", key: "keyAddress", - value: "valueInt8", - valueTransform: (v: bigint) => Number(v), + value: "valueVaruint16", }, - { mapName: "address_int42", key: "keyAddress", value: "valueInt42" }, - { mapName: "address_int256", key: "keyAddress", value: "valueInt256" }, { - mapName: "address_uint8", + mapName: "address_varuint32", key: "keyAddress", - value: "valueUint8", - valueTransform: (v: bigint) => Number(v), + value: "valueVaruint32", }, - { mapName: "address_uint42", key: "keyAddress", value: "valueUint42" }, - { mapName: "address_uint256", key: "keyAddress", value: "valueUint256" }, { mapName: "address_bool", key: "keyAddress", value: "valueBool" }, { mapName: "address_cell", key: "keyAddress", value: "valueCell" }, { mapName: "address_address", key: "keyAddress", value: "valueAddress" }, @@ -589,14 +467,10 @@ describe("MapTestContract", () => { const clearMessage: SetAllMaps = { $$type: "SetAllMaps", ...keys, - valueInt: null, - valueInt8: null, - valueInt42: null, - valueInt256: null, - valueUint8: null, - valueUint42: null, - valueUint256: null, - valueCoins: null, + valueVarint16: null, + valueVarint32: null, + valueVaruint16: null, + valueVaruint32: null, valueBool: null, valueCell: null, valueAddress: null, @@ -679,14 +553,10 @@ describe("MapTestContract", () => { const clearMessage: SetAllMaps = { $$type: "SetAllMaps", ...keys, - valueInt: null, - valueInt8: null, - valueInt42: null, - valueInt256: null, - valueUint8: null, - valueUint42: null, - valueUint256: null, - valueCoins: null, + valueVarint16: null, + valueVarint32: null, + valueVaruint16: null, + valueVaruint32: null, valueBool: null, valueCell: null, valueAddress: null, @@ -767,14 +637,10 @@ describe("MapTestContract", () => { const clearMessage: SetAllMaps = { $$type: "SetAllMaps", ...keys, - valueInt: null, - valueInt8: null, - valueInt42: null, - valueInt256: null, - valueUint8: null, - valueUint42: null, - valueUint256: null, - valueCoins: null, + valueVarint16: null, + valueVarint32: null, + valueVaruint16: null, + valueVaruint32: null, valueBool: null, valueCell: null, valueAddress: null, @@ -863,14 +729,10 @@ describe("MapTestContract", () => { const clearMessage: SetAllMaps = { $$type: "SetAllMaps", ...keys, - valueInt: null, - valueInt8: null, - valueInt42: null, - valueInt256: null, - valueUint8: null, - valueUint42: null, - valueUint256: null, - valueCoins: null, + valueVarint16: null, + valueVarint32: null, + valueVaruint16: null, + valueVaruint32: null, valueBool: null, valueCell: null, valueAddress: null, @@ -1506,14 +1368,10 @@ describe("MapTestContract", () => { const clearMessage: SetAllMaps = { $$type: "SetAllMaps", ...keys, - valueInt: null, - valueInt8: null, - valueInt42: null, - valueInt256: null, - valueUint8: null, - valueUint42: null, - valueUint256: null, - valueCoins: null, + valueVarint16: null, + valueVarint32: null, + valueVaruint16: null, + valueVaruint32: null, valueBool: null, valueCell: null, valueAddress: null, @@ -1581,14 +1439,10 @@ describe("MapTestContract", () => { const clearMessage: SetAllMaps = { $$type: "SetAllMaps", ...keys, - valueInt: null, - valueInt8: null, - valueInt42: null, - valueInt256: null, - valueUint8: null, - valueUint42: null, - valueUint256: null, - valueCoins: null, + valueVarint16: null, + valueVarint32: null, + valueVaruint16: null, + valueVaruint32: null, valueBool: null, valueCell: null, valueAddress: null, @@ -1611,7 +1465,7 @@ describe("MapTestContract", () => { } }); - it("asCell: should correctly serialize and deserialize maps", async () => { + it.only("asCell: should correctly serialize and deserialize maps", async () => { for (const { keys, values } of testCases) { // Set values for the current test case const setMessage: SetAllMaps = { @@ -1676,14 +1530,10 @@ describe("MapTestContract", () => { const clearMessage: SetAllMaps = { $$type: "SetAllMaps", ...keys, - valueInt: null, - valueInt8: null, - valueInt42: null, - valueInt256: null, - valueUint8: null, - valueUint42: null, - valueUint256: null, - valueCoins: null, + valueVarint16: null, + valueVarint32: null, + valueVaruint16: null, + valueVaruint32: null, valueBool: null, valueCell: null, valueAddress: null, @@ -1769,14 +1619,10 @@ describe("MapTestContract", () => { const clearMessage: ReplaceAllMaps = { $$type: "ReplaceAllMaps", ...keys, - valueInt: null, - valueInt8: null, - valueInt42: null, - valueInt256: null, - valueUint8: null, - valueUint42: null, - valueUint256: null, - valueCoins: null, + valueVarint16: null, + valueVarint32: null, + valueVaruint16: null, + valueVaruint32: null, valueBool: null, valueCell: null, valueAddress: null, @@ -1836,14 +1682,10 @@ describe("MapTestContract", () => { keys.keyUint42, keys.keyUint256, keys.keyAddress, - values.valueInt, - values.valueInt8, - values.valueInt42, - values.valueInt256, - values.valueUint8, - values.valueUint42, - values.valueUint256, - values.valueCoins, + values.valueVarint16, + values.valueVarint32, + values.valueVaruint16, + values.valueVaruint32, values.valueBool, values.valueCell, values.valueAddress, @@ -1880,14 +1722,10 @@ describe("MapTestContract", () => { keys.keyUint42, keys.keyUint256, keys.keyAddress, - values.valueInt, - values.valueInt8, - values.valueInt42, - values.valueInt256, - values.valueUint8, - values.valueUint42, - values.valueUint256, - values.valueCoins, + values.valueVarint16, + values.valueVarint32, + values.valueVaruint16, + values.valueVaruint32, values.valueBool, values.valueCell, values.valueAddress, @@ -1974,14 +1812,10 @@ describe("MapTestContract", () => { const clearMessage: ReplaceGetAllMaps = { $$type: "ReplaceGetAllMaps", ...keys, - valueInt: null, - valueInt8: null, - valueInt42: null, - valueInt256: null, - valueUint8: null, - valueUint42: null, - valueUint256: null, - valueCoins: null, + valueVarint16: null, + valueVarint32: null, + valueVaruint16: null, + valueVaruint32: null, valueBool: null, valueCell: null, valueAddress: null, @@ -2041,14 +1875,10 @@ describe("MapTestContract", () => { keys.keyUint42, keys.keyUint256, keys.keyAddress, - values.valueInt, - values.valueInt8, - values.valueInt42, - values.valueInt256, - values.valueUint8, - values.valueUint42, - values.valueUint256, - values.valueCoins, + values.valueVarint16, + values.valueVarint32, + values.valueVaruint16, + values.valueVaruint32, values.valueBool, values.valueCell, values.valueAddress, @@ -2086,14 +1916,10 @@ describe("MapTestContract", () => { keys.keyUint42, keys.keyUint256, keys.keyAddress, - values.valueInt, - values.valueInt8, - values.valueInt42, - values.valueInt256, - values.valueUint8, - values.valueUint42, - values.valueUint256, - values.valueCoins, + values.valueVarint16, + values.valueVarint32, + values.valueVaruint16, + values.valueVaruint32, values.valueBool, values.valueCell, values.valueAddress, diff --git a/src/test/e2e-emulated/map2.spec.ts b/src/test/e2e-emulated/map2.spec.ts new file mode 100644 index 000000000..c5375a3d6 --- /dev/null +++ b/src/test/e2e-emulated/map2.spec.ts @@ -0,0 +1,1818 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ + +import { randomAddress } from "../utils/randomAddress"; +import { + MapTestContract, + MapTestContract$Data, + SetAllMaps, + DelAllMaps, + ReplaceAllMaps, + ReplaceGetAllMaps, +} from "./contracts/output/maps2_MapTestContract"; +import { Blockchain, SandboxContract, TreasuryContract } from "@ton/sandbox"; +import { Address, beginCell, Dictionary, toNano } from "@ton/core"; +import "@ton/test-utils"; + +// Type definitions for keys and values to make them type-safe +type TestKeys = { + keyInt: bigint; + keyInt8: bigint; + keyInt42: bigint; + keyInt256: bigint; + keyUint8: bigint; + keyUint42: bigint; + keyUint256: bigint; + keyAddress: Address; +}; + +type TestValues = { + valueInt: bigint; + valueInt8: bigint; + valueInt42: bigint; + valueInt256: bigint; + valueUint8: bigint; + valueUint42: bigint; + valueUint256: bigint; + valueCoins: bigint; +}; + +// Configuration for all maps +type MapConfig = { + mapName: keyof MapTestContract$Data; + key: keyof TestKeys; + value: keyof TestValues; + keyTransform?: (key: any) => any; + valueTransform?: (value: any) => any; +}; + +type TestCase = { + keys: TestKeys; + values: TestValues; +}; + +const testCases: TestCase[] = [ + { + keys: { + keyInt: 123n, + keyInt8: -10n, + keyInt42: 42n, + keyInt256: 456n, + keyUint8: 200n, + keyUint42: 500_000n, + keyUint256: 1_000_000_000_000n, + keyAddress: randomAddress(0, "address0"), + }, + values: { + valueInt: 999n, + valueInt8: -128n, + valueInt42: 123_456n, + valueInt256: 789n, + valueUint8: 255n, + valueUint42: 123_456_789n, + valueUint256: 999_999_999_999n, + valueCoins: 100_000_000n, + }, + }, + { + keys: { + keyInt: -(2n ** 31n), // Min 32-bit signed int + keyInt8: -128n, // Min 8-bit signed int + keyInt42: -(2n ** 41n), // Min 42-bit signed int + keyInt256: -(2n ** 255n), // Min 256-bit signed int + keyUint8: 255n, // Max 8-bit unsigned int + keyUint42: 2n ** 42n - 1n, // Max 42-bit unsigned int + keyUint256: 2n ** 256n - 1n, // Max 256-bit unsigned int + keyAddress: randomAddress(0, "address1"), + }, + values: { + valueInt: 2n ** 31n - 1n, // Max 32-bit signed int + valueInt8: 127n, // Max 8-bit signed int + valueInt42: 2n ** 41n - 1n, // Max 42-bit signed int + valueInt256: 2n ** 255n - 1n, // Max 256-bit signed int + valueUint8: 0n, // Min unsigned int + valueUint42: 0n, // Min unsigned int + valueUint256: 0n, // Min unsigned int + valueCoins: 0n, + }, + }, + { + keys: { + keyInt: 0n, + keyInt8: 0n, + keyInt42: 0n, + keyInt256: 0n, + keyUint8: 0n, + keyUint42: 0n, + keyUint256: 0n, + keyAddress: randomAddress(0, "address2"), + }, + values: { + valueInt: 1n, + valueInt8: -1n, + valueInt42: -1n, + valueInt256: 1n, + valueUint8: 1n, + valueUint42: 1n, + valueUint256: 1n, + valueCoins: 1n, + }, + }, + { + keys: { + keyInt: 1n, + keyInt8: -1n, + keyInt42: 424n, + keyInt256: 2n ** 128n, // Large but not maximum value + keyUint8: 128n, // Middle value + keyUint42: 2n ** 41n, // Large power of 2 + keyUint256: 2n ** 128n, // Large power of 2 + keyAddress: randomAddress(0, "address3"), + }, + values: { + valueInt: -1n, + valueInt8: -127n, // Near min but not quite + valueInt42: 2n ** 40n, // Large power of 2 + valueInt256: -(2n ** 254n), // Large negative power of 2 + valueUint8: 128n, // Middle value + valueUint42: 2n ** 41n, // Large power of 2 + valueUint256: 2n ** 255n, // Large power of 2 + valueCoins: 2n ** 120n - 1n, + }, + }, +]; + +// Define all 88 map configurations +const mapConfigs: MapConfig[] = [ + // int_* Maps + { mapName: "int_int", key: "keyInt", value: "valueInt" }, + { + mapName: "int_int8", + key: "keyInt", + value: "valueInt8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "int_int42", key: "keyInt", value: "valueInt42" }, + { mapName: "int_int256", key: "keyInt", value: "valueInt256" }, + { + mapName: "int_uint8", + key: "keyInt", + value: "valueUint8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "int_uint42", key: "keyInt", value: "valueUint42" }, + { mapName: "int_uint256", key: "keyInt", value: "valueUint256" }, + { mapName: "int_coins", key: "keyInt", value: "valueCoins" }, + + // int8_* Maps + { + mapName: "int8_int", + key: "keyInt8", + value: "valueInt", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "int8_int8", + key: "keyInt8", + value: "valueInt8", + keyTransform: (k: bigint) => Number(k), + valueTransform: (v: bigint) => Number(v), + }, + { + mapName: "int8_int42", + key: "keyInt8", + value: "valueInt42", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "int8_int256", + key: "keyInt8", + value: "valueInt256", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "int8_uint8", + key: "keyInt8", + value: "valueUint8", + keyTransform: (k: bigint) => Number(k), + valueTransform: (v: bigint) => Number(v), + }, + { + mapName: "int8_uint42", + key: "keyInt8", + value: "valueUint42", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "int8_uint256", + key: "keyInt8", + value: "valueUint256", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "int8_coins", + key: "keyInt8", + value: "valueCoins", + keyTransform: (k: bigint) => Number(k), + }, + + // int42_* Maps + { mapName: "int42_int", key: "keyInt42", value: "valueInt" }, + { + mapName: "int42_int8", + key: "keyInt42", + value: "valueInt8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "int42_int42", key: "keyInt42", value: "valueInt42" }, + { mapName: "int42_int256", key: "keyInt42", value: "valueInt256" }, + { + mapName: "int42_uint8", + key: "keyInt42", + value: "valueUint8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "int42_uint42", key: "keyInt42", value: "valueUint42" }, + { mapName: "int42_uint256", key: "keyInt42", value: "valueUint256" }, + { mapName: "int42_coins", key: "keyInt42", value: "valueCoins" }, + + // int256_* Maps + { mapName: "int256_int", key: "keyInt256", value: "valueInt" }, + { + mapName: "int256_int8", + key: "keyInt256", + value: "valueInt8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "int256_int42", key: "keyInt256", value: "valueInt42" }, + { mapName: "int256_int256", key: "keyInt256", value: "valueInt256" }, + { + mapName: "int256_uint8", + key: "keyInt256", + value: "valueUint8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "int256_uint42", key: "keyInt256", value: "valueUint42" }, + { mapName: "int256_uint256", key: "keyInt256", value: "valueUint256" }, + { mapName: "int256_coins", key: "keyInt256", value: "valueCoins" }, + + // uint8_* Maps + { + mapName: "uint8_int", + key: "keyUint8", + value: "valueInt", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "uint8_int8", + key: "keyUint8", + value: "valueInt8", + keyTransform: (k: bigint) => Number(k), + valueTransform: (v: bigint) => Number(v), + }, + { + mapName: "uint8_int42", + key: "keyUint8", + value: "valueInt42", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "uint8_int256", + key: "keyUint8", + value: "valueInt256", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "uint8_uint8", + key: "keyUint8", + value: "valueUint8", + keyTransform: (k: bigint) => Number(k), + valueTransform: (v: bigint) => Number(v), + }, + { + mapName: "uint8_uint42", + key: "keyUint8", + value: "valueUint42", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "uint8_uint256", + key: "keyUint8", + value: "valueUint256", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "uint8_coins", + key: "keyUint8", + value: "valueCoins", + keyTransform: (k: bigint) => Number(k), + }, + + // uint42_* Maps + { mapName: "uint42_int", key: "keyUint42", value: "valueInt" }, + { + mapName: "uint42_int8", + key: "keyUint42", + value: "valueInt8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "uint42_int42", key: "keyUint42", value: "valueInt42" }, + { mapName: "uint42_int256", key: "keyUint42", value: "valueInt256" }, + { + mapName: "uint42_uint8", + key: "keyUint42", + value: "valueUint8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "uint42_uint42", key: "keyUint42", value: "valueUint42" }, + { mapName: "uint42_uint256", key: "keyUint42", value: "valueUint256" }, + { mapName: "uint42_coins", key: "keyUint42", value: "valueCoins" }, + + // uint256_* Maps + { mapName: "uint256_int", key: "keyUint256", value: "valueInt" }, + { + mapName: "uint256_int8", + key: "keyUint256", + value: "valueInt8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "uint256_int42", key: "keyUint256", value: "valueInt42" }, + { mapName: "uint256_int256", key: "keyUint256", value: "valueInt256" }, + { + mapName: "uint256_uint8", + key: "keyUint256", + value: "valueUint8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "uint256_uint42", key: "keyUint256", value: "valueUint42" }, + { mapName: "uint256_uint256", key: "keyUint256", value: "valueUint256" }, + { mapName: "uint256_coins", key: "keyUint256", value: "valueCoins" }, + + // address_* Maps + { mapName: "address_int", key: "keyAddress", value: "valueInt" }, + { + mapName: "address_int8", + key: "keyAddress", + value: "valueInt8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "address_int42", key: "keyAddress", value: "valueInt42" }, + { mapName: "address_int256", key: "keyAddress", value: "valueInt256" }, + { + mapName: "address_uint8", + key: "keyAddress", + value: "valueUint8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "address_uint42", key: "keyAddress", value: "valueUint42" }, + { mapName: "address_uint256", key: "keyAddress", value: "valueUint256" }, + { mapName: "address_coins", key: "keyAddress", value: "valueCoins" }, +]; + +describe("MapTestContract", () => { + let blockchain: Blockchain; + let treasury: SandboxContract; + let contract: SandboxContract; + + beforeEach(async () => { + // Initialize the blockchain and contracts + blockchain = await Blockchain.create(); + blockchain.verbosity.print = false; + treasury = await blockchain.treasury("treasury"); + contract = blockchain.openContract(await MapTestContract.fromInit()); + + // Fund the contract with some TONs + await contract.send( + treasury.getSender(), + { value: toNano("10") }, + null, + ); + + // Check that all maps are empty initially + const maps = await contract.getAllMaps(); + for (const [_mapName, map] of Object.entries(maps)) { + if (map instanceof Dictionary) { + expect(map.size).toBe(0); + } + } + }); + + it("set: should set and clear values", async () => { + for (const { keys, values } of testCases) { + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Retrieve all maps using `allMaps` getter + const allMaps = await contract.getAllMaps(); + + // Iterate over mapConfigs and perform assertions + mapConfigs.forEach( + ({ mapName, key, value, keyTransform, valueTransform }) => { + const map = allMaps[mapName] as Dictionary; + + expect(map.size).toBe(1); + + let mapKey = keys[key]; + if (keyTransform) { + mapKey = keyTransform(mapKey); + } + + let expectedValue = values[value]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + } + + const actualValue = map.get(mapKey); + + expect(actualValue).toEqual(expectedValue); + }, + ); + + // Clear all maps by setting values to null + const clearMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + valueInt: null, + valueInt8: null, + valueInt42: null, + valueInt256: null, + valueUint8: null, + valueUint42: null, + valueUint256: null, + valueCoins: null, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + clearMessage, + ); + + // Retrieve all maps again to ensure they are empty + const clearedMaps = await contract.getAllMaps(); + + // Iterate over mapConfigs and assert maps are empty + mapConfigs.forEach(({ mapName }) => { + const map = clearedMaps[mapName] as Dictionary; + expect(map.size).toBe(0); + }); + } + }); + + it("set: should set multiple values", async () => { + for (const { keys, values } of testCases) { + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + } + + // Retrieve all maps using `allMaps` getter + const allMaps = await contract.getAllMaps(); + + for (const { keys, values } of testCases) { + // Iterate over mapConfigs and perform assertions + mapConfigs.forEach( + ({ mapName, key, value, keyTransform, valueTransform }) => { + const map = allMaps[mapName] as Dictionary; + + expect(map.size).toBe(testCases.length); + + let mapKey = keys[key]; + if (keyTransform) { + mapKey = keyTransform(mapKey); + } + + let expectedValue = values[value]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + } + + const actualValue = map.get(mapKey); + + expect(actualValue).toEqual(expectedValue); + }, + ); + } + + for (const { keys } of testCases) { + // Clear all maps by setting values to null + const clearMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + valueInt: null, + valueInt8: null, + valueInt42: null, + valueInt256: null, + valueUint8: null, + valueUint42: null, + valueUint256: null, + valueCoins: null, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + clearMessage, + ); + } + + // Retrieve all maps again to ensure they are empty + const clearedMaps = await contract.getAllMaps(); + + // Iterate over mapConfigs and assert maps are empty + mapConfigs.forEach(({ mapName }) => { + const map = clearedMaps[mapName] as Dictionary; + expect(map.size).toBe(0); + }); + }); + + it("set: should overwrite values", async () => { + for (const { keys } of testCases) { + for (const { values } of testCases) { + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Retrieve all maps using `allMaps` getter + const allMaps = await contract.getAllMaps(); + + // Iterate over mapConfigs and perform assertions + mapConfigs.forEach( + ({ mapName, key, value, keyTransform, valueTransform }) => { + const map = allMaps[mapName] as Dictionary; + + expect(map.size).toBe(1); + + let mapKey = keys[key]; + if (keyTransform) { + mapKey = keyTransform(mapKey); + } + + let expectedValue = values[value]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + } + + const actualValue = map.get(mapKey); + + expect(actualValue).toEqual(expectedValue); + }, + ); + } + + // Clear all maps by setting values to null + const clearMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + valueInt: null, + valueInt8: null, + valueInt42: null, + valueInt256: null, + valueUint8: null, + valueUint42: null, + valueUint256: null, + valueCoins: null, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + clearMessage, + ); + + // Retrieve all maps again to ensure they are empty + const clearedMaps = await contract.getAllMaps(); + + // Iterate over mapConfigs and assert maps are empty + mapConfigs.forEach(({ mapName }) => { + const map = clearedMaps[mapName] as Dictionary; + expect(map.size).toBe(0); + }); + } + }); + + it("get: should get values after setting them and nulls after clearing", async () => { + for (const { keys, values } of testCases) { + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Call the .get operation on all maps + const getResponse = await contract.getGetAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + ); + + // Iterate over mapConfigs and perform assertions + mapConfigs.forEach( + ({ + mapName, + key: _key, + value, + keyTransform: _keyTransform, + valueTransform, + }) => { + let expectedValue = values[value]; + let actualValue = getResponse[mapName]; + + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + actualValue = valueTransform(actualValue); + } + + expect(actualValue).toEqual(expectedValue); + }, + ); + + // Clear all maps by setting values to null + const clearMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + valueInt: null, + valueInt8: null, + valueInt42: null, + valueInt256: null, + valueUint8: null, + valueUint42: null, + valueUint256: null, + valueCoins: null, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + clearMessage, + ); + + // Call the .get operation on all maps again + const clearedGetResponse = await contract.getGetAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + ); + + // Iterate over mapConfigs and assert maps are empty + mapConfigs.forEach(({ mapName }) => { + const actualValue = clearedGetResponse[mapName]; + expect(actualValue).toBeNull(); + }); + } + }); + + it("get: should return null for all maps when no values are set", async () => { + for (const { keys } of testCases) { + // Call the .get operation on all maps + const getResponse = await contract.getGetAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + ); + + // Iterate over mapConfigs and assert that all values are null + mapConfigs.forEach(({ mapName }) => { + const actualValue = getResponse[mapName]; + expect(actualValue).toBeNull(); + }); + } + }); + + it("get: should retrieve multiple values after setting them", async () => { + // Set multiple values + for (const { keys, values } of testCases) { + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + } + + // Now retrieve values for each test case + for (const { keys, values } of testCases) { + // Call the .get operation on all maps + const getResponse = await contract.getGetAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + ); + + // Iterate over mapConfigs and perform assertions + mapConfigs.forEach( + ({ + mapName, + key: _key, + value, + keyTransform: _keyTransform, + valueTransform, + }) => { + let expectedValue = values[value]; + let actualValue = getResponse[mapName]; + + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + actualValue = valueTransform(actualValue); + } + + expect(actualValue).toEqual(expectedValue); + }, + ); + } + }); + + it("get: should retrieve updated values after overwriting", async () => { + for (const { keys } of testCases) { + for (const { values } of testCases) { + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Call the .get operation on all maps + const getResponse = await contract.getGetAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + ); + + // Iterate over mapConfigs and perform assertions + mapConfigs.forEach( + ({ + mapName, + key: _key, + value, + keyTransform: _keyTransform, + valueTransform, + }) => { + let expectedValue = values[value]; + let actualValue = getResponse[mapName]; + + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + actualValue = valueTransform(actualValue); + } + + expect(actualValue).toEqual(expectedValue); + }, + ); + } + } + }); + + it("get: should return null for non-existent keys", async () => { + // First, set some keys + for (const { keys, values } of testCases.slice(0, -1)) { + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + } + + // Now, attempt to get values for keys that have not been set + const nonExistentKeys = testCases[testCases.length - 1]!.keys; + + const getResponse = await contract.getGetAllMaps( + nonExistentKeys.keyInt, + nonExistentKeys.keyInt8, + nonExistentKeys.keyInt42, + nonExistentKeys.keyInt256, + nonExistentKeys.keyUint8, + nonExistentKeys.keyUint42, + nonExistentKeys.keyUint256, + nonExistentKeys.keyAddress, + ); + + // Iterate over mapConfigs and assert that values are null + mapConfigs.forEach(({ mapName }) => { + const actualValue = getResponse[mapName]; + expect(actualValue).toBeNull(); + }); + }); + + it("del: should delete values", async () => { + for (const { keys, values } of testCases) { + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Retrieve all maps using `allMaps` getter to ensure they are set + const allMapsBeforeDel = await contract.getAllMaps(); + + // Iterate over mapConfigs and verify all maps have one entry + mapConfigs.forEach( + ({ mapName, key, value, keyTransform, valueTransform }) => { + const map = allMapsBeforeDel[mapName] as Dictionary< + any, + any + >; + + expect(map.size).toBe(1); + + let mapKey = keys[key]; + if (keyTransform) { + mapKey = keyTransform(mapKey); + } + + let expectedValue = values[value]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + } + + const actualValue = map.get(mapKey); + + expect(actualValue).toEqual(expectedValue); + }, + ); + + // Send the del operation + const delMessage: DelAllMaps = { + $$type: "DelAllMaps", + ...keys, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + delMessage, + ); + + // Retrieve all maps using `allMaps` getter to ensure they are deleted + const allMapsAfterDel = await contract.getAllMaps(); + + // Iterate over mapConfigs and assert maps are empty + mapConfigs.forEach(({ mapName }) => { + const map = allMapsAfterDel[mapName] as Dictionary; + expect(map.size).toBe(0); + }); + } + }); + + it("del: should delete multiple values", async () => { + // Set multiple values + for (const { keys, values } of testCases) { + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + } + + // Check that all maps are set + const allMapsBeforeDel = await contract.getAllMaps(); + mapConfigs.forEach(({ mapName }) => { + const map = allMapsBeforeDel[mapName] as Dictionary; + expect(map.size).toBe(testCases.length); + }); + + // Delete them + for (const { keys } of testCases) { + const delMessage: DelAllMaps = { $$type: "DelAllMaps", ...keys }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + delMessage, + ); + } + + // Ensure maps are empty + const allMapsAfterDel = await contract.getAllMaps(); + mapConfigs.forEach(({ mapName }) => { + const map = allMapsAfterDel[mapName] as Dictionary; + expect(map.size).toBe(0); + }); + }); + + it("del: should not affect other keys when deleting", async () => { + // Set multiple values + for (const { keys, values } of testCases) { + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + } + + // Delete only the first test case's keys + const keysToDelete = testCases[0]!.keys; + const delMessage: DelAllMaps = { + $$type: "DelAllMaps", + ...keysToDelete, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + delMessage, + ); + + // Check that only the deleted keys are removed + const allMapsAfterDel = await contract.getAllMaps(); + mapConfigs.forEach(({ mapName }) => { + const map = allMapsAfterDel[mapName] as Dictionary; + expect(map.size).toBe(testCases.length - 1); + }); + + // Verify other keys are unaffected + for (const { keys, values } of testCases.slice(1)) { + const getResponse = await contract.getAllMaps(); + + mapConfigs.forEach( + ({ mapName, key, value, keyTransform, valueTransform }) => { + const map = getResponse[mapName] as Dictionary; + + let mapKey = keys[key]; + if (keyTransform) { + mapKey = keyTransform(mapKey); + } + + let expectedValue = values[value]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + } + + const actualValue = map.get(mapKey); + + expect(actualValue).toEqual(expectedValue); + }, + ); + } + }); + + it("del: should do nothing when deleting non-existent keys", async () => { + // Set values except for the last test case + for (const { keys, values } of testCases.slice(0, -1)) { + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + } + + // Ensure existing data is unaffected + const allMapsBeforeDel = await contract.getAllMaps(); + mapConfigs.forEach(({ mapName }) => { + const map = allMapsBeforeDel[mapName] as Dictionary; + expect(map.size).toBe(testCases.length - 1); + }); + + // Attempt to delete non-existent keys + const nonExistentKeys = testCases[testCases.length - 1]!.keys; + const delMessage: DelAllMaps = { + $$type: "DelAllMaps", + ...nonExistentKeys, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + delMessage, + ); + + // Ensure existing data is unaffected + const allMapsAfterDel = await contract.getAllMaps(); + mapConfigs.forEach(({ mapName }) => { + const map = allMapsAfterDel[mapName] as Dictionary; + expect(map.size).toBe(testCases.length - 1); + }); + + // Verify that the existing values are still there + for (const { keys, values } of testCases.slice(0, -1)) { + const allMaps = await contract.getAllMaps(); + + mapConfigs.forEach( + ({ mapName, key, value, keyTransform, valueTransform }) => { + const map = allMaps[mapName] as Dictionary; + + let mapKey = keys[key]; + if (keyTransform) { + mapKey = keyTransform(mapKey); + } + + let expectedValue = values[value]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + } + + const actualValue = map.get(mapKey); + + expect(actualValue).toEqual(expectedValue); + }, + ); + } + }); + + it("del: should handle delete after overwriting", async () => { + for (const { keys } of testCases) { + for (const { values } of testCases) { + // Set values + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Delete values + const delMessage: DelAllMaps = { + $$type: "DelAllMaps", + ...keys, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + delMessage, + ); + + // Ensure maps are empty + const allMapsAfterDel = await contract.getAllMaps(); + mapConfigs.forEach(({ mapName }) => { + const map = allMapsAfterDel[mapName] as Dictionary< + any, + any + >; + expect(map.size).toBe(0); + }); + } + } + }); + + it("exists: should return 'true' for existing keys and 'false' for non-existent keys", async () => { + // Set values for all test cases + for (const { keys, values } of testCases.slice(0, -1)) { + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + } + + // Check that all keys exist + for (const { keys } of testCases.slice(0, -1)) { + const existsResponse = await contract.getExistsAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + ); + + Object.values(existsResponse).forEach((exists) => { + if (typeof exists === "boolean") { + expect(exists).toBe(true); + } + }); + } + + // Check that non-existent keys do not exist + const nonExistentKeys = testCases[testCases.length - 1]!.keys; + const nonExistentResponse = await contract.getExistsAllMaps( + nonExistentKeys.keyInt, + nonExistentKeys.keyInt8, + nonExistentKeys.keyInt42, + nonExistentKeys.keyInt256, + nonExistentKeys.keyUint8, + nonExistentKeys.keyUint42, + nonExistentKeys.keyUint256, + nonExistentKeys.keyAddress, + ); + + Object.values(nonExistentResponse).forEach((exists) => { + if (typeof exists === "boolean") { + expect(exists).toBe(false); + } + }); + }); + + it("exists: should still return 'true' after overwriting", async () => { + for (const { keys } of testCases) { + for (const { values } of testCases) { + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Call the .exists operation on all maps + const existsResponse = await contract.getExistsAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + ); + + Object.values(existsResponse).forEach((exists) => { + if (typeof exists === "boolean") { + expect(exists).toBe(true); + } + }); + } + } + }); + + it("exists: should return 'false' for all keys after clearing all maps", async () => { + for (const { keys, values } of testCases) { + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + } + + for (const { keys } of testCases) { + const clearMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + valueInt: null, + valueInt8: null, + valueInt42: null, + valueInt256: null, + valueUint8: null, + valueUint42: null, + valueUint256: null, + valueCoins: null, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + clearMessage, + ); + } + + for (const { keys } of testCases) { + const existsResponse = await contract.getExistsAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + ); + + Object.values(existsResponse).forEach((exists) => { + if (typeof exists === "boolean") { + expect(exists).toBe(false); + } + }); + } + }); + + it("isEmpty: should return 'true' for empty maps and 'false' for non-empty maps", async () => { + for (const { keys, values } of testCases) { + // Check that all maps are empty initially + const initialIsEmptyResponse = await contract.getIsEmptyAllMaps(); + Object.values(initialIsEmptyResponse).forEach((isEmpty) => { + if (typeof isEmpty === "boolean") { + expect(isEmpty).toBe(true); + } + }); + + // Set values for the current test case + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Check that all maps are non-empty + const nonEmptyIsEmptyResponse = await contract.getIsEmptyAllMaps(); + Object.values(nonEmptyIsEmptyResponse).forEach((isEmpty) => { + if (typeof isEmpty === "boolean") { + expect(isEmpty).toBe(false); + } + }); + + // Clear all maps + for (const { keys } of testCases) { + const clearMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + valueInt: null, + valueInt8: null, + valueInt42: null, + valueInt256: null, + valueUint8: null, + valueUint42: null, + valueUint256: null, + valueCoins: null, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + clearMessage, + ); + } + + // Check that all maps are empty again + const emptyIsEmptyResponse = await contract.getIsEmptyAllMaps(); + Object.values(emptyIsEmptyResponse).forEach((isEmpty) => { + if (typeof isEmpty === "boolean") { + expect(isEmpty).toBe(true); + } + }); + } + }); + + it("asCell: should correctly serialize and deserialize maps", async () => { + for (const { keys, values } of testCases) { + // Set values for the current test case + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Serialize all maps to a Cell + const cellResponse = await contract.getAsCellAllMaps(); + + // Retrieve all maps using `allMaps` getter + const allMaps = await contract.getAllMaps(); + + // Iterate over mapConfigs and perform assertions + mapConfigs.forEach( + ({ mapName, key, value, keyTransform, valueTransform }) => { + const map = allMaps[mapName] as Dictionary; + + expect(map.size).toBe(1); + + let mapKey = keys[key]; + if (keyTransform) { + mapKey = keyTransform(mapKey); + } + + let expectedValue = values[value]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + } + + const actualValue = map.get(mapKey); + + expect(actualValue).toEqual(expectedValue); + + // Serialize the map from allMaps to a Cell to compare with the response + const serializedMap = beginCell() + .storeDictDirect(map) + .endCell(); + + expect(cellResponse[mapName]).toEqualCell(serializedMap); + }, + ); + + // Clear all maps + for (const { keys } of testCases) { + const clearMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + valueInt: null, + valueInt8: null, + valueInt42: null, + valueInt256: null, + valueUint8: null, + valueUint42: null, + valueUint256: null, + valueCoins: null, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + clearMessage, + ); + } + } + }); + + it("replace: should replace values and clear them", async () => { + for (const { keys } of testCases) { + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...testCases[0]!.values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + for (const { values } of testCases) { + // Send the replace operation + const replaceMessage: ReplaceAllMaps = { + $$type: "ReplaceAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + replaceMessage, + ); + + // Retrieve all maps using `allMaps` getter + const allMaps = await contract.getAllMaps(); + + // Iterate over mapConfigs and perform assertions + mapConfigs.forEach( + ({ mapName, key, value, keyTransform, valueTransform }) => { + const map = allMaps[mapName] as Dictionary; + + expect(map.size).toBe(1); + + let mapKey = keys[key]; + if (keyTransform) { + mapKey = keyTransform(mapKey); + } + + let expectedValue = values[value]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + } + + const actualValue = map.get(mapKey); + + expect(actualValue).toEqual(expectedValue); + }, + ); + } + + // Clear all maps + for (const { keys } of testCases) { + const clearMessage: ReplaceAllMaps = { + $$type: "ReplaceAllMaps", + ...keys, + valueInt: null, + valueInt8: null, + valueInt42: null, + valueInt256: null, + valueUint8: null, + valueUint42: null, + valueUint256: null, + valueCoins: null, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + clearMessage, + ); + } + } + + // Check that all maps are empty again + const allMaps = await contract.getAllMaps(); + mapConfigs.forEach(({ mapName }) => { + const map = allMaps[mapName] as Dictionary; + expect(map.size).toBe(0); + }); + }); + + it("replace: should not replace values when keys do not exist", async () => { + for (const { keys, values } of testCases) { + // Send the replace operation + const replaceMessage: ReplaceAllMaps = { + $$type: "ReplaceAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + replaceMessage, + ); + + // Retrieve all maps using `allMaps` getter + const allMaps = await contract.getAllMaps(); + + // Check that all maps are still empty + mapConfigs.forEach(({ mapName }) => { + const map = allMaps[mapName] as Dictionary; + expect(map.size).toBe(0); + }); + } + }); + + it("replace: should return 'true' when replacing values and 'false' when keys do not exist", async () => { + for (const { keys, values } of testCases) { + // Call the .replace operation on all maps + const replaceResult = await contract.getReplaceAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + values.valueInt, + values.valueInt8, + values.valueInt42, + values.valueInt256, + values.valueUint8, + values.valueUint42, + values.valueUint256, + values.valueCoins, + ); + + // Check that all return values are 'false' + Object.values(replaceResult).forEach((result) => { + if (typeof result === "boolean") { + expect(result).toBe(false); + } + }); + + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Call the .replace operation on all maps + const replaceResultAfterSet = await contract.getReplaceAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + values.valueInt, + values.valueInt8, + values.valueInt42, + values.valueInt256, + values.valueUint8, + values.valueUint42, + values.valueUint256, + values.valueCoins, + ); + + // Check that all return values are 'true' + Object.values(replaceResultAfterSet).forEach((result) => { + if (typeof result === "boolean") { + expect(result).toBe(true); + } + }); + } + }); + + it("replaceGet: should replace values and clear them", async () => { + for (const { keys } of testCases) { + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...testCases[0]!.values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + for (const { values } of testCases) { + // Send the replace operation + const replaceGetMessage: ReplaceGetAllMaps = { + $$type: "ReplaceGetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + replaceGetMessage, + ); + + // Retrieve all maps using `allMaps` getter + const allMaps = await contract.getAllMaps(); + + // Iterate over mapConfigs and perform assertions + mapConfigs.forEach( + ({ mapName, key, value, keyTransform, valueTransform }) => { + const map = allMaps[mapName] as Dictionary; + + expect(map.size).toBe(1); + + let mapKey = keys[key]; + if (keyTransform) { + mapKey = keyTransform(mapKey); + } + + let expectedValue = values[value]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + } + + const actualValue = map.get(mapKey); + + expect(actualValue).toEqual(expectedValue); + }, + ); + } + + // Clear all maps + for (const { keys } of testCases) { + const clearMessage: ReplaceGetAllMaps = { + $$type: "ReplaceGetAllMaps", + ...keys, + valueInt: null, + valueInt8: null, + valueInt42: null, + valueInt256: null, + valueUint8: null, + valueUint42: null, + valueUint256: null, + valueCoins: null, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + clearMessage, + ); + } + } + + // Check that all maps are empty again + const allMaps = await contract.getAllMaps(); + mapConfigs.forEach(({ mapName }) => { + const map = allMaps[mapName] as Dictionary; + expect(map.size).toBe(0); + }); + }); + + it("replaceGet: should not replace values when keys do not exist", async () => { + for (const { keys, values } of testCases) { + // Send the replace operation + const replaceGetMessage: ReplaceGetAllMaps = { + $$type: "ReplaceGetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + replaceGetMessage, + ); + + // Retrieve all maps using `allMaps` getter + const allMaps = await contract.getAllMaps(); + + // Check that all maps are still empty + mapConfigs.forEach(({ mapName }) => { + const map = allMaps[mapName] as Dictionary; + expect(map.size).toBe(0); + }); + } + }); + + it("replaceGet: should return old values when replaced and null when keys do not exist", async () => { + for (const { keys, values } of testCases) { + // Call the .replace operation on all maps + const replaceGetResult = await contract.getReplaceGetAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + values.valueInt, + values.valueInt8, + values.valueInt42, + values.valueInt256, + values.valueUint8, + values.valueUint42, + values.valueUint256, + values.valueCoins, + ); + + // Check that all return values are 'null' + Object.values(replaceGetResult).forEach((result) => { + if (result !== "ReplaceGetAllMapsResult") { + expect(result).toBeNull(); + } + }); + + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Call the .replace operation on all maps + const replaceGetResultAfterSet = + await contract.getReplaceGetAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + values.valueInt, + values.valueInt8, + values.valueInt42, + values.valueInt256, + values.valueUint8, + values.valueUint42, + values.valueUint256, + values.valueCoins, + ); + + // Check that all return values are equal to the old values + mapConfigs.forEach(({ mapName, value, valueTransform }) => { + let expectedValue = values[value]; + let actualValue = replaceGetResultAfterSet[mapName]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + actualValue = valueTransform(actualValue); + } + + expect(actualValue).toEqual(expectedValue); + }); + } + }); + + it("checkNullReference: should throw an error in getter when accessing a null reference", async () => { + await expect(contract.getCheckNullReference()).rejects.toThrow(); + }); + + it("checkNullReference: should throw an error in receiver when accessing a null reference", async () => { + const result = await contract.send( + treasury.getSender(), + { value: toNano("1") }, + { + $$type: "CheckNullReference", + }, + ); + + expect(result.transactions).toHaveLength(3); + expect(result.transactions).toHaveTransaction({ + on: contract.address, + success: false, + exitCode: 128, + }); + }); +}); diff --git a/src/test/e2e-emulated/structs.spec.ts b/src/test/e2e-emulated/structs.spec.ts index 2ffd4fdc0..55531b616 100644 --- a/src/test/e2e-emulated/structs.spec.ts +++ b/src/test/e2e-emulated/structs.spec.ts @@ -270,6 +270,19 @@ describe("structs", () => { exitCode: 9, }); + { + const sendResult = await contract.send( + treasure.getSender(), + { value: toNano("10") }, + "exampleVarIntegers", + ); + expect(sendResult.transactions).toHaveTransaction({ + from: treasure.address, + to: contract.address, + success: true, + }); + } + expect(await contract.getLongStruct15Test()).toMatchSnapshot(); expect(await contract.getLongStruct16Test()).toMatchSnapshot(); expect(await contract.getLongStruct32Test()).toMatchSnapshot(); diff --git a/src/types/__snapshots__/resolveDescriptors.spec.ts.snap b/src/types/__snapshots__/resolveDescriptors.spec.ts.snap index dc4bb74f7..98f09ba25 100644 --- a/src/types/__snapshots__/resolveDescriptors.spec.ts.snap +++ b/src/types/__snapshots__/resolveDescriptors.spec.ts.snap @@ -9079,6 +9079,2780 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-coins 1` exports[`resolveDescriptors should resolve descriptors for map-value-as-coins 2`] = `[]`; +exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1`] = ` +[ + { + "ast": { + "id": 2, + "kind": "primitive_type_decl", + "loc": primitive Int;, + "name": { + "id": 1, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + "constants": [], + "dependsOn": [], + "fields": [], + "functions": Map {}, + "header": null, + "init": null, + "interfaces": [], + "kind": "primitive_type_decl", + "name": "Int", + "origin": "user", + "partialFieldCount": 0, + "receivers": [], + "signature": null, + "tlb": null, + "traits": [], + "uid": 38154, + }, + { + "ast": { + "attributes": [], + "declarations": [], + "id": 4, + "kind": "trait", + "loc": trait BaseTrait { + +}, + "name": { + "id": 3, + "kind": "id", + "loc": BaseTrait, + "text": "BaseTrait", + }, + "traits": [], + }, + "constants": [], + "dependsOn": [], + "fields": [], + "functions": Map {}, + "header": null, + "init": null, + "interfaces": [], + "kind": "trait", + "name": "BaseTrait", + "origin": "user", + "partialFieldCount": 0, + "receivers": [], + "signature": null, + "tlb": null, + "traits": [], + "uid": 1020, + }, + { + "ast": { + "attributes": [], + "declarations": [ + { + "as": null, + "id": 11, + "initializer": null, + "kind": "field_decl", + "loc": m1: map, + "name": { + "id": 6, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "type": { + "id": 10, + "keyStorageType": null, + "keyType": { + "id": 7, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 9, + "kind": "id", + "loc": varint16, + "text": "varint16", + }, + "valueType": { + "id": 8, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "as": null, + "id": 17, + "initializer": null, + "kind": "field_decl", + "loc": m2: map, + "name": { + "id": 12, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "type": { + "id": 16, + "keyStorageType": null, + "keyType": { + "id": 13, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 15, + "kind": "id", + "loc": varint32, + "text": "varint32", + }, + "valueType": { + "id": 14, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "attributes": [ + { + "kind": "function_attribute", + "loc": get, + "methodId": null, + "type": "get", + }, + ], + "id": 54, + "kind": "function_def", + "loc": get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + }, + "name": { + "id": 18, + "kind": "id", + "loc": test1, + "text": "test1", + }, + "params": [], + "return": { + "id": 19, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "args": [], + "function": { + "id": 25, + "kind": "id", + "loc": emptyMap, + "text": "emptyMap", + }, + "id": 26, + "kind": "static_call", + "loc": emptyMap(), + }, + "id": 27, + "kind": "statement_let", + "loc": let m1: map = emptyMap();, + "name": { + "id": 20, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "type": { + "id": 24, + "keyStorageType": null, + "keyType": { + "id": 21, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 23, + "kind": "id", + "loc": varint16, + "text": "varint16", + }, + "valueType": { + "id": 22, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 30, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 31, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 32, + "kind": "method_call", + "loc": m1.set(1, 2), + "method": { + "id": 29, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "id": 28, + "kind": "id", + "loc": m1, + "text": "m1", + }, + }, + "id": 33, + "kind": "statement_expression", + "loc": m1.set(1, 2);, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 38, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 39, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 40, + "kind": "method_call", + "loc": self.m1.set(1, 2), + "method": { + "id": 37, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "aggregate": { + "id": 34, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 35, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "id": 36, + "kind": "field_access", + "loc": self.m1, + }, + }, + "id": 41, + "kind": "statement_expression", + "loc": self.m1.set(1, 2);, + }, + { + "expression": { + "id": 52, + "kind": "op_binary", + "left": { + "args": [ + { + "base": 10, + "id": 44, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 45, + "kind": "method_call", + "loc": m1.get(1), + "method": { + "id": 43, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "id": 42, + "kind": "id", + "loc": m1, + "text": "m1", + }, + }, + "loc": m1.get(1) + self.m1.get(1), + "op": "+", + "right": { + "args": [ + { + "base": 10, + "id": 50, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 51, + "kind": "method_call", + "loc": self.m1.get(1), + "method": { + "id": 49, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "aggregate": { + "id": 46, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 47, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "id": 48, + "kind": "field_access", + "loc": self.m1, + }, + }, + }, + "id": 53, + "kind": "statement_return", + "loc": return m1.get(1) + self.m1.get(1);, + }, + ], + }, + { + "attributes": [ + { + "kind": "function_attribute", + "loc": get, + "methodId": null, + "type": "get", + }, + ], + "id": 91, + "kind": "function_def", + "loc": get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + }, + "name": { + "id": 55, + "kind": "id", + "loc": test2, + "text": "test2", + }, + "params": [], + "return": { + "id": 56, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "args": [], + "function": { + "id": 62, + "kind": "id", + "loc": emptyMap, + "text": "emptyMap", + }, + "id": 63, + "kind": "static_call", + "loc": emptyMap(), + }, + "id": 64, + "kind": "statement_let", + "loc": let m2: map = emptyMap();, + "name": { + "id": 57, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "type": { + "id": 61, + "keyStorageType": null, + "keyType": { + "id": 58, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 60, + "kind": "id", + "loc": varint32, + "text": "varint32", + }, + "valueType": { + "id": 59, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 67, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 68, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 69, + "kind": "method_call", + "loc": m2.set(1, 2), + "method": { + "id": 66, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "id": 65, + "kind": "id", + "loc": m2, + "text": "m2", + }, + }, + "id": 70, + "kind": "statement_expression", + "loc": m2.set(1, 2);, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 75, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 76, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 77, + "kind": "method_call", + "loc": self.m2.set(1, 2), + "method": { + "id": 74, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "aggregate": { + "id": 71, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 72, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "id": 73, + "kind": "field_access", + "loc": self.m2, + }, + }, + "id": 78, + "kind": "statement_expression", + "loc": self.m2.set(1, 2);, + }, + { + "expression": { + "id": 89, + "kind": "op_binary", + "left": { + "args": [ + { + "base": 10, + "id": 81, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 82, + "kind": "method_call", + "loc": m2.get(1), + "method": { + "id": 80, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "id": 79, + "kind": "id", + "loc": m2, + "text": "m2", + }, + }, + "loc": m2.get(1) + self.m2.get(1), + "op": "+", + "right": { + "args": [ + { + "base": 10, + "id": 87, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 88, + "kind": "method_call", + "loc": self.m2.get(1), + "method": { + "id": 86, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "aggregate": { + "id": 83, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 84, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "id": 85, + "kind": "field_access", + "loc": self.m2, + }, + }, + }, + "id": 90, + "kind": "statement_return", + "loc": return m2.get(1) + self.m2.get(1);, + }, + ], + }, + ], + "id": 92, + "kind": "contract", + "loc": contract Main { + m1: map; + m2: map; + + get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + } + + get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + } +}, + "name": { + "id": 5, + "kind": "id", + "loc": Main, + "text": "Main", + }, + "traits": [], + }, + "constants": [], + "dependsOn": [], + "fields": [ + { + "abi": { + "name": "m1", + "type": { + "key": "int", + "keyFormat": undefined, + "kind": "dict", + "value": "int", + "valueFormat": "varint16", + }, + }, + "as": null, + "ast": { + "as": null, + "id": 11, + "initializer": null, + "kind": "field_decl", + "loc": m1: map, + "name": { + "id": 6, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "type": { + "id": 10, + "keyStorageType": null, + "keyType": { + "id": 7, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 9, + "kind": "id", + "loc": varint16, + "text": "varint16", + }, + "valueType": { + "id": 8, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + "default": undefined, + "index": 0, + "loc": m1: map, + "name": "m1", + "type": { + "key": "Int", + "keyAs": null, + "kind": "map", + "value": "Int", + "valueAs": "varint16", + }, + }, + { + "abi": { + "name": "m2", + "type": { + "key": "int", + "keyFormat": undefined, + "kind": "dict", + "value": "int", + "valueFormat": "varint32", + }, + }, + "as": null, + "ast": { + "as": null, + "id": 17, + "initializer": null, + "kind": "field_decl", + "loc": m2: map, + "name": { + "id": 12, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "type": { + "id": 16, + "keyStorageType": null, + "keyType": { + "id": 13, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 15, + "kind": "id", + "loc": varint32, + "text": "varint32", + }, + "valueType": { + "id": 14, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + "default": undefined, + "index": 1, + "loc": m2: map, + "name": "m2", + "type": { + "key": "Int", + "keyAs": null, + "kind": "map", + "value": "Int", + "valueAs": "varint32", + }, + }, + ], + "functions": Map { + "test1" => { + "ast": { + "attributes": [ + { + "kind": "function_attribute", + "loc": get, + "methodId": null, + "type": "get", + }, + ], + "id": 54, + "kind": "function_def", + "loc": get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + }, + "name": { + "id": 18, + "kind": "id", + "loc": test1, + "text": "test1", + }, + "params": [], + "return": { + "id": 19, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "args": [], + "function": { + "id": 25, + "kind": "id", + "loc": emptyMap, + "text": "emptyMap", + }, + "id": 26, + "kind": "static_call", + "loc": emptyMap(), + }, + "id": 27, + "kind": "statement_let", + "loc": let m1: map = emptyMap();, + "name": { + "id": 20, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "type": { + "id": 24, + "keyStorageType": null, + "keyType": { + "id": 21, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 23, + "kind": "id", + "loc": varint16, + "text": "varint16", + }, + "valueType": { + "id": 22, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 30, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 31, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 32, + "kind": "method_call", + "loc": m1.set(1, 2), + "method": { + "id": 29, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "id": 28, + "kind": "id", + "loc": m1, + "text": "m1", + }, + }, + "id": 33, + "kind": "statement_expression", + "loc": m1.set(1, 2);, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 38, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 39, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 40, + "kind": "method_call", + "loc": self.m1.set(1, 2), + "method": { + "id": 37, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "aggregate": { + "id": 34, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 35, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "id": 36, + "kind": "field_access", + "loc": self.m1, + }, + }, + "id": 41, + "kind": "statement_expression", + "loc": self.m1.set(1, 2);, + }, + { + "expression": { + "id": 52, + "kind": "op_binary", + "left": { + "args": [ + { + "base": 10, + "id": 44, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 45, + "kind": "method_call", + "loc": m1.get(1), + "method": { + "id": 43, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "id": 42, + "kind": "id", + "loc": m1, + "text": "m1", + }, + }, + "loc": m1.get(1) + self.m1.get(1), + "op": "+", + "right": { + "args": [ + { + "base": 10, + "id": 50, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 51, + "kind": "method_call", + "loc": self.m1.get(1), + "method": { + "id": 49, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "aggregate": { + "id": 46, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 47, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "id": 48, + "kind": "field_access", + "loc": self.m1, + }, + }, + }, + "id": 53, + "kind": "statement_return", + "loc": return m1.get(1) + self.m1.get(1);, + }, + ], + }, + "isAbstract": false, + "isGetter": true, + "isInline": false, + "isMutating": true, + "isOverride": false, + "isVirtual": false, + "methodId": null, + "name": "test1", + "origin": "user", + "params": [], + "returns": { + "kind": "ref", + "name": "Int", + "optional": false, + }, + "self": { + "kind": "ref", + "name": "Main", + "optional": false, + }, + }, + "test2" => { + "ast": { + "attributes": [ + { + "kind": "function_attribute", + "loc": get, + "methodId": null, + "type": "get", + }, + ], + "id": 91, + "kind": "function_def", + "loc": get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + }, + "name": { + "id": 55, + "kind": "id", + "loc": test2, + "text": "test2", + }, + "params": [], + "return": { + "id": 56, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "args": [], + "function": { + "id": 62, + "kind": "id", + "loc": emptyMap, + "text": "emptyMap", + }, + "id": 63, + "kind": "static_call", + "loc": emptyMap(), + }, + "id": 64, + "kind": "statement_let", + "loc": let m2: map = emptyMap();, + "name": { + "id": 57, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "type": { + "id": 61, + "keyStorageType": null, + "keyType": { + "id": 58, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 60, + "kind": "id", + "loc": varint32, + "text": "varint32", + }, + "valueType": { + "id": 59, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 67, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 68, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 69, + "kind": "method_call", + "loc": m2.set(1, 2), + "method": { + "id": 66, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "id": 65, + "kind": "id", + "loc": m2, + "text": "m2", + }, + }, + "id": 70, + "kind": "statement_expression", + "loc": m2.set(1, 2);, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 75, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 76, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 77, + "kind": "method_call", + "loc": self.m2.set(1, 2), + "method": { + "id": 74, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "aggregate": { + "id": 71, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 72, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "id": 73, + "kind": "field_access", + "loc": self.m2, + }, + }, + "id": 78, + "kind": "statement_expression", + "loc": self.m2.set(1, 2);, + }, + { + "expression": { + "id": 89, + "kind": "op_binary", + "left": { + "args": [ + { + "base": 10, + "id": 81, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 82, + "kind": "method_call", + "loc": m2.get(1), + "method": { + "id": 80, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "id": 79, + "kind": "id", + "loc": m2, + "text": "m2", + }, + }, + "loc": m2.get(1) + self.m2.get(1), + "op": "+", + "right": { + "args": [ + { + "base": 10, + "id": 87, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 88, + "kind": "method_call", + "loc": self.m2.get(1), + "method": { + "id": 86, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "aggregate": { + "id": 83, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 84, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "id": 85, + "kind": "field_access", + "loc": self.m2, + }, + }, + }, + "id": 90, + "kind": "statement_return", + "loc": return m2.get(1) + self.m2.get(1);, + }, + ], + }, + "isAbstract": false, + "isGetter": true, + "isInline": false, + "isMutating": true, + "isOverride": false, + "isVirtual": false, + "methodId": null, + "name": "test2", + "origin": "user", + "params": [], + "returns": { + "kind": "ref", + "name": "Int", + "optional": false, + }, + "self": { + "kind": "ref", + "name": "Main", + "optional": false, + }, + }, + }, + "header": null, + "init": { + "ast": { + "id": 94, + "kind": "contract_init", + "loc": contract Main { + m1: map; + m2: map; + + get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + } + + get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + } +}, + "params": [], + "statements": [], + }, + "params": [], + }, + "interfaces": [], + "kind": "contract", + "name": "Main", + "origin": "user", + "partialFieldCount": 0, + "receivers": [], + "signature": null, + "tlb": null, + "traits": [ + { + "ast": { + "attributes": [], + "declarations": [], + "id": 4, + "kind": "trait", + "loc": trait BaseTrait { + +}, + "name": { + "id": 3, + "kind": "id", + "loc": BaseTrait, + "text": "BaseTrait", + }, + "traits": [], + }, + "constants": [], + "dependsOn": [], + "fields": [], + "functions": Map {}, + "header": null, + "init": null, + "interfaces": [], + "kind": "trait", + "name": "BaseTrait", + "origin": "user", + "partialFieldCount": 0, + "receivers": [], + "signature": null, + "tlb": null, + "traits": [], + "uid": 1020, + }, + ], + "uid": 51099, + }, +] +`; + +exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 2`] = `[]`; + +exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint 1`] = ` +[ + { + "ast": { + "id": 2, + "kind": "primitive_type_decl", + "loc": primitive Int;, + "name": { + "id": 1, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + "constants": [], + "dependsOn": [], + "fields": [], + "functions": Map {}, + "header": null, + "init": null, + "interfaces": [], + "kind": "primitive_type_decl", + "name": "Int", + "origin": "user", + "partialFieldCount": 0, + "receivers": [], + "signature": null, + "tlb": null, + "traits": [], + "uid": 38154, + }, + { + "ast": { + "attributes": [], + "declarations": [], + "id": 4, + "kind": "trait", + "loc": trait BaseTrait { + +}, + "name": { + "id": 3, + "kind": "id", + "loc": BaseTrait, + "text": "BaseTrait", + }, + "traits": [], + }, + "constants": [], + "dependsOn": [], + "fields": [], + "functions": Map {}, + "header": null, + "init": null, + "interfaces": [], + "kind": "trait", + "name": "BaseTrait", + "origin": "user", + "partialFieldCount": 0, + "receivers": [], + "signature": null, + "tlb": null, + "traits": [], + "uid": 1020, + }, + { + "ast": { + "attributes": [], + "declarations": [ + { + "as": null, + "id": 11, + "initializer": null, + "kind": "field_decl", + "loc": m1: map, + "name": { + "id": 6, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "type": { + "id": 10, + "keyStorageType": null, + "keyType": { + "id": 7, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 9, + "kind": "id", + "loc": varuint16, + "text": "varuint16", + }, + "valueType": { + "id": 8, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "as": null, + "id": 17, + "initializer": null, + "kind": "field_decl", + "loc": m2: map, + "name": { + "id": 12, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "type": { + "id": 16, + "keyStorageType": null, + "keyType": { + "id": 13, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 15, + "kind": "id", + "loc": varuint32, + "text": "varuint32", + }, + "valueType": { + "id": 14, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "attributes": [ + { + "kind": "function_attribute", + "loc": get, + "methodId": null, + "type": "get", + }, + ], + "id": 54, + "kind": "function_def", + "loc": get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + }, + "name": { + "id": 18, + "kind": "id", + "loc": test1, + "text": "test1", + }, + "params": [], + "return": { + "id": 19, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "args": [], + "function": { + "id": 25, + "kind": "id", + "loc": emptyMap, + "text": "emptyMap", + }, + "id": 26, + "kind": "static_call", + "loc": emptyMap(), + }, + "id": 27, + "kind": "statement_let", + "loc": let m1: map = emptyMap();, + "name": { + "id": 20, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "type": { + "id": 24, + "keyStorageType": null, + "keyType": { + "id": 21, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 23, + "kind": "id", + "loc": varuint16, + "text": "varuint16", + }, + "valueType": { + "id": 22, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 30, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 31, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 32, + "kind": "method_call", + "loc": m1.set(1, 2), + "method": { + "id": 29, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "id": 28, + "kind": "id", + "loc": m1, + "text": "m1", + }, + }, + "id": 33, + "kind": "statement_expression", + "loc": m1.set(1, 2);, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 38, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 39, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 40, + "kind": "method_call", + "loc": self.m1.set(1, 2), + "method": { + "id": 37, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "aggregate": { + "id": 34, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 35, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "id": 36, + "kind": "field_access", + "loc": self.m1, + }, + }, + "id": 41, + "kind": "statement_expression", + "loc": self.m1.set(1, 2);, + }, + { + "expression": { + "id": 52, + "kind": "op_binary", + "left": { + "args": [ + { + "base": 10, + "id": 44, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 45, + "kind": "method_call", + "loc": m1.get(1), + "method": { + "id": 43, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "id": 42, + "kind": "id", + "loc": m1, + "text": "m1", + }, + }, + "loc": m1.get(1) + self.m1.get(1), + "op": "+", + "right": { + "args": [ + { + "base": 10, + "id": 50, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 51, + "kind": "method_call", + "loc": self.m1.get(1), + "method": { + "id": 49, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "aggregate": { + "id": 46, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 47, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "id": 48, + "kind": "field_access", + "loc": self.m1, + }, + }, + }, + "id": 53, + "kind": "statement_return", + "loc": return m1.get(1) + self.m1.get(1);, + }, + ], + }, + { + "attributes": [ + { + "kind": "function_attribute", + "loc": get, + "methodId": null, + "type": "get", + }, + ], + "id": 91, + "kind": "function_def", + "loc": get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + }, + "name": { + "id": 55, + "kind": "id", + "loc": test2, + "text": "test2", + }, + "params": [], + "return": { + "id": 56, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "args": [], + "function": { + "id": 62, + "kind": "id", + "loc": emptyMap, + "text": "emptyMap", + }, + "id": 63, + "kind": "static_call", + "loc": emptyMap(), + }, + "id": 64, + "kind": "statement_let", + "loc": let m2: map = emptyMap();, + "name": { + "id": 57, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "type": { + "id": 61, + "keyStorageType": null, + "keyType": { + "id": 58, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 60, + "kind": "id", + "loc": varuint32, + "text": "varuint32", + }, + "valueType": { + "id": 59, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 67, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 68, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 69, + "kind": "method_call", + "loc": m2.set(1, 2), + "method": { + "id": 66, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "id": 65, + "kind": "id", + "loc": m2, + "text": "m2", + }, + }, + "id": 70, + "kind": "statement_expression", + "loc": m2.set(1, 2);, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 75, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 76, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 77, + "kind": "method_call", + "loc": self.m2.set(1, 2), + "method": { + "id": 74, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "aggregate": { + "id": 71, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 72, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "id": 73, + "kind": "field_access", + "loc": self.m2, + }, + }, + "id": 78, + "kind": "statement_expression", + "loc": self.m2.set(1, 2);, + }, + { + "expression": { + "id": 89, + "kind": "op_binary", + "left": { + "args": [ + { + "base": 10, + "id": 81, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 82, + "kind": "method_call", + "loc": m2.get(1), + "method": { + "id": 80, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "id": 79, + "kind": "id", + "loc": m2, + "text": "m2", + }, + }, + "loc": m2.get(1) + self.m2.get(1), + "op": "+", + "right": { + "args": [ + { + "base": 10, + "id": 87, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 88, + "kind": "method_call", + "loc": self.m2.get(1), + "method": { + "id": 86, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "aggregate": { + "id": 83, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 84, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "id": 85, + "kind": "field_access", + "loc": self.m2, + }, + }, + }, + "id": 90, + "kind": "statement_return", + "loc": return m2.get(1) + self.m2.get(1);, + }, + ], + }, + ], + "id": 92, + "kind": "contract", + "loc": contract Main { + m1: map; + m2: map; + + get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + } + + get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + } +}, + "name": { + "id": 5, + "kind": "id", + "loc": Main, + "text": "Main", + }, + "traits": [], + }, + "constants": [], + "dependsOn": [], + "fields": [ + { + "abi": { + "name": "m1", + "type": { + "key": "int", + "keyFormat": undefined, + "kind": "dict", + "value": "uint", + "valueFormat": "varuint16", + }, + }, + "as": null, + "ast": { + "as": null, + "id": 11, + "initializer": null, + "kind": "field_decl", + "loc": m1: map, + "name": { + "id": 6, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "type": { + "id": 10, + "keyStorageType": null, + "keyType": { + "id": 7, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 9, + "kind": "id", + "loc": varuint16, + "text": "varuint16", + }, + "valueType": { + "id": 8, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + "default": undefined, + "index": 0, + "loc": m1: map, + "name": "m1", + "type": { + "key": "Int", + "keyAs": null, + "kind": "map", + "value": "Int", + "valueAs": "varuint16", + }, + }, + { + "abi": { + "name": "m2", + "type": { + "key": "int", + "keyFormat": undefined, + "kind": "dict", + "value": "uint", + "valueFormat": "varuint32", + }, + }, + "as": null, + "ast": { + "as": null, + "id": 17, + "initializer": null, + "kind": "field_decl", + "loc": m2: map, + "name": { + "id": 12, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "type": { + "id": 16, + "keyStorageType": null, + "keyType": { + "id": 13, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 15, + "kind": "id", + "loc": varuint32, + "text": "varuint32", + }, + "valueType": { + "id": 14, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + "default": undefined, + "index": 1, + "loc": m2: map, + "name": "m2", + "type": { + "key": "Int", + "keyAs": null, + "kind": "map", + "value": "Int", + "valueAs": "varuint32", + }, + }, + ], + "functions": Map { + "test1" => { + "ast": { + "attributes": [ + { + "kind": "function_attribute", + "loc": get, + "methodId": null, + "type": "get", + }, + ], + "id": 54, + "kind": "function_def", + "loc": get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + }, + "name": { + "id": 18, + "kind": "id", + "loc": test1, + "text": "test1", + }, + "params": [], + "return": { + "id": 19, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "args": [], + "function": { + "id": 25, + "kind": "id", + "loc": emptyMap, + "text": "emptyMap", + }, + "id": 26, + "kind": "static_call", + "loc": emptyMap(), + }, + "id": 27, + "kind": "statement_let", + "loc": let m1: map = emptyMap();, + "name": { + "id": 20, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "type": { + "id": 24, + "keyStorageType": null, + "keyType": { + "id": 21, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 23, + "kind": "id", + "loc": varuint16, + "text": "varuint16", + }, + "valueType": { + "id": 22, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 30, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 31, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 32, + "kind": "method_call", + "loc": m1.set(1, 2), + "method": { + "id": 29, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "id": 28, + "kind": "id", + "loc": m1, + "text": "m1", + }, + }, + "id": 33, + "kind": "statement_expression", + "loc": m1.set(1, 2);, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 38, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 39, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 40, + "kind": "method_call", + "loc": self.m1.set(1, 2), + "method": { + "id": 37, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "aggregate": { + "id": 34, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 35, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "id": 36, + "kind": "field_access", + "loc": self.m1, + }, + }, + "id": 41, + "kind": "statement_expression", + "loc": self.m1.set(1, 2);, + }, + { + "expression": { + "id": 52, + "kind": "op_binary", + "left": { + "args": [ + { + "base": 10, + "id": 44, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 45, + "kind": "method_call", + "loc": m1.get(1), + "method": { + "id": 43, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "id": 42, + "kind": "id", + "loc": m1, + "text": "m1", + }, + }, + "loc": m1.get(1) + self.m1.get(1), + "op": "+", + "right": { + "args": [ + { + "base": 10, + "id": 50, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 51, + "kind": "method_call", + "loc": self.m1.get(1), + "method": { + "id": 49, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "aggregate": { + "id": 46, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 47, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "id": 48, + "kind": "field_access", + "loc": self.m1, + }, + }, + }, + "id": 53, + "kind": "statement_return", + "loc": return m1.get(1) + self.m1.get(1);, + }, + ], + }, + "isAbstract": false, + "isGetter": true, + "isInline": false, + "isMutating": true, + "isOverride": false, + "isVirtual": false, + "methodId": null, + "name": "test1", + "origin": "user", + "params": [], + "returns": { + "kind": "ref", + "name": "Int", + "optional": false, + }, + "self": { + "kind": "ref", + "name": "Main", + "optional": false, + }, + }, + "test2" => { + "ast": { + "attributes": [ + { + "kind": "function_attribute", + "loc": get, + "methodId": null, + "type": "get", + }, + ], + "id": 91, + "kind": "function_def", + "loc": get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + }, + "name": { + "id": 55, + "kind": "id", + "loc": test2, + "text": "test2", + }, + "params": [], + "return": { + "id": 56, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "args": [], + "function": { + "id": 62, + "kind": "id", + "loc": emptyMap, + "text": "emptyMap", + }, + "id": 63, + "kind": "static_call", + "loc": emptyMap(), + }, + "id": 64, + "kind": "statement_let", + "loc": let m2: map = emptyMap();, + "name": { + "id": 57, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "type": { + "id": 61, + "keyStorageType": null, + "keyType": { + "id": 58, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 60, + "kind": "id", + "loc": varuint32, + "text": "varuint32", + }, + "valueType": { + "id": 59, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 67, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 68, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 69, + "kind": "method_call", + "loc": m2.set(1, 2), + "method": { + "id": 66, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "id": 65, + "kind": "id", + "loc": m2, + "text": "m2", + }, + }, + "id": 70, + "kind": "statement_expression", + "loc": m2.set(1, 2);, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 75, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 76, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 77, + "kind": "method_call", + "loc": self.m2.set(1, 2), + "method": { + "id": 74, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "aggregate": { + "id": 71, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 72, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "id": 73, + "kind": "field_access", + "loc": self.m2, + }, + }, + "id": 78, + "kind": "statement_expression", + "loc": self.m2.set(1, 2);, + }, + { + "expression": { + "id": 89, + "kind": "op_binary", + "left": { + "args": [ + { + "base": 10, + "id": 81, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 82, + "kind": "method_call", + "loc": m2.get(1), + "method": { + "id": 80, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "id": 79, + "kind": "id", + "loc": m2, + "text": "m2", + }, + }, + "loc": m2.get(1) + self.m2.get(1), + "op": "+", + "right": { + "args": [ + { + "base": 10, + "id": 87, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 88, + "kind": "method_call", + "loc": self.m2.get(1), + "method": { + "id": 86, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "aggregate": { + "id": 83, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 84, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "id": 85, + "kind": "field_access", + "loc": self.m2, + }, + }, + }, + "id": 90, + "kind": "statement_return", + "loc": return m2.get(1) + self.m2.get(1);, + }, + ], + }, + "isAbstract": false, + "isGetter": true, + "isInline": false, + "isMutating": true, + "isOverride": false, + "isVirtual": false, + "methodId": null, + "name": "test2", + "origin": "user", + "params": [], + "returns": { + "kind": "ref", + "name": "Int", + "optional": false, + }, + "self": { + "kind": "ref", + "name": "Main", + "optional": false, + }, + }, + }, + "header": null, + "init": { + "ast": { + "id": 94, + "kind": "contract_init", + "loc": contract Main { + m1: map; + m2: map; + + get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + } + + get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + } +}, + "params": [], + "statements": [], + }, + "params": [], + }, + "interfaces": [], + "kind": "contract", + "name": "Main", + "origin": "user", + "partialFieldCount": 0, + "receivers": [], + "signature": null, + "tlb": null, + "traits": [ + { + "ast": { + "attributes": [], + "declarations": [], + "id": 4, + "kind": "trait", + "loc": trait BaseTrait { + +}, + "name": { + "id": 3, + "kind": "id", + "loc": BaseTrait, + "text": "BaseTrait", + }, + "traits": [], + }, + "constants": [], + "dependsOn": [], + "fields": [], + "functions": Map {}, + "header": null, + "init": null, + "interfaces": [], + "kind": "trait", + "name": "BaseTrait", + "origin": "user", + "partialFieldCount": 0, + "receivers": [], + "signature": null, + "tlb": null, + "traits": [], + "uid": 1020, + }, + ], + "uid": 51099, + }, +] +`; + +exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint 2`] = `[]`; + exports[`resolveDescriptors should resolve descriptors for message-opcode-expr 1`] = ` [ { diff --git a/src/types/resolveABITypeRef.ts b/src/types/resolveABITypeRef.ts index 098f3fdfa..b343e421f 100644 --- a/src/types/resolveABITypeRef.ts +++ b/src/types/resolveABITypeRef.ts @@ -45,6 +45,10 @@ const intFormats: FormatDef = { ...intOptions, int257: { type: "int", format: 257 }, coins: { type: "uint", format: "coins" }, + varint16: { type: "int", format: "varint16" }, + varint32: { type: "int", format: "varint32" }, + varuint16: { type: "uint", format: "varuint16" }, + varuint32: { type: "uint", format: "varuint32" }, }; export const intMapFormats: FormatDef = { ...intFormats }; diff --git a/src/types/resolveSignatures.ts b/src/types/resolveSignatures.ts index 807c63300..e940bfe47 100644 --- a/src/types/resolveSignatures.ts +++ b/src/types/resolveSignatures.ts @@ -33,6 +33,8 @@ export function resolveSignatures(ctx: CompilerContext) { if (type === "int") { if (typeof format === "number") { return `int${format}`; + } else if (format === "varint16" || format === "varint32") { + return format; } else if (format !== null) { throwInternalCompilerError(`Unsupported int format: ${format}`); } @@ -42,6 +44,8 @@ export function resolveSignatures(ctx: CompilerContext) { return `uint${format}`; } else if (format === "coins") { return `coins`; + } else if (format === "varuint16" || format === "varuint32") { + return format; } else if (format !== null) { throwInternalCompilerError( `Unsupported uint format: ${format}`, diff --git a/src/types/test/map-value-as-varint.tact b/src/types/test/map-value-as-varint.tact new file mode 100644 index 000000000..fba54523e --- /dev/null +++ b/src/types/test/map-value-as-varint.tact @@ -0,0 +1,24 @@ +primitive Int; + +trait BaseTrait { + +} + +contract Main { + m1: map; + m2: map; + + get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + } + + get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + } +} diff --git a/src/types/test/map-value-as-varuint.tact b/src/types/test/map-value-as-varuint.tact new file mode 100644 index 000000000..759dc4637 --- /dev/null +++ b/src/types/test/map-value-as-varuint.tact @@ -0,0 +1,24 @@ +primitive Int; + +trait BaseTrait { + +} + +contract Main { + m1: map; + m2: map; + + get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + } + + get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + } +} diff --git a/stdlib/std/cells.tact b/stdlib/std/cells.tact index 99c5b7443..2e6bf5dab 100644 --- a/stdlib/std/cells.tact +++ b/stdlib/std/cells.tact @@ -32,6 +32,14 @@ extends native storeBit(self: Builder, value: Bool): Builder; asm extends fun storeCoins(self: Builder, value: Int): Builder { STVARUINT16 } +asm extends fun storeVarInt16(self: Builder, value: Int): Builder { STVARINT16 } + +asm extends fun storeVarInt32(self: Builder, value: Int): Builder { STVARINT32 } + +asm extends fun storeVarUint16(self: Builder, value: Int): Builder { STVARUINT16 } + +asm extends fun storeVarUint32(self: Builder, value: Int): Builder { STVARUINT32 } + asm(cell self) extends fun storeRef(self: Builder, cell: Cell): Builder { STREF } asm extends fun storeSlice(self: Builder, cell: Slice): Builder { STSLICER } diff --git a/stdlib/stdlib.fc b/stdlib/stdlib.fc index 91d461649..1e41379c3 100644 --- a/stdlib/stdlib.fc +++ b/stdlib/stdlib.fc @@ -327,6 +327,11 @@ cell preload_ref(slice s) asm "PLDREF"; (slice, int) load_grams(slice s) asm(-> 1 0) "LDGRAMS"; (slice, int) load_coins(slice s) asm(-> 1 0) "LDVARUINT16"; +(slice, int) load_varint16(slice s) asm(-> 1 0) "LDVARINT16"; +(slice, int) load_varint32(slice s) asm(-> 1 0) "LDVARINT32"; +(slice, int) load_varuint16(slice s) asm(-> 1 0) "LDVARUINT16"; +(slice, int) load_varuint32(slice s) asm(-> 1 0) "LDVARUINT32"; + ;;; Returns all but the first `0 ≤ len ≤ 1023` bits of `slice` [s]. slice skip_bits(slice s, int len) asm "SDSKIPFIRST"; (slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST"; @@ -450,6 +455,11 @@ builder store_slice(builder b, slice s) asm "STSLICER"; builder store_grams(builder b, int x) asm "STGRAMS"; builder store_coins(builder b, int x) asm "STVARUINT16"; +builder store_varint16(builder b, int x) asm "STVARINT16"; +builder store_varint32(builder b, int x) asm "STVARINT32"; +builder store_varuint16(builder b, int x) asm "STVARUINT16"; +builder store_varuint32(builder b, int x) asm "STVARUINT32"; + ;;; Stores dictionary `D` represented by `cell` [c] or `null` into `builder` [b]. ;;; In other words, stores a `1`-bit and a reference to [c] if [c] is not `null` and `0`-bit otherwise. builder store_dict(builder b, cell c) asm(c b) "STDICT"; diff --git a/tact.config.json b/tact.config.json index cad08c5fa..07bd8e4e2 100644 --- a/tact.config.json +++ b/tact.config.json @@ -80,8 +80,13 @@ "output": "./examples/output" }, { - "name": "maps", - "path": "./src/test/e2e-emulated/contracts/maps.tact", + "name": "maps1", + "path": "./src/test/e2e-emulated/contracts/maps1.tact", + "output": "./src/test/e2e-emulated/contracts/output" + }, + { + "name": "maps2", + "path": "./src/test/e2e-emulated/contracts/maps2.tact", "output": "./src/test/e2e-emulated/contracts/output" }, {