Odak modu

Smart Contract Development with Solidity

Mappings

Code from video: https://solidity-by-example.org/mapping/ 

You can access the video content in Turkish prepared by İTÜ Blockchain here: https://www.youtube.com/watch?v=aZDdyhfesEc&list=PLby2HXktGwN4Cof_6a8YwlMrboX8-hs73&index=7 

Mapping in Solidity acts like a hash table or dictionary in any other language. These are used to store data values in key:value pairs. In terms of mapping, the key data is not stored in a mapping, only its keccak256 hash is used to look up the value. The KeyType can be any built-in value type, bytes, string, or any contract or enum type. Other user-defined or complex types, such as mappings, structs or array types are not allowed. ValueType can be any type, including mappings, arrays and structs.

Mappings are mostly used to associate the unique Ethereum address with the associated value type.

  • Maps are created with the syntax mapping (keyType => valueType).
  • The keyType can be any built-in value type, bytes, string, or any contract.
  • valueType can be any type including another mapping or an array.
  • Mappings are not iterable.
  • Mappings can be counted so that we can know how many values are stored in mapping.

Resources:

You can find detailed further information from Solidity Official documentation(in English):  

https://docs.soliditylang.org/en/v0.8.15/types.html#mapping-types 

https://solidity-by-example.org/mapping/

https://www.geeksforgeeks.org/solidity-mappings/

Background Pattern
Birlikte öğrenelim

Sektörde en çok aranan yazılım becerilerini kazan

Yapay zeka desteği, birebir mentörlük saatleri, canlı dersler ve senin için özel hazırlanmış içeriklerle eksiklerini tamamla, düzenli geri bildirimler al ve öğrenme sürecini en verimli hale getir.

Yunus Emre Kabakcı

Patika+ mezunu

Patika+ Fullstack Web Development Bootcamp mezunumuz Yunus Emre,

3 ay içinde Katar’dan aldığı teklif ile, global bir şirket olan Pavo Group’da işe başladı!


“İçerik zenginliği, mentor desteği, ileriye dönük bir network sağlaması ve dünyada en çok tercih edilen frameworkler üzerinden bir eğitim veriyor olması Patika+’ı tercih etmemin temel sebepleri oldu!“

Yorumlar

Yorum yapabilmek için derse kayıt olmalısın!