When Storing Dynamic type data , We don’t explicitly store the data in the next immediate slot, instead we only store the address of the slot where the element of that index is , In simpler words we are basically storing the “Pointer” to the actual a...
Let’s first have a look at the Code contract Demo{ uint256 a 1234 // slot 0 uint8 b = 0x12; // slot 1 uint8[6] c = [1,2,3,4,5,6]; // line 4 (slot 2) uint256[2] d = [10,20] // line 5 slot(3 & 4) function getSlotvalue(uint slot) public...
Introduction to Solidity and Remix .sol File Extension: Files with the .sol extension are Solidity contracts. SPDX License Identifier (// SPDX-License-Identifier: MIT): Although not required by the compiler, including this identifier is recommended...
Lets first look at the code contract A { struct SomeStruct{ uint256 val1; uint16 val2; bool val3; } uint256 a = 3; // slot 0 uint256 b = 0x555 // slot 1 SomeStruct structVar = SomeStruct(0x2345,5,true) // Line 10 function getSlotVal(u...
Introduction When developing smart contracts, we often need to interact with contracts that have already been deployed. It would not be a smart decision to deploy the contract and test it on Mainnet using real ETH. But, thankfully for us, there is a ...
In this blog post, I’ll walk you through how I automated the process of installing Apache2 and deploying a static website on an EC2 instance using Ansible. This task is an essential part of cloud infrastructure automation and plays a key role in impr...
Meet Aryan, a skilled DevOps engineer working at a mid-sized tech firm called TechNova. Each day for Aryan starts early, with a strong cup of coffee as he settles into his home workspace. The soft hum of his dual-monitor setup fills the room as he ch...
Error handling lies at the core of writing secure and efficient smart contracts in Solidity. Whether you’re working on DeFi protocols, NFT marketplaces, or dApps, knowing how and when to use “require”, “assert”, and “revert” is crucial for preventing...
Many high severity findings found during private audits by external auditors could have been found by the protocol developers themselves using invariant fuzz testing prior to engaging external auditors. While this doesn’t require developing an “attac...
The world of blockchain and smart contracts has long been hampered by the limitations of operating in a closed, self-contained environment. Traditional blockchain networks have struggled to connect their on-chain applications and logic to the wealth ...