Code Monkey home page Code Monkey logo

snapshot's Introduction

Snapshot Logo

Snapshot

Snapshot is an off-chain gasless multi-governance client with easy to verify and hard to contest results.

Project setup

yarn

Compiles and hot-reloads for development

yarn dev

Compiles and minifies for production

yarn build

Lints and fixes files

yarn run lint

Development Guide

Use http://localhost:8080/#/fabien.eth for testing your code.

By default your instance will connect to the hub at https://testnet.hub.snapshot.org. To change that (or other values) you can create a .env.local and overwrite the values from .env.

Running service locally with Docker

  1. Run docker build -t snapshot . to build the image
  2. Run docker run --name snapshot -p 8080:8080 snapshot to run the container
  3. Go to http://localhost:8080/#/fabien.eth to test your code

License

Snapshot is open-sourced software licensed under the © MIT license.

snapshot's People

Contributors

alannabiev avatar aurelianob avatar bonustrack avatar brockelmore avatar carlosfebres avatar chaituvr avatar chefnomi avatar davidalbela avatar daywiss avatar dependabot[bot] avatar ethedev avatar github-actions[bot] avatar gokaiorg avatar gsteenkamp89 avatar harshmaur avatar ironwebstar avatar j0hnfl0w avatar mathxlee avatar midgerate avatar mktcode avatar qsnh avatar renovate[bot] avatar ro5s avatar rootial avatar samuveth avatar sarmatdev avatar sasicodes avatar todmy avatar wa0x6e avatar zzuziak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

snapshot's Issues

Reduce code when it's possible

We should reduce the code as much as possible, here is some idea to do that:

  • Remove code duplicate. There might be some tool that we can use to detect code duplicate, we should create utils instead of rewriting same code in multiple place.
  • Use optional chaining as much as we can (with Vue3 optional chaining is possible within the view <template>) we can use it to replace the _get mixin.
  • Use composition API when it simplify the code.
  • Anything else that can reduce the number of line of code (or make the code easier to understand) is welcome

Normal to Core address update bug

Reproduce Bug

  1. post a proposal on a space from an address without being a core member.
  2. add the address of this proposal author to core member array.
  3. the proposals posted by this address will not show anymore, unless deployed.
  4. after deploy, the proposal will show again.

Add proposal dropdown with delete button

We should add a 3 dots button in the proposal page.

Like this:
image
We are using iconfont.cn to manage font icons. Please give me your email on on Discord to get access.

The button should open a dropdown with a link "Delete proposal". The dropdown should use primer-css classes. The 3 dots button should be visible only for creator of the proposal. The link to delete a proposal should be inactive first, this is the first step to integrate the ability to delete a proposal, there will need 2 more tasks to make it work, i will write more details after.

Wrong Image inside Connect Wallet button when we cancel login

Describe the bug
Wrong Image inside Connect Wallet button when we cancel login

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://snapshot.page/#/
  2. Click on 'Connect Wallet', then select metamask, close it without connecting
  3. See an error

Expected behavior
should show "Connect wallet"

Screenshots
image

Desktop (please complete the following information):

  • OS: [e.g. iOS] windows
  • Browser [e.g. chrome, safari] Chrome
  • Version [e.g. 22] 87.0.4280.88

VUE_APP_IPFS_GATEWAY is missing or not valid in snapshot.page

Describe the bug
VUE_APP_IPFS_GATEWAY is not set in env variables in snapshot.page
it should be
VUE_APP_IPFS_GATEWAY=gateway.ipfs.io

To Reproduce
Steps to reproduce the behavior:

  1. Go to any proposal page
    ex: https://snapshot.page/#/sushi/proposal/Qmczqhvmmepe9wwuvw7Uuhk7GKb29Gu5cW73VrLxjG7T1K

  2. Click on Ipfs link
    image

  3. It will take you to https://undefined/ipfs/Qmczqhvmmepe9wwuvw7Uuhk7GKb29Gu5cW73VrLxjG7T1K instead of https://gateway.ipfs.io/ipfs/Qmczqhvmmepe9wwuvw7Uuhk7GKb29Gu5cW73VrLxjG7T1K

Expected behavior
https://gateway.ipfs.io/ipfs/Qmczqhvmmepe9wwuvw7Uuhk7GKb29Gu5cW73VrLxjG7T1K instead of https://undefined/ipfs/Qmczqhvmmepe9wwuvw7Uuhk7GKb29Gu5cW73VrLxjG7T1K

