sergi-pantoja avatar

Common errors you may have while writing smart contracts with Solidity

sergi-pantoja

Published: 14 Oct 2019 › Updated: 14 Oct 2019Common errors you may have while writing smart contracts with Solidity

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.

Leave Common errors you may have while writing smart contracts with Solidity to:

Written by

Read more #solidity posts


Best Posts From sergi-pantoja

We have not curated any of sergi-pantoja's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From sergi-pantoja