releaseV1TokensOf
Contract: JBV1TokenPaymentTerminal
Interface: IJBPaymentTerminal
- Step by step
- Code
- Errors
- Events
- Bug bounty
Allows a project owner to gain custody of all the v1 tokens that have been paid, after they have finalized the ability for v1 token holders to convert to v2 tokens via this contract.
Definition
function releaseV1TokensOf(uint256 _v1ProjectId, address _beneficiary) external override { ... }
- Arguments:
_v1ProjectId
is the ID of the v1 project whose tokens are being released._beneficiary
is the address that the tokens are being sent to.
- The function can be accessed externally by anyone.
- The resulting function overrides a function definition from the
IJBV1TokenPaymentTerminal
interface. - The function doesn't return anything.
Body
-
Make sure the message sender is the owner of the v1 project.
// Make sure only the v1 project owner can retrieve the tokens.
if (msg.sender != ticketBooth.projects().ownerOf(_v1ProjectId)) revert NOT_ALLOWED();Internal references:
External references:
-
Make sure the v1 project has not yet been finalized.
// Make sure v1 token conversion has not yet finalized.
if (finalized[_v1ProjectId]) revert MIGRATION_TERMINATED();Internal references:
-
Get a reference to the v1 ERC20 token being used by the project.
// Get a reference to the v1 project's ERC20 tokens.
ITickets _v1Token = ticketBooth.ticketsOf(_v1ProjectId);