Skip to content
Lattice

CCTPHookReceiptRenderer

Git Source

Title: CCTPHookReceiptRenderer

Authors: David Dada <daveproxy80@gmail.com> (https://github.com/dadadave80), Modified from Uniswap v4 Periphery (https://github.com/Uniswap/v4-periphery)

Builds fully on-chain JSON + SVG metadata for an immutable CCTP delivery receipt.

Functions

tokenURI

function tokenURI(RenderParams memory p) internal pure returns (string memory);

Parameters

NameTypeDescription
pRenderParams

Returns

NameTypeDescription
<none>string

_coreAttributes

function _coreAttributes(RenderParams memory p, string memory amount, string memory source)
        private
        pure
        returns (bytes memory);

Parameters

NameTypeDescription
pRenderParams
amountstring
sourcestring

Returns

NameTypeDescription
<none>bytes

_routeAttributes

function _routeAttributes(
        RenderParams memory p,
        string memory destination,
        string memory sender,
        string memory recipient
    ) private pure returns (bytes memory);

Parameters

NameTypeDescription
pRenderParams
destinationstring
senderstring
recipientstring

Returns

NameTypeDescription
<none>bytes

formatUSDC

function formatUSDC(uint256 amount) internal pure returns (string memory);

Parameters

NameTypeDescription
amountuint256

Returns

NameTypeDescription
<none>string

sourceLabel

function sourceLabel(uint32 domain) internal pure returns (string memory);

Parameters

NameTypeDescription
domainuint32

Returns

NameTypeDescription
<none>string

destinationLabel

function destinationLabel(uint256 chainId) internal pure returns (string memory);

Parameters

NameTypeDescription
chainIduint256

Returns

NameTypeDescription
<none>string

_svg

function _svg(RenderParams memory p) private pure returns (string memory);

Parameters

NameTypeDescription
pRenderParams

Returns

NameTypeDescription
<none>string

_shell

function _shell(Display memory d) private pure returns (bytes memory);

Parameters

NameTypeDescription
dDisplay

Returns

NameTypeDescription
<none>bytes

_header

function _header(uint256 tokenId, string memory accent) private pure returns (bytes memory);

Parameters

NameTypeDescription
tokenIduint256
accentstring

Returns

NameTypeDescription
<none>bytes

_amountAndRoute

function _amountAndRoute(string memory amount, string memory source, string memory destination)
        private
        pure
        returns (bytes memory);

Parameters

NameTypeDescription
amountstring
sourcestring
destinationstring

Returns

NameTypeDescription
<none>bytes

_facts

function _facts(string memory sender, string memory recipient, uint64 recordedAt)
        private
        pure
        returns (bytes memory);

Parameters

NameTypeDescription
senderstring
recipientstring
recordedAtuint64

Returns

NameTypeDescription
<none>bytes
function _footer(string memory accent) private pure returns (bytes memory);

Parameters

NameTypeDescription
accentstring

Returns

NameTypeDescription
<none>bytes

_circles

function _circles(uint256 seed, string memory accent, string memory accent2) private pure returns (bytes memory);

Parameters

NameTypeDescription
seeduint256
accentstring
accent2string

Returns

NameTypeDescription
<none>bytes

_palette

function _palette(uint256 index) private pure returns (string memory accent, string memory accent2);

Parameters

NameTypeDescription
indexuint256

Returns

NameTypeDescription
accentstring
accent2string

_short

function _short(string memory value, uint256 leading, uint256 trailing) private pure returns (string memory);

Parameters

NameTypeDescription
valuestring
leadinguint256
trailinguint256

Returns

NameTypeDescription
<none>string

Structs

RenderParams

struct RenderParams {
        uint256 tokenId;
        uint32 sourceDomain;
        bytes32 sender;
        address originalRecipient;
        uint256 amount;
        uint64 recordedAt;
        uint256 destinationChainId;
    }

Properties

NameTypeDescription
tokenIduint256
sourceDomainuint32
senderbytes32
originalRecipientaddress
amountuint256
recordedAtuint64
destinationChainIduint256

Display

struct Display {
        string source;
        string destination;
        string amount;
        string sender;
        string recipient;
        string accent;
        string accent2;
    }

Properties

NameTypeDescription
sourcestring
destinationstring
amountstring
senderstring
recipientstring
accentstring
accent2string