sourcify
sourcify copied to clipboard
Wrong assumption of auxdata being at the end of the creation bytecode
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
- There's only 1 CBOR auxdata in the bytecode
- It's appended at the end of the creation bytecode.
View in Huly HI-489