EcoPotVoting
This contract is creating and managing of the EcoPot project and exercising voting rights for the EcoPot project. KSP staking users vote for the EcoPot project they want and receive tokens according to their stake.
Address
CreateEcoPot
event CreateEcoPot(address operator, address ecoPot, address token, string name);Event log of EcoPot created
Parameters
operator: EcoPotOperator addressecoPot: EcoPot addresstoken: Token address received by username: EcoPot Project name
RemoveEcoPot
event RemoveEcoPot(address ecoPot);Event that occurs when EcoPot is removed
ChangeEcoPotAvailable
event ChangeEcoPotAvailable(address ecoPot, bool b);Event that occurs when the status is changed
AddVoting
event AddVoting(address user, address ecopot, uint amount);Event log of voting vKSP for EcoPot
Parameters
user : User address
ecopot : EcoPot address
amount : Vote vKSP amount
RemoveVoting
event RemoveVoting(address user, address ecopot, uint amount);Event log of remove voting vKSP for EcoPot
Parameters
user : User address
ecopot : EcoPot address
amount : Unote vKSP amount
Read-Only Functions
ecoPotCount
Number of EcoPot
MAX_VOTING_POT_COUNT
Maximum number of EcoPots where users can vote
ecoPotList
mapping(uint => address)
EcoPot addresses
ecoPotExist
mapping(address => bool)
Return if the address is EcoPot address
potTotalVotedAmount
Total voted number of EcoPot
userVotingPotCount
mapping(address => uint)
Number of votes each user voted for EcoPot
userVotingPotAddress
function userVotingPotAddress(address user, uint256 ecoPotIndex) public view returns (address) EcoPot addresses voted by each user
userVotingPotAmount
function userVotingPotAmount(address user, uint256 ecoPotIndex) public view returns (uint256) EcoPot voted amount by each user
State-Changing Functions
addVoting
function addVoting(address ecoPot, uint amount) publicMethod to voting vKSP for EcoPot
The amount can be entered in integer units
removeVoting
function removeVoting(address ecoPot, uint amount) publicMethod to remove voting vKSP for Ecopot
The amount can be entered in integer units within the voting limit
removeAllVoting
function removeAllVoting() publicMethod of remove total vote Ecopot
claimReward
function claimReward(address ecopot) public Method of vote Ecopot’s reward
claimRewardAll
function claimRewardAll() publicMethod of all vote Ecopot’s reward