Lesson11: Base64.encode(abi.encodePacked(svg)) == Base64.encode(bytes(string(abi.encodePacked(svg)))), is that possible? #1996
-
in DeployMoodNft.s.sol |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Hello @codeplay22 That is a good catch, and I must say you are correct, but Patrick is a really security-minded person, and he will always do everything to be safe rather than sorry. Some things seem to work the same on a surface level, but when they are battle-tested, you will get to realize why the extra step was needed. This doesn't mean that doing it the way you have stated will definitely lead to a security issue, but I am just talking from the perspective with which I look at it when I see Patrick do stuff in more complicated ways |
Beta Was this translation helpful? Give feedback.
-
Hi @PatrickAlphaC i wanted to know why you first encoded it from |
Beta Was this translation helpful? Give feedback.
@EngrPips no, i asked that to know the concept behind it only.
So according to patrick i think answer would be to use it like this only
Base64.encode(abi.encodePacked(svg))
and the same thing can be done here as well in
Moodnft.s.sol
there's no need to convert
abi.EncodePacked to bytes
you can remove it and it will work fine.Like that -