The calldata Storage

Learn how calldata works in Solidity.

calldata is recognized as the third type of data location in Solidity. It operates similarly to memory by serving as a temporary storage space. Although calldata is temporary storage, it differs slightly from memory. The primary distinction is that once function arguments are supplied, they can’t be changed inside the function because calldata is nonmodifiable storage. It’s less expensive than memory and is mostly utilized with external function types, which is the second significant distinction.

calldata is often utilized with external functions, and the this keyword allows us to invoke a function that’s declared with the external keyword inside the contract.

Key characteristics

The key characteristics of calldata are listed below: ...