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]>
52 lines
2.1 KiB
Solidity
52 lines
2.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 IGuard
|
|
* @author Gnosis Guild (Zodiac)
|
|
* @notice Interface for guard contracts that check transactions
|
|
* @dev Guards can be used to restrict the actions that can be performed by modules.
|
|
* They implement pre- and post-transaction checks to ensure transactions meet
|
|
* certain criteria before and after execution.
|
|
*/
|
|
interface IGuard {
|
|
/**
|
|
* @notice Checks a transaction before execution
|
|
* @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
|
|
* @param safeTxGas Gas that should be used for the safe transaction
|
|
* @param baseGas Gas costs for data used to trigger the safe transaction
|
|
* @param gasPrice Maximum gas price that should be used for this transaction
|
|
* @param gasToken Token address (or 0 if ETH) that is used for the payment
|
|
* @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin)
|
|
* @param signatures Signature data that should be verified
|
|
* @param msgSender Account that initiated the transaction
|
|
* @dev Should revert if the transaction is not allowed
|
|
*/
|
|
function checkTransaction(
|
|
address to,
|
|
uint256 value,
|
|
bytes memory data,
|
|
Enum.Operation operation,
|
|
uint256 safeTxGas,
|
|
uint256 baseGas,
|
|
uint256 gasPrice,
|
|
address gasToken,
|
|
address payable refundReceiver,
|
|
bytes memory signatures,
|
|
address msgSender
|
|
) external;
|
|
|
|
/**
|
|
* @notice Checks after a transaction execution
|
|
* @param txHash Hash of the executed transaction
|
|
* @param success Boolean indicating if the transaction was successful
|
|
* @dev Should revert if the post-execution state is not allowed
|
|
*/
|
|
function checkAfterExecution(bytes32 txHash, bool success) external;
|
|
} |