ProtocolOwner
The ProtocolOwner contract handles protocol-level functions and permissions within the Unlockd Wallet. It allows authorized protocol owners to execute specific actions and interacts with the TransactionGuard and DelegationOwner contracts.
Key Functions:
Initializes the ProtocolOwner 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.
_delegationOwner
(address): The address of the DelegationOwner contract.
Approves the sale of an asset and transfers the necessary approvals and permissions.
Parameters:
_collection
(address): The address of the asset collection.
_tokenId
(uint256): The ID of the asset being sold.
_underlyingAsset
(address): The address of the underlying asset.
_amount
(uint256): The amount to be approved.
_marketApproval
(address): The address of the market approval contract.
_loanId
(bytes32): The ID of the loan associated with the sale.
Executes a transaction through the GnosisSafe wallet with protocol-level permissions.
Parameters:
_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.
Delegates the execution permission to a specified address for a single transaction.
Parameters:
to
(address): The address to delegate the execution permission to.
value
(bool): Indicates whether to grant or revoke the execution permission.
Checks if an address has delegated execution permission.
Parameters:
to
(address): The address to check for delegated execution permission.
Returns:
(bool): Indicates whether the address has delegated execution permission or not.
Checks if an asset is locked.
Parameters:
_id
(bytes32): The ID of the asset.
Returns:
(bool): Indicates whether the asset is locked or not.
Returns the loan ID assigned to a specific asset.
Parameters:
index
(bytes32): The index of the asset.
Returns:
(bytes32): The loan ID assigned to the asset.
Sets the loan ID assigned to a specific asset.
Parameters:
_index
(bytes32): The index of the asset.
_loanId
(bytes32): The loan ID to be assigned.
Safely sets the loan ID assigned to a specific asset and resets approvals.
Parameters:
_asset
(address): The address of the asset.
_id
(uint256): The ID of the asset.
_loanId
(bytes32): The loan ID to be assigned.
Changes the current ownership of an asset.
Parameters:
_asset
(address): The address of the asset.
_id
(uint256): The ID of the asset.
_newOwner
(address): The address of the new owner.
Batch function to set loan IDs to zero for a group of assets.
Parameters:
_assets
(bytes32[]): An array of asset IDs.
Batch function to set loan IDs to a specific value for a group of assets.
Parameters:
_assets
(bytes32[]): An array of asset IDs.
_loanId
(bytes32): The loan ID to be assigned.
Interactions:
Interacts with the TransactionGuard contract to enforce protocol-level rules and permissions.
Interacts with the DelegationOwner contract to perform protocol-specific actions.
Last updated