Skip to main content

TerminalV1Rescue

Git Source

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

NameTypeDescription
_projectsIProjectsA Projects contract which mints ERC-721's that represent project ownership and transfers.
_fundingCyclesIFundingCyclesA funding cycle configuration store.
_ticketBoothITicketBoothA contract that manages Ticket printing and redeeming.
_operatorStoreIOperatorStoreA contract storing operator assignments.
_terminalDirectoryITerminalDirectoryA directory of a project's current Juicebox terminal to receive payments in.
_owneraddress

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

NameTypeDescription
_projectIduint256The ID of the project to print tickets for.
_amountuint256The amount of tickets to print.
_beneficiaryaddressThe address to send the printed tickets to.
_memostringA memo to leave with the printing.
_preferUnstakedTicketsboolIf 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

NameTypeDescription
_projectIduint256The ID of the project whose ETH is being resued.
_beneficiaryaddress payableThe recipient of the resucued funds.
_amountuint256The 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

NameTypeDescription
_projectIduint256The 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

NameTypeDescription
_projectIduint256The 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);