Closed asteshin closed 1 year ago
hey. what for what usecases this packed encoding is used?
Sure, the UniswapV3 has an entity called path
which is encoded route of multihop swap, for example: path: abi.encodePacked(DAI, poolFee, USDC, poolFee, WETH9)
I can look into including the encodePacked
to this library. The thing is encode packed is kind of getting deprecated but there are many projects (namely uniswap v3) still using it. @ayrat555 Do you think this can be included here?
@asteshin Meanwhile, you can encode it manually. Elixir has a very nice syntax for dealing with binaries. For the example of Uniswap you can do as following.
packed = <<dai_address:binary, pool_fee::unsigned-24, usdc_address::binary, pool_fee::unsigned-24, weth_address::binary>>
The addresses should be decoded (20 bytes long binaries) and not in hex.
@alisinabh it would be a great addition to the library
Hi. I did not find any like a
abi.encodePacked()
in current release. If so, will it be available soon or there is another reason for that? Thanks.