hi guys, im trying to test a signature verification in my foundry test and i would like to provide the signature from the outside as a string, but obviously i have to convert it to bytes first. What is the correct way to do it? i constantly run into: ECDSA: invalid signature length so obviosuly bytes("signature") is not working.

May 11, 2023, 8:10 PM
thx in advance
May 11, 2023, 8:10 PM
You should use bytes for signatures (And why shouldn't you?)
you need to properly ask first
May 11, 2023, 8:23 PM
what's the problem with using uint as sort of unique identifiers , like NFTs?
May 11, 2023, 8:23 PM
What problem?
May 11, 2023, 8:26 PM
what's a signature first of all? I am not clear on this one
doesn't it means the signing of a tx we do in metamask?
May 11, 2023, 8:27 PM
Public key cryptography
May 11, 2023, 8:29 PM
like how does that work under the hood, in simple terms
May 11, 2023, 8:29 PM
u use private key to sign a message
May 11, 2023, 8:30 PM
Go back to the basics
May 11, 2023, 8:40 PM
I mean would the update significantly affect the old tutorials about smart contracts?

As I'm learning building in a manner
For example Python 2 and Python 3
May 11, 2023, 8:47 PM
it's in the foundry tests. I hardcoded the signatures, the solution was actually prefixing it with hex.

https://docs.soliditylang.org/en/develop/types.html#hexadecimal-literals
it's still bytes
May 11, 2023, 9:02 PM
yes trying to, I was at the basics anyways
not significantly, but some changes will affect otc
ofc
May 11, 2023, 9:38 PM

© 2024 Draquery.com All rights reserved.