Error on staking against

I have this error on staking against a proposal. Staking for works as it should. Code is the same for both actions. Any hints on what to check to solve?



proposal.js:791 Uncaught (in promise) Error: Error staking: no "Stake" event was found - 
    at map (proposal.js:791)
    at Object.<anonymous> (operation.js:322)
    at step (operation.js:124)
    at (operation.js:55)
    at operation.js:27
    at new Promise (<anonymous>)
    at push../node_modules/@daostack/client/dist/lib/operation.js.__awaiter (operation.js:4)
    at Promise.<anonymous> (operation.js:309)
    at Promise.emit (index.js:181)
    at index.js:341

Adding @oren’s telgram response to this thread.

Increasing staking is enable only on the same direction as your previous stake. So once you upstake a proposal you cannot downstake on it .(you can always do that from different accounts)

thanks, it’s clear. Also, i’ve not understood how the fields preboostedAt, boostedAt and accountsWithUnclaimedRewards works. The field preboostedAt is filled when upstakeNeededToPreBoost became 0. When boostedAt is filled? Also, I can see addresses in accountsWithUnclaimedRewards but the claimRewards method seems not to have any effect: MetaMask opens with gas request but no reputation or GEN values is modified. After the call, accountsWithUnclaimedRewards remains the same.


Hey Daniele,
So the proposals run through different states, from Pending to PreBoosted to Boosted (to Executed, etc). The terms “BoostedAt” (and PreboostedAT) refer to the time the proposal last changed to Boosted (orPreboosted)

If you have a link to the failing transaction we can investigate…

ok, it’s clear that the field refer to the time the proposal goes to the state. Transaction goes to preboosted state (preboostedAt filled with timestamp value), but I’ve not clear when (or after what amount of time or under which condition) goes to Boosted state.Same thing for accountsWithUnclaimedRewards.

accountsWithUnclaimedRewards: Array(3) [ "0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1", "0xffcf8fdee72ac11b5c542428b35eef5769c409f0", "0x22d491bde2303f2f43325b2108d26f1eaba1e32b" ]
​boostedAt: 0
​closingAt: 1574055451
​confidenceThreshold: 1099511627776
​contributionReward: Object { alreadyRedeemedEthPeriods: 0, alreadyRedeemedExternalTokenPeriods: 0, alreadyRedeemedNativeTokenPeriods: 0, … }
​createdAt: 1574015426
​dao: Object { context: {…}, id: "0x68b0688b9c2676ba19bee93fd41776e1b8c2e677" }
​description: "Please provide Sample proposal description"
​descriptionHash: "QmXq4VzLyEjbWJmirAdbzEPrzzVwgSF3VJTZ6CGe8cRMR4"
​downStakeNeededToQueue: Object { negative: 0, words: (1) […], length: 1, … }
​executedAt: 1574055451
​executionState: 3
​expiresInQueueAt: 1574447426
​genericScheme: null
​genesisProtocolParams: Object { activationTime: 0, boostedVotePeriodLimit: 86400, daoBountyConst: 10, … }
​id: "0x4ad18ce8bca51ea8d71d0aad05567d1d18b8636cdc71957d62baee3ba2c448cd"
​organizationId: "0x2e9f60dfe2c6d37b8094e508b5a83945bb7aa89b49b921e5ccf559eaa779567d"
​paramsHash: undefined
​preBoostedAt: 1574016485
​proposal: Object { id: "0x4ad18ce8bca51ea8d71d0aad05567d1d18b8636cdc71957d62baee3ba2c448cd", staticState: {…}, context: {…} }
​proposer: "0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1"
​queue: Object { dao: "0x68b0688b9c2676ba19bee93fd41776e1b8c2e677", id: "0x2e9f60dfe2c6d37b8094e508b5a83945bb7aa89b49b921e5ccf559eaa779567d", name: "ContributionReward", … }
​quietEndingPeriodBeganAt: 0
​resolvedAt: 0
​scheme: Object { address: "0x31c58776929abe0f8ecbab93bfcefe0bfd6b73b3", canDelegateCall: false, canManageGlobalConstraints: false, … }
​schemeRegistrar: null
​stage: 1
​stakesAgainst: Object { negative: 0, words: (3) […], length: 3, … }
​stakesFor: Object { negative: 0, words: (3) […], length: 3, … }
​tags: Array []
​title: "seconda"
​totalRepWhenCreated: Object { negative: 0, words: (3) […], length: 3, … }
​totalRepWhenExecuted: Object { negative: 0, words: (3) […], length: 3, … }
​type: "ContributionReward"
​upstakeNeededToPreBoost: {…}
​​length: 1
​​negative: 0
​​red: null
​​words: Array [ 0 ]
​​<prototype>: Object { _init: init(), _initNumber: _initNumber(), _initArray: _initArray(), … }
​url: "#"
​voteOnBehalf: undefined
​votesAgainst: Object { negative: 0, words: (1) […], length: 1, … }
​votesCount: 3
​votesFor: Object { negative: 0, words: (3) […], length: 3, … }
​votingMachine: "0xba0d957ac890712af5307c8c5eb10dc961b1fa82"
​winningOutcome: 1
​<prototype>: Object { … }

