Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

LibCreate2Salt

Git Source

Derives the CREATE2 salts of deterministic deployments, so that permissionless and reserved addresses never collide.

Functions

permissionless

Derive the CREATE2 salt of a permissionless deployment.

function permissionless(bytes32 salt) internal pure returns (bytes32);

Parameters

NameTypeDescription
saltbytes32The user-provided salt

Returns

NameTypeDescription
<none>bytes32The CREATE2 salt

reserved

Derive the CREATE2 salt of a deployment reserved for a caller.

function reserved(bytes32 salt, address caller) internal pure returns (bytes32);

Parameters

NameTypeDescription
saltbytes32The user-provided salt
calleraddressThe caller for which the address is reserved

Returns

NameTypeDescription
<none>bytes32The CREATE2 salt

Enums

DeploymentType

The type of a deterministic deployment.

Prefixes the CREATE2 salt pre-image, so that the types never collide. New types must be appended, so that existing addresses do not change.

enum DeploymentType {
    PERMISSIONLESS,
    RESERVED
}