TerminalV1Rescue
Inherits: Operatable
, ITerminalV1Rescue
, ITerminal
, ReentrancyGuard
, Ownable
Terminal allowing allow listed projects with one-time funding cycles to rescue stuck ETH.
State Variables
projects
The Projects contract which mints ERC-721's that represent project ownership and transfers.
IProjects public immutable override projects;
fundingCycles
The contract storing all funding cycle configurations.
IFundingCycles public immutable override fundingCycles;
ticketBooth
The contract that manages Ticket printing and redeeming.
ITicketBooth public immutable override ticketBooth;
terminalDirectory
The directory of terminals.
ITerminalDirectory public immutable override terminalDirectory;
balanceOf
The amount of ETH that each project is responsible for.
mapping(uint256 => uint256) public override balanceOf;
rescueAllowed
The addresses that are allowed to be rescued.
mapping(uint256 => bool) public override rescueAllowed;
migrationIsAllowed
mapping(ITerminal => bool) public override migrationIsAllowed;
Functions
constructor
constructor(
IProjects _projects,
IFundingCycles _fundingCycles,
ITicketBooth _ticketBooth,
IOperatorStore _operatorStore,
ITerminalDirectory _terminalDirectory,
address _owner
) Operatable(_operatorStore);
Parameters
Name | Type | Description |
---|---|---|
_projects | IProjects | A Projects contract which mints ERC-721's that represent project ownership and transfers. |
_fundingCycles | IFundingCycles | A funding cycle configuration store. |
_ticketBooth | ITicketBooth | A contract that manages Ticket printing and redeeming. |
_operatorStore | IOperatorStore | A contract storing operator assignments. |
_terminalDirectory | ITerminalDirectory | A directory of a project's current Juicebox terminal to receive payments in. |
_owner | address |
printTickets
Allows a project to print tickets for a specified beneficiary.
Only a project's owner or a designated operator can print tickets.
function printTickets(
uint256 _projectId,
uint256 _amount,
address _beneficiary,
string memory _memo,
bool _preferUnstakedTickets
) external override requirePermission(projects.ownerOf(_projectId), _projectId, Operations.PrintTickets);
Parameters
Name | Type | Description |
---|---|---|
_projectId | uint256 | The ID of the project to print tickets for. |
_amount | uint256 | The amount of tickets to print. |
_beneficiary | address | The address to send the printed tickets to. |
_memo | string | A memo to leave with the printing. |
_preferUnstakedTickets | bool | If there is a preference to unstake the printed tickets. |
rescue
A function that burns the supply of the dead address for a project.
Callable only by project owner, if rescue is allowed by the projectId, if the project's current funding cycle is non recurring.
function rescue(uint256 _projectId, address payable _beneficiary, uint256 _amount) external override nonReentrant;
Parameters
Name | Type | Description |
---|---|---|
_projectId | uint256 | The ID of the project whose ETH is being resued. |
_beneficiary | address payable | The recipient of the resucued funds. |
_amount | uint256 | The amount to rescue as a fixed point number. |
addToBalance
Receives and allocates funds belonging to the specified project.
function addToBalance(uint256 _projectId) external payable override;
Parameters
Name | Type | Description |
---|---|---|
_projectId | uint256 | The ID of the project to which the funds received belong. |
toggleRescue
Allows certain projects to migrate to have funds rescued.
function toggleRescue(uint256 _projectId) external override onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
_projectId | uint256 | The ID of the project to allow rescuing. |
migrate
NO-OP
function migrate(uint256, ITerminal) external pure override;
allowMigration
NO-OP
function allowMigration(ITerminal) external pure override;
pay
NO-OP
function pay(uint256, address, string calldata, bool) external payable override returns (uint256);