Tally Docs
Search…
OpenZeppelin Style
Compatibility considerations when implementing OpenZeppelin governor
To be compatible with the Tally app we recommend you to use OpenZeppelin's library Governor contract. If you want to implement changes to this base contract these are the things you should keep in mind.

Events signatures

Please maintain the event signatures that OZ Governor implements, we use these to index the data needed from your governance.
1
event ProposalCreated(
2
uint256 proposalId,
3
address proposer,
4
address[] targets,
5
uint256[] values,
6
string[] signatures,
7
bytes[] calldatas,
8
uint256 startBlock,
9
uint256 endBlock,
10
string description
11
);
12
event ProposalCanceled(uint256 proposalId);
13
event ProposalExecuted(uint256 proposalId);
14
event VoteCast(
15
address indexed voter,
16
uint256 proposalId,
17
uint8 support,
18
uint256 weight,
19
string reason
20
);
Copied!

Functions signatures

These are the functions signatures that cannot change:
1
function votingDelay() public view virtual returns (uint256);
2
function votingPeriod() public view virtual returns (uint256);
3
function quorum(uint256 blockNumber) public view virtual returns (uint256);
4
function proposalThreshold() public view virtual returns (uint256);
5
function state(uint256 proposalId) public view virtual override returns (
6
ProposalState
7
);
8
9
function getVotes(
10
address account,
11
uint256 blockNumber
12
) public view virtual returns (uint256);
13
14
function propose(
15
address[] memory targets,
16
uint256[] memory values,
17
bytes[] memory calldatas,
18
string memory description
19
) public virtual returns (uint256 proposalId);
20
21
function execute(
22
address[] memory targets,
23
uint256[] memory values,
24
bytes[] memory calldatas,
25
bytes32 descriptionHash
26
) public payable virtual returns (uint256 proposalId);
27
28
function castVote(
29
uint256 proposalId,
30
uint8 support
31
) public virtual returns (uint256 balance);
32
33
function castVoteWithReason(
34
uint256 proposalId,
35
uint8 support,
36
string calldata reason
37
) public virtual returns (uint256 balance);
38
39
function castVoteBySig(
40
uint256 proposalId,
41
uint8 support,
42
uint8 v,
43
bytes32 r,
44
bytes32 s
45
) public virtual returns (uint256 balance);
Copied!
If your OpenZeppelin governor contract implements a timelock, this function signature also needs to be maintained:
1
function queue(
2
address[] memory targets,
3
uint256[] memory values,
4
bytes[] memory calldatas,
5
bytes32 descriptionHash
6
) public virtual override returns (uint256)
Copied!

Proposal state lifecycle

We support the following states during the proposal lifecycle if your governance uses different states from these it won't work on Tally:
1
enum ProposalState {
2
Pending,
3
Active,
4
Canceled,
5
Defeated,
6
Succeeded,
7
Queued,
8
Expired,
9
Executed
10
}
Copied!
Last modified 29d ago