Strategies
Interface

description: What functions are available from the IVotingStrategy interface?

Interface and Spec

This documentation covers methods and events in the IVotingStrategy interface. See Writing a Custom Voting Strategy for more information on implementing a voting strategy.

The Allo IVotingStrategy interface can be found here: https://github.com/allo-protocol/contracts/blob/main/contracts/votingStrategy/IVotingStrategy.sol (opens in a new tab)

Functions

init

function init() external[^1]

The init function needs to be called by a RoundImplementation before voting can begin.

Behaviors

StatusResponseNotes
SuccessroundAddress is set to msg.sender
Error"init: roundAddress already set"Will be returned if this instance of the voting contract has already been initialized

vote

function vote(bytes[] calldata _encodedVotes, address _voterAddress) external virtual payable

The vote function should be called by the roundAddress that was stored when contract was initialized. \ The vote function body is blank in the interface.

Parameters

nametypedescription
encodedVotesbytes[]encoded vote information. Specific information required will depend on the implementation.
voterAddressaddressaddress of the voter