Why storage slots are just dumb bytes and Solidity does the slicing Ethereum storage slots are just 32 raw bytes, a 256-bit word, usually shown as 64 hex characters with a 0x prefix. Slots don’t know types, addresses, or numbers. It’s the Solidity compiler and ABI that define how those bytes are sliced and interpreted.… Continue reading Ethereum doesn’t care about your variables
Author: Burt Snyder
Writing about interesting things and sharing ideas.
Solidity Storage Packing
TL;DR Writing about Solidity I’m deep-diving Solidity from the ground up to sharpen my understanding and share practical takeaways. This article collects my notes and examples, starting where it all begins: storage slots. Understanding how data lives in 32-byte words explains packing rules and gas costs. Once storage clicks, choosing the right types and using… Continue reading Solidity Storage Packing
The Oracle Problem in Blockchain: Why Chainlink Became the Most Trusted Source of Truth
Smart contracts can’t fetch data on their own. This article explains the oracle problem, why APIs aren’t enough, and how Chainlink solves it. Smart contracts are powerful: they execute code deterministically on-chain, without relying on human intervention. But they live in a closed environment(the blockchain) which cannot directly access external data like stock prices, weather… Continue reading The Oracle Problem in Blockchain: Why Chainlink Became the Most Trusted Source of Truth
What is API Development Part 1
Introduction: Part 1: Understanding APIs
Basic Blockchain Example Code
This code defines a Block struct using the Rust Programming Language with fields for the nonce, previous hash, and transactions, and a Blockchain struct with a field for a list of blocks. The Blockchain struct has an implementation with a new method that creates a new empty blockchain and adds a block with a nonce… Continue reading Basic Blockchain Example Code
Smart contract development and security
Keeping security in mind is important when developing smart contracts and there are a number of different techniques and philosophies in regards to your smart contract development and security. Revisiting the NftFactory I was discussing earlier we’re deploying a new ERC721 from an address that isn’t verified so far. This could lead to anyone using… Continue reading Smart contract development and security
Using blockchain tech in recordkeeping
New Jersey Corporations have been permitted to maintain records using blockchain technologies under a law that was passed in Sept, 2021. A digital ledger, which was also called an electronic network by some involved, is now allowed to store data by the new law. There are many different types of blockchain networks, not only bitcoin.… Continue reading Using blockchain tech in recordkeeping
A basic NFT modifiers and more…
So far in our ERC721 contract we’ve got one function ( mintOneNft ) that’s public (external) and anyone can mint. There is a difference between a public function and external but for our case at this time we just need to know it can be accessed by anyone in the outside world. Let’s add a… Continue reading A basic NFT modifiers and more…
A basic Nft – ERC721
Everyone loves an NFT and they all want one, so that’s why I’m using this contract type for my example. An ERC721 Nft token ( Non-Fungible-Token) needs a token id. You can’t live without that. We’ll just use the Counter class supplied to us by the awesome people at Open Zeppelin. Import the library and… Continue reading A basic Nft – ERC721
Factory Design Pattern with Solidity
The Factory design pattern is the most widely used design pattern from the popular 23 “Gang of Four” design patterns. The pattern designates that you define an interface or an abstract class for creating an object but you let the subclasses determine what class will be instantiated. The logic that creates the object isn’t exposed… Continue reading Factory Design Pattern with Solidity