DelegationOwner

The DelegationOwner contract manages asset and signature delegation within the Unlockd Wallet. It allows the wallet owner to delegate specific assets to trusted parties for a defined duration and provides functionality for signature delegation.

Key Functions:

function initialize(
    address _guard, 
    address _safe, 
    address _owner, 
    address _delegationController, 
    address _protocolOwner
) public

Initializes the DelegationOwner contract with the necessary parameters.

Parameters:

_guard (address): The address of the TransactionGuard contract.

_safe (address): The address of the GnosisSafe contract.

_owner (address): The address of the wallet owner.

_delegationController (address): The address of the delegation controller.

_protocolOwner (address): The address of the protocol owner.


Sets a delegation controller address as allowed or disallowed.

Parameters:

  • _delegationController (address): The address of the delegation controller.

  • _allowed (bool): Indicates whether the delegation controller is allowed or not.


Delegates the usage of an asset to a delegatee for a specified duration.

Parameters:

_asset (address): The address of the asset being delegated.

_id (uint256): The ID of the asset being delegated.

_delegatee (address): The address of the delegatee.

_duration (uint256): The duration of the delegation in seconds.


Ends the delegation of an asset.

Parameters:

_asset (address): The address of the delegated asset.

_id (uint256): The ID of the delegated asset.


Forcefully ends the delegation of an asset by the protocol owner.

Parameters:

_asset (address): The address of the delegated asset.

_id (uint256): The ID of the delegated asset.


Delegates the usage of the signature to a delegatee for a specified duration, locking a group of assets.

Parameters:

_assets (address[]): An array of asset addresses being delegated.

_ids (uint256[]): An array of asset IDs being delegated.

_delegatee (address): The address of the delegatee.

_duration (uint256): The duration of the signature delegation, expressed in seconds.


Ends the delegation of the signature, unlocking a group of assets.


Executes a transaction through the GnosisSafe wallet, validating the delegatee and allowed functions.

Parameters:

_asset (address): The address of the delegated asset.

_id (uint256): The ID of the delegated asset.

_to (address): The destination address of the transaction.

_value (uint256): The amount of ETH to be sent with the transaction.

_data (bytes): The data payload of the transaction.

_safeTxGas (uint256): The gas limit for the transaction.

_baseGas (uint256): The base gas cost.

_gasPrice (uint256): The gas price used for the transaction.

_gasToken (address): The address of the token used for gas payment (0 for ETH).

_refundReceiver (address payable): The address that receives the gas payment refund.

Returns:

A boolean indicating the success of the transaction execution.


Validates if a signature is valid based on the current signature delegation.

Parameters:

_data (bytes): The hash of the signed data.

_signature (bytes): The signature bytes.

Returns:

The EIP1271 magic value if the signature is valid.


Sends an asset to a receiver if it is not delegated or locked.

Parameters:

_asset (address): The address of the asset being claimed.

_id (uint256): The ID of the asset being claimed.

_receiver (address): The address of the receiver.


Returns if an asset is delegated or included in the current signature delegation.

Parameters:

_asset (address): The address of the asset.

_id (uint256): The ID of the asset. Returns:

(bool): Indicates whether the asset is delegated or not.


Returns if the signature is delegated.

Returns:

(bool): Indicates whether the signature is delegated or not.


Checks if a function is allowed to be executed by a delegatee of a given asset.

Parameters:

_asset (address): The address of the delegated asset.

_contract (address): The address of the destination contract.

_selector (bytes4): The selector of the destination function.

Returns:

(bool): Indicates whether the function is allowed or not.


Interactions:

  • Interacts with the TransactionGuard contract to enforce delegation and locking rules.

  • Utilizes the DelegationRecipes contract to determine allowed functions for asset collections.

  • Integrates with the AllowedControllers contract to manage delegation and lock controllers.

  • Executes transactions through the GnosisSafe contract.

Last updated