sourcify icon indicating copy to clipboard operation
sourcify copied to clipboard

Wrong assumption of auxdata being at the end of the creation bytecode

Open kuzdogan opened this issue 2 years ago • 0 comments

Related to #851 when matching with the creation bytecode, we are assuming the bytecode has the auxdata at the end of the contract when doing splitAuxdata. E.g.:

https://github.com/ethereum/sourcify/blob/38fdfafa95d3ebe3c971321f8f5c86e3eedfa22d/packages/lib-sourcify/src/lib/verification.ts#L479-L481

This does not cause a bug as splitAuxdata will return the original bytecode if it fails to find the CBOR part and the verification will fail again.

Instead we should use the findAuxdataPositions function we created to find the positions by recompiling, and not assume

  1. There's only 1 CBOR auxdata in the bytecode
  2. It's appended at the end of the creation bytecode.

View in Huly HI-489

kuzdogan avatar Jan 04 '24 09:01 kuzdogan