ethers.js icon indicating copy to clipboard operation
ethers.js copied to clipboard

Pack of "address" as Uint8Array(20)

Open adraffy opened this issue 2 years ago • 0 comments

Ethers Version

6.9.2

Search Terms

abi

Describe the Problem

pack() of "address" with a bytes20-equivalent should just pack directly.

https://github.com/ethers-io/ethers.js/blob/6017d3d39a4d428793bddae33d82fd814cacd878/src.ts/hash/solidity.ts#L83-L89

https://github.com/ethers-io/ethers.js/blob/6017d3d39a4d428793bddae33d82fd814cacd878/src.ts/hash/solidity.ts#L16-L20

Code Snippet

ethers.solidityPackedKeccak256(['address'], [new Uint8Array(20]);

Contract ABI

No response

Errors

TypeError: invalid address (argument="address", value=0x0000000000000000000000000000000000000000, code=INVALID_ARGUMENT, version=6.9.2)

Environment

node.js (v12 or newer)

Environment (Other)

No response

adraffy avatar Jan 03 '24 07:01 adraffy