âī¸Setter Functions
This page provides an overview on how the setter functions of the NFTDelegation smart contract work.
How to register a Delegation Address?
Purpose: The registerDelegationAddress() function registers a new delegation Address.
Description: The function takes six parameters: _collectionAddress, _delegationAddress, _expiryDate, _useCase, _allTokens and _tokenid. The _collectionAddress parameter is the address of the collection that the delegation address will be registered. The _delegationAddress parameter is the address to register. The _expiryDate parameter sets the expiry date of the delegation, after that date the delegation is not active. The _useCase parameter is the type of delegation to register. The _allTokens parameter can take two statuses (true/false), if true it registers the delegation for all collection tokens owned by the delegator, if false then it refers to a specific token that is set on the _tokenid parameter. The _tokenid parameter is the ID of the token to register the delegation for.
Notes:
To register a delegation Address for all collections the value of parameter _collectionAddress should be set to 0x8888888888888888888888888888888888888888.
To delegate for all tokens owned set the _allTokens parameter to true, otherwise, by setting _allTokens to false the delegation refers only to the token id set in the _tokenid parameter
How to register a Delegation Address using an address with sub-delegation rights?
Purpose: The registerDelegationAddressUsingSubDelegation() function registers a new delegation Address by taking into consideration the sub-delegation rights given by a delegator to a specific delegation Address.
Description: The function takes seven parameters: _delegatorAddress, _collectionAddress, _delegationAddress, _expiryDate, _useCase, _allTokens and _tokenid. The _delegatorAddress parameter is the address of the delegator who gave sub-delegation rights to the address that will execute this function. The _collectionAddress parameter is the address of the collection that the delegation will be registered. The _delegationAddress parameter is the address to register. The _expiryDate parameter sets the expiry date of the delegation, after that date the delegation is not active. The _useCase parameter is the type of delegation to register. The _allTokens parameter can take two status (true/false), if true it registers the delegation for all collection tokens owned by the delegator, if false then it refers to a specific token that is set on the _tokenid parameter. The _tokenid parameter is the ID of the token to register the delegation for.
How to revoke a Delegation Address?
Purpose: The revokeDelegationAddress() function revokes the delegation rights given to a delegation address on a specific use case for a specific collection.
Description: The function takes three parameters: _collectionAddress, _delegationAddress and _useCase. The _collectionAddress parameter is the address of the collection that the delegation will be revoked. The _delegationAddress parameter is the address that will be revoked. The _useCase parameter is the type of delegation that will be revoked.
How to revoke a Delegation Address using an address with sub-delegation rights?
Purpose: The revokeDelegationAddressUsingSubdelegation() function revokes the delegation rights given to a delegation address on a specific use case for a specific collection by taking into consideration the sub-delegation rights given by a delegator to a specific delegation Address.
Description: The function takes four parameters: _delegatorAddress, _collectionAddress, _delegationAddress and _useCase. The _delegatorAddress parameter is the address of the delegator who gave sub-delegation rights to the address that will execute this function. The _collectionAddress parameter is the address of the collection that the delegation will be revoked. The _delegationAddress parameter is the address that will be revoked. The _useCase parameter is the type of delegation that will be revoked.
How to register multiple Delegation Addresses?
Purpose: The batchDelegations() function registers delegation rights to 1 to 5 delegation addresses on various use cases of different collections.
Description: The function takes six parameters: _collectionAddresses[], _delegationAddresses[], _expiryDates[], _useCases[], _allTokens[] and _tokenids[]. The _collectionAddresses[] parameter is an array that includes the collection addresses for each one of the delegation addresses that will be registered. The _delegationAddresses[] parameter is an array that includes the delegation addresses that will be registered for each one of the collection addresses. The _expiryDates[] parameter is an array that includes the expiry date for each one of the delegations. The _useCases[] parameter is an array that includes the type of a delegation that will be registered. The _allTokens parameter is an array that refers to the delegated tokens of each collection. The _tokenids[] parameter is an array that specifies the token id assigned to a delegation.
How to revoke multiple Delegation Addresses?
Purpose: The batchRevocations() function revokes the delegation rights given to 1 to 5 delegation addresses on various use cases of different collections.
Description: The function takes three parameters: _collectionAddresses[], _delegationAddresses[] and _useCases[]. The _collectionAddresses parameter is an array that includes the collection addresses for each one of the delegation addresses that will be revoked. The _delegationAddresses parameter is an array that includes the delegation addresses for each one of the collection addresses that will be revoked. The _useCases parameter is an array that includes the types of delegations that will be revoked.
How to update a Delegation Address?
Purpose: The updateDelegationAddress() function updates a delegation Address.
Description: The function takes seven parameters: _collectionAddress, _olddelegationAddress, _newdelegationAddress, _expiryDate, _useCase, _allTokens and _tokenid. The _collectionAddress parameter is the address of the collection that the new delegation will be registered. The _olddelegationAddress parameter is the address that will be removed. The _newdelegationAddress parameter is the address to register. The _expiryDate parameter sets the expiry date of the delegation, after that date the delegation is not active. The _useCase parameter is the type of delegation to register. The _allTokens parameter can take two statuses (true/false), if true it registers the delegation for all collection tokens owned by the delegator, otherwise, if false then it refers to a specific token that is set on the _tokenid parameter. The _tokenid parameter is the ID of the token to register the delegation for.
How to globally lock my hot wallet?
Purpose: The setGlobalLock() function locks the wallet address that executes the transaction to prevent any delegation registration of it on any use case on any collection.
Description: The function takes one parameter: _status. The _status parameter is a bool value (true/false), if _status = true the wallet address locks itself, if _status = false the wallet address unlocks.
How to lock my hot wallet on a collection?
Purpose: The setCollectionLock() function locks the wallet address that executes the transaction to prevent any registration of it on a specific collection.
Description: The function takes two parameters: _collectionAddress and _status. The _collectionAddress parameter is the address of the collection that the wallet address will be locked/unlocked. The _status parameter is a bool value (true/false), if _status = true the wallet address locks itself, if _status = false the wallet address unlocks.
How to lock my hot wallet on a specific usecase on a collection?
Purpose: The setCollectionUsecaseLock() function locks the wallet address that executes the transaction to prevent any registration of it on a specific usecase on a specific collection.
Description: The function takes three parameters: _collectionAddress, _useCase and _status. The _collectionAddress parameter is the address of the collection that the wallet address will be locked/unlocked. The _useCase parameter is the type for which the wallet address will be locked/unlocked. The _status parameter is a bool value (true/false), if _status = true the wallet address locks itself, if _status = false the wallet address unlocks.
Last updated