``` // Input to our TX call // getRitualIdFromPublicKey((bytes32,bytes16)) { pointStruct: { word0: Uint8Array(32) [ 143, 165, 135, 13, 100, 179, 35, 181, 57, 19, 203, 246, 161, 238, 95, 128, 190, 171, 22, 243, 51, 183, 66, 200, 129, 85, 79, 147, 31, 232, 103, 160 ], word1: Uint8Array(16) [ 104, 74, 233, 91, 17, 153, 29, 224, 138, 40, 72, 221, 19, 140, 105, 40 ] } } ``` ``` // Error thrown Example failed: Error: call revert exception; VM Exception while processing transaction: reverted with panic code 17 [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method="getRitualIdFromPublicKey((bytes32,bytes16))", data="0x4e487b710000000000000000000000000000000000000000000000000000000000000011", errorArgs=[{"type":"BigNumber","hex":"0x11"}], errorName="Panic", errorSignature="Panic(uint256)", reason=null, code=CALL_EXCEPTION, version=abi/5.7.0) at Logger.makeError (/home/piotr/Documents/projects/nucypher/nucypher-ts-mono/node_modules/.pnpm/@ethersproject+logger@5.7.0/node_modules/@ethersproject/logger/src.ts/index.ts:269:28) at Logger.throwError (/home/piotr/Documents/projects/nucypher/nucypher-ts-mono/node_modules/.pnpm/@ethersproject+logger@5.7.0/node_modules/@ethersproject/logger/src.ts/index.ts:281:20) at Interface.decodeFunctionResult (/home/piotr/Documents/projects/nucypher/nucypher-ts-mono/node_modules/.pnpm/@ethersproject+abi@5.7.0/node_modules/@ethersproject/abi/src.ts/interface.ts:427:23) at Contract.<anonymous> (/home/piotr/Documents/projects/nucypher/nucypher-ts-mono/node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/src.ts/index.ts:400:44) at step (/home/piotr/Documents/projects/nucypher/nucypher-ts-mono/node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/lib/index.js:48:23) at Object.next (/home/piotr/Documents/projects/nucypher/nucypher-ts-mono/node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/lib/index.js:29:53) at fulfilled (/home/piotr/Documents/projects/nucypher/nucypher-ts-mono/node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/lib/index.js:20:58) at processTicksAndRejections (node:internal/process/task_queues:95:5) { reason: null, code: 'CALL_EXCEPTION', method: 'getRitualIdFromPublicKey((bytes32,bytes16))', data: '0x4e487b710000000000000000000000000000000000000000000000000000000000000011', errorArgs: [ BigNumber { _hex: '0x11', _isBigNumber: true } ], errorName: 'Panic', errorSignature: 'Panic(uint256)', address: '0xF429C1f2d42765FE2b04CC62ab037564C2C66e5E', args: [ { word0: [Uint8Array], word1: [Uint8Array] } ], transaction: { data: '0x9c488a5a8fa5870d64b323b53913cbf6a1ee5f80beab16f333b742c881554f931fe867a0684ae95b11991de08a2848dd138c692800000000000000000000000000000000', to: '0xF429C1f2d42765FE2b04CC62ab037564C2C66e5E' } } ``` Decoding tx ``` transaction: { data: '0x9c488a5a8fa5870d64b323b53913cbf6a1ee5f80beab16f333b742c881554f931fe867a0684ae95b11991de08a2848dd138c692800000000000000000000000000000000', to: '0xF429C1f2d42765FE2b04CC62ab037564C2C66e5E' } ``` Becomes: ![image.png](https://hackmd.io/_uploads/SyuyrBcQp.png) https://lab.miguelmota.com/ethereum-input-data-decoder/example/ Let's decode the hex values ``` version "ethers/5.7.1" provider.network.name "homestead" ethers.utils.arrayify("0x8fa5870d64b323b53913cbf6a1ee5f80beab16f333b742c881554f931fe867a0"); Uint8Array { 143, 165, 135, 13, 100, 179, 35, 181, 57, 19, 203, 246, 161, 238, 95, 128, 190, 171, 22, 243, 51, 183, 66, 200, 129, 85, 79, 147, 31, 232, 103, 160 } ethers.utils.arrayify("0x684ae95b11991de08a2848dd138c6928"); Uint8Array { 104, 74, 233, 91, 17, 153, 29, 224, 138, 40, 72, 221, 19, 140, 105, 40 } ``` https://playground.ethers.org/ They seem to match ``` // Decoded values const d1 = [ 143, 165, 135, 13, 100, 179, 35, 181, 57, 19, 203, 246, 161, 238, 95, 128, 190, 171, 22, 243, 51, 183, 66, 200, 129, 85, 79, 147, 31, 232, 103, 160 ]; const d2 = [ 104, 74, 233, 91, 17, 153, 29, 224, 138, 40, 72, 221, 19, 140, 105, 40 ]; // Original values const o1 =[ 143, 165, 135, 13, 100, 179, 35, 181, 57, 19, 203, 246, 161, 238, 95, 128, 190, 171, 22, 243, 51, 183, 66, 200, 129, 85, 79, 147, 31, 232, 103, 160 ]; const o2 = [ 104, 74, 233, 91, 17, 153, 29, 224, 138, 40, 72, 221, 19, 140, 105, 40 ]; function arrayEquals(a, b) { return Array.isArray(a) && Array.isArray(b) && a.length === b.length && a.every((val, index) => val === b[index]); } console.log(arrayEquals(d1, o1)); // true console.log(arrayEquals(d2, o2)); // true ``` Okay, so the inputs match, why does the contract throw then? The demo doesn't throw ``` // Outputs from taco-demo const dd1 = [143, 165, 135, 13, 100, 179, 35, 181, 57, 19, 203, 246, 161, 238, 95, 128, 190, 171, 22, 243, 51, 183, 66, 200, 129, 85, 79, 147, 31, 232, 103, 160]; const dd2 = [104, 74, 233, 91, 17, 153, 29, 224, 138, 40, 72, 221, 19, 140, 105, 40]; console.log(arrayEquals(dd1, o1)); // true console.log(arrayEquals(dd2, o2)); // true ```