LibAddress

Git Source

This library helps manipulating addresses.

State Variables

ETH1_PREFIX

The base mask used to generate a bytes32 withdrawal credential from an address.

uint256 constant ETH1_PREFIX = 0x0100000000000000000000000000000000000000000000000000000000000000;

Functions

toWithdrawalCredentials

Utility to convert an address into withdrawal credentials.

function toWithdrawalCredentials(address addr) internal pure returns (bytes32);

Parameters

NameTypeDescription
addraddressThe address receiving the withdrawal of the validator

Returns

NameTypeDescription
<none>bytes32The bytes32 withdrawal credentials

fromWithdrawalCredentials

Utility to convert withdrawal credentials back to an address.

function fromWithdrawalCredentials(bytes32 withdrawalCredentials) internal pure returns (address);

Parameters

NameTypeDescription
withdrawalCredentialsbytes32The Withdrawal Credentials to convert

Returns

NameTypeDescription
<none>addressThe withdrawal account