From 6c4109ca035534c43dd37533902f6154e9c312e9 Mon Sep 17 00:00:00 2001 From: Divya Chaudhary Date: Wed, 25 Jun 2025 11:20:01 +0000 Subject: [PATCH] docs: add NatSpec comments for Bytes32AddressLib --- src/utils/Bytes32AddressLib.sol | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/utils/Bytes32AddressLib.sol b/src/utils/Bytes32AddressLib.sol index 448fb759..05baf348 100644 --- a/src/utils/Bytes32AddressLib.sol +++ b/src/utils/Bytes32AddressLib.sol @@ -4,10 +4,18 @@ pragma solidity >=0.8.0; /// @notice Library for converting between addresses and bytes32 values. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/Bytes32AddressLib.sol) library Bytes32AddressLib { + /// @notice Converts a bytes32 value into an address. + /// @param bytesValue The bytes32 value to convert. + /// @return The resulting address. + function fromLast20Bytes(bytes32 bytesValue) internal pure returns (address) { return address(uint160(uint256(bytesValue))); } + /// @notice Converts an address to a bytes32 representation. + /// @param addressValue The address to convert. + /// @return The resulting bytes32 value. + function fillLast12Bytes(address addressValue) internal pure returns (bytes32) { return bytes32(bytes20(addressValue)); }