DefaultTokenUriResolver
Inherits: IJBTokenUriResolver
, JBOperatable
, Ownable
State Variables
fundingCycleStore
The address of the Juicebox Funding Cycle Store contract.
IJBFundingCycleStore public immutable fundingCycleStore;
projects
The address of the Juicebox Projects contract.
IJBProjects public immutable projects;
directory
The address of the Juicebox Directory contract.
IJBDirectory public immutable directory;
projectHandles
The address of the Juicebox Project Handles contract.
IJBProjectHandles public immutable projectHandles;
capsulesTypeface
The address of the Capsules typeface contract.
ITypeface public immutable capsulesTypeface;
themes
Mapping containing each project's theme, if one is set. Themes describe the color palette to be used when generating the token uri SVG.
Theme 0 is the default theme used for all projects without custom themes.
mapping(uint256 => Theme) private themes;
Functions
constructor
constructor(
IJBOperatorStore _operatorStore,
IJBDirectory _directory,
IJBProjectHandles _projectHandles,
ITypeface _capsulesTypeface
) JBOperatable(_operatorStore);
getTheme
Gets the Theme for a given id in the private themes mapping.
function getTheme(uint256 id) external view returns (Theme memory);
Parameters
Name | Type | Description |
---|---|---|
id | uint256 | The id of the theme to fetch. This is the project's ID for all values except 0, which is the default theme. |
Returns
Name | Type | Description |
---|---|---|
<none> | Theme | Theme The Theme corresponding to the id passed as an argument. |
getFontSource
Gets the Base64 encoded Capsules-500.otf typeface.
function getFontSource() internal view returns (bytes memory fontSource);
Returns
Name | Type | Description |
---|---|---|
fontSource | bytes | The Base64 encoded font file. |
pad
Transform strings to target length by abbreviating or padding with spaces.
Shortens long strings to 13 characters including an ellipsis and adds left padding spaces to short strings. Allows variable target length to account for strings that have unicode characters that are longer than 1 byte but only take up 1 character space.
function pad(bool left, string memory str, uint256 targetLength) internal pure returns (string memory);