Time Units - Solidity Part 4.2

In Solidity, dealing with time is essential for various applications, especially when building contracts that involve time-based conditions, such as delays, expiration times, or scheduling events. Solidity simplifies time calculations by providing predefined time units, making it easier for developers to work with timestamps and durations.Source Code: https://github.com/scaihai/enkwadore-blog-blockchain-demos/tree/main/solidity/contracts/4.2Solidity’s...
spacer

Ether Units - Solidity Part 4.1

In Ethereum, the native cryptocurrency is called Ether (ETH). When writing smart contracts in Solidity, understanding how to work with Ether units is crucial, as it ensures that your contract handles payments, fees, and balances correctly. Solidity provides a convenient way to manage Ether values by using different units. This post will explore these units and how to use them effectively in your smart...
spacer

Mapping Types - Solidity Part 3.3

Mappings are one of the key data structures in Solidity, used extensively to create associations between data. If you’re familiar with the concept of hash tables or dictionaries in other programming languages, mappings in Solidity serve a similar purpose. However, they come with unique characteristics and limitations due to the blockchain’s nature.Source Code: https://github.com/scaihai/enkwadore-blog-blockchain-demos/tree/main/solidity/contracts/3.3What...
spacer

Arrays - Solidity Part 3.2.1

Arrays are essential data structures in Solidity that allow you to store multiple values of the same type within a single variable. In this post, we’ll explore the details of arrays in Solidity, covering their types, how to declare and initialize them, access and modify their elements, and the best practices for working with them.Source Code: https://github.com/scaihai/enkwadore-blog-blockchain-demos/tree/main/solidity/contracts/3.2.1Understanding...
spacer

Reference Types - Solidity Part 3.2

In Solidity, understanding how data is handled in smart contracts is crucial for optimizing performance and ensuring correct behavior. One of the key concepts in Solidity is reference types, which include arrays, structs, and mappings. These types are more complex than value types and are managed differently depending on where they are stored: in storage, memory, or calldata. Let’s dive into these...
spacer

Interfaces - Solidity Part 3.1.15

In Solidity, interfaces play a crucial role in enabling smart contracts to communicate with each other. They allow for the definition of a contract’s external functions without implementing them, providing a blueprint for other contracts to interact with. This blog post will dive into the concept of interfaces in Solidity, their syntax, use cases, and best practices.Source Code: https://github.com/scaihai/enkwadore-blog-blockchain-demos/tree/main/solidity/contracts/3.1.15What...
spacer

Abstract Class - Solidity Part 3.1.14

In Solidity, abstract contracts are a powerful feature that allows developers to define contract templates with incomplete or unimplemented functionality. These contracts serve as blueprints that can be extended by other contracts to create more complex systems. In this blog post, we’ll explore the concept of abstract contracts in Solidity, how they work, and when to use them in your decentralized...
spacer

Inheritance - Solidity Part 3.1.13

Inheritance is a powerful feature in Solidity that allows developers to create a new contract that reuses, extends, or modifies the behavior of another contract. This mechanism promotes code reuse, modularity, and easier maintenance. In this blog post, we’ll explore the fundamentals of inheritance in Solidity, along with practical examples to illustrate its application.Source Code: https://github.com/scaihai/enkwadore-blog-blockchain-demos/tree/main/solidity/contracts/3.1.13What...
spacer

Function Types - Solidity Part 3.1.12

In Solidity, functions are a core part of writing smart contracts. Functions allow us to encapsulate logic, making our contracts modular and easier to understand. But did you know that functions in Solidity can also be treated as variables, passed around as arguments, and returned from other functions? This is possible because Solidity supports function types.Source Code: https://github.com/scaihai/enkwadore-blog-blockchain-demos/tree/main/solidity/contracts/3.1.12What...
spacer

Literals - Solidity Part 3.1.11

When working with Solidity, you’ll frequently encounter literals—fixed values directly written in the code. These literals serve as the basic building blocks for assigning values to variables. In this post, we’ll explore different types of literals in Solidity, including address literals, integer literals, string literals, Unicode literals, and hexadecimal literals. Understanding how to use them effectively...
spacer

Fixed-size byte arrays - Solidity Part 3.1.10

In Solidity, fixed-sized byte arrays are essential for managing and storing binary data efficiently. They are a powerful feature of the language, offering specific operators and a length member that facilitate their manipulation. This post will dive into the intricacies of fixed-sized byte arrays, including their operators and the length member.Source Code: https://github.com/scaihai/enkwadore-blog-blockchain-demos/tree/main/solidity/contracts/3.1.10What...
spacer

Contract Type - Solidity Part 3.1.9

In Solidity, understanding the different types is crucial to writing robust smart contracts. Among these types, the contract type plays a pivotal role in how contracts interact with each other and manage Ethereum addresses. This post will explore what the contract type is, how it relates to the address and address payable types, and provide insights into practical scenarios where these concepts come...
spacer

balance, code and codehash members of address - Solidity Part 3.1.8

In Solidity, the address type is more than just an identifier for an account or contract. It comes with a variety of members that provide access to crucial information about the blockchain’s state. In this post, we’ll focus on three important members of an address: balance, code, and codehash.1. balanceThe balance member of an address returns the amount of Wei (the smallest denomination of Ether)...
spacer

staticcall function in address - Solidity Part 3.1.7

When working with smart contracts in Solidity, understanding how to interact with other contracts securely and efficiently is crucial. One such interaction method is the staticcall function, which is a powerful tool when you need to call a function on another contract without changing the state of the blockchain. In this post, we’ll delve into what staticcall is, how it works, and when to use it in...
spacer

delegatecall Function in address - Solidity Part 3.1.6

In Solidity, one of the most powerful and, potentially, dangerous functions is delegatecall. This function allows for the execution of a function call to another contract, but with the context (storage, msg.sender, msg.value) of the calling contract. This post will delve into what delegatecall is, how it works, and its common use cases, along with some examples to illustrate its functionality.Source...
spacer