From 7448c80bd027f3d4fcf0a16a7c7397ca3dfd4bfb Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Wed, 27 Jan 2021 19:13:57 +0800 Subject: [PATCH 1/5] add beforeTokenMint handler --- schema.graphql | 1 + src/mappingForComptroller.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/schema.graphql b/schema.graphql index e9b3ce4..b02f49f 100644 --- a/schema.graphql +++ b/schema.graphql @@ -211,6 +211,7 @@ type ControlledTokenBalance @entity { account: Account! controlledToken: ControlledToken! balance: BigInt + referrer: Bytes } # ID: `${prizeStrategy.address}-${token.address}` diff --git a/src/mappingForComptroller.ts b/src/mappingForComptroller.ts index e50df1c..b5d2481 100644 --- a/src/mappingForComptroller.ts +++ b/src/mappingForComptroller.ts @@ -1,4 +1,5 @@ import { Address, BigInt, log } from '@graphprotocol/graph-ts' +import { generateCompositeId, ONE, ZERO, ZERO_ADDRESS } from "./helpers/common" import { Comptroller, @@ -8,6 +9,7 @@ import { BalanceDripPlayer, VolumeDripPlayer, VolumeDripPeriod, + ControlledTokenBalance, } from '../generated/schema' import { @@ -29,6 +31,7 @@ import { VolumeDripPeriodStarted, VolumeDripPeriodEnded, VolumeDripDripped, + BeforeTokenMintCall, } from '../generated/Comptroller/Comptroller' import { @@ -302,3 +305,12 @@ export function handleVolumeDripDripped(event: VolumeDripDripped): void { _volumeDripPlayer.balance = _volumeDripPlayer.balance.plus(_amount) _volumeDripPlayer.save() } + +export function handleBeforeTokenMint(call: BeforeTokenMintCall): void { + if (call.inputs.referrer === null) { + return + } + const _controlledTokenBalance = ControlledTokenBalance.load(generateCompositeId(call.inputs.to.toHexString(), call.inputs.measure.toHexString())) + _controlledTokenBalance.referrer = call.inputs.referrer + _controlledTokenBalance.save() +} \ No newline at end of file From d42cf24af0a879c4a64fe75fc57ee50c16c8cd95 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Wed, 27 Jan 2021 21:32:56 +0800 Subject: [PATCH 2/5] fix errors --- src/mappingForComptroller.ts | 20 ++++++++++++++++---- subgraph.template.yaml | 3 +++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/mappingForComptroller.ts b/src/mappingForComptroller.ts index b5d2481..05f39b2 100644 --- a/src/mappingForComptroller.ts +++ b/src/mappingForComptroller.ts @@ -35,6 +35,7 @@ import { } from '../generated/Comptroller/Comptroller' import { + loadOrCreateAccount, // loadOrCreateDripTokenPlayer, loadOrCreateBalanceDripPlayer, loadOrCreateVolumeDripPlayer, @@ -46,6 +47,7 @@ import { loadOrCreateVolumeDrip, loadOrCreateVolumeDripPeriod, } from './helpers/loadOrCreateComptroller' +import { loadOrCreateControlledToken } from './helpers/loadOrCreateControlledToken' @@ -307,10 +309,20 @@ export function handleVolumeDripDripped(event: VolumeDripDripped): void { } export function handleBeforeTokenMint(call: BeforeTokenMintCall): void { - if (call.inputs.referrer === null) { + if (call.inputs.referrer === null || call.inputs.referrer.toHexString() === ZERO_ADDRESS) { return } - const _controlledTokenBalance = ControlledTokenBalance.load(generateCompositeId(call.inputs.to.toHexString(), call.inputs.measure.toHexString())) - _controlledTokenBalance.referrer = call.inputs.referrer - _controlledTokenBalance.save() + + const id = generateCompositeId(call.inputs.to.toHexString(), call.inputs.measure.toHexString()) + + let tokenBalance = ControlledTokenBalance.load(id) + + if (!tokenBalance) { + tokenBalance = new ControlledTokenBalance(id) + tokenBalance.account = loadOrCreateAccount(call.inputs.to).id + tokenBalance.controlledToken = loadOrCreateControlledToken(call.inputs.measure).id + } + + tokenBalance.referrer = call.inputs.referrer + tokenBalance.save() } \ No newline at end of file diff --git a/subgraph.template.yaml b/subgraph.template.yaml index 8671328..3c5c96d 100644 --- a/subgraph.template.yaml +++ b/subgraph.template.yaml @@ -19,6 +19,9 @@ dataSources: abis: - name: Comptroller file: ./abis/v3_1_0/abis/Comptroller.json + callHandlers: + - function: beforeTokenMint(address,uint256,address,address) + handler: handleBeforeTokenMint eventHandlers: - event: OwnershipTransferred(indexed address,indexed address) handler: handleOwnershipTransferred From 3ea6ce451d93617423b7e142fcac869701c9c760 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Fri, 29 Jan 2021 17:45:46 +0800 Subject: [PATCH 3/5] add entities to track when a user enters or exits a pool --- generated/schema.ts | 133 +++++++++++++++++++++++++++ networks/local.json | 52 +++++++---- schema.graphql | 14 +++ src/mappingForComptroller.ts | 2 +- src/mappingForControlledToken.ts | 22 ++++- testquery.gql | 152 ++----------------------------- 6 files changed, 208 insertions(+), 167 deletions(-) diff --git a/generated/schema.ts b/generated/schema.ts index c4d9b88..18a6bb2 100644 --- a/generated/schema.ts +++ b/generated/schema.ts @@ -1635,6 +1635,139 @@ export class ControlledTokenBalance extends Entity { this.set("balance", Value.fromBigInt(value as BigInt)); } } + + get referrer(): Bytes | null { + let value = this.get("referrer"); + if (value === null || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set referrer(value: Bytes | null) { + if (value === null) { + this.unset("referrer"); + } else { + this.set("referrer", Value.fromBytes(value as Bytes)); + } + } +} + +export class EnteredPool extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + } + + save(): void { + let id = this.get("id"); + assert(id !== null, "Cannot save EnteredPool entity without an ID"); + assert( + id.kind == ValueKind.STRING, + "Cannot save EnteredPool entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("EnteredPool", id.toString(), this); + } + + static load(id: string): EnteredPool | null { + return store.get("EnteredPool", id) as EnteredPool | null; + } + + get id(): string { + let value = this.get("id"); + return value.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get controlledToken(): string { + let value = this.get("controlledToken"); + return value.toString(); + } + + set controlledToken(value: string) { + this.set("controlledToken", Value.fromString(value)); + } + + get account(): string { + let value = this.get("account"); + return value.toString(); + } + + set account(value: string) { + this.set("account", Value.fromString(value)); + } + + get timestamp(): BigInt { + let value = this.get("timestamp"); + return value.toBigInt(); + } + + set timestamp(value: BigInt) { + this.set("timestamp", Value.fromBigInt(value)); + } +} + +export class ExitedPool extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + } + + save(): void { + let id = this.get("id"); + assert(id !== null, "Cannot save ExitedPool entity without an ID"); + assert( + id.kind == ValueKind.STRING, + "Cannot save ExitedPool entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("ExitedPool", id.toString(), this); + } + + static load(id: string): ExitedPool | null { + return store.get("ExitedPool", id) as ExitedPool | null; + } + + get id(): string { + let value = this.get("id"); + return value.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get controlledToken(): string { + let value = this.get("controlledToken"); + return value.toString(); + } + + set controlledToken(value: string) { + this.set("controlledToken", Value.fromString(value)); + } + + get account(): string { + let value = this.get("account"); + return value.toString(); + } + + set account(value: string) { + this.set("account", Value.fromString(value)); + } + + get timestamp(): BigInt { + let value = this.get("timestamp"); + return value.toBigInt(); + } + + set timestamp(value: BigInt) { + this.set("timestamp", Value.fromBigInt(value)); + } } export class SingleRandomWinnerExternalErc20Award extends Entity { diff --git a/networks/local.json b/networks/local.json index 5c3a9b2..69550a4 100644 --- a/networks/local.json +++ b/networks/local.json @@ -1,27 +1,47 @@ { "network": "mainnet", - "compoundPrizePoolProxyFactory": { - "address": "0x4DC0a534b596a8c91B91769c2A09315E9Bb6288B", - "startBlock": "1" + "compoundPrizePoolProxyFactory_v3_0_1": { + "address": "0x17CfE08818E8260FAe3a19761668EBc27B24d72A", + "startBlock": "11101023" }, - "singleRandomWinnerProxyFactory": { - "address": "0x1d00e7c992490a839574a05788F7391A9911f7c7", - "startBlock": "1" + "compoundPrizePoolProxyFactory_v3_1_0": { + "address": "0x4e972abb057495635718F416E5836ac516bD2618", + "startBlock": "11428997" + }, + "singleRandomWinnerProxyFactory_v3_0_1": { + "address": "0xc79B5D46f010c88f738A00B3bed7757d04dd2a37", + "startBlock": "11101039" + }, + "singleRandomWinnerProxyFactory_v3_1_0": { + "address": "0xBa49B45Bc5f7e3F23B5d994082038c836895AdfD", + "startBlock": "11429018" }, "comptroller": { - "address": "0x3Aa2b03Bf8B5744f45F867F55c6A143D6A72A8Cf", - "startBlock": "1" + "address": "0x4027dE966127af5F015Ea1cfd6293a3583892668", + "startBlock": "11101017" + }, + "controlledTokenProxyFactory_v3_0_1": { + "address": "0xdd8f31f7B9C6026311464bc07aE5DB2F99F3892e", + "startBlock": "11101028" + }, + "controlledTokenProxyFactory_v3_1_0": { + "address": "0xfB932b0BcFA5208D536600ab23C13Ac55CD69Ba1", + "startBlock": "11429010" + }, + "multipleWinnersProxyFactory_v3_1_0": { + "address": "0x734E677AC3699f63f47c2bAE7a8F3c16aFf5aE70", + "startBlock": "11429015" }, - "multipleWinnersProxyFactory": { - "address": "0xBA42f54497E428b3d41280C39A94ca01830bEA57", - "startBlock": "1" + "ticketProxyFactory_v3_1_0": { + "address": "0xa7d0d3C4f96BB896e0878ef4b83e5cA79700aCB9", + "startBlock": "11429012" }, - "controlledTokenProxyFactory": { - "address": "", - "startBlock": "1" + "ticketProxyFactory_v3_0_1": { + "address": "0x59b34c5BC94e2d5b9DcB97Ec935c94C353E5Eb94", + "startBlock": "11101030" }, "stakePrizePoolProxyFactory_v3_1_0": { - "address": "", - "startBlock": "" + "address": "0x3b694ce9d12F0bF032bF002b3b0473Cb58bbe3F0", + "startBlock": "11429013" } } \ No newline at end of file diff --git a/schema.graphql b/schema.graphql index b02f49f..841bcf8 100644 --- a/schema.graphql +++ b/schema.graphql @@ -214,6 +214,20 @@ type ControlledTokenBalance @entity { referrer: Bytes } +type EnteredPool @entity { + id: ID! # transaction hash + controlledToken: ControlledToken! + account: Account! + timestamp: BigInt! +} + +type ExitedPool @entity { + id: ID! # transaction hash + controlledToken: ControlledToken! + account: Account! + timestamp: BigInt! +} + # ID: `${prizeStrategy.address}-${token.address}` # dynamically generated type, not mapped to a specific contract type SingleRandomWinnerExternalErc20Award @entity { diff --git a/src/mappingForComptroller.ts b/src/mappingForComptroller.ts index 05f39b2..e57e13d 100644 --- a/src/mappingForComptroller.ts +++ b/src/mappingForComptroller.ts @@ -309,7 +309,7 @@ export function handleVolumeDripDripped(event: VolumeDripDripped): void { } export function handleBeforeTokenMint(call: BeforeTokenMintCall): void { - if (call.inputs.referrer === null || call.inputs.referrer.toHexString() === ZERO_ADDRESS) { + if (call.inputs.referrer.equals(null) || call.inputs.referrer.toHexString() === ZERO_ADDRESS) { return } diff --git a/src/mappingForControlledToken.ts b/src/mappingForControlledToken.ts index 2d6e057..75cc457 100644 --- a/src/mappingForControlledToken.ts +++ b/src/mappingForControlledToken.ts @@ -5,7 +5,7 @@ import { } from '../generated/templates/ControlledToken/ControlledToken' import { - ControlledTokenBalance, + ControlledTokenBalance, EnteredPool, ExitedPool, } from '../generated/schema' import { loadOrCreateAccount } from './helpers/loadOrCreateAccount' import { loadOrCreateControlledToken } from './helpers/loadOrCreateControlledToken' @@ -26,13 +26,20 @@ export function handleTransfer(event: Transfer): void { else{ let toBalance = ControlledTokenBalance.load(generateCompositeId (event.params.to.toHexString(), event.address.toHexString())) // controlledtokenbalance id = (address, controlledToken) - if(toBalance == null) {// create case + if(toBalance == null || toBalance.balance.equals(ZERO)) {// create case toBalance = new ControlledTokenBalance(generateCompositeId (event.params.to.toHexString(), event.address.toHexString())) controlledToken.numberOfHolders = controlledToken.numberOfHolders.plus(ONE) // if transfer is to NEW address then increment number of players toBalance.balance = event.params.value toBalance.controlledToken = controlledToken.id // or event.address toBalance.account = loadOrCreateAccount(event.params.to).id + + // Log when user as entered the pool + const enteredPool = new EnteredPool(event.transaction.hash.toHexString()) + enteredPool.controlledToken = controlledToken.id + enteredPool.account = toBalance.account + enteredPool.timestamp = event.block.timestamp + enteredPool.save() } else{ toBalance.balance = toBalance.balance.plus(event.params.value) @@ -49,9 +56,16 @@ export function handleTransfer(event: Transfer): void { fromBalance.balance = fromBalance.balance.minus(event.params.value) // if the balance of the sending account is zero then remove it - if(fromBalance.balance.equals(ZERO)){ + if (fromBalance.balance.equals(ZERO)) { + // Log when user has exited the pool + const exitedPool = new ExitedPool(event.transaction.hash.toHexString()) + exitedPool.controlledToken = controlledToken.id + exitedPool.account = fromBalance.account + exitedPool.timestamp = event.block.timestamp + exitedPool.save() + controlledToken.numberOfHolders = controlledToken.numberOfHolders.minus(ONE) // if account balance depleted decrement player count - store.remove("ControlledTokenBalance", fromBalance.id) + store.remove("ControlledTokenBalance", fromBalance.id) } else{ fromBalance.save() diff --git a/testquery.gql b/testquery.gql index fe3c1ef..3f54581 100644 --- a/testquery.gql +++ b/testquery.gql @@ -1,153 +1,13 @@ { - comptrollers { + controlledTokenBalances { id - owner - - balanceDrips { + referrer + account { id - measureToken - dripToken - - dripRatePerSecond - exchangeRateMantissa - timestamp - - players { - address - } } - volumeDrips { + controlledToken { id - measureToken - dripToken - dripAmount - - deactivated - referral - - periodSeconds - periodCount - periods { - id - periodIndex - totalSupply - dripAmount - endTime - isDripping - } - deposits { - id - address - periodIndex - balance - } } + balance } - - prizePools { - id - deactivated - owner - - prizePoolType - compoundPrizePool { - id - cToken - } - - reserveFeeControlledToken - - underlyingCollateralToken - underlyingCollateralName - underlyingCollateralSymbol - underlyingCollateralDecimals - - maxExitFeeMantissa - maxTimelockDuration - timelockTotalSupply - liquidityCap - - currentPrizeId - currentState - - cumulativePrizeNet - cumulativePrizeGross - cumulativePrizeReserveFee - - prizeStrategy { - singleRandomWinner { - id - owner - rng - - ticket { - id - type - name - symbol - decimals - totalSupply - } - sponsorship { - id - type - name - symbol - decimals - totalSupply - } - - prizePeriodSeconds - prizePeriodStartedAt - prizePeriodEndAt - - externalErc20Awards { - address - } - externalErc721Awards { - address - tokenIds - } - } - } - - totalSupply - totalSponsorship - - playerCount - players { - id - address - balance - timelockedBalance - unlockTimestamp - cumulativeWinnings - } - - prizes { - id - awardedBlock - randomNumber - amount - totalTicketSupply - winners - } - - tokenCreditRates { - creditRateMantissa - creditLimitMantissa - } - - tokenCreditBalances { - balance - timestamp - initialized - } - - sponsors { - id - address - balance - } - } -} +} \ No newline at end of file From 08c128ad2528398bf925b907fdb90aca77c88eaf Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Sat, 30 Jan 2021 17:45:16 +0800 Subject: [PATCH 4/5] update mappings and create mint/burn entities --- generated/Comptroller/Comptroller.ts | 1914 -------------- .../CompoundPrizePool/CompoundPrizePool.ts | 2189 ----------------- .../CompoundPrizePool/ControlledToken.ts | 672 ----- .../templates/CompoundPrizePool/PrizePool.ts | 2108 ---------------- .../ControlledToken/ControlledToken.ts | 672 ----- .../SingleRandomWinner/Comptroller.ts | 1914 -------------- .../SingleRandomWinner/ControlledToken.ts | 672 ----- .../templates/SingleRandomWinner/ERC20.ts | 706 ------ .../templates/SingleRandomWinner/PrizePool.ts | 2108 ---------------- .../SingleRandomWinner/RNGInterface.ts | 294 --- .../SingleRandomWinner/SingleRandomWinner.ts | 1496 ----------- schema.graphql | 12 +- src/mappingForComptroller.ts | 24 +- src/mappingForControlledToken.ts | 27 +- testquery.gql | 4 +- 15 files changed, 28 insertions(+), 14784 deletions(-) delete mode 100644 generated/Comptroller/Comptroller.ts delete mode 100644 generated/templates/CompoundPrizePool/CompoundPrizePool.ts delete mode 100644 generated/templates/CompoundPrizePool/ControlledToken.ts delete mode 100644 generated/templates/CompoundPrizePool/PrizePool.ts delete mode 100644 generated/templates/ControlledToken/ControlledToken.ts delete mode 100644 generated/templates/SingleRandomWinner/Comptroller.ts delete mode 100644 generated/templates/SingleRandomWinner/ControlledToken.ts delete mode 100644 generated/templates/SingleRandomWinner/ERC20.ts delete mode 100644 generated/templates/SingleRandomWinner/PrizePool.ts delete mode 100644 generated/templates/SingleRandomWinner/RNGInterface.ts delete mode 100644 generated/templates/SingleRandomWinner/SingleRandomWinner.ts diff --git a/generated/Comptroller/Comptroller.ts b/generated/Comptroller/Comptroller.ts deleted file mode 100644 index 391003b..0000000 --- a/generated/Comptroller/Comptroller.ts +++ /dev/null @@ -1,1914 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - ethereum, - JSONValue, - TypedMap, - Entity, - Bytes, - Address, - BigInt -} from "@graphprotocol/graph-ts"; - -export class BalanceDripActivated extends ethereum.Event { - get params(): BalanceDripActivated__Params { - return new BalanceDripActivated__Params(this); - } -} - -export class BalanceDripActivated__Params { - _event: BalanceDripActivated; - - constructor(event: BalanceDripActivated) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get dripRatePerSecond(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BalanceDripDeactivated extends ethereum.Event { - get params(): BalanceDripDeactivated__Params { - return new BalanceDripDeactivated__Params(this); - } -} - -export class BalanceDripDeactivated__Params { - _event: BalanceDripDeactivated; - - constructor(event: BalanceDripDeactivated) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } -} - -export class BalanceDripDripped extends ethereum.Event { - get params(): BalanceDripDripped__Params { - return new BalanceDripDripped__Params(this); - } -} - -export class BalanceDripDripped__Params { - _event: BalanceDripDripped; - - constructor(event: BalanceDripDripped) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get user(): Address { - return this._event.parameters[3].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class BalanceDripRateSet extends ethereum.Event { - get params(): BalanceDripRateSet__Params { - return new BalanceDripRateSet__Params(this); - } -} - -export class BalanceDripRateSet__Params { - _event: BalanceDripRateSet; - - constructor(event: BalanceDripRateSet) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get dripRatePerSecond(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class DripTokenClaimed extends ethereum.Event { - get params(): DripTokenClaimed__Params { - return new DripTokenClaimed__Params(this); - } -} - -export class DripTokenClaimed__Params { - _event: DripTokenClaimed; - - constructor(event: DripTokenClaimed) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get user(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class DripTokenDripped extends ethereum.Event { - get params(): DripTokenDripped__Params { - return new DripTokenDripped__Params(this); - } -} - -export class DripTokenDripped__Params { - _event: DripTokenDripped; - - constructor(event: DripTokenDripped) { - this._event = event; - } - - get dripToken(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get user(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class TransferredOut extends ethereum.Event { - get params(): TransferredOut__Params { - return new TransferredOut__Params(this); - } -} - -export class TransferredOut__Params { - _event: TransferredOut; - - constructor(event: TransferredOut) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class VolumeDripActivated extends ethereum.Event { - get params(): VolumeDripActivated__Params { - return new VolumeDripActivated__Params(this); - } -} - -export class VolumeDripActivated__Params { - _event: VolumeDripActivated; - - constructor(event: VolumeDripActivated) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get isReferral(): boolean { - return this._event.parameters[3].value.toBoolean(); - } - - get periodSeconds(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get dripAmount(): BigInt { - return this._event.parameters[5].value.toBigInt(); - } -} - -export class VolumeDripDeactivated extends ethereum.Event { - get params(): VolumeDripDeactivated__Params { - return new VolumeDripDeactivated__Params(this); - } -} - -export class VolumeDripDeactivated__Params { - _event: VolumeDripDeactivated; - - constructor(event: VolumeDripDeactivated) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get isReferral(): boolean { - return this._event.parameters[3].value.toBoolean(); - } -} - -export class VolumeDripDripped extends ethereum.Event { - get params(): VolumeDripDripped__Params { - return new VolumeDripDripped__Params(this); - } -} - -export class VolumeDripDripped__Params { - _event: VolumeDripDripped; - - constructor(event: VolumeDripDripped) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get isReferral(): boolean { - return this._event.parameters[3].value.toBoolean(); - } - - get user(): Address { - return this._event.parameters[4].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[5].value.toBigInt(); - } -} - -export class VolumeDripPeriodEnded extends ethereum.Event { - get params(): VolumeDripPeriodEnded__Params { - return new VolumeDripPeriodEnded__Params(this); - } -} - -export class VolumeDripPeriodEnded__Params { - _event: VolumeDripPeriodEnded; - - constructor(event: VolumeDripPeriodEnded) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get isReferral(): boolean { - return this._event.parameters[3].value.toBoolean(); - } - - get period(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get totalSupply(): BigInt { - return this._event.parameters[5].value.toBigInt(); - } - - get drippedTokens(): BigInt { - return this._event.parameters[6].value.toBigInt(); - } -} - -export class VolumeDripPeriodStarted extends ethereum.Event { - get params(): VolumeDripPeriodStarted__Params { - return new VolumeDripPeriodStarted__Params(this); - } -} - -export class VolumeDripPeriodStarted__Params { - _event: VolumeDripPeriodStarted; - - constructor(event: VolumeDripPeriodStarted) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get isReferral(): boolean { - return this._event.parameters[3].value.toBoolean(); - } - - get period(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get dripAmount(): BigInt { - return this._event.parameters[5].value.toBigInt(); - } - - get endTime(): BigInt { - return this._event.parameters[6].value.toBigInt(); - } -} - -export class VolumeDripSet extends ethereum.Event { - get params(): VolumeDripSet__Params { - return new VolumeDripSet__Params(this); - } -} - -export class VolumeDripSet__Params { - _event: VolumeDripSet; - - constructor(event: VolumeDripSet) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get isReferral(): boolean { - return this._event.parameters[3].value.toBoolean(); - } - - get periodSeconds(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get dripAmount(): BigInt { - return this._event.parameters[5].value.toBigInt(); - } -} - -export class Comptroller__balanceOfClaimsResultValue0Struct extends ethereum.Tuple { - get dripToken(): Address { - return this[0].toAddress(); - } - - get balance(): BigInt { - return this[1].toBigInt(); - } -} - -export class Comptroller__getBalanceDripResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } -} - -export class Comptroller__getVolumeDripResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } -} - -export class Comptroller__getVolumeDripPeriodResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } -} - -export class Comptroller__updateAndClaimDripsResultValue0Struct extends ethereum.Tuple { - get dripToken(): Address { - return this[0].toAddress(); - } - - get balance(): BigInt { - return this[1].toBigInt(); - } -} - -export class Comptroller__updateAndClaimDripsInputPairsStruct extends ethereum.Tuple { - get source(): Address { - return this[0].toAddress(); - } - - get measure(): Address { - return this[1].toAddress(); - } -} - -export class Comptroller__updateDripsResultValue0Struct extends ethereum.Tuple { - get dripToken(): Address { - return this[0].toAddress(); - } - - get balance(): BigInt { - return this[1].toBigInt(); - } -} - -export class Comptroller__updateDripsInputPairsStruct extends ethereum.Tuple { - get source(): Address { - return this[0].toAddress(); - } - - get measure(): Address { - return this[1].toAddress(); - } -} - -export class Comptroller extends ethereum.SmartContract { - static bind(address: Address): Comptroller { - return new Comptroller("Comptroller", address); - } - - balanceOfClaims( - user: Address, - dripTokens: Array
- ): Array { - let result = super.call( - "balanceOfClaims", - "balanceOfClaims(address,address[]):((address,uint256)[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(dripTokens) - ] - ); - - return result[0].toTupleArray< - Comptroller__balanceOfClaimsResultValue0Struct - >(); - } - - try_balanceOfClaims( - user: Address, - dripTokens: Array
- ): ethereum.CallResult< - Array - > { - let result = super.tryCall( - "balanceOfClaims", - "balanceOfClaims(address,address[]):((address,uint256)[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(dripTokens) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - value[0].toTupleArray() - ); - } - - balanceOfDrip(user: Address, dripToken: Address): BigInt { - let result = super.call( - "balanceOfDrip", - "balanceOfDrip(address,address):(uint256)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(dripToken)] - ); - - return result[0].toBigInt(); - } - - try_balanceOfDrip( - user: Address, - dripToken: Address - ): ethereum.CallResult { - let result = super.tryCall( - "balanceOfDrip", - "balanceOfDrip(address,address):(uint256)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(dripToken)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getActiveBalanceDripTokens( - source: Address, - measure: Address - ): Array
{ - let result = super.call( - "getActiveBalanceDripTokens", - "getActiveBalanceDripTokens(address,address):(address[])", - [ethereum.Value.fromAddress(source), ethereum.Value.fromAddress(measure)] - ); - - return result[0].toAddressArray(); - } - - try_getActiveBalanceDripTokens( - source: Address, - measure: Address - ): ethereum.CallResult> { - let result = super.tryCall( - "getActiveBalanceDripTokens", - "getActiveBalanceDripTokens(address,address):(address[])", - [ethereum.Value.fromAddress(source), ethereum.Value.fromAddress(measure)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddressArray()); - } - - getActiveVolumeDripTokens( - source: Address, - measure: Address, - isReferral: boolean - ): Array
{ - let result = super.call( - "getActiveVolumeDripTokens", - "getActiveVolumeDripTokens(address,address,bool):(address[])", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromBoolean(isReferral) - ] - ); - - return result[0].toAddressArray(); - } - - try_getActiveVolumeDripTokens( - source: Address, - measure: Address, - isReferral: boolean - ): ethereum.CallResult> { - let result = super.tryCall( - "getActiveVolumeDripTokens", - "getActiveVolumeDripTokens(address,address,bool):(address[])", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromBoolean(isReferral) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddressArray()); - } - - getBalanceDrip( - source: Address, - measure: Address, - dripToken: Address - ): Comptroller__getBalanceDripResult { - let result = super.call( - "getBalanceDrip", - "getBalanceDrip(address,address,address):(uint256,uint128,uint32)", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromAddress(dripToken) - ] - ); - - return new Comptroller__getBalanceDripResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getBalanceDrip( - source: Address, - measure: Address, - dripToken: Address - ): ethereum.CallResult { - let result = super.tryCall( - "getBalanceDrip", - "getBalanceDrip(address,address,address):(uint256,uint128,uint32)", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromAddress(dripToken) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new Comptroller__getBalanceDripResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getVolumeDrip( - source: Address, - measure: Address, - dripToken: Address, - isReferral: boolean - ): Comptroller__getVolumeDripResult { - let result = super.call( - "getVolumeDrip", - "getVolumeDrip(address,address,address,bool):(uint256,uint256,uint256)", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromAddress(dripToken), - ethereum.Value.fromBoolean(isReferral) - ] - ); - - return new Comptroller__getVolumeDripResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getVolumeDrip( - source: Address, - measure: Address, - dripToken: Address, - isReferral: boolean - ): ethereum.CallResult { - let result = super.tryCall( - "getVolumeDrip", - "getVolumeDrip(address,address,address,bool):(uint256,uint256,uint256)", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromAddress(dripToken), - ethereum.Value.fromBoolean(isReferral) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new Comptroller__getVolumeDripResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getVolumeDripPeriod( - source: Address, - measure: Address, - dripToken: Address, - isReferral: boolean, - period: i32 - ): Comptroller__getVolumeDripPeriodResult { - let result = super.call( - "getVolumeDripPeriod", - "getVolumeDripPeriod(address,address,address,bool,uint16):(uint112,uint112,uint32)", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromAddress(dripToken), - ethereum.Value.fromBoolean(isReferral), - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(period)) - ] - ); - - return new Comptroller__getVolumeDripPeriodResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getVolumeDripPeriod( - source: Address, - measure: Address, - dripToken: Address, - isReferral: boolean, - period: i32 - ): ethereum.CallResult { - let result = super.tryCall( - "getVolumeDripPeriod", - "getVolumeDripPeriod(address,address,address,bool,uint16):(uint112,uint112,uint32)", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromAddress(dripToken), - ethereum.Value.fromBoolean(isReferral), - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(period)) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new Comptroller__getVolumeDripPeriodResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - isVolumeDripActive( - source: Address, - measure: Address, - dripToken: Address, - isReferral: boolean - ): boolean { - let result = super.call( - "isVolumeDripActive", - "isVolumeDripActive(address,address,address,bool):(bool)", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromAddress(dripToken), - ethereum.Value.fromBoolean(isReferral) - ] - ); - - return result[0].toBoolean(); - } - - try_isVolumeDripActive( - source: Address, - measure: Address, - dripToken: Address, - isReferral: boolean - ): ethereum.CallResult { - let result = super.tryCall( - "isVolumeDripActive", - "isVolumeDripActive(address,address,address,bool):(bool)", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromAddress(dripToken), - ethereum.Value.fromBoolean(isReferral) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - owner(): Address { - let result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - let result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - supportsInterface(interfaceId: Bytes): boolean { - let result = super.call( - "supportsInterface", - "supportsInterface(bytes4):(bool)", - [ethereum.Value.fromFixedBytes(interfaceId)] - ); - - return result[0].toBoolean(); - } - - try_supportsInterface(interfaceId: Bytes): ethereum.CallResult { - let result = super.tryCall( - "supportsInterface", - "supportsInterface(bytes4):(bool)", - [ethereum.Value.fromFixedBytes(interfaceId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - updateAndClaimDrips( - pairs: Array, - user: Address, - dripTokens: Array
- ): Array { - let result = super.call( - "updateAndClaimDrips", - "updateAndClaimDrips((address,address)[],address,address[]):((address,uint256)[])", - [ - ethereum.Value.fromTupleArray(pairs), - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(dripTokens) - ] - ); - - return result[0].toTupleArray< - Comptroller__updateAndClaimDripsResultValue0Struct - >(); - } - - try_updateAndClaimDrips( - pairs: Array, - user: Address, - dripTokens: Array
- ): ethereum.CallResult< - Array - > { - let result = super.tryCall( - "updateAndClaimDrips", - "updateAndClaimDrips((address,address)[],address,address[]):((address,uint256)[])", - [ - ethereum.Value.fromTupleArray(pairs), - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(dripTokens) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - value[0].toTupleArray< - Comptroller__updateAndClaimDripsResultValue0Struct - >() - ); - } - - updateDrips( - pairs: Array, - user: Address, - dripTokens: Array
- ): Array { - let result = super.call( - "updateDrips", - "updateDrips((address,address)[],address,address[]):((address,uint256)[])", - [ - ethereum.Value.fromTupleArray(pairs), - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(dripTokens) - ] - ); - - return result[0].toTupleArray(); - } - - try_updateDrips( - pairs: Array, - user: Address, - dripTokens: Array
- ): ethereum.CallResult> { - let result = super.tryCall( - "updateDrips", - "updateDrips((address,address)[],address,address[]):((address,uint256)[])", - [ - ethereum.Value.fromTupleArray(pairs), - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(dripTokens) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - value[0].toTupleArray() - ); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ActivateBalanceDripCall extends ethereum.Call { - get inputs(): ActivateBalanceDripCall__Inputs { - return new ActivateBalanceDripCall__Inputs(this); - } - - get outputs(): ActivateBalanceDripCall__Outputs { - return new ActivateBalanceDripCall__Outputs(this); - } -} - -export class ActivateBalanceDripCall__Inputs { - _call: ActivateBalanceDripCall; - - constructor(call: ActivateBalanceDripCall) { - this._call = call; - } - - get source(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get measure(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get dripToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get dripRatePerSecond(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class ActivateBalanceDripCall__Outputs { - _call: ActivateBalanceDripCall; - - constructor(call: ActivateBalanceDripCall) { - this._call = call; - } -} - -export class ActivateVolumeDripCall extends ethereum.Call { - get inputs(): ActivateVolumeDripCall__Inputs { - return new ActivateVolumeDripCall__Inputs(this); - } - - get outputs(): ActivateVolumeDripCall__Outputs { - return new ActivateVolumeDripCall__Outputs(this); - } -} - -export class ActivateVolumeDripCall__Inputs { - _call: ActivateVolumeDripCall; - - constructor(call: ActivateVolumeDripCall) { - this._call = call; - } - - get source(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get measure(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get dripToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get isReferral(): boolean { - return this._call.inputValues[3].value.toBoolean(); - } - - get periodSeconds(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get dripAmount(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get endTime(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } -} - -export class ActivateVolumeDripCall__Outputs { - _call: ActivateVolumeDripCall; - - constructor(call: ActivateVolumeDripCall) { - this._call = call; - } -} - -export class BeforeTokenMintCall extends ethereum.Call { - get inputs(): BeforeTokenMintCall__Inputs { - return new BeforeTokenMintCall__Inputs(this); - } - - get outputs(): BeforeTokenMintCall__Outputs { - return new BeforeTokenMintCall__Outputs(this); - } -} - -export class BeforeTokenMintCall__Inputs { - _call: BeforeTokenMintCall; - - constructor(call: BeforeTokenMintCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get measure(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get referrer(): Address { - return this._call.inputValues[3].value.toAddress(); - } -} - -export class BeforeTokenMintCall__Outputs { - _call: BeforeTokenMintCall; - - constructor(call: BeforeTokenMintCall) { - this._call = call; - } -} - -export class BeforeTokenTransferCall extends ethereum.Call { - get inputs(): BeforeTokenTransferCall__Inputs { - return new BeforeTokenTransferCall__Inputs(this); - } - - get outputs(): BeforeTokenTransferCall__Outputs { - return new BeforeTokenTransferCall__Outputs(this); - } -} - -export class BeforeTokenTransferCall__Inputs { - _call: BeforeTokenTransferCall; - - constructor(call: BeforeTokenTransferCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value2(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get measure(): Address { - return this._call.inputValues[3].value.toAddress(); - } -} - -export class BeforeTokenTransferCall__Outputs { - _call: BeforeTokenTransferCall; - - constructor(call: BeforeTokenTransferCall) { - this._call = call; - } -} - -export class CaptureClaimsForBalanceDripsForPairsCall extends ethereum.Call { - get inputs(): CaptureClaimsForBalanceDripsForPairsCall__Inputs { - return new CaptureClaimsForBalanceDripsForPairsCall__Inputs(this); - } - - get outputs(): CaptureClaimsForBalanceDripsForPairsCall__Outputs { - return new CaptureClaimsForBalanceDripsForPairsCall__Outputs(this); - } -} - -export class CaptureClaimsForBalanceDripsForPairsCall__Inputs { - _call: CaptureClaimsForBalanceDripsForPairsCall; - - constructor(call: CaptureClaimsForBalanceDripsForPairsCall) { - this._call = call; - } - - get pairs(): Array { - return this._call.inputValues[0].value.toTupleArray< - CaptureClaimsForBalanceDripsForPairsCallPairsStruct - >(); - } - - get user(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get dripTokens(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } -} - -export class CaptureClaimsForBalanceDripsForPairsCall__Outputs { - _call: CaptureClaimsForBalanceDripsForPairsCall; - - constructor(call: CaptureClaimsForBalanceDripsForPairsCall) { - this._call = call; - } -} - -export class CaptureClaimsForBalanceDripsForPairsCallPairsStruct extends ethereum.Tuple { - get source(): Address { - return this[0].toAddress(); - } - - get measure(): Address { - return this[1].toAddress(); - } -} - -export class ClaimDripCall extends ethereum.Call { - get inputs(): ClaimDripCall__Inputs { - return new ClaimDripCall__Inputs(this); - } - - get outputs(): ClaimDripCall__Outputs { - return new ClaimDripCall__Outputs(this); - } -} - -export class ClaimDripCall__Inputs { - _call: ClaimDripCall; - - constructor(call: ClaimDripCall) { - this._call = call; - } - - get user(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get dripToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class ClaimDripCall__Outputs { - _call: ClaimDripCall; - - constructor(call: ClaimDripCall) { - this._call = call; - } -} - -export class ClaimDripsCall extends ethereum.Call { - get inputs(): ClaimDripsCall__Inputs { - return new ClaimDripsCall__Inputs(this); - } - - get outputs(): ClaimDripsCall__Outputs { - return new ClaimDripsCall__Outputs(this); - } -} - -export class ClaimDripsCall__Inputs { - _call: ClaimDripsCall; - - constructor(call: ClaimDripsCall) { - this._call = call; - } - - get user(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get dripTokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } -} - -export class ClaimDripsCall__Outputs { - _call: ClaimDripsCall; - - constructor(call: ClaimDripsCall) { - this._call = call; - } -} - -export class DeactivateBalanceDripCall extends ethereum.Call { - get inputs(): DeactivateBalanceDripCall__Inputs { - return new DeactivateBalanceDripCall__Inputs(this); - } - - get outputs(): DeactivateBalanceDripCall__Outputs { - return new DeactivateBalanceDripCall__Outputs(this); - } -} - -export class DeactivateBalanceDripCall__Inputs { - _call: DeactivateBalanceDripCall; - - constructor(call: DeactivateBalanceDripCall) { - this._call = call; - } - - get source(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get measure(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get dripToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get prevDripToken(): Address { - return this._call.inputValues[3].value.toAddress(); - } -} - -export class DeactivateBalanceDripCall__Outputs { - _call: DeactivateBalanceDripCall; - - constructor(call: DeactivateBalanceDripCall) { - this._call = call; - } -} - -export class DeactivateVolumeDripCall extends ethereum.Call { - get inputs(): DeactivateVolumeDripCall__Inputs { - return new DeactivateVolumeDripCall__Inputs(this); - } - - get outputs(): DeactivateVolumeDripCall__Outputs { - return new DeactivateVolumeDripCall__Outputs(this); - } -} - -export class DeactivateVolumeDripCall__Inputs { - _call: DeactivateVolumeDripCall; - - constructor(call: DeactivateVolumeDripCall) { - this._call = call; - } - - get source(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get measure(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get dripToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get isReferral(): boolean { - return this._call.inputValues[3].value.toBoolean(); - } - - get prevDripToken(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class DeactivateVolumeDripCall__Outputs { - _call: DeactivateVolumeDripCall; - - constructor(call: DeactivateVolumeDripCall) { - this._call = call; - } -} - -export class MintAndCaptureVolumeDripsForPairsCall extends ethereum.Call { - get inputs(): MintAndCaptureVolumeDripsForPairsCall__Inputs { - return new MintAndCaptureVolumeDripsForPairsCall__Inputs(this); - } - - get outputs(): MintAndCaptureVolumeDripsForPairsCall__Outputs { - return new MintAndCaptureVolumeDripsForPairsCall__Outputs(this); - } -} - -export class MintAndCaptureVolumeDripsForPairsCall__Inputs { - _call: MintAndCaptureVolumeDripsForPairsCall; - - constructor(call: MintAndCaptureVolumeDripsForPairsCall) { - this._call = call; - } - - get pairs(): Array { - return this._call.inputValues[0].value.toTupleArray< - MintAndCaptureVolumeDripsForPairsCallPairsStruct - >(); - } - - get user(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get dripTokens(): Array
{ - return this._call.inputValues[3].value.toAddressArray(); - } -} - -export class MintAndCaptureVolumeDripsForPairsCall__Outputs { - _call: MintAndCaptureVolumeDripsForPairsCall; - - constructor(call: MintAndCaptureVolumeDripsForPairsCall) { - this._call = call; - } -} - -export class MintAndCaptureVolumeDripsForPairsCallPairsStruct extends ethereum.Tuple { - get source(): Address { - return this[0].toAddress(); - } - - get measure(): Address { - return this[1].toAddress(); - } -} - -export class RenounceOwnershipCall extends ethereum.Call { - get inputs(): RenounceOwnershipCall__Inputs { - return new RenounceOwnershipCall__Inputs(this); - } - - get outputs(): RenounceOwnershipCall__Outputs { - return new RenounceOwnershipCall__Outputs(this); - } -} - -export class RenounceOwnershipCall__Inputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall__Outputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class SetBalanceDripRateCall extends ethereum.Call { - get inputs(): SetBalanceDripRateCall__Inputs { - return new SetBalanceDripRateCall__Inputs(this); - } - - get outputs(): SetBalanceDripRateCall__Outputs { - return new SetBalanceDripRateCall__Outputs(this); - } -} - -export class SetBalanceDripRateCall__Inputs { - _call: SetBalanceDripRateCall; - - constructor(call: SetBalanceDripRateCall) { - this._call = call; - } - - get source(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get measure(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get dripToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get dripRatePerSecond(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetBalanceDripRateCall__Outputs { - _call: SetBalanceDripRateCall; - - constructor(call: SetBalanceDripRateCall) { - this._call = call; - } -} - -export class SetVolumeDripCall extends ethereum.Call { - get inputs(): SetVolumeDripCall__Inputs { - return new SetVolumeDripCall__Inputs(this); - } - - get outputs(): SetVolumeDripCall__Outputs { - return new SetVolumeDripCall__Outputs(this); - } -} - -export class SetVolumeDripCall__Inputs { - _call: SetVolumeDripCall; - - constructor(call: SetVolumeDripCall) { - this._call = call; - } - - get source(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get measure(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get dripToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get isReferral(): boolean { - return this._call.inputValues[3].value.toBoolean(); - } - - get periodSeconds(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get dripAmount(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } -} - -export class SetVolumeDripCall__Outputs { - _call: SetVolumeDripCall; - - constructor(call: SetVolumeDripCall) { - this._call = call; - } -} - -export class TransferOutCall extends ethereum.Call { - get inputs(): TransferOutCall__Inputs { - return new TransferOutCall__Inputs(this); - } - - get outputs(): TransferOutCall__Outputs { - return new TransferOutCall__Outputs(this); - } -} - -export class TransferOutCall__Inputs { - _call: TransferOutCall; - - constructor(call: TransferOutCall) { - this._call = call; - } - - get token(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferOutCall__Outputs { - _call: TransferOutCall; - - constructor(call: TransferOutCall) { - this._call = call; - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get newOwner(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} - -export class UpdateActiveBalanceDripsForPairsCall extends ethereum.Call { - get inputs(): UpdateActiveBalanceDripsForPairsCall__Inputs { - return new UpdateActiveBalanceDripsForPairsCall__Inputs(this); - } - - get outputs(): UpdateActiveBalanceDripsForPairsCall__Outputs { - return new UpdateActiveBalanceDripsForPairsCall__Outputs(this); - } -} - -export class UpdateActiveBalanceDripsForPairsCall__Inputs { - _call: UpdateActiveBalanceDripsForPairsCall; - - constructor(call: UpdateActiveBalanceDripsForPairsCall) { - this._call = call; - } - - get pairs(): Array { - return this._call.inputValues[0].value.toTupleArray< - UpdateActiveBalanceDripsForPairsCallPairsStruct - >(); - } -} - -export class UpdateActiveBalanceDripsForPairsCall__Outputs { - _call: UpdateActiveBalanceDripsForPairsCall; - - constructor(call: UpdateActiveBalanceDripsForPairsCall) { - this._call = call; - } -} - -export class UpdateActiveBalanceDripsForPairsCallPairsStruct extends ethereum.Tuple { - get source(): Address { - return this[0].toAddress(); - } - - get measure(): Address { - return this[1].toAddress(); - } -} - -export class UpdateActiveVolumeDripsForPairsCall extends ethereum.Call { - get inputs(): UpdateActiveVolumeDripsForPairsCall__Inputs { - return new UpdateActiveVolumeDripsForPairsCall__Inputs(this); - } - - get outputs(): UpdateActiveVolumeDripsForPairsCall__Outputs { - return new UpdateActiveVolumeDripsForPairsCall__Outputs(this); - } -} - -export class UpdateActiveVolumeDripsForPairsCall__Inputs { - _call: UpdateActiveVolumeDripsForPairsCall; - - constructor(call: UpdateActiveVolumeDripsForPairsCall) { - this._call = call; - } - - get pairs(): Array { - return this._call.inputValues[0].value.toTupleArray< - UpdateActiveVolumeDripsForPairsCallPairsStruct - >(); - } -} - -export class UpdateActiveVolumeDripsForPairsCall__Outputs { - _call: UpdateActiveVolumeDripsForPairsCall; - - constructor(call: UpdateActiveVolumeDripsForPairsCall) { - this._call = call; - } -} - -export class UpdateActiveVolumeDripsForPairsCallPairsStruct extends ethereum.Tuple { - get source(): Address { - return this[0].toAddress(); - } - - get measure(): Address { - return this[1].toAddress(); - } -} - -export class UpdateAndClaimDripsCall extends ethereum.Call { - get inputs(): UpdateAndClaimDripsCall__Inputs { - return new UpdateAndClaimDripsCall__Inputs(this); - } - - get outputs(): UpdateAndClaimDripsCall__Outputs { - return new UpdateAndClaimDripsCall__Outputs(this); - } -} - -export class UpdateAndClaimDripsCall__Inputs { - _call: UpdateAndClaimDripsCall; - - constructor(call: UpdateAndClaimDripsCall) { - this._call = call; - } - - get pairs(): Array { - return this._call.inputValues[0].value.toTupleArray< - UpdateAndClaimDripsCallPairsStruct - >(); - } - - get user(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get dripTokens(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } -} - -export class UpdateAndClaimDripsCall__Outputs { - _call: UpdateAndClaimDripsCall; - - constructor(call: UpdateAndClaimDripsCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toTupleArray< - UpdateAndClaimDripsCallValue0Struct - >(); - } -} - -export class UpdateAndClaimDripsCallPairsStruct extends ethereum.Tuple { - get source(): Address { - return this[0].toAddress(); - } - - get measure(): Address { - return this[1].toAddress(); - } -} - -export class UpdateAndClaimDripsCallValue0Struct extends ethereum.Tuple { - get dripToken(): Address { - return this[0].toAddress(); - } - - get balance(): BigInt { - return this[1].toBigInt(); - } -} - -export class UpdateDripsCall extends ethereum.Call { - get inputs(): UpdateDripsCall__Inputs { - return new UpdateDripsCall__Inputs(this); - } - - get outputs(): UpdateDripsCall__Outputs { - return new UpdateDripsCall__Outputs(this); - } -} - -export class UpdateDripsCall__Inputs { - _call: UpdateDripsCall; - - constructor(call: UpdateDripsCall) { - this._call = call; - } - - get pairs(): Array { - return this._call.inputValues[0].value.toTupleArray< - UpdateDripsCallPairsStruct - >(); - } - - get user(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get dripTokens(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } -} - -export class UpdateDripsCall__Outputs { - _call: UpdateDripsCall; - - constructor(call: UpdateDripsCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toTupleArray< - UpdateDripsCallValue0Struct - >(); - } -} - -export class UpdateDripsCallPairsStruct extends ethereum.Tuple { - get source(): Address { - return this[0].toAddress(); - } - - get measure(): Address { - return this[1].toAddress(); - } -} - -export class UpdateDripsCallValue0Struct extends ethereum.Tuple { - get dripToken(): Address { - return this[0].toAddress(); - } - - get balance(): BigInt { - return this[1].toBigInt(); - } -} diff --git a/generated/templates/CompoundPrizePool/CompoundPrizePool.ts b/generated/templates/CompoundPrizePool/CompoundPrizePool.ts deleted file mode 100644 index e565a59..0000000 --- a/generated/templates/CompoundPrizePool/CompoundPrizePool.ts +++ /dev/null @@ -1,2189 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - ethereum, - JSONValue, - TypedMap, - Entity, - Bytes, - Address, - BigInt -} from "@graphprotocol/graph-ts"; - -export class AwardCaptured extends ethereum.Event { - get params(): AwardCaptured__Params { - return new AwardCaptured__Params(this); - } -} - -export class AwardCaptured__Params { - _event: AwardCaptured; - - constructor(event: AwardCaptured) { - this._event = event; - } - - get amount(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class Awarded extends ethereum.Event { - get params(): Awarded__Params { - return new Awarded__Params(this); - } -} - -export class Awarded__Params { - _event: Awarded; - - constructor(event: Awarded) { - this._event = event; - } - - get winner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class AwardedExternalERC20 extends ethereum.Event { - get params(): AwardedExternalERC20__Params { - return new AwardedExternalERC20__Params(this); - } -} - -export class AwardedExternalERC20__Params { - _event: AwardedExternalERC20; - - constructor(event: AwardedExternalERC20) { - this._event = event; - } - - get winner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class AwardedExternalERC721 extends ethereum.Event { - get params(): AwardedExternalERC721__Params { - return new AwardedExternalERC721__Params(this); - } -} - -export class AwardedExternalERC721__Params { - _event: AwardedExternalERC721; - - constructor(event: AwardedExternalERC721) { - this._event = event; - } - - get winner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokenIds(): Array { - return this._event.parameters[2].value.toBigIntArray(); - } -} - -export class CompoundPrizePoolInitialized extends ethereum.Event { - get params(): CompoundPrizePoolInitialized__Params { - return new CompoundPrizePoolInitialized__Params(this); - } -} - -export class CompoundPrizePoolInitialized__Params { - _event: CompoundPrizePoolInitialized; - - constructor(event: CompoundPrizePoolInitialized) { - this._event = event; - } - - get cToken(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class ControlledTokenAdded extends ethereum.Event { - get params(): ControlledTokenAdded__Params { - return new ControlledTokenAdded__Params(this); - } -} - -export class ControlledTokenAdded__Params { - _event: ControlledTokenAdded; - - constructor(event: ControlledTokenAdded) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class CreditBurned extends ethereum.Event { - get params(): CreditBurned__Params { - return new CreditBurned__Params(this); - } -} - -export class CreditBurned__Params { - _event: CreditBurned; - - constructor(event: CreditBurned) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class CreditMinted extends ethereum.Event { - get params(): CreditMinted__Params { - return new CreditMinted__Params(this); - } -} - -export class CreditMinted__Params { - _event: CreditMinted; - - constructor(event: CreditMinted) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class CreditPlanSet extends ethereum.Event { - get params(): CreditPlanSet__Params { - return new CreditPlanSet__Params(this); - } -} - -export class CreditPlanSet__Params { - _event: CreditPlanSet; - - constructor(event: CreditPlanSet) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get creditLimitMantissa(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get creditRateMantissa(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Deposited extends ethereum.Event { - get params(): Deposited__Params { - return new Deposited__Params(this); - } -} - -export class Deposited__Params { - _event: Deposited; - - constructor(event: Deposited) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get referrer(): Address { - return this._event.parameters[4].value.toAddress(); - } -} - -export class Initialized extends ethereum.Event { - get params(): Initialized__Params { - return new Initialized__Params(this); - } -} - -export class Initialized__Params { - _event: Initialized; - - constructor(event: Initialized) { - this._event = event; - } - - get reserveRegistry(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get maxExitFeeMantissa(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get maxTimelockDuration(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class InstantWithdrawal extends ethereum.Event { - get params(): InstantWithdrawal__Params { - return new InstantWithdrawal__Params(this); - } -} - -export class InstantWithdrawal__Params { - _event: InstantWithdrawal; - - constructor(event: InstantWithdrawal) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get from(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get redeemed(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get exitFee(): BigInt { - return this._event.parameters[5].value.toBigInt(); - } -} - -export class LiquidityCapSet extends ethereum.Event { - get params(): LiquidityCapSet__Params { - return new LiquidityCapSet__Params(this); - } -} - -export class LiquidityCapSet__Params { - _event: LiquidityCapSet; - - constructor(event: LiquidityCapSet) { - this._event = event; - } - - get liquidityCap(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class PrizeStrategySet extends ethereum.Event { - get params(): PrizeStrategySet__Params { - return new PrizeStrategySet__Params(this); - } -} - -export class PrizeStrategySet__Params { - _event: PrizeStrategySet; - - constructor(event: PrizeStrategySet) { - this._event = event; - } - - get prizeStrategy(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class ReserveFeeCaptured extends ethereum.Event { - get params(): ReserveFeeCaptured__Params { - return new ReserveFeeCaptured__Params(this); - } -} - -export class ReserveFeeCaptured__Params { - _event: ReserveFeeCaptured; - - constructor(event: ReserveFeeCaptured) { - this._event = event; - } - - get amount(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class ReserveWithdrawal extends ethereum.Event { - get params(): ReserveWithdrawal__Params { - return new ReserveWithdrawal__Params(this); - } -} - -export class ReserveWithdrawal__Params { - _event: ReserveWithdrawal; - - constructor(event: ReserveWithdrawal) { - this._event = event; - } - - get to(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class TimelockDeposited extends ethereum.Event { - get params(): TimelockDeposited__Params { - return new TimelockDeposited__Params(this); - } -} - -export class TimelockDeposited__Params { - _event: TimelockDeposited; - - constructor(event: TimelockDeposited) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class TimelockedWithdrawal extends ethereum.Event { - get params(): TimelockedWithdrawal__Params { - return new TimelockedWithdrawal__Params(this); - } -} - -export class TimelockedWithdrawal__Params { - _event: TimelockedWithdrawal; - - constructor(event: TimelockedWithdrawal) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get from(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get unlockTimestamp(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class TimelockedWithdrawalSwept extends ethereum.Event { - get params(): TimelockedWithdrawalSwept__Params { - return new TimelockedWithdrawalSwept__Params(this); - } -} - -export class TimelockedWithdrawalSwept__Params { - _event: TimelockedWithdrawalSwept; - - constructor(event: TimelockedWithdrawalSwept) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get from(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get redeemed(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class TransferredExternalERC20 extends ethereum.Event { - get params(): TransferredExternalERC20__Params { - return new TransferredExternalERC20__Params(this); - } -} - -export class TransferredExternalERC20__Params { - _event: TransferredExternalERC20; - - constructor(event: TransferredExternalERC20) { - this._event = event; - } - - get to(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class CompoundPrizePool__calculateEarlyExitFeeResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } -} - -export class CompoundPrizePool__calculateTimelockDurationResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } -} - -export class CompoundPrizePool__creditPlanOfResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } -} - -export class CompoundPrizePool extends ethereum.SmartContract { - static bind(address: Address): CompoundPrizePool { - return new CompoundPrizePool("CompoundPrizePool", address); - } - - accountedBalance(): BigInt { - let result = super.call( - "accountedBalance", - "accountedBalance():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_accountedBalance(): ethereum.CallResult { - let result = super.tryCall( - "accountedBalance", - "accountedBalance():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - awardBalance(): BigInt { - let result = super.call("awardBalance", "awardBalance():(uint256)", []); - - return result[0].toBigInt(); - } - - try_awardBalance(): ethereum.CallResult { - let result = super.tryCall("awardBalance", "awardBalance():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - balance(): BigInt { - let result = super.call("balance", "balance():(uint256)", []); - - return result[0].toBigInt(); - } - - try_balance(): ethereum.CallResult { - let result = super.tryCall("balance", "balance():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - balanceOfCredit(user: Address, controlledToken: Address): BigInt { - let result = super.call( - "balanceOfCredit", - "balanceOfCredit(address,address):(uint256)", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddress(controlledToken) - ] - ); - - return result[0].toBigInt(); - } - - try_balanceOfCredit( - user: Address, - controlledToken: Address - ): ethereum.CallResult { - let result = super.tryCall( - "balanceOfCredit", - "balanceOfCredit(address,address):(uint256)", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddress(controlledToken) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - cToken(): Address { - let result = super.call("cToken", "cToken():(address)", []); - - return result[0].toAddress(); - } - - try_cToken(): ethereum.CallResult
{ - let result = super.tryCall("cToken", "cToken():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - calculateEarlyExitFee( - from: Address, - controlledToken: Address, - amount: BigInt - ): CompoundPrizePool__calculateEarlyExitFeeResult { - let result = super.call( - "calculateEarlyExitFee", - "calculateEarlyExitFee(address,address,uint256):(uint256,uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(controlledToken), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return new CompoundPrizePool__calculateEarlyExitFeeResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_calculateEarlyExitFee( - from: Address, - controlledToken: Address, - amount: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "calculateEarlyExitFee", - "calculateEarlyExitFee(address,address,uint256):(uint256,uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(controlledToken), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new CompoundPrizePool__calculateEarlyExitFeeResult( - value[0].toBigInt(), - value[1].toBigInt() - ) - ); - } - - calculateReserveFee(amount: BigInt): BigInt { - let result = super.call( - "calculateReserveFee", - "calculateReserveFee(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amount)] - ); - - return result[0].toBigInt(); - } - - try_calculateReserveFee(amount: BigInt): ethereum.CallResult { - let result = super.tryCall( - "calculateReserveFee", - "calculateReserveFee(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amount)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculateTimelockDuration( - from: Address, - controlledToken: Address, - amount: BigInt - ): CompoundPrizePool__calculateTimelockDurationResult { - let result = super.call( - "calculateTimelockDuration", - "calculateTimelockDuration(address,address,uint256):(uint256,uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(controlledToken), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return new CompoundPrizePool__calculateTimelockDurationResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_calculateTimelockDuration( - from: Address, - controlledToken: Address, - amount: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "calculateTimelockDuration", - "calculateTimelockDuration(address,address,uint256):(uint256,uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(controlledToken), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new CompoundPrizePool__calculateTimelockDurationResult( - value[0].toBigInt(), - value[1].toBigInt() - ) - ); - } - - canAwardExternal(_externalToken: Address): boolean { - let result = super.call( - "canAwardExternal", - "canAwardExternal(address):(bool)", - [ethereum.Value.fromAddress(_externalToken)] - ); - - return result[0].toBoolean(); - } - - try_canAwardExternal(_externalToken: Address): ethereum.CallResult { - let result = super.tryCall( - "canAwardExternal", - "canAwardExternal(address):(bool)", - [ethereum.Value.fromAddress(_externalToken)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - captureAwardBalance(): BigInt { - let result = super.call( - "captureAwardBalance", - "captureAwardBalance():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_captureAwardBalance(): ethereum.CallResult { - let result = super.tryCall( - "captureAwardBalance", - "captureAwardBalance():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - creditPlanOf( - controlledToken: Address - ): CompoundPrizePool__creditPlanOfResult { - let result = super.call( - "creditPlanOf", - "creditPlanOf(address):(uint128,uint128)", - [ethereum.Value.fromAddress(controlledToken)] - ); - - return new CompoundPrizePool__creditPlanOfResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_creditPlanOf( - controlledToken: Address - ): ethereum.CallResult { - let result = super.tryCall( - "creditPlanOf", - "creditPlanOf(address):(uint128,uint128)", - [ethereum.Value.fromAddress(controlledToken)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new CompoundPrizePool__creditPlanOfResult( - value[0].toBigInt(), - value[1].toBigInt() - ) - ); - } - - estimateCreditAccrualTime( - _controlledToken: Address, - _principal: BigInt, - _interest: BigInt - ): BigInt { - let result = super.call( - "estimateCreditAccrualTime", - "estimateCreditAccrualTime(address,uint256,uint256):(uint256)", - [ - ethereum.Value.fromAddress(_controlledToken), - ethereum.Value.fromUnsignedBigInt(_principal), - ethereum.Value.fromUnsignedBigInt(_interest) - ] - ); - - return result[0].toBigInt(); - } - - try_estimateCreditAccrualTime( - _controlledToken: Address, - _principal: BigInt, - _interest: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "estimateCreditAccrualTime", - "estimateCreditAccrualTime(address,uint256,uint256):(uint256)", - [ - ethereum.Value.fromAddress(_controlledToken), - ethereum.Value.fromUnsignedBigInt(_principal), - ethereum.Value.fromUnsignedBigInt(_interest) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - liquidityCap(): BigInt { - let result = super.call("liquidityCap", "liquidityCap():(uint256)", []); - - return result[0].toBigInt(); - } - - try_liquidityCap(): ethereum.CallResult { - let result = super.tryCall("liquidityCap", "liquidityCap():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxExitFeeMantissa(): BigInt { - let result = super.call( - "maxExitFeeMantissa", - "maxExitFeeMantissa():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_maxExitFeeMantissa(): ethereum.CallResult { - let result = super.tryCall( - "maxExitFeeMantissa", - "maxExitFeeMantissa():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxTimelockDuration(): BigInt { - let result = super.call( - "maxTimelockDuration", - "maxTimelockDuration():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_maxTimelockDuration(): ethereum.CallResult { - let result = super.tryCall( - "maxTimelockDuration", - "maxTimelockDuration():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - owner(): Address { - let result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - let result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - prizeStrategy(): Address { - let result = super.call("prizeStrategy", "prizeStrategy():(address)", []); - - return result[0].toAddress(); - } - - try_prizeStrategy(): ethereum.CallResult
{ - let result = super.tryCall( - "prizeStrategy", - "prizeStrategy():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - reserveRegistry(): Address { - let result = super.call( - "reserveRegistry", - "reserveRegistry():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_reserveRegistry(): ethereum.CallResult
{ - let result = super.tryCall( - "reserveRegistry", - "reserveRegistry():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - reserveTotalSupply(): BigInt { - let result = super.call( - "reserveTotalSupply", - "reserveTotalSupply():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_reserveTotalSupply(): ethereum.CallResult { - let result = super.tryCall( - "reserveTotalSupply", - "reserveTotalSupply():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - sweepTimelockBalances(users: Array
): BigInt { - let result = super.call( - "sweepTimelockBalances", - "sweepTimelockBalances(address[]):(uint256)", - [ethereum.Value.fromAddressArray(users)] - ); - - return result[0].toBigInt(); - } - - try_sweepTimelockBalances( - users: Array
- ): ethereum.CallResult { - let result = super.tryCall( - "sweepTimelockBalances", - "sweepTimelockBalances(address[]):(uint256)", - [ethereum.Value.fromAddressArray(users)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - timelockBalanceAvailableAt(user: Address): BigInt { - let result = super.call( - "timelockBalanceAvailableAt", - "timelockBalanceAvailableAt(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - - return result[0].toBigInt(); - } - - try_timelockBalanceAvailableAt(user: Address): ethereum.CallResult { - let result = super.tryCall( - "timelockBalanceAvailableAt", - "timelockBalanceAvailableAt(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - timelockBalanceOf(user: Address): BigInt { - let result = super.call( - "timelockBalanceOf", - "timelockBalanceOf(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - - return result[0].toBigInt(); - } - - try_timelockBalanceOf(user: Address): ethereum.CallResult { - let result = super.tryCall( - "timelockBalanceOf", - "timelockBalanceOf(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - timelockTotalSupply(): BigInt { - let result = super.call( - "timelockTotalSupply", - "timelockTotalSupply():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_timelockTotalSupply(): ethereum.CallResult { - let result = super.tryCall( - "timelockTotalSupply", - "timelockTotalSupply():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - token(): Address { - let result = super.call("token", "token():(address)", []); - - return result[0].toAddress(); - } - - try_token(): ethereum.CallResult
{ - let result = super.tryCall("token", "token():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - tokens(): Array
{ - let result = super.call("tokens", "tokens():(address[])", []); - - return result[0].toAddressArray(); - } - - try_tokens(): ethereum.CallResult> { - let result = super.tryCall("tokens", "tokens():(address[])", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddressArray()); - } - - withdrawInstantlyFrom( - from: Address, - amount: BigInt, - controlledToken: Address, - maximumExitFee: BigInt - ): BigInt { - let result = super.call( - "withdrawInstantlyFrom", - "withdrawInstantlyFrom(address,uint256,address,uint256):(uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromUnsignedBigInt(amount), - ethereum.Value.fromAddress(controlledToken), - ethereum.Value.fromUnsignedBigInt(maximumExitFee) - ] - ); - - return result[0].toBigInt(); - } - - try_withdrawInstantlyFrom( - from: Address, - amount: BigInt, - controlledToken: Address, - maximumExitFee: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "withdrawInstantlyFrom", - "withdrawInstantlyFrom(address,uint256,address,uint256):(uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromUnsignedBigInt(amount), - ethereum.Value.fromAddress(controlledToken), - ethereum.Value.fromUnsignedBigInt(maximumExitFee) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - withdrawReserve(to: Address): BigInt { - let result = super.call( - "withdrawReserve", - "withdrawReserve(address):(uint256)", - [ethereum.Value.fromAddress(to)] - ); - - return result[0].toBigInt(); - } - - try_withdrawReserve(to: Address): ethereum.CallResult { - let result = super.tryCall( - "withdrawReserve", - "withdrawReserve(address):(uint256)", - [ethereum.Value.fromAddress(to)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - withdrawWithTimelockFrom( - from: Address, - amount: BigInt, - controlledToken: Address - ): BigInt { - let result = super.call( - "withdrawWithTimelockFrom", - "withdrawWithTimelockFrom(address,uint256,address):(uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromUnsignedBigInt(amount), - ethereum.Value.fromAddress(controlledToken) - ] - ); - - return result[0].toBigInt(); - } - - try_withdrawWithTimelockFrom( - from: Address, - amount: BigInt, - controlledToken: Address - ): ethereum.CallResult { - let result = super.tryCall( - "withdrawWithTimelockFrom", - "withdrawWithTimelockFrom(address,uint256,address):(uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromUnsignedBigInt(amount), - ethereum.Value.fromAddress(controlledToken) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class AddControlledTokenCall extends ethereum.Call { - get inputs(): AddControlledTokenCall__Inputs { - return new AddControlledTokenCall__Inputs(this); - } - - get outputs(): AddControlledTokenCall__Outputs { - return new AddControlledTokenCall__Outputs(this); - } -} - -export class AddControlledTokenCall__Inputs { - _call: AddControlledTokenCall; - - constructor(call: AddControlledTokenCall) { - this._call = call; - } - - get _controlledToken(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class AddControlledTokenCall__Outputs { - _call: AddControlledTokenCall; - - constructor(call: AddControlledTokenCall) { - this._call = call; - } -} - -export class AwardCall extends ethereum.Call { - get inputs(): AwardCall__Inputs { - return new AwardCall__Inputs(this); - } - - get outputs(): AwardCall__Outputs { - return new AwardCall__Outputs(this); - } -} - -export class AwardCall__Inputs { - _call: AwardCall; - - constructor(call: AwardCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get controlledToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class AwardCall__Outputs { - _call: AwardCall; - - constructor(call: AwardCall) { - this._call = call; - } -} - -export class AwardExternalERC20Call extends ethereum.Call { - get inputs(): AwardExternalERC20Call__Inputs { - return new AwardExternalERC20Call__Inputs(this); - } - - get outputs(): AwardExternalERC20Call__Outputs { - return new AwardExternalERC20Call__Outputs(this); - } -} - -export class AwardExternalERC20Call__Inputs { - _call: AwardExternalERC20Call; - - constructor(call: AwardExternalERC20Call) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get externalToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class AwardExternalERC20Call__Outputs { - _call: AwardExternalERC20Call; - - constructor(call: AwardExternalERC20Call) { - this._call = call; - } -} - -export class AwardExternalERC721Call extends ethereum.Call { - get inputs(): AwardExternalERC721Call__Inputs { - return new AwardExternalERC721Call__Inputs(this); - } - - get outputs(): AwardExternalERC721Call__Outputs { - return new AwardExternalERC721Call__Outputs(this); - } -} - -export class AwardExternalERC721Call__Inputs { - _call: AwardExternalERC721Call; - - constructor(call: AwardExternalERC721Call) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get externalToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get tokenIds(): Array { - return this._call.inputValues[2].value.toBigIntArray(); - } -} - -export class AwardExternalERC721Call__Outputs { - _call: AwardExternalERC721Call; - - constructor(call: AwardExternalERC721Call) { - this._call = call; - } -} - -export class BalanceCall extends ethereum.Call { - get inputs(): BalanceCall__Inputs { - return new BalanceCall__Inputs(this); - } - - get outputs(): BalanceCall__Outputs { - return new BalanceCall__Outputs(this); - } -} - -export class BalanceCall__Inputs { - _call: BalanceCall; - - constructor(call: BalanceCall) { - this._call = call; - } -} - -export class BalanceCall__Outputs { - _call: BalanceCall; - - constructor(call: BalanceCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class BalanceOfCreditCall extends ethereum.Call { - get inputs(): BalanceOfCreditCall__Inputs { - return new BalanceOfCreditCall__Inputs(this); - } - - get outputs(): BalanceOfCreditCall__Outputs { - return new BalanceOfCreditCall__Outputs(this); - } -} - -export class BalanceOfCreditCall__Inputs { - _call: BalanceOfCreditCall; - - constructor(call: BalanceOfCreditCall) { - this._call = call; - } - - get user(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get controlledToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class BalanceOfCreditCall__Outputs { - _call: BalanceOfCreditCall; - - constructor(call: BalanceOfCreditCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class BeforeTokenTransferCall extends ethereum.Call { - get inputs(): BeforeTokenTransferCall__Inputs { - return new BeforeTokenTransferCall__Inputs(this); - } - - get outputs(): BeforeTokenTransferCall__Outputs { - return new BeforeTokenTransferCall__Outputs(this); - } -} - -export class BeforeTokenTransferCall__Inputs { - _call: BeforeTokenTransferCall; - - constructor(call: BeforeTokenTransferCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class BeforeTokenTransferCall__Outputs { - _call: BeforeTokenTransferCall; - - constructor(call: BeforeTokenTransferCall) { - this._call = call; - } -} - -export class CalculateEarlyExitFeeCall extends ethereum.Call { - get inputs(): CalculateEarlyExitFeeCall__Inputs { - return new CalculateEarlyExitFeeCall__Inputs(this); - } - - get outputs(): CalculateEarlyExitFeeCall__Outputs { - return new CalculateEarlyExitFeeCall__Outputs(this); - } -} - -export class CalculateEarlyExitFeeCall__Inputs { - _call: CalculateEarlyExitFeeCall; - - constructor(call: CalculateEarlyExitFeeCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get controlledToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class CalculateEarlyExitFeeCall__Outputs { - _call: CalculateEarlyExitFeeCall; - - constructor(call: CalculateEarlyExitFeeCall) { - this._call = call; - } - - get exitFee(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get burnedCredit(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class CalculateTimelockDurationCall extends ethereum.Call { - get inputs(): CalculateTimelockDurationCall__Inputs { - return new CalculateTimelockDurationCall__Inputs(this); - } - - get outputs(): CalculateTimelockDurationCall__Outputs { - return new CalculateTimelockDurationCall__Outputs(this); - } -} - -export class CalculateTimelockDurationCall__Inputs { - _call: CalculateTimelockDurationCall; - - constructor(call: CalculateTimelockDurationCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get controlledToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class CalculateTimelockDurationCall__Outputs { - _call: CalculateTimelockDurationCall; - - constructor(call: CalculateTimelockDurationCall) { - this._call = call; - } - - get durationSeconds(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get burnedCredit(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class CaptureAwardBalanceCall extends ethereum.Call { - get inputs(): CaptureAwardBalanceCall__Inputs { - return new CaptureAwardBalanceCall__Inputs(this); - } - - get outputs(): CaptureAwardBalanceCall__Outputs { - return new CaptureAwardBalanceCall__Outputs(this); - } -} - -export class CaptureAwardBalanceCall__Inputs { - _call: CaptureAwardBalanceCall; - - constructor(call: CaptureAwardBalanceCall) { - this._call = call; - } -} - -export class CaptureAwardBalanceCall__Outputs { - _call: CaptureAwardBalanceCall; - - constructor(call: CaptureAwardBalanceCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class DepositToCall extends ethereum.Call { - get inputs(): DepositToCall__Inputs { - return new DepositToCall__Inputs(this); - } - - get outputs(): DepositToCall__Outputs { - return new DepositToCall__Outputs(this); - } -} - -export class DepositToCall__Inputs { - _call: DepositToCall; - - constructor(call: DepositToCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get controlledToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get referrer(): Address { - return this._call.inputValues[3].value.toAddress(); - } -} - -export class DepositToCall__Outputs { - _call: DepositToCall; - - constructor(call: DepositToCall) { - this._call = call; - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _reserveRegistry(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _controlledTokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get _maxExitFeeMantissa(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxTimelockDuration(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class Initialize1Call extends ethereum.Call { - get inputs(): Initialize1Call__Inputs { - return new Initialize1Call__Inputs(this); - } - - get outputs(): Initialize1Call__Outputs { - return new Initialize1Call__Outputs(this); - } -} - -export class Initialize1Call__Inputs { - _call: Initialize1Call; - - constructor(call: Initialize1Call) { - this._call = call; - } - - get _reserveRegistry(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _controlledTokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get _maxExitFeeMantissa(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxTimelockDuration(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _cToken(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class Initialize1Call__Outputs { - _call: Initialize1Call; - - constructor(call: Initialize1Call) { - this._call = call; - } -} - -export class RenounceOwnershipCall extends ethereum.Call { - get inputs(): RenounceOwnershipCall__Inputs { - return new RenounceOwnershipCall__Inputs(this); - } - - get outputs(): RenounceOwnershipCall__Outputs { - return new RenounceOwnershipCall__Outputs(this); - } -} - -export class RenounceOwnershipCall__Inputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall__Outputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class SetCreditPlanOfCall extends ethereum.Call { - get inputs(): SetCreditPlanOfCall__Inputs { - return new SetCreditPlanOfCall__Inputs(this); - } - - get outputs(): SetCreditPlanOfCall__Outputs { - return new SetCreditPlanOfCall__Outputs(this); - } -} - -export class SetCreditPlanOfCall__Inputs { - _call: SetCreditPlanOfCall; - - constructor(call: SetCreditPlanOfCall) { - this._call = call; - } - - get _controlledToken(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _creditRateMantissa(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _creditLimitMantissa(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class SetCreditPlanOfCall__Outputs { - _call: SetCreditPlanOfCall; - - constructor(call: SetCreditPlanOfCall) { - this._call = call; - } -} - -export class SetLiquidityCapCall extends ethereum.Call { - get inputs(): SetLiquidityCapCall__Inputs { - return new SetLiquidityCapCall__Inputs(this); - } - - get outputs(): SetLiquidityCapCall__Outputs { - return new SetLiquidityCapCall__Outputs(this); - } -} - -export class SetLiquidityCapCall__Inputs { - _call: SetLiquidityCapCall; - - constructor(call: SetLiquidityCapCall) { - this._call = call; - } - - get _liquidityCap(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetLiquidityCapCall__Outputs { - _call: SetLiquidityCapCall; - - constructor(call: SetLiquidityCapCall) { - this._call = call; - } -} - -export class SetPrizeStrategyCall extends ethereum.Call { - get inputs(): SetPrizeStrategyCall__Inputs { - return new SetPrizeStrategyCall__Inputs(this); - } - - get outputs(): SetPrizeStrategyCall__Outputs { - return new SetPrizeStrategyCall__Outputs(this); - } -} - -export class SetPrizeStrategyCall__Inputs { - _call: SetPrizeStrategyCall; - - constructor(call: SetPrizeStrategyCall) { - this._call = call; - } - - get _prizeStrategy(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetPrizeStrategyCall__Outputs { - _call: SetPrizeStrategyCall; - - constructor(call: SetPrizeStrategyCall) { - this._call = call; - } -} - -export class SweepTimelockBalancesCall extends ethereum.Call { - get inputs(): SweepTimelockBalancesCall__Inputs { - return new SweepTimelockBalancesCall__Inputs(this); - } - - get outputs(): SweepTimelockBalancesCall__Outputs { - return new SweepTimelockBalancesCall__Outputs(this); - } -} - -export class SweepTimelockBalancesCall__Inputs { - _call: SweepTimelockBalancesCall; - - constructor(call: SweepTimelockBalancesCall) { - this._call = call; - } - - get users(): Array
{ - return this._call.inputValues[0].value.toAddressArray(); - } -} - -export class SweepTimelockBalancesCall__Outputs { - _call: SweepTimelockBalancesCall; - - constructor(call: SweepTimelockBalancesCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class TimelockDepositToCall extends ethereum.Call { - get inputs(): TimelockDepositToCall__Inputs { - return new TimelockDepositToCall__Inputs(this); - } - - get outputs(): TimelockDepositToCall__Outputs { - return new TimelockDepositToCall__Outputs(this); - } -} - -export class TimelockDepositToCall__Inputs { - _call: TimelockDepositToCall; - - constructor(call: TimelockDepositToCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get controlledToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class TimelockDepositToCall__Outputs { - _call: TimelockDepositToCall; - - constructor(call: TimelockDepositToCall) { - this._call = call; - } -} - -export class TransferExternalERC20Call extends ethereum.Call { - get inputs(): TransferExternalERC20Call__Inputs { - return new TransferExternalERC20Call__Inputs(this); - } - - get outputs(): TransferExternalERC20Call__Outputs { - return new TransferExternalERC20Call__Outputs(this); - } -} - -export class TransferExternalERC20Call__Inputs { - _call: TransferExternalERC20Call; - - constructor(call: TransferExternalERC20Call) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get externalToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferExternalERC20Call__Outputs { - _call: TransferExternalERC20Call; - - constructor(call: TransferExternalERC20Call) { - this._call = call; - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get newOwner(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} - -export class WithdrawInstantlyFromCall extends ethereum.Call { - get inputs(): WithdrawInstantlyFromCall__Inputs { - return new WithdrawInstantlyFromCall__Inputs(this); - } - - get outputs(): WithdrawInstantlyFromCall__Outputs { - return new WithdrawInstantlyFromCall__Outputs(this); - } -} - -export class WithdrawInstantlyFromCall__Inputs { - _call: WithdrawInstantlyFromCall; - - constructor(call: WithdrawInstantlyFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get controlledToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get maximumExitFee(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class WithdrawInstantlyFromCall__Outputs { - _call: WithdrawInstantlyFromCall; - - constructor(call: WithdrawInstantlyFromCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class WithdrawReserveCall extends ethereum.Call { - get inputs(): WithdrawReserveCall__Inputs { - return new WithdrawReserveCall__Inputs(this); - } - - get outputs(): WithdrawReserveCall__Outputs { - return new WithdrawReserveCall__Outputs(this); - } -} - -export class WithdrawReserveCall__Inputs { - _call: WithdrawReserveCall; - - constructor(call: WithdrawReserveCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class WithdrawReserveCall__Outputs { - _call: WithdrawReserveCall; - - constructor(call: WithdrawReserveCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class WithdrawWithTimelockFromCall extends ethereum.Call { - get inputs(): WithdrawWithTimelockFromCall__Inputs { - return new WithdrawWithTimelockFromCall__Inputs(this); - } - - get outputs(): WithdrawWithTimelockFromCall__Outputs { - return new WithdrawWithTimelockFromCall__Outputs(this); - } -} - -export class WithdrawWithTimelockFromCall__Inputs { - _call: WithdrawWithTimelockFromCall; - - constructor(call: WithdrawWithTimelockFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get controlledToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class WithdrawWithTimelockFromCall__Outputs { - _call: WithdrawWithTimelockFromCall; - - constructor(call: WithdrawWithTimelockFromCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} diff --git a/generated/templates/CompoundPrizePool/ControlledToken.ts b/generated/templates/CompoundPrizePool/ControlledToken.ts deleted file mode 100644 index 91686f3..0000000 --- a/generated/templates/CompoundPrizePool/ControlledToken.ts +++ /dev/null @@ -1,672 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - ethereum, - JSONValue, - TypedMap, - Entity, - Bytes, - Address, - BigInt -} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ControlledToken extends ethereum.SmartContract { - static bind(address: Address): ControlledToken { - return new ControlledToken("ControlledToken", address); - } - - allowance(owner: Address, spender: Address): BigInt { - let result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - let result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - let result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - controller(): Address { - let result = super.call("controller", "controller():(address)", []); - - return result[0].toAddress(); - } - - try_controller(): ethereum.CallResult
{ - let result = super.tryCall("controller", "controller():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - decimals(): i32 { - let result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - let result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { - let result = super.call( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseAllowance( - spender: Address, - subtractedValue: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - increaseAllowance(spender: Address, addedValue: BigInt): boolean { - let result = super.call( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseAllowance( - spender: Address, - addedValue: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - let result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - let result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - symbol(): string { - let result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - let result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - let result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - let result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - let result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class ControllerBurnCall extends ethereum.Call { - get inputs(): ControllerBurnCall__Inputs { - return new ControllerBurnCall__Inputs(this); - } - - get outputs(): ControllerBurnCall__Outputs { - return new ControllerBurnCall__Outputs(this); - } -} - -export class ControllerBurnCall__Inputs { - _call: ControllerBurnCall; - - constructor(call: ControllerBurnCall) { - this._call = call; - } - - get _user(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ControllerBurnCall__Outputs { - _call: ControllerBurnCall; - - constructor(call: ControllerBurnCall) { - this._call = call; - } -} - -export class ControllerBurnFromCall extends ethereum.Call { - get inputs(): ControllerBurnFromCall__Inputs { - return new ControllerBurnFromCall__Inputs(this); - } - - get outputs(): ControllerBurnFromCall__Outputs { - return new ControllerBurnFromCall__Outputs(this); - } -} - -export class ControllerBurnFromCall__Inputs { - _call: ControllerBurnFromCall; - - constructor(call: ControllerBurnFromCall) { - this._call = call; - } - - get _operator(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _user(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class ControllerBurnFromCall__Outputs { - _call: ControllerBurnFromCall; - - constructor(call: ControllerBurnFromCall) { - this._call = call; - } -} - -export class ControllerMintCall extends ethereum.Call { - get inputs(): ControllerMintCall__Inputs { - return new ControllerMintCall__Inputs(this); - } - - get outputs(): ControllerMintCall__Outputs { - return new ControllerMintCall__Outputs(this); - } -} - -export class ControllerMintCall__Inputs { - _call: ControllerMintCall; - - constructor(call: ControllerMintCall) { - this._call = call; - } - - get _user(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ControllerMintCall__Outputs { - _call: ControllerMintCall; - - constructor(call: ControllerMintCall) { - this._call = call; - } -} - -export class DecreaseAllowanceCall extends ethereum.Call { - get inputs(): DecreaseAllowanceCall__Inputs { - return new DecreaseAllowanceCall__Inputs(this); - } - - get outputs(): DecreaseAllowanceCall__Outputs { - return new DecreaseAllowanceCall__Outputs(this); - } -} - -export class DecreaseAllowanceCall__Inputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get subtractedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseAllowanceCall__Outputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseAllowanceCall extends ethereum.Call { - get inputs(): IncreaseAllowanceCall__Inputs { - return new IncreaseAllowanceCall__Inputs(this); - } - - get outputs(): IncreaseAllowanceCall__Outputs { - return new IncreaseAllowanceCall__Outputs(this); - } -} - -export class IncreaseAllowanceCall__Inputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get addedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseAllowanceCall__Outputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _name(): string { - return this._call.inputValues[0].value.toString(); - } - - get _symbol(): string { - return this._call.inputValues[1].value.toString(); - } - - get _decimals(): i32 { - return this._call.inputValues[2].value.toI32(); - } - - get _controller(): Address { - return this._call.inputValues[3].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/generated/templates/CompoundPrizePool/PrizePool.ts b/generated/templates/CompoundPrizePool/PrizePool.ts deleted file mode 100644 index 8aabba9..0000000 --- a/generated/templates/CompoundPrizePool/PrizePool.ts +++ /dev/null @@ -1,2108 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - ethereum, - JSONValue, - TypedMap, - Entity, - Bytes, - Address, - BigInt -} from "@graphprotocol/graph-ts"; - -export class AwardCaptured extends ethereum.Event { - get params(): AwardCaptured__Params { - return new AwardCaptured__Params(this); - } -} - -export class AwardCaptured__Params { - _event: AwardCaptured; - - constructor(event: AwardCaptured) { - this._event = event; - } - - get amount(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class Awarded extends ethereum.Event { - get params(): Awarded__Params { - return new Awarded__Params(this); - } -} - -export class Awarded__Params { - _event: Awarded; - - constructor(event: Awarded) { - this._event = event; - } - - get winner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class AwardedExternalERC20 extends ethereum.Event { - get params(): AwardedExternalERC20__Params { - return new AwardedExternalERC20__Params(this); - } -} - -export class AwardedExternalERC20__Params { - _event: AwardedExternalERC20; - - constructor(event: AwardedExternalERC20) { - this._event = event; - } - - get winner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class AwardedExternalERC721 extends ethereum.Event { - get params(): AwardedExternalERC721__Params { - return new AwardedExternalERC721__Params(this); - } -} - -export class AwardedExternalERC721__Params { - _event: AwardedExternalERC721; - - constructor(event: AwardedExternalERC721) { - this._event = event; - } - - get winner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokenIds(): Array { - return this._event.parameters[2].value.toBigIntArray(); - } -} - -export class ControlledTokenAdded extends ethereum.Event { - get params(): ControlledTokenAdded__Params { - return new ControlledTokenAdded__Params(this); - } -} - -export class ControlledTokenAdded__Params { - _event: ControlledTokenAdded; - - constructor(event: ControlledTokenAdded) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class CreditBurned extends ethereum.Event { - get params(): CreditBurned__Params { - return new CreditBurned__Params(this); - } -} - -export class CreditBurned__Params { - _event: CreditBurned; - - constructor(event: CreditBurned) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class CreditMinted extends ethereum.Event { - get params(): CreditMinted__Params { - return new CreditMinted__Params(this); - } -} - -export class CreditMinted__Params { - _event: CreditMinted; - - constructor(event: CreditMinted) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class CreditPlanSet extends ethereum.Event { - get params(): CreditPlanSet__Params { - return new CreditPlanSet__Params(this); - } -} - -export class CreditPlanSet__Params { - _event: CreditPlanSet; - - constructor(event: CreditPlanSet) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get creditLimitMantissa(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get creditRateMantissa(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Deposited extends ethereum.Event { - get params(): Deposited__Params { - return new Deposited__Params(this); - } -} - -export class Deposited__Params { - _event: Deposited; - - constructor(event: Deposited) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get referrer(): Address { - return this._event.parameters[4].value.toAddress(); - } -} - -export class Initialized extends ethereum.Event { - get params(): Initialized__Params { - return new Initialized__Params(this); - } -} - -export class Initialized__Params { - _event: Initialized; - - constructor(event: Initialized) { - this._event = event; - } - - get reserveRegistry(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get maxExitFeeMantissa(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get maxTimelockDuration(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class InstantWithdrawal extends ethereum.Event { - get params(): InstantWithdrawal__Params { - return new InstantWithdrawal__Params(this); - } -} - -export class InstantWithdrawal__Params { - _event: InstantWithdrawal; - - constructor(event: InstantWithdrawal) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get from(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get redeemed(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get exitFee(): BigInt { - return this._event.parameters[5].value.toBigInt(); - } -} - -export class LiquidityCapSet extends ethereum.Event { - get params(): LiquidityCapSet__Params { - return new LiquidityCapSet__Params(this); - } -} - -export class LiquidityCapSet__Params { - _event: LiquidityCapSet; - - constructor(event: LiquidityCapSet) { - this._event = event; - } - - get liquidityCap(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class PrizeStrategySet extends ethereum.Event { - get params(): PrizeStrategySet__Params { - return new PrizeStrategySet__Params(this); - } -} - -export class PrizeStrategySet__Params { - _event: PrizeStrategySet; - - constructor(event: PrizeStrategySet) { - this._event = event; - } - - get prizeStrategy(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class ReserveFeeCaptured extends ethereum.Event { - get params(): ReserveFeeCaptured__Params { - return new ReserveFeeCaptured__Params(this); - } -} - -export class ReserveFeeCaptured__Params { - _event: ReserveFeeCaptured; - - constructor(event: ReserveFeeCaptured) { - this._event = event; - } - - get amount(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class ReserveWithdrawal extends ethereum.Event { - get params(): ReserveWithdrawal__Params { - return new ReserveWithdrawal__Params(this); - } -} - -export class ReserveWithdrawal__Params { - _event: ReserveWithdrawal; - - constructor(event: ReserveWithdrawal) { - this._event = event; - } - - get to(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class TimelockDeposited extends ethereum.Event { - get params(): TimelockDeposited__Params { - return new TimelockDeposited__Params(this); - } -} - -export class TimelockDeposited__Params { - _event: TimelockDeposited; - - constructor(event: TimelockDeposited) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class TimelockedWithdrawal extends ethereum.Event { - get params(): TimelockedWithdrawal__Params { - return new TimelockedWithdrawal__Params(this); - } -} - -export class TimelockedWithdrawal__Params { - _event: TimelockedWithdrawal; - - constructor(event: TimelockedWithdrawal) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get from(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get unlockTimestamp(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class TimelockedWithdrawalSwept extends ethereum.Event { - get params(): TimelockedWithdrawalSwept__Params { - return new TimelockedWithdrawalSwept__Params(this); - } -} - -export class TimelockedWithdrawalSwept__Params { - _event: TimelockedWithdrawalSwept; - - constructor(event: TimelockedWithdrawalSwept) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get from(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get redeemed(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class TransferredExternalERC20 extends ethereum.Event { - get params(): TransferredExternalERC20__Params { - return new TransferredExternalERC20__Params(this); - } -} - -export class TransferredExternalERC20__Params { - _event: TransferredExternalERC20; - - constructor(event: TransferredExternalERC20) { - this._event = event; - } - - get to(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PrizePool__calculateEarlyExitFeeResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } -} - -export class PrizePool__calculateTimelockDurationResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } -} - -export class PrizePool__creditPlanOfResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } -} - -export class PrizePool extends ethereum.SmartContract { - static bind(address: Address): PrizePool { - return new PrizePool("PrizePool", address); - } - - accountedBalance(): BigInt { - let result = super.call( - "accountedBalance", - "accountedBalance():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_accountedBalance(): ethereum.CallResult { - let result = super.tryCall( - "accountedBalance", - "accountedBalance():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - awardBalance(): BigInt { - let result = super.call("awardBalance", "awardBalance():(uint256)", []); - - return result[0].toBigInt(); - } - - try_awardBalance(): ethereum.CallResult { - let result = super.tryCall("awardBalance", "awardBalance():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - balance(): BigInt { - let result = super.call("balance", "balance():(uint256)", []); - - return result[0].toBigInt(); - } - - try_balance(): ethereum.CallResult { - let result = super.tryCall("balance", "balance():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - balanceOfCredit(user: Address, controlledToken: Address): BigInt { - let result = super.call( - "balanceOfCredit", - "balanceOfCredit(address,address):(uint256)", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddress(controlledToken) - ] - ); - - return result[0].toBigInt(); - } - - try_balanceOfCredit( - user: Address, - controlledToken: Address - ): ethereum.CallResult { - let result = super.tryCall( - "balanceOfCredit", - "balanceOfCredit(address,address):(uint256)", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddress(controlledToken) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculateEarlyExitFee( - from: Address, - controlledToken: Address, - amount: BigInt - ): PrizePool__calculateEarlyExitFeeResult { - let result = super.call( - "calculateEarlyExitFee", - "calculateEarlyExitFee(address,address,uint256):(uint256,uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(controlledToken), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return new PrizePool__calculateEarlyExitFeeResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_calculateEarlyExitFee( - from: Address, - controlledToken: Address, - amount: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "calculateEarlyExitFee", - "calculateEarlyExitFee(address,address,uint256):(uint256,uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(controlledToken), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new PrizePool__calculateEarlyExitFeeResult( - value[0].toBigInt(), - value[1].toBigInt() - ) - ); - } - - calculateReserveFee(amount: BigInt): BigInt { - let result = super.call( - "calculateReserveFee", - "calculateReserveFee(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amount)] - ); - - return result[0].toBigInt(); - } - - try_calculateReserveFee(amount: BigInt): ethereum.CallResult { - let result = super.tryCall( - "calculateReserveFee", - "calculateReserveFee(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amount)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculateTimelockDuration( - from: Address, - controlledToken: Address, - amount: BigInt - ): PrizePool__calculateTimelockDurationResult { - let result = super.call( - "calculateTimelockDuration", - "calculateTimelockDuration(address,address,uint256):(uint256,uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(controlledToken), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return new PrizePool__calculateTimelockDurationResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_calculateTimelockDuration( - from: Address, - controlledToken: Address, - amount: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "calculateTimelockDuration", - "calculateTimelockDuration(address,address,uint256):(uint256,uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(controlledToken), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new PrizePool__calculateTimelockDurationResult( - value[0].toBigInt(), - value[1].toBigInt() - ) - ); - } - - canAwardExternal(_externalToken: Address): boolean { - let result = super.call( - "canAwardExternal", - "canAwardExternal(address):(bool)", - [ethereum.Value.fromAddress(_externalToken)] - ); - - return result[0].toBoolean(); - } - - try_canAwardExternal(_externalToken: Address): ethereum.CallResult { - let result = super.tryCall( - "canAwardExternal", - "canAwardExternal(address):(bool)", - [ethereum.Value.fromAddress(_externalToken)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - captureAwardBalance(): BigInt { - let result = super.call( - "captureAwardBalance", - "captureAwardBalance():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_captureAwardBalance(): ethereum.CallResult { - let result = super.tryCall( - "captureAwardBalance", - "captureAwardBalance():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - creditPlanOf(controlledToken: Address): PrizePool__creditPlanOfResult { - let result = super.call( - "creditPlanOf", - "creditPlanOf(address):(uint128,uint128)", - [ethereum.Value.fromAddress(controlledToken)] - ); - - return new PrizePool__creditPlanOfResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_creditPlanOf( - controlledToken: Address - ): ethereum.CallResult { - let result = super.tryCall( - "creditPlanOf", - "creditPlanOf(address):(uint128,uint128)", - [ethereum.Value.fromAddress(controlledToken)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new PrizePool__creditPlanOfResult( - value[0].toBigInt(), - value[1].toBigInt() - ) - ); - } - - estimateCreditAccrualTime( - _controlledToken: Address, - _principal: BigInt, - _interest: BigInt - ): BigInt { - let result = super.call( - "estimateCreditAccrualTime", - "estimateCreditAccrualTime(address,uint256,uint256):(uint256)", - [ - ethereum.Value.fromAddress(_controlledToken), - ethereum.Value.fromUnsignedBigInt(_principal), - ethereum.Value.fromUnsignedBigInt(_interest) - ] - ); - - return result[0].toBigInt(); - } - - try_estimateCreditAccrualTime( - _controlledToken: Address, - _principal: BigInt, - _interest: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "estimateCreditAccrualTime", - "estimateCreditAccrualTime(address,uint256,uint256):(uint256)", - [ - ethereum.Value.fromAddress(_controlledToken), - ethereum.Value.fromUnsignedBigInt(_principal), - ethereum.Value.fromUnsignedBigInt(_interest) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - liquidityCap(): BigInt { - let result = super.call("liquidityCap", "liquidityCap():(uint256)", []); - - return result[0].toBigInt(); - } - - try_liquidityCap(): ethereum.CallResult { - let result = super.tryCall("liquidityCap", "liquidityCap():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxExitFeeMantissa(): BigInt { - let result = super.call( - "maxExitFeeMantissa", - "maxExitFeeMantissa():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_maxExitFeeMantissa(): ethereum.CallResult { - let result = super.tryCall( - "maxExitFeeMantissa", - "maxExitFeeMantissa():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxTimelockDuration(): BigInt { - let result = super.call( - "maxTimelockDuration", - "maxTimelockDuration():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_maxTimelockDuration(): ethereum.CallResult { - let result = super.tryCall( - "maxTimelockDuration", - "maxTimelockDuration():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - owner(): Address { - let result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - let result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - prizeStrategy(): Address { - let result = super.call("prizeStrategy", "prizeStrategy():(address)", []); - - return result[0].toAddress(); - } - - try_prizeStrategy(): ethereum.CallResult
{ - let result = super.tryCall( - "prizeStrategy", - "prizeStrategy():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - reserveRegistry(): Address { - let result = super.call( - "reserveRegistry", - "reserveRegistry():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_reserveRegistry(): ethereum.CallResult
{ - let result = super.tryCall( - "reserveRegistry", - "reserveRegistry():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - reserveTotalSupply(): BigInt { - let result = super.call( - "reserveTotalSupply", - "reserveTotalSupply():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_reserveTotalSupply(): ethereum.CallResult { - let result = super.tryCall( - "reserveTotalSupply", - "reserveTotalSupply():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - sweepTimelockBalances(users: Array
): BigInt { - let result = super.call( - "sweepTimelockBalances", - "sweepTimelockBalances(address[]):(uint256)", - [ethereum.Value.fromAddressArray(users)] - ); - - return result[0].toBigInt(); - } - - try_sweepTimelockBalances( - users: Array
- ): ethereum.CallResult { - let result = super.tryCall( - "sweepTimelockBalances", - "sweepTimelockBalances(address[]):(uint256)", - [ethereum.Value.fromAddressArray(users)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - timelockBalanceAvailableAt(user: Address): BigInt { - let result = super.call( - "timelockBalanceAvailableAt", - "timelockBalanceAvailableAt(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - - return result[0].toBigInt(); - } - - try_timelockBalanceAvailableAt(user: Address): ethereum.CallResult { - let result = super.tryCall( - "timelockBalanceAvailableAt", - "timelockBalanceAvailableAt(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - timelockBalanceOf(user: Address): BigInt { - let result = super.call( - "timelockBalanceOf", - "timelockBalanceOf(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - - return result[0].toBigInt(); - } - - try_timelockBalanceOf(user: Address): ethereum.CallResult { - let result = super.tryCall( - "timelockBalanceOf", - "timelockBalanceOf(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - timelockTotalSupply(): BigInt { - let result = super.call( - "timelockTotalSupply", - "timelockTotalSupply():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_timelockTotalSupply(): ethereum.CallResult { - let result = super.tryCall( - "timelockTotalSupply", - "timelockTotalSupply():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - token(): Address { - let result = super.call("token", "token():(address)", []); - - return result[0].toAddress(); - } - - try_token(): ethereum.CallResult
{ - let result = super.tryCall("token", "token():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - tokens(): Array
{ - let result = super.call("tokens", "tokens():(address[])", []); - - return result[0].toAddressArray(); - } - - try_tokens(): ethereum.CallResult> { - let result = super.tryCall("tokens", "tokens():(address[])", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddressArray()); - } - - withdrawInstantlyFrom( - from: Address, - amount: BigInt, - controlledToken: Address, - maximumExitFee: BigInt - ): BigInt { - let result = super.call( - "withdrawInstantlyFrom", - "withdrawInstantlyFrom(address,uint256,address,uint256):(uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromUnsignedBigInt(amount), - ethereum.Value.fromAddress(controlledToken), - ethereum.Value.fromUnsignedBigInt(maximumExitFee) - ] - ); - - return result[0].toBigInt(); - } - - try_withdrawInstantlyFrom( - from: Address, - amount: BigInt, - controlledToken: Address, - maximumExitFee: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "withdrawInstantlyFrom", - "withdrawInstantlyFrom(address,uint256,address,uint256):(uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromUnsignedBigInt(amount), - ethereum.Value.fromAddress(controlledToken), - ethereum.Value.fromUnsignedBigInt(maximumExitFee) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - withdrawReserve(to: Address): BigInt { - let result = super.call( - "withdrawReserve", - "withdrawReserve(address):(uint256)", - [ethereum.Value.fromAddress(to)] - ); - - return result[0].toBigInt(); - } - - try_withdrawReserve(to: Address): ethereum.CallResult { - let result = super.tryCall( - "withdrawReserve", - "withdrawReserve(address):(uint256)", - [ethereum.Value.fromAddress(to)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - withdrawWithTimelockFrom( - from: Address, - amount: BigInt, - controlledToken: Address - ): BigInt { - let result = super.call( - "withdrawWithTimelockFrom", - "withdrawWithTimelockFrom(address,uint256,address):(uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromUnsignedBigInt(amount), - ethereum.Value.fromAddress(controlledToken) - ] - ); - - return result[0].toBigInt(); - } - - try_withdrawWithTimelockFrom( - from: Address, - amount: BigInt, - controlledToken: Address - ): ethereum.CallResult { - let result = super.tryCall( - "withdrawWithTimelockFrom", - "withdrawWithTimelockFrom(address,uint256,address):(uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromUnsignedBigInt(amount), - ethereum.Value.fromAddress(controlledToken) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class AddControlledTokenCall extends ethereum.Call { - get inputs(): AddControlledTokenCall__Inputs { - return new AddControlledTokenCall__Inputs(this); - } - - get outputs(): AddControlledTokenCall__Outputs { - return new AddControlledTokenCall__Outputs(this); - } -} - -export class AddControlledTokenCall__Inputs { - _call: AddControlledTokenCall; - - constructor(call: AddControlledTokenCall) { - this._call = call; - } - - get _controlledToken(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class AddControlledTokenCall__Outputs { - _call: AddControlledTokenCall; - - constructor(call: AddControlledTokenCall) { - this._call = call; - } -} - -export class AwardCall extends ethereum.Call { - get inputs(): AwardCall__Inputs { - return new AwardCall__Inputs(this); - } - - get outputs(): AwardCall__Outputs { - return new AwardCall__Outputs(this); - } -} - -export class AwardCall__Inputs { - _call: AwardCall; - - constructor(call: AwardCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get controlledToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class AwardCall__Outputs { - _call: AwardCall; - - constructor(call: AwardCall) { - this._call = call; - } -} - -export class AwardExternalERC20Call extends ethereum.Call { - get inputs(): AwardExternalERC20Call__Inputs { - return new AwardExternalERC20Call__Inputs(this); - } - - get outputs(): AwardExternalERC20Call__Outputs { - return new AwardExternalERC20Call__Outputs(this); - } -} - -export class AwardExternalERC20Call__Inputs { - _call: AwardExternalERC20Call; - - constructor(call: AwardExternalERC20Call) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get externalToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class AwardExternalERC20Call__Outputs { - _call: AwardExternalERC20Call; - - constructor(call: AwardExternalERC20Call) { - this._call = call; - } -} - -export class AwardExternalERC721Call extends ethereum.Call { - get inputs(): AwardExternalERC721Call__Inputs { - return new AwardExternalERC721Call__Inputs(this); - } - - get outputs(): AwardExternalERC721Call__Outputs { - return new AwardExternalERC721Call__Outputs(this); - } -} - -export class AwardExternalERC721Call__Inputs { - _call: AwardExternalERC721Call; - - constructor(call: AwardExternalERC721Call) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get externalToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get tokenIds(): Array { - return this._call.inputValues[2].value.toBigIntArray(); - } -} - -export class AwardExternalERC721Call__Outputs { - _call: AwardExternalERC721Call; - - constructor(call: AwardExternalERC721Call) { - this._call = call; - } -} - -export class BalanceCall extends ethereum.Call { - get inputs(): BalanceCall__Inputs { - return new BalanceCall__Inputs(this); - } - - get outputs(): BalanceCall__Outputs { - return new BalanceCall__Outputs(this); - } -} - -export class BalanceCall__Inputs { - _call: BalanceCall; - - constructor(call: BalanceCall) { - this._call = call; - } -} - -export class BalanceCall__Outputs { - _call: BalanceCall; - - constructor(call: BalanceCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class BalanceOfCreditCall extends ethereum.Call { - get inputs(): BalanceOfCreditCall__Inputs { - return new BalanceOfCreditCall__Inputs(this); - } - - get outputs(): BalanceOfCreditCall__Outputs { - return new BalanceOfCreditCall__Outputs(this); - } -} - -export class BalanceOfCreditCall__Inputs { - _call: BalanceOfCreditCall; - - constructor(call: BalanceOfCreditCall) { - this._call = call; - } - - get user(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get controlledToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class BalanceOfCreditCall__Outputs { - _call: BalanceOfCreditCall; - - constructor(call: BalanceOfCreditCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class BeforeTokenTransferCall extends ethereum.Call { - get inputs(): BeforeTokenTransferCall__Inputs { - return new BeforeTokenTransferCall__Inputs(this); - } - - get outputs(): BeforeTokenTransferCall__Outputs { - return new BeforeTokenTransferCall__Outputs(this); - } -} - -export class BeforeTokenTransferCall__Inputs { - _call: BeforeTokenTransferCall; - - constructor(call: BeforeTokenTransferCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class BeforeTokenTransferCall__Outputs { - _call: BeforeTokenTransferCall; - - constructor(call: BeforeTokenTransferCall) { - this._call = call; - } -} - -export class CalculateEarlyExitFeeCall extends ethereum.Call { - get inputs(): CalculateEarlyExitFeeCall__Inputs { - return new CalculateEarlyExitFeeCall__Inputs(this); - } - - get outputs(): CalculateEarlyExitFeeCall__Outputs { - return new CalculateEarlyExitFeeCall__Outputs(this); - } -} - -export class CalculateEarlyExitFeeCall__Inputs { - _call: CalculateEarlyExitFeeCall; - - constructor(call: CalculateEarlyExitFeeCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get controlledToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class CalculateEarlyExitFeeCall__Outputs { - _call: CalculateEarlyExitFeeCall; - - constructor(call: CalculateEarlyExitFeeCall) { - this._call = call; - } - - get exitFee(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get burnedCredit(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class CalculateTimelockDurationCall extends ethereum.Call { - get inputs(): CalculateTimelockDurationCall__Inputs { - return new CalculateTimelockDurationCall__Inputs(this); - } - - get outputs(): CalculateTimelockDurationCall__Outputs { - return new CalculateTimelockDurationCall__Outputs(this); - } -} - -export class CalculateTimelockDurationCall__Inputs { - _call: CalculateTimelockDurationCall; - - constructor(call: CalculateTimelockDurationCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get controlledToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class CalculateTimelockDurationCall__Outputs { - _call: CalculateTimelockDurationCall; - - constructor(call: CalculateTimelockDurationCall) { - this._call = call; - } - - get durationSeconds(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get burnedCredit(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class CaptureAwardBalanceCall extends ethereum.Call { - get inputs(): CaptureAwardBalanceCall__Inputs { - return new CaptureAwardBalanceCall__Inputs(this); - } - - get outputs(): CaptureAwardBalanceCall__Outputs { - return new CaptureAwardBalanceCall__Outputs(this); - } -} - -export class CaptureAwardBalanceCall__Inputs { - _call: CaptureAwardBalanceCall; - - constructor(call: CaptureAwardBalanceCall) { - this._call = call; - } -} - -export class CaptureAwardBalanceCall__Outputs { - _call: CaptureAwardBalanceCall; - - constructor(call: CaptureAwardBalanceCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class DepositToCall extends ethereum.Call { - get inputs(): DepositToCall__Inputs { - return new DepositToCall__Inputs(this); - } - - get outputs(): DepositToCall__Outputs { - return new DepositToCall__Outputs(this); - } -} - -export class DepositToCall__Inputs { - _call: DepositToCall; - - constructor(call: DepositToCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get controlledToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get referrer(): Address { - return this._call.inputValues[3].value.toAddress(); - } -} - -export class DepositToCall__Outputs { - _call: DepositToCall; - - constructor(call: DepositToCall) { - this._call = call; - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _reserveRegistry(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _controlledTokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get _maxExitFeeMantissa(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxTimelockDuration(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall extends ethereum.Call { - get inputs(): RenounceOwnershipCall__Inputs { - return new RenounceOwnershipCall__Inputs(this); - } - - get outputs(): RenounceOwnershipCall__Outputs { - return new RenounceOwnershipCall__Outputs(this); - } -} - -export class RenounceOwnershipCall__Inputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall__Outputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class SetCreditPlanOfCall extends ethereum.Call { - get inputs(): SetCreditPlanOfCall__Inputs { - return new SetCreditPlanOfCall__Inputs(this); - } - - get outputs(): SetCreditPlanOfCall__Outputs { - return new SetCreditPlanOfCall__Outputs(this); - } -} - -export class SetCreditPlanOfCall__Inputs { - _call: SetCreditPlanOfCall; - - constructor(call: SetCreditPlanOfCall) { - this._call = call; - } - - get _controlledToken(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _creditRateMantissa(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _creditLimitMantissa(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class SetCreditPlanOfCall__Outputs { - _call: SetCreditPlanOfCall; - - constructor(call: SetCreditPlanOfCall) { - this._call = call; - } -} - -export class SetLiquidityCapCall extends ethereum.Call { - get inputs(): SetLiquidityCapCall__Inputs { - return new SetLiquidityCapCall__Inputs(this); - } - - get outputs(): SetLiquidityCapCall__Outputs { - return new SetLiquidityCapCall__Outputs(this); - } -} - -export class SetLiquidityCapCall__Inputs { - _call: SetLiquidityCapCall; - - constructor(call: SetLiquidityCapCall) { - this._call = call; - } - - get _liquidityCap(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetLiquidityCapCall__Outputs { - _call: SetLiquidityCapCall; - - constructor(call: SetLiquidityCapCall) { - this._call = call; - } -} - -export class SetPrizeStrategyCall extends ethereum.Call { - get inputs(): SetPrizeStrategyCall__Inputs { - return new SetPrizeStrategyCall__Inputs(this); - } - - get outputs(): SetPrizeStrategyCall__Outputs { - return new SetPrizeStrategyCall__Outputs(this); - } -} - -export class SetPrizeStrategyCall__Inputs { - _call: SetPrizeStrategyCall; - - constructor(call: SetPrizeStrategyCall) { - this._call = call; - } - - get _prizeStrategy(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetPrizeStrategyCall__Outputs { - _call: SetPrizeStrategyCall; - - constructor(call: SetPrizeStrategyCall) { - this._call = call; - } -} - -export class SweepTimelockBalancesCall extends ethereum.Call { - get inputs(): SweepTimelockBalancesCall__Inputs { - return new SweepTimelockBalancesCall__Inputs(this); - } - - get outputs(): SweepTimelockBalancesCall__Outputs { - return new SweepTimelockBalancesCall__Outputs(this); - } -} - -export class SweepTimelockBalancesCall__Inputs { - _call: SweepTimelockBalancesCall; - - constructor(call: SweepTimelockBalancesCall) { - this._call = call; - } - - get users(): Array
{ - return this._call.inputValues[0].value.toAddressArray(); - } -} - -export class SweepTimelockBalancesCall__Outputs { - _call: SweepTimelockBalancesCall; - - constructor(call: SweepTimelockBalancesCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class TimelockDepositToCall extends ethereum.Call { - get inputs(): TimelockDepositToCall__Inputs { - return new TimelockDepositToCall__Inputs(this); - } - - get outputs(): TimelockDepositToCall__Outputs { - return new TimelockDepositToCall__Outputs(this); - } -} - -export class TimelockDepositToCall__Inputs { - _call: TimelockDepositToCall; - - constructor(call: TimelockDepositToCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get controlledToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class TimelockDepositToCall__Outputs { - _call: TimelockDepositToCall; - - constructor(call: TimelockDepositToCall) { - this._call = call; - } -} - -export class TransferExternalERC20Call extends ethereum.Call { - get inputs(): TransferExternalERC20Call__Inputs { - return new TransferExternalERC20Call__Inputs(this); - } - - get outputs(): TransferExternalERC20Call__Outputs { - return new TransferExternalERC20Call__Outputs(this); - } -} - -export class TransferExternalERC20Call__Inputs { - _call: TransferExternalERC20Call; - - constructor(call: TransferExternalERC20Call) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get externalToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferExternalERC20Call__Outputs { - _call: TransferExternalERC20Call; - - constructor(call: TransferExternalERC20Call) { - this._call = call; - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get newOwner(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} - -export class WithdrawInstantlyFromCall extends ethereum.Call { - get inputs(): WithdrawInstantlyFromCall__Inputs { - return new WithdrawInstantlyFromCall__Inputs(this); - } - - get outputs(): WithdrawInstantlyFromCall__Outputs { - return new WithdrawInstantlyFromCall__Outputs(this); - } -} - -export class WithdrawInstantlyFromCall__Inputs { - _call: WithdrawInstantlyFromCall; - - constructor(call: WithdrawInstantlyFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get controlledToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get maximumExitFee(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class WithdrawInstantlyFromCall__Outputs { - _call: WithdrawInstantlyFromCall; - - constructor(call: WithdrawInstantlyFromCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class WithdrawReserveCall extends ethereum.Call { - get inputs(): WithdrawReserveCall__Inputs { - return new WithdrawReserveCall__Inputs(this); - } - - get outputs(): WithdrawReserveCall__Outputs { - return new WithdrawReserveCall__Outputs(this); - } -} - -export class WithdrawReserveCall__Inputs { - _call: WithdrawReserveCall; - - constructor(call: WithdrawReserveCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class WithdrawReserveCall__Outputs { - _call: WithdrawReserveCall; - - constructor(call: WithdrawReserveCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class WithdrawWithTimelockFromCall extends ethereum.Call { - get inputs(): WithdrawWithTimelockFromCall__Inputs { - return new WithdrawWithTimelockFromCall__Inputs(this); - } - - get outputs(): WithdrawWithTimelockFromCall__Outputs { - return new WithdrawWithTimelockFromCall__Outputs(this); - } -} - -export class WithdrawWithTimelockFromCall__Inputs { - _call: WithdrawWithTimelockFromCall; - - constructor(call: WithdrawWithTimelockFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get controlledToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class WithdrawWithTimelockFromCall__Outputs { - _call: WithdrawWithTimelockFromCall; - - constructor(call: WithdrawWithTimelockFromCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} diff --git a/generated/templates/ControlledToken/ControlledToken.ts b/generated/templates/ControlledToken/ControlledToken.ts deleted file mode 100644 index 91686f3..0000000 --- a/generated/templates/ControlledToken/ControlledToken.ts +++ /dev/null @@ -1,672 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - ethereum, - JSONValue, - TypedMap, - Entity, - Bytes, - Address, - BigInt -} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ControlledToken extends ethereum.SmartContract { - static bind(address: Address): ControlledToken { - return new ControlledToken("ControlledToken", address); - } - - allowance(owner: Address, spender: Address): BigInt { - let result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - let result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - let result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - controller(): Address { - let result = super.call("controller", "controller():(address)", []); - - return result[0].toAddress(); - } - - try_controller(): ethereum.CallResult
{ - let result = super.tryCall("controller", "controller():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - decimals(): i32 { - let result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - let result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { - let result = super.call( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseAllowance( - spender: Address, - subtractedValue: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - increaseAllowance(spender: Address, addedValue: BigInt): boolean { - let result = super.call( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseAllowance( - spender: Address, - addedValue: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - let result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - let result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - symbol(): string { - let result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - let result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - let result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - let result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - let result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class ControllerBurnCall extends ethereum.Call { - get inputs(): ControllerBurnCall__Inputs { - return new ControllerBurnCall__Inputs(this); - } - - get outputs(): ControllerBurnCall__Outputs { - return new ControllerBurnCall__Outputs(this); - } -} - -export class ControllerBurnCall__Inputs { - _call: ControllerBurnCall; - - constructor(call: ControllerBurnCall) { - this._call = call; - } - - get _user(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ControllerBurnCall__Outputs { - _call: ControllerBurnCall; - - constructor(call: ControllerBurnCall) { - this._call = call; - } -} - -export class ControllerBurnFromCall extends ethereum.Call { - get inputs(): ControllerBurnFromCall__Inputs { - return new ControllerBurnFromCall__Inputs(this); - } - - get outputs(): ControllerBurnFromCall__Outputs { - return new ControllerBurnFromCall__Outputs(this); - } -} - -export class ControllerBurnFromCall__Inputs { - _call: ControllerBurnFromCall; - - constructor(call: ControllerBurnFromCall) { - this._call = call; - } - - get _operator(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _user(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class ControllerBurnFromCall__Outputs { - _call: ControllerBurnFromCall; - - constructor(call: ControllerBurnFromCall) { - this._call = call; - } -} - -export class ControllerMintCall extends ethereum.Call { - get inputs(): ControllerMintCall__Inputs { - return new ControllerMintCall__Inputs(this); - } - - get outputs(): ControllerMintCall__Outputs { - return new ControllerMintCall__Outputs(this); - } -} - -export class ControllerMintCall__Inputs { - _call: ControllerMintCall; - - constructor(call: ControllerMintCall) { - this._call = call; - } - - get _user(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ControllerMintCall__Outputs { - _call: ControllerMintCall; - - constructor(call: ControllerMintCall) { - this._call = call; - } -} - -export class DecreaseAllowanceCall extends ethereum.Call { - get inputs(): DecreaseAllowanceCall__Inputs { - return new DecreaseAllowanceCall__Inputs(this); - } - - get outputs(): DecreaseAllowanceCall__Outputs { - return new DecreaseAllowanceCall__Outputs(this); - } -} - -export class DecreaseAllowanceCall__Inputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get subtractedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseAllowanceCall__Outputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseAllowanceCall extends ethereum.Call { - get inputs(): IncreaseAllowanceCall__Inputs { - return new IncreaseAllowanceCall__Inputs(this); - } - - get outputs(): IncreaseAllowanceCall__Outputs { - return new IncreaseAllowanceCall__Outputs(this); - } -} - -export class IncreaseAllowanceCall__Inputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get addedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseAllowanceCall__Outputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _name(): string { - return this._call.inputValues[0].value.toString(); - } - - get _symbol(): string { - return this._call.inputValues[1].value.toString(); - } - - get _decimals(): i32 { - return this._call.inputValues[2].value.toI32(); - } - - get _controller(): Address { - return this._call.inputValues[3].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/generated/templates/SingleRandomWinner/Comptroller.ts b/generated/templates/SingleRandomWinner/Comptroller.ts deleted file mode 100644 index 391003b..0000000 --- a/generated/templates/SingleRandomWinner/Comptroller.ts +++ /dev/null @@ -1,1914 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - ethereum, - JSONValue, - TypedMap, - Entity, - Bytes, - Address, - BigInt -} from "@graphprotocol/graph-ts"; - -export class BalanceDripActivated extends ethereum.Event { - get params(): BalanceDripActivated__Params { - return new BalanceDripActivated__Params(this); - } -} - -export class BalanceDripActivated__Params { - _event: BalanceDripActivated; - - constructor(event: BalanceDripActivated) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get dripRatePerSecond(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BalanceDripDeactivated extends ethereum.Event { - get params(): BalanceDripDeactivated__Params { - return new BalanceDripDeactivated__Params(this); - } -} - -export class BalanceDripDeactivated__Params { - _event: BalanceDripDeactivated; - - constructor(event: BalanceDripDeactivated) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } -} - -export class BalanceDripDripped extends ethereum.Event { - get params(): BalanceDripDripped__Params { - return new BalanceDripDripped__Params(this); - } -} - -export class BalanceDripDripped__Params { - _event: BalanceDripDripped; - - constructor(event: BalanceDripDripped) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get user(): Address { - return this._event.parameters[3].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class BalanceDripRateSet extends ethereum.Event { - get params(): BalanceDripRateSet__Params { - return new BalanceDripRateSet__Params(this); - } -} - -export class BalanceDripRateSet__Params { - _event: BalanceDripRateSet; - - constructor(event: BalanceDripRateSet) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get dripRatePerSecond(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class DripTokenClaimed extends ethereum.Event { - get params(): DripTokenClaimed__Params { - return new DripTokenClaimed__Params(this); - } -} - -export class DripTokenClaimed__Params { - _event: DripTokenClaimed; - - constructor(event: DripTokenClaimed) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get user(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class DripTokenDripped extends ethereum.Event { - get params(): DripTokenDripped__Params { - return new DripTokenDripped__Params(this); - } -} - -export class DripTokenDripped__Params { - _event: DripTokenDripped; - - constructor(event: DripTokenDripped) { - this._event = event; - } - - get dripToken(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get user(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class TransferredOut extends ethereum.Event { - get params(): TransferredOut__Params { - return new TransferredOut__Params(this); - } -} - -export class TransferredOut__Params { - _event: TransferredOut; - - constructor(event: TransferredOut) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class VolumeDripActivated extends ethereum.Event { - get params(): VolumeDripActivated__Params { - return new VolumeDripActivated__Params(this); - } -} - -export class VolumeDripActivated__Params { - _event: VolumeDripActivated; - - constructor(event: VolumeDripActivated) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get isReferral(): boolean { - return this._event.parameters[3].value.toBoolean(); - } - - get periodSeconds(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get dripAmount(): BigInt { - return this._event.parameters[5].value.toBigInt(); - } -} - -export class VolumeDripDeactivated extends ethereum.Event { - get params(): VolumeDripDeactivated__Params { - return new VolumeDripDeactivated__Params(this); - } -} - -export class VolumeDripDeactivated__Params { - _event: VolumeDripDeactivated; - - constructor(event: VolumeDripDeactivated) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get isReferral(): boolean { - return this._event.parameters[3].value.toBoolean(); - } -} - -export class VolumeDripDripped extends ethereum.Event { - get params(): VolumeDripDripped__Params { - return new VolumeDripDripped__Params(this); - } -} - -export class VolumeDripDripped__Params { - _event: VolumeDripDripped; - - constructor(event: VolumeDripDripped) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get isReferral(): boolean { - return this._event.parameters[3].value.toBoolean(); - } - - get user(): Address { - return this._event.parameters[4].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[5].value.toBigInt(); - } -} - -export class VolumeDripPeriodEnded extends ethereum.Event { - get params(): VolumeDripPeriodEnded__Params { - return new VolumeDripPeriodEnded__Params(this); - } -} - -export class VolumeDripPeriodEnded__Params { - _event: VolumeDripPeriodEnded; - - constructor(event: VolumeDripPeriodEnded) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get isReferral(): boolean { - return this._event.parameters[3].value.toBoolean(); - } - - get period(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get totalSupply(): BigInt { - return this._event.parameters[5].value.toBigInt(); - } - - get drippedTokens(): BigInt { - return this._event.parameters[6].value.toBigInt(); - } -} - -export class VolumeDripPeriodStarted extends ethereum.Event { - get params(): VolumeDripPeriodStarted__Params { - return new VolumeDripPeriodStarted__Params(this); - } -} - -export class VolumeDripPeriodStarted__Params { - _event: VolumeDripPeriodStarted; - - constructor(event: VolumeDripPeriodStarted) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get isReferral(): boolean { - return this._event.parameters[3].value.toBoolean(); - } - - get period(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get dripAmount(): BigInt { - return this._event.parameters[5].value.toBigInt(); - } - - get endTime(): BigInt { - return this._event.parameters[6].value.toBigInt(); - } -} - -export class VolumeDripSet extends ethereum.Event { - get params(): VolumeDripSet__Params { - return new VolumeDripSet__Params(this); - } -} - -export class VolumeDripSet__Params { - _event: VolumeDripSet; - - constructor(event: VolumeDripSet) { - this._event = event; - } - - get source(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get measure(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get dripToken(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get isReferral(): boolean { - return this._event.parameters[3].value.toBoolean(); - } - - get periodSeconds(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get dripAmount(): BigInt { - return this._event.parameters[5].value.toBigInt(); - } -} - -export class Comptroller__balanceOfClaimsResultValue0Struct extends ethereum.Tuple { - get dripToken(): Address { - return this[0].toAddress(); - } - - get balance(): BigInt { - return this[1].toBigInt(); - } -} - -export class Comptroller__getBalanceDripResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } -} - -export class Comptroller__getVolumeDripResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } -} - -export class Comptroller__getVolumeDripPeriodResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } -} - -export class Comptroller__updateAndClaimDripsResultValue0Struct extends ethereum.Tuple { - get dripToken(): Address { - return this[0].toAddress(); - } - - get balance(): BigInt { - return this[1].toBigInt(); - } -} - -export class Comptroller__updateAndClaimDripsInputPairsStruct extends ethereum.Tuple { - get source(): Address { - return this[0].toAddress(); - } - - get measure(): Address { - return this[1].toAddress(); - } -} - -export class Comptroller__updateDripsResultValue0Struct extends ethereum.Tuple { - get dripToken(): Address { - return this[0].toAddress(); - } - - get balance(): BigInt { - return this[1].toBigInt(); - } -} - -export class Comptroller__updateDripsInputPairsStruct extends ethereum.Tuple { - get source(): Address { - return this[0].toAddress(); - } - - get measure(): Address { - return this[1].toAddress(); - } -} - -export class Comptroller extends ethereum.SmartContract { - static bind(address: Address): Comptroller { - return new Comptroller("Comptroller", address); - } - - balanceOfClaims( - user: Address, - dripTokens: Array
- ): Array { - let result = super.call( - "balanceOfClaims", - "balanceOfClaims(address,address[]):((address,uint256)[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(dripTokens) - ] - ); - - return result[0].toTupleArray< - Comptroller__balanceOfClaimsResultValue0Struct - >(); - } - - try_balanceOfClaims( - user: Address, - dripTokens: Array
- ): ethereum.CallResult< - Array - > { - let result = super.tryCall( - "balanceOfClaims", - "balanceOfClaims(address,address[]):((address,uint256)[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(dripTokens) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - value[0].toTupleArray() - ); - } - - balanceOfDrip(user: Address, dripToken: Address): BigInt { - let result = super.call( - "balanceOfDrip", - "balanceOfDrip(address,address):(uint256)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(dripToken)] - ); - - return result[0].toBigInt(); - } - - try_balanceOfDrip( - user: Address, - dripToken: Address - ): ethereum.CallResult { - let result = super.tryCall( - "balanceOfDrip", - "balanceOfDrip(address,address):(uint256)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(dripToken)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getActiveBalanceDripTokens( - source: Address, - measure: Address - ): Array
{ - let result = super.call( - "getActiveBalanceDripTokens", - "getActiveBalanceDripTokens(address,address):(address[])", - [ethereum.Value.fromAddress(source), ethereum.Value.fromAddress(measure)] - ); - - return result[0].toAddressArray(); - } - - try_getActiveBalanceDripTokens( - source: Address, - measure: Address - ): ethereum.CallResult> { - let result = super.tryCall( - "getActiveBalanceDripTokens", - "getActiveBalanceDripTokens(address,address):(address[])", - [ethereum.Value.fromAddress(source), ethereum.Value.fromAddress(measure)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddressArray()); - } - - getActiveVolumeDripTokens( - source: Address, - measure: Address, - isReferral: boolean - ): Array
{ - let result = super.call( - "getActiveVolumeDripTokens", - "getActiveVolumeDripTokens(address,address,bool):(address[])", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromBoolean(isReferral) - ] - ); - - return result[0].toAddressArray(); - } - - try_getActiveVolumeDripTokens( - source: Address, - measure: Address, - isReferral: boolean - ): ethereum.CallResult> { - let result = super.tryCall( - "getActiveVolumeDripTokens", - "getActiveVolumeDripTokens(address,address,bool):(address[])", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromBoolean(isReferral) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddressArray()); - } - - getBalanceDrip( - source: Address, - measure: Address, - dripToken: Address - ): Comptroller__getBalanceDripResult { - let result = super.call( - "getBalanceDrip", - "getBalanceDrip(address,address,address):(uint256,uint128,uint32)", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromAddress(dripToken) - ] - ); - - return new Comptroller__getBalanceDripResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getBalanceDrip( - source: Address, - measure: Address, - dripToken: Address - ): ethereum.CallResult { - let result = super.tryCall( - "getBalanceDrip", - "getBalanceDrip(address,address,address):(uint256,uint128,uint32)", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromAddress(dripToken) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new Comptroller__getBalanceDripResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getVolumeDrip( - source: Address, - measure: Address, - dripToken: Address, - isReferral: boolean - ): Comptroller__getVolumeDripResult { - let result = super.call( - "getVolumeDrip", - "getVolumeDrip(address,address,address,bool):(uint256,uint256,uint256)", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromAddress(dripToken), - ethereum.Value.fromBoolean(isReferral) - ] - ); - - return new Comptroller__getVolumeDripResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getVolumeDrip( - source: Address, - measure: Address, - dripToken: Address, - isReferral: boolean - ): ethereum.CallResult { - let result = super.tryCall( - "getVolumeDrip", - "getVolumeDrip(address,address,address,bool):(uint256,uint256,uint256)", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromAddress(dripToken), - ethereum.Value.fromBoolean(isReferral) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new Comptroller__getVolumeDripResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getVolumeDripPeriod( - source: Address, - measure: Address, - dripToken: Address, - isReferral: boolean, - period: i32 - ): Comptroller__getVolumeDripPeriodResult { - let result = super.call( - "getVolumeDripPeriod", - "getVolumeDripPeriod(address,address,address,bool,uint16):(uint112,uint112,uint32)", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromAddress(dripToken), - ethereum.Value.fromBoolean(isReferral), - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(period)) - ] - ); - - return new Comptroller__getVolumeDripPeriodResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getVolumeDripPeriod( - source: Address, - measure: Address, - dripToken: Address, - isReferral: boolean, - period: i32 - ): ethereum.CallResult { - let result = super.tryCall( - "getVolumeDripPeriod", - "getVolumeDripPeriod(address,address,address,bool,uint16):(uint112,uint112,uint32)", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromAddress(dripToken), - ethereum.Value.fromBoolean(isReferral), - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(period)) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new Comptroller__getVolumeDripPeriodResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - isVolumeDripActive( - source: Address, - measure: Address, - dripToken: Address, - isReferral: boolean - ): boolean { - let result = super.call( - "isVolumeDripActive", - "isVolumeDripActive(address,address,address,bool):(bool)", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromAddress(dripToken), - ethereum.Value.fromBoolean(isReferral) - ] - ); - - return result[0].toBoolean(); - } - - try_isVolumeDripActive( - source: Address, - measure: Address, - dripToken: Address, - isReferral: boolean - ): ethereum.CallResult { - let result = super.tryCall( - "isVolumeDripActive", - "isVolumeDripActive(address,address,address,bool):(bool)", - [ - ethereum.Value.fromAddress(source), - ethereum.Value.fromAddress(measure), - ethereum.Value.fromAddress(dripToken), - ethereum.Value.fromBoolean(isReferral) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - owner(): Address { - let result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - let result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - supportsInterface(interfaceId: Bytes): boolean { - let result = super.call( - "supportsInterface", - "supportsInterface(bytes4):(bool)", - [ethereum.Value.fromFixedBytes(interfaceId)] - ); - - return result[0].toBoolean(); - } - - try_supportsInterface(interfaceId: Bytes): ethereum.CallResult { - let result = super.tryCall( - "supportsInterface", - "supportsInterface(bytes4):(bool)", - [ethereum.Value.fromFixedBytes(interfaceId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - updateAndClaimDrips( - pairs: Array, - user: Address, - dripTokens: Array
- ): Array { - let result = super.call( - "updateAndClaimDrips", - "updateAndClaimDrips((address,address)[],address,address[]):((address,uint256)[])", - [ - ethereum.Value.fromTupleArray(pairs), - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(dripTokens) - ] - ); - - return result[0].toTupleArray< - Comptroller__updateAndClaimDripsResultValue0Struct - >(); - } - - try_updateAndClaimDrips( - pairs: Array, - user: Address, - dripTokens: Array
- ): ethereum.CallResult< - Array - > { - let result = super.tryCall( - "updateAndClaimDrips", - "updateAndClaimDrips((address,address)[],address,address[]):((address,uint256)[])", - [ - ethereum.Value.fromTupleArray(pairs), - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(dripTokens) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - value[0].toTupleArray< - Comptroller__updateAndClaimDripsResultValue0Struct - >() - ); - } - - updateDrips( - pairs: Array, - user: Address, - dripTokens: Array
- ): Array { - let result = super.call( - "updateDrips", - "updateDrips((address,address)[],address,address[]):((address,uint256)[])", - [ - ethereum.Value.fromTupleArray(pairs), - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(dripTokens) - ] - ); - - return result[0].toTupleArray(); - } - - try_updateDrips( - pairs: Array, - user: Address, - dripTokens: Array
- ): ethereum.CallResult> { - let result = super.tryCall( - "updateDrips", - "updateDrips((address,address)[],address,address[]):((address,uint256)[])", - [ - ethereum.Value.fromTupleArray(pairs), - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(dripTokens) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - value[0].toTupleArray() - ); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ActivateBalanceDripCall extends ethereum.Call { - get inputs(): ActivateBalanceDripCall__Inputs { - return new ActivateBalanceDripCall__Inputs(this); - } - - get outputs(): ActivateBalanceDripCall__Outputs { - return new ActivateBalanceDripCall__Outputs(this); - } -} - -export class ActivateBalanceDripCall__Inputs { - _call: ActivateBalanceDripCall; - - constructor(call: ActivateBalanceDripCall) { - this._call = call; - } - - get source(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get measure(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get dripToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get dripRatePerSecond(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class ActivateBalanceDripCall__Outputs { - _call: ActivateBalanceDripCall; - - constructor(call: ActivateBalanceDripCall) { - this._call = call; - } -} - -export class ActivateVolumeDripCall extends ethereum.Call { - get inputs(): ActivateVolumeDripCall__Inputs { - return new ActivateVolumeDripCall__Inputs(this); - } - - get outputs(): ActivateVolumeDripCall__Outputs { - return new ActivateVolumeDripCall__Outputs(this); - } -} - -export class ActivateVolumeDripCall__Inputs { - _call: ActivateVolumeDripCall; - - constructor(call: ActivateVolumeDripCall) { - this._call = call; - } - - get source(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get measure(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get dripToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get isReferral(): boolean { - return this._call.inputValues[3].value.toBoolean(); - } - - get periodSeconds(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get dripAmount(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get endTime(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } -} - -export class ActivateVolumeDripCall__Outputs { - _call: ActivateVolumeDripCall; - - constructor(call: ActivateVolumeDripCall) { - this._call = call; - } -} - -export class BeforeTokenMintCall extends ethereum.Call { - get inputs(): BeforeTokenMintCall__Inputs { - return new BeforeTokenMintCall__Inputs(this); - } - - get outputs(): BeforeTokenMintCall__Outputs { - return new BeforeTokenMintCall__Outputs(this); - } -} - -export class BeforeTokenMintCall__Inputs { - _call: BeforeTokenMintCall; - - constructor(call: BeforeTokenMintCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get measure(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get referrer(): Address { - return this._call.inputValues[3].value.toAddress(); - } -} - -export class BeforeTokenMintCall__Outputs { - _call: BeforeTokenMintCall; - - constructor(call: BeforeTokenMintCall) { - this._call = call; - } -} - -export class BeforeTokenTransferCall extends ethereum.Call { - get inputs(): BeforeTokenTransferCall__Inputs { - return new BeforeTokenTransferCall__Inputs(this); - } - - get outputs(): BeforeTokenTransferCall__Outputs { - return new BeforeTokenTransferCall__Outputs(this); - } -} - -export class BeforeTokenTransferCall__Inputs { - _call: BeforeTokenTransferCall; - - constructor(call: BeforeTokenTransferCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value2(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get measure(): Address { - return this._call.inputValues[3].value.toAddress(); - } -} - -export class BeforeTokenTransferCall__Outputs { - _call: BeforeTokenTransferCall; - - constructor(call: BeforeTokenTransferCall) { - this._call = call; - } -} - -export class CaptureClaimsForBalanceDripsForPairsCall extends ethereum.Call { - get inputs(): CaptureClaimsForBalanceDripsForPairsCall__Inputs { - return new CaptureClaimsForBalanceDripsForPairsCall__Inputs(this); - } - - get outputs(): CaptureClaimsForBalanceDripsForPairsCall__Outputs { - return new CaptureClaimsForBalanceDripsForPairsCall__Outputs(this); - } -} - -export class CaptureClaimsForBalanceDripsForPairsCall__Inputs { - _call: CaptureClaimsForBalanceDripsForPairsCall; - - constructor(call: CaptureClaimsForBalanceDripsForPairsCall) { - this._call = call; - } - - get pairs(): Array { - return this._call.inputValues[0].value.toTupleArray< - CaptureClaimsForBalanceDripsForPairsCallPairsStruct - >(); - } - - get user(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get dripTokens(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } -} - -export class CaptureClaimsForBalanceDripsForPairsCall__Outputs { - _call: CaptureClaimsForBalanceDripsForPairsCall; - - constructor(call: CaptureClaimsForBalanceDripsForPairsCall) { - this._call = call; - } -} - -export class CaptureClaimsForBalanceDripsForPairsCallPairsStruct extends ethereum.Tuple { - get source(): Address { - return this[0].toAddress(); - } - - get measure(): Address { - return this[1].toAddress(); - } -} - -export class ClaimDripCall extends ethereum.Call { - get inputs(): ClaimDripCall__Inputs { - return new ClaimDripCall__Inputs(this); - } - - get outputs(): ClaimDripCall__Outputs { - return new ClaimDripCall__Outputs(this); - } -} - -export class ClaimDripCall__Inputs { - _call: ClaimDripCall; - - constructor(call: ClaimDripCall) { - this._call = call; - } - - get user(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get dripToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class ClaimDripCall__Outputs { - _call: ClaimDripCall; - - constructor(call: ClaimDripCall) { - this._call = call; - } -} - -export class ClaimDripsCall extends ethereum.Call { - get inputs(): ClaimDripsCall__Inputs { - return new ClaimDripsCall__Inputs(this); - } - - get outputs(): ClaimDripsCall__Outputs { - return new ClaimDripsCall__Outputs(this); - } -} - -export class ClaimDripsCall__Inputs { - _call: ClaimDripsCall; - - constructor(call: ClaimDripsCall) { - this._call = call; - } - - get user(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get dripTokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } -} - -export class ClaimDripsCall__Outputs { - _call: ClaimDripsCall; - - constructor(call: ClaimDripsCall) { - this._call = call; - } -} - -export class DeactivateBalanceDripCall extends ethereum.Call { - get inputs(): DeactivateBalanceDripCall__Inputs { - return new DeactivateBalanceDripCall__Inputs(this); - } - - get outputs(): DeactivateBalanceDripCall__Outputs { - return new DeactivateBalanceDripCall__Outputs(this); - } -} - -export class DeactivateBalanceDripCall__Inputs { - _call: DeactivateBalanceDripCall; - - constructor(call: DeactivateBalanceDripCall) { - this._call = call; - } - - get source(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get measure(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get dripToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get prevDripToken(): Address { - return this._call.inputValues[3].value.toAddress(); - } -} - -export class DeactivateBalanceDripCall__Outputs { - _call: DeactivateBalanceDripCall; - - constructor(call: DeactivateBalanceDripCall) { - this._call = call; - } -} - -export class DeactivateVolumeDripCall extends ethereum.Call { - get inputs(): DeactivateVolumeDripCall__Inputs { - return new DeactivateVolumeDripCall__Inputs(this); - } - - get outputs(): DeactivateVolumeDripCall__Outputs { - return new DeactivateVolumeDripCall__Outputs(this); - } -} - -export class DeactivateVolumeDripCall__Inputs { - _call: DeactivateVolumeDripCall; - - constructor(call: DeactivateVolumeDripCall) { - this._call = call; - } - - get source(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get measure(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get dripToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get isReferral(): boolean { - return this._call.inputValues[3].value.toBoolean(); - } - - get prevDripToken(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class DeactivateVolumeDripCall__Outputs { - _call: DeactivateVolumeDripCall; - - constructor(call: DeactivateVolumeDripCall) { - this._call = call; - } -} - -export class MintAndCaptureVolumeDripsForPairsCall extends ethereum.Call { - get inputs(): MintAndCaptureVolumeDripsForPairsCall__Inputs { - return new MintAndCaptureVolumeDripsForPairsCall__Inputs(this); - } - - get outputs(): MintAndCaptureVolumeDripsForPairsCall__Outputs { - return new MintAndCaptureVolumeDripsForPairsCall__Outputs(this); - } -} - -export class MintAndCaptureVolumeDripsForPairsCall__Inputs { - _call: MintAndCaptureVolumeDripsForPairsCall; - - constructor(call: MintAndCaptureVolumeDripsForPairsCall) { - this._call = call; - } - - get pairs(): Array { - return this._call.inputValues[0].value.toTupleArray< - MintAndCaptureVolumeDripsForPairsCallPairsStruct - >(); - } - - get user(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get dripTokens(): Array
{ - return this._call.inputValues[3].value.toAddressArray(); - } -} - -export class MintAndCaptureVolumeDripsForPairsCall__Outputs { - _call: MintAndCaptureVolumeDripsForPairsCall; - - constructor(call: MintAndCaptureVolumeDripsForPairsCall) { - this._call = call; - } -} - -export class MintAndCaptureVolumeDripsForPairsCallPairsStruct extends ethereum.Tuple { - get source(): Address { - return this[0].toAddress(); - } - - get measure(): Address { - return this[1].toAddress(); - } -} - -export class RenounceOwnershipCall extends ethereum.Call { - get inputs(): RenounceOwnershipCall__Inputs { - return new RenounceOwnershipCall__Inputs(this); - } - - get outputs(): RenounceOwnershipCall__Outputs { - return new RenounceOwnershipCall__Outputs(this); - } -} - -export class RenounceOwnershipCall__Inputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall__Outputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class SetBalanceDripRateCall extends ethereum.Call { - get inputs(): SetBalanceDripRateCall__Inputs { - return new SetBalanceDripRateCall__Inputs(this); - } - - get outputs(): SetBalanceDripRateCall__Outputs { - return new SetBalanceDripRateCall__Outputs(this); - } -} - -export class SetBalanceDripRateCall__Inputs { - _call: SetBalanceDripRateCall; - - constructor(call: SetBalanceDripRateCall) { - this._call = call; - } - - get source(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get measure(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get dripToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get dripRatePerSecond(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetBalanceDripRateCall__Outputs { - _call: SetBalanceDripRateCall; - - constructor(call: SetBalanceDripRateCall) { - this._call = call; - } -} - -export class SetVolumeDripCall extends ethereum.Call { - get inputs(): SetVolumeDripCall__Inputs { - return new SetVolumeDripCall__Inputs(this); - } - - get outputs(): SetVolumeDripCall__Outputs { - return new SetVolumeDripCall__Outputs(this); - } -} - -export class SetVolumeDripCall__Inputs { - _call: SetVolumeDripCall; - - constructor(call: SetVolumeDripCall) { - this._call = call; - } - - get source(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get measure(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get dripToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get isReferral(): boolean { - return this._call.inputValues[3].value.toBoolean(); - } - - get periodSeconds(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get dripAmount(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } -} - -export class SetVolumeDripCall__Outputs { - _call: SetVolumeDripCall; - - constructor(call: SetVolumeDripCall) { - this._call = call; - } -} - -export class TransferOutCall extends ethereum.Call { - get inputs(): TransferOutCall__Inputs { - return new TransferOutCall__Inputs(this); - } - - get outputs(): TransferOutCall__Outputs { - return new TransferOutCall__Outputs(this); - } -} - -export class TransferOutCall__Inputs { - _call: TransferOutCall; - - constructor(call: TransferOutCall) { - this._call = call; - } - - get token(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferOutCall__Outputs { - _call: TransferOutCall; - - constructor(call: TransferOutCall) { - this._call = call; - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get newOwner(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} - -export class UpdateActiveBalanceDripsForPairsCall extends ethereum.Call { - get inputs(): UpdateActiveBalanceDripsForPairsCall__Inputs { - return new UpdateActiveBalanceDripsForPairsCall__Inputs(this); - } - - get outputs(): UpdateActiveBalanceDripsForPairsCall__Outputs { - return new UpdateActiveBalanceDripsForPairsCall__Outputs(this); - } -} - -export class UpdateActiveBalanceDripsForPairsCall__Inputs { - _call: UpdateActiveBalanceDripsForPairsCall; - - constructor(call: UpdateActiveBalanceDripsForPairsCall) { - this._call = call; - } - - get pairs(): Array { - return this._call.inputValues[0].value.toTupleArray< - UpdateActiveBalanceDripsForPairsCallPairsStruct - >(); - } -} - -export class UpdateActiveBalanceDripsForPairsCall__Outputs { - _call: UpdateActiveBalanceDripsForPairsCall; - - constructor(call: UpdateActiveBalanceDripsForPairsCall) { - this._call = call; - } -} - -export class UpdateActiveBalanceDripsForPairsCallPairsStruct extends ethereum.Tuple { - get source(): Address { - return this[0].toAddress(); - } - - get measure(): Address { - return this[1].toAddress(); - } -} - -export class UpdateActiveVolumeDripsForPairsCall extends ethereum.Call { - get inputs(): UpdateActiveVolumeDripsForPairsCall__Inputs { - return new UpdateActiveVolumeDripsForPairsCall__Inputs(this); - } - - get outputs(): UpdateActiveVolumeDripsForPairsCall__Outputs { - return new UpdateActiveVolumeDripsForPairsCall__Outputs(this); - } -} - -export class UpdateActiveVolumeDripsForPairsCall__Inputs { - _call: UpdateActiveVolumeDripsForPairsCall; - - constructor(call: UpdateActiveVolumeDripsForPairsCall) { - this._call = call; - } - - get pairs(): Array { - return this._call.inputValues[0].value.toTupleArray< - UpdateActiveVolumeDripsForPairsCallPairsStruct - >(); - } -} - -export class UpdateActiveVolumeDripsForPairsCall__Outputs { - _call: UpdateActiveVolumeDripsForPairsCall; - - constructor(call: UpdateActiveVolumeDripsForPairsCall) { - this._call = call; - } -} - -export class UpdateActiveVolumeDripsForPairsCallPairsStruct extends ethereum.Tuple { - get source(): Address { - return this[0].toAddress(); - } - - get measure(): Address { - return this[1].toAddress(); - } -} - -export class UpdateAndClaimDripsCall extends ethereum.Call { - get inputs(): UpdateAndClaimDripsCall__Inputs { - return new UpdateAndClaimDripsCall__Inputs(this); - } - - get outputs(): UpdateAndClaimDripsCall__Outputs { - return new UpdateAndClaimDripsCall__Outputs(this); - } -} - -export class UpdateAndClaimDripsCall__Inputs { - _call: UpdateAndClaimDripsCall; - - constructor(call: UpdateAndClaimDripsCall) { - this._call = call; - } - - get pairs(): Array { - return this._call.inputValues[0].value.toTupleArray< - UpdateAndClaimDripsCallPairsStruct - >(); - } - - get user(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get dripTokens(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } -} - -export class UpdateAndClaimDripsCall__Outputs { - _call: UpdateAndClaimDripsCall; - - constructor(call: UpdateAndClaimDripsCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toTupleArray< - UpdateAndClaimDripsCallValue0Struct - >(); - } -} - -export class UpdateAndClaimDripsCallPairsStruct extends ethereum.Tuple { - get source(): Address { - return this[0].toAddress(); - } - - get measure(): Address { - return this[1].toAddress(); - } -} - -export class UpdateAndClaimDripsCallValue0Struct extends ethereum.Tuple { - get dripToken(): Address { - return this[0].toAddress(); - } - - get balance(): BigInt { - return this[1].toBigInt(); - } -} - -export class UpdateDripsCall extends ethereum.Call { - get inputs(): UpdateDripsCall__Inputs { - return new UpdateDripsCall__Inputs(this); - } - - get outputs(): UpdateDripsCall__Outputs { - return new UpdateDripsCall__Outputs(this); - } -} - -export class UpdateDripsCall__Inputs { - _call: UpdateDripsCall; - - constructor(call: UpdateDripsCall) { - this._call = call; - } - - get pairs(): Array { - return this._call.inputValues[0].value.toTupleArray< - UpdateDripsCallPairsStruct - >(); - } - - get user(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get dripTokens(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } -} - -export class UpdateDripsCall__Outputs { - _call: UpdateDripsCall; - - constructor(call: UpdateDripsCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toTupleArray< - UpdateDripsCallValue0Struct - >(); - } -} - -export class UpdateDripsCallPairsStruct extends ethereum.Tuple { - get source(): Address { - return this[0].toAddress(); - } - - get measure(): Address { - return this[1].toAddress(); - } -} - -export class UpdateDripsCallValue0Struct extends ethereum.Tuple { - get dripToken(): Address { - return this[0].toAddress(); - } - - get balance(): BigInt { - return this[1].toBigInt(); - } -} diff --git a/generated/templates/SingleRandomWinner/ControlledToken.ts b/generated/templates/SingleRandomWinner/ControlledToken.ts deleted file mode 100644 index 91686f3..0000000 --- a/generated/templates/SingleRandomWinner/ControlledToken.ts +++ /dev/null @@ -1,672 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - ethereum, - JSONValue, - TypedMap, - Entity, - Bytes, - Address, - BigInt -} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ControlledToken extends ethereum.SmartContract { - static bind(address: Address): ControlledToken { - return new ControlledToken("ControlledToken", address); - } - - allowance(owner: Address, spender: Address): BigInt { - let result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - let result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - let result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - controller(): Address { - let result = super.call("controller", "controller():(address)", []); - - return result[0].toAddress(); - } - - try_controller(): ethereum.CallResult
{ - let result = super.tryCall("controller", "controller():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - decimals(): i32 { - let result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - let result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { - let result = super.call( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseAllowance( - spender: Address, - subtractedValue: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - increaseAllowance(spender: Address, addedValue: BigInt): boolean { - let result = super.call( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseAllowance( - spender: Address, - addedValue: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - let result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - let result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - symbol(): string { - let result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - let result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - let result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - let result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - let result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class ControllerBurnCall extends ethereum.Call { - get inputs(): ControllerBurnCall__Inputs { - return new ControllerBurnCall__Inputs(this); - } - - get outputs(): ControllerBurnCall__Outputs { - return new ControllerBurnCall__Outputs(this); - } -} - -export class ControllerBurnCall__Inputs { - _call: ControllerBurnCall; - - constructor(call: ControllerBurnCall) { - this._call = call; - } - - get _user(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ControllerBurnCall__Outputs { - _call: ControllerBurnCall; - - constructor(call: ControllerBurnCall) { - this._call = call; - } -} - -export class ControllerBurnFromCall extends ethereum.Call { - get inputs(): ControllerBurnFromCall__Inputs { - return new ControllerBurnFromCall__Inputs(this); - } - - get outputs(): ControllerBurnFromCall__Outputs { - return new ControllerBurnFromCall__Outputs(this); - } -} - -export class ControllerBurnFromCall__Inputs { - _call: ControllerBurnFromCall; - - constructor(call: ControllerBurnFromCall) { - this._call = call; - } - - get _operator(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _user(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class ControllerBurnFromCall__Outputs { - _call: ControllerBurnFromCall; - - constructor(call: ControllerBurnFromCall) { - this._call = call; - } -} - -export class ControllerMintCall extends ethereum.Call { - get inputs(): ControllerMintCall__Inputs { - return new ControllerMintCall__Inputs(this); - } - - get outputs(): ControllerMintCall__Outputs { - return new ControllerMintCall__Outputs(this); - } -} - -export class ControllerMintCall__Inputs { - _call: ControllerMintCall; - - constructor(call: ControllerMintCall) { - this._call = call; - } - - get _user(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ControllerMintCall__Outputs { - _call: ControllerMintCall; - - constructor(call: ControllerMintCall) { - this._call = call; - } -} - -export class DecreaseAllowanceCall extends ethereum.Call { - get inputs(): DecreaseAllowanceCall__Inputs { - return new DecreaseAllowanceCall__Inputs(this); - } - - get outputs(): DecreaseAllowanceCall__Outputs { - return new DecreaseAllowanceCall__Outputs(this); - } -} - -export class DecreaseAllowanceCall__Inputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get subtractedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseAllowanceCall__Outputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseAllowanceCall extends ethereum.Call { - get inputs(): IncreaseAllowanceCall__Inputs { - return new IncreaseAllowanceCall__Inputs(this); - } - - get outputs(): IncreaseAllowanceCall__Outputs { - return new IncreaseAllowanceCall__Outputs(this); - } -} - -export class IncreaseAllowanceCall__Inputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get addedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseAllowanceCall__Outputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _name(): string { - return this._call.inputValues[0].value.toString(); - } - - get _symbol(): string { - return this._call.inputValues[1].value.toString(); - } - - get _decimals(): i32 { - return this._call.inputValues[2].value.toI32(); - } - - get _controller(): Address { - return this._call.inputValues[3].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/generated/templates/SingleRandomWinner/ERC20.ts b/generated/templates/SingleRandomWinner/ERC20.ts deleted file mode 100644 index b0551bc..0000000 --- a/generated/templates/SingleRandomWinner/ERC20.ts +++ /dev/null @@ -1,706 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - ethereum, - JSONValue, - TypedMap, - Entity, - Bytes, - Address, - BigInt -} from "@graphprotocol/graph-ts"; - -export class MinterAdded extends ethereum.Event { - get params(): MinterAdded__Params { - return new MinterAdded__Params(this); - } -} - -export class MinterAdded__Params { - _event: MinterAdded; - - constructor(event: MinterAdded) { - this._event = event; - } - - get account(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class MinterRemoved extends ethereum.Event { - get params(): MinterRemoved__Params { - return new MinterRemoved__Params(this); - } -} - -export class MinterRemoved__Params { - _event: MinterRemoved; - - constructor(event: MinterRemoved) { - this._event = event; - } - - get account(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ERC20 extends ethereum.SmartContract { - static bind(address: Address): ERC20 { - return new ERC20("ERC20", address); - } - - name(): string { - let result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - let result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - approve(spender: Address, value: BigInt): boolean { - let result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalSupply(): BigInt { - let result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - let result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - decimals(): i32 { - let result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - let result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - increaseAllowance(spender: Address, addedValue: BigInt): boolean { - let result = super.call( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseAllowance( - spender: Address, - addedValue: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - mint(to: Address, value: BigInt): boolean { - let result = super.call("mint", "mint(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_mint(to: Address, value: BigInt): ethereum.CallResult { - let result = super.tryCall("mint", "mint(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(owner: Address): BigInt { - let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(owner: Address): ethereum.CallResult { - let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - let result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - let result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { - let result = super.call( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseAllowance( - spender: Address, - subtractedValue: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transfer(to: Address, value: BigInt): boolean { - let result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - isMinter(account: Address): boolean { - let result = super.call("isMinter", "isMinter(address):(bool)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBoolean(); - } - - try_isMinter(account: Address): ethereum.CallResult { - let result = super.tryCall("isMinter", "isMinter(address):(bool)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - allowance(owner: Address, spender: Address): BigInt { - let result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - let result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseAllowanceCall extends ethereum.Call { - get inputs(): IncreaseAllowanceCall__Inputs { - return new IncreaseAllowanceCall__Inputs(this); - } - - get outputs(): IncreaseAllowanceCall__Outputs { - return new IncreaseAllowanceCall__Outputs(this); - } -} - -export class IncreaseAllowanceCall__Inputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get addedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseAllowanceCall__Outputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class MintCall extends ethereum.Call { - get inputs(): MintCall__Inputs { - return new MintCall__Inputs(this); - } - - get outputs(): MintCall__Outputs { - return new MintCall__Outputs(this); - } -} - -export class MintCall__Inputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class MintCall__Outputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class AddMinterCall extends ethereum.Call { - get inputs(): AddMinterCall__Inputs { - return new AddMinterCall__Inputs(this); - } - - get outputs(): AddMinterCall__Outputs { - return new AddMinterCall__Outputs(this); - } -} - -export class AddMinterCall__Inputs { - _call: AddMinterCall; - - constructor(call: AddMinterCall) { - this._call = call; - } - - get account(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class AddMinterCall__Outputs { - _call: AddMinterCall; - - constructor(call: AddMinterCall) { - this._call = call; - } -} - -export class RenounceMinterCall extends ethereum.Call { - get inputs(): RenounceMinterCall__Inputs { - return new RenounceMinterCall__Inputs(this); - } - - get outputs(): RenounceMinterCall__Outputs { - return new RenounceMinterCall__Outputs(this); - } -} - -export class RenounceMinterCall__Inputs { - _call: RenounceMinterCall; - - constructor(call: RenounceMinterCall) { - this._call = call; - } -} - -export class RenounceMinterCall__Outputs { - _call: RenounceMinterCall; - - constructor(call: RenounceMinterCall) { - this._call = call; - } -} - -export class DecreaseAllowanceCall extends ethereum.Call { - get inputs(): DecreaseAllowanceCall__Inputs { - return new DecreaseAllowanceCall__Inputs(this); - } - - get outputs(): DecreaseAllowanceCall__Outputs { - return new DecreaseAllowanceCall__Outputs(this); - } -} - -export class DecreaseAllowanceCall__Inputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get subtractedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseAllowanceCall__Outputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} diff --git a/generated/templates/SingleRandomWinner/PrizePool.ts b/generated/templates/SingleRandomWinner/PrizePool.ts deleted file mode 100644 index 8aabba9..0000000 --- a/generated/templates/SingleRandomWinner/PrizePool.ts +++ /dev/null @@ -1,2108 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - ethereum, - JSONValue, - TypedMap, - Entity, - Bytes, - Address, - BigInt -} from "@graphprotocol/graph-ts"; - -export class AwardCaptured extends ethereum.Event { - get params(): AwardCaptured__Params { - return new AwardCaptured__Params(this); - } -} - -export class AwardCaptured__Params { - _event: AwardCaptured; - - constructor(event: AwardCaptured) { - this._event = event; - } - - get amount(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class Awarded extends ethereum.Event { - get params(): Awarded__Params { - return new Awarded__Params(this); - } -} - -export class Awarded__Params { - _event: Awarded; - - constructor(event: Awarded) { - this._event = event; - } - - get winner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class AwardedExternalERC20 extends ethereum.Event { - get params(): AwardedExternalERC20__Params { - return new AwardedExternalERC20__Params(this); - } -} - -export class AwardedExternalERC20__Params { - _event: AwardedExternalERC20; - - constructor(event: AwardedExternalERC20) { - this._event = event; - } - - get winner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class AwardedExternalERC721 extends ethereum.Event { - get params(): AwardedExternalERC721__Params { - return new AwardedExternalERC721__Params(this); - } -} - -export class AwardedExternalERC721__Params { - _event: AwardedExternalERC721; - - constructor(event: AwardedExternalERC721) { - this._event = event; - } - - get winner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokenIds(): Array { - return this._event.parameters[2].value.toBigIntArray(); - } -} - -export class ControlledTokenAdded extends ethereum.Event { - get params(): ControlledTokenAdded__Params { - return new ControlledTokenAdded__Params(this); - } -} - -export class ControlledTokenAdded__Params { - _event: ControlledTokenAdded; - - constructor(event: ControlledTokenAdded) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class CreditBurned extends ethereum.Event { - get params(): CreditBurned__Params { - return new CreditBurned__Params(this); - } -} - -export class CreditBurned__Params { - _event: CreditBurned; - - constructor(event: CreditBurned) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class CreditMinted extends ethereum.Event { - get params(): CreditMinted__Params { - return new CreditMinted__Params(this); - } -} - -export class CreditMinted__Params { - _event: CreditMinted; - - constructor(event: CreditMinted) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class CreditPlanSet extends ethereum.Event { - get params(): CreditPlanSet__Params { - return new CreditPlanSet__Params(this); - } -} - -export class CreditPlanSet__Params { - _event: CreditPlanSet; - - constructor(event: CreditPlanSet) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get creditLimitMantissa(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get creditRateMantissa(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Deposited extends ethereum.Event { - get params(): Deposited__Params { - return new Deposited__Params(this); - } -} - -export class Deposited__Params { - _event: Deposited; - - constructor(event: Deposited) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get referrer(): Address { - return this._event.parameters[4].value.toAddress(); - } -} - -export class Initialized extends ethereum.Event { - get params(): Initialized__Params { - return new Initialized__Params(this); - } -} - -export class Initialized__Params { - _event: Initialized; - - constructor(event: Initialized) { - this._event = event; - } - - get reserveRegistry(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get maxExitFeeMantissa(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get maxTimelockDuration(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class InstantWithdrawal extends ethereum.Event { - get params(): InstantWithdrawal__Params { - return new InstantWithdrawal__Params(this); - } -} - -export class InstantWithdrawal__Params { - _event: InstantWithdrawal; - - constructor(event: InstantWithdrawal) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get from(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get redeemed(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get exitFee(): BigInt { - return this._event.parameters[5].value.toBigInt(); - } -} - -export class LiquidityCapSet extends ethereum.Event { - get params(): LiquidityCapSet__Params { - return new LiquidityCapSet__Params(this); - } -} - -export class LiquidityCapSet__Params { - _event: LiquidityCapSet; - - constructor(event: LiquidityCapSet) { - this._event = event; - } - - get liquidityCap(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class PrizeStrategySet extends ethereum.Event { - get params(): PrizeStrategySet__Params { - return new PrizeStrategySet__Params(this); - } -} - -export class PrizeStrategySet__Params { - _event: PrizeStrategySet; - - constructor(event: PrizeStrategySet) { - this._event = event; - } - - get prizeStrategy(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class ReserveFeeCaptured extends ethereum.Event { - get params(): ReserveFeeCaptured__Params { - return new ReserveFeeCaptured__Params(this); - } -} - -export class ReserveFeeCaptured__Params { - _event: ReserveFeeCaptured; - - constructor(event: ReserveFeeCaptured) { - this._event = event; - } - - get amount(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class ReserveWithdrawal extends ethereum.Event { - get params(): ReserveWithdrawal__Params { - return new ReserveWithdrawal__Params(this); - } -} - -export class ReserveWithdrawal__Params { - _event: ReserveWithdrawal; - - constructor(event: ReserveWithdrawal) { - this._event = event; - } - - get to(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class TimelockDeposited extends ethereum.Event { - get params(): TimelockDeposited__Params { - return new TimelockDeposited__Params(this); - } -} - -export class TimelockDeposited__Params { - _event: TimelockDeposited; - - constructor(event: TimelockDeposited) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class TimelockedWithdrawal extends ethereum.Event { - get params(): TimelockedWithdrawal__Params { - return new TimelockedWithdrawal__Params(this); - } -} - -export class TimelockedWithdrawal__Params { - _event: TimelockedWithdrawal; - - constructor(event: TimelockedWithdrawal) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get from(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get unlockTimestamp(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class TimelockedWithdrawalSwept extends ethereum.Event { - get params(): TimelockedWithdrawalSwept__Params { - return new TimelockedWithdrawalSwept__Params(this); - } -} - -export class TimelockedWithdrawalSwept__Params { - _event: TimelockedWithdrawalSwept; - - constructor(event: TimelockedWithdrawalSwept) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get from(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get redeemed(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class TransferredExternalERC20 extends ethereum.Event { - get params(): TransferredExternalERC20__Params { - return new TransferredExternalERC20__Params(this); - } -} - -export class TransferredExternalERC20__Params { - _event: TransferredExternalERC20; - - constructor(event: TransferredExternalERC20) { - this._event = event; - } - - get to(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PrizePool__calculateEarlyExitFeeResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } -} - -export class PrizePool__calculateTimelockDurationResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } -} - -export class PrizePool__creditPlanOfResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } -} - -export class PrizePool extends ethereum.SmartContract { - static bind(address: Address): PrizePool { - return new PrizePool("PrizePool", address); - } - - accountedBalance(): BigInt { - let result = super.call( - "accountedBalance", - "accountedBalance():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_accountedBalance(): ethereum.CallResult { - let result = super.tryCall( - "accountedBalance", - "accountedBalance():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - awardBalance(): BigInt { - let result = super.call("awardBalance", "awardBalance():(uint256)", []); - - return result[0].toBigInt(); - } - - try_awardBalance(): ethereum.CallResult { - let result = super.tryCall("awardBalance", "awardBalance():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - balance(): BigInt { - let result = super.call("balance", "balance():(uint256)", []); - - return result[0].toBigInt(); - } - - try_balance(): ethereum.CallResult { - let result = super.tryCall("balance", "balance():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - balanceOfCredit(user: Address, controlledToken: Address): BigInt { - let result = super.call( - "balanceOfCredit", - "balanceOfCredit(address,address):(uint256)", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddress(controlledToken) - ] - ); - - return result[0].toBigInt(); - } - - try_balanceOfCredit( - user: Address, - controlledToken: Address - ): ethereum.CallResult { - let result = super.tryCall( - "balanceOfCredit", - "balanceOfCredit(address,address):(uint256)", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddress(controlledToken) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculateEarlyExitFee( - from: Address, - controlledToken: Address, - amount: BigInt - ): PrizePool__calculateEarlyExitFeeResult { - let result = super.call( - "calculateEarlyExitFee", - "calculateEarlyExitFee(address,address,uint256):(uint256,uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(controlledToken), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return new PrizePool__calculateEarlyExitFeeResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_calculateEarlyExitFee( - from: Address, - controlledToken: Address, - amount: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "calculateEarlyExitFee", - "calculateEarlyExitFee(address,address,uint256):(uint256,uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(controlledToken), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new PrizePool__calculateEarlyExitFeeResult( - value[0].toBigInt(), - value[1].toBigInt() - ) - ); - } - - calculateReserveFee(amount: BigInt): BigInt { - let result = super.call( - "calculateReserveFee", - "calculateReserveFee(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amount)] - ); - - return result[0].toBigInt(); - } - - try_calculateReserveFee(amount: BigInt): ethereum.CallResult { - let result = super.tryCall( - "calculateReserveFee", - "calculateReserveFee(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amount)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculateTimelockDuration( - from: Address, - controlledToken: Address, - amount: BigInt - ): PrizePool__calculateTimelockDurationResult { - let result = super.call( - "calculateTimelockDuration", - "calculateTimelockDuration(address,address,uint256):(uint256,uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(controlledToken), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return new PrizePool__calculateTimelockDurationResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_calculateTimelockDuration( - from: Address, - controlledToken: Address, - amount: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "calculateTimelockDuration", - "calculateTimelockDuration(address,address,uint256):(uint256,uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(controlledToken), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new PrizePool__calculateTimelockDurationResult( - value[0].toBigInt(), - value[1].toBigInt() - ) - ); - } - - canAwardExternal(_externalToken: Address): boolean { - let result = super.call( - "canAwardExternal", - "canAwardExternal(address):(bool)", - [ethereum.Value.fromAddress(_externalToken)] - ); - - return result[0].toBoolean(); - } - - try_canAwardExternal(_externalToken: Address): ethereum.CallResult { - let result = super.tryCall( - "canAwardExternal", - "canAwardExternal(address):(bool)", - [ethereum.Value.fromAddress(_externalToken)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - captureAwardBalance(): BigInt { - let result = super.call( - "captureAwardBalance", - "captureAwardBalance():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_captureAwardBalance(): ethereum.CallResult { - let result = super.tryCall( - "captureAwardBalance", - "captureAwardBalance():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - creditPlanOf(controlledToken: Address): PrizePool__creditPlanOfResult { - let result = super.call( - "creditPlanOf", - "creditPlanOf(address):(uint128,uint128)", - [ethereum.Value.fromAddress(controlledToken)] - ); - - return new PrizePool__creditPlanOfResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_creditPlanOf( - controlledToken: Address - ): ethereum.CallResult { - let result = super.tryCall( - "creditPlanOf", - "creditPlanOf(address):(uint128,uint128)", - [ethereum.Value.fromAddress(controlledToken)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new PrizePool__creditPlanOfResult( - value[0].toBigInt(), - value[1].toBigInt() - ) - ); - } - - estimateCreditAccrualTime( - _controlledToken: Address, - _principal: BigInt, - _interest: BigInt - ): BigInt { - let result = super.call( - "estimateCreditAccrualTime", - "estimateCreditAccrualTime(address,uint256,uint256):(uint256)", - [ - ethereum.Value.fromAddress(_controlledToken), - ethereum.Value.fromUnsignedBigInt(_principal), - ethereum.Value.fromUnsignedBigInt(_interest) - ] - ); - - return result[0].toBigInt(); - } - - try_estimateCreditAccrualTime( - _controlledToken: Address, - _principal: BigInt, - _interest: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "estimateCreditAccrualTime", - "estimateCreditAccrualTime(address,uint256,uint256):(uint256)", - [ - ethereum.Value.fromAddress(_controlledToken), - ethereum.Value.fromUnsignedBigInt(_principal), - ethereum.Value.fromUnsignedBigInt(_interest) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - liquidityCap(): BigInt { - let result = super.call("liquidityCap", "liquidityCap():(uint256)", []); - - return result[0].toBigInt(); - } - - try_liquidityCap(): ethereum.CallResult { - let result = super.tryCall("liquidityCap", "liquidityCap():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxExitFeeMantissa(): BigInt { - let result = super.call( - "maxExitFeeMantissa", - "maxExitFeeMantissa():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_maxExitFeeMantissa(): ethereum.CallResult { - let result = super.tryCall( - "maxExitFeeMantissa", - "maxExitFeeMantissa():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxTimelockDuration(): BigInt { - let result = super.call( - "maxTimelockDuration", - "maxTimelockDuration():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_maxTimelockDuration(): ethereum.CallResult { - let result = super.tryCall( - "maxTimelockDuration", - "maxTimelockDuration():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - owner(): Address { - let result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - let result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - prizeStrategy(): Address { - let result = super.call("prizeStrategy", "prizeStrategy():(address)", []); - - return result[0].toAddress(); - } - - try_prizeStrategy(): ethereum.CallResult
{ - let result = super.tryCall( - "prizeStrategy", - "prizeStrategy():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - reserveRegistry(): Address { - let result = super.call( - "reserveRegistry", - "reserveRegistry():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_reserveRegistry(): ethereum.CallResult
{ - let result = super.tryCall( - "reserveRegistry", - "reserveRegistry():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - reserveTotalSupply(): BigInt { - let result = super.call( - "reserveTotalSupply", - "reserveTotalSupply():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_reserveTotalSupply(): ethereum.CallResult { - let result = super.tryCall( - "reserveTotalSupply", - "reserveTotalSupply():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - sweepTimelockBalances(users: Array
): BigInt { - let result = super.call( - "sweepTimelockBalances", - "sweepTimelockBalances(address[]):(uint256)", - [ethereum.Value.fromAddressArray(users)] - ); - - return result[0].toBigInt(); - } - - try_sweepTimelockBalances( - users: Array
- ): ethereum.CallResult { - let result = super.tryCall( - "sweepTimelockBalances", - "sweepTimelockBalances(address[]):(uint256)", - [ethereum.Value.fromAddressArray(users)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - timelockBalanceAvailableAt(user: Address): BigInt { - let result = super.call( - "timelockBalanceAvailableAt", - "timelockBalanceAvailableAt(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - - return result[0].toBigInt(); - } - - try_timelockBalanceAvailableAt(user: Address): ethereum.CallResult { - let result = super.tryCall( - "timelockBalanceAvailableAt", - "timelockBalanceAvailableAt(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - timelockBalanceOf(user: Address): BigInt { - let result = super.call( - "timelockBalanceOf", - "timelockBalanceOf(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - - return result[0].toBigInt(); - } - - try_timelockBalanceOf(user: Address): ethereum.CallResult { - let result = super.tryCall( - "timelockBalanceOf", - "timelockBalanceOf(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - timelockTotalSupply(): BigInt { - let result = super.call( - "timelockTotalSupply", - "timelockTotalSupply():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_timelockTotalSupply(): ethereum.CallResult { - let result = super.tryCall( - "timelockTotalSupply", - "timelockTotalSupply():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - token(): Address { - let result = super.call("token", "token():(address)", []); - - return result[0].toAddress(); - } - - try_token(): ethereum.CallResult
{ - let result = super.tryCall("token", "token():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - tokens(): Array
{ - let result = super.call("tokens", "tokens():(address[])", []); - - return result[0].toAddressArray(); - } - - try_tokens(): ethereum.CallResult> { - let result = super.tryCall("tokens", "tokens():(address[])", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddressArray()); - } - - withdrawInstantlyFrom( - from: Address, - amount: BigInt, - controlledToken: Address, - maximumExitFee: BigInt - ): BigInt { - let result = super.call( - "withdrawInstantlyFrom", - "withdrawInstantlyFrom(address,uint256,address,uint256):(uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromUnsignedBigInt(amount), - ethereum.Value.fromAddress(controlledToken), - ethereum.Value.fromUnsignedBigInt(maximumExitFee) - ] - ); - - return result[0].toBigInt(); - } - - try_withdrawInstantlyFrom( - from: Address, - amount: BigInt, - controlledToken: Address, - maximumExitFee: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "withdrawInstantlyFrom", - "withdrawInstantlyFrom(address,uint256,address,uint256):(uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromUnsignedBigInt(amount), - ethereum.Value.fromAddress(controlledToken), - ethereum.Value.fromUnsignedBigInt(maximumExitFee) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - withdrawReserve(to: Address): BigInt { - let result = super.call( - "withdrawReserve", - "withdrawReserve(address):(uint256)", - [ethereum.Value.fromAddress(to)] - ); - - return result[0].toBigInt(); - } - - try_withdrawReserve(to: Address): ethereum.CallResult { - let result = super.tryCall( - "withdrawReserve", - "withdrawReserve(address):(uint256)", - [ethereum.Value.fromAddress(to)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - withdrawWithTimelockFrom( - from: Address, - amount: BigInt, - controlledToken: Address - ): BigInt { - let result = super.call( - "withdrawWithTimelockFrom", - "withdrawWithTimelockFrom(address,uint256,address):(uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromUnsignedBigInt(amount), - ethereum.Value.fromAddress(controlledToken) - ] - ); - - return result[0].toBigInt(); - } - - try_withdrawWithTimelockFrom( - from: Address, - amount: BigInt, - controlledToken: Address - ): ethereum.CallResult { - let result = super.tryCall( - "withdrawWithTimelockFrom", - "withdrawWithTimelockFrom(address,uint256,address):(uint256)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromUnsignedBigInt(amount), - ethereum.Value.fromAddress(controlledToken) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class AddControlledTokenCall extends ethereum.Call { - get inputs(): AddControlledTokenCall__Inputs { - return new AddControlledTokenCall__Inputs(this); - } - - get outputs(): AddControlledTokenCall__Outputs { - return new AddControlledTokenCall__Outputs(this); - } -} - -export class AddControlledTokenCall__Inputs { - _call: AddControlledTokenCall; - - constructor(call: AddControlledTokenCall) { - this._call = call; - } - - get _controlledToken(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class AddControlledTokenCall__Outputs { - _call: AddControlledTokenCall; - - constructor(call: AddControlledTokenCall) { - this._call = call; - } -} - -export class AwardCall extends ethereum.Call { - get inputs(): AwardCall__Inputs { - return new AwardCall__Inputs(this); - } - - get outputs(): AwardCall__Outputs { - return new AwardCall__Outputs(this); - } -} - -export class AwardCall__Inputs { - _call: AwardCall; - - constructor(call: AwardCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get controlledToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class AwardCall__Outputs { - _call: AwardCall; - - constructor(call: AwardCall) { - this._call = call; - } -} - -export class AwardExternalERC20Call extends ethereum.Call { - get inputs(): AwardExternalERC20Call__Inputs { - return new AwardExternalERC20Call__Inputs(this); - } - - get outputs(): AwardExternalERC20Call__Outputs { - return new AwardExternalERC20Call__Outputs(this); - } -} - -export class AwardExternalERC20Call__Inputs { - _call: AwardExternalERC20Call; - - constructor(call: AwardExternalERC20Call) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get externalToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class AwardExternalERC20Call__Outputs { - _call: AwardExternalERC20Call; - - constructor(call: AwardExternalERC20Call) { - this._call = call; - } -} - -export class AwardExternalERC721Call extends ethereum.Call { - get inputs(): AwardExternalERC721Call__Inputs { - return new AwardExternalERC721Call__Inputs(this); - } - - get outputs(): AwardExternalERC721Call__Outputs { - return new AwardExternalERC721Call__Outputs(this); - } -} - -export class AwardExternalERC721Call__Inputs { - _call: AwardExternalERC721Call; - - constructor(call: AwardExternalERC721Call) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get externalToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get tokenIds(): Array { - return this._call.inputValues[2].value.toBigIntArray(); - } -} - -export class AwardExternalERC721Call__Outputs { - _call: AwardExternalERC721Call; - - constructor(call: AwardExternalERC721Call) { - this._call = call; - } -} - -export class BalanceCall extends ethereum.Call { - get inputs(): BalanceCall__Inputs { - return new BalanceCall__Inputs(this); - } - - get outputs(): BalanceCall__Outputs { - return new BalanceCall__Outputs(this); - } -} - -export class BalanceCall__Inputs { - _call: BalanceCall; - - constructor(call: BalanceCall) { - this._call = call; - } -} - -export class BalanceCall__Outputs { - _call: BalanceCall; - - constructor(call: BalanceCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class BalanceOfCreditCall extends ethereum.Call { - get inputs(): BalanceOfCreditCall__Inputs { - return new BalanceOfCreditCall__Inputs(this); - } - - get outputs(): BalanceOfCreditCall__Outputs { - return new BalanceOfCreditCall__Outputs(this); - } -} - -export class BalanceOfCreditCall__Inputs { - _call: BalanceOfCreditCall; - - constructor(call: BalanceOfCreditCall) { - this._call = call; - } - - get user(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get controlledToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class BalanceOfCreditCall__Outputs { - _call: BalanceOfCreditCall; - - constructor(call: BalanceOfCreditCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class BeforeTokenTransferCall extends ethereum.Call { - get inputs(): BeforeTokenTransferCall__Inputs { - return new BeforeTokenTransferCall__Inputs(this); - } - - get outputs(): BeforeTokenTransferCall__Outputs { - return new BeforeTokenTransferCall__Outputs(this); - } -} - -export class BeforeTokenTransferCall__Inputs { - _call: BeforeTokenTransferCall; - - constructor(call: BeforeTokenTransferCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class BeforeTokenTransferCall__Outputs { - _call: BeforeTokenTransferCall; - - constructor(call: BeforeTokenTransferCall) { - this._call = call; - } -} - -export class CalculateEarlyExitFeeCall extends ethereum.Call { - get inputs(): CalculateEarlyExitFeeCall__Inputs { - return new CalculateEarlyExitFeeCall__Inputs(this); - } - - get outputs(): CalculateEarlyExitFeeCall__Outputs { - return new CalculateEarlyExitFeeCall__Outputs(this); - } -} - -export class CalculateEarlyExitFeeCall__Inputs { - _call: CalculateEarlyExitFeeCall; - - constructor(call: CalculateEarlyExitFeeCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get controlledToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class CalculateEarlyExitFeeCall__Outputs { - _call: CalculateEarlyExitFeeCall; - - constructor(call: CalculateEarlyExitFeeCall) { - this._call = call; - } - - get exitFee(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get burnedCredit(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class CalculateTimelockDurationCall extends ethereum.Call { - get inputs(): CalculateTimelockDurationCall__Inputs { - return new CalculateTimelockDurationCall__Inputs(this); - } - - get outputs(): CalculateTimelockDurationCall__Outputs { - return new CalculateTimelockDurationCall__Outputs(this); - } -} - -export class CalculateTimelockDurationCall__Inputs { - _call: CalculateTimelockDurationCall; - - constructor(call: CalculateTimelockDurationCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get controlledToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class CalculateTimelockDurationCall__Outputs { - _call: CalculateTimelockDurationCall; - - constructor(call: CalculateTimelockDurationCall) { - this._call = call; - } - - get durationSeconds(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get burnedCredit(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class CaptureAwardBalanceCall extends ethereum.Call { - get inputs(): CaptureAwardBalanceCall__Inputs { - return new CaptureAwardBalanceCall__Inputs(this); - } - - get outputs(): CaptureAwardBalanceCall__Outputs { - return new CaptureAwardBalanceCall__Outputs(this); - } -} - -export class CaptureAwardBalanceCall__Inputs { - _call: CaptureAwardBalanceCall; - - constructor(call: CaptureAwardBalanceCall) { - this._call = call; - } -} - -export class CaptureAwardBalanceCall__Outputs { - _call: CaptureAwardBalanceCall; - - constructor(call: CaptureAwardBalanceCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class DepositToCall extends ethereum.Call { - get inputs(): DepositToCall__Inputs { - return new DepositToCall__Inputs(this); - } - - get outputs(): DepositToCall__Outputs { - return new DepositToCall__Outputs(this); - } -} - -export class DepositToCall__Inputs { - _call: DepositToCall; - - constructor(call: DepositToCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get controlledToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get referrer(): Address { - return this._call.inputValues[3].value.toAddress(); - } -} - -export class DepositToCall__Outputs { - _call: DepositToCall; - - constructor(call: DepositToCall) { - this._call = call; - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _reserveRegistry(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _controlledTokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get _maxExitFeeMantissa(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxTimelockDuration(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall extends ethereum.Call { - get inputs(): RenounceOwnershipCall__Inputs { - return new RenounceOwnershipCall__Inputs(this); - } - - get outputs(): RenounceOwnershipCall__Outputs { - return new RenounceOwnershipCall__Outputs(this); - } -} - -export class RenounceOwnershipCall__Inputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall__Outputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class SetCreditPlanOfCall extends ethereum.Call { - get inputs(): SetCreditPlanOfCall__Inputs { - return new SetCreditPlanOfCall__Inputs(this); - } - - get outputs(): SetCreditPlanOfCall__Outputs { - return new SetCreditPlanOfCall__Outputs(this); - } -} - -export class SetCreditPlanOfCall__Inputs { - _call: SetCreditPlanOfCall; - - constructor(call: SetCreditPlanOfCall) { - this._call = call; - } - - get _controlledToken(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _creditRateMantissa(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _creditLimitMantissa(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class SetCreditPlanOfCall__Outputs { - _call: SetCreditPlanOfCall; - - constructor(call: SetCreditPlanOfCall) { - this._call = call; - } -} - -export class SetLiquidityCapCall extends ethereum.Call { - get inputs(): SetLiquidityCapCall__Inputs { - return new SetLiquidityCapCall__Inputs(this); - } - - get outputs(): SetLiquidityCapCall__Outputs { - return new SetLiquidityCapCall__Outputs(this); - } -} - -export class SetLiquidityCapCall__Inputs { - _call: SetLiquidityCapCall; - - constructor(call: SetLiquidityCapCall) { - this._call = call; - } - - get _liquidityCap(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetLiquidityCapCall__Outputs { - _call: SetLiquidityCapCall; - - constructor(call: SetLiquidityCapCall) { - this._call = call; - } -} - -export class SetPrizeStrategyCall extends ethereum.Call { - get inputs(): SetPrizeStrategyCall__Inputs { - return new SetPrizeStrategyCall__Inputs(this); - } - - get outputs(): SetPrizeStrategyCall__Outputs { - return new SetPrizeStrategyCall__Outputs(this); - } -} - -export class SetPrizeStrategyCall__Inputs { - _call: SetPrizeStrategyCall; - - constructor(call: SetPrizeStrategyCall) { - this._call = call; - } - - get _prizeStrategy(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetPrizeStrategyCall__Outputs { - _call: SetPrizeStrategyCall; - - constructor(call: SetPrizeStrategyCall) { - this._call = call; - } -} - -export class SweepTimelockBalancesCall extends ethereum.Call { - get inputs(): SweepTimelockBalancesCall__Inputs { - return new SweepTimelockBalancesCall__Inputs(this); - } - - get outputs(): SweepTimelockBalancesCall__Outputs { - return new SweepTimelockBalancesCall__Outputs(this); - } -} - -export class SweepTimelockBalancesCall__Inputs { - _call: SweepTimelockBalancesCall; - - constructor(call: SweepTimelockBalancesCall) { - this._call = call; - } - - get users(): Array
{ - return this._call.inputValues[0].value.toAddressArray(); - } -} - -export class SweepTimelockBalancesCall__Outputs { - _call: SweepTimelockBalancesCall; - - constructor(call: SweepTimelockBalancesCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class TimelockDepositToCall extends ethereum.Call { - get inputs(): TimelockDepositToCall__Inputs { - return new TimelockDepositToCall__Inputs(this); - } - - get outputs(): TimelockDepositToCall__Outputs { - return new TimelockDepositToCall__Outputs(this); - } -} - -export class TimelockDepositToCall__Inputs { - _call: TimelockDepositToCall; - - constructor(call: TimelockDepositToCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get controlledToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class TimelockDepositToCall__Outputs { - _call: TimelockDepositToCall; - - constructor(call: TimelockDepositToCall) { - this._call = call; - } -} - -export class TransferExternalERC20Call extends ethereum.Call { - get inputs(): TransferExternalERC20Call__Inputs { - return new TransferExternalERC20Call__Inputs(this); - } - - get outputs(): TransferExternalERC20Call__Outputs { - return new TransferExternalERC20Call__Outputs(this); - } -} - -export class TransferExternalERC20Call__Inputs { - _call: TransferExternalERC20Call; - - constructor(call: TransferExternalERC20Call) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get externalToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferExternalERC20Call__Outputs { - _call: TransferExternalERC20Call; - - constructor(call: TransferExternalERC20Call) { - this._call = call; - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get newOwner(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} - -export class WithdrawInstantlyFromCall extends ethereum.Call { - get inputs(): WithdrawInstantlyFromCall__Inputs { - return new WithdrawInstantlyFromCall__Inputs(this); - } - - get outputs(): WithdrawInstantlyFromCall__Outputs { - return new WithdrawInstantlyFromCall__Outputs(this); - } -} - -export class WithdrawInstantlyFromCall__Inputs { - _call: WithdrawInstantlyFromCall; - - constructor(call: WithdrawInstantlyFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get controlledToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get maximumExitFee(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class WithdrawInstantlyFromCall__Outputs { - _call: WithdrawInstantlyFromCall; - - constructor(call: WithdrawInstantlyFromCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class WithdrawReserveCall extends ethereum.Call { - get inputs(): WithdrawReserveCall__Inputs { - return new WithdrawReserveCall__Inputs(this); - } - - get outputs(): WithdrawReserveCall__Outputs { - return new WithdrawReserveCall__Outputs(this); - } -} - -export class WithdrawReserveCall__Inputs { - _call: WithdrawReserveCall; - - constructor(call: WithdrawReserveCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class WithdrawReserveCall__Outputs { - _call: WithdrawReserveCall; - - constructor(call: WithdrawReserveCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class WithdrawWithTimelockFromCall extends ethereum.Call { - get inputs(): WithdrawWithTimelockFromCall__Inputs { - return new WithdrawWithTimelockFromCall__Inputs(this); - } - - get outputs(): WithdrawWithTimelockFromCall__Outputs { - return new WithdrawWithTimelockFromCall__Outputs(this); - } -} - -export class WithdrawWithTimelockFromCall__Inputs { - _call: WithdrawWithTimelockFromCall; - - constructor(call: WithdrawWithTimelockFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get controlledToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class WithdrawWithTimelockFromCall__Outputs { - _call: WithdrawWithTimelockFromCall; - - constructor(call: WithdrawWithTimelockFromCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} diff --git a/generated/templates/SingleRandomWinner/RNGInterface.ts b/generated/templates/SingleRandomWinner/RNGInterface.ts deleted file mode 100644 index 2d04335..0000000 --- a/generated/templates/SingleRandomWinner/RNGInterface.ts +++ /dev/null @@ -1,294 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - ethereum, - JSONValue, - TypedMap, - Entity, - Bytes, - Address, - BigInt -} from "@graphprotocol/graph-ts"; - -export class RandomNumberCompleted extends ethereum.Event { - get params(): RandomNumberCompleted__Params { - return new RandomNumberCompleted__Params(this); - } -} - -export class RandomNumberCompleted__Params { - _event: RandomNumberCompleted; - - constructor(event: RandomNumberCompleted) { - this._event = event; - } - - get requestId(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get randomNumber(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class RandomNumberRequested extends ethereum.Event { - get params(): RandomNumberRequested__Params { - return new RandomNumberRequested__Params(this); - } -} - -export class RandomNumberRequested__Params { - _event: RandomNumberRequested; - - constructor(event: RandomNumberRequested) { - this._event = event; - } - - get requestId(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class RNGInterface__getRequestFeeResult { - value0: Address; - value1: BigInt; - - constructor(value0: Address, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddress(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } -} - -export class RNGInterface__requestRandomNumberResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } -} - -export class RNGInterface extends ethereum.SmartContract { - static bind(address: Address): RNGInterface { - return new RNGInterface("RNGInterface", address); - } - - getLastRequestId(): BigInt { - let result = super.call( - "getLastRequestId", - "getLastRequestId():(uint32)", - [] - ); - - return result[0].toBigInt(); - } - - try_getLastRequestId(): ethereum.CallResult { - let result = super.tryCall( - "getLastRequestId", - "getLastRequestId():(uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getRequestFee(): RNGInterface__getRequestFeeResult { - let result = super.call( - "getRequestFee", - "getRequestFee():(address,uint256)", - [] - ); - - return new RNGInterface__getRequestFeeResult( - result[0].toAddress(), - result[1].toBigInt() - ); - } - - try_getRequestFee(): ethereum.CallResult { - let result = super.tryCall( - "getRequestFee", - "getRequestFee():(address,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new RNGInterface__getRequestFeeResult( - value[0].toAddress(), - value[1].toBigInt() - ) - ); - } - - isRequestComplete(requestId: BigInt): boolean { - let result = super.call( - "isRequestComplete", - "isRequestComplete(uint32):(bool)", - [ethereum.Value.fromUnsignedBigInt(requestId)] - ); - - return result[0].toBoolean(); - } - - try_isRequestComplete(requestId: BigInt): ethereum.CallResult { - let result = super.tryCall( - "isRequestComplete", - "isRequestComplete(uint32):(bool)", - [ethereum.Value.fromUnsignedBigInt(requestId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - randomNumber(requestId: BigInt): BigInt { - let result = super.call("randomNumber", "randomNumber(uint32):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(requestId) - ]); - - return result[0].toBigInt(); - } - - try_randomNumber(requestId: BigInt): ethereum.CallResult { - let result = super.tryCall( - "randomNumber", - "randomNumber(uint32):(uint256)", - [ethereum.Value.fromUnsignedBigInt(requestId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - requestRandomNumber(): RNGInterface__requestRandomNumberResult { - let result = super.call( - "requestRandomNumber", - "requestRandomNumber():(uint32,uint32)", - [] - ); - - return new RNGInterface__requestRandomNumberResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_requestRandomNumber(): ethereum.CallResult< - RNGInterface__requestRandomNumberResult - > { - let result = super.tryCall( - "requestRandomNumber", - "requestRandomNumber():(uint32,uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new RNGInterface__requestRandomNumberResult( - value[0].toBigInt(), - value[1].toBigInt() - ) - ); - } -} - -export class RandomNumberCall extends ethereum.Call { - get inputs(): RandomNumberCall__Inputs { - return new RandomNumberCall__Inputs(this); - } - - get outputs(): RandomNumberCall__Outputs { - return new RandomNumberCall__Outputs(this); - } -} - -export class RandomNumberCall__Inputs { - _call: RandomNumberCall; - - constructor(call: RandomNumberCall) { - this._call = call; - } - - get requestId(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class RandomNumberCall__Outputs { - _call: RandomNumberCall; - - constructor(call: RandomNumberCall) { - this._call = call; - } - - get randomNum(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RequestRandomNumberCall extends ethereum.Call { - get inputs(): RequestRandomNumberCall__Inputs { - return new RequestRandomNumberCall__Inputs(this); - } - - get outputs(): RequestRandomNumberCall__Outputs { - return new RequestRandomNumberCall__Outputs(this); - } -} - -export class RequestRandomNumberCall__Inputs { - _call: RequestRandomNumberCall; - - constructor(call: RequestRandomNumberCall) { - this._call = call; - } -} - -export class RequestRandomNumberCall__Outputs { - _call: RequestRandomNumberCall; - - constructor(call: RequestRandomNumberCall) { - this._call = call; - } - - get requestId(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get lockBlock(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} diff --git a/generated/templates/SingleRandomWinner/SingleRandomWinner.ts b/generated/templates/SingleRandomWinner/SingleRandomWinner.ts deleted file mode 100644 index 40d95e0..0000000 --- a/generated/templates/SingleRandomWinner/SingleRandomWinner.ts +++ /dev/null @@ -1,1496 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - ethereum, - JSONValue, - TypedMap, - Entity, - Bytes, - Address, - BigInt -} from "@graphprotocol/graph-ts"; - -export class ExternalErc20AwardAdded extends ethereum.Event { - get params(): ExternalErc20AwardAdded__Params { - return new ExternalErc20AwardAdded__Params(this); - } -} - -export class ExternalErc20AwardAdded__Params { - _event: ExternalErc20AwardAdded; - - constructor(event: ExternalErc20AwardAdded) { - this._event = event; - } - - get externalErc20(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class ExternalErc20AwardRemoved extends ethereum.Event { - get params(): ExternalErc20AwardRemoved__Params { - return new ExternalErc20AwardRemoved__Params(this); - } -} - -export class ExternalErc20AwardRemoved__Params { - _event: ExternalErc20AwardRemoved; - - constructor(event: ExternalErc20AwardRemoved) { - this._event = event; - } - - get externalErc20Award(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class ExternalErc721AwardAdded extends ethereum.Event { - get params(): ExternalErc721AwardAdded__Params { - return new ExternalErc721AwardAdded__Params(this); - } -} - -export class ExternalErc721AwardAdded__Params { - _event: ExternalErc721AwardAdded; - - constructor(event: ExternalErc721AwardAdded) { - this._event = event; - } - - get externalErc721(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get tokenIds(): Array { - return this._event.parameters[1].value.toBigIntArray(); - } -} - -export class ExternalErc721AwardRemoved extends ethereum.Event { - get params(): ExternalErc721AwardRemoved__Params { - return new ExternalErc721AwardRemoved__Params(this); - } -} - -export class ExternalErc721AwardRemoved__Params { - _event: ExternalErc721AwardRemoved; - - constructor(event: ExternalErc721AwardRemoved) { - this._event = event; - } - - get externalErc721Award(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class Initialized extends ethereum.Event { - get params(): Initialized__Params { - return new Initialized__Params(this); - } -} - -export class Initialized__Params { - _event: Initialized; - - constructor(event: Initialized) { - this._event = event; - } - - get prizePeriodStart(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get prizePeriodSeconds(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get prizePool(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get ticket(): Address { - return this._event.parameters[3].value.toAddress(); - } - - get sponsorship(): Address { - return this._event.parameters[4].value.toAddress(); - } - - get rng(): Address { - return this._event.parameters[5].value.toAddress(); - } - - get externalErc20Awards(): Array
{ - return this._event.parameters[6].value.toAddressArray(); - } -} - -export class NoWinner extends ethereum.Event { - get params(): NoWinner__Params { - return new NoWinner__Params(this); - } -} - -export class NoWinner__Params { - _event: NoWinner; - - constructor(event: NoWinner) { - this._event = event; - } -} - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class PeriodicPrizeStrategyListenerSet extends ethereum.Event { - get params(): PeriodicPrizeStrategyListenerSet__Params { - return new PeriodicPrizeStrategyListenerSet__Params(this); - } -} - -export class PeriodicPrizeStrategyListenerSet__Params { - _event: PeriodicPrizeStrategyListenerSet; - - constructor(event: PeriodicPrizeStrategyListenerSet) { - this._event = event; - } - - get periodicPrizeStrategyListener(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class PrizePoolAwardCancelled extends ethereum.Event { - get params(): PrizePoolAwardCancelled__Params { - return new PrizePoolAwardCancelled__Params(this); - } -} - -export class PrizePoolAwardCancelled__Params { - _event: PrizePoolAwardCancelled; - - constructor(event: PrizePoolAwardCancelled) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get prizePool(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get rngRequestId(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get rngLockBlock(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class PrizePoolAwardStarted extends ethereum.Event { - get params(): PrizePoolAwardStarted__Params { - return new PrizePoolAwardStarted__Params(this); - } -} - -export class PrizePoolAwardStarted__Params { - _event: PrizePoolAwardStarted; - - constructor(event: PrizePoolAwardStarted) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get prizePool(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get rngRequestId(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get rngLockBlock(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class PrizePoolAwarded extends ethereum.Event { - get params(): PrizePoolAwarded__Params { - return new PrizePoolAwarded__Params(this); - } -} - -export class PrizePoolAwarded__Params { - _event: PrizePoolAwarded; - - constructor(event: PrizePoolAwarded) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get randomNumber(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class PrizePoolOpened extends ethereum.Event { - get params(): PrizePoolOpened__Params { - return new PrizePoolOpened__Params(this); - } -} - -export class PrizePoolOpened__Params { - _event: PrizePoolOpened; - - constructor(event: PrizePoolOpened) { - this._event = event; - } - - get operator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get prizePeriodStartedAt(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class RngRequestFailed extends ethereum.Event { - get params(): RngRequestFailed__Params { - return new RngRequestFailed__Params(this); - } -} - -export class RngRequestFailed__Params { - _event: RngRequestFailed; - - constructor(event: RngRequestFailed) { - this._event = event; - } -} - -export class RngRequestTimeoutSet extends ethereum.Event { - get params(): RngRequestTimeoutSet__Params { - return new RngRequestTimeoutSet__Params(this); - } -} - -export class RngRequestTimeoutSet__Params { - _event: RngRequestTimeoutSet; - - constructor(event: RngRequestTimeoutSet) { - this._event = event; - } - - get rngRequestTimeout(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class RngServiceUpdated extends ethereum.Event { - get params(): RngServiceUpdated__Params { - return new RngServiceUpdated__Params(this); - } -} - -export class RngServiceUpdated__Params { - _event: RngServiceUpdated; - - constructor(event: RngServiceUpdated) { - this._event = event; - } - - get rngService(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class TokenListenerUpdated extends ethereum.Event { - get params(): TokenListenerUpdated__Params { - return new TokenListenerUpdated__Params(this); - } -} - -export class TokenListenerUpdated__Params { - _event: TokenListenerUpdated; - - constructor(event: TokenListenerUpdated) { - this._event = event; - } - - get tokenListener(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class SingleRandomWinner extends ethereum.SmartContract { - static bind(address: Address): SingleRandomWinner { - return new SingleRandomWinner("SingleRandomWinner", address); - } - - calculateNextPrizePeriodStartTime(currentTime: BigInt): BigInt { - let result = super.call( - "calculateNextPrizePeriodStartTime", - "calculateNextPrizePeriodStartTime(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(currentTime)] - ); - - return result[0].toBigInt(); - } - - try_calculateNextPrizePeriodStartTime( - currentTime: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "calculateNextPrizePeriodStartTime", - "calculateNextPrizePeriodStartTime(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(currentTime)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - canCompleteAward(): boolean { - let result = super.call( - "canCompleteAward", - "canCompleteAward():(bool)", - [] - ); - - return result[0].toBoolean(); - } - - try_canCompleteAward(): ethereum.CallResult { - let result = super.tryCall( - "canCompleteAward", - "canCompleteAward():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - canStartAward(): boolean { - let result = super.call("canStartAward", "canStartAward():(bool)", []); - - return result[0].toBoolean(); - } - - try_canStartAward(): ethereum.CallResult { - let result = super.tryCall("canStartAward", "canStartAward():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - currentPrize(): BigInt { - let result = super.call("currentPrize", "currentPrize():(uint256)", []); - - return result[0].toBigInt(); - } - - try_currentPrize(): ethereum.CallResult { - let result = super.tryCall("currentPrize", "currentPrize():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - estimateRemainingBlocksToPrize(secondsPerBlockMantissa: BigInt): BigInt { - let result = super.call( - "estimateRemainingBlocksToPrize", - "estimateRemainingBlocksToPrize(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(secondsPerBlockMantissa)] - ); - - return result[0].toBigInt(); - } - - try_estimateRemainingBlocksToPrize( - secondsPerBlockMantissa: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "estimateRemainingBlocksToPrize", - "estimateRemainingBlocksToPrize(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(secondsPerBlockMantissa)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getExternalErc20Awards(): Array
{ - let result = super.call( - "getExternalErc20Awards", - "getExternalErc20Awards():(address[])", - [] - ); - - return result[0].toAddressArray(); - } - - try_getExternalErc20Awards(): ethereum.CallResult> { - let result = super.tryCall( - "getExternalErc20Awards", - "getExternalErc20Awards():(address[])", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddressArray()); - } - - getExternalErc721AwardTokenIds(_externalErc721: Address): Array { - let result = super.call( - "getExternalErc721AwardTokenIds", - "getExternalErc721AwardTokenIds(address):(uint256[])", - [ethereum.Value.fromAddress(_externalErc721)] - ); - - return result[0].toBigIntArray(); - } - - try_getExternalErc721AwardTokenIds( - _externalErc721: Address - ): ethereum.CallResult> { - let result = super.tryCall( - "getExternalErc721AwardTokenIds", - "getExternalErc721AwardTokenIds(address):(uint256[])", - [ethereum.Value.fromAddress(_externalErc721)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getExternalErc721Awards(): Array
{ - let result = super.call( - "getExternalErc721Awards", - "getExternalErc721Awards():(address[])", - [] - ); - - return result[0].toAddressArray(); - } - - try_getExternalErc721Awards(): ethereum.CallResult> { - let result = super.tryCall( - "getExternalErc721Awards", - "getExternalErc721Awards():(address[])", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddressArray()); - } - - getLastRngLockBlock(): BigInt { - let result = super.call( - "getLastRngLockBlock", - "getLastRngLockBlock():(uint32)", - [] - ); - - return result[0].toBigInt(); - } - - try_getLastRngLockBlock(): ethereum.CallResult { - let result = super.tryCall( - "getLastRngLockBlock", - "getLastRngLockBlock():(uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getLastRngRequestId(): BigInt { - let result = super.call( - "getLastRngRequestId", - "getLastRngRequestId():(uint32)", - [] - ); - - return result[0].toBigInt(); - } - - try_getLastRngRequestId(): ethereum.CallResult { - let result = super.tryCall( - "getLastRngRequestId", - "getLastRngRequestId():(uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isPrizePeriodOver(): boolean { - let result = super.call( - "isPrizePeriodOver", - "isPrizePeriodOver():(bool)", - [] - ); - - return result[0].toBoolean(); - } - - try_isPrizePeriodOver(): ethereum.CallResult { - let result = super.tryCall( - "isPrizePeriodOver", - "isPrizePeriodOver():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - isRngCompleted(): boolean { - let result = super.call("isRngCompleted", "isRngCompleted():(bool)", []); - - return result[0].toBoolean(); - } - - try_isRngCompleted(): ethereum.CallResult { - let result = super.tryCall("isRngCompleted", "isRngCompleted():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - isRngRequested(): boolean { - let result = super.call("isRngRequested", "isRngRequested():(bool)", []); - - return result[0].toBoolean(); - } - - try_isRngRequested(): ethereum.CallResult { - let result = super.tryCall("isRngRequested", "isRngRequested():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - isRngTimedOut(): boolean { - let result = super.call("isRngTimedOut", "isRngTimedOut():(bool)", []); - - return result[0].toBoolean(); - } - - try_isRngTimedOut(): ethereum.CallResult { - let result = super.tryCall("isRngTimedOut", "isRngTimedOut():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - owner(): Address { - let result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - let result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - periodicPrizeStrategyListener(): Address { - let result = super.call( - "periodicPrizeStrategyListener", - "periodicPrizeStrategyListener():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_periodicPrizeStrategyListener(): ethereum.CallResult
{ - let result = super.tryCall( - "periodicPrizeStrategyListener", - "periodicPrizeStrategyListener():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - prizePeriodEndAt(): BigInt { - let result = super.call( - "prizePeriodEndAt", - "prizePeriodEndAt():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_prizePeriodEndAt(): ethereum.CallResult { - let result = super.tryCall( - "prizePeriodEndAt", - "prizePeriodEndAt():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - prizePeriodRemainingSeconds(): BigInt { - let result = super.call( - "prizePeriodRemainingSeconds", - "prizePeriodRemainingSeconds():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_prizePeriodRemainingSeconds(): ethereum.CallResult { - let result = super.tryCall( - "prizePeriodRemainingSeconds", - "prizePeriodRemainingSeconds():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - prizePeriodSeconds(): BigInt { - let result = super.call( - "prizePeriodSeconds", - "prizePeriodSeconds():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_prizePeriodSeconds(): ethereum.CallResult { - let result = super.tryCall( - "prizePeriodSeconds", - "prizePeriodSeconds():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - prizePeriodStartedAt(): BigInt { - let result = super.call( - "prizePeriodStartedAt", - "prizePeriodStartedAt():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_prizePeriodStartedAt(): ethereum.CallResult { - let result = super.tryCall( - "prizePeriodStartedAt", - "prizePeriodStartedAt():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - prizePool(): Address { - let result = super.call("prizePool", "prizePool():(address)", []); - - return result[0].toAddress(); - } - - try_prizePool(): ethereum.CallResult
{ - let result = super.tryCall("prizePool", "prizePool():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - rng(): Address { - let result = super.call("rng", "rng():(address)", []); - - return result[0].toAddress(); - } - - try_rng(): ethereum.CallResult
{ - let result = super.tryCall("rng", "rng():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - rngRequestTimeout(): BigInt { - let result = super.call( - "rngRequestTimeout", - "rngRequestTimeout():(uint32)", - [] - ); - - return result[0].toBigInt(); - } - - try_rngRequestTimeout(): ethereum.CallResult { - let result = super.tryCall( - "rngRequestTimeout", - "rngRequestTimeout():(uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - sponsorship(): Address { - let result = super.call("sponsorship", "sponsorship():(address)", []); - - return result[0].toAddress(); - } - - try_sponsorship(): ethereum.CallResult
{ - let result = super.tryCall("sponsorship", "sponsorship():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - supportsInterface(interfaceId: Bytes): boolean { - let result = super.call( - "supportsInterface", - "supportsInterface(bytes4):(bool)", - [ethereum.Value.fromFixedBytes(interfaceId)] - ); - - return result[0].toBoolean(); - } - - try_supportsInterface(interfaceId: Bytes): ethereum.CallResult { - let result = super.tryCall( - "supportsInterface", - "supportsInterface(bytes4):(bool)", - [ethereum.Value.fromFixedBytes(interfaceId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - ticket(): Address { - let result = super.call("ticket", "ticket():(address)", []); - - return result[0].toAddress(); - } - - try_ticket(): ethereum.CallResult
{ - let result = super.tryCall("ticket", "ticket():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - tokenListener(): Address { - let result = super.call("tokenListener", "tokenListener():(address)", []); - - return result[0].toAddress(); - } - - try_tokenListener(): ethereum.CallResult
{ - let result = super.tryCall( - "tokenListener", - "tokenListener():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } -} - -export class AddExternalErc20AwardCall extends ethereum.Call { - get inputs(): AddExternalErc20AwardCall__Inputs { - return new AddExternalErc20AwardCall__Inputs(this); - } - - get outputs(): AddExternalErc20AwardCall__Outputs { - return new AddExternalErc20AwardCall__Outputs(this); - } -} - -export class AddExternalErc20AwardCall__Inputs { - _call: AddExternalErc20AwardCall; - - constructor(call: AddExternalErc20AwardCall) { - this._call = call; - } - - get _externalErc20(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class AddExternalErc20AwardCall__Outputs { - _call: AddExternalErc20AwardCall; - - constructor(call: AddExternalErc20AwardCall) { - this._call = call; - } -} - -export class AddExternalErc20AwardsCall extends ethereum.Call { - get inputs(): AddExternalErc20AwardsCall__Inputs { - return new AddExternalErc20AwardsCall__Inputs(this); - } - - get outputs(): AddExternalErc20AwardsCall__Outputs { - return new AddExternalErc20AwardsCall__Outputs(this); - } -} - -export class AddExternalErc20AwardsCall__Inputs { - _call: AddExternalErc20AwardsCall; - - constructor(call: AddExternalErc20AwardsCall) { - this._call = call; - } - - get _externalErc20s(): Array
{ - return this._call.inputValues[0].value.toAddressArray(); - } -} - -export class AddExternalErc20AwardsCall__Outputs { - _call: AddExternalErc20AwardsCall; - - constructor(call: AddExternalErc20AwardsCall) { - this._call = call; - } -} - -export class AddExternalErc721AwardCall extends ethereum.Call { - get inputs(): AddExternalErc721AwardCall__Inputs { - return new AddExternalErc721AwardCall__Inputs(this); - } - - get outputs(): AddExternalErc721AwardCall__Outputs { - return new AddExternalErc721AwardCall__Outputs(this); - } -} - -export class AddExternalErc721AwardCall__Inputs { - _call: AddExternalErc721AwardCall; - - constructor(call: AddExternalErc721AwardCall) { - this._call = call; - } - - get _externalErc721(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _tokenIds(): Array { - return this._call.inputValues[1].value.toBigIntArray(); - } -} - -export class AddExternalErc721AwardCall__Outputs { - _call: AddExternalErc721AwardCall; - - constructor(call: AddExternalErc721AwardCall) { - this._call = call; - } -} - -export class BeforeTokenMintCall extends ethereum.Call { - get inputs(): BeforeTokenMintCall__Inputs { - return new BeforeTokenMintCall__Inputs(this); - } - - get outputs(): BeforeTokenMintCall__Outputs { - return new BeforeTokenMintCall__Outputs(this); - } -} - -export class BeforeTokenMintCall__Inputs { - _call: BeforeTokenMintCall; - - constructor(call: BeforeTokenMintCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get controlledToken(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get referrer(): Address { - return this._call.inputValues[3].value.toAddress(); - } -} - -export class BeforeTokenMintCall__Outputs { - _call: BeforeTokenMintCall; - - constructor(call: BeforeTokenMintCall) { - this._call = call; - } -} - -export class BeforeTokenTransferCall extends ethereum.Call { - get inputs(): BeforeTokenTransferCall__Inputs { - return new BeforeTokenTransferCall__Inputs(this); - } - - get outputs(): BeforeTokenTransferCall__Outputs { - return new BeforeTokenTransferCall__Outputs(this); - } -} - -export class BeforeTokenTransferCall__Inputs { - _call: BeforeTokenTransferCall; - - constructor(call: BeforeTokenTransferCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get controlledToken(): Address { - return this._call.inputValues[3].value.toAddress(); - } -} - -export class BeforeTokenTransferCall__Outputs { - _call: BeforeTokenTransferCall; - - constructor(call: BeforeTokenTransferCall) { - this._call = call; - } -} - -export class CancelAwardCall extends ethereum.Call { - get inputs(): CancelAwardCall__Inputs { - return new CancelAwardCall__Inputs(this); - } - - get outputs(): CancelAwardCall__Outputs { - return new CancelAwardCall__Outputs(this); - } -} - -export class CancelAwardCall__Inputs { - _call: CancelAwardCall; - - constructor(call: CancelAwardCall) { - this._call = call; - } -} - -export class CancelAwardCall__Outputs { - _call: CancelAwardCall; - - constructor(call: CancelAwardCall) { - this._call = call; - } -} - -export class CompleteAwardCall extends ethereum.Call { - get inputs(): CompleteAwardCall__Inputs { - return new CompleteAwardCall__Inputs(this); - } - - get outputs(): CompleteAwardCall__Outputs { - return new CompleteAwardCall__Outputs(this); - } -} - -export class CompleteAwardCall__Inputs { - _call: CompleteAwardCall; - - constructor(call: CompleteAwardCall) { - this._call = call; - } -} - -export class CompleteAwardCall__Outputs { - _call: CompleteAwardCall; - - constructor(call: CompleteAwardCall) { - this._call = call; - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _prizePeriodStart(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _prizePeriodSeconds(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _prizePool(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _ticket(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _sponsorship(): Address { - return this._call.inputValues[4].value.toAddress(); - } - - get _rng(): Address { - return this._call.inputValues[5].value.toAddress(); - } - - get externalErc20Awards(): Array
{ - return this._call.inputValues[6].value.toAddressArray(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class RemoveExternalErc20AwardCall extends ethereum.Call { - get inputs(): RemoveExternalErc20AwardCall__Inputs { - return new RemoveExternalErc20AwardCall__Inputs(this); - } - - get outputs(): RemoveExternalErc20AwardCall__Outputs { - return new RemoveExternalErc20AwardCall__Outputs(this); - } -} - -export class RemoveExternalErc20AwardCall__Inputs { - _call: RemoveExternalErc20AwardCall; - - constructor(call: RemoveExternalErc20AwardCall) { - this._call = call; - } - - get _externalErc20(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _prevExternalErc20(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class RemoveExternalErc20AwardCall__Outputs { - _call: RemoveExternalErc20AwardCall; - - constructor(call: RemoveExternalErc20AwardCall) { - this._call = call; - } -} - -export class RemoveExternalErc721AwardCall extends ethereum.Call { - get inputs(): RemoveExternalErc721AwardCall__Inputs { - return new RemoveExternalErc721AwardCall__Inputs(this); - } - - get outputs(): RemoveExternalErc721AwardCall__Outputs { - return new RemoveExternalErc721AwardCall__Outputs(this); - } -} - -export class RemoveExternalErc721AwardCall__Inputs { - _call: RemoveExternalErc721AwardCall; - - constructor(call: RemoveExternalErc721AwardCall) { - this._call = call; - } - - get _externalErc721(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _prevExternalErc721(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class RemoveExternalErc721AwardCall__Outputs { - _call: RemoveExternalErc721AwardCall; - - constructor(call: RemoveExternalErc721AwardCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall extends ethereum.Call { - get inputs(): RenounceOwnershipCall__Inputs { - return new RenounceOwnershipCall__Inputs(this); - } - - get outputs(): RenounceOwnershipCall__Outputs { - return new RenounceOwnershipCall__Outputs(this); - } -} - -export class RenounceOwnershipCall__Inputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall__Outputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class SetPeriodicPrizeStrategyListenerCall extends ethereum.Call { - get inputs(): SetPeriodicPrizeStrategyListenerCall__Inputs { - return new SetPeriodicPrizeStrategyListenerCall__Inputs(this); - } - - get outputs(): SetPeriodicPrizeStrategyListenerCall__Outputs { - return new SetPeriodicPrizeStrategyListenerCall__Outputs(this); - } -} - -export class SetPeriodicPrizeStrategyListenerCall__Inputs { - _call: SetPeriodicPrizeStrategyListenerCall; - - constructor(call: SetPeriodicPrizeStrategyListenerCall) { - this._call = call; - } - - get _periodicPrizeStrategyListener(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetPeriodicPrizeStrategyListenerCall__Outputs { - _call: SetPeriodicPrizeStrategyListenerCall; - - constructor(call: SetPeriodicPrizeStrategyListenerCall) { - this._call = call; - } -} - -export class SetRngRequestTimeoutCall extends ethereum.Call { - get inputs(): SetRngRequestTimeoutCall__Inputs { - return new SetRngRequestTimeoutCall__Inputs(this); - } - - get outputs(): SetRngRequestTimeoutCall__Outputs { - return new SetRngRequestTimeoutCall__Outputs(this); - } -} - -export class SetRngRequestTimeoutCall__Inputs { - _call: SetRngRequestTimeoutCall; - - constructor(call: SetRngRequestTimeoutCall) { - this._call = call; - } - - get _rngRequestTimeout(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetRngRequestTimeoutCall__Outputs { - _call: SetRngRequestTimeoutCall; - - constructor(call: SetRngRequestTimeoutCall) { - this._call = call; - } -} - -export class SetRngServiceCall extends ethereum.Call { - get inputs(): SetRngServiceCall__Inputs { - return new SetRngServiceCall__Inputs(this); - } - - get outputs(): SetRngServiceCall__Outputs { - return new SetRngServiceCall__Outputs(this); - } -} - -export class SetRngServiceCall__Inputs { - _call: SetRngServiceCall; - - constructor(call: SetRngServiceCall) { - this._call = call; - } - - get rngService(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetRngServiceCall__Outputs { - _call: SetRngServiceCall; - - constructor(call: SetRngServiceCall) { - this._call = call; - } -} - -export class SetTokenListenerCall extends ethereum.Call { - get inputs(): SetTokenListenerCall__Inputs { - return new SetTokenListenerCall__Inputs(this); - } - - get outputs(): SetTokenListenerCall__Outputs { - return new SetTokenListenerCall__Outputs(this); - } -} - -export class SetTokenListenerCall__Inputs { - _call: SetTokenListenerCall; - - constructor(call: SetTokenListenerCall) { - this._call = call; - } - - get _tokenListener(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetTokenListenerCall__Outputs { - _call: SetTokenListenerCall; - - constructor(call: SetTokenListenerCall) { - this._call = call; - } -} - -export class StartAwardCall extends ethereum.Call { - get inputs(): StartAwardCall__Inputs { - return new StartAwardCall__Inputs(this); - } - - get outputs(): StartAwardCall__Outputs { - return new StartAwardCall__Outputs(this); - } -} - -export class StartAwardCall__Inputs { - _call: StartAwardCall; - - constructor(call: StartAwardCall) { - this._call = call; - } -} - -export class StartAwardCall__Outputs { - _call: StartAwardCall; - - constructor(call: StartAwardCall) { - this._call = call; - } -} - -export class TransferExternalERC20Call extends ethereum.Call { - get inputs(): TransferExternalERC20Call__Inputs { - return new TransferExternalERC20Call__Inputs(this); - } - - get outputs(): TransferExternalERC20Call__Outputs { - return new TransferExternalERC20Call__Outputs(this); - } -} - -export class TransferExternalERC20Call__Inputs { - _call: TransferExternalERC20Call; - - constructor(call: TransferExternalERC20Call) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get externalToken(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferExternalERC20Call__Outputs { - _call: TransferExternalERC20Call; - - constructor(call: TransferExternalERC20Call) { - this._call = call; - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get newOwner(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} diff --git a/schema.graphql b/schema.graphql index 841bcf8..0e1920b 100644 --- a/schema.graphql +++ b/schema.graphql @@ -211,20 +211,22 @@ type ControlledTokenBalance @entity { account: Account! controlledToken: ControlledToken! balance: BigInt - referrer: Bytes } -type EnteredPool @entity { +type MintedControlledToken @entity { id: ID! # transaction hash - controlledToken: ControlledToken! account: Account! + controlledToken: ControlledToken! + amount: BigInt! + referrer: Bytes timestamp: BigInt! } -type ExitedPool @entity { +type BurnedControlledToken @entity { id: ID! # transaction hash - controlledToken: ControlledToken! account: Account! + controlledToken: ControlledToken! + amount: BigInt! timestamp: BigInt! } diff --git a/src/mappingForComptroller.ts b/src/mappingForComptroller.ts index e57e13d..36c3a71 100644 --- a/src/mappingForComptroller.ts +++ b/src/mappingForComptroller.ts @@ -10,6 +10,7 @@ import { VolumeDripPlayer, VolumeDripPeriod, ControlledTokenBalance, + MintedControlledToken, } from '../generated/schema' import { @@ -309,20 +310,11 @@ export function handleVolumeDripDripped(event: VolumeDripDripped): void { } export function handleBeforeTokenMint(call: BeforeTokenMintCall): void { - if (call.inputs.referrer.equals(null) || call.inputs.referrer.toHexString() === ZERO_ADDRESS) { - return - } - - const id = generateCompositeId(call.inputs.to.toHexString(), call.inputs.measure.toHexString()) - - let tokenBalance = ControlledTokenBalance.load(id) - - if (!tokenBalance) { - tokenBalance = new ControlledTokenBalance(id) - tokenBalance.account = loadOrCreateAccount(call.inputs.to).id - tokenBalance.controlledToken = loadOrCreateControlledToken(call.inputs.measure).id - } - - tokenBalance.referrer = call.inputs.referrer - tokenBalance.save() + const mint = new MintedControlledToken(call.transaction.hash.toHexString()) + mint.account = loadOrCreateAccount(call.inputs.to).id + mint.controlledToken = loadOrCreateControlledToken(call.inputs.measure).id + mint.amount = call.inputs.amount + mint.referrer = call.inputs.referrer + mint.timestamp = call.block.timestamp + mint.save() } \ No newline at end of file diff --git a/src/mappingForControlledToken.ts b/src/mappingForControlledToken.ts index 75cc457..9a33f35 100644 --- a/src/mappingForControlledToken.ts +++ b/src/mappingForControlledToken.ts @@ -5,7 +5,8 @@ import { } from '../generated/templates/ControlledToken/ControlledToken' import { - ControlledTokenBalance, EnteredPool, ExitedPool, + BurnedControlledToken, + ControlledTokenBalance, } from '../generated/schema' import { loadOrCreateAccount } from './helpers/loadOrCreateAccount' import { loadOrCreateControlledToken } from './helpers/loadOrCreateControlledToken' @@ -33,13 +34,6 @@ export function handleTransfer(event: Transfer): void { toBalance.balance = event.params.value toBalance.controlledToken = controlledToken.id // or event.address toBalance.account = loadOrCreateAccount(event.params.to).id - - // Log when user as entered the pool - const enteredPool = new EnteredPool(event.transaction.hash.toHexString()) - enteredPool.controlledToken = controlledToken.id - enteredPool.account = toBalance.account - enteredPool.timestamp = event.block.timestamp - enteredPool.save() } else{ toBalance.balance = toBalance.balance.plus(event.params.value) @@ -54,16 +48,17 @@ export function handleTransfer(event: Transfer): void { else{ const fromBalance = ControlledTokenBalance.load(generateCompositeId (event.params.from.toHexString(), event.address.toHexString())) // must always exist fromBalance.balance = fromBalance.balance.minus(event.params.value) - + + // Log burn event + const burn = new BurnedControlledToken(event.transaction.hash.toHexString()) + burn.account = fromBalance.account + burn.controlledToken = fromBalance.controlledToken + burn.amount = event.params.value + burn.timestamp = event.block.timestamp + burn.save() + // if the balance of the sending account is zero then remove it if (fromBalance.balance.equals(ZERO)) { - // Log when user has exited the pool - const exitedPool = new ExitedPool(event.transaction.hash.toHexString()) - exitedPool.controlledToken = controlledToken.id - exitedPool.account = fromBalance.account - exitedPool.timestamp = event.block.timestamp - exitedPool.save() - controlledToken.numberOfHolders = controlledToken.numberOfHolders.minus(ONE) // if account balance depleted decrement player count store.remove("ControlledTokenBalance", fromBalance.id) } diff --git a/testquery.gql b/testquery.gql index 3f54581..483ba69 100644 --- a/testquery.gql +++ b/testquery.gql @@ -1,5 +1,5 @@ { - controlledTokenBalances { + mintedControlledTokens { id referrer account { @@ -8,6 +8,6 @@ controlledToken { id } - balance + amount } } \ No newline at end of file From a00b772b227c0db51bb87877bc749531ad71ed86 Mon Sep 17 00:00:00 2001 From: Scott Herren Date: Thu, 8 Apr 2021 09:13:40 -0500 Subject: [PATCH 5/5] update ignore, leave testquery --- .gitignore | 3 +- generated/schema.ts | 3236 ---------------------------------------- generated/templates.ts | 133 -- networks/local.json | 47 - testquery.gql | 152 +- 5 files changed, 147 insertions(+), 3424 deletions(-) delete mode 100644 generated/schema.ts delete mode 100644 generated/templates.ts delete mode 100644 networks/local.json diff --git a/.gitignore b/.gitignore index 12796ed..2a0c2da 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,4 @@ subgraph.ropsten.yaml subgraph.rinkeby.yaml subgraph.mainnet.yaml networks/local.json -generated -generated/schema.ts \ No newline at end of file +generated/ \ No newline at end of file diff --git a/generated/schema.ts b/generated/schema.ts deleted file mode 100644 index 18a6bb2..0000000 --- a/generated/schema.ts +++ /dev/null @@ -1,3236 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - TypedMap, - Entity, - Value, - ValueKind, - store, - Address, - Bytes, - BigInt, - BigDecimal -} from "@graphprotocol/graph-ts"; - -export class Comptroller extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save Comptroller entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save Comptroller entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("Comptroller", id.toString(), this); - } - - static load(id: string): Comptroller | null { - return store.get("Comptroller", id) as Comptroller | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get owner(): Bytes { - let value = this.get("owner"); - return value.toBytes(); - } - - set owner(value: Bytes) { - this.set("owner", Value.fromBytes(value)); - } - - get players(): Array { - let value = this.get("players"); - return value.toStringArray(); - } - - set players(value: Array) { - this.set("players", Value.fromStringArray(value)); - } - - get balanceDrips(): Array { - let value = this.get("balanceDrips"); - return value.toStringArray(); - } - - set balanceDrips(value: Array) { - this.set("balanceDrips", Value.fromStringArray(value)); - } - - get volumeDrips(): Array { - let value = this.get("volumeDrips"); - return value.toStringArray(); - } - - set volumeDrips(value: Array) { - this.set("volumeDrips", Value.fromStringArray(value)); - } -} - -export class SablierStream extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save SablierStream entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save SablierStream entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("SablierStream", id.toString(), this); - } - - static load(id: string): SablierStream | null { - return store.get("SablierStream", id) as SablierStream | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get prizePool(): string { - let value = this.get("prizePool"); - return value.toString(); - } - - set prizePool(value: string) { - this.set("prizePool", Value.fromString(value)); - } -} - -export class PrizePool extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save PrizePool entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save PrizePool entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("PrizePool", id.toString(), this); - } - - static load(id: string): PrizePool | null { - return store.get("PrizePool", id) as PrizePool | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get deactivated(): boolean { - let value = this.get("deactivated"); - return value.toBoolean(); - } - - set deactivated(value: boolean) { - this.set("deactivated", Value.fromBoolean(value)); - } - - get owner(): Bytes | null { - let value = this.get("owner"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBytes(); - } - } - - set owner(value: Bytes | null) { - if (value === null) { - this.unset("owner"); - } else { - this.set("owner", Value.fromBytes(value as Bytes)); - } - } - - get reserveRegistry(): Bytes | null { - let value = this.get("reserveRegistry"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBytes(); - } - } - - set reserveRegistry(value: Bytes | null) { - if (value === null) { - this.unset("reserveRegistry"); - } else { - this.set("reserveRegistry", Value.fromBytes(value as Bytes)); - } - } - - get prizeStrategy(): string | null { - let value = this.get("prizeStrategy"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set prizeStrategy(value: string | null) { - if (value === null) { - this.unset("prizeStrategy"); - } else { - this.set("prizeStrategy", Value.fromString(value as string)); - } - } - - get prizePoolType(): string | null { - let value = this.get("prizePoolType"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set prizePoolType(value: string | null) { - if (value === null) { - this.unset("prizePoolType"); - } else { - this.set("prizePoolType", Value.fromString(value as string)); - } - } - - get compoundPrizePool(): string | null { - let value = this.get("compoundPrizePool"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set compoundPrizePool(value: string | null) { - if (value === null) { - this.unset("compoundPrizePool"); - } else { - this.set("compoundPrizePool", Value.fromString(value as string)); - } - } - - get stakePrizePool(): string | null { - let value = this.get("stakePrizePool"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set stakePrizePool(value: string | null) { - if (value === null) { - this.unset("stakePrizePool"); - } else { - this.set("stakePrizePool", Value.fromString(value as string)); - } - } - - get yieldSourcePrizePool(): string | null { - let value = this.get("yieldSourcePrizePool"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set yieldSourcePrizePool(value: string | null) { - if (value === null) { - this.unset("yieldSourcePrizePool"); - } else { - this.set("yieldSourcePrizePool", Value.fromString(value as string)); - } - } - - get reserveFeeControlledToken(): Bytes { - let value = this.get("reserveFeeControlledToken"); - return value.toBytes(); - } - - set reserveFeeControlledToken(value: Bytes) { - this.set("reserveFeeControlledToken", Value.fromBytes(value)); - } - - get sablierStream(): string | null { - let value = this.get("sablierStream"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set sablierStream(value: string | null) { - if (value === null) { - this.unset("sablierStream"); - } else { - this.set("sablierStream", Value.fromString(value as string)); - } - } - - get underlyingCollateralToken(): Bytes | null { - let value = this.get("underlyingCollateralToken"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBytes(); - } - } - - set underlyingCollateralToken(value: Bytes | null) { - if (value === null) { - this.unset("underlyingCollateralToken"); - } else { - this.set("underlyingCollateralToken", Value.fromBytes(value as Bytes)); - } - } - - get underlyingCollateralDecimals(): BigInt | null { - let value = this.get("underlyingCollateralDecimals"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set underlyingCollateralDecimals(value: BigInt | null) { - if (value === null) { - this.unset("underlyingCollateralDecimals"); - } else { - this.set( - "underlyingCollateralDecimals", - Value.fromBigInt(value as BigInt) - ); - } - } - - get underlyingCollateralName(): string | null { - let value = this.get("underlyingCollateralName"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set underlyingCollateralName(value: string | null) { - if (value === null) { - this.unset("underlyingCollateralName"); - } else { - this.set("underlyingCollateralName", Value.fromString(value as string)); - } - } - - get underlyingCollateralSymbol(): string | null { - let value = this.get("underlyingCollateralSymbol"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set underlyingCollateralSymbol(value: string | null) { - if (value === null) { - this.unset("underlyingCollateralSymbol"); - } else { - this.set("underlyingCollateralSymbol", Value.fromString(value as string)); - } - } - - get maxExitFeeMantissa(): BigInt { - let value = this.get("maxExitFeeMantissa"); - return value.toBigInt(); - } - - set maxExitFeeMantissa(value: BigInt) { - this.set("maxExitFeeMantissa", Value.fromBigInt(value)); - } - - get maxTimelockDuration(): BigInt { - let value = this.get("maxTimelockDuration"); - return value.toBigInt(); - } - - set maxTimelockDuration(value: BigInt) { - this.set("maxTimelockDuration", Value.fromBigInt(value)); - } - - get timelockTotalSupply(): BigInt | null { - let value = this.get("timelockTotalSupply"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set timelockTotalSupply(value: BigInt | null) { - if (value === null) { - this.unset("timelockTotalSupply"); - } else { - this.set("timelockTotalSupply", Value.fromBigInt(value as BigInt)); - } - } - - get liquidityCap(): BigInt { - let value = this.get("liquidityCap"); - return value.toBigInt(); - } - - set liquidityCap(value: BigInt) { - this.set("liquidityCap", Value.fromBigInt(value)); - } - - get cumulativePrizeGross(): BigInt { - let value = this.get("cumulativePrizeGross"); - return value.toBigInt(); - } - - set cumulativePrizeGross(value: BigInt) { - this.set("cumulativePrizeGross", Value.fromBigInt(value)); - } - - get cumulativePrizeReserveFee(): BigInt { - let value = this.get("cumulativePrizeReserveFee"); - return value.toBigInt(); - } - - set cumulativePrizeReserveFee(value: BigInt) { - this.set("cumulativePrizeReserveFee", Value.fromBigInt(value)); - } - - get cumulativePrizeNet(): BigInt { - let value = this.get("cumulativePrizeNet"); - return value.toBigInt(); - } - - set cumulativePrizeNet(value: BigInt) { - this.set("cumulativePrizeNet", Value.fromBigInt(value)); - } - - get currentPrizeId(): BigInt { - let value = this.get("currentPrizeId"); - return value.toBigInt(); - } - - set currentPrizeId(value: BigInt) { - this.set("currentPrizeId", Value.fromBigInt(value)); - } - - get currentState(): string { - let value = this.get("currentState"); - return value.toString(); - } - - set currentState(value: string) { - this.set("currentState", Value.fromString(value)); - } - - get prizes(): Array { - let value = this.get("prizes"); - return value.toStringArray(); - } - - set prizes(value: Array) { - this.set("prizes", Value.fromStringArray(value)); - } - - get tokenCreditRates(): Array { - let value = this.get("tokenCreditRates"); - return value.toStringArray(); - } - - set tokenCreditRates(value: Array) { - this.set("tokenCreditRates", Value.fromStringArray(value)); - } - - get tokenCreditBalances(): Array { - let value = this.get("tokenCreditBalances"); - return value.toStringArray(); - } - - set tokenCreditBalances(value: Array) { - this.set("tokenCreditBalances", Value.fromStringArray(value)); - } - - get prizePoolAccounts(): Array { - let value = this.get("prizePoolAccounts"); - return value.toStringArray(); - } - - set prizePoolAccounts(value: Array) { - this.set("prizePoolAccounts", Value.fromStringArray(value)); - } - - get controlledTokens(): Array { - let value = this.get("controlledTokens"); - return value.toStringArray(); - } - - set controlledTokens(value: Array) { - this.set("controlledTokens", Value.fromStringArray(value)); - } -} - -export class CompoundPrizePool extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save CompoundPrizePool entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save CompoundPrizePool entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("CompoundPrizePool", id.toString(), this); - } - - static load(id: string): CompoundPrizePool | null { - return store.get("CompoundPrizePool", id) as CompoundPrizePool | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get cToken(): Bytes | null { - let value = this.get("cToken"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBytes(); - } - } - - set cToken(value: Bytes | null) { - if (value === null) { - this.unset("cToken"); - } else { - this.set("cToken", Value.fromBytes(value as Bytes)); - } - } -} - -export class StakePrizePool extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save StakePrizePool entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save StakePrizePool entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("StakePrizePool", id.toString(), this); - } - - static load(id: string): StakePrizePool | null { - return store.get("StakePrizePool", id) as StakePrizePool | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get stakeToken(): Bytes | null { - let value = this.get("stakeToken"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBytes(); - } - } - - set stakeToken(value: Bytes | null) { - if (value === null) { - this.unset("stakeToken"); - } else { - this.set("stakeToken", Value.fromBytes(value as Bytes)); - } - } -} - -export class YieldSourcePrizePool extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert( - id !== null, - "Cannot save YieldSourcePrizePool entity without an ID" - ); - assert( - id.kind == ValueKind.STRING, - "Cannot save YieldSourcePrizePool entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("YieldSourcePrizePool", id.toString(), this); - } - - static load(id: string): YieldSourcePrizePool | null { - return store.get("YieldSourcePrizePool", id) as YieldSourcePrizePool | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get yieldSource(): Bytes | null { - let value = this.get("yieldSource"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBytes(); - } - } - - set yieldSource(value: Bytes | null) { - if (value === null) { - this.unset("yieldSource"); - } else { - this.set("yieldSource", Value.fromBytes(value as Bytes)); - } - } -} - -export class PrizeStrategy extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save PrizeStrategy entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save PrizeStrategy entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("PrizeStrategy", id.toString(), this); - } - - static load(id: string): PrizeStrategy | null { - return store.get("PrizeStrategy", id) as PrizeStrategy | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get singleRandomWinner(): string | null { - let value = this.get("singleRandomWinner"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set singleRandomWinner(value: string | null) { - if (value === null) { - this.unset("singleRandomWinner"); - } else { - this.set("singleRandomWinner", Value.fromString(value as string)); - } - } - - get multipleWinners(): string | null { - let value = this.get("multipleWinners"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set multipleWinners(value: string | null) { - if (value === null) { - this.unset("multipleWinners"); - } else { - this.set("multipleWinners", Value.fromString(value as string)); - } - } -} - -export class SingleRandomWinnerPrizeStrategy extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert( - id !== null, - "Cannot save SingleRandomWinnerPrizeStrategy entity without an ID" - ); - assert( - id.kind == ValueKind.STRING, - "Cannot save SingleRandomWinnerPrizeStrategy entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("SingleRandomWinnerPrizeStrategy", id.toString(), this); - } - - static load(id: string): SingleRandomWinnerPrizeStrategy | null { - return store.get( - "SingleRandomWinnerPrizeStrategy", - id - ) as SingleRandomWinnerPrizeStrategy | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get owner(): Bytes | null { - let value = this.get("owner"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBytes(); - } - } - - set owner(value: Bytes | null) { - if (value === null) { - this.unset("owner"); - } else { - this.set("owner", Value.fromBytes(value as Bytes)); - } - } - - get tokenListener(): string | null { - let value = this.get("tokenListener"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set tokenListener(value: string | null) { - if (value === null) { - this.unset("tokenListener"); - } else { - this.set("tokenListener", Value.fromString(value as string)); - } - } - - get prizePool(): string | null { - let value = this.get("prizePool"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set prizePool(value: string | null) { - if (value === null) { - this.unset("prizePool"); - } else { - this.set("prizePool", Value.fromString(value as string)); - } - } - - get rng(): Bytes | null { - let value = this.get("rng"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBytes(); - } - } - - set rng(value: Bytes | null) { - if (value === null) { - this.unset("rng"); - } else { - this.set("rng", Value.fromBytes(value as Bytes)); - } - } - - get ticket(): string | null { - let value = this.get("ticket"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set ticket(value: string | null) { - if (value === null) { - this.unset("ticket"); - } else { - this.set("ticket", Value.fromString(value as string)); - } - } - - get sponsorship(): string | null { - let value = this.get("sponsorship"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set sponsorship(value: string | null) { - if (value === null) { - this.unset("sponsorship"); - } else { - this.set("sponsorship", Value.fromString(value as string)); - } - } - - get prizePeriodSeconds(): BigInt { - let value = this.get("prizePeriodSeconds"); - return value.toBigInt(); - } - - set prizePeriodSeconds(value: BigInt) { - this.set("prizePeriodSeconds", Value.fromBigInt(value)); - } - - get prizePeriodStartedAt(): BigInt { - let value = this.get("prizePeriodStartedAt"); - return value.toBigInt(); - } - - set prizePeriodStartedAt(value: BigInt) { - this.set("prizePeriodStartedAt", Value.fromBigInt(value)); - } - - get prizePeriodEndAt(): BigInt { - let value = this.get("prizePeriodEndAt"); - return value.toBigInt(); - } - - set prizePeriodEndAt(value: BigInt) { - this.set("prizePeriodEndAt", Value.fromBigInt(value)); - } - - get externalErc20Awards(): Array { - let value = this.get("externalErc20Awards"); - return value.toStringArray(); - } - - set externalErc20Awards(value: Array) { - this.set("externalErc20Awards", Value.fromStringArray(value)); - } - - get externalErc721Awards(): Array { - let value = this.get("externalErc721Awards"); - return value.toStringArray(); - } - - set externalErc721Awards(value: Array) { - this.set("externalErc721Awards", Value.fromStringArray(value)); - } -} - -export class Prize extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save Prize entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save Prize entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("Prize", id.toString(), this); - } - - static load(id: string): Prize | null { - return store.get("Prize", id) as Prize | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get prizePool(): string { - let value = this.get("prizePool"); - return value.toString(); - } - - set prizePool(value: string) { - this.set("prizePool", Value.fromString(value)); - } - - get awardStartOperator(): Bytes | null { - let value = this.get("awardStartOperator"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBytes(); - } - } - - set awardStartOperator(value: Bytes | null) { - if (value === null) { - this.unset("awardStartOperator"); - } else { - this.set("awardStartOperator", Value.fromBytes(value as Bytes)); - } - } - - get awardedOperator(): Bytes | null { - let value = this.get("awardedOperator"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBytes(); - } - } - - set awardedOperator(value: Bytes | null) { - if (value === null) { - this.unset("awardedOperator"); - } else { - this.set("awardedOperator", Value.fromBytes(value as Bytes)); - } - } - - get prizePeriodStartedTimestamp(): BigInt | null { - let value = this.get("prizePeriodStartedTimestamp"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set prizePeriodStartedTimestamp(value: BigInt | null) { - if (value === null) { - this.unset("prizePeriodStartedTimestamp"); - } else { - this.set( - "prizePeriodStartedTimestamp", - Value.fromBigInt(value as BigInt) - ); - } - } - - get lockBlock(): BigInt | null { - let value = this.get("lockBlock"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set lockBlock(value: BigInt | null) { - if (value === null) { - this.unset("lockBlock"); - } else { - this.set("lockBlock", Value.fromBigInt(value as BigInt)); - } - } - - get awardedBlock(): BigInt | null { - let value = this.get("awardedBlock"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set awardedBlock(value: BigInt | null) { - if (value === null) { - this.unset("awardedBlock"); - } else { - this.set("awardedBlock", Value.fromBigInt(value as BigInt)); - } - } - - get awardedTimestamp(): BigInt | null { - let value = this.get("awardedTimestamp"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set awardedTimestamp(value: BigInt | null) { - if (value === null) { - this.unset("awardedTimestamp"); - } else { - this.set("awardedTimestamp", Value.fromBigInt(value as BigInt)); - } - } - - get rngRequestId(): BigInt | null { - let value = this.get("rngRequestId"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set rngRequestId(value: BigInt | null) { - if (value === null) { - this.unset("rngRequestId"); - } else { - this.set("rngRequestId", Value.fromBigInt(value as BigInt)); - } - } - - get randomNumber(): BigInt | null { - let value = this.get("randomNumber"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set randomNumber(value: BigInt | null) { - if (value === null) { - this.unset("randomNumber"); - } else { - this.set("randomNumber", Value.fromBigInt(value as BigInt)); - } - } - - get numberOfSubWinners(): BigInt | null { - let value = this.get("numberOfSubWinners"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set numberOfSubWinners(value: BigInt | null) { - if (value === null) { - this.unset("numberOfSubWinners"); - } else { - this.set("numberOfSubWinners", Value.fromBigInt(value as BigInt)); - } - } - - get totalTicketSupply(): BigInt | null { - let value = this.get("totalTicketSupply"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set totalTicketSupply(value: BigInt | null) { - if (value === null) { - this.unset("totalTicketSupply"); - } else { - this.set("totalTicketSupply", Value.fromBigInt(value as BigInt)); - } - } - - get awardedControlledTokens(): Array { - let value = this.get("awardedControlledTokens"); - return value.toStringArray(); - } - - set awardedControlledTokens(value: Array) { - this.set("awardedControlledTokens", Value.fromStringArray(value)); - } - - get awardedExternalErc20Tokens(): Array { - let value = this.get("awardedExternalErc20Tokens"); - return value.toStringArray(); - } - - set awardedExternalErc20Tokens(value: Array) { - this.set("awardedExternalErc20Tokens", Value.fromStringArray(value)); - } - - get awardedExternalErc721Nfts(): Array { - let value = this.get("awardedExternalErc721Nfts"); - return value.toStringArray(); - } - - set awardedExternalErc721Nfts(value: Array) { - this.set("awardedExternalErc721Nfts", Value.fromStringArray(value)); - } -} - -export class AwardedControlledToken extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert( - id !== null, - "Cannot save AwardedControlledToken entity without an ID" - ); - assert( - id.kind == ValueKind.STRING, - "Cannot save AwardedControlledToken entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("AwardedControlledToken", id.toString(), this); - } - - static load(id: string): AwardedControlledToken | null { - return store.get( - "AwardedControlledToken", - id - ) as AwardedControlledToken | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get winner(): Bytes { - let value = this.get("winner"); - return value.toBytes(); - } - - set winner(value: Bytes) { - this.set("winner", Value.fromBytes(value)); - } - - get amount(): BigInt { - let value = this.get("amount"); - return value.toBigInt(); - } - - set amount(value: BigInt) { - this.set("amount", Value.fromBigInt(value)); - } - - get token(): string { - let value = this.get("token"); - return value.toString(); - } - - set token(value: string) { - this.set("token", Value.fromString(value)); - } - - get prize(): string { - let value = this.get("prize"); - return value.toString(); - } - - set prize(value: string) { - this.set("prize", Value.fromString(value)); - } -} - -export class AwardedExternalErc20Token extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert( - id !== null, - "Cannot save AwardedExternalErc20Token entity without an ID" - ); - assert( - id.kind == ValueKind.STRING, - "Cannot save AwardedExternalErc20Token entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("AwardedExternalErc20Token", id.toString(), this); - } - - static load(id: string): AwardedExternalErc20Token | null { - return store.get( - "AwardedExternalErc20Token", - id - ) as AwardedExternalErc20Token | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get address(): Bytes { - let value = this.get("address"); - return value.toBytes(); - } - - set address(value: Bytes) { - this.set("address", Value.fromBytes(value)); - } - - get name(): string | null { - let value = this.get("name"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set name(value: string | null) { - if (value === null) { - this.unset("name"); - } else { - this.set("name", Value.fromString(value as string)); - } - } - - get symbol(): string | null { - let value = this.get("symbol"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set symbol(value: string | null) { - if (value === null) { - this.unset("symbol"); - } else { - this.set("symbol", Value.fromString(value as string)); - } - } - - get decimals(): BigInt | null { - let value = this.get("decimals"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set decimals(value: BigInt | null) { - if (value === null) { - this.unset("decimals"); - } else { - this.set("decimals", Value.fromBigInt(value as BigInt)); - } - } - - get balanceAwarded(): BigInt | null { - let value = this.get("balanceAwarded"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set balanceAwarded(value: BigInt | null) { - if (value === null) { - this.unset("balanceAwarded"); - } else { - this.set("balanceAwarded", Value.fromBigInt(value as BigInt)); - } - } - - get prize(): string { - let value = this.get("prize"); - return value.toString(); - } - - set prize(value: string) { - this.set("prize", Value.fromString(value)); - } - - get winner(): Bytes | null { - let value = this.get("winner"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBytes(); - } - } - - set winner(value: Bytes | null) { - if (value === null) { - this.unset("winner"); - } else { - this.set("winner", Value.fromBytes(value as Bytes)); - } - } -} - -export class AwardedExternalErc721Nft extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert( - id !== null, - "Cannot save AwardedExternalErc721Nft entity without an ID" - ); - assert( - id.kind == ValueKind.STRING, - "Cannot save AwardedExternalErc721Nft entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("AwardedExternalErc721Nft", id.toString(), this); - } - - static load(id: string): AwardedExternalErc721Nft | null { - return store.get( - "AwardedExternalErc721Nft", - id - ) as AwardedExternalErc721Nft | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get address(): Bytes { - let value = this.get("address"); - return value.toBytes(); - } - - set address(value: Bytes) { - this.set("address", Value.fromBytes(value)); - } - - get tokenIds(): Array | null { - let value = this.get("tokenIds"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigIntArray(); - } - } - - set tokenIds(value: Array | null) { - if (value === null) { - this.unset("tokenIds"); - } else { - this.set("tokenIds", Value.fromBigIntArray(value as Array)); - } - } - - get prize(): string | null { - let value = this.get("prize"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set prize(value: string | null) { - if (value === null) { - this.unset("prize"); - } else { - this.set("prize", Value.fromString(value as string)); - } - } - - get winner(): Bytes | null { - let value = this.get("winner"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBytes(); - } - } - - set winner(value: Bytes | null) { - if (value === null) { - this.unset("winner"); - } else { - this.set("winner", Value.fromBytes(value as Bytes)); - } - } -} - -export class ControlledToken extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save ControlledToken entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save ControlledToken entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("ControlledToken", id.toString(), this); - } - - static load(id: string): ControlledToken | null { - return store.get("ControlledToken", id) as ControlledToken | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get name(): string { - let value = this.get("name"); - return value.toString(); - } - - set name(value: string) { - this.set("name", Value.fromString(value)); - } - - get symbol(): string { - let value = this.get("symbol"); - return value.toString(); - } - - set symbol(value: string) { - this.set("symbol", Value.fromString(value)); - } - - get decimals(): BigInt | null { - let value = this.get("decimals"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set decimals(value: BigInt | null) { - if (value === null) { - this.unset("decimals"); - } else { - this.set("decimals", Value.fromBigInt(value as BigInt)); - } - } - - get controller(): string | null { - let value = this.get("controller"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set controller(value: string | null) { - if (value === null) { - this.unset("controller"); - } else { - this.set("controller", Value.fromString(value as string)); - } - } - - get totalSupply(): BigInt { - let value = this.get("totalSupply"); - return value.toBigInt(); - } - - set totalSupply(value: BigInt) { - this.set("totalSupply", Value.fromBigInt(value)); - } - - get numberOfHolders(): BigInt { - let value = this.get("numberOfHolders"); - return value.toBigInt(); - } - - set numberOfHolders(value: BigInt) { - this.set("numberOfHolders", Value.fromBigInt(value)); - } - - get balances(): Array { - let value = this.get("balances"); - return value.toStringArray(); - } - - set balances(value: Array) { - this.set("balances", Value.fromStringArray(value)); - } -} - -export class ControlledTokenBalance extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert( - id !== null, - "Cannot save ControlledTokenBalance entity without an ID" - ); - assert( - id.kind == ValueKind.STRING, - "Cannot save ControlledTokenBalance entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("ControlledTokenBalance", id.toString(), this); - } - - static load(id: string): ControlledTokenBalance | null { - return store.get( - "ControlledTokenBalance", - id - ) as ControlledTokenBalance | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get account(): string { - let value = this.get("account"); - return value.toString(); - } - - set account(value: string) { - this.set("account", Value.fromString(value)); - } - - get controlledToken(): string { - let value = this.get("controlledToken"); - return value.toString(); - } - - set controlledToken(value: string) { - this.set("controlledToken", Value.fromString(value)); - } - - get balance(): BigInt | null { - let value = this.get("balance"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set balance(value: BigInt | null) { - if (value === null) { - this.unset("balance"); - } else { - this.set("balance", Value.fromBigInt(value as BigInt)); - } - } - - get referrer(): Bytes | null { - let value = this.get("referrer"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBytes(); - } - } - - set referrer(value: Bytes | null) { - if (value === null) { - this.unset("referrer"); - } else { - this.set("referrer", Value.fromBytes(value as Bytes)); - } - } -} - -export class EnteredPool extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save EnteredPool entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save EnteredPool entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("EnteredPool", id.toString(), this); - } - - static load(id: string): EnteredPool | null { - return store.get("EnteredPool", id) as EnteredPool | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get controlledToken(): string { - let value = this.get("controlledToken"); - return value.toString(); - } - - set controlledToken(value: string) { - this.set("controlledToken", Value.fromString(value)); - } - - get account(): string { - let value = this.get("account"); - return value.toString(); - } - - set account(value: string) { - this.set("account", Value.fromString(value)); - } - - get timestamp(): BigInt { - let value = this.get("timestamp"); - return value.toBigInt(); - } - - set timestamp(value: BigInt) { - this.set("timestamp", Value.fromBigInt(value)); - } -} - -export class ExitedPool extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save ExitedPool entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save ExitedPool entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("ExitedPool", id.toString(), this); - } - - static load(id: string): ExitedPool | null { - return store.get("ExitedPool", id) as ExitedPool | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get controlledToken(): string { - let value = this.get("controlledToken"); - return value.toString(); - } - - set controlledToken(value: string) { - this.set("controlledToken", Value.fromString(value)); - } - - get account(): string { - let value = this.get("account"); - return value.toString(); - } - - set account(value: string) { - this.set("account", Value.fromString(value)); - } - - get timestamp(): BigInt { - let value = this.get("timestamp"); - return value.toBigInt(); - } - - set timestamp(value: BigInt) { - this.set("timestamp", Value.fromBigInt(value)); - } -} - -export class SingleRandomWinnerExternalErc20Award extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert( - id !== null, - "Cannot save SingleRandomWinnerExternalErc20Award entity without an ID" - ); - assert( - id.kind == ValueKind.STRING, - "Cannot save SingleRandomWinnerExternalErc20Award entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("SingleRandomWinnerExternalErc20Award", id.toString(), this); - } - - static load(id: string): SingleRandomWinnerExternalErc20Award | null { - return store.get( - "SingleRandomWinnerExternalErc20Award", - id - ) as SingleRandomWinnerExternalErc20Award | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get address(): Bytes { - let value = this.get("address"); - return value.toBytes(); - } - - set address(value: Bytes) { - this.set("address", Value.fromBytes(value)); - } - - get name(): string | null { - let value = this.get("name"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set name(value: string | null) { - if (value === null) { - this.unset("name"); - } else { - this.set("name", Value.fromString(value as string)); - } - } - - get symbol(): string | null { - let value = this.get("symbol"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set symbol(value: string | null) { - if (value === null) { - this.unset("symbol"); - } else { - this.set("symbol", Value.fromString(value as string)); - } - } - - get decimals(): BigInt | null { - let value = this.get("decimals"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set decimals(value: BigInt | null) { - if (value === null) { - this.unset("decimals"); - } else { - this.set("decimals", Value.fromBigInt(value as BigInt)); - } - } - - get prizeStrategy(): string | null { - let value = this.get("prizeStrategy"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set prizeStrategy(value: string | null) { - if (value === null) { - this.unset("prizeStrategy"); - } else { - this.set("prizeStrategy", Value.fromString(value as string)); - } - } -} - -export class SingleRandomWinnerExternalErc721Award extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert( - id !== null, - "Cannot save SingleRandomWinnerExternalErc721Award entity without an ID" - ); - assert( - id.kind == ValueKind.STRING, - "Cannot save SingleRandomWinnerExternalErc721Award entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("SingleRandomWinnerExternalErc721Award", id.toString(), this); - } - - static load(id: string): SingleRandomWinnerExternalErc721Award | null { - return store.get( - "SingleRandomWinnerExternalErc721Award", - id - ) as SingleRandomWinnerExternalErc721Award | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get address(): Bytes { - let value = this.get("address"); - return value.toBytes(); - } - - set address(value: Bytes) { - this.set("address", Value.fromBytes(value)); - } - - get tokenIds(): Array | null { - let value = this.get("tokenIds"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigIntArray(); - } - } - - set tokenIds(value: Array | null) { - if (value === null) { - this.unset("tokenIds"); - } else { - this.set("tokenIds", Value.fromBigIntArray(value as Array)); - } - } - - get prizeStrategy(): string | null { - let value = this.get("prizeStrategy"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set prizeStrategy(value: string | null) { - if (value === null) { - this.unset("prizeStrategy"); - } else { - this.set("prizeStrategy", Value.fromString(value as string)); - } - } -} - -export class PrizePoolAccount extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save PrizePoolAccount entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save PrizePoolAccount entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("PrizePoolAccount", id.toString(), this); - } - - static load(id: string): PrizePoolAccount | null { - return store.get("PrizePoolAccount", id) as PrizePoolAccount | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get prizePool(): string { - let value = this.get("prizePool"); - return value.toString(); - } - - set prizePool(value: string) { - this.set("prizePool", Value.fromString(value)); - } - - get account(): string { - let value = this.get("account"); - return value.toString(); - } - - set account(value: string) { - this.set("account", Value.fromString(value)); - } - - get timelockedBalance(): BigInt { - let value = this.get("timelockedBalance"); - return value.toBigInt(); - } - - set timelockedBalance(value: BigInt) { - this.set("timelockedBalance", Value.fromBigInt(value)); - } - - get unlockTimestamp(): BigInt { - let value = this.get("unlockTimestamp"); - return value.toBigInt(); - } - - set unlockTimestamp(value: BigInt) { - this.set("unlockTimestamp", Value.fromBigInt(value)); - } -} - -export class Account extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save Account entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save Account entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("Account", id.toString(), this); - } - - static load(id: string): Account | null { - return store.get("Account", id) as Account | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get prizePoolAccounts(): Array { - let value = this.get("prizePoolAccounts"); - return value.toStringArray(); - } - - set prizePoolAccounts(value: Array) { - this.set("prizePoolAccounts", Value.fromStringArray(value)); - } - - get controlledTokenBalances(): Array | null { - let value = this.get("controlledTokenBalances"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toStringArray(); - } - } - - set controlledTokenBalances(value: Array | null) { - if (value === null) { - this.unset("controlledTokenBalances"); - } else { - this.set( - "controlledTokenBalances", - Value.fromStringArray(value as Array) - ); - } - } -} - -export class CreditRate extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save CreditRate entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save CreditRate entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("CreditRate", id.toString(), this); - } - - static load(id: string): CreditRate | null { - return store.get("CreditRate", id) as CreditRate | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get prizePool(): string { - let value = this.get("prizePool"); - return value.toString(); - } - - set prizePool(value: string) { - this.set("prizePool", Value.fromString(value)); - } - - get creditLimitMantissa(): BigInt { - let value = this.get("creditLimitMantissa"); - return value.toBigInt(); - } - - set creditLimitMantissa(value: BigInt) { - this.set("creditLimitMantissa", Value.fromBigInt(value)); - } - - get creditRateMantissa(): BigInt { - let value = this.get("creditRateMantissa"); - return value.toBigInt(); - } - - set creditRateMantissa(value: BigInt) { - this.set("creditRateMantissa", Value.fromBigInt(value)); - } -} - -export class CreditBalance extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save CreditBalance entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save CreditBalance entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("CreditBalance", id.toString(), this); - } - - static load(id: string): CreditBalance | null { - return store.get("CreditBalance", id) as CreditBalance | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get prizePool(): string { - let value = this.get("prizePool"); - return value.toString(); - } - - set prizePool(value: string) { - this.set("prizePool", Value.fromString(value)); - } - - get balance(): BigInt | null { - let value = this.get("balance"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set balance(value: BigInt | null) { - if (value === null) { - this.unset("balance"); - } else { - this.set("balance", Value.fromBigInt(value as BigInt)); - } - } - - get timestamp(): BigInt | null { - let value = this.get("timestamp"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set timestamp(value: BigInt | null) { - if (value === null) { - this.unset("timestamp"); - } else { - this.set("timestamp", Value.fromBigInt(value as BigInt)); - } - } - - get initialized(): boolean { - let value = this.get("initialized"); - return value.toBoolean(); - } - - set initialized(value: boolean) { - this.set("initialized", Value.fromBoolean(value)); - } -} - -export class DripTokenPlayer extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save DripTokenPlayer entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save DripTokenPlayer entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("DripTokenPlayer", id.toString(), this); - } - - static load(id: string): DripTokenPlayer | null { - return store.get("DripTokenPlayer", id) as DripTokenPlayer | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get comptroller(): string { - let value = this.get("comptroller"); - return value.toString(); - } - - set comptroller(value: string) { - this.set("comptroller", Value.fromString(value)); - } - - get dripToken(): Bytes { - let value = this.get("dripToken"); - return value.toBytes(); - } - - set dripToken(value: Bytes) { - this.set("dripToken", Value.fromBytes(value)); - } - - get address(): Bytes { - let value = this.get("address"); - return value.toBytes(); - } - - set address(value: Bytes) { - this.set("address", Value.fromBytes(value)); - } - - get balance(): BigInt { - let value = this.get("balance"); - return value.toBigInt(); - } - - set balance(value: BigInt) { - this.set("balance", Value.fromBigInt(value)); - } -} - -export class BalanceDripPlayer extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save BalanceDripPlayer entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save BalanceDripPlayer entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("BalanceDripPlayer", id.toString(), this); - } - - static load(id: string): BalanceDripPlayer | null { - return store.get("BalanceDripPlayer", id) as BalanceDripPlayer | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get balanceDrip(): string { - let value = this.get("balanceDrip"); - return value.toString(); - } - - set balanceDrip(value: string) { - this.set("balanceDrip", Value.fromString(value)); - } - - get address(): Bytes { - let value = this.get("address"); - return value.toBytes(); - } - - set address(value: Bytes) { - this.set("address", Value.fromBytes(value)); - } -} - -export class BalanceDrip extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save BalanceDrip entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save BalanceDrip entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("BalanceDrip", id.toString(), this); - } - - static load(id: string): BalanceDrip | null { - return store.get("BalanceDrip", id) as BalanceDrip | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get comptroller(): string { - let value = this.get("comptroller"); - return value.toString(); - } - - set comptroller(value: string) { - this.set("comptroller", Value.fromString(value)); - } - - get sourceAddress(): Bytes { - let value = this.get("sourceAddress"); - return value.toBytes(); - } - - set sourceAddress(value: Bytes) { - this.set("sourceAddress", Value.fromBytes(value)); - } - - get measureToken(): Bytes { - let value = this.get("measureToken"); - return value.toBytes(); - } - - set measureToken(value: Bytes) { - this.set("measureToken", Value.fromBytes(value)); - } - - get dripToken(): Bytes { - let value = this.get("dripToken"); - return value.toBytes(); - } - - set dripToken(value: Bytes) { - this.set("dripToken", Value.fromBytes(value)); - } - - get dripRatePerSecond(): BigInt | null { - let value = this.get("dripRatePerSecond"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set dripRatePerSecond(value: BigInt | null) { - if (value === null) { - this.unset("dripRatePerSecond"); - } else { - this.set("dripRatePerSecond", Value.fromBigInt(value as BigInt)); - } - } - - get exchangeRateMantissa(): BigInt | null { - let value = this.get("exchangeRateMantissa"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set exchangeRateMantissa(value: BigInt | null) { - if (value === null) { - this.unset("exchangeRateMantissa"); - } else { - this.set("exchangeRateMantissa", Value.fromBigInt(value as BigInt)); - } - } - - get timestamp(): BigInt | null { - let value = this.get("timestamp"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set timestamp(value: BigInt | null) { - if (value === null) { - this.unset("timestamp"); - } else { - this.set("timestamp", Value.fromBigInt(value as BigInt)); - } - } - - get players(): Array { - let value = this.get("players"); - return value.toStringArray(); - } - - set players(value: Array) { - this.set("players", Value.fromStringArray(value)); - } - - get deactivated(): boolean { - let value = this.get("deactivated"); - return value.toBoolean(); - } - - set deactivated(value: boolean) { - this.set("deactivated", Value.fromBoolean(value)); - } -} - -export class VolumeDripPlayer extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save VolumeDripPlayer entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save VolumeDripPlayer entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("VolumeDripPlayer", id.toString(), this); - } - - static load(id: string): VolumeDripPlayer | null { - return store.get("VolumeDripPlayer", id) as VolumeDripPlayer | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get volumeDrip(): string { - let value = this.get("volumeDrip"); - return value.toString(); - } - - set volumeDrip(value: string) { - this.set("volumeDrip", Value.fromString(value)); - } - - get address(): Bytes { - let value = this.get("address"); - return value.toBytes(); - } - - set address(value: Bytes) { - this.set("address", Value.fromBytes(value)); - } - - get periodIndex(): BigInt { - let value = this.get("periodIndex"); - return value.toBigInt(); - } - - set periodIndex(value: BigInt) { - this.set("periodIndex", Value.fromBigInt(value)); - } - - get balance(): BigInt { - let value = this.get("balance"); - return value.toBigInt(); - } - - set balance(value: BigInt) { - this.set("balance", Value.fromBigInt(value)); - } -} - -export class VolumeDripPeriod extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save VolumeDripPeriod entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save VolumeDripPeriod entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("VolumeDripPeriod", id.toString(), this); - } - - static load(id: string): VolumeDripPeriod | null { - return store.get("VolumeDripPeriod", id) as VolumeDripPeriod | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get volumeDrip(): string { - let value = this.get("volumeDrip"); - return value.toString(); - } - - set volumeDrip(value: string) { - this.set("volumeDrip", Value.fromString(value)); - } - - get periodIndex(): BigInt { - let value = this.get("periodIndex"); - return value.toBigInt(); - } - - set periodIndex(value: BigInt) { - this.set("periodIndex", Value.fromBigInt(value)); - } - - get totalSupply(): BigInt | null { - let value = this.get("totalSupply"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set totalSupply(value: BigInt | null) { - if (value === null) { - this.unset("totalSupply"); - } else { - this.set("totalSupply", Value.fromBigInt(value as BigInt)); - } - } - - get dripAmount(): BigInt | null { - let value = this.get("dripAmount"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set dripAmount(value: BigInt | null) { - if (value === null) { - this.unset("dripAmount"); - } else { - this.set("dripAmount", Value.fromBigInt(value as BigInt)); - } - } - - get endTime(): BigInt | null { - let value = this.get("endTime"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set endTime(value: BigInt | null) { - if (value === null) { - this.unset("endTime"); - } else { - this.set("endTime", Value.fromBigInt(value as BigInt)); - } - } - - get isDripping(): boolean { - let value = this.get("isDripping"); - return value.toBoolean(); - } - - set isDripping(value: boolean) { - this.set("isDripping", Value.fromBoolean(value)); - } -} - -export class VolumeDrip extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id !== null, "Cannot save VolumeDrip entity without an ID"); - assert( - id.kind == ValueKind.STRING, - "Cannot save VolumeDrip entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("VolumeDrip", id.toString(), this); - } - - static load(id: string): VolumeDrip | null { - return store.get("VolumeDrip", id) as VolumeDrip | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get comptroller(): string { - let value = this.get("comptroller"); - return value.toString(); - } - - set comptroller(value: string) { - this.set("comptroller", Value.fromString(value)); - } - - get sourceAddress(): Bytes { - let value = this.get("sourceAddress"); - return value.toBytes(); - } - - set sourceAddress(value: Bytes) { - this.set("sourceAddress", Value.fromBytes(value)); - } - - get measureToken(): Bytes { - let value = this.get("measureToken"); - return value.toBytes(); - } - - set measureToken(value: Bytes) { - this.set("measureToken", Value.fromBytes(value)); - } - - get dripToken(): Bytes { - let value = this.get("dripToken"); - return value.toBytes(); - } - - set dripToken(value: Bytes) { - this.set("dripToken", Value.fromBytes(value)); - } - - get referral(): boolean { - let value = this.get("referral"); - return value.toBoolean(); - } - - set referral(value: boolean) { - this.set("referral", Value.fromBoolean(value)); - } - - get periodSeconds(): BigInt | null { - let value = this.get("periodSeconds"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set periodSeconds(value: BigInt | null) { - if (value === null) { - this.unset("periodSeconds"); - } else { - this.set("periodSeconds", Value.fromBigInt(value as BigInt)); - } - } - - get dripAmount(): BigInt | null { - let value = this.get("dripAmount"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set dripAmount(value: BigInt | null) { - if (value === null) { - this.unset("dripAmount"); - } else { - this.set("dripAmount", Value.fromBigInt(value as BigInt)); - } - } - - get periodCount(): BigInt | null { - let value = this.get("periodCount"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set periodCount(value: BigInt | null) { - if (value === null) { - this.unset("periodCount"); - } else { - this.set("periodCount", Value.fromBigInt(value as BigInt)); - } - } - - get deposits(): Array { - let value = this.get("deposits"); - return value.toStringArray(); - } - - set deposits(value: Array) { - this.set("deposits", Value.fromStringArray(value)); - } - - get periods(): Array { - let value = this.get("periods"); - return value.toStringArray(); - } - - set periods(value: Array) { - this.set("periods", Value.fromStringArray(value)); - } - - get deactivated(): boolean { - let value = this.get("deactivated"); - return value.toBoolean(); - } - - set deactivated(value: boolean) { - this.set("deactivated", Value.fromBoolean(value)); - } -} - -export class MultipleWinnersPrizeStrategy extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert( - id !== null, - "Cannot save MultipleWinnersPrizeStrategy entity without an ID" - ); - assert( - id.kind == ValueKind.STRING, - "Cannot save MultipleWinnersPrizeStrategy entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("MultipleWinnersPrizeStrategy", id.toString(), this); - } - - static load(id: string): MultipleWinnersPrizeStrategy | null { - return store.get( - "MultipleWinnersPrizeStrategy", - id - ) as MultipleWinnersPrizeStrategy | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get owner(): Bytes | null { - let value = this.get("owner"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBytes(); - } - } - - set owner(value: Bytes | null) { - if (value === null) { - this.unset("owner"); - } else { - this.set("owner", Value.fromBytes(value as Bytes)); - } - } - - get numberOfWinners(): BigInt | null { - let value = this.get("numberOfWinners"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set numberOfWinners(value: BigInt | null) { - if (value === null) { - this.unset("numberOfWinners"); - } else { - this.set("numberOfWinners", Value.fromBigInt(value as BigInt)); - } - } - - get splitExternalERC20Awards(): boolean { - let value = this.get("splitExternalERC20Awards"); - return value.toBoolean(); - } - - set splitExternalERC20Awards(value: boolean) { - this.set("splitExternalERC20Awards", Value.fromBoolean(value)); - } - - get tokenListener(): Bytes | null { - let value = this.get("tokenListener"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBytes(); - } - } - - set tokenListener(value: Bytes | null) { - if (value === null) { - this.unset("tokenListener"); - } else { - this.set("tokenListener", Value.fromBytes(value as Bytes)); - } - } - - get prizePool(): string | null { - let value = this.get("prizePool"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set prizePool(value: string | null) { - if (value === null) { - this.unset("prizePool"); - } else { - this.set("prizePool", Value.fromString(value as string)); - } - } - - get rng(): Bytes | null { - let value = this.get("rng"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBytes(); - } - } - - set rng(value: Bytes | null) { - if (value === null) { - this.unset("rng"); - } else { - this.set("rng", Value.fromBytes(value as Bytes)); - } - } - - get ticket(): string | null { - let value = this.get("ticket"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set ticket(value: string | null) { - if (value === null) { - this.unset("ticket"); - } else { - this.set("ticket", Value.fromString(value as string)); - } - } - - get sponsorship(): string | null { - let value = this.get("sponsorship"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set sponsorship(value: string | null) { - if (value === null) { - this.unset("sponsorship"); - } else { - this.set("sponsorship", Value.fromString(value as string)); - } - } - - get prizePeriodSeconds(): BigInt { - let value = this.get("prizePeriodSeconds"); - return value.toBigInt(); - } - - set prizePeriodSeconds(value: BigInt) { - this.set("prizePeriodSeconds", Value.fromBigInt(value)); - } - - get prizePeriodStartedAt(): BigInt { - let value = this.get("prizePeriodStartedAt"); - return value.toBigInt(); - } - - set prizePeriodStartedAt(value: BigInt) { - this.set("prizePeriodStartedAt", Value.fromBigInt(value)); - } - - get prizePeriodEndAt(): BigInt { - let value = this.get("prizePeriodEndAt"); - return value.toBigInt(); - } - - set prizePeriodEndAt(value: BigInt) { - this.set("prizePeriodEndAt", Value.fromBigInt(value)); - } - - get externalErc20Awards(): Array { - let value = this.get("externalErc20Awards"); - return value.toStringArray(); - } - - set externalErc20Awards(value: Array) { - this.set("externalErc20Awards", Value.fromStringArray(value)); - } - - get externalErc721Awards(): Array { - let value = this.get("externalErc721Awards"); - return value.toStringArray(); - } - - set externalErc721Awards(value: Array) { - this.set("externalErc721Awards", Value.fromStringArray(value)); - } -} - -export class MultipleWinnersExternalErc20Award extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert( - id !== null, - "Cannot save MultipleWinnersExternalErc20Award entity without an ID" - ); - assert( - id.kind == ValueKind.STRING, - "Cannot save MultipleWinnersExternalErc20Award entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("MultipleWinnersExternalErc20Award", id.toString(), this); - } - - static load(id: string): MultipleWinnersExternalErc20Award | null { - return store.get( - "MultipleWinnersExternalErc20Award", - id - ) as MultipleWinnersExternalErc20Award | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get address(): Bytes { - let value = this.get("address"); - return value.toBytes(); - } - - set address(value: Bytes) { - this.set("address", Value.fromBytes(value)); - } - - get name(): string | null { - let value = this.get("name"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set name(value: string | null) { - if (value === null) { - this.unset("name"); - } else { - this.set("name", Value.fromString(value as string)); - } - } - - get symbol(): string | null { - let value = this.get("symbol"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set symbol(value: string | null) { - if (value === null) { - this.unset("symbol"); - } else { - this.set("symbol", Value.fromString(value as string)); - } - } - - get decimals(): BigInt | null { - let value = this.get("decimals"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set decimals(value: BigInt | null) { - if (value === null) { - this.unset("decimals"); - } else { - this.set("decimals", Value.fromBigInt(value as BigInt)); - } - } - - get balanceAwarded(): BigInt | null { - let value = this.get("balanceAwarded"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set balanceAwarded(value: BigInt | null) { - if (value === null) { - this.unset("balanceAwarded"); - } else { - this.set("balanceAwarded", Value.fromBigInt(value as BigInt)); - } - } - - get prizeStrategy(): string | null { - let value = this.get("prizeStrategy"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set prizeStrategy(value: string | null) { - if (value === null) { - this.unset("prizeStrategy"); - } else { - this.set("prizeStrategy", Value.fromString(value as string)); - } - } -} - -export class MultipleWinnersExternalErc721Award extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert( - id !== null, - "Cannot save MultipleWinnersExternalErc721Award entity without an ID" - ); - assert( - id.kind == ValueKind.STRING, - "Cannot save MultipleWinnersExternalErc721Award entity with non-string ID. " + - 'Considering using .toHex() to convert the "id" to a string.' - ); - store.set("MultipleWinnersExternalErc721Award", id.toString(), this); - } - - static load(id: string): MultipleWinnersExternalErc721Award | null { - return store.get( - "MultipleWinnersExternalErc721Award", - id - ) as MultipleWinnersExternalErc721Award | null; - } - - get id(): string { - let value = this.get("id"); - return value.toString(); - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get address(): Bytes { - let value = this.get("address"); - return value.toBytes(); - } - - set address(value: Bytes) { - this.set("address", Value.fromBytes(value)); - } - - get tokenIds(): Array | null { - let value = this.get("tokenIds"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigIntArray(); - } - } - - set tokenIds(value: Array | null) { - if (value === null) { - this.unset("tokenIds"); - } else { - this.set("tokenIds", Value.fromBigIntArray(value as Array)); - } - } - - get prizeStrategy(): string | null { - let value = this.get("prizeStrategy"); - if (value === null || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set prizeStrategy(value: string | null) { - if (value === null) { - this.unset("prizeStrategy"); - } else { - this.set("prizeStrategy", Value.fromString(value as string)); - } - } -} diff --git a/generated/templates.ts b/generated/templates.ts deleted file mode 100644 index f4d859d..0000000 --- a/generated/templates.ts +++ /dev/null @@ -1,133 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - DataSourceTemplate, - DataSourceContext -} from "@graphprotocol/graph-ts"; - -export class SingleRandomWinner extends DataSourceTemplate { - static create(address: Address): void { - DataSourceTemplate.create("SingleRandomWinner", [address.toHex()]); - } - - static createWithContext(address: Address, context: DataSourceContext): void { - DataSourceTemplate.createWithContext( - "SingleRandomWinner", - [address.toHex()], - context - ); - } -} - -export class StakePrizePool extends DataSourceTemplate { - static create(address: Address): void { - DataSourceTemplate.create("StakePrizePool", [address.toHex()]); - } - - static createWithContext(address: Address, context: DataSourceContext): void { - DataSourceTemplate.createWithContext( - "StakePrizePool", - [address.toHex()], - context - ); - } -} - -export class CompoundPrizePool extends DataSourceTemplate { - static create(address: Address): void { - DataSourceTemplate.create("CompoundPrizePool", [address.toHex()]); - } - - static createWithContext(address: Address, context: DataSourceContext): void { - DataSourceTemplate.createWithContext( - "CompoundPrizePool", - [address.toHex()], - context - ); - } -} - -export class YieldSourcePrizePool extends DataSourceTemplate { - static create(address: Address): void { - DataSourceTemplate.create("YieldSourcePrizePool", [address.toHex()]); - } - - static createWithContext(address: Address, context: DataSourceContext): void { - DataSourceTemplate.createWithContext( - "YieldSourcePrizePool", - [address.toHex()], - context - ); - } -} - -export class PrizePool_v3 extends DataSourceTemplate { - static create(address: Address): void { - DataSourceTemplate.create("PrizePool_v3", [address.toHex()]); - } - - static createWithContext(address: Address, context: DataSourceContext): void { - DataSourceTemplate.createWithContext( - "PrizePool_v3", - [address.toHex()], - context - ); - } -} - -export class PrizePool_v3_1_0 extends DataSourceTemplate { - static create(address: Address): void { - DataSourceTemplate.create("PrizePool_v3_1_0", [address.toHex()]); - } - - static createWithContext(address: Address, context: DataSourceContext): void { - DataSourceTemplate.createWithContext( - "PrizePool_v3_1_0", - [address.toHex()], - context - ); - } -} - -export class PrizePool_v3_0_1 extends DataSourceTemplate { - static create(address: Address): void { - DataSourceTemplate.create("PrizePool_v3_0_1", [address.toHex()]); - } - - static createWithContext(address: Address, context: DataSourceContext): void { - DataSourceTemplate.createWithContext( - "PrizePool_v3_0_1", - [address.toHex()], - context - ); - } -} - -export class ControlledToken extends DataSourceTemplate { - static create(address: Address): void { - DataSourceTemplate.create("ControlledToken", [address.toHex()]); - } - - static createWithContext(address: Address, context: DataSourceContext): void { - DataSourceTemplate.createWithContext( - "ControlledToken", - [address.toHex()], - context - ); - } -} - -export class MultipleWinners extends DataSourceTemplate { - static create(address: Address): void { - DataSourceTemplate.create("MultipleWinners", [address.toHex()]); - } - - static createWithContext(address: Address, context: DataSourceContext): void { - DataSourceTemplate.createWithContext( - "MultipleWinners", - [address.toHex()], - context - ); - } -} diff --git a/networks/local.json b/networks/local.json deleted file mode 100644 index 69550a4..0000000 --- a/networks/local.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "network": "mainnet", - "compoundPrizePoolProxyFactory_v3_0_1": { - "address": "0x17CfE08818E8260FAe3a19761668EBc27B24d72A", - "startBlock": "11101023" - }, - "compoundPrizePoolProxyFactory_v3_1_0": { - "address": "0x4e972abb057495635718F416E5836ac516bD2618", - "startBlock": "11428997" - }, - "singleRandomWinnerProxyFactory_v3_0_1": { - "address": "0xc79B5D46f010c88f738A00B3bed7757d04dd2a37", - "startBlock": "11101039" - }, - "singleRandomWinnerProxyFactory_v3_1_0": { - "address": "0xBa49B45Bc5f7e3F23B5d994082038c836895AdfD", - "startBlock": "11429018" - }, - "comptroller": { - "address": "0x4027dE966127af5F015Ea1cfd6293a3583892668", - "startBlock": "11101017" - }, - "controlledTokenProxyFactory_v3_0_1": { - "address": "0xdd8f31f7B9C6026311464bc07aE5DB2F99F3892e", - "startBlock": "11101028" - }, - "controlledTokenProxyFactory_v3_1_0": { - "address": "0xfB932b0BcFA5208D536600ab23C13Ac55CD69Ba1", - "startBlock": "11429010" - }, - "multipleWinnersProxyFactory_v3_1_0": { - "address": "0x734E677AC3699f63f47c2bAE7a8F3c16aFf5aE70", - "startBlock": "11429015" - }, - "ticketProxyFactory_v3_1_0": { - "address": "0xa7d0d3C4f96BB896e0878ef4b83e5cA79700aCB9", - "startBlock": "11429012" - }, - "ticketProxyFactory_v3_0_1": { - "address": "0x59b34c5BC94e2d5b9DcB97Ec935c94C353E5Eb94", - "startBlock": "11101030" - }, - "stakePrizePoolProxyFactory_v3_1_0": { - "address": "0x3b694ce9d12F0bF032bF002b3b0473Cb58bbe3F0", - "startBlock": "11429013" - } -} \ No newline at end of file diff --git a/testquery.gql b/testquery.gql index 483ba69..fe3c1ef 100644 --- a/testquery.gql +++ b/testquery.gql @@ -1,13 +1,153 @@ { - mintedControlledTokens { + comptrollers { id - referrer - account { + owner + + balanceDrips { id + measureToken + dripToken + + dripRatePerSecond + exchangeRateMantissa + timestamp + + players { + address + } } - controlledToken { + volumeDrips { id + measureToken + dripToken + dripAmount + + deactivated + referral + + periodSeconds + periodCount + periods { + id + periodIndex + totalSupply + dripAmount + endTime + isDripping + } + deposits { + id + address + periodIndex + balance + } } - amount } -} \ No newline at end of file + + prizePools { + id + deactivated + owner + + prizePoolType + compoundPrizePool { + id + cToken + } + + reserveFeeControlledToken + + underlyingCollateralToken + underlyingCollateralName + underlyingCollateralSymbol + underlyingCollateralDecimals + + maxExitFeeMantissa + maxTimelockDuration + timelockTotalSupply + liquidityCap + + currentPrizeId + currentState + + cumulativePrizeNet + cumulativePrizeGross + cumulativePrizeReserveFee + + prizeStrategy { + singleRandomWinner { + id + owner + rng + + ticket { + id + type + name + symbol + decimals + totalSupply + } + sponsorship { + id + type + name + symbol + decimals + totalSupply + } + + prizePeriodSeconds + prizePeriodStartedAt + prizePeriodEndAt + + externalErc20Awards { + address + } + externalErc721Awards { + address + tokenIds + } + } + } + + totalSupply + totalSponsorship + + playerCount + players { + id + address + balance + timelockedBalance + unlockTimestamp + cumulativeWinnings + } + + prizes { + id + awardedBlock + randomNumber + amount + totalTicketSupply + winners + } + + tokenCreditRates { + creditRateMantissa + creditLimitMantissa + } + + tokenCreditBalances { + balance + timestamp + initialized + } + + sponsors { + id + address + balance + } + } +}