diff --git a/script/DeployLlamaTokenVotingFactory.s.sol b/script/DeployLlamaTokenVotingFactory.s.sol index bd28a24..c3e8fbf 100644 --- a/script/DeployLlamaTokenVotingFactory.s.sol +++ b/script/DeployLlamaTokenVotingFactory.s.sol @@ -4,18 +4,18 @@ pragma solidity 0.8.23; import {Script} from "forge-std/Script.sol"; import {DeployUtils} from "script/DeployUtils.sol"; -import {ERC20TokenholderActionCreator} from "src/token-voting/ERC20TokenholderActionCreator.sol"; -import {ERC20TokenholderCaster} from "src/token-voting/ERC20TokenholderCaster.sol"; -import {ERC721TokenholderActionCreator} from "src/token-voting/ERC721TokenholderActionCreator.sol"; -import {ERC721TokenholderCaster} from "src/token-voting/ERC721TokenholderCaster.sol"; +import {LlamaERC20TokenHolderActionCreator} from "src/token-voting/LlamaERC20TokenHolderActionCreator.sol"; +import {LlamaERC20TokenHolderCaster} from "src/token-voting/LlamaERC20TokenHolderCaster.sol"; +import {LlamaERC721TokenHolderActionCreator} from "src/token-voting/LlamaERC721TokenHolderActionCreator.sol"; +import {LlamaERC721TokenHolderCaster} from "src/token-voting/LlamaERC721TokenHolderCaster.sol"; import {LlamaTokenVotingFactory} from "src/token-voting/LlamaTokenVotingFactory.sol"; contract DeployLlamaTokenVotingFactory is Script { // Logic contracts. - ERC20TokenholderActionCreator erc20TokenholderActionCreatorLogic; - ERC20TokenholderCaster erc20TokenholderCasterLogic; - ERC721TokenholderActionCreator erc721TokenholderActionCreatorLogic; - ERC721TokenholderCaster erc721TokenholderCasterLogic; + LlamaERC20TokenHolderActionCreator erc20LlamaTokenHolderActionCreatorLogic; + LlamaERC20TokenHolderCaster erc20LlamaTokenHolderCasterLogic; + LlamaERC721TokenHolderActionCreator erc721LlamaTokenHolderActionCreatorLogic; + LlamaERC721TokenHolderCaster erc721LlamaTokenHolderCasterLogic; // Factory contracts. LlamaTokenVotingFactory tokenVotingFactory; @@ -26,37 +26,39 @@ contract DeployLlamaTokenVotingFactory is Script { ); vm.broadcast(); - erc20TokenholderActionCreatorLogic = new ERC20TokenholderActionCreator(); + erc20LlamaTokenHolderActionCreatorLogic = new LlamaERC20TokenHolderActionCreator(); DeployUtils.print( - string.concat(" ERC20TokenholderActionCreatorLogic: ", vm.toString(address(erc20TokenholderActionCreatorLogic))) + string.concat( + " LlamaERC20TokenHolderActionCreatorLogic: ", vm.toString(address(erc20LlamaTokenHolderActionCreatorLogic)) + ) ); vm.broadcast(); - erc20TokenholderCasterLogic = new ERC20TokenholderCaster(); + erc20LlamaTokenHolderCasterLogic = new LlamaERC20TokenHolderCaster(); DeployUtils.print( - string.concat(" ERC20TokenholderCasterLogic: ", vm.toString(address(erc20TokenholderCasterLogic))) + string.concat(" LlamaERC20TokenHolderCasterLogic: ", vm.toString(address(erc20LlamaTokenHolderCasterLogic))) ); vm.broadcast(); - erc721TokenholderActionCreatorLogic = new ERC721TokenholderActionCreator(); + erc721LlamaTokenHolderActionCreatorLogic = new LlamaERC721TokenHolderActionCreator(); DeployUtils.print( string.concat( - " ERC721TokenholderActionCreatorLogic: ", vm.toString(address(erc721TokenholderActionCreatorLogic)) + " LlamaERC721TokenHolderActionCreatorLogic: ", vm.toString(address(erc721LlamaTokenHolderActionCreatorLogic)) ) ); vm.broadcast(); - erc721TokenholderCasterLogic = new ERC721TokenholderCaster(); + erc721LlamaTokenHolderCasterLogic = new LlamaERC721TokenHolderCaster(); DeployUtils.print( - string.concat(" ERC721TokenholderCasterLogic: ", vm.toString(address(erc721TokenholderCasterLogic))) + string.concat(" LlamaERC721TokenHolderCasterLogic: ", vm.toString(address(erc721LlamaTokenHolderCasterLogic))) ); vm.broadcast(); tokenVotingFactory = new LlamaTokenVotingFactory( - erc20TokenholderActionCreatorLogic, - erc20TokenholderCasterLogic, - erc721TokenholderActionCreatorLogic, - erc721TokenholderCasterLogic + erc20LlamaTokenHolderActionCreatorLogic, + erc20LlamaTokenHolderCasterLogic, + erc721LlamaTokenHolderActionCreatorLogic, + erc721LlamaTokenHolderCasterLogic ); DeployUtils.print(string.concat(" LlamaTokenVotingFactory: ", vm.toString(address(tokenVotingFactory)))); } diff --git a/src/token-voting/ERC20TokenholderActionCreator.sol b/src/token-voting/LlamaERC20TokenHolderActionCreator.sol similarity index 84% rename from src/token-voting/ERC20TokenholderActionCreator.sol rename to src/token-voting/LlamaERC20TokenHolderActionCreator.sol index 1ff0962..7c7c9ff 100644 --- a/src/token-voting/ERC20TokenholderActionCreator.sol +++ b/src/token-voting/LlamaERC20TokenHolderActionCreator.sol @@ -2,14 +2,14 @@ pragma solidity ^0.8.23; import {ILlamaCore} from "src/interfaces/ILlamaCore.sol"; -import {TokenholderActionCreator} from "src/token-voting/TokenholderActionCreator.sol"; +import {LlamaTokenHolderActionCreator} from "src/token-voting/LlamaTokenHolderActionCreator.sol"; import {ERC20Votes} from "@openzeppelin/token/ERC20/extensions/ERC20Votes.sol"; -/// @title ERC20TokenholderActionCreator +/// @title LlamaERC20TokenHolderActionCreator /// @author Llama (devsdosomething@llama.xyz) /// @notice This contract lets holders of a specified `ERC20Votes` token create actions on a llama instance if their /// token balance is greater than or equal to the creation threshold. -contract ERC20TokenholderActionCreator is TokenholderActionCreator { +contract LlamaERC20TokenHolderActionCreator is LlamaTokenHolderActionCreator { ERC20Votes public token; /// @dev This contract is deployed as a minimal proxy from the factory's `deployTokenVotingModule` function. The @@ -18,7 +18,7 @@ contract ERC20TokenholderActionCreator is TokenholderActionCreator { _disableInitializers(); } - /// @notice Initializes a new `ERC20TokenholderActionCreator` clone. + /// @notice Initializes a new `LlamaERC20TokenHolderActionCreator` clone. /// @dev This function is called by the `deployTokenVotingModule` function in the `LlamaTokenVotingFactory` contract. /// The `initializer` modifier ensures that this function can be invoked at most once. /// @param _token The ERC20 token to be used for voting. @@ -27,7 +27,7 @@ contract ERC20TokenholderActionCreator is TokenholderActionCreator { /// be in the same decimals as the token. For example, if the token has 18 decimals and you want a /// creation threshold of 1000 tokens, pass in 1000e18. function initialize(ERC20Votes _token, ILlamaCore _llamaCore, uint256 _creationThreshold) external initializer { - __initializeTokenholderActionCreatorMinimalProxy(_llamaCore, _creationThreshold); + __initializeLlamaTokenHolderActionCreatorMinimalProxy(_llamaCore, _creationThreshold); token = _token; uint256 totalSupply = token.totalSupply(); if (totalSupply == 0) revert InvalidTokenAddress(); diff --git a/src/token-voting/ERC20TokenholderCaster.sol b/src/token-voting/LlamaERC20TokenHolderCaster.sol similarity index 85% rename from src/token-voting/ERC20TokenholderCaster.sol rename to src/token-voting/LlamaERC20TokenHolderCaster.sol index 1ae50af..9e4ea38 100644 --- a/src/token-voting/ERC20TokenholderCaster.sol +++ b/src/token-voting/LlamaERC20TokenHolderCaster.sol @@ -2,14 +2,14 @@ pragma solidity ^0.8.23; import {ILlamaCore} from "src/interfaces/ILlamaCore.sol"; -import {TokenholderCaster} from "src/token-voting/TokenholderCaster.sol"; +import {LlamaTokenHolderCaster} from "src/token-voting/LlamaTokenHolderCaster.sol"; import {ERC20Votes} from "@openzeppelin/token/ERC20/extensions/ERC20Votes.sol"; -/// @title ERC20TokenholderCaster +/// @title LlamaERC20TokenHolderCaster /// @author Llama (devsdosomething@llama.xyz) /// @notice This contract lets holders of a given governance ERC20Votes token cast approvals and disapprovals /// on created actions. -contract ERC20TokenholderCaster is TokenholderCaster { +contract LlamaERC20TokenHolderCaster is LlamaTokenHolderCaster { ERC20Votes public token; /// @dev This contract is deployed as a minimal proxy from the factory's `deployTokenVotingModule` function. The @@ -18,7 +18,7 @@ contract ERC20TokenholderCaster is TokenholderCaster { _disableInitializers(); } - /// @notice Initializes a new `ERC20TokenholderCaster` clone. + /// @notice Initializes a new `LlamaERC20TokenHolderCaster` clone. /// @dev This function is called by the `deployTokenVotingModule` function in the `LlamaTokenVotingFactory` contract. /// The `initializer` modifier ensures that this function can be invoked at most once. /// @param _token The ERC20 token to be used for voting. @@ -33,7 +33,7 @@ contract ERC20TokenholderCaster is TokenholderCaster { uint256 _minApprovalPct, uint256 _minDisapprovalPct ) external initializer { - __initializeTokenholderCasterMinimalProxy(_llamaCore, _role, _minApprovalPct, _minDisapprovalPct); + __initializeLlamaTokenHolderCasterMinimalProxy(_llamaCore, _role, _minApprovalPct, _minDisapprovalPct); token = _token; uint256 totalSupply = token.totalSupply(); if (totalSupply == 0) revert InvalidTokenAddress(); diff --git a/src/token-voting/ERC721TokenholderActionCreator.sol b/src/token-voting/LlamaERC721TokenHolderActionCreator.sol similarity index 85% rename from src/token-voting/ERC721TokenholderActionCreator.sol rename to src/token-voting/LlamaERC721TokenHolderActionCreator.sol index 1687d24..89907b7 100644 --- a/src/token-voting/ERC721TokenholderActionCreator.sol +++ b/src/token-voting/LlamaERC721TokenHolderActionCreator.sol @@ -2,15 +2,15 @@ pragma solidity ^0.8.23; import {ILlamaCore} from "src/interfaces/ILlamaCore.sol"; -import {TokenholderActionCreator} from "src/token-voting/TokenholderActionCreator.sol"; +import {LlamaTokenHolderActionCreator} from "src/token-voting/LlamaTokenHolderActionCreator.sol"; import {ERC721Votes} from "@openzeppelin/token/ERC721/extensions/ERC721Votes.sol"; import {IERC721} from "@openzeppelin/token/ERC721/IERC721.sol"; -/// @title ERC721TokenholderActionCreator +/// @title LlamaERC721TokenHolderActionCreator /// @author Llama (devsdosomething@llama.xyz) /// @notice This contract lets holders of a given governance ERC721Votes token create actions on the llama instance if /// they hold enough tokens. -contract ERC721TokenholderActionCreator is TokenholderActionCreator { +contract LlamaERC721TokenHolderActionCreator is LlamaTokenHolderActionCreator { ERC721Votes public token; /// @dev This contract is deployed as a minimal proxy from the factory's `deployTokenVotingModule` function. The @@ -19,7 +19,7 @@ contract ERC721TokenholderActionCreator is TokenholderActionCreator { _disableInitializers(); } - /// @notice Initializes a new `ERC721TokenholderActionCreator` clone. + /// @notice Initializes a new `LlamaERC721TokenHolderActionCreator` clone. /// @dev This function is called by the `deployTokenVotingModule` function in the `LlamaTokenVotingFactory` contract. /// The `initializer` modifier ensures that this function can be invoked at most once. /// @param _token The ERC721 token to be used for voting. @@ -28,7 +28,7 @@ contract ERC721TokenholderActionCreator is TokenholderActionCreator { /// be in the same decimals as the token. For example, if the token has 18 decimals and you want a /// creation threshold of 1000 tokens, pass in 1000e18. function initialize(ERC721Votes _token, ILlamaCore _llamaCore, uint256 _creationThreshold) external initializer { - __initializeTokenholderActionCreatorMinimalProxy(_llamaCore, _creationThreshold); + __initializeLlamaTokenHolderActionCreatorMinimalProxy(_llamaCore, _creationThreshold); token = _token; if (!token.supportsInterface(type(IERC721).interfaceId)) revert InvalidTokenAddress(); uint256 totalSupply = token.getPastTotalSupply(block.timestamp - 1); diff --git a/src/token-voting/ERC721TokenholderCaster.sol b/src/token-voting/LlamaERC721TokenHolderCaster.sol similarity index 85% rename from src/token-voting/ERC721TokenholderCaster.sol rename to src/token-voting/LlamaERC721TokenHolderCaster.sol index fa9f2c3..21adc9f 100644 --- a/src/token-voting/ERC721TokenholderCaster.sol +++ b/src/token-voting/LlamaERC721TokenHolderCaster.sol @@ -2,15 +2,15 @@ pragma solidity ^0.8.23; import {ILlamaCore} from "src/interfaces/ILlamaCore.sol"; -import {TokenholderCaster} from "src/token-voting/TokenholderCaster.sol"; +import {LlamaTokenHolderCaster} from "src/token-voting/LlamaTokenHolderCaster.sol"; import {ERC721Votes} from "@openzeppelin/token/ERC721/extensions/ERC721Votes.sol"; import {IERC721} from "@openzeppelin/token/ERC721/IERC721.sol"; -/// @title ERC721TokenholderCaster +/// @title LlamaERC721TokenHolderCaster /// @author Llama (devsdosomething@llama.xyz) /// @notice This contract lets holders of a given governance ERC721Votes token cast approvals and disapprovals /// on created actions. -contract ERC721TokenholderCaster is TokenholderCaster { +contract LlamaERC721TokenHolderCaster is LlamaTokenHolderCaster { ERC721Votes public token; /// @dev This contract is deployed as a minimal proxy from the factory's `deployTokenVotingModule` function. The @@ -19,7 +19,7 @@ contract ERC721TokenholderCaster is TokenholderCaster { _disableInitializers(); } - /// @notice Initializes a new `ERC721TokenholderCaster` clone. + /// @notice Initializes a new `LlamaERC721TokenHolderCaster` clone. /// @dev This function is called by the `deployTokenVotingModule` function in the `LlamaTokenVotingFactory` contract. /// The `initializer` modifier ensures that this function can be invoked at most once. /// @param _token The ERC721 token to be used for voting. @@ -34,7 +34,7 @@ contract ERC721TokenholderCaster is TokenholderCaster { uint256 _minApprovalPct, uint256 _minDisapprovalPct ) external initializer { - __initializeTokenholderCasterMinimalProxy(_llamaCore, _role, _minApprovalPct, _minDisapprovalPct); + __initializeLlamaTokenHolderCasterMinimalProxy(_llamaCore, _role, _minApprovalPct, _minDisapprovalPct); token = _token; if (!token.supportsInterface(type(IERC721).interfaceId)) revert InvalidTokenAddress(); } diff --git a/src/token-voting/TokenholderCaster.sol b/src/token-voting/LlamaTokenHolderCaster.sol similarity index 99% rename from src/token-voting/TokenholderCaster.sol rename to src/token-voting/LlamaTokenHolderCaster.sol index c342609..48b6977 100644 --- a/src/token-voting/TokenholderCaster.sol +++ b/src/token-voting/LlamaTokenHolderCaster.sol @@ -10,7 +10,7 @@ import {LlamaUtils} from "src/lib/LlamaUtils.sol"; import {Action, ActionInfo} from "src/lib/Structs.sol"; import {ILlamaRelativeStrategyBase} from "src/interfaces/ILlamaRelativeStrategyBase.sol"; -/// @title TokenholderCaster +/// @title LlamaTokenHolderCaster /// @author Llama (devsdosomething@llama.xyz) /// @notice This contract lets holders of a given governance token cast approvals and disapprovals /// on created actions. @@ -18,7 +18,7 @@ import {ILlamaRelativeStrategyBase} from "src/interfaces/ILlamaRelativeStrategyB /// it must hold a Policy from the specified `LlamaCore` instance to actually be able to cast on an action. This /// contract does not verify that it holds the correct policy when voting and relies on `LlamaCore` to /// verify that during submission. -abstract contract TokenholderCaster is Initializable { +abstract contract LlamaTokenHolderCaster is Initializable { // ========================= // ======== Structs ======== // ========================= @@ -188,7 +188,7 @@ abstract contract TokenholderCaster is Initializable { /// @param _role The role used by this contract to cast approvals and disapprovals. /// @param _minApprovalPct The minimum % of approvals required to submit approvals to `LlamaCore`. /// @param _minDisapprovalPct The minimum % of disapprovals required to submit disapprovals to `LlamaCore`. - function __initializeTokenholderCasterMinimalProxy( + function __initializeLlamaTokenHolderCasterMinimalProxy( ILlamaCore _llamaCore, uint8 _role, uint256 _minApprovalPct, diff --git a/src/token-voting/LlamaTokenVotingFactory.sol b/src/token-voting/LlamaTokenVotingFactory.sol index 7c30247..f413d92 100644 --- a/src/token-voting/LlamaTokenVotingFactory.sol +++ b/src/token-voting/LlamaTokenVotingFactory.sol @@ -5,11 +5,11 @@ import {Clones} from "@openzeppelin/proxy/Clones.sol"; import {ILlamaCore} from "src/interfaces/ILlamaCore.sol"; import {ILlamaExecutor} from "src/interfaces/ILlamaExecutor.sol"; -import {ERC20TokenholderActionCreator} from "src/token-voting/ERC20TokenholderActionCreator.sol"; -import {ERC20TokenholderCaster} from "src/token-voting/ERC20TokenholderCaster.sol"; +import {LlamaERC20TokenHolderActionCreator} from "src/token-voting/LlamaERC20TokenHolderActionCreator.sol"; +import {LlamaERC20TokenHolderCaster} from "src/token-voting/LlamaERC20TokenHolderCaster.sol"; import {ERC20Votes} from "@openzeppelin/token/ERC20/extensions/ERC20Votes.sol"; -import {ERC721TokenholderActionCreator} from "src/token-voting/ERC721TokenholderActionCreator.sol"; -import {ERC721TokenholderCaster} from "src/token-voting/ERC721TokenholderCaster.sol"; +import {LlamaERC721TokenHolderActionCreator} from "src/token-voting/LlamaERC721TokenHolderActionCreator.sol"; +import {LlamaERC721TokenHolderCaster} from "src/token-voting/LlamaERC721TokenHolderCaster.sol"; import {ERC721Votes} from "@openzeppelin/token/ERC721/extensions/ERC721Votes.sol"; /// @title LlamaTokenVotingFactory @@ -18,38 +18,38 @@ import {ERC721Votes} from "@openzeppelin/token/ERC721/extensions/ERC721Votes.sol contract LlamaTokenVotingFactory { error NoModulesDeployed(); - event ERC20TokenholderActionCreatorCreated(address actionCreator, address indexed token); - event ERC721TokenholderActionCreatorCreated(address actionCreator, address indexed token); - event ERC20TokenholderCasterCreated( + event LlamaERC20TokenHolderActionCreatorCreated(address actionCreator, address indexed token); + event LlamaERC721TokenHolderActionCreatorCreated(address actionCreator, address indexed token); + event LlamaERC20TokenHolderCasterCreated( address caster, address indexed token, uint256 minApprovalPct, uint256 minDisapprovalPct ); - event ERC721TokenholderCasterCreated( + event LlamaERC721TokenHolderCasterCreated( address caster, address indexed token, uint256 minApprovalPct, uint256 minDisapprovalPct ); /// @notice The ERC20 Tokenholder Action Creator (logic) contract. - ERC20TokenholderActionCreator public immutable ERC20_TOKENHOLDER_ACTION_CREATOR_LOGIC; + LlamaERC20TokenHolderActionCreator public immutable ERC20_TOKENHOLDER_ACTION_CREATOR_LOGIC; /// @notice The ERC20 Tokenholder Caster (logic) contract. - ERC20TokenholderCaster public immutable ERC20_TOKENHOLDER_CASTER_LOGIC; + LlamaERC20TokenHolderCaster public immutable ERC20_TOKENHOLDER_CASTER_LOGIC; /// @notice The ERC721 Tokenholder Action Creator (logic) contract. - ERC721TokenholderActionCreator public immutable ERC721_TOKENHOLDER_ACTION_CREATOR_LOGIC; + LlamaERC721TokenHolderActionCreator public immutable ERC721_TOKENHOLDER_ACTION_CREATOR_LOGIC; /// @notice The ERC721 Tokenholder Caster (logic) contract. - ERC721TokenholderCaster public immutable ERC721_TOKENHOLDER_CASTER_LOGIC; + LlamaERC721TokenHolderCaster public immutable ERC721_TOKENHOLDER_CASTER_LOGIC; /// @dev Set the logic contracts used to deploy Token Voting modules. constructor( - ERC20TokenholderActionCreator erc20TokenholderActionCreatorLogic, - ERC20TokenholderCaster erc20TokenholderCasterLogic, - ERC721TokenholderActionCreator erc721TokenholderActionCreatorLogic, - ERC721TokenholderCaster erc721TokenholderCasterLogic + LlamaERC20TokenHolderActionCreator erc20LlamaTokenHolderActionCreatorLogic, + LlamaERC20TokenHolderCaster erc20LlamaTokenHolderCasterLogic, + LlamaERC721TokenHolderActionCreator erc721LlamaTokenHolderActionCreatorLogic, + LlamaERC721TokenHolderCaster erc721LlamaTokenHolderCasterLogic ) { - ERC20_TOKENHOLDER_ACTION_CREATOR_LOGIC = erc20TokenholderActionCreatorLogic; - ERC20_TOKENHOLDER_CASTER_LOGIC = erc20TokenholderCasterLogic; - ERC721_TOKENHOLDER_ACTION_CREATOR_LOGIC = erc721TokenholderActionCreatorLogic; - ERC721_TOKENHOLDER_CASTER_LOGIC = erc721TokenholderCasterLogic; + ERC20_TOKENHOLDER_ACTION_CREATOR_LOGIC = erc20LlamaTokenHolderActionCreatorLogic; + ERC20_TOKENHOLDER_CASTER_LOGIC = erc20LlamaTokenHolderCasterLogic; + ERC721_TOKENHOLDER_ACTION_CREATOR_LOGIC = erc721LlamaTokenHolderActionCreatorLogic; + ERC721_TOKENHOLDER_CASTER_LOGIC = erc721LlamaTokenHolderCasterLogic; } ///@notice Deploys a token voting module in a single function so it can be deployed in a single llama action. @@ -73,11 +73,13 @@ contract LlamaTokenVotingFactory { ) external returns (address actionCreator, address caster) { ILlamaCore core = ILlamaCore(ILlamaExecutor(msg.sender).LLAMA_CORE()); if (isERC20) { - actionCreator = address(_deployERC20TokenholderActionCreator(ERC20Votes(token), core, creationThreshold)); - caster = address(_deployERC20TokenholderCaster(ERC20Votes(token), core, 0, minApprovalPct, minDisapprovalPct)); + actionCreator = address(_deployLlamaERC20TokenHolderActionCreator(ERC20Votes(token), core, creationThreshold)); + caster = + address(_deployLlamaERC20TokenHolderCaster(ERC20Votes(token), core, 0, minApprovalPct, minDisapprovalPct)); } else { - actionCreator = address(_deployERC721TokenholderActionCreator(ERC721Votes(token), core, creationThreshold)); - caster = address(_deployERC721TokenholderCaster(ERC721Votes(token), core, 0, minApprovalPct, minDisapprovalPct)); + actionCreator = address(_deployLlamaERC721TokenHolderActionCreator(ERC721Votes(token), core, creationThreshold)); + caster = + address(_deployLlamaERC721TokenHolderCaster(ERC721Votes(token), core, 0, minApprovalPct, minDisapprovalPct)); } } @@ -85,61 +87,62 @@ contract LlamaTokenVotingFactory { // ======== Internal Functions ======== // ==================================== - function _deployERC20TokenholderActionCreator(ERC20Votes token, ILlamaCore llamaCore, uint256 creationThreshold) + function _deployLlamaERC20TokenHolderActionCreator(ERC20Votes token, ILlamaCore llamaCore, uint256 creationThreshold) internal - returns (ERC20TokenholderActionCreator actionCreator) + returns (LlamaERC20TokenHolderActionCreator actionCreator) { - actionCreator = ERC20TokenholderActionCreator( + actionCreator = LlamaERC20TokenHolderActionCreator( Clones.cloneDeterministic( address(ERC20_TOKENHOLDER_ACTION_CREATOR_LOGIC), keccak256(abi.encodePacked(address(token), msg.sender)) ) ); actionCreator.initialize(token, llamaCore, creationThreshold); - emit ERC20TokenholderActionCreatorCreated(address(actionCreator), address(token)); + emit LlamaERC20TokenHolderActionCreatorCreated(address(actionCreator), address(token)); } - function _deployERC721TokenholderActionCreator(ERC721Votes token, ILlamaCore llamaCore, uint256 creationThreshold) - internal - returns (ERC721TokenholderActionCreator actionCreator) - { - actionCreator = ERC721TokenholderActionCreator( + function _deployLlamaERC721TokenHolderActionCreator( + ERC721Votes token, + ILlamaCore llamaCore, + uint256 creationThreshold + ) internal returns (LlamaERC721TokenHolderActionCreator actionCreator) { + actionCreator = LlamaERC721TokenHolderActionCreator( Clones.cloneDeterministic( address(ERC721_TOKENHOLDER_ACTION_CREATOR_LOGIC), keccak256(abi.encodePacked(address(token), msg.sender)) ) ); actionCreator.initialize(token, llamaCore, creationThreshold); - emit ERC721TokenholderActionCreatorCreated(address(actionCreator), address(token)); + emit LlamaERC721TokenHolderActionCreatorCreated(address(actionCreator), address(token)); } - function _deployERC20TokenholderCaster( + function _deployLlamaERC20TokenHolderCaster( ERC20Votes token, ILlamaCore llamaCore, uint8 role, uint256 minApprovalPct, uint256 minDisapprovalPct - ) internal returns (ERC20TokenholderCaster caster) { - caster = ERC20TokenholderCaster( + ) internal returns (LlamaERC20TokenHolderCaster caster) { + caster = LlamaERC20TokenHolderCaster( Clones.cloneDeterministic( address(ERC20_TOKENHOLDER_CASTER_LOGIC), keccak256(abi.encodePacked(address(token), msg.sender)) ) ); caster.initialize(token, llamaCore, role, minApprovalPct, minDisapprovalPct); - emit ERC20TokenholderCasterCreated(address(caster), address(token), minApprovalPct, minDisapprovalPct); + emit LlamaERC20TokenHolderCasterCreated(address(caster), address(token), minApprovalPct, minDisapprovalPct); } - function _deployERC721TokenholderCaster( + function _deployLlamaERC721TokenHolderCaster( ERC721Votes token, ILlamaCore llamaCore, uint8 role, uint256 minApprovalPct, uint256 minDisapprovalPct - ) internal returns (ERC721TokenholderCaster caster) { - caster = ERC721TokenholderCaster( + ) internal returns (LlamaERC721TokenHolderCaster caster) { + caster = LlamaERC721TokenHolderCaster( Clones.cloneDeterministic( address(ERC721_TOKENHOLDER_CASTER_LOGIC), keccak256(abi.encodePacked(address(token), msg.sender)) ) ); caster.initialize(token, llamaCore, role, minApprovalPct, minDisapprovalPct); - emit ERC721TokenholderCasterCreated(address(caster), address(token), minApprovalPct, minDisapprovalPct); + emit LlamaERC721TokenHolderCasterCreated(address(caster), address(token), minApprovalPct, minDisapprovalPct); } } diff --git a/src/token-voting/TokenholderActionCreator.sol b/src/token-voting/LlamaTokenholderActionCreator.sol similarity index 98% rename from src/token-voting/TokenholderActionCreator.sol rename to src/token-voting/LlamaTokenholderActionCreator.sol index 4d273c2..4a578be 100644 --- a/src/token-voting/TokenholderActionCreator.sol +++ b/src/token-voting/LlamaTokenholderActionCreator.sol @@ -8,7 +8,7 @@ import {ILlamaStrategy} from "src/interfaces/ILlamaStrategy.sol"; import {Action, ActionInfo} from "src/lib/Structs.sol"; import {LlamaUtils} from "src/lib/LlamaUtils.sol"; -/// @title TokenholderActionCreator +/// @title LlamaTokenHolderActionCreator /// @author Llama (devsdosomething@llama.xyz) /// @notice This contract lets holders of a given governance token create actions if they have /// sufficient token balance. @@ -16,7 +16,7 @@ import {LlamaUtils} from "src/lib/LlamaUtils.sol"; /// it must hold a Policy from the specified `LlamaCore` instance to actually be able to create an action. The /// instance's policy encodes what actions this contract is allowed to create, and attempting to create an action that /// is not allowed by the policy will result in a revert. -abstract contract TokenholderActionCreator is Initializable { +abstract contract LlamaTokenHolderActionCreator is Initializable { /// @notice The core contract for this Llama instance. ILlamaCore public llamaCore; @@ -101,7 +101,9 @@ abstract contract TokenholderActionCreator is Initializable { /// @param _creationThreshold The default number of tokens required to create an action. This must /// be in the same decimals as the token. For example, if the token has 18 decimals and you want a /// creation threshold of 1000 tokens, pass in 1000e18. - function __initializeTokenholderActionCreatorMinimalProxy(ILlamaCore _llamaCore, uint256 _creationThreshold) internal { + function __initializeLlamaTokenHolderActionCreatorMinimalProxy(ILlamaCore _llamaCore, uint256 _creationThreshold) + internal + { if (_llamaCore.actionsCount() < 0) revert InvalidLlamaCoreAddress(); llamaCore = _llamaCore;