Files
openzeppelin-contracts/contracts/utils/Calldata.sol
github-actions[bot] 39f5a0284e Release v5.3.0 (rc) (#5503)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Ernesto García <ernestognw@gmail.com>
2025-03-19 18:02:18 +01:00

26 lines
702 B
Solidity

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0-rc.0) (utils/Calldata.sol)
pragma solidity ^0.8.20;
/**
* @dev Helper library for manipulating objects in calldata.
*/
library Calldata {
// slither-disable-next-line write-after-write
function emptyBytes() internal pure returns (bytes calldata result) {
assembly ("memory-safe") {
result.offset := 0
result.length := 0
}
}
// slither-disable-next-line write-after-write
function emptyString() internal pure returns (string calldata result) {
assembly ("memory-safe") {
result.offset := 0
result.length := 0
}
}
}