Blockchain

Find The Bug in this Smart Contract [series] 2024

Find The Bug in this Smart Contract [series] 2024

// SPDX-License-Identifier: MIT pragma solidity 0.8.18; /* * @author not-so-secure-dev * @title PasswordStore * @notice This contract allows you to store a private password that others won’t be able to see. * You can update your password at any time. */ contract PasswordStore { error PasswordStore__NotOwner(); address private s_owner; //this is not really private //all …

Find The Bug in this Smart Contract [series] 2024 Read More »

abi.encode, abi.encodePacked, and abi.decode in Solidity 

abi.encode, abi.encodePacked, and abi.decode in Solidity 

In Solidity, several key functions for encoding and decoding data are abi.encode, encodePacked decode string.concat  ,bytes.concat and finally, type casting using bytes or strings. These functions allow you to convert Solidity data types like strings, integers, addresses, etc., into a compact binary representation and back again. Understanding how to encode and decode data properly is …

abi.encode, abi.encodePacked, and abi.decode in Solidity  Read More »