CCTPHookReceiptRenderer
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
| Name | Type | Description |
|---|---|---|
| p | RenderParams |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | string |
_coreAttributes
function _coreAttributes(RenderParams memory p, string memory amount, string memory source)
private
pure
returns (bytes memory);Parameters
| Name | Type | Description |
|---|---|---|
| p | RenderParams | |
| amount | string | |
| source | string |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes |
_routeAttributes
function _routeAttributes(
RenderParams memory p,
string memory destination,
string memory sender,
string memory recipient
) private pure returns (bytes memory);Parameters
| Name | Type | Description |
|---|---|---|
| p | RenderParams | |
| destination | string | |
| sender | string | |
| recipient | string |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes |
formatUSDC
function formatUSDC(uint256 amount) internal pure returns (string memory);Parameters
| Name | Type | Description |
|---|---|---|
| amount | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | string |
sourceLabel
function sourceLabel(uint32 domain) internal pure returns (string memory);Parameters
| Name | Type | Description |
|---|---|---|
| domain | uint32 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | string |
destinationLabel
function destinationLabel(uint256 chainId) internal pure returns (string memory);Parameters
| Name | Type | Description |
|---|---|---|
| chainId | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | string |
_svg
function _svg(RenderParams memory p) private pure returns (string memory);Parameters
| Name | Type | Description |
|---|---|---|
| p | RenderParams |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | string |
_shell
function _shell(Display memory d) private pure returns (bytes memory);Parameters
| Name | Type | Description |
|---|---|---|
| d | Display |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes |
_header
function _header(uint256 tokenId, string memory accent) private pure returns (bytes memory);Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | |
| accent | string |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes |
_amountAndRoute
function _amountAndRoute(string memory amount, string memory source, string memory destination)
private
pure
returns (bytes memory);Parameters
| Name | Type | Description |
|---|---|---|
| amount | string | |
| source | string | |
| destination | string |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes |
_facts
function _facts(string memory sender, string memory recipient, uint64 recordedAt)
private
pure
returns (bytes memory);Parameters
| Name | Type | Description |
|---|---|---|
| sender | string | |
| recipient | string | |
| recordedAt | uint64 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes |
_footer
function _footer(string memory accent) private pure returns (bytes memory);Parameters
| Name | Type | Description |
|---|---|---|
| accent | string |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes |
_circles
function _circles(uint256 seed, string memory accent, string memory accent2) private pure returns (bytes memory);Parameters
| Name | Type | Description |
|---|---|---|
| seed | uint256 | |
| accent | string | |
| accent2 | string |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes |
_palette
function _palette(uint256 index) private pure returns (string memory accent, string memory accent2);Parameters
| Name | Type | Description |
|---|---|---|
| index | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| accent | string | |
| accent2 | string |
_short
function _short(string memory value, uint256 leading, uint256 trailing) private pure returns (string memory);Parameters
| Name | Type | Description |
|---|---|---|
| value | string | |
| leading | uint256 | |
| trailing | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | string |
Structs
RenderParams
struct RenderParams {
uint256 tokenId;
uint32 sourceDomain;
bytes32 sender;
address originalRecipient;
uint256 amount;
uint64 recordedAt;
uint256 destinationChainId;
}Properties
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | |
| sourceDomain | uint32 | |
| sender | bytes32 | |
| originalRecipient | address | |
| amount | uint256 | |
| recordedAt | uint64 | |
| destinationChainId | uint256 |
Display
struct Display {
string source;
string destination;
string amount;
string sender;
string recipient;
string accent;
string accent2;
}Properties
| Name | Type | Description |
|---|---|---|
| source | string | |
| destination | string | |
| amount | string | |
| sender | string | |
| recipient | string | |
| accent | string | |
| accent2 | string |