* Decode the ABI %%data%% as the %%types%% into values. * * If %%loose%% decoding is enabled, then strict padding is * not enforced. Some older versions of Solidity incorrectly * padded event data emitted from ``external`` functions.
(types: ReadonlyArray<string | ParamType>, data: BytesLike, loose?: boolean)
| 136 | * padded event data emitted from ``external`` functions. |
| 137 | */ |
| 138 | decode(types: ReadonlyArray<string | ParamType>, data: BytesLike, loose?: boolean): Result { |
| 139 | const coders: Array<Coder> = types.map((type) => this.#getCoder(ParamType.from(type))); |
| 140 | const coder = new TupleCoder(coders, "_"); |
| 141 | return coder.decode(new Reader(data, loose, defaultMaxInflation)); |
| 142 | } |
| 143 | |
| 144 | static _setDefaultMaxInflation(value: number): void { |
| 145 | assertArgument(typeof(value) === "number" && Number.isInteger(value), "invalid defaultMaxInflation factor", "value", value); |