Skip to main content

PointerLibrary

Git Source

Author: Axicon Labs Limited

Data type that represents a pointer to a slice of contract code at an address.

Functions

createPointer

Create a pointer to a slice of contract code at an address.

function createPointer(address _location, uint48 _start, uint48 _size) internal pure returns (Pointer);

Parameters

NameTypeDescription
_locationaddressThe address of the contract code
_startuint48The starting position of the slice
_sizeuint48The size of the slice

location

Get the address of the pointed contract code from a pointer.

function location(Pointer self) internal pure returns (address);

Parameters

NameTypeDescription
selfPointerThe pointer to the slice of contract code

Returns

NameTypeDescription
<none>addressThe address of the contract code

start

Get the starting position of the pointed slice from a pointer.

function start(Pointer self) internal pure returns (uint48);

Parameters

NameTypeDescription
selfPointerThe pointer to the section of contract code

Returns

NameTypeDescription
<none>uint48The starting position of the slice

size

Get the size of the pointed slice from a pointer.

function size(Pointer self) internal pure returns (uint48);

Parameters

NameTypeDescription
selfPointerThe pointer to the slice of contract code

Returns

NameTypeDescription
<none>uint48The size of the slice

data

Get the data of the pointed slice from a pointer as a bytearray.

function data(Pointer self) internal view returns (bytes memory);

Parameters

NameTypeDescription
selfPointerThe pointer to the slice of contract code

Returns

NameTypeDescription
<none>bytesThe pointed slice as a bytearray

dataStr

Get the data of the pointed slice from a pointer as a string.

function dataStr(Pointer self) internal view returns (string memory);

Parameters

NameTypeDescription
selfPointerThe pointer to the slice of contract code

Returns

NameTypeDescription
<none>stringThe pointed slice as a string

decompressedDataStr

Returns the result of decompressing the pointed slice of data with LZ-77 interpreted as a UTF-8-encoded string.

function decompressedDataStr(Pointer self) internal view returns (string memory);

Parameters

NameTypeDescription
selfPointerThe pointer to the slice of contract code

Returns

NameTypeDescription
<none>stringThe LZ-77 decompressed data as a string