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

`let signature = "0xa023966c15a4fdefac7e06c06a869f77adfc5359fe26c7241f122266b063bd280941e2f6922b42656ce53ef0d32d071ac6178c88195bc8f8c6f597792d57304c1b"0x8b54901f0C6AE2be51cc1FA783b34a77Aa53A643 #5

Open
SandraSavic opened this issue Jan 28, 2023 · 0 comments

Comments

@SandraSavic
Copy link
Owner

let signature = "0xa023966c15a4fdefac7e06c06a869f77adfc5359fe26c7241f122266b063bd280941e2f6922b42656ce53ef0d32d071ac6178c88195bc8f8c6f597792d57304c1b" let abiCoder = new ethers.utils.AbiCoder(); let signature_hex = abiCoder.encode(["bytes"], [signature]).replace("0x", ""); console.log(signature_hex)

错误输出结果:00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000041a023966c15a4fdefac7e06c06a869f77adfc5359fe26c7241f122266b063bd280941e2f6922b42656ce53ef0d32d071ac6178c88195bc8f8c6f597792d57304c1b00000000000000000000000000000000000000000000000000000000000000

正确输出结果:00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000041a023966c15a4fdefac7e06c06a869f77adfc5359fe26c7241f122266b063bd280941e2f6922b42656ce53ef0d32d071ac6178c88195bc8f8c6f597792d57304c1b00000000000000000000000000000000000000000000000000000000000000

Originally posted by @EvanHenrs in lbc-team/ethers.js-docs#3 (comment)

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

No branches or pull requests

1 participant