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.
Merge branch 'main' into theo/language
- Loading branch information
Showing
17 changed files
with
1,729 additions
and
2,034 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -9,7 +9,7 @@ import {ERC20Votes} from "@openzeppelin/token/ERC20/extensions/ERC20Votes.sol"; | |
/// @author Llama ([email protected]) | ||
/// @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 ERC20TokenholderActionCreator is TokenholderActionCreator { | ||
ERC20Votes public token; | ||
|
||
/// @dev This contract is deployed as a minimal proxy from the factory's `deployTokenVotingModule` function. The | ||
|
@@ -18,16 +18,20 @@ contract ERC20TokenHolderActionCreator is TokenHolderActionCreator { | |
_disableInitializers(); | ||
} | ||
|
||
/// @notice Initializes a new `ERC20TokenHolderActionCreator` clone. | ||
/// @notice Initializes a new `ERC20TokenholderActionCreator` 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. | ||
/// @param _llamaCore The `LlamaCore` contract for this Llama instance. | ||
/// @param _role The role used by this contract to cast approvals and disapprovals. | ||
/// @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 initialize(ERC20Votes _token, ILlamaCore _llamaCore, uint256 _creationThreshold) external initializer { | ||
__initializeTokenHolderActionCreatorMinimalProxy(_llamaCore, _creationThreshold); | ||
function initialize(ERC20Votes _token, ILlamaCore _llamaCore, uint8 _role, uint256 _creationThreshold) | ||
external | ||
initializer | ||
{ | ||
__initializeTokenholderActionCreatorMinimalProxy(_llamaCore, _role, _creationThreshold); | ||
token = _token; | ||
uint256 totalSupply = token.totalSupply(); | ||
if (totalSupply == 0) revert InvalidTokenAddress(); | ||
|
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 |
---|---|---|
|
@@ -9,7 +9,7 @@ import {ERC20Votes} from "@openzeppelin/token/ERC20/extensions/ERC20Votes.sol"; | |
/// @author Llama ([email protected]) | ||
/// @notice This contract lets holders of a given governance ERC20Votes token cast approvals and disapprovals | ||
/// on created actions. | ||
contract ERC20TokenHolderCaster is TokenHolderCaster { | ||
contract ERC20TokenholderCaster is TokenholderCaster { | ||
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 `ERC20TokenholderCaster` 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); | ||
__initializeTokenholderCasterMinimalProxy(_llamaCore, _role, _minApprovalPct, _minDisapprovalPct); | ||
token = _token; | ||
uint256 totalSupply = token.totalSupply(); | ||
if (totalSupply == 0) revert InvalidTokenAddress(); | ||
|
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 |
---|---|---|
|
@@ -10,7 +10,7 @@ import {IERC721} from "@openzeppelin/token/ERC721/IERC721.sol"; | |
/// @author Llama ([email protected]) | ||
/// @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 ERC721TokenholderActionCreator is TokenholderActionCreator { | ||
ERC721Votes public token; | ||
|
||
/// @dev This contract is deployed as a minimal proxy from the factory's `deployTokenVotingModule` function. The | ||
|
@@ -19,16 +19,20 @@ contract ERC721TokenHolderActionCreator is TokenHolderActionCreator { | |
_disableInitializers(); | ||
} | ||
|
||
/// @notice Initializes a new `ERC721TokenHolderActionCreator` clone. | ||
/// @notice Initializes a new `ERC721TokenholderActionCreator` 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. | ||
/// @param _llamaCore The `LlamaCore` contract for this Llama instance. | ||
/// @param _role The role used by this contract to cast approvals and disapprovals. | ||
/// @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 initialize(ERC721Votes _token, ILlamaCore _llamaCore, uint256 _creationThreshold) external initializer { | ||
__initializeTokenHolderActionCreatorMinimalProxy(_llamaCore, _creationThreshold); | ||
function initialize(ERC721Votes _token, ILlamaCore _llamaCore, uint8 _role, uint256 _creationThreshold) | ||
external | ||
initializer | ||
{ | ||
__initializeTokenholderActionCreatorMinimalProxy(_llamaCore, _role, _creationThreshold); | ||
token = _token; | ||
if (!token.supportsInterface(type(IERC721).interfaceId)) revert InvalidTokenAddress(); | ||
uint256 totalSupply = token.getPastTotalSupply(block.timestamp - 1); | ||
|
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 |
---|---|---|
|
@@ -10,7 +10,7 @@ import {IERC721} from "@openzeppelin/token/ERC721/IERC721.sol"; | |
/// @author Llama ([email protected]) | ||
/// @notice This contract lets holders of a given governance ERC721Votes token cast approvals and disapprovals | ||
/// on created actions. | ||
contract ERC721TokenHolderCaster is TokenHolderCaster { | ||
contract ERC721TokenholderCaster is TokenholderCaster { | ||
ERC721Votes public token; | ||
|
||
/// @dev This contract is deployed as a minimal proxy from the factory's `deployTokenVotingModule` function. The | ||
|
@@ -19,22 +19,19 @@ contract ERC721TokenHolderCaster is TokenHolderCaster { | |
_disableInitializers(); | ||
} | ||
|
||
/// @notice Initializes a new `ERC721TokenHolderCaster` clone. | ||
/// @notice Initializes a new `ERC721TokenholderCaster` 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. | ||
/// @param _llamaCore The `LlamaCore` contract for this Llama instance. | ||
/// @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 initialize( | ||
ERC721Votes _token, | ||
ILlamaCore _llamaCore, | ||
uint8 _role, | ||
uint256 _minApprovalPct, | ||
uint256 _minDisapprovalPct | ||
) external initializer { | ||
__initializeTokenHolderCasterMinimalProxy(_llamaCore, _role, _minApprovalPct, _minDisapprovalPct); | ||
/// @param _voteQuorum The minimum % of approvals required to submit approvals to `LlamaCore`. | ||
/// @param _vetoQuorum The minimum % of disapprovals required to submit disapprovals to `LlamaCore`. | ||
function initialize(ERC721Votes _token, ILlamaCore _llamaCore, uint8 _role, uint256 _voteQuorum, uint256 _vetoQuorum) | ||
external | ||
initializer | ||
{ | ||
__initializeTokenholderCasterMinimalProxy(_llamaCore, _role, _voteQuorum, _vetoQuorum); | ||
token = _token; | ||
if (!token.supportsInterface(type(IERC721).interfaceId)) revert InvalidTokenAddress(); | ||
} | ||
|
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
Oops, something went wrong.