At the moment the application is on a virtual machine (locally on my laptop) and is based on starter-template.



A little description on how staking works

Regular: Proposals are initially submitted to regular queue.

Regular to Pending: Gen staked on proposal > proposal.​upstakeNeededToPreBoost,

Pending to Boosted: currentTime >= proposal.preBoostedAt + proposal.genesisProtocolParams.preBoostedVotePeriodLimit

You can check the proposal.stage to see which stage it is in.

The list of beneficiary appears in accountsWithUnclaimedRewards.

Regarding your issue of no GEN values modified … are you sure DAO has enough to pay the beneficiary? Redemption won’t succeed if there are not enough funds in the DAO, Since DAO does not do partial payment.

I’ve set upstakeNeededToPreBoost = 300 in DAO: it seems that the value is added to closingAt value, not boostedAt that remains 0. In one proposal boostedAt became equals to closingAt after closing… I’ve not understand how it works… Stage remains 3. About DAO funds, how can I check if DAO has enough?



closingAt: 1574333892
createdAt: 1574332308
executedAt: 1574333892
executionState: 5
expiresInQueueAt: 1574764308
preBoostedAt: 1574333582
stage: 1
stakesAgainst: Object { negative: 0, words: (3) […], length: 3, … }
stakesFor: Object { negative: 0, words: (3) […], length: 3, … }
tags: Array []
title: “Sample Proposal”
totalRepWhenCreated: Object { negative: 0, words: (3) […], length: 3, … }
totalRepWhenExecuted: Object { negative: 0, words: (3) […], length: 3, … }
type: “ContributionReward”
upstakeNeededToPreBoost: Object { negative: 0, words: (1) […], length: 1, … }
url: “#hghgh”
voteOnBehalf: undefined
votesAgainst: Object { negative: 0, words: (1) […], length: 1, … }
votesCount: 3
votesFor: Object { negative: 0, words: (3) […], length: 3, … }
votingMachine: “0x52538ef9bf93187c0acdcdda27610d0f81a17227”
winningOutcome: 1

Upstakeneededtopreboost is a field that is calculated based on blockchain data and cannot be set using client. (will update documentation for these terms wrt protocol).

If you try localhost:8000 you can use graphQL queries to check the data indexed. Check graql guide here

The values for fields such as closingAt is decided by the parameters used to setup scheme - in case of starter-kit you can find these in daospec file.
BoostedAt is The time at which proposal is boosted which in case of downstake is supposed to stay 0

You can check the balance on subgraph (hint: query AvatarContract) or directly query in App

Also, it seems that dao.createProposal() returns a proposal that has already a stakesAgainst value set (150). Is it possibile?

        const as = await dao.createProposal({
         dao: dao.address
        console.log(await as.result.state().first())



So in DaoSpecs it is possible to adjust minimum negative stake made by dao on any proposal. This is to incentivize engagement. This value might be set to 150 in your case.

Also, refer to DAO parameters