web3c.js icon indicating copy to clipboard operation
web3c.js copied to clipboard

Sending confidential transaction returns different event key in the transaction receipt.

Open armaniferrante opened this issue 7 years ago • 2 comments

The following returns a different receipt for confidential vs non-confidential: let receipt = await instance.methods.transfer(accounts[1], amount).send();

For confidential we get for receipt.events

{ '0': 
   { address: '0x4e18C408a1b9229Ddd4b900E279eDFF256907B1e',
     blockHash: '0x818213a9aacb72830e9f40057edd45567a0074d05714721a3ab89bb02675a94e',
     blockNumber: 148183,
     logIndex: 0,
     transactionHash: '0x1c1d38fa9cc2d4986f850ec07ede70f6765e35aca4b5e96186e3d60fa6346b69',
     transactionIndex: 0,
     transactionLogIndex: '0x0',
     type: 'mined',
     id: 'log_5af471ac',
     returnValues: Result {},
     event: undefined,
     signature: '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
     raw: 
      { data: '0x0000000000000000000000000000000000000000000000000000000000000014',
        topics: [Array] } } }

For non-confidential, the key is not 0, but instead, Transfer, which is the name of the event.

armaniferrante avatar Nov 06 '18 22:11 armaniferrante

is this an issue with the web3c library?

I guess the issue is that the name of the event Transfer is meant to be confidential, so we should expect a response we can decrypt / map back to the actual type

willscott avatar Nov 07 '18 06:11 willscott

As discussed elsewhere, the issue might need a runtime change as well, sending back the encrypted event type.

armaniferrante avatar Nov 07 '18 06:11 armaniferrante