Skip to content

Instantly share code, notes, and snippets.

View adrake33's full-sized avatar

Aaron Drake adrake33

View GitHub Profile
// Use TokensTransferred events to calculate `balance` for an account?
// Use `TokensMinted` to calculate supply?
export interface UniversesInfo<BigNumberType> {
balance: BigNumberType;
isInvalid: boolean; // Use UniverseCreated.payoutNumerators
numMarkets: BigNumberType; // Keep running total of MarketCreated events in this universe
parentUniverse: Address; // Universecreated.parentUniverse
payout: Array<number>; // UniverseCreated.payoutNumerators
supply: BigNumberType;
// Might need to add logs for the total fields?
export interface UIFeeWindowCurrent<BigNumberType> {
endTime: number; // DisputeWindowCreated.endTime
feeWindow: Address|null; // DisputeWindowCreated.disputeWindow
feeWindowId: number; // DisputeWindowCreated.id
startTime: number; // DisputeWindowCreated.startTime
universe: Address; // DisputeWindowCreated.universe
totalStake?: BigNumberType;
feeWindowEthFees?: BigNumberType;
// Returns breakdown of how many markets are in each reporting state.
// Might want to add logs to emit these totals?
interface UIReportingSummary {
[reportingState: string]: number;
}
// Will require data from multiple event types. Should log `crowdsourcerId` for initial reporters.
export interface UIReport<BigNumberType> {
creationBlockNumber: number;
creationTime: number;
logIndex: number;
transactionHash: Bytes32;
blockHash: Bytes32;
marketId: Address; // InitialReportSubmitted.market or DisputeCrowdsourcerContribution.market
feeWindow: Address; // DisputeWindowCreated.disputeWindow in v2
// This will require getting data from a lot of different logs. Might want to create new logs for fields in `totals .
export interface CrowdsourcerState {
crowdsourcerId: Address;
needsFork: boolean;
}
export interface InitialReporterState {
initialReporterId: Address;
needsFork: boolean;
// Should add initial reporter address to logging
export interface InitialReportersRow<BigNumberType> {
marketId: Address; // InitialReportSubmitted.market
reporter: Address; // InitialReportSubmitted.reporter
amountStaked: BigNumberType; // InitialReportSubmitted.amountStaked
initialReporter: Address; // Should be logged
redeemed: boolean; // Whether InitialReporterRedeemed has been logged
isDesignatedReporter: boolean; // InitialReportSubmitted.isDesignatedReporter
repBalance: BigNumberType; // InitialReportSubmitted.amountStaked or 0 (if claimed)
// Somewhat similar to getDisputeInfo. Will probably need to add logging for most of these?
export interface DisputeToken<BigNumberType> {
disputeToken: Address,
marketId: Address,
payout0: number,
payout1: number,
payout2: number,
payout3: number,
payout4: number,
// Most of these fields will probably need to be logged
export interface NormalizedPayoutNumerators<BigNumberType> {
payout: Array<BigNumberType>;
}
export interface NormalizedPayout<BigNumberType> extends NormalizedPayoutNumerators<BigNumberType> {
isInvalid: boolean|number;
}
// Should not require any additional logging
export interface Timestamped {
timestamp: number;
}
export interface FrozenFunds {
frozenFunds: BigNumber; // in whole tokens (eg. ETH)
}
// Should add `outcome`, `price`, & `maker` to TradingProceedsClaimed
export interface ProceedTradesRow {
logIndex: number, // Block logIndex
blockNumber: number, // Block number
timestamp: number, // Block timestamp
marketId: Address, // TradingProceedsClaimed.market
outcome: number, // Share token's outcome
price: BigNumberType, // Payout * tickSize * MarketCreated.minPrice
amount: BigNumberType, // TradingProceedsClaimed.numShares