Report from "Download report" is broken

Describe the bug
The CSV that the "Download report" button provides doesn't actually have the vote information expected.

Expected behavior
I expect a report with votes, addresses, token amount voted, signatures, etc.

Screenshots

Report from: https://gov.aragon.org/#/aragon/proposal/Qmb2ZWCUcbTmTGg1Hfu8b8QNZ6vFhW74n614dEdjuwttku

vote-report

Desktop (please complete the following information):

  • OS: Mint 19.3
  • Browser: Firefox 82.0.2
  • Spreadsheet: Libre Office 6.0.7.3 - Calc

Fortmatic wallet bug

Fortmatic wallet bug

Page get stuck if we were trying to connect Fortmatic wallet.

To reproduce:

  • go to the website
  • click connect wallet, click Fortmatic
  • wait for it to load
  • close the website
  • reopen the website
  • you will get stuck
Error log
fortmatic.ts:16 Error: Fortmatic RPC Error: [-32603] Fortmatic: User denied account access.
    at new t (fortmatic.js:1)
    at e.<anonymous> (fortmatic.js:1)
    at fortmatic.js:1
    at Object.next (fortmatic.js:1)
    at a (fortmatic.js:1)

Post length

When creating long proposal it gets cut in UI – is there length restriction? Can you add indication to UI?

Provide more information on why a block number *and* a date is needed.

Is your feature request related to a problem? Please describe.
I'm not sure why I need to set both a start date and a block number. What happens if the block number is after the start date? What happens if it is before? Creating a poll is confusing!

Describe the solution you'd like
Better in-line documentation on why I need both, and what I should set them as.

Describe alternatives you've considered
Just ask me for a start time and auto-fill the block number for me (perhaps just displaying it as a disabled text box, or let me edit it as an expert mode feature).

Additional context
As a user, guessing when future blocks will occur is very hard. Even just figuring out what current block is non-intuitive.

Could not vote with Frame

Describe the bug
I tried to cast a vote using Frame and repeatedly got this error:

Screenshot_2020-10-22 Snapshot(2)

Snapshot is the only dapp I seem to be having problems with.

Desktop (please complete the following information):

  • OS: Linux Mint 19.3
  • Browser: Firefox
  • Version: 82

Vote amounts shown are rounded

Is your feature request related to a problem? Please describe.
The vote amounts shown are rounded.

Describe the solution you'd like
Show the exact vote amounts.

Describe alternatives you've considered
If you hover over the rounded number (or press on the rounded number if on mobile) it can show the exact vote amount in a tooltip.

Additional context

Screenshot_2020-11-20 Aragon

Screenshot_2020-11-20 Aragon(1)

Publishing flow

Screen Shot 2020-08-31 at 08 27 56

First time users will have a hard time publishing a proposal without an instruction manual

  • What is the function of "snapshot block number" and how do you obtain it?
    • Does it have to be displayed to the user? If yes could it be automatically filled?
  • Error messages, currently the button is only grey with no explanation when something is missing.
    • I managed to get it into a state where I seemingly had everything correctly filled in but the button was still greyed out

Swap out "MetaMask" logo for generic "Web3" logo on the connector modal

If a voter uses Frame as their signing interface, they must currently know to select "MetaMask" from the list of connection options:

Screenshot_2020-10-21 Snapshot

I can think of two solutions to make this more intuitive:

  • Add a logo for Frame too, but this option doesn't scale well; it implies that for each Web3 signing tool a new logo should be added to this modal, which could eventually make it cluttered with a ton of logos for users to sift through.
  • Add a generic "Web3" logo and remove the MetaMask logo (Coinbase too?), then users of any signing interface that supports generic Web3 connections can click the Web3 button and not have to sort through a bunch of logos to find their specific signer.

Fix proposal block number error

Fix proposal block number error

Error shows if you set an invalid block number, and the block number must be bigger than the block where the token has been created at, this should not console log error but show the user more info what happened in there.

Snapshot proposal link:
https://snapshot.page/#/nft/proposal/QmPGuJzBuuajYMHEyTEomnTbyd46wECvh7QHYkpKTcEVik
IPFS link:
https://ipfs.io/ipfs/QmPGuJzBuuajYMHEyTEomnTbyd46wECvh7QHYkpKTcEVik

