Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ivan/fix l1 l2 address conversion #262

Merged
merged 4 commits into from
Mar 11, 2024
Merged

Conversation

ischasny
Copy link
Contributor

let x = ethers.BigNumber.from(address).add(L1_TO_L2_ALIAS_OFFSET) .mod(ADDRESS_MODULO). So x is a big number and applying to hexlify will convert it hex string without extra padding. E.g. if x == 1, then hexlify(x) == "0x1", we want address so it should padded to len 40.

let x = ethers.BigNumber.from(address).add(L1_TO_L2_ALIAS_OFFSET)
.mod(ADDRESS_MODULO). So x is a big number and applying to hexlify
will convert it hex string without extra padding. E.g. if x == 1,
then hexlify(x) == "0x1", we want address so it should padded to
len 40.
perekopskiy
perekopskiy previously approved these changes Mar 11, 2024
@vladbochok vladbochok merged commit cad9e99 into main Mar 11, 2024
16 checks passed
@vladbochok vladbochok deleted the ivan/fix-l1-l2-address-conversion branch March 11, 2024 21:56
matzayonc pushed a commit to neotheprogramist/era-contracts that referenced this pull request Mar 27, 2024
matzayonc pushed a commit to neotheprogramist/era-contracts that referenced this pull request Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants