Skip to main content

ModStore

Git Source

Mainnet: 0xB9E4B658298C7A36BdF4C2832042A5D6700c3Ab8

Inherits: IModStore, Operatable, TerminalUtility

Stores mods for each project.

Mods can be used to distribute a percentage of payments or tickets to preconfigured beneficiaries.

State Variables

_payoutModsOf

mapping(uint256 => mapping(uint256 => PayoutMod[])) private _payoutModsOf;

_ticketModsOf

mapping(uint256 => mapping(uint256 => TicketMod[])) private _ticketModsOf;

projects

The contract storing project information.

IProjects public immutable override projects;

Functions

payoutModsOf

Get all payout mods for the specified project ID.

function payoutModsOf(uint256 _projectId, uint256 _configuration) external view override returns (PayoutMod[] memory);

Parameters

NameTypeDescription
_projectIduint256The ID of the project to get mods for.
_configurationuint256The configuration to get mods for.

Returns

NameTypeDescription
<none>PayoutMod[]An array of all mods for the project.

ticketModsOf

Get all ticket mods for the specified project ID.

function ticketModsOf(uint256 _projectId, uint256 _configuration) external view override returns (TicketMod[] memory);

Parameters

NameTypeDescription
_projectIduint256The ID of the project to get mods for.
_configurationuint256The configuration to get mods for.

Returns

NameTypeDescription
<none>TicketMod[]An array of all mods for the project.

constructor

constructor(IProjects _projects, IOperatorStore _operatorStore, ITerminalDirectory _terminalDirectory)
Operatable(_operatorStore)
TerminalUtility(_terminalDirectory);

Parameters

NameTypeDescription
_projectsIProjectsThe contract storing project information
_operatorStoreIOperatorStoreA contract storing operator assignments.
_terminalDirectoryITerminalDirectoryA directory of a project's current Juicebox terminal to receive payments in.

setPayoutMods

Adds a mod to the payout mods list.

Only the owner or operator of a project can make this call, or the current terminal of the project.

function setPayoutMods(uint256 _projectId, uint256 _configuration, PayoutMod[] memory _mods)
external
override
requirePermissionAcceptingAlternateAddress(
projects.ownerOf(_projectId),
_projectId,
Operations.SetPayoutMods,
address(terminalDirectory.terminalOf(_projectId))
);

Parameters

NameTypeDescription
_projectIduint256The project to add a mod to.
_configurationuint256The configuration to set the mods to be active during.
_modsPayoutMod[]The payout mods to set.

setTicketMods

Adds a mod to the ticket mods list.

Only the owner or operator of a project can make this call, or the current terminal of the project.

function setTicketMods(uint256 _projectId, uint256 _configuration, TicketMod[] memory _mods)
external
override
requirePermissionAcceptingAlternateAddress(
projects.ownerOf(_projectId),
_projectId,
Operations.SetTicketMods,
address(terminalDirectory.terminalOf(_projectId))
);

Parameters

NameTypeDescription
_projectIduint256The project to add a mod to.
_configurationuint256The configuration to set the mods to be active during.
_modsTicketMod[]The ticket mods to set.