diff --git a/src/abi/typeFormulaParser.ts b/src/abi/typeFormulaParser.ts index ede40443..7806cd0c 100644 --- a/src/abi/typeFormulaParser.ts +++ b/src/abi/typeFormulaParser.ts @@ -30,9 +30,7 @@ export class TypeFormulaParser { // It's a type name. We push it as a simple string. stack.push(token); } - console.log({ stack }); } - console.log({ stack: JSON.stringify(stack) }); if (stack.length !== 1) { throw new Error(`Unexpected stack length at end of parsing: ${stack.length}`); } @@ -88,7 +86,7 @@ export class TypeFormulaParser { const typeFormula = new TypeFormula(typeName, [], typeParameters[0].name); return typeFormula; } - const typeFormula = new TypeFormula(typeName, typeParameters); + const typeFormula = new TypeFormula(typeName, typeParameters.reverse()); return typeFormula; } @@ -97,7 +95,6 @@ export class TypeFormulaParser { while (true) { const item = stack.pop(); - console.log({ item }); if (item === undefined) { throw new Error("Badly specified type parameters"); } diff --git a/src/smartcontracts/codec/managedDecimal.ts b/src/smartcontracts/codec/managedDecimal.ts index b6b9a7d8..976e7cc4 100644 --- a/src/smartcontracts/codec/managedDecimal.ts +++ b/src/smartcontracts/codec/managedDecimal.ts @@ -1,7 +1,7 @@ import BigNumber from "bignumber.js"; -import { BigUIntValue, ManagedDecimalType, ManagedDecimalValue, U64Value } from "../typesystem"; +import { BigUIntValue, ManagedDecimalType, ManagedDecimalValue, U32Value, U64Value } from "../typesystem"; import { BinaryCodec } from "./binary"; -import { cloneBuffer } from "./utils"; +import { bufferToBigInt, cloneBuffer } from "./utils"; export class ManagedDecimalCodec { private readonly binaryCodec: BinaryCodec; @@ -12,7 +12,6 @@ export class ManagedDecimalCodec { decodeNested(buffer: Buffer, type: ManagedDecimalType): [ManagedDecimalValue, number] { let [bytesValue, length] = this.binaryCodec.decodeNested(buffer, type); - console.log(11111, { bytesValue }); return [new ManagedDecimalValue(new BigNumber(1), 1), length]; } @@ -20,28 +19,34 @@ export class ManagedDecimalCodec { let payload = cloneBuffer(buffer); let empty = buffer.length == 0; if (empty) { - return new ManagedDecimalValue(new BigNumber(0), type.getScale()); + return new ManagedDecimalValue(new BigNumber(0), 2); } - console.log({ bsc: type }); - const decimalBuff = Buffer.from(this.binaryCodec.encodeTopLevel(new U64Value(type.getScale()))); - const bigUintSize = buffer.length - decimalBuff.length; // Remaining bytes are for BigUInt - console.log({ buffer, l: buffer.length, d: decimalBuff.length, bigUintSize, decimalBuff, sc: type }); + if (type.getMetadata() == "usize") { + const u32Size = 4; + const bigUintSize = buffer.length - u32Size; - // Read BigUInt (dynamic size) - const bigUintBuffer = payload.slice(0, bigUintSize); - const u64Buffer = payload.slice(bigUintSize, payload.length); - const bigUint = new BigNumber(bigUintBuffer.toString("hex"), 16); - console.log({ payload, bigUintBuffer, u64Buffer }); - const u64Value = new U64Value(u64Buffer.toString("hex")).toString(); + // Read BigUInt (dynamic size) + const bigUintBuffer = buffer.slice(0, bigUintSize); + const bigUint = new BigNumber(bigUintBuffer.toString("hex"), 16); - console.log({ payload, bigUintBuffer, u64Buffer, u64Value }); - return new ManagedDecimalValue(bigUint, type.getScale()); + const u32Offset = bigUintSize; + const u32 = buffer.readUInt32BE(u32Offset); + return new ManagedDecimalValue(bigUint, parseInt(u32.toString())); + } + let value = bufferToBigInt(payload); + return new ManagedDecimalValue(value, parseInt(type.getMetadata())); } encodeNested(value: ManagedDecimalValue): Buffer { + value.getType().getMetadata(); let buffers: Buffer[] = []; - buffers.push(Buffer.from(this.binaryCodec.encodeTopLevel(new BigUIntValue(value.valueOf())))); + if (value.getType().getMetadata() == "usize") { + buffers.push(Buffer.from(this.binaryCodec.encodeNested(new BigUIntValue(value.valueOf())))); + buffers.push(Buffer.from(this.binaryCodec.encodeNested(new U32Value(value.getScale())))); + } else { + buffers.push(Buffer.from(this.binaryCodec.encodeTopLevel(new BigUIntValue(value.valueOf())))); + } return Buffer.concat(buffers); } diff --git a/src/smartcontracts/interaction.local.net.spec.ts b/src/smartcontracts/interaction.local.net.spec.ts index 939e6326..6280181b 100644 --- a/src/smartcontracts/interaction.local.net.spec.ts +++ b/src/smartcontracts/interaction.local.net.spec.ts @@ -15,7 +15,7 @@ import { ResultsParser } from "./resultsParser"; import { TransactionWatcher } from "../transactionWatcher"; import { SmartContractQueriesController } from "../smartContractQueriesController"; import { QueryRunnerAdapter } from "../adapters/queryRunnerAdapter"; -import { ManagedDecimalValue } from "./typesystem"; +import { ManagedDecimalSignedValue, ManagedDecimalValue } from "./typesystem"; describe("test smart contract interactor", function () { let provider = createLocalnetProvider(); @@ -210,23 +210,23 @@ describe("test smart contract interactor", function () { } = await controller.deploy(deployTransaction); assert.isTrue(returnCode.isSuccess()); - // let startInteraction = ( - // contract.methods - // .returns_egld_decimal([]) - // .withGasLimit(8000000) - // .withChainID(network.ChainID) - // .withSender(alice.address) - // .withValue(1) - // ); - - // // start() - // let startTransaction = startInteraction - // .withSender(alice.address) - // .useThenIncrementNonceOf(alice.account) - // .buildTransaction(); + let returnEgldInteraction = ( + contract.methods + .returns_egld_decimal([]) + .withGasLimit(10000000) + .withChainID(network.ChainID) + .withSender(alice.address) + .withValue(1) + ); + + // returnEgld() + let returnEgldTransaction = returnEgldInteraction + .withSender(alice.address) + .useThenIncrementNonceOf(alice.account) + .buildTransaction(); let additionInteraction = contract.methods - .managed_decimal_addition([new ManagedDecimalValue(122, 5), new ManagedDecimalValue(3, 6)]) + .managed_decimal_addition([new ManagedDecimalValue(2, 2), new ManagedDecimalValue(3, 2)]) .withGasLimit(10000000) .withChainID(network.ChainID) .withSender(alice.address) @@ -238,31 +238,63 @@ describe("test smart contract interactor", function () { .useThenIncrementNonceOf(alice.account) .buildTransaction(); - // let mdLnInteraction = contract.methods - // .managed_decimal_ln([new ManagedDecimalValue(23, 9)]) - // .withGasLimit(10000000) - // .withChainID(network.ChainID) - // .withSender(alice.address) - // .withValue(0); - - // // mdLn() - // let mdLnTransaction = mdLnInteraction - // .withSender(alice.address) - // .useThenIncrementNonceOf(alice.account) - // .buildTransaction(); - - // await signTransaction({ transaction: startTransaction, wallet: alice }); - // let { bundle: bundleStart } = await controller.execute(startInteraction, startTransaction); - // assert.isTrue(bundleStart.returnCode.equals(ReturnCode.Ok)); - // assert.lengthOf(bundleStart.values, 1); - // assert.deepEqual(bundleStart.values[0], new ManagedDecimalValue(1, 18)); + // log + let mdLnInteraction = contract.methods + .managed_decimal_ln([new ManagedDecimalValue(23, 9)]) + .withGasLimit(10000000) + .withChainID(network.ChainID) + .withSender(alice.address) + .withValue(0); + + // mdLn() + let mdLnTransaction = mdLnInteraction + .withSender(alice.address) + .useThenIncrementNonceOf(alice.account) + .buildTransaction(); + + let additionVarInteraction = contract.methods + .managed_decimal_addition_var([ + new ManagedDecimalValue(378298000000, 9, true), + new ManagedDecimalValue(378298000000, 9, true), + ]) + .withGasLimit(50000000) + .withChainID(network.ChainID) + .withSender(alice.address) + .withValue(0); + + // addition() + let additionVarTransaction = additionVarInteraction + .withSender(alice.address) + .useThenIncrementNonceOf(alice.account) + .buildTransaction(); + + // returnEgld() + await signTransaction({ transaction: returnEgldTransaction, wallet: alice }); + let { bundle: bundleEgld } = await controller.execute(returnEgldInteraction, returnEgldTransaction); + assert.isTrue(bundleEgld.returnCode.equals(ReturnCode.Ok)); + assert.lengthOf(bundleEgld.values, 1); + assert.deepEqual(bundleEgld.values[0], new ManagedDecimalValue(1, 18)); + // addition with const decimals() await signTransaction({ transaction: additionTransaction, wallet: alice }); - let { bundle: bundleAddition } = await controller.execute(additionInteraction, additionTransaction); + let { bundle: bundleAdditionConst } = await controller.execute(additionInteraction, additionTransaction); + assert.isTrue(bundleAdditionConst.returnCode.equals(ReturnCode.Ok)); + assert.lengthOf(bundleAdditionConst.values, 1); + assert.deepEqual(bundleAdditionConst.values[0], new ManagedDecimalValue(5, 2)); + + // log + await signTransaction({ transaction: mdLnTransaction, wallet: alice }); + let { bundle: bundleMDLn } = await controller.execute(mdLnInteraction, mdLnTransaction); + assert.isTrue(bundleMDLn.returnCode.equals(ReturnCode.Ok)); + assert.lengthOf(bundleMDLn.values, 1); + assert.deepEqual(bundleMDLn.values[0], new ManagedDecimalSignedValue(3.135553845, 9)); + + // addition with var decimals + await signTransaction({ transaction: additionVarTransaction, wallet: alice }); + let { bundle: bundleAddition } = await controller.execute(additionVarInteraction, additionVarTransaction); assert.isTrue(bundleAddition.returnCode.equals(ReturnCode.Ok)); assert.lengthOf(bundleAddition.values, 1); - assert.deepEqual(bundleAddition.values[0], new ManagedDecimalValue(new BigNumber(5), 2)); - // assert.deepEqual(bundleAddition.values[0], new ManagedDecimalValue(new BigNumber(3.135553845), 9)); + assert.deepEqual(bundleAddition.values[0], new ManagedDecimalValue(new BigNumber(6254154138880), 9)); }); it("should interact with 'counter' (local testnet)", async function () { diff --git a/src/smartcontracts/typesystem/managedDecimal.ts b/src/smartcontracts/typesystem/managedDecimal.ts index bb48a426..39b6f233 100644 --- a/src/smartcontracts/typesystem/managedDecimal.ts +++ b/src/smartcontracts/typesystem/managedDecimal.ts @@ -3,19 +3,18 @@ import { Type, TypedValue } from "./types"; export class ManagedDecimalType extends Type { static ClassName = "ManagedDecimalType"; - private readonly scale: number; + private readonly scale: any; - constructor(scale: number) { - super("ManagedDecimal", undefined, undefined, scale); - this.scale = scale; + constructor(metadata: any) { + super("ManagedDecimal", undefined, undefined, metadata); } getClassName(): string { return ManagedDecimalType.ClassName; } - getScale(): number { - return this.scale; + getMetadata(): string { + return this.metadata; } } @@ -24,8 +23,8 @@ export class ManagedDecimalValue extends TypedValue { private readonly value: BigNumber; private readonly scale: number; - constructor(value: BigNumber.Value, scale: number) { - super(new ManagedDecimalType(scale)); + constructor(value: BigNumber.Value, scale: number, isVar: boolean = false) { + super(new ManagedDecimalType(isVar ? "usize" : scale)); this.value = new BigNumber(value); this.scale = scale; } @@ -85,9 +84,9 @@ export class ManagedDecimalSignedValue extends TypedValue { private readonly value: BigNumber; private readonly scale: number; - constructor(value: BigNumber, scale: number) { + constructor(value: BigNumber.Value, scale: number) { super(new ManagedDecimalType(scale)); - this.value = value; + this.value = new BigNumber(value); this.scale = scale; } diff --git a/src/smartcontracts/typesystem/typeMapper.ts b/src/smartcontracts/typesystem/typeMapper.ts index e156b71f..0c5fa0e8 100644 --- a/src/smartcontracts/typesystem/typeMapper.ts +++ b/src/smartcontracts/typesystem/typeMapper.ts @@ -76,8 +76,8 @@ export class TypeMapper { ["array64", (...typeParameters: Type[]) => new ArrayVecType(64, typeParameters[0])], ["array128", (...typeParameters: Type[]) => new ArrayVecType(128, typeParameters[0])], ["array256", (...typeParameters: Type[]) => new ArrayVecType(256, typeParameters[0])], - ["ManagedDecimal", (...metadata: any) => new ManagedDecimalType(parseInt(metadata))], - ["ManagedDecimalSigned", (...metadata: any) => new ManagedDecimalSignedType(parseInt(metadata))], + ["ManagedDecimal", (...metadata: any) => new ManagedDecimalType(metadata)], + ["ManagedDecimalSigned", (...metadata: any) => new ManagedDecimalSignedType(metadata)], ]); // For closed types, we hold actual type instances instead of type constructors / factories (no type parameters needed). diff --git a/src/testdata/basic-features.abi.json b/src/testdata/basic-features.abi.json index 2103af90..762e044c 100644 --- a/src/testdata/basic-features.abi.json +++ b/src/testdata/basic-features.abi.json @@ -1,16 +1,16 @@ { "buildInfo": { "rustc": { - "version": "1.80.0", - "commitHash": "051478957371ee0084a7c0913941d2a8c4757bb9", - "commitDate": "2024-07-21", + "version": "1.80.1", + "commitHash": "3f5fd8dd41153bc5fdca9427e9e05be2c767ba23", + "commitDate": "2024-08-06", "channel": "Stable", - "short": "rustc 1.80.0 (051478957 2024-07-21)" + "short": "rustc 1.80.1 (3f5fd8dd4 2024-08-06)" }, "contractCrate": { "name": "basic-features", "version": "0.0.0", - "gitVersion": "v0.52.3-10-gd1f19c0d4" + "gitVersion": "v0.52.3-147-g2659d2399" }, "framework": { "name": "multiversx-sc", @@ -23,6 +23,5768 @@ "outputs": [] }, "endpoints": [ + { + "name": "panicWithMessage", + "mutability": "mutable", + "inputs": [], + "outputs": [] + }, + { + "docs": [ + "Operation that has caused issues in the past" + ], + "name": "count_ones", + "mutability": "mutable", + "inputs": [ + { + "name": "arg", + "type": "u64" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "endpoint_with_mutable_arg", + "mutability": "mutable", + "inputs": [ + { + "name": "arg1", + "type": "BigUint" + }, + { + "name": "arg2", + "type": "u64" + }, + { + "name": "arg3", + "type": "u32" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "sqrt_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "sqrt_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "log2_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "log2_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "pow_big_int", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "u32" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "pow_big_int_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "u32" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "pow_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "u32" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "pow_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "u32" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "big_uint_to_u64", + "mutability": "mutable", + "inputs": [ + { + "name": "bu", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "optional", + "multi_result": true + } + ] + }, + { + "name": "biguint_overwrite_u64", + "mutability": "mutable", + "inputs": [ + { + "name": "bu", + "type": "BigUint" + }, + { + "name": "small", + "type": "u64" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "big_uint_zero", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "big_uint_from_u64_1", + "mutability": "mutable", + "inputs": [ + { + "name": "small", + "type": "u64" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "big_uint_from_u64_2", + "mutability": "mutable", + "inputs": [ + { + "name": "small", + "type": "u64" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "biguint_from_u128", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "big_uint_from_managed_buffer", + "mutability": "mutable", + "inputs": [ + { + "name": "mb", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "big_uint_from_managed_buffer_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "mb", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "big_int_zero", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "big_int_from_i64_1", + "mutability": "mutable", + "inputs": [ + { + "name": "small", + "type": "i64" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "big_int_from_i64_2", + "mutability": "mutable", + "inputs": [ + { + "name": "small", + "type": "i64" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "big_uint_eq_u64", + "mutability": "mutable", + "inputs": [ + { + "name": "bi", + "type": "BigUint" + }, + { + "name": "small", + "type": "u64" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "big_int_to_i64", + "mutability": "mutable", + "inputs": [ + { + "name": "bi", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "optional", + "multi_result": true + } + ] + }, + { + "name": "bigint_overwrite_i64", + "mutability": "mutable", + "inputs": [ + { + "name": "bi", + "type": "BigInt" + }, + { + "name": "small", + "type": "i64" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "add_big_int", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "add_big_int_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "add_big_uint_big_int", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "add_big_int_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "add_big_uint_big_int_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "add_big_int_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "add_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "add_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "sub_big_int", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "sub_big_int_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "sub_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "sub_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "mul_big_int", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "mul_big_int_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "mul_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "mul_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "div_big_int", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "div_big_int_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "div_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "div_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "rem_big_int", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "rem_big_int_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "rem_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "rem_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "add_assign_big_int", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "add_assign_big_int_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "add_assign_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "add_assign_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "sub_assign_big_int", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "sub_assign_big_int_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "sub_assign_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "sub_assign_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "mul_assign_big_int", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "mul_assign_big_int_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "mul_assign_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "mul_assign_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "div_assign_big_int", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "div_assign_big_int_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "div_assign_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "div_assign_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "rem_assign_big_int", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "rem_assign_big_int_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigInt" + }, + { + "name": "b", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "rem_assign_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "rem_assign_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "bit_and_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "bit_and_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "bit_or_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "bit_or_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "bit_xor_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "bit_xor_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "bit_and_assign_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "bit_and_assign_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "bit_or_assign_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "bit_or_assign_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "bit_xor_assign_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "bit_xor_assign_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "shr_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "u32" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "shr_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "u32" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "shl_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "u32" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "shl_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "u32" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "shr_assign_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "u32" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "shr_assign_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "u32" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "shl_assign_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "u32" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "shl_assign_big_uint_ref", + "mutability": "mutable", + "inputs": [ + { + "name": "a", + "type": "BigUint" + }, + { + "name": "b", + "type": "u32" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "get_block_timestamp", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "u64" + } + ] + }, + { + "name": "get_block_nonce", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "u64" + } + ] + }, + { + "name": "get_block_round", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "u64" + } + ] + }, + { + "name": "get_block_epoch", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "u64" + } + ] + }, + { + "name": "get_block_random_seed", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "array48" + } + ] + }, + { + "name": "get_prev_block_timestamp", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "u64" + } + ] + }, + { + "name": "get_prev_block_nonce", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "u64" + } + ] + }, + { + "name": "get_prev_block_round", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "u64" + } + ] + }, + { + "name": "get_prev_block_epoch", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "u64" + } + ] + }, + { + "name": "get_prev_block_random_seed", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "array48" + } + ] + }, + { + "name": "get_caller", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "Address" + } + ] + }, + { + "name": "get_owner_address", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "Address" + } + ] + }, + { + "name": "get_shard_of_address", + "mutability": "mutable", + "inputs": [ + { + "name": "address", + "type": "Address" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "is_smart_contract", + "mutability": "mutable", + "inputs": [ + { + "name": "address", + "type": "Address" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "get_state_root_hash", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "array32" + } + ] + }, + { + "name": "get_tx_hash", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "array32" + } + ] + }, + { + "name": "get_gas_left", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u64" + } + ] + }, + { + "name": "get_cumulated_validator_rewards", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "get_code_metadata", + "mutability": "mutable", + "inputs": [ + { + "name": "address", + "type": "Address" + } + ], + "outputs": [ + { + "type": "CodeMetadata" + } + ] + }, + { + "name": "is_builtin_function", + "mutability": "mutable", + "inputs": [ + { + "name": "function_name", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "codec_err_finish", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "CodecErrorTestType" + } + ] + }, + { + "name": "codec_err_storage_key", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "i32" + } + ] + }, + { + "name": "codec_err_storage_get", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "CodecErrorTestType" + } + ] + }, + { + "name": "codec_err_storage_set", + "mutability": "mutable", + "inputs": [], + "outputs": [] + }, + { + "name": "codec_err_event_topic", + "mutability": "mutable", + "inputs": [], + "outputs": [] + }, + { + "name": "codec_err_event_data", + "mutability": "mutable", + "inputs": [], + "outputs": [] + }, + { + "docs": [ + "Never actually calls any deploy/upgrade, so it is appropriate in this contract.", + "It just covers contract init serialization errors." + ], + "name": "codec_err_contract_init", + "mutability": "mutable", + "inputs": [], + "outputs": [] + }, + { + "docs": [ + "Never actually calls any async/sync call, so it is appropriate in this contract.", + "It just covers contract call serialization errors." + ], + "name": "codec_err_contract_call", + "mutability": "mutable", + "inputs": [], + "outputs": [] + }, + { + "name": "compute_sha256", + "mutability": "mutable", + "inputs": [ + { + "name": "input", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "array32" + } + ] + }, + { + "name": "compute_keccak256", + "mutability": "mutable", + "inputs": [ + { + "name": "input", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "array32" + } + ] + }, + { + "name": "compute_ripemd160", + "mutability": "mutable", + "inputs": [ + { + "name": "input", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "array20" + } + ] + }, + { + "name": "verify_bls_signature", + "mutability": "mutable", + "inputs": [ + { + "name": "key", + "type": "bytes" + }, + { + "name": "message", + "type": "bytes" + }, + { + "name": "signature", + "type": "bytes" + } + ], + "outputs": [] + }, + { + "name": "verify_ed25519_signature", + "mutability": "mutable", + "inputs": [ + { + "name": "key", + "type": "bytes" + }, + { + "name": "message", + "type": "bytes" + }, + { + "name": "signature", + "type": "bytes" + } + ], + "outputs": [] + }, + { + "name": "verify_secp256k1_signature", + "mutability": "mutable", + "inputs": [ + { + "name": "key", + "type": "bytes" + }, + { + "name": "message", + "type": "bytes" + }, + { + "name": "signature", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "compute_secp256k1_der_signature", + "mutability": "mutable", + "inputs": [ + { + "name": "r", + "type": "bytes" + }, + { + "name": "s", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "bytes" + } + ] + }, + { + "name": "echo_u64", + "mutability": "mutable", + "inputs": [ + { + "name": "i", + "type": "u64" + } + ], + "outputs": [ + { + "type": "u64" + } + ] + }, + { + "name": "echo_i64", + "mutability": "mutable", + "inputs": [ + { + "name": "i", + "type": "i64" + } + ], + "outputs": [ + { + "type": "i64" + } + ] + }, + { + "name": "echo_i32", + "mutability": "mutable", + "inputs": [ + { + "name": "i", + "type": "i32" + } + ], + "outputs": [ + { + "type": "i32" + } + ] + }, + { + "name": "echo_u32", + "mutability": "mutable", + "inputs": [ + { + "name": "i", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "echo_isize", + "mutability": "mutable", + "inputs": [ + { + "name": "i", + "type": "i32" + } + ], + "outputs": [ + { + "type": "i32" + } + ] + }, + { + "name": "echo_usize", + "mutability": "mutable", + "inputs": [ + { + "name": "i", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "echo_i8", + "mutability": "mutable", + "inputs": [ + { + "name": "i", + "type": "i8" + } + ], + "outputs": [ + { + "type": "i8" + } + ] + }, + { + "name": "echo_u8", + "mutability": "mutable", + "inputs": [ + { + "name": "i", + "type": "u8" + } + ], + "outputs": [ + { + "type": "u8" + } + ] + }, + { + "name": "echo_bool", + "mutability": "mutable", + "inputs": [ + { + "name": "i", + "type": "bool" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "echo_opt_bool", + "mutability": "mutable", + "inputs": [ + { + "name": "i", + "type": "Option" + } + ], + "outputs": [ + { + "type": "Option" + } + ] + }, + { + "name": "echo_multi_value_u32", + "mutability": "mutable", + "inputs": [ + { + "name": "m", + "type": "variadic", + "multi_arg": true + } + ], + "outputs": [ + { + "type": "u32" + }, + { + "type": "variadic", + "multi_result": true + } + ] + }, + { + "name": "echo_multi_value_tuples", + "mutability": "mutable", + "inputs": [ + { + "name": "m", + "type": "variadic>", + "multi_arg": true + } + ], + "outputs": [ + { + "type": "variadic>", + "multi_result": true + } + ] + }, + { + "name": "echo_ser_example_2", + "mutability": "mutable", + "inputs": [ + { + "name": "se", + "type": "ExampleEnumWithFields" + } + ], + "outputs": [ + { + "type": "ExampleEnumWithFields" + } + ] + }, + { + "name": "echo_simple_enum", + "mutability": "readonly", + "inputs": [ + { + "name": "se", + "type": "ExampleEnumSimple" + } + ], + "outputs": [ + { + "type": "ExampleEnumSimple" + } + ] + }, + { + "name": "finish_simple_enum_variant_1", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "ExampleEnumSimple" + } + ] + }, + { + "name": "echo_arrayvec", + "mutability": "readonly", + "inputs": [ + { + "name": "av", + "type": "List" + } + ], + "outputs": [ + { + "type": "List" + } + ] + }, + { + "name": "echo_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "bi", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "echo_big_int", + "mutability": "mutable", + "inputs": [ + { + "name": "bi", + "type": "BigInt" + } + ], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "echo_managed_buffer", + "mutability": "mutable", + "inputs": [ + { + "name": "mb", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "bytes" + } + ] + }, + { + "name": "echo_managed_address", + "mutability": "mutable", + "inputs": [ + { + "name": "ma", + "type": "Address" + } + ], + "outputs": [ + { + "type": "Address" + } + ] + }, + { + "docs": [ + "This tests that nested serialization of big ints within unmanaged types works." + ], + "name": "echo_big_int_managed_vec", + "mutability": "mutable", + "inputs": [ + { + "name": "x", + "type": "List" + } + ], + "outputs": [ + { + "type": "List" + } + ] + }, + { + "docs": [ + "This tests that nested serialization of big ints within unmanaged types works." + ], + "name": "echo_big_int_tuple", + "mutability": "mutable", + "inputs": [ + { + "name": "x", + "type": "tuple" + } + ], + "outputs": [ + { + "type": "tuple" + } + ] + }, + { + "docs": [ + "This tests that nested serialization of big ints within unmanaged types works." + ], + "name": "echo_big_int_option", + "mutability": "mutable", + "inputs": [ + { + "name": "x", + "type": "Option" + } + ], + "outputs": [ + { + "type": "Option" + } + ] + }, + { + "name": "echo_tuple_into_multiresult", + "mutability": "mutable", + "inputs": [ + { + "name": "addr", + "type": "Address" + }, + { + "name": "vec", + "type": "List" + } + ], + "outputs": [ + { + "type": "Address" + }, + { + "type": "List" + } + ] + }, + { + "name": "echo_managed_vec_of_managed_vec", + "mutability": "mutable", + "inputs": [ + { + "name": "mv", + "type": "List>" + } + ], + "outputs": [ + { + "type": "List>" + } + ] + }, + { + "name": "echo_managed_vec_of_token_identifier", + "mutability": "mutable", + "inputs": [ + { + "name": "mv", + "type": "List" + } + ], + "outputs": [ + { + "type": "List" + } + ] + }, + { + "name": "echo_varags_managed_eager", + "mutability": "mutable", + "inputs": [ + { + "name": "m", + "type": "variadic", + "multi_arg": true + } + ], + "outputs": [ + { + "type": "u32" + }, + { + "type": "variadic", + "multi_result": true + } + ] + }, + { + "name": "echo_varags_managed_sum", + "mutability": "mutable", + "inputs": [ + { + "name": "m", + "type": "variadic>", + "multi_arg": true + } + ], + "outputs": [ + { + "type": "variadic>", + "multi_result": true + } + ] + }, + { + "name": "compute_get_values", + "mutability": "mutable", + "inputs": [ + { + "name": "curve_bitsize", + "type": "u32" + } + ], + "outputs": [ + { + "type": "tuple" + } + ] + }, + { + "name": "compute_create_ec", + "mutability": "mutable", + "inputs": [ + { + "name": "curve", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "tuple" + } + ] + }, + { + "name": "compute_get_ec_length", + "mutability": "mutable", + "inputs": [ + { + "name": "curve_bitsize", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "compute_get_priv_key_byte_length", + "mutability": "mutable", + "inputs": [ + { + "name": "curve_bitsize", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "compute_ec_add", + "mutability": "mutable", + "inputs": [ + { + "name": "curve_bitsize", + "type": "u32" + }, + { + "name": "x_first_point", + "type": "BigUint" + }, + { + "name": "y_first_point", + "type": "BigUint" + }, + { + "name": "x_second_point", + "type": "BigUint" + }, + { + "name": "y_second_point", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + }, + { + "type": "BigUint" + } + ] + }, + { + "name": "compute_ec_double", + "mutability": "mutable", + "inputs": [ + { + "name": "curve_bitsize", + "type": "u32" + }, + { + "name": "x_point", + "type": "BigUint" + }, + { + "name": "y_point", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "BigUint" + }, + { + "type": "BigUint" + } + ] + }, + { + "name": "compute_is_on_curve_ec", + "mutability": "mutable", + "inputs": [ + { + "name": "curve_bitsize", + "type": "u32" + }, + { + "name": "x_point", + "type": "BigUint" + }, + { + "name": "y_point", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "compute_scalar_mult", + "mutability": "mutable", + "inputs": [ + { + "name": "curve_bitsize", + "type": "u32" + }, + { + "name": "x_point", + "type": "BigUint" + }, + { + "name": "y_point", + "type": "BigUint" + }, + { + "name": "data", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "BigUint" + }, + { + "type": "BigUint" + } + ] + }, + { + "name": "compute_scalar_base_mult", + "mutability": "mutable", + "inputs": [ + { + "name": "curve_bitsize", + "type": "u32" + }, + { + "name": "data", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "BigUint" + }, + { + "type": "BigUint" + } + ] + }, + { + "name": "compute_marshal_ec", + "mutability": "mutable", + "inputs": [ + { + "name": "curve_bitsize", + "type": "u32" + }, + { + "name": "x_pair", + "type": "BigUint" + }, + { + "name": "y_pair", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "bytes" + } + ] + }, + { + "name": "compute_marshal_compressed_ec", + "mutability": "mutable", + "inputs": [ + { + "name": "curve_bitsize", + "type": "u32" + }, + { + "name": "x_pair", + "type": "BigUint" + }, + { + "name": "y_pair", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "bytes" + } + ] + }, + { + "name": "compute_unmarshal_ec", + "mutability": "mutable", + "inputs": [ + { + "name": "curve_bitsize", + "type": "u32" + }, + { + "name": "data", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "BigUint" + }, + { + "type": "BigUint" + } + ] + }, + { + "name": "compute_unmarshal_compressed_ec", + "mutability": "mutable", + "inputs": [ + { + "name": "curve_bitsize", + "type": "u32" + }, + { + "name": "data", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "BigUint" + }, + { + "type": "BigUint" + } + ] + }, + { + "name": "compute_generate_key_ec", + "mutability": "mutable", + "inputs": [ + { + "name": "curve_bitsize", + "type": "u32" + } + ], + "outputs": [ + { + "type": "BigUint" + }, + { + "type": "BigUint" + }, + { + "type": "bytes" + } + ] + }, + { + "name": "logEventA", + "mutability": "mutable", + "inputs": [ + { + "name": "data", + "type": "u32" + } + ], + "outputs": [] + }, + { + "docs": [ + "Logs `event_a` a repeated number of times." + ], + "name": "logEventARepeat", + "mutability": "mutable", + "inputs": [ + { + "name": "num_logs", + "type": "u32" + } + ], + "outputs": [] + }, + { + "name": "logEventB", + "mutability": "mutable", + "inputs": [ + { + "name": "arg1", + "type": "BigUint" + }, + { + "name": "arg2", + "type": "Address" + }, + { + "name": "data", + "type": "variadic", + "multi_arg": true + } + ], + "outputs": [] + }, + { + "name": "only_owner_endpoint", + "onlyOwner": true, + "mutability": "mutable", + "inputs": [], + "outputs": [] + }, + { + "name": "only_user_account_endpoint", + "mutability": "mutable", + "inputs": [], + "outputs": [] + }, + { + "name": "require_equals", + "mutability": "readonly", + "inputs": [ + { + "name": "a", + "type": "u32" + }, + { + "name": "b", + "type": "u32" + } + ], + "outputs": [] + }, + { + "name": "sc_panic", + "mutability": "readonly", + "inputs": [], + "outputs": [] + }, + { + "name": "maddress_from_array", + "mutability": "mutable", + "inputs": [ + { + "name": "array", + "type": "array32" + } + ], + "outputs": [ + { + "type": "Address" + } + ] + }, + { + "name": "maddress_from_managed_buffer", + "mutability": "mutable", + "inputs": [ + { + "name": "managed_buffer", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "Address" + } + ] + }, + { + "name": "mbuffer_new", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "bytes" + } + ] + }, + { + "name": "mbuffer_concat", + "mutability": "mutable", + "inputs": [ + { + "name": "mb1", + "type": "bytes" + }, + { + "name": "mb2", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "bytes" + } + ] + }, + { + "name": "mbuffer_copy_slice", + "mutability": "mutable", + "inputs": [ + { + "name": "mb", + "type": "bytes" + }, + { + "name": "starting_position", + "type": "u32" + }, + { + "name": "slice_len", + "type": "u32" + } + ], + "outputs": [ + { + "type": "optional", + "multi_result": true + } + ] + }, + { + "name": "mbuffer_set_random", + "mutability": "mutable", + "inputs": [ + { + "name": "nr_bytes", + "type": "u32" + } + ], + "outputs": [ + { + "type": "bytes" + } + ] + }, + { + "name": "mbuffer_eq", + "mutability": "mutable", + "inputs": [ + { + "name": "mb1", + "type": "bytes" + }, + { + "name": "mb2", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "managed_address_zero", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "Address" + } + ] + }, + { + "name": "managed_address_eq", + "mutability": "mutable", + "inputs": [ + { + "name": "mb1", + "type": "Address" + }, + { + "name": "mb2", + "type": "Address" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "managed_vec_new", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "List" + } + ] + }, + { + "name": "managed_vec_biguint_push", + "mutability": "mutable", + "inputs": [ + { + "name": "mv", + "type": "List" + }, + { + "name": "item", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "List" + } + ] + }, + { + "name": "managed_vec_biguint_eq", + "mutability": "mutable", + "inputs": [ + { + "name": "mv1", + "type": "List" + }, + { + "name": "mv2", + "type": "List" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "managed_vec_address_push", + "mutability": "mutable", + "inputs": [ + { + "name": "mv", + "type": "List
" + }, + { + "name": "item", + "type": "Address" + } + ], + "outputs": [ + { + "type": "List
" + } + ] + }, + { + "name": "managed_vec_set", + "mutability": "mutable", + "inputs": [ + { + "name": "mv", + "type": "List" + }, + { + "name": "index", + "type": "u32" + }, + { + "name": "item", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "List" + } + ] + }, + { + "name": "managed_vec_remove", + "mutability": "mutable", + "inputs": [ + { + "name": "mv", + "type": "List" + }, + { + "name": "index", + "type": "u32" + } + ], + "outputs": [ + { + "type": "List" + } + ] + }, + { + "name": "managed_vec_find", + "mutability": "mutable", + "inputs": [ + { + "name": "mv", + "type": "List" + }, + { + "name": "item", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "Option" + } + ] + }, + { + "name": "managed_vec_contains", + "mutability": "mutable", + "inputs": [ + { + "name": "mv", + "type": "List" + }, + { + "name": "item", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "managed_ref_explicit", + "mutability": "mutable", + "inputs": [ + { + "name": "mv", + "type": "List" + }, + { + "name": "index", + "type": "u32" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "storage_read_raw", + "mutability": "mutable", + "inputs": [ + { + "name": "storage_key", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "bytes" + } + ] + }, + { + "name": "storage_write_raw", + "mutability": "mutable", + "inputs": [ + { + "name": "storage_key", + "type": "bytes" + }, + { + "name": "value", + "type": "bytes" + } + ], + "outputs": [] + }, + { + "name": "storage_read_from_address", + "mutability": "mutable", + "inputs": [ + { + "name": "address", + "type": "Address" + }, + { + "name": "storage_key", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "bytes" + } + ] + }, + { + "name": "load_bytes", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "bytes" + } + ] + }, + { + "name": "load_big_uint", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "load_big_int", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "load_u64", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u64" + } + ] + }, + { + "name": "load_usize", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "load_i64", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "i64" + } + ] + }, + { + "name": "load_bool", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "load_addr", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "Address" + } + ] + }, + { + "name": "load_opt_addr", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "optional
", + "multi_result": true + } + ] + }, + { + "name": "is_empty_opt_addr", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "get_nr_to_clear", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "clear_storage_value", + "mutability": "mutable", + "inputs": [], + "outputs": [] + }, + { + "name": "load_ser_2", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "ExampleEnumWithFields" + } + ] + }, + { + "name": "load_map1", + "mutability": "mutable", + "inputs": [ + { + "name": "addr", + "type": "Address" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "load_map2", + "mutability": "mutable", + "inputs": [ + { + "name": "addr1", + "type": "Address" + }, + { + "name": "addr2", + "type": "Address" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "load_map3", + "mutability": "mutable", + "inputs": [ + { + "name": "x", + "type": "u32" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "load_from_address_raw", + "mutability": "mutable", + "inputs": [ + { + "name": "address", + "type": "Address" + }, + { + "name": "key", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "bytes" + } + ] + }, + { + "name": "store_bytes", + "mutability": "mutable", + "inputs": [ + { + "name": "bi", + "type": "bytes" + } + ], + "outputs": [] + }, + { + "name": "store_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "bi", + "type": "BigUint" + } + ], + "outputs": [] + }, + { + "name": "store_big_int", + "mutability": "mutable", + "inputs": [ + { + "name": "bi", + "type": "BigInt" + } + ], + "outputs": [] + }, + { + "name": "store_usize", + "mutability": "mutable", + "inputs": [ + { + "name": "i", + "type": "u32" + } + ], + "outputs": [] + }, + { + "name": "store_i32", + "mutability": "mutable", + "inputs": [ + { + "name": "i", + "type": "i32" + } + ], + "outputs": [] + }, + { + "name": "store_u64", + "mutability": "mutable", + "inputs": [ + { + "name": "i", + "type": "u64" + } + ], + "outputs": [] + }, + { + "name": "store_i64", + "mutability": "mutable", + "inputs": [ + { + "name": "i", + "type": "i64" + } + ], + "outputs": [] + }, + { + "name": "store_bool", + "mutability": "mutable", + "inputs": [ + { + "name": "i", + "type": "bool" + } + ], + "outputs": [] + }, + { + "name": "store_addr", + "mutability": "mutable", + "inputs": [ + { + "name": "arg", + "type": "Address" + } + ], + "outputs": [] + }, + { + "name": "store_opt_addr", + "mutability": "mutable", + "inputs": [ + { + "name": "opt_addr", + "type": "optional
", + "multi_arg": true + } + ], + "outputs": [] + }, + { + "name": "store_ser_2", + "mutability": "mutable", + "inputs": [ + { + "name": "arg", + "type": "ExampleEnumWithFields" + } + ], + "outputs": [] + }, + { + "name": "store_map1", + "mutability": "mutable", + "inputs": [ + { + "name": "addr", + "type": "Address" + }, + { + "name": "bi", + "type": "BigUint" + } + ], + "outputs": [] + }, + { + "name": "store_map2", + "mutability": "mutable", + "inputs": [ + { + "name": "addr1", + "type": "Address" + }, + { + "name": "addr2", + "type": "Address" + }, + { + "name": "bi", + "type": "BigUint" + } + ], + "outputs": [] + }, + { + "name": "store_map3", + "mutability": "mutable", + "inputs": [ + { + "name": "x", + "type": "u32" + }, + { + "name": "b", + "type": "bool" + } + ], + "outputs": [] + }, + { + "name": "store_reserved_i64", + "mutability": "mutable", + "inputs": [ + { + "name": "i", + "type": "i64" + } + ], + "outputs": [] + }, + { + "name": "store_reserved_big_uint", + "mutability": "mutable", + "inputs": [ + { + "name": "i", + "type": "BigUint" + } + ], + "outputs": [] + }, + { + "name": "store_reserved_vec_u8", + "mutability": "mutable", + "inputs": [ + { + "name": "i", + "type": "bytes" + } + ], + "outputs": [] + }, + { + "name": "address_to_id_mapper_get_id", + "mutability": "mutable", + "inputs": [ + { + "name": "address", + "type": "Address" + } + ], + "outputs": [ + { + "type": "u64" + } + ] + }, + { + "name": "address_to_id_mapper_get_id_non_zero", + "mutability": "mutable", + "inputs": [ + { + "name": "address", + "type": "Address" + } + ], + "outputs": [ + { + "type": "u64" + } + ] + }, + { + "name": "address_to_id_mapper_get_address", + "mutability": "mutable", + "inputs": [ + { + "name": "address_id", + "type": "u64" + } + ], + "outputs": [ + { + "type": "Option
" + } + ] + }, + { + "name": "address_to_id_mapper_contains", + "mutability": "mutable", + "inputs": [ + { + "name": "address_id", + "type": "u64" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "address_to_id_mapper_set", + "mutability": "mutable", + "inputs": [ + { + "name": "address", + "type": "Address" + } + ], + "outputs": [ + { + "type": "u64" + } + ] + }, + { + "name": "address_to_id_mapper_get_id_or_insert", + "mutability": "mutable", + "inputs": [ + { + "name": "address", + "type": "Address" + } + ], + "outputs": [ + { + "type": "u64" + } + ] + }, + { + "name": "address_to_id_mapper_remove_by_id", + "mutability": "mutable", + "inputs": [ + { + "name": "address_id", + "type": "u64" + } + ], + "outputs": [ + { + "type": "Option
" + } + ] + }, + { + "name": "address_to_id_mapper_remove_by_address", + "mutability": "mutable", + "inputs": [ + { + "name": "address", + "type": "Address" + } + ], + "outputs": [ + { + "type": "u64" + } + ] + }, + { + "name": "getListMapper", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "variadic", + "multi_result": true + } + ] + }, + { + "name": "listMapperPushBack", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [] + }, + { + "name": "listMapperPushFront", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [] + }, + { + "name": "listMapperPopFront", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "optional", + "multi_result": true + } + ] + }, + { + "name": "listMapperPopBack", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "optional", + "multi_result": true + } + ] + }, + { + "name": "listMapperFront", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "optional", + "multi_result": true + } + ] + }, + { + "name": "listMapperBack", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "optional", + "multi_result": true + } + ] + }, + { + "name": "listMapperPushAfter", + "mutability": "mutable", + "inputs": [ + { + "name": "node_id", + "type": "u32" + }, + { + "name": "element", + "type": "u32" + } + ], + "outputs": [ + { + "type": "optional", + "multi_result": true + } + ] + }, + { + "name": "listMapperPushBefore", + "mutability": "mutable", + "inputs": [ + { + "name": "node_id", + "type": "u32" + }, + { + "name": "element", + "type": "u32" + } + ], + "outputs": [ + { + "type": "optional", + "multi_result": true + } + ] + }, + { + "name": "listMapperRemoveNode", + "mutability": "mutable", + "inputs": [ + { + "name": "node_id", + "type": "u32" + } + ], + "outputs": [] + }, + { + "name": "listMapperRemoveNodeById", + "mutability": "mutable", + "inputs": [ + { + "name": "node_id", + "type": "u32" + } + ], + "outputs": [ + { + "type": "optional", + "multi_result": true + } + ] + }, + { + "name": "listMapperSetValue", + "mutability": "mutable", + "inputs": [ + { + "name": "node_id", + "type": "u32" + }, + { + "name": "new_value", + "type": "u32" + } + ], + "outputs": [] + }, + { + "name": "listMapperSetValueById", + "mutability": "mutable", + "inputs": [ + { + "name": "node_id", + "type": "u32" + }, + { + "name": "new_value", + "type": "u32" + } + ], + "outputs": [] + }, + { + "name": "listMapperIterateByHand", + "mutability": "mutable", + "inputs": [ + { + "name": "node_id", + "type": "u32" + } + ], + "outputs": [ + { + "type": "variadic", + "multi_result": true + } + ] + }, + { + "name": "listMapperIterateByIter", + "mutability": "mutable", + "inputs": [ + { + "name": "node_id", + "type": "u32" + } + ], + "outputs": [ + { + "type": "variadic", + "multi_result": true + } + ] + }, + { + "name": "queue_mapper", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "variadic", + "multi_result": true + } + ] + }, + { + "name": "queue_mapper_push_back", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [] + }, + { + "name": "queue_mapper_pop_front", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "Option" + } + ] + }, + { + "name": "queue_mapper_front", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "map_mapper", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "variadic>", + "multi_result": true + } + ] + }, + { + "name": "map_mapper_keys", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "variadic", + "multi_result": true + } + ] + }, + { + "name": "map_mapper_values", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "variadic", + "multi_result": true + } + ] + }, + { + "name": "map_mapper_insert", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + }, + { + "name": "value", + "type": "u32" + } + ], + "outputs": [ + { + "type": "Option" + } + ] + }, + { + "name": "map_mapper_contains_key", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "map_mapper_get", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "Option" + } + ] + }, + { + "name": "map_mapper_remove", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "Option" + } + ] + }, + { + "name": "map_mapper_entry_or_default_update_increment", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + }, + { + "name": "increment", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "map_mapper_entry_or_insert_default", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + }, + { + "name": "default", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "map_mapper_entry_and_modify", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + }, + { + "name": "increment", + "type": "u32" + }, + { + "name": "otherwise", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "map_mapper_entry_or_insert_with_key", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + }, + { + "name": "key_increment", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "map_storage_mapper_view", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "variadic", + "multi_result": true + } + ] + }, + { + "name": "map_storage_mapper_insert_default", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "map_storage_mapper_contains_key", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "map_storage_mapper_get", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "variadic", + "multi_result": true + } + ] + }, + { + "name": "map_storage_mapper_insert_value", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + }, + { + "name": "key", + "type": "u32" + }, + { + "name": "value", + "type": "u32" + } + ], + "outputs": [ + { + "type": "Option" + } + ] + }, + { + "name": "map_storage_mapper_get_value", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + }, + { + "name": "key", + "type": "u32" + } + ], + "outputs": [ + { + "type": "Option" + } + ] + }, + { + "name": "map_storage_mapper_remove", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "map_storage_mapper_clear", + "mutability": "mutable", + "inputs": [], + "outputs": [] + }, + { + "name": "map_storage_mapper_entry_or_default_update_increment", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + }, + { + "name": "key", + "type": "u32" + }, + { + "name": "increment", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "map_storage_mapper_entry_and_modify_increment_or_default", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + }, + { + "name": "key", + "type": "u32" + }, + { + "name": "value", + "type": "u32" + }, + { + "name": "other", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "map_storage_mapper_entry_or_default_update", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + }, + { + "name": "key", + "type": "u32" + }, + { + "name": "value", + "type": "u32" + } + ], + "outputs": [ + { + "type": "Option" + } + ] + }, + { + "name": "set_mapper", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "variadic", + "multi_result": true + } + ] + }, + { + "name": "set_mapper_insert", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "set_mapper_contains", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "set_mapper_remove", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "set_mapper_front", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "set_mapper_back", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "set_mapper_next", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "set_mapper_previous", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "set_mapper_iter_from_and_count", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "map_my_single_value_mapper", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "BigInt" + } + ] + }, + { + "name": "my_single_value_mapper_increment_1", + "mutability": "mutable", + "inputs": [ + { + "name": "amount", + "type": "BigInt" + } + ], + "outputs": [] + }, + { + "docs": [ + "Same as my_single_value_mapper_increment_1, but expressed more compactly." + ], + "name": "my_single_value_mapper_increment_2", + "mutability": "mutable", + "inputs": [ + { + "name": "amount", + "type": "BigInt" + } + ], + "outputs": [] + }, + { + "name": "my_single_value_mapper_subtract_with_require", + "mutability": "mutable", + "inputs": [ + { + "name": "amount", + "type": "BigInt" + } + ], + "outputs": [] + }, + { + "name": "my_single_value_mapper_set_if_empty", + "mutability": "mutable", + "inputs": [ + { + "name": "value", + "type": "BigInt" + } + ], + "outputs": [] + }, + { + "name": "clear_single_value_mapper", + "mutability": "mutable", + "inputs": [], + "outputs": [] + }, + { + "name": "get_from_address_single_value_mapper", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "is_empty_single_value_mapper", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "is_empty_at_address_single_value_mapper", + "mutability": "mutable", + "inputs": [ + { + "name": "address", + "type": "Address" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "raw_byte_length_single_value_mapper", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "set_single_value_mapper_with_key", + "mutability": "mutable", + "inputs": [ + { + "name": "key", + "type": "u32" + }, + { + "name": "value", + "type": "bytes" + } + ], + "outputs": [] + }, + { + "name": "vec_mapper", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "variadic", + "multi_result": true + } + ] + }, + { + "name": "vec_mapper_push", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [] + }, + { + "name": "vec_mapper_get", + "mutability": "readonly", + "inputs": [ + { + "name": "index", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "vec_mapper_get_at_address", + "mutability": "readonly", + "inputs": [ + { + "name": "address", + "type": "Address" + }, + { + "name": "index", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "vec_mapper_len", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "vec_mapper_len_at_address", + "mutability": "readonly", + "inputs": [ + { + "name": "address", + "type": "Address" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "token_attributes_set", + "mutability": "mutable", + "inputs": [ + { + "name": "token_id", + "type": "TokenIdentifier" + }, + { + "name": "token_nonce", + "type": "u64" + }, + { + "name": "attributes", + "type": "TokenAttributesStruct" + } + ], + "outputs": [] + }, + { + "name": "token_attributes_update", + "mutability": "mutable", + "inputs": [ + { + "name": "token_id", + "type": "TokenIdentifier" + }, + { + "name": "token_nonce", + "type": "u64" + }, + { + "name": "attributes", + "type": "TokenAttributesStruct" + } + ], + "outputs": [] + }, + { + "name": "token_attributes_get_attributes", + "mutability": "mutable", + "inputs": [ + { + "name": "token_id", + "type": "TokenIdentifier" + }, + { + "name": "token_nonce", + "type": "u64" + } + ], + "outputs": [ + { + "type": "TokenAttributesStruct" + } + ] + }, + { + "name": "token_attributes_get_nonce", + "mutability": "mutable", + "inputs": [ + { + "name": "token_id", + "type": "TokenIdentifier" + }, + { + "name": "attributes", + "type": "TokenAttributesStruct" + } + ], + "outputs": [ + { + "type": "u64" + } + ] + }, + { + "name": "token_attributes_clear", + "mutability": "mutable", + "inputs": [ + { + "name": "token_id", + "type": "TokenIdentifier" + }, + { + "name": "token_nonce", + "type": "u64" + } + ], + "outputs": [] + }, + { + "name": "token_attributes_has_attributes", + "mutability": "mutable", + "inputs": [ + { + "name": "token_id", + "type": "TokenIdentifier" + }, + { + "name": "token_nonce", + "type": "u64" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "add_to_whitelist", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "bytes" + } + ], + "outputs": [] + }, + { + "name": "remove_from_whitelist", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "bytes" + } + ], + "outputs": [] + }, + { + "name": "check_contains", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "check_contains_at_address", + "mutability": "mutable", + "inputs": [ + { + "name": "address", + "type": "Address" + }, + { + "name": "item", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "require_contains", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "bytes" + } + ], + "outputs": [] + }, + { + "name": "require_contains_at_address", + "mutability": "mutable", + "inputs": [ + { + "name": "address", + "type": "Address" + }, + { + "name": "item", + "type": "bytes" + } + ], + "outputs": [] + }, + { + "name": "issue_fungible_default_callback", + "mutability": "mutable", + "payableInTokens": [ + "EGLD" + ], + "inputs": [ + { + "name": "token_ticker", + "type": "bytes" + }, + { + "name": "initial_supply", + "type": "BigUint" + } + ], + "outputs": [] + }, + { + "name": "issue_fungible_custom_callback", + "mutability": "mutable", + "payableInTokens": [ + "EGLD" + ], + "inputs": [ + { + "name": "token_ticker", + "type": "bytes" + }, + { + "name": "initial_supply", + "type": "BigUint" + } + ], + "outputs": [] + }, + { + "name": "issue_and_set_all_roles_fungible", + "mutability": "mutable", + "payableInTokens": [ + "EGLD" + ], + "inputs": [ + { + "name": "token_ticker", + "type": "bytes" + } + ], + "outputs": [] + }, + { + "name": "set_local_roles_fungible", + "mutability": "mutable", + "inputs": [], + "outputs": [] + }, + { + "name": "mint_fungible", + "mutability": "mutable", + "inputs": [ + { + "name": "amount", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "EsdtTokenPayment" + } + ] + }, + { + "name": "mint_and_send_fungible", + "mutability": "mutable", + "inputs": [ + { + "name": "to", + "type": "Address" + }, + { + "name": "amount", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "EsdtTokenPayment" + } + ] + }, + { + "name": "burn_fungible", + "mutability": "mutable", + "inputs": [ + { + "name": "amount", + "type": "BigUint" + } + ], + "outputs": [] + }, + { + "name": "get_balance_fungible", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "require_same_token_fungible", + "mutability": "mutable", + "payableInTokens": [ + "*" + ], + "inputs": [], + "outputs": [] + }, + { + "name": "require_all_same_token_fungible", + "mutability": "mutable", + "payableInTokens": [ + "*" + ], + "inputs": [], + "outputs": [] + }, + { + "name": "getFungibleTokenId", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "TokenIdentifier" + } + ] + }, + { + "name": "issue_and_set_all_roles_meta", + "mutability": "mutable", + "payableInTokens": [ + "EGLD" + ], + "inputs": [ + { + "name": "token_ticker", + "type": "bytes" + } + ], + "outputs": [] + }, + { + "name": "mapper_nft_set_token_id", + "mutability": "mutable", + "inputs": [ + { + "name": "token_id", + "type": "TokenIdentifier" + } + ], + "outputs": [] + }, + { + "name": "mapper_nft_create", + "mutability": "mutable", + "inputs": [ + { + "name": "amount", + "type": "BigUint" + }, + { + "name": "attributes", + "type": "RgbColor" + } + ], + "outputs": [ + { + "type": "EsdtTokenPayment" + } + ] + }, + { + "name": "mapper_nft_create_and_send", + "mutability": "mutable", + "inputs": [ + { + "name": "to", + "type": "Address" + }, + { + "name": "amount", + "type": "BigUint" + }, + { + "name": "attributes", + "type": "RgbColor" + } + ], + "outputs": [ + { + "type": "EsdtTokenPayment" + } + ] + }, + { + "name": "mapper_nft_add_quantity", + "mutability": "mutable", + "inputs": [ + { + "name": "token_nonce", + "type": "u64" + }, + { + "name": "amount", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "EsdtTokenPayment" + } + ] + }, + { + "name": "mapper_nft_add_quantity_and_send", + "mutability": "mutable", + "inputs": [ + { + "name": "to", + "type": "Address" + }, + { + "name": "token_nonce", + "type": "u64" + }, + { + "name": "amount", + "type": "BigUint" + } + ], + "outputs": [ + { + "type": "EsdtTokenPayment" + } + ] + }, + { + "name": "mapper_nft_burn", + "mutability": "mutable", + "inputs": [ + { + "name": "token_nonce", + "type": "u64" + }, + { + "name": "amount", + "type": "BigUint" + } + ], + "outputs": [] + }, + { + "name": "mapper_nft_get_balance", + "mutability": "mutable", + "inputs": [ + { + "name": "token_nonce", + "type": "u64" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "mapper_get_token_attributes", + "mutability": "mutable", + "inputs": [ + { + "name": "token_nonce", + "type": "u64" + } + ], + "outputs": [ + { + "type": "RgbColor" + } + ] + }, + { + "name": "getNonFungibleTokenId", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "TokenIdentifier" + } + ] + }, + { + "name": "init_unique_id_mapper", + "mutability": "mutable", + "inputs": [ + { + "name": "len", + "type": "u32" + } + ], + "outputs": [] + }, + { + "name": "unique_id_mapper_get", + "mutability": "mutable", + "inputs": [ + { + "name": "index", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "unique_id_mapper_swap_remove", + "mutability": "mutable", + "inputs": [ + { + "name": "index", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "unique_id_mapper_set", + "mutability": "mutable", + "inputs": [ + { + "name": "index", + "type": "u32" + }, + { + "name": "id", + "type": "u32" + } + ], + "outputs": [] + }, + { + "name": "unique_id_mapper", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "variadic", + "multi_result": true + } + ] + }, + { + "name": "unordered_set_mapper", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "variadic", + "multi_result": true + } + ] + }, + { + "name": "unordered_set_mapper_insert", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "unordered_set_mapper_contains", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "unordered_set_mapper_remove", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "managed_struct_eq", + "mutability": "mutable", + "inputs": [ + { + "name": "s1", + "type": "ExampleStructManaged" + }, + { + "name": "s2", + "type": "ExampleStructManaged" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "no_overflow_usize", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "no_overflow_u8", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u8" + } + ] + }, + { + "name": "no_overflow_u16", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u16" + } + ] + }, + { + "name": "no_overflow_u32", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "no_overflow_u64", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u64" + } + ] + }, + { + "name": "overflow_usize", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "overflow_u8", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u8" + } + ] + }, + { + "name": "overflow_u16", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u16" + } + ] + }, + { + "name": "overflow_u32", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "overflow_u64", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u64" + } + ] + }, + { + "name": "no_overflow_isize", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "i32" + } + ] + }, + { + "name": "no_overflow_i8", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "i8" + } + ] + }, + { + "name": "no_overflow_i16", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "i16" + } + ] + }, + { + "name": "no_overflow_i32", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "i32" + } + ] + }, + { + "name": "no_overflow_i64", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "i64" + } + ] + }, + { + "name": "overflow_isize", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "i32" + } + ] + }, + { + "name": "overflow_i8", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "i8" + } + ] + }, + { + "name": "overflow_i16", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "i16" + } + ] + }, + { + "name": "overflow_i32", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "i32" + } + ] + }, + { + "name": "overflow_i64", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "i64" + } + ] + }, + { + "name": "token_identifier_egld", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "EgldOrEsdtTokenIdentifier" + } + ] + }, + { + "name": "token_identifier_is_valid_1", + "mutability": "mutable", + "inputs": [ + { + "name": "token_id", + "type": "EgldOrEsdtTokenIdentifier" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "token_identifier_is_valid_2", + "mutability": "mutable", + "inputs": [ + { + "name": "bytes", + "type": "bytes" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "returns_egld_decimal", + "mutability": "mutable", + "payableInTokens": [ + "EGLD" + ], + "inputs": [], + "outputs": [ + { + "type": "ManagedDecimal<18>" + } + ] + }, + { + "name": "set_contract_address", + "mutability": "mutable", + "inputs": [ + { + "name": "address", + "type": "Address" + } + ], + "outputs": [] + }, + { + "name": "is_empty_at_address", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "contains_at_address", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "len_at_address", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "next_at_address", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "previous_at_address", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "front_at_address", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "back_at_address", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "keys_at_address", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "List" + } + ] + }, + { + "name": "values_at_address", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "List" + } + ] + }, + { + "name": "contains_unordered_at_address", + "mutability": "mutable", + "inputs": [ + { + "name": "item", + "type": "u32" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "get_by_index", + "mutability": "mutable", + "inputs": [ + { + "name": "index", + "type": "u32" + } + ], + "outputs": [ + { + "type": "u32" + } + ] + }, + { + "name": "fill_set_mapper", + "mutability": "mutable", + "inputs": [ + { + "name": "value", + "type": "u32" + } + ], + "outputs": [] + }, + { + "name": "fill_map_mapper", + "mutability": "mutable", + "inputs": [ + { + "name": "value", + "type": "u32" + } + ], + "outputs": [] + }, + { + "name": "fill_unordered_set_mapper", + "mutability": "mutable", + "inputs": [ + { + "name": "value", + "type": "u32" + } + ], + "outputs": [] + }, + { + "name": "get_value_from_address_with_keys", + "mutability": "readonly", + "inputs": [ + { + "name": "address", + "type": "Address" + }, + { + "name": "extra_key", + "type": "u32" + } + ], + "outputs": [ + { + "type": "bytes" + } + ] + }, { "name": "managed_decimal_addition", "mutability": "mutable", @@ -129,6 +5891,93 @@ "type": "ManagedDecimalSigned<9>" } ] + }, + { + "name": "managed_decimal_addition_var", + "mutability": "mutable", + "inputs": [ + { + "name": "first", + "type": "ManagedDecimal" + }, + { + "name": "second", + "type": "ManagedDecimal" + } + ], + "outputs": [ + { + "type": "ManagedDecimal" + } + ] + }, + { + "name": "managed_decimal_subtraction_var", + "mutability": "mutable", + "inputs": [ + { + "name": "first", + "type": "ManagedDecimal" + }, + { + "name": "second", + "type": "ManagedDecimal" + } + ], + "outputs": [ + { + "type": "ManagedDecimal" + } + ] + }, + { + "name": "managed_decimal_eq_var", + "mutability": "mutable", + "inputs": [ + { + "name": "first", + "type": "ManagedDecimal" + }, + { + "name": "second", + "type": "ManagedDecimal" + } + ], + "outputs": [ + { + "type": "bool" + } + ] + }, + { + "name": "managed_decimal_ln_var", + "mutability": "mutable", + "inputs": [ + { + "name": "x", + "type": "ManagedDecimal" + } + ], + "outputs": [ + { + "type": "ManagedDecimalSigned<9>" + } + ] + }, + { + "name": "managed_decimal_log2_var", + "mutability": "mutable", + "inputs": [ + { + "name": "x", + "type": "ManagedDecimal" + } + ], + "outputs": [ + { + "type": "ManagedDecimalSigned<9>" + } + ] } ], "events": [ diff --git a/src/testdata/basic-features.wasm b/src/testdata/basic-features.wasm old mode 100755 new mode 100644 index a0da77ca..ad7cf557 Binary files a/src/testdata/basic-features.wasm and b/src/testdata/basic-features.wasm differ diff --git a/src/transactionsFactories/smartContractTransactionsFactory.spec.ts b/src/transactionsFactories/smartContractTransactionsFactory.spec.ts index d108c103..0a98b5e6 100644 --- a/src/transactionsFactories/smartContractTransactionsFactory.spec.ts +++ b/src/transactionsFactories/smartContractTransactionsFactory.spec.ts @@ -1,7 +1,7 @@ import { assert } from "chai"; import { Address } from "../address"; import { Err } from "../errors"; -import { U32Value } from "../smartcontracts"; +import { ManagedDecimalValue, U32Value } from "../smartcontracts"; import { Code } from "../smartcontracts/code"; import { AbiRegistry } from "../smartcontracts/typesystem/abiRegistry"; import { loadAbiRegistry, loadContractCode } from "../testutils/utils"; @@ -142,6 +142,60 @@ describe("test smart contract transactions factory", function () { assert.deepEqual(transaction, transactionAbiAware); }); + it("should create 'Transaction' for execute and transfer native token", async function () { + const sender = Address.fromBech32("erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th"); + const contract = Address.fromBech32("erd1qqqqqqqqqqqqqpgqhy6nl6zq07rnzry8uyh6rtyq0uzgtk3e69fqgtz9l4"); + const func = "managed_decimal_subtraction"; + const gasLimit = 6000000n; + + const transaction = factory.createTransactionForExecute({ + sender: sender, + contract: contract, + function: func, + gasLimit: gasLimit, + arguments: [new ManagedDecimalValue(9, 2), new ManagedDecimalValue(4, 2)], + }); + + // const transactionAbiAware = abiAwareFactory.createTransactionForExecute({ + // sender: sender, + // contract: contract, + // function: func, + // gasLimit: gasLimit, + // arguments: [9, 4], + // }); + + assert.equal(transaction.sender, "erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th"); + assert.equal(transaction.receiver, "erd1qqqqqqqqqqqqqpgqhy6nl6zq07rnzry8uyh6rtyq0uzgtk3e69fqgtz9l4"); + assert.deepEqual(transaction.data, Buffer.from("managed_decimal_subtraction@09@04")); + }); + + it("should create 'Transaction' for execute and transfer native token", async function () { + const sender = Address.fromBech32("erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th"); + const contract = Address.fromBech32("erd1qqqqqqqqqqqqqpgqhy6nl6zq07rnzry8uyh6rtyq0uzgtk3e69fqgtz9l4"); + const func = "managed_decimal_ln"; + const gasLimit = 6000000n; + + const transaction = factory.createTransactionForExecute({ + sender: sender, + contract: contract, + function: func, + gasLimit: gasLimit, + arguments: [new ManagedDecimalValue(23.0, 9)], + }); + + // const transactionAbiAware = abiAwareFactory.createTransactionForExecute({ + // sender: sender, + // contract: contract, + // function: func, + // gasLimit: gasLimit, + // arguments: [9, 4], + // }); + + assert.equal(transaction.sender, "erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th"); + assert.equal(transaction.receiver, "erd1qqqqqqqqqqqqqpgqhy6nl6zq07rnzry8uyh6rtyq0uzgtk3e69fqgtz9l4"); + assert.deepEqual(transaction.data, Buffer.from("managed_decimal_ln@17")); + }); + it("should create 'Transaction' for execute and transfer single esdt", async function () { const sender = Address.fromBech32("erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th"); const contract = Address.fromBech32("erd1qqqqqqqqqqqqqpgqhy6nl6zq07rnzry8uyh6rtyq0uzgtk3e69fqgtz9l4"); diff --git a/src/transactionsOutcomeParsers/smartContractTransactionsOutcomeParser.spec.ts b/src/transactionsOutcomeParsers/smartContractTransactionsOutcomeParser.spec.ts index 5bbcbdd5..7b7cf912 100644 --- a/src/transactionsOutcomeParsers/smartContractTransactionsOutcomeParser.spec.ts +++ b/src/transactionsOutcomeParsers/smartContractTransactionsOutcomeParser.spec.ts @@ -75,7 +75,7 @@ describe("test smart contract transactions outcome parser", () => { contractResults: new ContractResults([ new ContractResultItem({ nonce: 8, - data: "@6f6b", + data: "@6f6b@fd60b96668", }), ]), });