Solidity Data Types

yassinechraa

Yassine Chraa

Posted on December 10, 2022

Solidity Data Types

Image description

  1. Values Types:
    • uint(Unsigned Integer), uint8,..., uint256
    • int, int8,..., int256
    • bool(Boolean)
    • address: use to stock Ethereum address
    • bytes: Holds a 30 byte value
    • enum: The data representation is the same as for enums in C example: enum Countries{ Morocco, CANDA, ESPAIN};
    • function: There are three types of functions; pure, view and payable
  2. References Types:
    • Arrays: uint[] memory a = new uint[](7);
    • Data Location: There are three data locations; memory, storageand calldata.
    • struct: used to create new types
struct Funder {
    address addr;
    uint amount;
}
Enter fullscreen mode Exit fullscreen mode

3.Mapping Types:

  • Syntax: mapping(KeyType => ValueType) VariableName;
💖 💪 🙅 🚩
yassinechraa
Yassine Chraa

Posted on December 10, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

What was your win this week?
weeklyretro What was your win this week?

November 29, 2024

Where GitOps Meets ClickOps
devops Where GitOps Meets ClickOps

November 29, 2024

How to Use KitOps with MLflow
beginners How to Use KitOps with MLflow

November 29, 2024

Modern C++ for LeetCode 🧑‍💻🚀
leetcode Modern C++ for LeetCode 🧑‍💻🚀

November 29, 2024