import { Bytes32, EthAddress, BigNumber, ParamProposalState, ParamProp, PollID, ParamPropChallengeData, UserChallengeData, WrappedPropID } from "@joincivil/typescript-types"; import { Observable } from "rxjs"; import { TwoStepEthTransaction } from "../../types"; import { EthApi } from "@joincivil/ethapi"; import { BaseWrapper } from "../basewrapper"; import { CivilParameterizerContract } from "../generated/wrappers/civil_parameterizer"; import { Voting } from "./voting"; export declare const enum Parameters { minDeposit = "minDepost", pMinDeposit = "pMinDeposit", applyStageLen = "applyStageLen", pApplyStageLen = "pApplyStageLen", commitStageLen = "commitStageLen", pCommitStageLen = "pCommitStageLen", revealStageLen = "revealStageLen", pRevealStageLen = "pRevealStageLen", dispensationPct = "dispensationPct", pDispensationPct = "pDispensationPct", voteQuorum = "voteQuorum", pVoteQuorum = "pVoteQuorum", challengeAppealLen = "challengeAppealLen", challengeAppealCommitLen = "challengeAppealCommitLen", challengeAppealRevealLen = "challengeAppealRevealLen" } /** * The Parameterizer is where we store and update values associated with "parameters", variables * needed for logic of the Registry. * Users can propose new values for parameters, as well as challenge and then vote on those proposals */ export declare class Parameterizer extends BaseWrapper { static singleton(ethApi: EthApi): Promise; static atUntrusted(web3wrapper: EthApi, address: EthAddress): Promise; private voting; private constructor(); /** * Returns Voting instance associated with this TCR */ getVoting(): Promise; /** * Get address for voting contract used with this TCR */ getVotingAddress(): Promise; getPropState(propID: string): Promise; /** * Event Streams */ /** * An unending stream of the propIDs of all active Parameterizer proposals * @param fromBlock Starting block in history for events. Set to "latest" for only new events. * @returns currently active proposals propIDs */ propIDsInApplicationPhase(fromBlock?: number): Observable; /** * An unending stream of the propIDs of all Reparametization proposals currently in * Challenge Commit Phase * @param fromBlock Starting block in history for events. Set to "latest" for only new events. * @returns currently active proposals in Challenge Commit Phase propIDs */ propIDsInChallengeCommitPhase(fromBlock?: number): Observable; /** * An unending stream of the propIDs of all Reparametization proposals currently in * Challenge Reveal Phase * @param fromBlock Starting block in history for events. Set to "latest" for only new events * @returns currently active proposals in Challenge Reveal Phase propIDs */ propIDsInChallengeRevealPhase(fromBlock?: number): Observable; propIDsInChallenge(fromBlock?: number): Observable; /** * An unending stream of the propIDs of all Reparametization proposals that can be * processed right now. Includes unchallenged applications that have passed their application * expiry time, and proposals with challenges that can be resolved. * @param fromBlock Starting block in history for events. Set to "latest" for only new events * @returns propIDs for proposals that can be updated */ propIDsToProcess(fromBlock?: number): Observable; /** * An unending stream of the pollIDs of all Reparametization proposals that have * been challenged and had those challenges resolved. * @param fromBlock Starting block in history for events. Set to "latest" for only new events * @returns pollIDs for proposals that have been challenged and resolved */ pollIDsForResolvedChallenges(propID: string, fromBlock?: number): Observable; /** * An unending stream of the propIDs of all Reparametization proposals that have * been challenged and had those challenges resolved. * @param fromBlock Starting block in history for events. Set to "latest" for only new events * @returns propIDs for proposals that have been challenged and resolved */ propIDsForResolvedChallenges(fromBlock?: number): Observable; allProposalChallengeIDsEver(): Observable; /** * Contract Transactions */ /** * Propose a "reparameterization" (change the value of a parameter) * @param paramName name of parameter you intend to change * @param newValue value you want parameter to be changed to */ proposeReparameterization(paramName: Parameters | string, newValue: BigNumber): Promise; /** * Challenge a "reparameterization" * @param propID the ID of the proposed reparameterization you wish to challenge */ challengeReparameterization(propID: Bytes32): Promise; /** * Update state of proposal. Changes value of parameter if proposal passes without * challenge or wins challenge. Deletes it if it loses. Distributes tokens correctly. * @param propID the ID of the proposed reparameterization to process */ processProposal(propID: Bytes32): Promise; /** * Claims reward associated with challenge * @param challengeID ID of challenge to claim reward of * @param salt Salt for user's vote on specified challenge */ claimReward(challengeID: BigNumber, salt: BigNumber): Promise; /** * Contract Getters */ /** * Get ParamProp for proposal * @param propID ID of proposal to get */ getProposal(propID: string): Promise; /** * Gets reward for voter * @param challengeID ID of challenge to check * @param salt Salt of vote associated with voter for specified challenge * @param voter Voter of which to check reward */ voterReward(challengeID: BigNumber, salt: BigNumber, voter?: EthAddress): Promise; /** * Gets the current value of the specified parameter * @param parameter key of parameter to check */ getParameterValue(parameter: string): Promise; /** * Gets the current ChallengeID of the specified parameter * @param parameter key of parameter to check */ getChallengeID(parameter: string): Promise; /** * Gets the challenge data for the specified proposal challenge ID * @param challenge ID of prop challenge to check */ getChallengeData(challengeID: BigNumber): Promise; /** * Returns whether or not a Proposal is in the Unchallenged Applicaton Phase * @param propID ID of prop to check */ isPropInUnchallengedApplicationPhase(propID: string): Promise; /** * Returns whether or not a Proposal Application can be Updated (has passed Application * phase without being challenged) * @param propID ID of prop to check */ isPropInUnchallengedApplicationUpdatePhase(propID: string): Promise; /** * Returns whether or not a Proposal is in the Challenge Commit Phase * @param propID ID of prop to check */ isPropInChallengeCommitPhase(propID: string): Promise; /** * Returns whether or not a Proposal is in the Challenge Reveal Phase * @param propID ID of prop to check */ isPropInChallengeRevealPhase(propID: string): Promise; /** * Returns whether or not a Proposal is in the Challenge Resolve Phase * @param propID ID of prop to check */ isPropInChallengeResolvePhase(propID: string): Promise; /** * Returns whether or not a Challenge has been resolved * @param propID ID of poll (challenge) to check */ isChallengeResolved(pollID: BigNumber): Promise; /** * Returns the Application Expiry date for a proposal * @param propID ID of prop to check */ getPropApplicationExpiry(propID: string): Promise; /** * * @param propID id of proposal to check * @throws {CivilErrors.NoChallenge} */ getPropChallengeCommitExpiry(propID: string): Promise; /** * * @param propID id of proposal to check * @throws {CivilErrors.NoChallenge} */ getPropChallengeRevealExpiry(propID: string): Promise; /** * Returns the date by which a proposal must be processed. Successful proposals must * be processed within a certain timeframe, to avoid gaming the parameterizer. * @param propID ID of prop to check */ getPropProcessBy(propID: string): Promise; /** * Returns the timestamp of the Application Expiry * @param propID ID of prop to check */ getPropApplicationExpiryTimestamp(propID: string): Promise; /** * Returns the name of the paramater associated with the given proposal * @param propID ID of prop to check */ getPropName(propID: string): Promise; /** * Returns the value proposed associated with the given proposal * @param propID ID of prop to check */ getPropValue(propID: string): Promise; getUserProposalChallengeData(propChallengeID: BigNumber, user: EthAddress): Promise; getRewardClaimed(challengeID: BigNumber, user: EthAddress): Promise; }