IHaiDelegatee

Git Source

Functions

delegatee

Get the address of the delegatee of the contract

function delegatee() external view returns (address _delegatee);

Returns

NameTypeDescription
_delegateeaddressThe address of the delegatee

setDelegatee

Set the delegatee of the contract

function setDelegatee(address _delegatee) external;

Parameters

NameTypeDescription
_delegateeaddressThe 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) external returns (uint256 _weight);

Parameters

NameTypeDescription
_governorIGovernorThe governor contract to vote on
_proposalIduint256The id of the proposal
_supportuint8The vote type

Returns

NameTypeDescription
_weightuint256The 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
) external returns (uint256 _weight);

Parameters

NameTypeDescription
_governorIGovernorThe governor contract to vote on
_proposalIduint256The id of the proposal
_supportuint8The vote type
_reasonstringThe reason for the vote

Returns

NameTypeDescription
_weightuint256The 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
) external returns (uint256 _weight);

Parameters

NameTypeDescription
_governorIGovernorThe governor contract to vote on
_proposalIduint256The id of the proposal
_supportuint8The vote type
_reasonstringThe reason for the vote
_paramsbytesThe params for the vote

Events

DelegateeSet

Emitted when the delegatee of the contract is set

event DelegateeSet(address _delegatee);

Parameters

NameTypeDescription
_delegateeaddressThe address of the new delegatee

Errors

OnlyDelegatee

Throws if called by any account other than the delegatee

error OnlyDelegatee();