Tag: smart-contract
-
Updated
Solidity: Multicall - Aggregate Multiple Contract Calls
Category: Blockchain
The main idea of Multicaller is to aggregate multiple contract function calls into a single one. It's usually to batch contract reads from off-chain apps. However, it could also be used to batch contract writes.
-
Updated
Demystifying Solidity ABI Encoding
Category: Blockchain
There are many encode functions in Solidity: abi.encode(), abi.encodePacked(), abi.encodeWithSignature(), and abi.encodeCall(). Which one to use, and when.
-
Updated
Solidity: Read Contract Storage by Slots with Foundry
Category: Blockchain
State variables are stored in different "slots" in a contract, and each slot is 32 bytes (256 bits). However, multiple adjacent state variables declared in the contract may be packed into the same slot by the Solidity compiler if their combined size does not exceed 32 bytes.
-
Updated
Solidity: CREATE vs CREATE2
Category: Blockchain
How to deploy a contract using `CREATE2` which is introduced in EIP-1014 to provide more flexible address generation.
-
Updated
Solidity: calldata, memory, and storage
Category: Blockchain
If you can, try to use calldata as data location because it will avoid copies, reduce gas usage, and also make sure that the data cannot be modified.
-
Updated
hardhat-deploy: Upgradeable Contracts with Linked Libraries
Category: Blockchain
Whenever the library is changed, hardhat-deploy will deploy a new implementation and upgrade the proxy.