This repository has been archived by the owner on Nov 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
502b9b1
commit fd3eded
Showing
20 changed files
with
683 additions
and
706 deletions.
There are no files selected for viewing
Submodule openzeppelin-contracts
added at
932fdd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,19 +5,19 @@ pragma solidity ^0.8.23; | |
/// @author Llama ([email protected]) | ||
/// @notice This is the interface for Llama accounts which can be used to hold assets for a Llama instance. | ||
interface ILlamaAccount { | ||
// -------- For Inspection -------- | ||
// -------- For Inspection -------- | ||
|
||
/// @notice Returns the address of the Llama instance's executor. | ||
function llamaExecutor() external view returns (address); | ||
/// @notice Returns the address of the Llama instance's executor. | ||
function llamaExecutor() external view returns (address); | ||
|
||
// -------- At Account Creation -------- | ||
// -------- At Account Creation -------- | ||
|
||
/// @notice Initializes a new clone of the account. | ||
/// @dev This function is called by the `_deployAccounts` function in the `LlamaCore` contract. The `initializer` | ||
/// modifier ensures that this function can be invoked at most once. | ||
/// @param config The account configuration, encoded as bytes to support differing constructor arguments in | ||
/// different account logic contracts. | ||
/// @return This return statement must be hardcoded to `true` to ensure that initializing an EOA | ||
/// (like the zero address) will revert. | ||
function initialize(bytes memory config) external returns (bool); | ||
/// @notice Initializes a new clone of the account. | ||
/// @dev This function is called by the `_deployAccounts` function in the `LlamaCore` contract. The `initializer` | ||
/// modifier ensures that this function can be invoked at most once. | ||
/// @param config The account configuration, encoded as bytes to support differing constructor arguments in | ||
/// different account logic contracts. | ||
/// @return This return statement must be hardcoded to `true` to ensure that initializing an EOA | ||
/// (like the zero address) will revert. | ||
function initialize(bytes memory config) external returns (bool); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,87 +7,85 @@ pragma solidity ^0.8.23; | |
import {ILlamaPolicy} from "src/interfaces/ILlamaPolicy.sol"; | ||
import {ILlamaStrategy} from "src/interfaces/ILlamaStrategy.sol"; | ||
import { | ||
Action, | ||
ActionInfo, | ||
LlamaInstanceConfig, | ||
LlamaPolicyConfig, | ||
PermissionData, | ||
RoleHolderData, | ||
RolePermissionData | ||
Action, | ||
ActionInfo, | ||
LlamaInstanceConfig, | ||
LlamaPolicyConfig, | ||
PermissionData, | ||
RoleHolderData, | ||
RolePermissionData | ||
} from "src/lib/Structs.sol"; | ||
|
||
/// @title LlamaCore Interface | ||
/// @author Llama ([email protected]) | ||
/// @notice This is the interface for LlamaCore. | ||
interface ILlamaCore { | ||
function actionGuard(address target, bytes4 selector) external view returns (address guard); | ||
function actionsCount() external view returns (uint256); | ||
function approvals(uint256 actionId, address policyholder) external view returns (bool hasApproved); | ||
function authorizedAccountLogics(address accountLogic) external view returns (bool isAuthorized); | ||
function authorizedScripts(address script) external view returns (bool isAuthorized); | ||
function authorizedStrategyLogics(ILlamaStrategy strategyLogic) external view returns (bool isAuthorized); | ||
function cancelAction(ActionInfo memory actionInfo) external; | ||
function cancelActionBySig(address policyholder, ActionInfo memory actionInfo, uint8 v, bytes32 r, bytes32 s) | ||
external; | ||
function castApproval(uint8 role, ActionInfo memory actionInfo, string memory reason) external returns (uint96); | ||
function castApprovalBySig( | ||
address policyholder, | ||
uint8 role, | ||
ActionInfo memory actionInfo, | ||
string memory reason, | ||
uint8 v, | ||
bytes32 r, | ||
bytes32 s | ||
) external returns (uint96); | ||
function castDisapproval(uint8 role, ActionInfo memory actionInfo, string memory reason) | ||
external | ||
returns (uint96); | ||
function castDisapprovalBySig( | ||
address policyholder, | ||
uint8 role, | ||
ActionInfo memory actionInfo, | ||
string memory reason, | ||
uint8 v, | ||
bytes32 r, | ||
bytes32 s | ||
) external returns (uint96); | ||
function createAccounts(address llamaAccountLogic, bytes[] memory accountConfigs) external; | ||
function createAction( | ||
uint8 role, | ||
ILlamaStrategy strategy, | ||
address target, | ||
uint256 value, | ||
bytes memory data, | ||
string memory description | ||
) external returns (uint256 actionId); | ||
function createActionBySig( | ||
address policyholder, | ||
uint8 role, | ||
ILlamaStrategy strategy, | ||
address target, | ||
uint256 value, | ||
bytes memory data, | ||
string memory description, | ||
uint8 v, | ||
bytes32 r, | ||
bytes32 s | ||
) external returns (uint256 actionId); | ||
function createStrategies(address llamaStrategyLogic, bytes[] memory strategyConfigs) external; | ||
function disapprovals(uint256 actionId, address policyholder) external view returns (bool hasDisapproved); | ||
function executeAction(ActionInfo memory actionInfo) external payable; | ||
function executor() external view returns (address); | ||
function getAction(uint256 actionId) external view returns (Action memory); | ||
function getActionState(ActionInfo memory actionInfo) external view returns (uint8); | ||
function incrementNonce(bytes4 selector) external; | ||
function initialize(LlamaInstanceConfig memory config, address policyLogic, address policyMetadataLogic) external; | ||
function name() external view returns (string memory); | ||
function nonces(address policyholder, bytes4 selector) external view returns (uint256 currentNonce); | ||
function policy() external view returns (ILlamaPolicy); | ||
function queueAction(ActionInfo memory actionInfo) external; | ||
function setAccountLogicAuthorization(address accountLogic, bool authorized) external; | ||
function setGuard(address target, bytes4 selector, address guard) external; | ||
function setScriptAuthorization(address script, bool authorized) external; | ||
function setStrategyAuthorization(ILlamaStrategy strategy, bool authorized) external; | ||
function setStrategyLogicAuthorization(ILlamaStrategy strategyLogic, bool authorized) external; | ||
function strategies(ILlamaStrategy strategy) external view returns (bool deployed, bool authorized); | ||
function actionGuard(address target, bytes4 selector) external view returns (address guard); | ||
function actionsCount() external view returns (uint256); | ||
function approvals(uint256 actionId, address policyholder) external view returns (bool hasApproved); | ||
function authorizedAccountLogics(address accountLogic) external view returns (bool isAuthorized); | ||
function authorizedScripts(address script) external view returns (bool isAuthorized); | ||
function authorizedStrategyLogics(ILlamaStrategy strategyLogic) external view returns (bool isAuthorized); | ||
function cancelAction(ActionInfo memory actionInfo) external; | ||
function cancelActionBySig(address policyholder, ActionInfo memory actionInfo, uint8 v, bytes32 r, bytes32 s) | ||
external; | ||
function castApproval(uint8 role, ActionInfo memory actionInfo, string memory reason) external returns (uint96); | ||
function castApprovalBySig( | ||
address policyholder, | ||
uint8 role, | ||
ActionInfo memory actionInfo, | ||
string memory reason, | ||
uint8 v, | ||
bytes32 r, | ||
bytes32 s | ||
) external returns (uint96); | ||
function castDisapproval(uint8 role, ActionInfo memory actionInfo, string memory reason) external returns (uint96); | ||
function castDisapprovalBySig( | ||
address policyholder, | ||
uint8 role, | ||
ActionInfo memory actionInfo, | ||
string memory reason, | ||
uint8 v, | ||
bytes32 r, | ||
bytes32 s | ||
) external returns (uint96); | ||
function createAccounts(address llamaAccountLogic, bytes[] memory accountConfigs) external; | ||
function createAction( | ||
uint8 role, | ||
ILlamaStrategy strategy, | ||
address target, | ||
uint256 value, | ||
bytes memory data, | ||
string memory description | ||
) external returns (uint256 actionId); | ||
function createActionBySig( | ||
address policyholder, | ||
uint8 role, | ||
ILlamaStrategy strategy, | ||
address target, | ||
uint256 value, | ||
bytes memory data, | ||
string memory description, | ||
uint8 v, | ||
bytes32 r, | ||
bytes32 s | ||
) external returns (uint256 actionId); | ||
function createStrategies(address llamaStrategyLogic, bytes[] memory strategyConfigs) external; | ||
function disapprovals(uint256 actionId, address policyholder) external view returns (bool hasDisapproved); | ||
function executeAction(ActionInfo memory actionInfo) external payable; | ||
function executor() external view returns (address); | ||
function getAction(uint256 actionId) external view returns (Action memory); | ||
function getActionState(ActionInfo memory actionInfo) external view returns (uint8); | ||
function incrementNonce(bytes4 selector) external; | ||
function initialize(LlamaInstanceConfig memory config, address policyLogic, address policyMetadataLogic) external; | ||
function name() external view returns (string memory); | ||
function nonces(address policyholder, bytes4 selector) external view returns (uint256 currentNonce); | ||
function policy() external view returns (ILlamaPolicy); | ||
function queueAction(ActionInfo memory actionInfo) external; | ||
function setAccountLogicAuthorization(address accountLogic, bool authorized) external; | ||
function setGuard(address target, bytes4 selector, address guard) external; | ||
function setScriptAuthorization(address script, bool authorized) external; | ||
function setStrategyAuthorization(ILlamaStrategy strategy, bool authorized) external; | ||
function setStrategyLogicAuthorization(ILlamaStrategy strategyLogic, bool authorized) external; | ||
function strategies(ILlamaStrategy strategy) external view returns (bool deployed, bool authorized); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,9 @@ pragma solidity ^0.8.23; | |
/// @author Llama ([email protected]) | ||
/// @notice This is the interface for LlamaExecutor. | ||
interface ILlamaExecutor { | ||
function LLAMA_CORE() external view returns (address); | ||
function execute(address target, bool isScript, bytes calldata data) | ||
external | ||
payable | ||
returns (bool success, bytes memory result); | ||
function LLAMA_CORE() external view returns (address); | ||
function execute(address target, bool isScript, bytes calldata data) | ||
external | ||
payable | ||
returns (bool success, bytes memory result); | ||
} |
Oops, something went wrong.