Closed hbriese closed 9 months ago
A quick search reveals several other functions that use zeroPadBytes
which previously used zeroPad
@hbriese Thank you for finding this bug. Obviously the bug is present because functions are not covered with tests. Also feel free to add test here.
Also update your commit message to follow convetional commits as mentioned here. So the message should look like:
fix: resolve padding bugs in `createAccount` and `createAccount2`
I've added some tests. Are there any more that you would recommend?
LGTM!
What :computer:
Fixes #29
Why :hand:
createAddress
andcreate2Address
produce incorrect addressesNotes :memo:
The error seems to have occured in the ethers v5 -> v6 migration, where
ethers.utils.zeroPad
, which zero-pads left bits (docs), was incorrectly replaced withethers.utils.zeroPadBytes
, which zero-pads the right bits (docs). The correct replacement beingethers.utils.zeroPadValue
(docs)