NFTSVGUtils

Git Source

State Variables

HEX_DIGITS

bytes16 private constant HEX_DIGITS = "0123456789abcdef";

Functions

Generates the logo for the NFT.

function generateSVGLogo() public pure returns (string memory);

addressToString

Converts an address to 2 string slices.

function addressToString(address addr_)
    public
    pure
    returns (string memory, string memory);

Parameters

NameTypeDescription
addr_addressaddress to convert to string.

uintToFloatString

Converts uints to float strings with 4 decimal places.

function uintToFloatString(
    uint256 value_,
    uint8 decimals_
) public pure returns (string memory);

Parameters

NameTypeDescription
value_uint256uint to convert to string.
decimals_uint8number of decimal places of the input value.

_uintToString

Code borrowed form: https://github.com/transmissions11/solmate/blob/main/src/utils/LibString.sol

Converts uints to strings.

function _uintToString(uint256 value_)
    internal
    pure
    returns (string memory str);

Parameters

NameTypeDescription
value_uint256uint to convert to string.