Error log
TypeError: Cannot read property 'proposal' of undefined
    at Proposal.vue:204
    at u (runtime.js:45)
    at Generator._invoke (runtime.js:274)
    at Generator.forEach.e.<computed> [as next] (runtime.js:97)
    at n (asyncToGenerator.js:3)
    at s (asyncToGenerator.js:25)

SSL_ERROR_RX_RECORD_TOO_LONG

Describe the bug
When I visit https://snapshot.page through my ISP (BT in the UK) i'm getting an error on every browser

SSL_ERROR_RX_RECORD_TOO_LONG

When I run https://www.ssllabs.com/ssltest/analyze.html?d=snapshot.page&latest the site is only scoring B's across the board (not sure if that's something that needs looking into).

I've managed to overcome it by Tethering on my mobile data, but that's not the point.

Expected behavior
I expect to be able to visit the snapshot.page through my regular internet connection on just about any browser.

Screenshots

image

Desktop (please complete the following information):

  • OS: OSX 10.14.6 (18G7016)
  • Browser: Chrome, Safari, Firefox (all latest versions)

Extend Snapshot.page from 1:1 voting to Quadratic Voting

Actual behavior

1:1 voting

Expected behavior

Implement quadratic voting on snapshot.page

WHY: Quadratic Voting ( https://en.wikipedia.org/wiki/Quadratic_voting ) is a mathematically elegant way to make sure that decisions are made in a more democratic way. It mutes the influence of whales. It optimizes for the voting power of the "poor and many" over the "rich and many".

In order to implement QV on Snapshot.page, i think all we need to do to do an entirely trivial QV implementation is:

  1. For each new proposal, the user can select '1:1 voting' or "QV voting".
  2. If the proposal is in QV mode, votes on that proposal should count quadratically instead of 1to1. (the math is easy; just take the sqrt of the vote instead of the vote, and add that to the total - you can see an example here https://wtfisqf.com/ - esp in the linked javascript library )

A less naive implementation (lets call it Milestone 2) would be to introduce some sort of sybil resistence to the system. We’d have to integrate with something that can provide Sybil resistance as an minimal identity layer... Let's cross that bridge when we get to it, but some early promising routes

  1. BrightID integration (make each voter be a verified BrightID user), and use that as sybil resistence.
  2. Integrate with Gitcoin (make each voter authenticate with their Gitcoin account), and use that as sybil resistence.

IPFS version is broken

It seems that http://snapshot.page has DNSLink enabled, but linked IPFS site does not load properly because URLs of static files are absolute. To work correctly when opened on IPFS gateway the site should use relative URLs.

If you're using vue, setting publicPath: './' in vue.config.js might fix this.

min should apply to votes according to strategy @ snapshot block number

Expected behavior

min should apply to votes according to strategy @ snapshot block number

Actual behavior

min applies to balanceOf of token of proposal signer address

Steps to reproduce the behavior

create a proposal from account that has enough votes according to strategies to exceed min
it does not show up

Not able to read some proposals

Not able to read some proposals

Only on some proposals this issue appears.

Snapshot proposal link:
https://snapshot.page/#/farm/proposal/QmQvoNCNhz5dARMgR82vFPeHAMPqMahHgsHjPYggFuAkGZ
IPFS link:
https://ipfs.io/ipfs/QmQvoNCNhz5dARMgR82vFPeHAMPqMahHgsHjPYggFuAkGZ

This bug does not relate to #131

Error log
TypeError: Cannot read property 'proposal' of undefined
    at Proposal.vue:204
    at u (runtime.js:45)
    at Generator._invoke (runtime.js:274)
    at Generator.forEach.e.<computed> [as next] (runtime.js:97)
    at n (asyncToGenerator.js:3)
    at s (asyncToGenerator.js:25)

Fix deployment (error with lodash.set)

Deployment of the UI failing because of a missing dependency lodash.set on Snapshot.js. The package.json on Snapshot.js include lodash.set as depencency we should find out why we still seeing this error.

vue3 - outdated package replacements

Problem
Vue 3 no longer works with infiniteScroll and TextareaAutosize packages.

Solution
Create our own infiniteScroll and TextareaAutosize components or update the package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.