changeTokenOf
Contract: JBController
Interface: IJBController
- Step by step
- Code
- Errors
- Bug bounty
Swap the current project's token that is minted and burned for another, and transfer ownership of the current token to another address if needed.
Only a project's owner or operator can change its token.
Definition
function changeTokenOf(
uint256 _projectId,
IJBToken _token,
address _newOwner
)
external
virtual
override
requirePermission(projects.ownerOf(_projectId), _projectId, JBOperations.CHANGE_TOKEN) { ... }
- Arguments:
_projectId
is the ID of the project to which the changed token belongs._token
is the new token, which must adhere to theIJBToken
specification._newOwner
is an address to transfer the current token's ownership to. This is optional, but it cannot be done later.
- Through the
requirePermission
modifier, the function is only accessible by the project's owner, or from an operator that has been given theJBOperations.CHANGE_TOKEN
permission by the project owner for the provided_projectId
. - The function can be overriden by inheriting contracts.
- The function overrides a function definition from the
IJBController
interface. - The function doesn't return anything.
Body
-
Get a reference to the project's current funding cycle.
// Get a reference to the project's current funding cycle.
JBFundingCycle memory _fundingCycle = fundingCycleStore.currentOf(_projectId);