telosnetwork / app-telos-net Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
The only option for wallet should be Anchor for both mobile and desktop
All packages need to be checked in order to avoid known exploits
The getter for those options is here:
An account can only create ballots in treasuries which it is registered for, as seen in the contract code where it looks up the tables:
So, that getter needs to also filter where the current account is a voter. Likely can do a lookup on the voters table and only show the treasuries you find there, similar to how the actual contract does the table lookup.
Currently, when the user opens a ballot, there is no indication that there is a fee associated with opening it. Before the user gets an error message or they're surprised by their reduced balance, we want to show them they'll be paying the fee.
Cancel
and Accept
optionsWhen creating a ballot, we should never create a ballot where votestake and voteliquid are both false, because then there will never be any vote weights to count, and voting will always fail with the "must vote with a positive amount" error.
When creating a ballot, voteliquid is always set to false and votestake is always set based on the stakeable value from the treasury's settings:
So, if a treasury's token is not stakable, we always should toggle voteliquid to true... which is the case for the VOTE token, this is why those ballots we have created for testing will never get votes. If a treasury's token is stakable, we should give the user an option in the form "Would you like to count liquid or staked or both"... but we cannot ever submit a ballot with both of those values set to false (which is what ballots for the VOTE token currently do). Maybe a message would be good in any case... "This treasury is not stakeable so liquid tokens will be used" or "This treasury is stakable, would you like to count liquid or staked tokens, or both?"
The settings should be on the treasury row, which I think should be loaded into the store already. So you can check the value of the stakeable property on the treasury row's settings to see how to handle this on the ballot form.
To toggle ballot settings, we need to call the togglebal action:
To call that action, we need to add another action to the array of actions we create in the addBallot function here:
app-telos-net/src/store/trails/actions.js
Line 145 in 7e36abb
To know what values the ballot will have for each setting, see the code in ballot.cpp above... voteliquid is always starting as false, and votestake is based on the stakeable setting, so based on that logic, and what the user has selected, need to toggle one or both of those settings by adding 1 or 2 actions to the actions array in addBallot function.
Find where it comes from and remove it, it looks like it is hardcoded.
On the ballot view, for already created ballots, if a ballot ended, we should show when it ended. Or if it is still in progress, we should show when it will end.
Should ensure there are at least 2 options, I believe another failure we saw was when attempting to create a ballot with only one option.
Show the actual error from the contract, without the assertion prefix (details[0]):
{
"code": 500,
"message": "Internal Service Error",
"error": {
"code": 3050003,
"name": "eosio_assert_message_exception",
"what": "eosio_assert_message assertion failure",
"details": [
{
"message": "assertion failure with message: ballot name already exists",
"file": "cf_system.cpp",
"line_number": 14,
"method": "eosio_assert"
},
{
"message": "pending console output: ",
"file": "apply_context.cpp",
"line_number": 143,
"method": "exec_one"
}
]
}
}
When leaving the website open on the ballots page, get_table_rows
continues to get called, causing unnecessary resource usage on the user's computer.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.