Giter Club home page Giter Club logo

everest's People

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

Watchers

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

everest's Issues

Subgraph issues

We need to update the schema and the mappings, and add the following:
createdAt field to ALL entities
updatedAt field to Project entity
name field to Category entity

UI should not allow to vote on a challenge if that tx is going to fail

I just created a challenge in https://everest.link/project/0xe265942ad988d0c8512a92fac73d124389362191/
Afterwards, I was presented with this view:
image

The buttons "Keep" and "Remove" are active, so I clicked "Remove", not knowing that creating a challenge already counts as a "Remove" vote (as I now assume).
Next I cloud select a project on behalf of which I wanted to vote. I selected and confirmed.
Metamask didn't complain and let me send the tx. Which then failed: https://etherscan.io/tx/0xb4062ed4048beed1723c2678e2b4f05d0e107a1973be5e02bbc6220480ca19d6

The UI should not allow casting a vote in such a case.

PS: I also wonder why challenges and votes on them are to be expressed on behalf of a project. Why can't I do that simply as a registry curator, independent of a project?

UIX Comments/Suggestions

  1. Metamask popup asks me to "click to install or activate metamask", then I get metamask popup that promps me to "connect".

    • is "install or activate" the right wording? it's a bit jarring to get a different prompt in the popup
  2. On Project page the Owner value renders immediately as the ethereum account address then switches quickly to the string name

    • causes page load to look flashy/buggy
  3. Category dropdown on add project page gets stuck, doesn't minimize when I click/select a category until I click out somewhere else on the screen

    • Ok, I see the "SELECT" button at the top of dropdown now, but it's easy to miss or forget because you have to scroll to top to see it.
  4. If project creation fails (I didn't have sufficient ETH for gas fees) the project info is lost...is there any way we can keep that page with info and allow me to return to it retry to retry without re-entering the info?

  5. It'd be nice if the metamask popup didn't disappear immediately when I click to sign a transaction (and it looks like it's trying to go to another page in popup as its exiting.) I know to click the metamask plugin to monitor the pending transaction, but that may not be obvious.

Add link to finished product

add a link to a finished product or app.
for example: wallet, exchange ..
add download links for App Store, Google Play, Web

Error in adding a project - MetaMask Signing

Hi guys,

I'd like to list our project but can't do so since I'm stuck in the signing part.

The console displayed the following errors:

inpage.js:1 MetaMask - RPC Error: MetaMask Message Signature: Error: Not supported on this device {code: -32603, message: "MetaMask Message Signature: Error: Not supported on this device", data: {…}, stack: "Error: MetaMask Message Signature: Error: Not supp…eogaeaoehlefnkodbefgpgknn/background.js:1:141281)"}

index.ts:126 {code: -32603, message: "MetaMask Message Signature: Error: Not supported on this device", data: {…}, stack: "Error: MetaMask Message Signature: Error: Not supp…eogaeaoehlefnkodbefgpgknn/background.js:1:141281)"}

Error adding a project:  Error: Network error: MetaMask Message Signature: Error: Not supported on this device
    at new t (bundle.esm.js:69)
    at Object.error (bundle.esm.js:1339)
    at m (Observable.js:186)
    at w (Observable.js:222)
    at e.value (Observable.js:275)
    at bundle.esm.js:1115
    at Set.forEach (<anonymous>)
    at Object.error (bundle.esm.js:1114)
    at m (Observable.js:186)
    at w (Observable.js:222)

I can sign the transactions on other DApps except for this one.

Any help is appreciated, thank you!

Make mutations resolvers that are compatible with optimistic UI

Resolvers need to return objects that we can use for Apollo caching in the UI. For example, addProject mutation should return a project object (once it's successful):

return  {
  id: "123",
  name: "One"
  description: "Blah blah"
  ...
}

If it's unsuccessful, it should return an error object that the UI will handle, instead of silently failing.

BUG: 'Load more ' button appears at the end of projects list

When filtering projects list by claimed projects, 'Load more' button appears at the end of projects list even when all projects are there.

Steps to reproduce:

  • go to Projects page
  • filter by claimed projects
  • scroll down and press 'Load more' until all projects will be loaded
    Load more button will be shown, but on other filters(all, challenged) it disappears.

123

Logging of events

I created a challenge, after 2 days there is no challenge, and the results of its completion are not visible, there is no way to clarify how it ended. Logging of events for the project challenge and the history of other changes, if they are not there, then you need to add.

TypeError while adding a project

I got this error while waiting for the submit confirmation on the Add Project page.
The page turned blank, but the project was added with success, as I was able to see it in my projects list after I refreshed the page.

Screenshot 2020-10-24 at 20 02 59

Link to the project here

Feature Request: View Unclaimed Projects

On the projects page, it is possible to view "All projects", "Challenged projects", and "Claimed projects".
However it is not possible to view "Unclaimed projects".
As part of the initiative for curators to reach out to various projects to get involved, I believe it would be beneficial to see a list of projects worth contacting and tracking down to get involved. This new tab would make that easier.

Screen Shot 2020-10-24 at 5 58 19 PM

Remaining contract/mutations issues

Challenge a project

  • challenge duration is 5 days, we want it to be 2 or 3 days
  • challenge description is not being set - subgraph returns always null (it is being passed from the UI)

Everest actions

Schema

Everest schema proposal: #1
Everest current schema: https://github.com/graphprotocol/everest/blob/master/subgraph/schema.graphql

Actions:

  1. Add a project
    UX: Once a user fills out the form fields and hits "Submit" there will be a loading indicator (while transaction is in progress) and a progress bar - to show the percentage. We will also cache the data, so if they leave the page and return to it - they can't add another project simultaneously, we show that "adding a project" is in progress.
function applySignedWithAttribute(
        address _newMember,
        uint8[2] calldata _sigV,
        bytes32[2] calldata _sigR,
        bytes32[2] calldata _sigS,
        address _owner,
        uint8 _attributeSigV,
        bytes32 _attributeSigR,
        bytes32 _attributeSigS,
        bytes32 _offChainDataName,
        bytes calldata _offChainDataValue,
        uint256 _offChainDataValidity
    ) external {
        applySignedInternal(_newMember, _sigV, _sigR, _sigS, _owner);
        editOffChainDataSigned(
            _newMember,
            _attributeSigV,
            _attributeSigR,
            _attributeSigS,
            _offChainDataName,
            _offChainDataValue,
            _offChainDataValidity
        );
    }
  1. Edit a project
    UX: Once a user hits "Submit" there will be a loading indicator (while transaction is in progress) and a progress bar - to show the percentage. We will also cache the data, so if they leave the page and return to it - they can't add another project simultaneously, we show that "editing a project" is in progress.
  • Uploads project metadata to IPFS (the same as Add a project, everything is editable)
    name: String
    description: String
    website: String
    twitter: String
    github: String # Make sure we call it github or something else
    avatar: String
    image: String
    categories: [Category!]
    isRepresentative: Boolean
    
  • Calls editOffChainDataSigned on the Everest contract, https://github.com/graphprotocol/everest/blob/master/contracts/contracts/Everest.sol#L367 with the signature:
function editOffChainDataSigned(
        address _member,
        uint8 _sigV,
        bytes32 _sigR,
        bytes32 _sigS,
        bytes32 _offChainDataName,
        bytes memory _offChainDataValue,
        uint256 _offChainDataValidity
    ) public onlyMemberOwner(_member) {
        erc1056Registry.setAttributeSigned(
            _member,
            _sigV,
            _sigR,
            _sigS,
            _offChainDataName,
            _offChainDataValue,
            _offChainDataValidity
        );
    }
  1. Upload image
    • This involves only ipfs
  • Uploads image data to IPFS: image: File object from the UI (e.target.files[0]) . UX: We show a loading indicator, and once the image is uploaded, it shows in the UI
  1. Remove a project
    UX: Pass projecId. Set a loading indicator and a progress bar, and cache the state of the transaction
function memberExit(
        address _member
    ) external onlyMemberOwner(_member) {
        require(
            !memberChallengeExists(_member),
            "Everest::memberExit - Can't exit during ongoing challenge"
        );
        memberRegistry.deleteMember(_member);
        emit MemberExited(_member);
    }

  1. Transfer ownership
    UX:: Once "Transfer" is pressed, pass the address of the new owner and the projectId. Set a loading indicator and a progress bar, and cache the state of the transaction
function changeOwner(address identity, address actor, address newOwner)
        internal
        onlyOwner(identity, actor)
    {
        owners[identity] = newOwner;
        emit DIDOwnerChanged(identity, newOwner, changed[identity]);
        changed[identity] = block.number;
    }
  1. Delegate ownership
    UX: Once "Delegate" is pressed, pass the address of the new owner and the projectId. Set a loading indicator and a progress bar, and cache the state of the transaction
function addDelegate(
        address identity,
        address actor,
        bytes32 delegateType,
        address delegate,
        uint256 validity
    ) internal onlyOwner(identity, actor) {
        /* solium-disable-next-line security/no-block-members*/
        delegates[identity][keccak256(abi.encode(delegateType))][delegate] = now + validity;
        emit DIDDelegateChanged(
            identity,
            delegateType,
            delegate,
            /* solium-disable-next-line security/no-block-members*/
            now + validity,
            changed[identity]
        );
        changed[identity] = block.number;
    }
  1. Challenge a project
    UX: Once "Challenge" is pressed, set a loading indicator and a progress bar, and cache the state of the transaction
function challenge(
        address _challengingMember,
        address _challengedMember,
        bytes32 _details
    ) external onlyMemberOwner(_challengingMember) returns (uint256 challengeID) {
        uint256 challengeeMemberTime = memberRegistry.getMembershipStartTime(_challengedMember);
        require (challengeeMemberTime > 0, "Everest::challenge - Challengee must exist");
        uint256 challengerMemberTime = memberRegistry.getMembershipStartTime(_challengingMember);
        require(
            !memberChallengeExists(_challengedMember),
            "Everest::challenge - Member can't be challenged multiple times at once"
        );

        require(
            _challengingMember != _challengedMember,
            "Everest::challenge - Can't challenge self"
        );

        uint256 newChallengeID = challengeCounter;
        Challenge memory newChallenge = Challenge({
            challenger: _challengingMember,
            member: _challengingMember,
            /* solium-disable-next-line security/no-block-members*/
            yesVotes: now - challengerMemberTime,
            noVotes: 0,
            voterCount: 1,
            /* solium-disable-next-line security/no-block-members*/
            endTime: now + votingPeriodDuration,
            details: _details
        });
        challengeCounter++;

        challenges[newChallengeID] = newChallenge;

        // Updates member to store most recent challenge
        memberRegistry.editChallengeID(_challengedMember, newChallengeID);

        // Takes tokens from challenger
        require(
            approvedToken.transferFrom(msg.sender, address(reserveBank), challengeDeposit),
            "Everest::challenge - Token transfer failed"
        );

        emit MemberChallenged(
            _challengedMember,
            newChallengeID,
            _challengingMember,
            /* solium-disable-next-line security/no-block-members*/
            now + votingPeriodDuration,
            newChallenge.details
        );

        // Insert challengers vote into the challenge
        submitVote(challengeID, VoteChoice.Yes, _challengingMember);
        return challengeID;
    }
  1. Vote on a challenge
    UX: Set a loading indicator and a progress bar, and cache the state of the transaction
function submitVotes(
        uint256 _challengeID,
        VoteChoice[] memory _voteChoices,
        address[] memory _voters
    ) public {
        require(
            _voteChoices.length == _voters.length,
            "Everest::SubmitVotes - Arrays must be equal"
        );
        for (uint256 i; i < _voteChoices.length; i++){
            submitVote(_challengeID, _voteChoices[i], _voters[i]);
        }
    }
  1. Resolve a challenge
    UX: Hit resolve and the "Active challenge" box disappears. No loading, no progress bar
function resolveChallenge(uint256 _challengeID) public {
        challengeCanBeResolved(_challengeID);
        Challenge storage storedChallenge = challenges[_challengeID];

        bool didPass = storedChallenge.yesVotes > storedChallenge.noVotes;
        bool moreThanOneVote = storedChallenge.voterCount > 1;
        if (didPass && moreThanOneVote) {

            // Transfer challenge deposit to challenger for winning challenge
            require(
                withdraw(storedChallenge.challenger, challengeDeposit),
                "Everest::resolveChallenge - Rewarding challenger failed"
            );
            memberRegistry.deleteMember(storedChallenge.member);
            emit ChallengeSucceeded(
                storedChallenge.member,
                _challengeID,
                storedChallenge.yesVotes,
                storedChallenge.noVotes
            );
        } else {
            // Transfer challenge deposit to challengee. This keeps the token balance the same
            // whether or not the challenge fails.
            require(
                withdraw(storedChallenge.challenger, challengeDeposit),
                "Everest::resolveChallenge - Rewarding challenger failed"
            );
            // Remove challenge ID from registry
            memberRegistry.editChallengeID(storedChallenge.member, 0);
            emit ChallengeFailed(
                storedChallenge.member,
                _challengeID,
                storedChallenge.yesVotes,
                storedChallenge.noVotes
            );
        }

        // Delete challenge from Everest in either case
        delete challenges[_challengeID];
    }

BUG - search vaninshes page

If you got to projects and put either challenged or claimed projects, then try to search and the entire page disappears.

Deciding on schema for Everest subgraph

Below is the proposed schema. @nenadjaja needs this to work on the front end with mock data. It will need input from @yanivtal

type Project {
    id: ID!
    # From IPFS / off chain storage
    name: String!
    description: String!
    website: String
    twitter: String
    github: String # Make sure we call it github or something else
    avatar: String
    image: String
    ipfsHash: String!
    categories: [Category!]! 

    # From smart contracts directly
    owner: User
    isChallenged: Bool
    challenges: [Challenge]
    isWhitelistedProject: Bool! # check with Brandon
    createdAt: Int! # This would allow you to know when it will become a full member too
    delegateAddress: Bytes # Null if no delegate is set
    isRepresentative: Bool

    # Derived from smart contract events
    totalVotes: Int!
    reputation: Int!

    # All votes a Project has made
    votes: [Vote] @derivedFrom(field: "projectID")
}

type Category {
   id: ID!
   name: String!
   description: String!
   slug: String!
   projects: [Project]
   subcategories: [Category] @derivedFrom(field: "ID")
}

type Challenge {
    id: ID!
    description: String
    createdAt: Int!
    votesFor: Int!
    votesAgainst: Int!
    project: Project!
    owner: Bytes!
    resolved: Bool! #  means it's a past challenge
    votes: [Vote] @derivedFrom(field: "challengeID")
}

# For global variables
type Everest {
    id: ID!
    period: Int! # how long the challenge will last
    votingPeriodDuration: Int!
    whitelistPeriodDuration: Int!
    challengeDeposit: BigInt!
    applicationFee: BigInt!
    approvedToken: Bytes!
    reserveBank: Bytes!
    registry: Bytes!
}

type Vote {
    id: ID! # concatenation of challenge ID and voter address
    challenge: Challenge!
    choice: Choice!
}

enum Choice {
    RemoveProject
    KeepProject
}

    # Decide what we want to show from 3box (example: https://3box.io/0xbeb1faa6e7e39c7d9bdab03a7a362fe9d73d7c61/details)
type User {
     id: ID!
     name: String
     bio: String
     projects: [Project]
     challenges: [Challenge] # challenges you started
     votes: [Project] # participation in other people's challenges
}

Transaction, Submission, vote, and challenge history details

I was trying to find some of my activity and think I voted multiple times on some challenges because I couldn't find my vote history or info showing if I successfully voted and on what.

A resolved challenges section similar to our registries would be a great feature to include.

everest.link UI search BUG

after entering certain phrases a white page appears

how to repeat the bug:

  1. open any page on the everest website link
  2. enter the phrase 'un' or 'ori' in the top field "search projects"
  3. wait 1-5 seconds

I checked the bug on multiple devices - same behavior everywhere

No check for mainnet is present

When you try to add a projects on https://everest.link/projects/new/
And you have selected a test network, for example kovan.
You don't see any error message when you try to add the project.

However in the developer console i see the following error message when loading the page.

component---src-pages-projects-new-js-5493eeff585c0cab61b9.js:1 Error getting Dai balance:  Error: Network error: Cannot read property 'enable' of undefined
    at new t (app-1a524a930b38464c0d93.js:1)
    at Object.error (app-1a524a930b38464c0d93.js:1)
    at m (app-1a524a930b38464c0d93.js:1)
    at w (app-1a524a930b38464c0d93.js:1)
    at e.value (app-1a524a930b38464c0d93.js:1)
    at app-1a524a930b38464c0d93.js:1
    at Set.forEach (<anonymous>)
    at Object.error (app-1a524a930b38464c0d93.js:1)
    at m (app-1a524a930b38464c0d93.js:1)
    at w (app-1a524a930b38464c0d93.js:1)

When pressing "add project" i see the following message in the developer console.

 Error adding a project:  Error: Network error: Cannot read property 'enable' of undefined
    at new t (app-1a524a930b38464c0d93.js:1)
    at Object.error (app-1a524a930b38464c0d93.js:1)
    at m (app-1a524a930b38464c0d93.js:1)
    at w (app-1a524a930b38464c0d93.js:1)
    at e.value (app-1a524a930b38464c0d93.js:1)
    at app-1a524a930b38464c0d93.js:1
    at Set.forEach (<anonymous>)
    at Object.error (app-1a524a930b38464c0d93.js:1)
    at m (app-1a524a930b38464c0d93.js:1)
    at w (app-1a524a930b38464c0d93.js:1)

Suggestion: check for the chain metamask is connected to.

Query projects loop

Let's address Jannis' comment:

There's a better way to loop. If we know the block that the transaction was mined in, we can query with

{
  project(id: ..., block: { hash: "..." }) {
    ...
  }
}
That will return an error if the block is not available yet. We can loop until it is available.

There is, of course, the chance, that the block never becomes available (e.g. when it never ends up on the canonical chain). For that, we could abort the loop after e.g. 30s or 60s and throw an error from the mutation. At that point we can be pretty certain that the transaction never truly made it to the chain, I think.

Here: https://github.com/graphprotocol/everest/pull/20/files/5a9652b2c3c12d1eda308635800b96b7597f53d5#r381202190

Add lerna to the project

We'd like to have the same setup as for the registry starter: https://github.com/graphprotocol/registry-starter with a few improvements:

  • we should make it more stable, for example: a subgraph should be created first before trying to deploy. And maybe add more sleep time for graph-node to come up
  • we shouldn't need to restart the server several times to get it to work :)

Make users to call approve() instead of permit()

DAIs permit() requires you to allow for infinite allowance. We don't want this, especially when we
upgrade Everest to use proxies.

So we should remove this from the mutations and just make the user call approve() and then permit().

Add/Edit/Remove project mutations

A few things to keep in mind:

  • Mutations should be compatible with optimistic UI: #15
  • They should expose the Error object to the UI so we can use it to inform the users
  • @davekaj will implement the addProject mutation that needs to work with metatransactions
  • Once this is done, let's test it with the UI and the contracts before we merge it into master

Allow user to set default category

Right now if a project belongs to multiple categories, we pick the first category to display in the card. It would be nice if in the create/edit pages, a user could set a default category which gets displayed on the card.
image

"Challenge" button should remain disabled until a project is selected

Hiya team,

I found an error/bug in the validation as part of the Challenge flow.

When you go to challenge a project, you are asked to select a project. Initially I was unsure if I needed to select that & went straight to writing the reason for a challenge. The "Challenge" button then became enabled & I clicked it to go ahead with the challenge. I assumed with this flow the project field was not required.

Once you click the button, it shows the "Waiting for transaction" screen for short while & then the transaction/flow fails & resets without a reason why.

Perhaps it would be better to explain that the Project field is definitely required & also prevent the "Challenge" button from becoming enabled if that field is missing.

i18n support

Hey everyone 👋🏻

Blockchain industry a touchy area where some foreign language misunderstanding can lead to an error. Maybe it's a good idea to add a couple of popular languages to Everest to improve new users' boarding.

Add new category

Add a new category. DiFi has a subcategory of Payments, but this is a broad definition for many coins / blockchains. I suggest adding a separate category of Payments

URL paths from the Navbar don't resolve when opening in a new tab

Heya team,

love this project! I found a bug in the way the URLs are treated in the Navbar. Not 100% sure if this occurs somewhere else just yet.

How to reproduce:

(It does however seem to work when you click through without opening a new tab).

So it seems like the fix could be to make sure the additional paths don't get added in the navbar when you're in a sub-path.

Let me know if you need anything else here.

User creation and update

I just realized that User needs an image.
Also when are we going to populate the User:

  1. When they create a project, we can get their Ethereum address and create a User
  2. When they update the fields on 3Box. But how are we going to know that they did that? How are we going to keep 3Box in sync?

Essentially, if a User has set e.g. an image on 3Box, we need to update that image and show in the UI.
@davekaj let's pls chat about this tomorrow

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.