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 ...
Smart contracts are one of the core building blocks of Web3 and decentralized finance (DeFi). They promise a future where transactions can be executed automatically without intermediaries, adding speed and trust to digital agreements. But what exactl...
DeltaPrime, a decentralised finance (DeFi) protocol, operating on the Arbitrum and Avalanche blockchains, suffered its second security incident in a matter of months, leading to the loss of approximately $4.85 million. DeltraPrime lost $6 million in ...
THE IMPACT OF SMART CONTRACTS ON THE INDUSTRIES LIKE FINANCE, REAL ESTATE AND SUPPLY CHAINS. What are Smart Contracts? A smart contract is a self-executing contract with the terms of the agreement written directly into code. It operates on blockchai...
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...
INTRODUCTION: Non-fungible tokens (NFTs) have revolutionized how digital assets are created, owned, and traded. ERC721, the most common standard for NFTs on the Ethereum blockchain, provides a framework for creating unique, indivisible tokens. In thi...