4th Street Bar Hive-Bar

Hive-Bar Powered by Hive beta-fdb5b5b

Community post

Common errors you may have while writing smart contracts with Solidity

If you are writing an smart contract you absolutely don't want to have any errors in it that might compromise your project. Here I'll introduce some of the most common mistakes people make while coding with Solidity.

  • Syntax errors
    Like all programing languages, syntax errors are common mistakes, specially for programers inexperienced in that particular language. You will get the hang of it if you practice enough. Example: missing a semi-colon.
  • No defining a function's type
    All functions need a type to determine their scope and what they can manipulate and have access to. The type of a function can be either view, pure or payable.
  • No defining a function as internal or external
    Internal functions can only be called within the smart contract they are defined in, while external functions can be called from other smart contracts and through web3 calls.
  • Not returning the correct type for a function
  • Not providing a reference type for arguments or variables in a function
    This types can be either memory, callable or storage.
2 upvotes $0.00

Replies (0)

Conversation

No replies yet

Replies will appear here as people join the conversation.

Review before signing

Posting as . Signing with . Keychain permission: Posting. Hive Keychain will ask you to approve this action next.


  
Technical details

Operation fingerprint: