ModStore
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
| Name | Type | Description | 
|---|---|---|
_projectId | uint256 | The ID of the project to get mods for. | 
_configuration | uint256 | The configuration to get mods for. | 
Returns
| Name | Type | Description | 
|---|---|---|
<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
| Name | Type | Description | 
|---|---|---|
_projectId | uint256 | The ID of the project to get mods for. | 
_configuration | uint256 | The configuration to get mods for. | 
Returns
| Name | Type | Description | 
|---|---|---|
<none> | TicketMod[] | An array of all mods for the project. | 
constructor
constructor(IProjects _projects, IOperatorStore _operatorStore, ITerminalDirectory _terminalDirectory)
    Operatable(_operatorStore)
    TerminalUtility(_terminalDirectory);
Parameters
| Name | Type | Description | 
|---|---|---|
_projects | IProjects | The contract storing project information | 
_operatorStore | IOperatorStore | A contract storing operator assignments. | 
_terminalDirectory | ITerminalDirectory | A 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
| Name | Type | Description | 
|---|---|---|
_projectId | uint256 | The project to add a mod to. | 
_configuration | uint256 | The configuration to set the mods to be active during. | 
_mods | PayoutMod[] | 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
| Name | Type | Description | 
|---|---|---|
_projectId | uint256 | The project to add a mod to. | 
_configuration | uint256 | The configuration to set the mods to be active during. | 
_mods | TicketMod[] | The ticket mods to set. |