Content pfp
Content
@
0 reply
0 recast
0 reaction

GIGAMΞSH pfp
GIGAMΞSH
@gigamesh
ChatGPT failed me on this question so I'm asking here: I'm trying to use Viem to recreate a solidity function that computes an address. Viem has abi.encodePacked but no abi.encode. How do I do the abi.encode part of this?
3 replies
2 recasts
36 reactions

GIGAMΞSH pfp
GIGAMΞSH
@gigamesh
Got it! For anyone who stumbles on this in the future, here is the solution: https://gist.github.com/gigamesh/f515ae5be37e1e7003c3319ee7793ec6
0 reply
0 recast
2 reactions

Nico.cast🎩  pfp
Nico.cast🎩
@n
I think just pass in the raw parameters without all the abi? Just the types encodePacked( ['address', 'string', 'bytes16[]'], [ '0xd8da6bf26964af9d7eed9e03e53415d37aa96045', 'hello world', ['0xdeadbeefdeadbeefdeadbeefdeadbeef', '0xcafebabecafebabecafebabecafebabe'] ] )
1 reply
0 recast
1 reaction

Kuririn pfp
Kuririn
@kuririn
What about https://viem.sh/docs/abi/encodeAbiParameters.html?
1 reply
0 recast
0 reaction