NEWTON
Asked
2 months ago
46
views
0
Hey! The title sort of summarizes the question. I was wondering if there's any project where I can see an example of how something like keccak256(abi.encodePacked(var1, var2, var3))
could be achieved in starknet.
If there were a way to concatenate bytes, I think it wouldn't be too complicated, but such a string would never fit in a felt, and using a struct won't result in the same output.
So yes, my question is if there's an equivalent way to achieve this behavior in cairo.
0x63D4...320eE2
asked
2 months ago
0
Accepted answer
Hi, There is no "out of the box" way of doing this to my knowledge.
So you need to look at the formal specification and replicate it in Cairo (at least that's what people have done thus far). Yeah.. not an ideal scenario ^^
0x5EF2...46c5dd
answered
1 month ago
0
Not a real answer, but there is a similar question What should I use to execute abi.encodePacked from solidity in starknet?
Newton
answered
2 months ago
Is there a Cairo equivalent to Keccak256(abi.encode(parameters))?
How to check for smaller Uints in Cairo?
What should I use to execute abi.encodePacked from solidity in starknet?
How to check if a contract has been deployed at a certain address in cairo?
How to calculate the sum of the digits of a felt in Cairo?
What is SHARP in Cairo Language?
How to modify keccak.cairo and/or packed_keccak.cairo to compute a 512bits keccak hash instead of 256 bits?
how to return struct
How do I check that my Solidity compiler version is >= 0.8.0 ?
What should I use to execute abi.encodePacked from solidity in starknet?
How to generate a proof for a Cairo program and verify it?[StackOverflow]
Do you have any idea on how much is starknetJS request limit?
Cairo Error: Getting Error while setting value of item in array
Can you explain Cairo v0.10 usage functions as expressions?