-
Notifications
You must be signed in to change notification settings - Fork 0
TMP: Base polls #6
Copy link
Copy link
Open
Description
TMP-6: Base polls
tmp: 6
title: Base polls
author: Evert Kors (@Evert0x)
discussions-to: #6
status: Draft
type: Module
created: 2021/01/19
requires (*optional):
replaces (*optional):
Simple Summary
Polls are native to every pool, this TMP describes basic functionalities for any poll.
Abstract
The following standard allows other poll modules to be built on top of.
Using a different storage pointer for every poll
Motivation
...
Specification
Interface
interface IBasePoll {
function getStartTime(uint256 _id) external view returns (uint256);
function getEndTime(uint256 _id) external view returns (uint256);
function getYesCounter(uint256 _id) external view returns (uint256);
function getNoCounter(uint256 _id) external view returns (uint256);
function getTotalVoted(uint256 _id) external view returns (uint256);
function getVoteByAddress(uint256 _id, address _address)
external
view
returns (LibBasePollStorage.Vote memory);
}
Storage
struct BaseStorage {
uint256 pollCounter;
}
struct BasePollStorage {
uint256 id;
uint256 startTime;
uint256 endTime;
uint256 yesCounter;
uint256 noCounter;
uint256 totalVoted;
mapping(address => Vote) votesByAddress;
}
struct Vote {
uint256 time;
uint256 weight;
bool agree;
}Rationale
Backwards Compatibility
Reference Implementation
https://github.com/Evert0x/BasePoll
Security Considerations
Copyright
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels