HaiDelegatee
Inherits: IHaiDelegatee, Ownable
This contract is used to proxy the voting power delegated to it to a delegatee
Compatible with OpenZeppelin's Governor contract
State Variables
delegatee
Get the address of the delegatee of the contract
address public delegatee;
Functions
constructor
constructor(address _owner) Ownable(_owner);
setDelegatee
Set the delegatee of the contract
function setDelegatee(address _delegatee) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
_delegatee | address | The address of the new delegatee |
castVote
Cast a vote using the voting power delegated to this contract
function castVote(
IGovernor _governor,
uint256 _proposalId,
uint8 _support
) public onlyDelegatee returns (uint256 _weight);
Parameters
Name | Type | Description |
---|---|---|
_governor | IGovernor | The governor contract to vote on |
_proposalId | uint256 | The id of the proposal |
_support | uint8 | The vote type |
Returns
Name | Type | Description |
---|---|---|
_weight | uint256 | The weight of the vote |
castVoteWithReason
Cast a vote with reason using the voting power delegated to this contract
function castVoteWithReason(
IGovernor _governor,
uint256 _proposalId,
uint8 _support,
string memory _reason
) public onlyDelegatee returns (uint256 _weight);
Parameters
Name | Type | Description |
---|---|---|
_governor | IGovernor | The governor contract to vote on |
_proposalId | uint256 | The id of the proposal |
_support | uint8 | The vote type |
_reason | string | The reason for the vote |
Returns
Name | Type | Description |
---|---|---|
_weight | uint256 | The weight of the vote |
castVoteWithReasonAndParams
Cast a vote with reason and params using the voting power delegated to this contract
function castVoteWithReasonAndParams(
IGovernor _governor,
uint256 _proposalId,
uint8 _support,
string memory _reason,
bytes memory _params
) public onlyDelegatee returns (uint256 _weight);
Parameters
Name | Type | Description |
---|---|---|
_governor | IGovernor | The governor contract to vote on |
_proposalId | uint256 | The id of the proposal |
_support | uint8 | The vote type |
_reason | string | The reason for the vote |
_params | bytes | The params for the vote |
onlyDelegatee
modifier onlyDelegatee();