Why name error __ClaimAirdropScript__InvalidSignatureLength
instead of error ClaimAirdropScript__InvalidSignatureLength
?
#3179
-
See Advanced Foundry > Section 4: Airdrop and Signatures I don't remember the specific lesson, but code is below: https://github.com/Cyfrin/foundry-merkle-airdrop-cu/blob/main/script/Interact.s.sol Why name From what I've noticed, Ciara only used __ before error name for her scripts. Is it a newer convention for naming errors? [...]
bytes private SIGNATURE = hex"fbd2270e6f23fb5fe9248480c0f4be8a4e9bd77c3ad0b1333cc60b5debc511602a2a06c24085d8d7c038bad84edc53664c8ce0346caeaa3570afec0e61144dc11c";
error __ClaimAirdropScript__InvalidSignatureLength();
function claimAirdrop(address airdrop) public {
[...] |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Honestly, naming conventions are just there to make code more organized and uniform in some way. It is not enforced on anyone. You can name your error however works for you. I will suggest you always check the latest Solidity documentation as it should have all the best practices and convention in it. |
Beta Was this translation helpful? Give feedback.
Honestly, naming conventions are just there to make code more organized and uniform in some way. It is not enforced on anyone. You can name your error however works for you. I will suggest you always check the latest Solidity documentation as it should have all the best practices and convention in it.