-
How to implement the same behaviour as in the I am trying to do it this way: import { toHex, concat, keccak256 } from 'viem';
const opt = {
id: '0x88cadab56ea4e0eb38531d2313ed7f390aa9faf0661dcf98daa980342f1dcc97',
price: 1n,
asset: '0x12DC8e8De1C576284ab25842C2750c749c326301',
};
keccak256(
concat([opt.id, toHex(opt.price), opt.asset]),
); but the utils.solidityKeccak256(
["bytes32", "uint256", "address"],
[opt.id, opt.price, opt.asset]
) So, how to implement I have created an example on |
Beta Was this translation helpful? Give feedback.
Answered by
jxom
May 29, 2023
Replies: 1 comment
-
You’ll need to use |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
kostysh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You’ll need to use
encodePacked
instead ofconcat
.