WalletGovernanceFacet
Inherits: MultiOwnable
Manages governance contract integration and approval workflows
Governance integration facet for diamond wallets
Functions
setGovernanceContract
Set the governance contract for this wallet
function setGovernanceContract(address governanceContract) external onlyOwner;
Parameters
governanceContract
address
Address of the governance contract (0x0 to disable)
getGovernanceContract
Get the governance contract for this wallet
function getGovernanceContract() external view returns (address governanceContract);
Returns
governanceContract
address
Address of the governance contract
requiresGovernanceApproval
Check if an operation requires governance approval
function requiresGovernanceApproval(string calldata operation) external view returns (bool requiresApproval);
Parameters
operation
string
The operation identifier
Returns
requiresApproval
bool
True if governance approval is required
executeWithGovernance
Execute a transaction with governance checks
function executeWithGovernance(address target, uint256 value, bytes calldata data, string calldata operation)
external
onlyOwner;
Parameters
target
address
The target address
value
uint256
The ether value
data
bytes
The call data
operation
string
The operation description for governance
hasGovernanceApproval
Check if governance has approved a specific transaction
function hasGovernanceApproval(address target, uint256 value, bytes calldata data, string calldata operation)
external
view
returns (bool hasApproval);
Parameters
target
address
The target address
value
uint256
The ether value
data
bytes
The call data
operation
string
The operation description
Returns
hasApproval
bool
True if governance has approved this transaction
approveGovernanceTransaction
Mark a transaction as approved by governance (called by governance contract)
function approveGovernanceTransaction(address target, uint256 value, bytes calldata data, string calldata operation)
external;
Parameters
target
address
The target address
value
uint256
The ether value
data
bytes
The call data
operation
string
The operation description
revokeGovernanceApproval
Revoke governance approval for a transaction
function revokeGovernanceApproval(address target, uint256 value, bytes calldata data, string calldata operation)
external;
Parameters
target
address
The target address
value
uint256
The ether value
data
bytes
The call data
operation
string
The operation description
_isGovernanceRequiredOperation
Check if an operation requires governance approval
function _isGovernanceRequiredOperation(string calldata operation) internal pure returns (bool required);
Parameters
operation
string
The operation identifier
Returns
required
bool
True if governance approval is required
_hasGovernanceApproval
Check if governance has approved a specific transaction
function _hasGovernanceApproval(address target, uint256 value, bytes calldata data, string calldata operation)
internal
view
returns (bool hasApproval);
Parameters
target
address
The target address
value
uint256
The ether value
data
bytes
The call data
operation
string
The operation description
Returns
hasApproval
bool
True if governance has approved this transaction
Events
GovernanceContractUpdated
event GovernanceContractUpdated(address indexed oldGovernanceContract, address indexed newGovernanceContract);
GovernanceApprovalRequired
event GovernanceApprovalRequired(address indexed governance, string operation, bytes callData);
GovernanceTransactionExecuted
event GovernanceTransactionExecuted(
address indexed governance, address indexed target, uint256 value, string operation
);
Errors
GovernanceApprovalMissing
error GovernanceApprovalMissing(address governance, string operation, bytes callData);
InvalidGovernanceContract
error InvalidGovernanceContract();
GovernanceNotSet
error GovernanceNotSet();
UnauthorizedGovernanceAccess
error UnauthorizedGovernanceAccess();
Last updated
Was this helpful?