mirror of
https://github.com/luxdao/zodiac.git
synced 2026-10-30 20:34:38 +00:00
Zodiac code that had been sitting in luxdao/contracts under an AGPL header. It is Gnosis Guild's, LGPL-3.0, and belongs in our Zodiac fork. Source in luxdao/contracts: 11f600c2 "LuxDAO governance contracts" — contracts/base/GuardableModule.sol, contracts/interfaces/dao/IAvatar.sol and contracts/interfaces/dao/IGuard.sol. The layout follows zodiac-core (contracts/core, contracts/interfaces). Our GuardableModule deliberately differs from zodiac-core 4.x: setAvatar, setTarget and setGuard are gated on onlyAvatar rather than onlyOwner, setGuard does not run upstream's ERC-165 check, guards are called through IGuard.checkTransaction rather than IModuleGuard.checkModuleTransaction, and execAndReturnData is absent. That version is what is deployed behind the live ModuleGovernorV1 and ModuleFractalV1 masters on Zoo 200200 and Pars 494949, so the divergence is kept as-is here rather than reconciled. The code is the DAO repo's byte for byte; only headers, imports and natspec changed. Safe's Enum comes from luxfi/safe (contracts/interfaces/Enum.sol) through the @luxfi/safe/ remapping, resolved to a checkout beside this repo the same way luxdao/contracts reaches luxfi/standard. foundry.toml builds the three files. Co-authored-by: Hanzo Dev <[email protected]>
82 lines
3.1 KiB
Solidity
82 lines
3.1 KiB
Solidity
// SPDX-License-Identifier: LGPL-3.0-only
|
|
// Copyright (c) Gnosis Guild (Zodiac); modifications (c) 2026 Lux Industries Inc.
|
|
pragma solidity ^0.8.30;
|
|
|
|
import {Enum} from "@luxfi/safe/interfaces/Enum.sol";
|
|
|
|
/**
|
|
* @title IAvatar
|
|
* @author Gnosis Guild (Zodiac)
|
|
* @notice Interface for avatar contracts that can execute module transactions
|
|
* @dev An avatar is typically a Safe or similar smart account that executes
|
|
* transactions on behalf of the modules it has enabled.
|
|
*/
|
|
interface IAvatar {
|
|
/**
|
|
* @notice Enables a module for the avatar
|
|
* @param module Address of the module to enable
|
|
* @dev Only authorized callers should be able to enable modules
|
|
*/
|
|
function enableModule(address module) external;
|
|
|
|
/**
|
|
* @notice Disables a module for the avatar
|
|
* @param prevModule Previous module in the modules linked list
|
|
* @param module Module to be removed
|
|
* @dev Only authorized callers should be able to disable modules
|
|
*/
|
|
function disableModule(address prevModule, address module) external;
|
|
|
|
/**
|
|
* @notice Executes a transaction from a module
|
|
* @param to Destination address of module transaction
|
|
* @param value Ether value of module transaction
|
|
* @param data Data payload of module transaction
|
|
* @param operation Operation type of module transaction (Call or DelegateCall)
|
|
* @return success True if transaction was successful
|
|
* @dev Only enabled modules should be able to execute transactions
|
|
*/
|
|
function execTransactionFromModule(
|
|
address to,
|
|
uint256 value,
|
|
bytes calldata data,
|
|
Enum.Operation operation
|
|
) external returns (bool success);
|
|
|
|
/**
|
|
* @notice Executes a transaction from a module and returns data
|
|
* @param to Destination address of module transaction
|
|
* @param value Ether value of module transaction
|
|
* @param data Data payload of module transaction
|
|
* @param operation Operation type of module transaction (Call or DelegateCall)
|
|
* @return success True if transaction was successful
|
|
* @return returnData Data returned by the call
|
|
* @dev Only enabled modules should be able to execute transactions
|
|
*/
|
|
function execTransactionFromModuleReturnData(
|
|
address to,
|
|
uint256 value,
|
|
bytes calldata data,
|
|
Enum.Operation operation
|
|
) external returns (bool success, bytes memory returnData);
|
|
|
|
/**
|
|
* @notice Returns if a module is enabled
|
|
* @param module Address to check
|
|
* @return True if the module is enabled
|
|
*/
|
|
function isModuleEnabled(address module) external view returns (bool);
|
|
|
|
/**
|
|
* @notice Returns array of modules
|
|
* @param start Start of the page (address(0x1) for first page)
|
|
* @param pageSize Maximum number of modules that should be returned
|
|
* @return array Array of modules
|
|
* @return next Start of the next page
|
|
* @dev Pagination is implemented using linked list traversal
|
|
*/
|
|
function getModulesPaginated(
|
|
address start,
|
|
uint256 pageSize
|
|
) external view returns (address[] memory array, address next);
|
|
} |