├── .nvmrc ├── .gitignore ├── .DS_Store ├── src ├── helpers │ ├── hasZeroTickets.ts │ ├── consolidateDrawId.ts │ ├── loadSponsor.ts │ ├── consolidateBalance.ts │ ├── depositCommitted.ts │ ├── loadOrCreatePod.ts │ ├── loadOrCreateSponsor.ts │ ├── updatePod.ts │ ├── loadOrCreatePoolTokenContract.ts │ ├── loadOrCreatePodPlayer.ts │ ├── loadOrCreatePoolContract.ts │ ├── updatePodPlayer.ts │ └── loadOrCreatePlayer.ts ├── mappingForPoolToken.ts ├── mappingForPod.ts └── mappingForMCDAwarePool.ts ├── package.json ├── LICENSE ├── README.md ├── schema.graphql ├── subgraph.rinkeby.yaml ├── subgraph.kovan.yaml ├── subgraph.yaml ├── abis └── PoolToken.json └── generated ├── schema.ts ├── PoolDai └── PoolToken.ts ├── PoolSai └── PoolToken.ts └── PoolDaiToken └── PoolToken.ts /.nvmrc: -------------------------------------------------------------------------------- 1 | v10.20.1 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .history 3 | build 4 | subgraph.local.yaml 5 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooltogether/pooltogether-subgraph/HEAD/.DS_Store -------------------------------------------------------------------------------- /src/helpers/hasZeroTickets.ts: -------------------------------------------------------------------------------- 1 | import { BigInt } from "@graphprotocol/graph-ts" 2 | import { 3 | Player 4 | } from '../../generated/schema' 5 | 6 | const ZERO = BigInt.fromI32(0) 7 | 8 | export function hasZeroTickets(player: Player): boolean { 9 | return player.consolidatedBalance.plus(player.latestBalance).equals(ZERO) 10 | } -------------------------------------------------------------------------------- /src/helpers/consolidateDrawId.ts: -------------------------------------------------------------------------------- 1 | import { BigInt } from "@graphprotocol/graph-ts" 2 | import { Player } from "../../generated/schema"; 3 | 4 | const ZERO = BigInt.fromI32(0) 5 | 6 | export function consolidateDrawId(player: Player, drawId: BigInt): void { 7 | if (player.firstDepositDrawId.equals(ZERO)) { 8 | player.firstDepositDrawId = drawId 9 | } 10 | } -------------------------------------------------------------------------------- /src/helpers/loadSponsor.ts: -------------------------------------------------------------------------------- 1 | import { BigInt, Address } from "@graphprotocol/graph-ts" 2 | import { 3 | Sponsor 4 | } from '../../generated/schema' 5 | 6 | function formatSponsorId(sponsorAddress: Address, poolAddress: Address): string { 7 | return 'sponsor-' + sponsorAddress.toHex() + '_pool-' + poolAddress.toHex() 8 | } 9 | 10 | export function loadSponsor(sponsorAddress: Address, poolAddress: Address): Sponsor { 11 | let sponsorId = formatSponsorId(sponsorAddress, poolAddress) 12 | return Sponsor.load(sponsorId) as Sponsor 13 | } 14 | -------------------------------------------------------------------------------- /src/helpers/consolidateBalance.ts: -------------------------------------------------------------------------------- 1 | import { BigInt } from "@graphprotocol/graph-ts" 2 | import { 3 | PoolContract, 4 | Player 5 | } from '../../generated/schema' 6 | 7 | const ZERO = BigInt.fromI32(0) 8 | 9 | export function consolidateBalance(player: Player): void { 10 | let pool = PoolContract.load(player.poolContract) 11 | if (pool.openDrawId > player.latestDrawId) { 12 | player.consolidatedBalance = player.consolidatedBalance.plus(player.latestBalance) 13 | player.latestBalance = ZERO 14 | player.latestDrawId = ZERO 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/helpers/depositCommitted.ts: -------------------------------------------------------------------------------- 1 | import { BigInt, Address, store } from "@graphprotocol/graph-ts" 2 | import { consolidateBalance } from './consolidateBalance' 3 | import { loadOrCreatePlayer } from './loadOrCreatePlayer' 4 | 5 | const ONE = BigInt.fromI32(1) 6 | 7 | export function depositCommitted(playerAddress: Address, poolAddress: Address, amount: BigInt): void { 8 | let player = loadOrCreatePlayer(playerAddress, poolAddress) 9 | consolidateBalance(player) 10 | player.consolidatedBalance = player.consolidatedBalance.plus(amount) 11 | player.version = player.version.plus(ONE) 12 | player.save() 13 | } 14 | -------------------------------------------------------------------------------- /src/helpers/loadOrCreatePod.ts: -------------------------------------------------------------------------------- 1 | import { BigInt, Address } from "@graphprotocol/graph-ts" 2 | import { 3 | Pod 4 | } from '../../generated/schema' 5 | 6 | const ZERO = BigInt.fromI32(0) 7 | 8 | export function loadOrCreatePod(podAddress: Address, poolAddress: Address): Pod { 9 | const podId = podAddress.toHex() 10 | let pod = Pod.load(podId) 11 | 12 | if (!pod) { 13 | pod = new Pod(podId) 14 | pod.address = podAddress 15 | pod.currentExchangeRateMantissa = ZERO 16 | pod.balanceUnderlying = ZERO 17 | pod.totalPendingDeposits = ZERO 18 | pod.podPlayersCount = ZERO 19 | pod.poolContract = poolAddress.toHex() 20 | pod.version = ZERO 21 | pod.winnings = ZERO 22 | 23 | pod.save() 24 | } 25 | 26 | return pod as Pod 27 | } 28 | -------------------------------------------------------------------------------- /src/helpers/loadOrCreateSponsor.ts: -------------------------------------------------------------------------------- 1 | import { BigInt, Address } from "@graphprotocol/graph-ts" 2 | import { 3 | Sponsor 4 | } from '../../generated/schema' 5 | 6 | const ZERO = BigInt.fromI32(0) 7 | 8 | function formatSponsorId(sponsorAddress: Address, poolAddress: Address): string { 9 | return 'sponsor-' + sponsorAddress.toHex() + '_pool-' + poolAddress.toHex() 10 | } 11 | 12 | export function loadOrCreateSponsor(sponsorAddress: Address, poolAddress: Address): Sponsor { 13 | let sponsorId = formatSponsorId(sponsorAddress, poolAddress) 14 | let sponsor = Sponsor.load(sponsorId) 15 | 16 | if (!sponsor) { 17 | sponsor = new Sponsor(sponsorId) 18 | sponsor.address = sponsorAddress 19 | sponsor.sponsorshipAndFeeBalance = ZERO 20 | sponsor.poolContract = poolAddress.toHex() 21 | } 22 | 23 | return sponsor as Sponsor 24 | } 25 | -------------------------------------------------------------------------------- /src/helpers/updatePod.ts: -------------------------------------------------------------------------------- 1 | import { BigInt, Address } from "@graphprotocol/graph-ts" 2 | import { 3 | Pod as ContractPod 4 | } from '../../generated/DaiPod/Pod' 5 | import { 6 | Pod 7 | } from '../../generated/schema' 8 | import { loadOrCreatePodPlayer } from './loadOrCreatePodPlayer' 9 | import { updatePodPlayer } from './updatePodPlayer' 10 | 11 | const ONE = BigInt.fromI32(1) 12 | 13 | export function updatePod(pod: Pod, playerAddress: Address, newBalanceUnderlying: BigInt): void { 14 | const podPlayer = loadOrCreatePodPlayer(pod, playerAddress) 15 | const podAddress = Address.fromString(pod.address.toHex()) 16 | const boundPod = ContractPod.bind(podAddress) 17 | 18 | pod.totalPendingDeposits = boundPod.totalPendingDeposits() 19 | pod.currentExchangeRateMantissa = boundPod.currentExchangeRateMantissa() 20 | 21 | pod.balanceUnderlying = newBalanceUnderlying 22 | 23 | pod.version = pod.version.plus(ONE) 24 | pod.save() 25 | 26 | updatePodPlayer(podPlayer, boundPod) 27 | } 28 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pooltogether", 3 | "license": "MIT", 4 | "scripts": { 5 | "codegen": "graph codegen", 6 | "build": "graph build", 7 | "auth": "graph auth https://api.thegraph.com/deploy/", 8 | "create-local": "graph create --node http://127.0.0.1:8020 pooltogether/pooltogether subgraph.local.yaml", 9 | "remove-local": "graph remove --node http://127.0.0.1:8020 pooltogether/pooltogether subgraph.local.yaml", 10 | "deploy-local": "graph deploy --node http://127.0.0.1:8020 --ipfs http://localhost:5001 pooltogether/pooltogether-pods subgraph.local.yaml", 11 | "deploy": "graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ pooltogether/pooltogether subgraph.yaml", 12 | "deploy-kovan": "graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ pooltogether/pooltogether-kovan subgraph.kovan.yaml" 13 | }, 14 | "dependencies": { 15 | "@graphprotocol/graph-cli": "^0.18.0", 16 | "@graphprotocol/graph-ts": "^0.18.1" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2019 PoolTogether LLC 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /src/helpers/loadOrCreatePoolTokenContract.ts: -------------------------------------------------------------------------------- 1 | import { BigInt, Address } from "@graphprotocol/graph-ts" 2 | import { 3 | PoolToken 4 | } from "../../generated/PoolDaiToken/PoolToken" 5 | import { 6 | PoolTokenContract 7 | } from '../../generated/schema' 8 | import { loadOrCreatePoolContract } from './loadOrCreatePoolContract' 9 | 10 | const ONE = BigInt.fromI32(1) 11 | 12 | export function loadOrCreatePoolTokenContract(poolTokenAddress: Address): PoolTokenContract { 13 | let poolTokenContract = PoolTokenContract.load(poolTokenAddress.toHex()) 14 | if (!poolTokenContract) { 15 | let poolTokenContract = new PoolTokenContract(poolTokenAddress.toHex()) 16 | let poolToken = PoolToken.bind(poolTokenAddress) 17 | poolTokenContract.name = poolToken.name() 18 | poolTokenContract.symbol = poolToken.symbol() 19 | poolTokenContract.save() 20 | 21 | let poolContract = loadOrCreatePoolContract(poolToken.pool()) 22 | poolContract.poolToken = poolTokenContract.id 23 | poolContract.version = poolContract.version.plus(ONE) 24 | poolContract.save() 25 | } 26 | return poolTokenContract as PoolTokenContract 27 | } 28 | -------------------------------------------------------------------------------- /src/helpers/loadOrCreatePodPlayer.ts: -------------------------------------------------------------------------------- 1 | import { Bytes, BigInt, Address } from "@graphprotocol/graph-ts" 2 | import { 3 | Pod, 4 | PodPlayer 5 | } from '../../generated/schema' 6 | 7 | const ONE = BigInt.fromI32(1) 8 | const ZERO = BigInt.fromI32(0) 9 | 10 | function formatPlayerId(playerAddress: Address, podAddress: Bytes): string { 11 | return 'player-' + playerAddress.toHex() + '_pod-' + podAddress.toHex() 12 | } 13 | 14 | export function loadOrCreatePodPlayer(pod: Pod, playerAddress: Address): PodPlayer { 15 | let podPlayerId = formatPlayerId(playerAddress, pod.address) 16 | let podPlayer = PodPlayer.load(podPlayerId) 17 | 18 | if (!podPlayer) { 19 | podPlayer = new PodPlayer(podPlayerId) 20 | podPlayer.address = playerAddress 21 | podPlayer.balance = ZERO 22 | podPlayer.balanceUnderlying = ZERO 23 | podPlayer.lastDeposit = ZERO 24 | podPlayer.lastDepositDrawId = ZERO 25 | podPlayer.pod = pod.address.toHex() 26 | podPlayer.version = ZERO 27 | podPlayer.save() 28 | 29 | pod.podPlayersCount = pod.podPlayersCount.plus(ONE) 30 | pod.version = pod.version.plus(ONE) 31 | pod.save() 32 | } 33 | 34 | return podPlayer as PodPlayer 35 | } 36 | -------------------------------------------------------------------------------- /src/helpers/loadOrCreatePoolContract.ts: -------------------------------------------------------------------------------- 1 | import { BigInt, Address } from "@graphprotocol/graph-ts" 2 | import { 3 | PoolToken, 4 | } from '../../generated/PoolDaiToken/PoolToken' 5 | import { 6 | MCDAwarePool, 7 | } from '../../generated/PoolDai/MCDAwarePool' 8 | import { 9 | PoolContract 10 | } from '../../generated/schema' 11 | 12 | const ZERO = BigInt.fromI32(0) 13 | 14 | export function loadOrCreatePoolContract(poolAddress: Address, save: boolean = true): PoolContract { 15 | const poolId = poolAddress.toHex() 16 | let poolContract = PoolContract.load(poolId) 17 | 18 | if (!poolContract) { 19 | poolContract = new PoolContract(poolId) 20 | poolContract.drawsCount = ZERO 21 | poolContract.openDrawId = ZERO 22 | poolContract.committedDrawId = ZERO 23 | poolContract.committedBalance = ZERO 24 | poolContract.openBalance = ZERO 25 | poolContract.sponsorshipAndFeeBalance = ZERO 26 | poolContract.winnings = ZERO 27 | poolContract.playersCount = ZERO 28 | poolContract.paused = false 29 | poolContract.version = ZERO 30 | 31 | if (save) { 32 | poolContract.save() 33 | } 34 | } 35 | 36 | return poolContract as PoolContract 37 | } 38 | -------------------------------------------------------------------------------- /src/helpers/updatePodPlayer.ts: -------------------------------------------------------------------------------- 1 | import { Address, BigInt, store } from "@graphprotocol/graph-ts" 2 | import { 3 | Pod as ContractPod 4 | } from "../../generated/DaiPod/Pod" 5 | import { 6 | Pod, 7 | PodPlayer 8 | } from '../../generated/schema' 9 | 10 | const ZERO = BigInt.fromI32(0) 11 | const ONE = BigInt.fromI32(1) 12 | 13 | export function updatePodPlayer(podPlayer: PodPlayer, boundPod: ContractPod): void { 14 | const playerAddress = Address.fromString(podPlayer.address.toHex()) 15 | podPlayer.balance = boundPod.balanceOf(playerAddress) 16 | podPlayer.balanceUnderlying = boundPod.balanceOfUnderlying(playerAddress) 17 | 18 | podPlayer.lastDeposit = boundPod.pendingDeposit(playerAddress) 19 | 20 | if (podPlayer.lastDeposit.equals(ZERO)) { 21 | podPlayer.lastDepositDrawId = ZERO 22 | } 23 | 24 | if (podPlayer.balanceUnderlying.plus(podPlayer.lastDeposit).equals(ZERO)) { 25 | store.remove('PodPlayer', podPlayer.id) 26 | 27 | const pod = Pod.load(podPlayer.pod) 28 | pod.podPlayersCount = pod.podPlayersCount.minus(ONE) 29 | 30 | pod.version = pod.version.plus(ONE) 31 | pod.save() 32 | } else { 33 | podPlayer.version = podPlayer.version.plus(ONE) 34 | podPlayer.save() 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/helpers/loadOrCreatePlayer.ts: -------------------------------------------------------------------------------- 1 | import { BigInt, Address } from "@graphprotocol/graph-ts" 2 | import { 3 | Player 4 | } from '../../generated/schema' 5 | import { loadOrCreatePoolContract } from "./loadOrCreatePoolContract" 6 | 7 | const ONE = BigInt.fromI32(1) 8 | const ZERO = BigInt.fromI32(0) 9 | 10 | function formatPlayerId(playerAddress: Address, poolAddress: Address): string { 11 | return 'player-' + playerAddress.toHex() + '_pool-' + poolAddress.toHex() 12 | } 13 | 14 | export function loadOrCreatePlayer(playerAddress: Address, poolAddress: Address): Player { 15 | let playerId = formatPlayerId(playerAddress, poolAddress) 16 | let player = Player.load(playerId) 17 | 18 | if (!player) { 19 | player = new Player(playerId) 20 | player.address = playerAddress 21 | player.consolidatedBalance = ZERO 22 | player.firstDepositDrawId = ZERO 23 | player.latestBalance = ZERO 24 | player.latestDrawId = ZERO 25 | player.poolContract = poolAddress.toHex() 26 | player.winnings = ZERO 27 | player.version = ZERO 28 | 29 | let poolContract = loadOrCreatePoolContract(poolAddress) 30 | poolContract.playersCount = poolContract.playersCount.plus(ONE) 31 | poolContract.version = poolContract.version.plus(ONE) 32 | poolContract.save() 33 | } 34 | 35 | return player as Player 36 | } 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PoolTogether Subgraph 2 | 3 | The official PoolTogether subgraph. 4 | 5 | ## Local Setup 6 | 7 | First you'll need to setup a graph node, then you can deploy the project to it. 8 | 9 | ### Local Graph Node 10 | 11 | 1. Clone the Graph Node repo: 12 | 13 | ```bash 14 | $ git clone https://github.com/graphprotocol/graph-node/ 15 | ``` 16 | 17 | 2. Enter the dir 18 | 19 | ```bash 20 | $ cd graph-node/docker 21 | ``` 22 | 23 | 3. If using Linux, fix the local IP address: 24 | 25 | ```bash 26 | $ ./setup.sh 27 | ``` 28 | 29 | 4. Spin up the node 30 | 31 | ```bash 32 | $ docker-compose up 33 | ``` 34 | 35 | ### Deploying the Subgraph Locally 36 | 37 | Make sure you've already deployed the PoolTogether contracts. If you haven't done so, check out the [mock project](https://github.com/pooltogether/pooltogether-contracts-mock). Once the contracts are deployed, you can set up the subgraph: 38 | 39 | 1. Install deps 40 | 41 | ```bash 42 | $ yarn 43 | ``` 44 | 45 | 2. Ensure generated code is up-to-date: 46 | 47 | ```bash 48 | $ yarn codegen 49 | ``` 50 | 51 | 3. Create a new local manifest called `subgraph.local.yaml` 52 | 53 | ```bash 54 | $ cp subgraph.yaml subgraph.local.yaml 55 | ``` 56 | 57 | 4. Update `subgraph.local.yaml` to the correct contract address (network doesn't matter) 58 | 59 | ```yaml 60 | // subgraph.local.yaml 61 | dataSources: 62 | - kind: ethereum/contract 63 | name: PoolTogether 64 | network: mainnet 65 | source: 66 | address: "" 67 | abi: Pool 68 | ``` 69 | 70 | 5. Allocate the subgraph in the local Graph node 71 | 72 | ```bash 73 | $ yarn create-local 74 | ``` 75 | 76 | 6. Update the local subgraph 77 | 78 | ```bash 79 | $ yarn deploy-local 80 | ``` 81 | -------------------------------------------------------------------------------- /src/mappingForPoolToken.ts: -------------------------------------------------------------------------------- 1 | import { BigInt, Address, log, store } from "@graphprotocol/graph-ts" 2 | import { 3 | MCDAwarePool 4 | } from "../generated/PoolDai/MCDAwarePool" 5 | import { 6 | Pod 7 | } from '../generated/schema' 8 | import { 9 | PoolToken, 10 | Approval, 11 | AuthorizedOperator, 12 | Burned, 13 | Minted, 14 | Redeemed, 15 | RevokedOperator, 16 | Sent, 17 | Transfer 18 | } from "../generated/PoolDaiToken/PoolToken" 19 | import { loadOrCreatePlayer } from './helpers/loadOrCreatePlayer' 20 | import { consolidateBalance } from './helpers/consolidateBalance' 21 | import { loadOrCreatePoolTokenContract } from './helpers/loadOrCreatePoolTokenContract' 22 | import { hasZeroTickets } from './helpers/hasZeroTickets' 23 | import { loadOrCreatePoolContract } from "./helpers/loadOrCreatePoolContract" 24 | import { depositCommitted } from "./helpers/depositCommitted" 25 | import { updatePod } from './helpers/updatePod' 26 | 27 | const ONE = BigInt.fromI32(1) 28 | 29 | function withdraw(playerAddress: Address, poolAddress: Address, amount: BigInt): void { 30 | let player = loadOrCreatePlayer(playerAddress, poolAddress) 31 | consolidateBalance(player) 32 | 33 | let pool = loadOrCreatePoolContract(poolAddress) 34 | let poolContract = MCDAwarePool.bind(poolAddress) 35 | pool.committedBalance = poolContract.committedSupply() 36 | pool.version = pool.version.plus(ONE) 37 | pool.save() 38 | 39 | player.consolidatedBalance = player.consolidatedBalance.minus(amount) 40 | 41 | if (hasZeroTickets(player)) { 42 | store.remove('Player', player.id) 43 | pool.playersCount = pool.playersCount.minus(ONE) 44 | pool.save() 45 | } else { 46 | player.version = player.version.plus(ONE) 47 | player.save() 48 | } 49 | } 50 | 51 | export function handleApproval(event: Approval): void { 52 | } 53 | 54 | export function handleAuthorizedOperator(event: AuthorizedOperator): void {} 55 | 56 | export function handleBurned(event: Burned): void {} 57 | 58 | export function handleMinted(event: Minted): void {} 59 | 60 | export function handleRedeemed(event: Redeemed): void {} 61 | 62 | export function handleRevokedOperator(event: RevokedOperator): void {} 63 | 64 | export function handleSent(event: Sent): void { 65 | loadOrCreatePoolTokenContract(event.address) 66 | let poolToken = PoolToken.bind(event.address) 67 | let poolAddress = poolToken.pool() 68 | withdraw(event.params.from, poolAddress, event.params.amount) 69 | depositCommitted(event.params.to, poolAddress, event.params.amount) 70 | 71 | const podId = event.params.to.toHex() 72 | let pod = Pod.load(podId) 73 | if (pod) { 74 | const newBalanceUnderlying = pod.balanceUnderlying.plus(event.params.amount) 75 | updatePod(pod as Pod, event.params.from, newBalanceUnderlying) 76 | } 77 | } 78 | 79 | // only need to track either Sent or Transfer events. Sent is handled above 80 | export function handleTransfer(event: Transfer): void {} 81 | -------------------------------------------------------------------------------- /schema.graphql: -------------------------------------------------------------------------------- 1 | enum DrawState { 2 | Open 3 | Committed 4 | Rewarded 5 | } 6 | 7 | type Draw @entity { 8 | id: ID! 9 | drawId: BigInt! 10 | feeBeneficiary: Bytes 11 | secretHash: Bytes 12 | feeFraction: BigInt 13 | winner: Bytes 14 | entropy: Bytes 15 | winnings: BigInt 16 | fee: BigInt 17 | state: DrawState 18 | poolContract: PoolContract! 19 | 20 | openedAt: BigInt! 21 | committedAt: BigInt! 22 | rewardedAt: BigInt! 23 | 24 | openedAtBlock: BigInt! 25 | committedAtBlock: BigInt! 26 | rewardedAtBlock: BigInt! 27 | 28 | balance: BigInt 29 | 30 | version: BigInt! 31 | } 32 | 33 | type Player @entity { 34 | id: ID! 35 | address: Bytes! 36 | poolContract: PoolContract! 37 | consolidatedBalance: BigInt! 38 | firstDepositDrawId: BigInt! 39 | latestBalance: BigInt! 40 | latestDrawId: BigInt! 41 | winnings: BigInt! 42 | 43 | version: BigInt! 44 | } 45 | 46 | type Pod @entity { 47 | id: ID! 48 | address: Bytes! 49 | podPlayers: [PodPlayer!]! @derivedFrom(field: "pod") 50 | collateralizationEvents: [CollateralizationEvent!]! @derivedFrom(field: "pod") 51 | podPlayersCount: BigInt 52 | 53 | currentExchangeRateMantissa: BigInt! 54 | balanceUnderlying: BigInt! 55 | totalPendingDeposits: BigInt! 56 | poolContract: PoolContract! 57 | 58 | winnings: BigInt! 59 | 60 | version: BigInt! 61 | } 62 | 63 | type CollateralizationEvent @entity { 64 | id: ID! 65 | pod: Pod! 66 | block: BigInt! 67 | 68 | createdAt: BigInt! 69 | tokenSupply: BigInt! 70 | collateral: BigInt! 71 | exchangeRateMantissa: BigInt! 72 | } 73 | 74 | type PodPlayer @entity { 75 | id: ID! 76 | address: Bytes! 77 | pod: Pod! 78 | 79 | balance: BigInt! 80 | balanceUnderlying: BigInt! 81 | lastDeposit: BigInt! 82 | lastDepositDrawId: BigInt! 83 | 84 | version: BigInt! 85 | } 86 | 87 | type Sponsor @entity { 88 | id: ID! 89 | address: Bytes! 90 | poolContract: PoolContract! 91 | sponsorshipAndFeeBalance: BigInt! 92 | } 93 | 94 | type Admin @entity { 95 | id: ID! 96 | address: Bytes! 97 | addedAt: BigInt! 98 | poolContract: PoolContract! 99 | } 100 | 101 | type PoolContract @entity { 102 | id: ID! 103 | 104 | draws: [Draw!]! @derivedFrom(field: "poolContract") 105 | admins: [Admin!]! @derivedFrom(field: "poolContract") 106 | players: [Player!]! @derivedFrom(field: "poolContract") 107 | 108 | playersCount: BigInt 109 | drawsCount: BigInt 110 | openDrawId: BigInt! 111 | committedDrawId: BigInt! 112 | paused: Boolean 113 | poolToken: PoolTokenContract 114 | 115 | openBalance: BigInt! 116 | committedBalance: BigInt! 117 | sponsorshipAndFeeBalance: BigInt! 118 | winnings: BigInt! 119 | 120 | version: BigInt! 121 | } 122 | 123 | type PoolTokenContract @entity { 124 | id: ID! 125 | name: String! 126 | symbol: String! 127 | poolContract: PoolContract! @derivedFrom(field: "poolToken") 128 | } -------------------------------------------------------------------------------- /src/mappingForPod.ts: -------------------------------------------------------------------------------- 1 | import { log, BigInt, Address, store } from "@graphprotocol/graph-ts" 2 | import { 3 | Pod as ContractPod 4 | } from "../generated/DaiPod/Pod" 5 | import { 6 | CollateralizationEvent, 7 | Pod, 8 | } from '../generated/schema' 9 | import { 10 | PendingDepositWithdrawn, 11 | Redeemed, 12 | RedeemedToPool, 13 | CollateralizationChanged, 14 | Deposited 15 | } from "../generated/DaiPod/Pod" 16 | import { loadOrCreatePod } from './helpers/loadOrCreatePod' 17 | import { loadOrCreatePodPlayer } from './helpers/loadOrCreatePodPlayer' 18 | import { updatePod } from './helpers/updatePod' 19 | 20 | function getPod(podAddress: Address): Pod { 21 | const boundPod = ContractPod.bind(podAddress) 22 | const poolAddress = boundPod.pool() 23 | 24 | const pod = loadOrCreatePod(podAddress, poolAddress) 25 | 26 | return pod 27 | } 28 | 29 | export function handlePendingDepositWithdrawn(event: PendingDepositWithdrawn): void { 30 | const podAddress = event.address 31 | let pod = getPod(podAddress) 32 | 33 | const newBalanceUnderlying = pod.balanceUnderlying.minus(event.params.collateral) 34 | updatePod(pod as Pod, event.params.from, newBalanceUnderlying) 35 | } 36 | 37 | export function handleRedeemed(event: Redeemed): void { 38 | const podAddress = event.address 39 | let pod = getPod(podAddress) 40 | 41 | const newBalanceUnderlying = pod.balanceUnderlying.minus(event.params.collateral) 42 | updatePod(pod as Pod, event.params.from, newBalanceUnderlying) 43 | } 44 | 45 | export function handleRedeemedToPool(event: RedeemedToPool): void { 46 | const podAddress = event.address 47 | let pod = getPod(podAddress) 48 | 49 | const newBalanceUnderlying = pod.balanceUnderlying.minus(event.params.collateral) 50 | updatePod(pod as Pod, event.params.from, newBalanceUnderlying) 51 | } 52 | 53 | export function handleCollateralizationChanged(event: CollateralizationChanged): void { 54 | const collateralizationEventId = 'pod-' + event.address.toHex() + '-collateralizationEvent-' + event.params.timestamp.toHex() 55 | const collateralizationEvent = new CollateralizationEvent(collateralizationEventId) 56 | 57 | collateralizationEvent.pod = event.address.toHex() 58 | collateralizationEvent.block = event.block.number 59 | 60 | collateralizationEvent.createdAt = event.params.timestamp 61 | collateralizationEvent.tokenSupply = event.params.tokens 62 | collateralizationEvent.collateral = event.params.collateral 63 | collateralizationEvent.exchangeRateMantissa = event.params.mantissa 64 | 65 | collateralizationEvent.save() 66 | } 67 | 68 | export function handleDeposited(event: Deposited): void { 69 | const podAddress = event.address 70 | let pod = getPod(podAddress) 71 | 72 | const newBalanceUnderlying = pod.balanceUnderlying.plus(event.params.collateral) 73 | updatePod(pod as Pod, event.params.from, newBalanceUnderlying) 74 | 75 | const podPlayer = loadOrCreatePodPlayer(pod, event.params.from) 76 | podPlayer.lastDeposit = event.params.collateral 77 | podPlayer.lastDepositDrawId = event.params.drawId 78 | podPlayer.save() 79 | } 80 | -------------------------------------------------------------------------------- /subgraph.rinkeby.yaml: -------------------------------------------------------------------------------- 1 | specVersion: 0.0.2 2 | schema: 3 | file: ./schema.graphql 4 | dataSources: 5 | - kind: ethereum/contract 6 | name: PoolSai 7 | network: rinkeby 8 | source: 9 | address: "0x7f5442a047B95b7E1D8e11df9276756a2185127D" 10 | abi: Pool 11 | mapping: 12 | kind: ethereum/events 13 | apiVersion: 0.0.3 14 | language: wasm/assemblyscript 15 | entities: 16 | - Draw 17 | - Deposited 18 | - DepositedAndCommitted 19 | - SponsorshipDeposited 20 | - AdminAdded 21 | - AdminRemoved 22 | - Withdrawn 23 | - Opened 24 | - Committed 25 | - Rewarded 26 | - NextFeeFractionChanged 27 | - NextFeeBeneficiaryChanged 28 | - Paused 29 | - Unpaused 30 | abis: 31 | - name: Pool 32 | file: ./abis/Pool.json 33 | eventHandlers: 34 | - event: Deposited(indexed address,uint256) 35 | handler: handleDeposited 36 | - event: DepositedAndCommitted(indexed address,uint256) 37 | handler: handleDepositedAndCommitted 38 | - event: SponsorshipDeposited(indexed address,uint256) 39 | handler: handleSponsorshipDeposited 40 | - event: AdminAdded(indexed address) 41 | handler: handleAdminAdded 42 | - event: AdminRemoved(indexed address) 43 | handler: handleAdminRemoved 44 | - event: Withdrawn(indexed address,uint256) 45 | handler: handleWithdrawn 46 | - event: Opened(indexed uint256,indexed address,bytes32,uint256) 47 | handler: handleOpened 48 | - event: Committed(indexed uint256) 49 | handler: handleCommitted 50 | - event: Rewarded(indexed uint256,indexed address,bytes32,uint256,uint256) 51 | handler: handleRewarded 52 | - event: NextFeeFractionChanged(uint256) 53 | handler: handleNextFeeFractionChanged 54 | - event: NextFeeBeneficiaryChanged(indexed address) 55 | handler: handleNextFeeBeneficiaryChanged 56 | - event: Paused(indexed address) 57 | handler: handlePaused 58 | - event: Unpaused(indexed address) 59 | handler: handleUnpaused 60 | file: ./src/mapping.ts 61 | - kind: ethereum/contract 62 | name: PoolDai 63 | network: rinkeby 64 | source: 65 | address: "0x6012fD40A66b993a28298838Be5C341956B5f7f4" 66 | abi: Pool 67 | mapping: 68 | kind: ethereum/events 69 | apiVersion: 0.0.3 70 | language: wasm/assemblyscript 71 | entities: 72 | - Draw 73 | - Deposited 74 | - DepositedAndCommitted 75 | - SponsorshipDeposited 76 | - AdminAdded 77 | - AdminRemoved 78 | - Withdrawn 79 | - Opened 80 | - Committed 81 | - Rewarded 82 | - NextFeeFractionChanged 83 | - NextFeeBeneficiaryChanged 84 | - Paused 85 | - Unpaused 86 | abis: 87 | - name: Pool 88 | file: ./abis/Pool.json 89 | eventHandlers: 90 | - event: Deposited(indexed address,uint256) 91 | handler: handleDeposited 92 | - event: DepositedAndCommitted(indexed address,uint256) 93 | handler: handleDepositedAndCommitted 94 | - event: SponsorshipDeposited(indexed address,uint256) 95 | handler: handleSponsorshipDeposited 96 | - event: AdminAdded(indexed address) 97 | handler: handleAdminAdded 98 | - event: AdminRemoved(indexed address) 99 | handler: handleAdminRemoved 100 | - event: Withdrawn(indexed address,uint256) 101 | handler: handleWithdrawn 102 | - event: Opened(indexed uint256,indexed address,bytes32,uint256) 103 | handler: handleOpened 104 | - event: Committed(indexed uint256) 105 | handler: handleCommitted 106 | - event: Rewarded(indexed uint256,indexed address,bytes32,uint256,uint256) 107 | handler: handleRewarded 108 | - event: NextFeeFractionChanged(uint256) 109 | handler: handleNextFeeFractionChanged 110 | - event: NextFeeBeneficiaryChanged(indexed address) 111 | handler: handleNextFeeBeneficiaryChanged 112 | - event: Paused(indexed address) 113 | handler: handlePaused 114 | - event: Unpaused(indexed address) 115 | handler: handleUnpaused 116 | file: ./src/mapping.ts 117 | -------------------------------------------------------------------------------- /src/mappingForMCDAwarePool.ts: -------------------------------------------------------------------------------- 1 | import { BigInt, Bytes, Address, log, store } from "@graphprotocol/graph-ts" 2 | import { 3 | AdminAdded, 4 | AdminRemoved, 5 | Committed, 6 | CommittedDepositWithdrawn, 7 | Deposited, 8 | DepositedAndCommitted, 9 | FeeCollected, 10 | NextFeeBeneficiaryChanged, 11 | NextFeeFractionChanged, 12 | OpenDepositWithdrawn, 13 | Opened, 14 | Paused, 15 | Rewarded, 16 | RolledOver, 17 | SponsorshipAndFeesWithdrawn, 18 | SponsorshipDeposited, 19 | Unpaused, 20 | Withdrawn 21 | } from "../generated/PoolDai/MCDAwarePool" 22 | import { 23 | Admin, 24 | Draw, 25 | Pod, 26 | } from '../generated/schema' 27 | import { consolidateBalance } from './helpers/consolidateBalance' 28 | import { consolidateDrawId } from './helpers/consolidateDrawId' 29 | import { hasZeroTickets } from './helpers/hasZeroTickets' 30 | import { loadOrCreatePlayer } from './helpers/loadOrCreatePlayer' 31 | import { loadOrCreateSponsor } from './helpers/loadOrCreateSponsor' 32 | import { loadSponsor } from './helpers/loadSponsor' 33 | import { loadOrCreatePoolContract } from './helpers/loadOrCreatePoolContract' 34 | import { updatePod } from './helpers/updatePod' 35 | 36 | const ZERO = BigInt.fromI32(0) 37 | const ONE = BigInt.fromI32(1) 38 | const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" 39 | 40 | function formatDrawEntityId(poolAddress: Address, drawId: BigInt): string { 41 | return poolAddress.toHex() + '-' + drawId.toString() 42 | } 43 | 44 | function formatAdminEntityId(poolAddress: Address, adminAddress: Address): string { 45 | return poolAddress.toHex() + '-' + adminAddress.toHex() 46 | } 47 | 48 | export function handleAdminAdded(event: AdminAdded): void { 49 | let adminEntityId = formatAdminEntityId(event.address, event.params.admin) 50 | let admin = new Admin(adminEntityId) 51 | admin.addedAt = event.block.timestamp 52 | admin.address = event.params.admin 53 | 54 | let poolContract = loadOrCreatePoolContract(event.address) 55 | admin.poolContract = poolContract.id 56 | admin.save() 57 | } 58 | 59 | export function handleAdminRemoved(event: AdminRemoved): void { 60 | let adminEntityId = formatAdminEntityId(event.address, event.params.admin) 61 | store.remove('Admin', adminEntityId) 62 | } 63 | 64 | export function handleCommitted(event: Committed): void { 65 | const openDrawEntityId = formatDrawEntityId(event.address, event.params.drawId) 66 | const openDraw = Draw.load(openDrawEntityId) 67 | 68 | let poolContract = loadOrCreatePoolContract(event.address) 69 | poolContract.committedDrawId = openDraw.drawId 70 | poolContract.version = poolContract.version.plus(ONE) 71 | poolContract.save() 72 | 73 | openDraw.state = 'Committed' 74 | openDraw.committedAt = event.block.timestamp 75 | openDraw.committedAtBlock = event.block.number 76 | openDraw.version = openDraw.version.plus(ONE) 77 | openDraw.save() 78 | } 79 | 80 | export function handleDeposited(event: Deposited): void { 81 | let player = loadOrCreatePlayer(event.params.sender, event.address) 82 | consolidateBalance(player) 83 | 84 | let pool = loadOrCreatePoolContract(event.address) 85 | pool.openBalance = pool.openBalance.plus(event.params.amount) 86 | pool.version = pool.version.plus(ONE) 87 | pool.save() 88 | 89 | player.latestBalance = player.latestBalance.plus(event.params.amount) 90 | player.latestDrawId = pool.openDrawId 91 | player.version = player.version.plus(ONE) 92 | consolidateDrawId(player, pool.openDrawId) 93 | player.save() 94 | } 95 | 96 | export function handleDepositedAndCommitted( 97 | event: DepositedAndCommitted 98 | ): void { 99 | let player = loadOrCreatePlayer(event.params.sender, event.address) 100 | consolidateBalance(player) 101 | 102 | let pool = loadOrCreatePoolContract(event.address) 103 | pool.committedBalance = pool.committedBalance.plus(event.params.amount) 104 | pool.version = pool.version.plus(ONE) 105 | pool.save() 106 | 107 | player.consolidatedBalance = player.consolidatedBalance.plus(event.params.amount) 108 | player.version = player.version.plus(ONE) 109 | consolidateDrawId(player, pool.committedDrawId) 110 | player.save() 111 | } 112 | 113 | export function handleFeeCollected(event: FeeCollected): void { 114 | } 115 | 116 | export function handleNextFeeBeneficiaryChanged( 117 | event: NextFeeBeneficiaryChanged 118 | ): void {} 119 | 120 | export function handleNextFeeFractionChanged( 121 | event: NextFeeFractionChanged 122 | ): void {} 123 | 124 | export function handleOpened(event: Opened): void { 125 | const drawEntityId = formatDrawEntityId(event.address, event.params.drawId) 126 | const draw = new Draw(drawEntityId) 127 | 128 | let poolContract = loadOrCreatePoolContract(event.address, false) 129 | poolContract.drawsCount = poolContract.drawsCount.plus(ONE) 130 | poolContract.openDrawId = event.params.drawId 131 | poolContract.committedBalance = poolContract.committedBalance.plus(poolContract.openBalance) 132 | poolContract.openBalance = ZERO 133 | poolContract.version = poolContract.version.plus(ONE) 134 | poolContract.save() 135 | 136 | draw.drawId = event.params.drawId 137 | draw.winner = Bytes.fromHexString(ZERO_ADDRESS) as Bytes 138 | draw.entropy = new Bytes(32) 139 | draw.winnings = ZERO 140 | draw.fee = ZERO 141 | draw.state = 'Open' 142 | draw.feeBeneficiary = event.params.feeBeneficiary 143 | draw.secretHash = event.params.secretHash 144 | draw.feeFraction = event.params.feeFraction 145 | draw.openedAt = event.block.timestamp 146 | draw.openedAtBlock = event.block.number 147 | draw.committedAt = ZERO 148 | draw.committedAtBlock = ZERO 149 | draw.rewardedAt = ZERO 150 | draw.rewardedAtBlock = ZERO 151 | draw.poolContract = poolContract.id 152 | draw.balance = ZERO 153 | draw.version = ZERO 154 | 155 | draw.save() 156 | } 157 | 158 | export function handlePaused(event: Paused): void { 159 | let poolContract = loadOrCreatePoolContract(event.address, false) 160 | poolContract.paused = true 161 | poolContract.version = poolContract.version.plus(ONE) 162 | poolContract.save() 163 | } 164 | 165 | export function handleRewarded(event: Rewarded): void { 166 | let pool = loadOrCreatePoolContract(event.address) 167 | pool.sponsorshipAndFeeBalance = pool.sponsorshipAndFeeBalance.plus(event.params.fee) 168 | pool.committedBalance = pool.committedBalance.plus(event.params.winnings) 169 | pool.winnings = pool.winnings.plus(event.params.winnings) 170 | pool.version = pool.version.plus(ONE) 171 | pool.save() 172 | 173 | if (event.params.winner.toHex() != ZERO_ADDRESS) { 174 | let winner = loadOrCreatePlayer(event.params.winner, event.address) 175 | winner.consolidatedBalance = winner.consolidatedBalance.plus(event.params.winnings) 176 | winner.winnings = winner.winnings.plus(event.params.winnings) 177 | winner.version = winner.version.plus(ONE) 178 | winner.save() 179 | 180 | const podId = event.params.winner.toHex() 181 | let pod = Pod.load(podId) 182 | if (pod) { 183 | const newBalanceUnderlying = pod.balanceUnderlying.plus(event.params.winnings) 184 | pod.winnings = pod.winnings.plus(event.params.winnings) 185 | updatePod(pod as Pod, event.params.winner, newBalanceUnderlying) 186 | 187 | // We are unable to iterate on subgraphs, so this needs to be calculated 188 | // another way: 189 | // 190 | // const podPlayers = pod.podPlayers 191 | // const playerAddresses = podPlayers.join(' ') 192 | // log.warning('playerAddresses', [playerAddresses]) 193 | // for (var i = 0; i < podPlayers.length; i++) { 194 | // log.warning('podPlayer', [podPlayers[i]]) 195 | // const podPlayer = Pod.load(podPlayers[i]) 196 | // const shareOfWinnings = new BigInt(3) 197 | // podPlayer.winnings = podPlayer.winnings.plus(shareOfWinnings) 198 | // podPlayer.version = podPlayer.version.plus(ONE) 199 | // podPlayer.save() 200 | // } 201 | } 202 | } 203 | 204 | const committedDraw = Draw.load(formatDrawEntityId(event.address, event.params.drawId)) 205 | committedDraw.state = 'Rewarded' 206 | committedDraw.winner = event.params.winner 207 | committedDraw.winnings = event.params.winnings 208 | committedDraw.fee = event.params.fee 209 | committedDraw.entropy = event.params.entropy 210 | committedDraw.rewardedAt = event.block.timestamp 211 | committedDraw.rewardedAtBlock = event.block.number 212 | committedDraw.version = committedDraw.version.plus(ONE) 213 | committedDraw.save() 214 | 215 | let sponsor = loadOrCreateSponsor(Address.fromString(committedDraw.feeBeneficiary.toHex()), event.address) 216 | sponsor.sponsorshipAndFeeBalance = sponsor.sponsorshipAndFeeBalance.plus(event.params.fee) 217 | sponsor.save() 218 | } 219 | 220 | export function handleRolledOver(event: RolledOver): void { 221 | const committedDraw = Draw.load( 222 | formatDrawEntityId(event.address, event.params.drawId) 223 | ) 224 | 225 | committedDraw.state = 'Rewarded' 226 | committedDraw.entropy = Bytes.fromI32(1) as Bytes 227 | committedDraw.rewardedAt = event.block.timestamp 228 | committedDraw.rewardedAtBlock = event.block.number 229 | committedDraw.version = committedDraw.version.plus(ONE) 230 | 231 | committedDraw.save() 232 | } 233 | 234 | export function handleSponsorshipAndFeesWithdrawn(event: SponsorshipAndFeesWithdrawn): void { 235 | } 236 | 237 | export function handleCommittedDepositWithdrawn(event: CommittedDepositWithdrawn): void { 238 | } 239 | 240 | export function handleOpenDepositWithdrawn(event: OpenDepositWithdrawn): void { 241 | } 242 | 243 | // export function handleSponsorshipAndFeesWithdrawn( 244 | // event: SponsorshipAndFeesWithdrawn 245 | // ): void { 246 | // let pool = loadOrCreatePoolContract(event.address) 247 | // let sponsor = loadSponsor(event.params.sender, event.address) 248 | 249 | // pool.sponsorshipAndFeeBalance = pool.sponsorshipAndFeeBalance.minus(event.params.amount) 250 | // pool.version = pool.version.plus(ONE) 251 | // pool.save() 252 | 253 | // if (sponsor) { 254 | // if (sponsor.sponsorshipAndFeeBalance.equals(ZERO)) { 255 | // store.remove('Sponsor', sponsor.id) 256 | // } else { 257 | // sponsor.save() 258 | // } 259 | // } 260 | // } 261 | 262 | // export function handleOpenDepositWithdrawn(event: OpenDepositWithdrawn): void { 263 | // let player = loadOrCreatePlayer(event.params.sender, event.address) 264 | // consolidateBalance(player) 265 | 266 | // let pool = loadOrCreatePoolContract(event.address) 267 | // pool.openBalance = pool.openBalance.minus(player.latestBalance) 268 | 269 | // pool.version = pool.version.plus(ONE) 270 | // pool.save() 271 | 272 | // if (hasZeroTickets(player)) { 273 | // store.remove('Player', player.id) 274 | // pool.playersCount = pool.playersCount.minus(ONE) 275 | // pool.save() 276 | // } else { 277 | // player.save() 278 | // } 279 | // } 280 | 281 | // export function handleCommittedDepositWithdrawn(event: CommittedDepositWithdrawn): void { 282 | // let player = loadOrCreatePlayer(event.params.sender, event.address) 283 | // consolidateBalance(player) 284 | 285 | // let pool = loadOrCreatePoolContract(event.address) 286 | // pool.committedBalance = pool.committedBalance.minus(player.consolidatedBalance) 287 | 288 | // pool.version = pool.version.plus(ONE) 289 | // pool.save() 290 | 291 | // if (hasZeroTickets(player)) { 292 | // store.remove('Player', player.id) 293 | // pool.playersCount = pool.playersCount.minus(ONE) 294 | // pool.save() 295 | // } else { 296 | // player.save() 297 | // } 298 | // } 299 | 300 | export function handleSponsorshipDeposited(event: SponsorshipDeposited): void { 301 | let pool = loadOrCreatePoolContract(event.address) 302 | pool.sponsorshipAndFeeBalance = pool.sponsorshipAndFeeBalance.plus(event.params.amount) 303 | pool.version = pool.version.plus(ONE) 304 | pool.save() 305 | 306 | let sponsor = loadOrCreateSponsor(event.params.sender, event.address) 307 | sponsor.sponsorshipAndFeeBalance = sponsor.sponsorshipAndFeeBalance.plus(event.params.amount) 308 | sponsor.save() 309 | } 310 | 311 | export function handleUnpaused(event: Unpaused): void { 312 | let poolContract = loadOrCreatePoolContract(event.address, false) 313 | poolContract.paused = false 314 | poolContract.version = poolContract.version.plus(ONE) 315 | poolContract.save() 316 | } 317 | 318 | export function handleWithdrawn(event: Withdrawn): void { 319 | let player = loadOrCreatePlayer(event.params.sender, event.address) 320 | consolidateBalance(player) 321 | 322 | let pool = loadOrCreatePoolContract(event.address) 323 | pool.openBalance = pool.openBalance.minus(player.latestBalance) 324 | pool.committedBalance = pool.committedBalance.minus(player.consolidatedBalance) 325 | 326 | let sponsor = loadSponsor(event.params.sender, event.address) 327 | if (sponsor) { 328 | pool.sponsorshipAndFeeBalance = pool.sponsorshipAndFeeBalance.minus(sponsor.sponsorshipAndFeeBalance) 329 | store.remove('Sponsor', sponsor.id) 330 | } 331 | 332 | store.remove('Player', player.id) 333 | pool.playersCount = pool.playersCount.minus(ONE) 334 | pool.version = pool.version.plus(ONE) 335 | pool.save() 336 | } 337 | 338 | -------------------------------------------------------------------------------- /subgraph.kovan.yaml: -------------------------------------------------------------------------------- 1 | specVersion: 0.0.2 2 | schema: 3 | file: ./schema.graphql 4 | dataSources: 5 | - kind: ethereum/contract 6 | name: PoolSai 7 | network: kovan 8 | source: 9 | address: "0x9B80beA68835e8E39b9CeaeF83B7b49e9D41661C" 10 | abi: MCDAwarePool 11 | startBlock: 15540000 12 | mapping: 13 | kind: ethereum/events 14 | apiVersion: 0.0.4 15 | language: wasm/assemblyscript 16 | entities: 17 | - AdminAdded 18 | - AdminRemoved 19 | - Committed 20 | - CommittedDepositWithdrawn 21 | - Deposited 22 | - DepositedAndCommitted 23 | - FeeCollected 24 | - NextFeeBeneficiaryChanged 25 | - NextFeeFractionChanged 26 | - OpenDepositWithdrawn 27 | - Opened 28 | - Paused 29 | - Rewarded 30 | - RolledOver 31 | - SponsorshipAndFeesWithdrawn 32 | - SponsorshipDeposited 33 | - Unpaused 34 | - Withdrawn 35 | abis: 36 | - name: MCDAwarePool 37 | file: ./abis/MCDAwarePool.json 38 | - name: PoolToken 39 | file: ./abis/PoolToken.json 40 | eventHandlers: 41 | - event: AdminAdded(indexed address) 42 | handler: handleAdminAdded 43 | - event: AdminRemoved(indexed address) 44 | handler: handleAdminRemoved 45 | - event: Committed(indexed uint256) 46 | handler: handleCommitted 47 | - event: CommittedDepositWithdrawn(indexed address,uint256) 48 | handler: handleCommittedDepositWithdrawn 49 | - event: Deposited(indexed address,uint256) 50 | handler: handleDeposited 51 | - event: DepositedAndCommitted(indexed address,uint256) 52 | handler: handleDepositedAndCommitted 53 | - event: FeeCollected(indexed address,uint256,uint256) 54 | handler: handleFeeCollected 55 | - event: NextFeeBeneficiaryChanged(indexed address) 56 | handler: handleNextFeeBeneficiaryChanged 57 | - event: NextFeeFractionChanged(uint256) 58 | handler: handleNextFeeFractionChanged 59 | - event: OpenDepositWithdrawn(indexed address,uint256) 60 | handler: handleOpenDepositWithdrawn 61 | - event: Opened(indexed uint256,indexed address,bytes32,uint256) 62 | handler: handleOpened 63 | - event: Paused(indexed address) 64 | handler: handlePaused 65 | - event: Rewarded(indexed uint256,indexed address,bytes32,uint256,uint256) 66 | handler: handleRewarded 67 | - event: RolledOver(indexed uint256) 68 | handler: handleRolledOver 69 | - event: SponsorshipAndFeesWithdrawn(indexed address,uint256) 70 | handler: handleSponsorshipAndFeesWithdrawn 71 | - event: SponsorshipDeposited(indexed address,uint256) 72 | handler: handleSponsorshipDeposited 73 | - event: Unpaused(indexed address) 74 | handler: handleUnpaused 75 | - event: Withdrawn(indexed address,uint256) 76 | handler: handleWithdrawn 77 | file: ./src/mappingForMCDAwarePool.ts 78 | - kind: ethereum/contract 79 | name: PoolSaiToken 80 | network: kovan 81 | source: 82 | address: "0xC9689253a545D0C4dc733620281bBdCbb9FA4A4D" 83 | abi: PoolToken 84 | startBlock: 15540000 85 | mapping: 86 | kind: ethereum/events 87 | apiVersion: 0.0.4 88 | language: wasm/assemblyscript 89 | entities: 90 | - Approval 91 | - AuthorizedOperator 92 | - Burned 93 | - Minted 94 | - Redeemed 95 | - RevokedOperator 96 | - Sent 97 | - Transfer 98 | abis: 99 | - name: MCDAwarePool 100 | file: ./abis/MCDAwarePool.json 101 | - name: PoolToken 102 | file: ./abis/PoolToken.json 103 | eventHandlers: 104 | - event: Approval(indexed address,indexed address,uint256) 105 | handler: handleApproval 106 | - event: AuthorizedOperator(indexed address,indexed address) 107 | handler: handleAuthorizedOperator 108 | - event: Burned(indexed address,indexed address,uint256,bytes,bytes) 109 | handler: handleBurned 110 | - event: Minted(indexed address,indexed address,uint256,bytes,bytes) 111 | handler: handleMinted 112 | - event: Redeemed(indexed address,indexed address,uint256,bytes,bytes) 113 | handler: handleRedeemed 114 | - event: RevokedOperator(indexed address,indexed address) 115 | handler: handleRevokedOperator 116 | - event: Sent(indexed address,indexed address,indexed address,uint256,bytes,bytes) 117 | handler: handleSent 118 | - event: Transfer(indexed address,indexed address,uint256) 119 | handler: handleTransfer 120 | file: ./src/mappingForPoolToken.ts 121 | - kind: ethereum/contract 122 | name: PoolDai 123 | network: kovan 124 | source: 125 | address: "0xC3a62C8Af55c59642071bC171Ebd05Eb2479B663" 126 | abi: MCDAwarePool 127 | startBlock: 15540000 128 | mapping: 129 | kind: ethereum/events 130 | apiVersion: 0.0.4 131 | language: wasm/assemblyscript 132 | entities: 133 | - AdminAdded 134 | - AdminRemoved 135 | - Committed 136 | - CommittedDepositWithdrawn 137 | - Deposited 138 | - DepositedAndCommitted 139 | - FeeCollected 140 | - NextFeeBeneficiaryChanged 141 | - NextFeeFractionChanged 142 | - OpenDepositWithdrawn 143 | - Opened 144 | - Paused 145 | - Rewarded 146 | - RolledOver 147 | - SponsorshipAndFeesWithdrawn 148 | - SponsorshipDeposited 149 | - Unpaused 150 | - Withdrawn 151 | abis: 152 | - name: MCDAwarePool 153 | file: ./abis/MCDAwarePool.json 154 | - name: Pod 155 | file: ./abis/Pod.json 156 | - name: PoolToken 157 | file: ./abis/PoolToken.json 158 | eventHandlers: 159 | - event: AdminAdded(indexed address) 160 | handler: handleAdminAdded 161 | - event: AdminRemoved(indexed address) 162 | handler: handleAdminRemoved 163 | - event: Committed(indexed uint256) 164 | handler: handleCommitted 165 | - event: CommittedDepositWithdrawn(indexed address,uint256) 166 | handler: handleCommittedDepositWithdrawn 167 | - event: Deposited(indexed address,uint256) 168 | handler: handleDeposited 169 | - event: DepositedAndCommitted(indexed address,uint256) 170 | handler: handleDepositedAndCommitted 171 | - event: FeeCollected(indexed address,uint256,uint256) 172 | handler: handleFeeCollected 173 | - event: NextFeeBeneficiaryChanged(indexed address) 174 | handler: handleNextFeeBeneficiaryChanged 175 | - event: NextFeeFractionChanged(uint256) 176 | handler: handleNextFeeFractionChanged 177 | - event: OpenDepositWithdrawn(indexed address,uint256) 178 | handler: handleOpenDepositWithdrawn 179 | - event: Opened(indexed uint256,indexed address,bytes32,uint256) 180 | handler: handleOpened 181 | - event: Paused(indexed address) 182 | handler: handlePaused 183 | - event: Rewarded(indexed uint256,indexed address,bytes32,uint256,uint256) 184 | handler: handleRewarded 185 | - event: RolledOver(indexed uint256) 186 | handler: handleRolledOver 187 | - event: SponsorshipAndFeesWithdrawn(indexed address,uint256) 188 | handler: handleSponsorshipAndFeesWithdrawn 189 | - event: SponsorshipDeposited(indexed address,uint256) 190 | handler: handleSponsorshipDeposited 191 | - event: Unpaused(indexed address) 192 | handler: handleUnpaused 193 | - event: Withdrawn(indexed address,uint256) 194 | handler: handleWithdrawn 195 | file: ./src/mappingForMCDAwarePool.ts 196 | - kind: ethereum/contract 197 | name: PoolDaiToken 198 | network: kovan 199 | source: 200 | address: "0x1237a9f1664895bc30cfe9eCD1e3f6C2A83700AD" 201 | abi: PoolToken 202 | startBlock: 15540000 203 | mapping: 204 | kind: ethereum/events 205 | apiVersion: 0.0.4 206 | language: wasm/assemblyscript 207 | entities: 208 | - Approval 209 | - AuthorizedOperator 210 | - Burned 211 | - Minted 212 | - Redeemed 213 | - RevokedOperator 214 | - Sent 215 | - Transfer 216 | abis: 217 | - name: MCDAwarePool 218 | file: ./abis/MCDAwarePool.json 219 | - name: Pod 220 | file: ./abis/Pod.json 221 | - name: PoolToken 222 | file: ./abis/PoolToken.json 223 | eventHandlers: 224 | - event: Approval(indexed address,indexed address,uint256) 225 | handler: handleApproval 226 | - event: AuthorizedOperator(indexed address,indexed address) 227 | handler: handleAuthorizedOperator 228 | - event: Burned(indexed address,indexed address,uint256,bytes,bytes) 229 | handler: handleBurned 230 | - event: Minted(indexed address,indexed address,uint256,bytes,bytes) 231 | handler: handleMinted 232 | - event: Redeemed(indexed address,indexed address,uint256,bytes,bytes) 233 | handler: handleRedeemed 234 | - event: RevokedOperator(indexed address,indexed address) 235 | handler: handleRevokedOperator 236 | - event: Sent(indexed address,indexed address,indexed address,uint256,bytes,bytes) 237 | handler: handleSent 238 | - event: Transfer(indexed address,indexed address,uint256) 239 | handler: handleTransfer 240 | file: ./src/mappingForPoolToken.ts 241 | - kind: ethereum/contract 242 | name: DaiPod 243 | network: kovan 244 | source: 245 | address: "0x395fcB67ff8fdf5b9e2AeeCc02Ef7A8DE87a6677" 246 | abi: Pod 247 | startBlock: 18040000 248 | mapping: 249 | kind: ethereum/events 250 | apiVersion: 0.0.4 251 | language: wasm/assemblyscript 252 | entities: 253 | - PendingDepositWithdrawn 254 | - Redeemed 255 | - RedeemedToPool 256 | - CollateralizationChanged 257 | - Deposited 258 | abis: 259 | - name: Pod 260 | file: ./abis/Pod.json 261 | eventHandlers: 262 | - event: PendingDepositWithdrawn(indexed address,indexed address,uint256,bytes,bytes) 263 | handler: handlePendingDepositWithdrawn 264 | - event: Redeemed(indexed address,indexed address,uint256,uint256,bytes,bytes) 265 | handler: handleRedeemed 266 | - event: RedeemedToPool(indexed address,indexed address,uint256,uint256,bytes,bytes) 267 | handler: handleRedeemedToPool 268 | - event: CollateralizationChanged(indexed uint256,uint256,uint256,uint256) 269 | handler: handleCollateralizationChanged 270 | - event: Deposited(indexed address,indexed address,uint256,uint256,bytes,bytes) 271 | handler: handleDeposited 272 | file: ./src/mappingForPod.ts 273 | - kind: ethereum/contract 274 | name: PoolUsdc 275 | network: kovan 276 | source: 277 | address: "0xa0B2A98d0B769886ec06562ee9bB3572Fa4f3aAb" 278 | abi: MCDAwarePool 279 | startBlock: 15540000 280 | mapping: 281 | kind: ethereum/events 282 | apiVersion: 0.0.4 283 | language: wasm/assemblyscript 284 | entities: 285 | - AdminAdded 286 | - AdminRemoved 287 | - Committed 288 | - CommittedDepositWithdrawn 289 | - Deposited 290 | - DepositedAndCommitted 291 | - FeeCollected 292 | - NextFeeBeneficiaryChanged 293 | - NextFeeFractionChanged 294 | - OpenDepositWithdrawn 295 | - Opened 296 | - Paused 297 | - Rewarded 298 | - RolledOver 299 | - SponsorshipAndFeesWithdrawn 300 | - SponsorshipDeposited 301 | - Unpaused 302 | - Withdrawn 303 | abis: 304 | - name: MCDAwarePool 305 | file: ./abis/MCDAwarePool.json 306 | - name: Pod 307 | file: ./abis/Pod.json 308 | - name: PoolToken 309 | file: ./abis/PoolToken.json 310 | eventHandlers: 311 | - event: AdminAdded(indexed address) 312 | handler: handleAdminAdded 313 | - event: AdminRemoved(indexed address) 314 | handler: handleAdminRemoved 315 | - event: Committed(indexed uint256) 316 | handler: handleCommitted 317 | - event: CommittedDepositWithdrawn(indexed address,uint256) 318 | handler: handleCommittedDepositWithdrawn 319 | - event: Deposited(indexed address,uint256) 320 | handler: handleDeposited 321 | - event: DepositedAndCommitted(indexed address,uint256) 322 | handler: handleDepositedAndCommitted 323 | - event: FeeCollected(indexed address,uint256,uint256) 324 | handler: handleFeeCollected 325 | - event: NextFeeBeneficiaryChanged(indexed address) 326 | handler: handleNextFeeBeneficiaryChanged 327 | - event: NextFeeFractionChanged(uint256) 328 | handler: handleNextFeeFractionChanged 329 | - event: OpenDepositWithdrawn(indexed address,uint256) 330 | handler: handleOpenDepositWithdrawn 331 | - event: Opened(indexed uint256,indexed address,bytes32,uint256) 332 | handler: handleOpened 333 | - event: Paused(indexed address) 334 | handler: handlePaused 335 | - event: Rewarded(indexed uint256,indexed address,bytes32,uint256,uint256) 336 | handler: handleRewarded 337 | - event: RolledOver(indexed uint256) 338 | handler: handleRolledOver 339 | - event: SponsorshipAndFeesWithdrawn(indexed address,uint256) 340 | handler: handleSponsorshipAndFeesWithdrawn 341 | - event: SponsorshipDeposited(indexed address,uint256) 342 | handler: handleSponsorshipDeposited 343 | - event: Unpaused(indexed address) 344 | handler: handleUnpaused 345 | - event: Withdrawn(indexed address,uint256) 346 | handler: handleWithdrawn 347 | file: ./src/mappingForMCDAwarePool.ts 348 | - kind: ethereum/contract 349 | name: PoolUsdcToken 350 | network: kovan 351 | source: 352 | address: "0xDC9A918D43a9E018de904a09d4D04F539Df4ed34" 353 | abi: PoolToken 354 | startBlock: 15540000 355 | mapping: 356 | kind: ethereum/events 357 | apiVersion: 0.0.4 358 | language: wasm/assemblyscript 359 | entities: 360 | - Approval 361 | - AuthorizedOperator 362 | - Burned 363 | - Minted 364 | - Redeemed 365 | - RevokedOperator 366 | - Sent 367 | - Transfer 368 | abis: 369 | - name: MCDAwarePool 370 | file: ./abis/MCDAwarePool.json 371 | - name: Pod 372 | file: ./abis/Pod.json 373 | - name: PoolToken 374 | file: ./abis/PoolToken.json 375 | eventHandlers: 376 | - event: Approval(indexed address,indexed address,uint256) 377 | handler: handleApproval 378 | - event: AuthorizedOperator(indexed address,indexed address) 379 | handler: handleAuthorizedOperator 380 | - event: Burned(indexed address,indexed address,uint256,bytes,bytes) 381 | handler: handleBurned 382 | - event: Minted(indexed address,indexed address,uint256,bytes,bytes) 383 | handler: handleMinted 384 | - event: Redeemed(indexed address,indexed address,uint256,bytes,bytes) 385 | handler: handleRedeemed 386 | - event: RevokedOperator(indexed address,indexed address) 387 | handler: handleRevokedOperator 388 | - event: Sent(indexed address,indexed address,indexed address,uint256,bytes,bytes) 389 | handler: handleSent 390 | - event: Transfer(indexed address,indexed address,uint256) 391 | handler: handleTransfer 392 | file: ./src/mappingForPoolToken.ts 393 | - kind: ethereum/contract 394 | name: UsdcPod 395 | network: kovan 396 | source: 397 | address: "0x9191Fd9f29cbbE73bA0e1B8959eC89Bc780e598b" 398 | abi: Pod 399 | startBlock: 18040000 400 | mapping: 401 | kind: ethereum/events 402 | apiVersion: 0.0.4 403 | language: wasm/assemblyscript 404 | entities: 405 | - PendingDepositWithdrawn 406 | - Redeemed 407 | - RedeemedToPool 408 | - CollateralizationChanged 409 | - Deposited 410 | abis: 411 | - name: Pod 412 | file: ./abis/Pod.json 413 | eventHandlers: 414 | - event: PendingDepositWithdrawn(indexed address,indexed address,uint256,bytes,bytes) 415 | handler: handlePendingDepositWithdrawn 416 | - event: Redeemed(indexed address,indexed address,uint256,uint256,bytes,bytes) 417 | handler: handleRedeemed 418 | - event: RedeemedToPool(indexed address,indexed address,uint256,uint256,bytes,bytes) 419 | handler: handleRedeemedToPool 420 | - event: CollateralizationChanged(indexed uint256,uint256,uint256,uint256) 421 | handler: handleCollateralizationChanged 422 | - event: Deposited(indexed address,indexed address,uint256,uint256,bytes,bytes) 423 | handler: handleDeposited 424 | file: ./src/mappingForPod.ts -------------------------------------------------------------------------------- /subgraph.yaml: -------------------------------------------------------------------------------- 1 | specVersion: 0.0.2 2 | schema: 3 | file: ./schema.graphql 4 | dataSources: 5 | - kind: ethereum/contract 6 | name: PoolSai 7 | network: mainnet 8 | source: 9 | address: "0xb7896fce748396EcFC240F5a0d3Cc92ca42D7d84" 10 | abi: MCDAwarePool 11 | startBlock: 8480000 12 | mapping: 13 | kind: ethereum/events 14 | apiVersion: 0.0.4 15 | language: wasm/assemblyscript 16 | entities: 17 | - AdminAdded 18 | - AdminRemoved 19 | - Committed 20 | - CommittedDepositWithdrawn 21 | - Deposited 22 | - DepositedAndCommitted 23 | - FeeCollected 24 | - NextFeeBeneficiaryChanged 25 | - NextFeeFractionChanged 26 | - OpenDepositWithdrawn 27 | - Opened 28 | - Paused 29 | - Rewarded 30 | - RolledOver 31 | - SponsorshipAndFeesWithdrawn 32 | - SponsorshipDeposited 33 | - Unpaused 34 | - Withdrawn 35 | abis: 36 | - name: MCDAwarePool 37 | file: ./abis/MCDAwarePool.json 38 | - name: PoolToken 39 | file: ./abis/PoolToken.json 40 | eventHandlers: 41 | - event: AdminAdded(indexed address) 42 | handler: handleAdminAdded 43 | - event: AdminRemoved(indexed address) 44 | handler: handleAdminRemoved 45 | - event: Committed(indexed uint256) 46 | handler: handleCommitted 47 | - event: CommittedDepositWithdrawn(indexed address,uint256) 48 | handler: handleCommittedDepositWithdrawn 49 | - event: Deposited(indexed address,uint256) 50 | handler: handleDeposited 51 | - event: DepositedAndCommitted(indexed address,uint256) 52 | handler: handleDepositedAndCommitted 53 | - event: FeeCollected(indexed address,uint256,uint256) 54 | handler: handleFeeCollected 55 | - event: NextFeeBeneficiaryChanged(indexed address) 56 | handler: handleNextFeeBeneficiaryChanged 57 | - event: NextFeeFractionChanged(uint256) 58 | handler: handleNextFeeFractionChanged 59 | - event: OpenDepositWithdrawn(indexed address,uint256) 60 | handler: handleOpenDepositWithdrawn 61 | - event: Opened(indexed uint256,indexed address,bytes32,uint256) 62 | handler: handleOpened 63 | - event: Paused(indexed address) 64 | handler: handlePaused 65 | - event: Rewarded(indexed uint256,indexed address,bytes32,uint256,uint256) 66 | handler: handleRewarded 67 | - event: RolledOver(indexed uint256) 68 | handler: handleRolledOver 69 | - event: SponsorshipAndFeesWithdrawn(indexed address,uint256) 70 | handler: handleSponsorshipAndFeesWithdrawn 71 | - event: SponsorshipDeposited(indexed address,uint256) 72 | handler: handleSponsorshipDeposited 73 | - event: Unpaused(indexed address) 74 | handler: handleUnpaused 75 | - event: Withdrawn(indexed address,uint256) 76 | handler: handleWithdrawn 77 | file: ./src/mappingForMCDAwarePool.ts 78 | - kind: ethereum/contract 79 | name: PoolSaiToken 80 | network: mainnet 81 | source: 82 | address: "0xfE6892654CBB05eB73d28DCc1Ff938f59666Fe9f" 83 | abi: PoolToken 84 | startBlock: 9130000 85 | mapping: 86 | kind: ethereum/events 87 | apiVersion: 0.0.4 88 | language: wasm/assemblyscript 89 | entities: 90 | - Approval 91 | - AuthorizedOperator 92 | - Burned 93 | - Minted 94 | - Redeemed 95 | - RevokedOperator 96 | - Sent 97 | - Transfer 98 | abis: 99 | - name: MCDAwarePool 100 | file: ./abis/MCDAwarePool.json 101 | - name: PoolToken 102 | file: ./abis/PoolToken.json 103 | eventHandlers: 104 | - event: Approval(indexed address,indexed address,uint256) 105 | handler: handleApproval 106 | - event: AuthorizedOperator(indexed address,indexed address) 107 | handler: handleAuthorizedOperator 108 | - event: Burned(indexed address,indexed address,uint256,bytes,bytes) 109 | handler: handleBurned 110 | - event: Minted(indexed address,indexed address,uint256,bytes,bytes) 111 | handler: handleMinted 112 | - event: Redeemed(indexed address,indexed address,uint256,bytes,bytes) 113 | handler: handleRedeemed 114 | - event: RevokedOperator(indexed address,indexed address) 115 | handler: handleRevokedOperator 116 | - event: Sent(indexed address,indexed address,indexed address,uint256,bytes,bytes) 117 | handler: handleSent 118 | - event: Transfer(indexed address,indexed address,uint256) 119 | handler: handleTransfer 120 | file: ./src/mappingForPoolToken.ts 121 | - kind: ethereum/contract 122 | name: PoolDai 123 | network: mainnet 124 | source: 125 | address: "0x29fe7D60DdF151E5b52e5FAB4f1325da6b2bD958" 126 | abi: MCDAwarePool 127 | startBlock: 9130000 128 | mapping: 129 | kind: ethereum/events 130 | apiVersion: 0.0.4 131 | language: wasm/assemblyscript 132 | entities: 133 | - AdminAdded 134 | - AdminRemoved 135 | - Committed 136 | - CommittedDepositWithdrawn 137 | - Deposited 138 | - DepositedAndCommitted 139 | - FeeCollected 140 | - NextFeeBeneficiaryChanged 141 | - NextFeeFractionChanged 142 | - OpenDepositWithdrawn 143 | - Opened 144 | - Paused 145 | - Rewarded 146 | - RolledOver 147 | - SponsorshipAndFeesWithdrawn 148 | - SponsorshipDeposited 149 | - Unpaused 150 | - Withdrawn 151 | abis: 152 | - name: MCDAwarePool 153 | file: ./abis/MCDAwarePool.json 154 | - name: Pod 155 | file: ./abis/Pod.json 156 | - name: PoolToken 157 | file: ./abis/PoolToken.json 158 | eventHandlers: 159 | - event: AdminAdded(indexed address) 160 | handler: handleAdminAdded 161 | - event: AdminRemoved(indexed address) 162 | handler: handleAdminRemoved 163 | - event: Committed(indexed uint256) 164 | handler: handleCommitted 165 | - event: CommittedDepositWithdrawn(indexed address,uint256) 166 | handler: handleCommittedDepositWithdrawn 167 | - event: Deposited(indexed address,uint256) 168 | handler: handleDeposited 169 | - event: DepositedAndCommitted(indexed address,uint256) 170 | handler: handleDepositedAndCommitted 171 | - event: FeeCollected(indexed address,uint256,uint256) 172 | handler: handleFeeCollected 173 | - event: NextFeeBeneficiaryChanged(indexed address) 174 | handler: handleNextFeeBeneficiaryChanged 175 | - event: NextFeeFractionChanged(uint256) 176 | handler: handleNextFeeFractionChanged 177 | - event: OpenDepositWithdrawn(indexed address,uint256) 178 | handler: handleOpenDepositWithdrawn 179 | - event: Opened(indexed uint256,indexed address,bytes32,uint256) 180 | handler: handleOpened 181 | - event: Paused(indexed address) 182 | handler: handlePaused 183 | - event: Rewarded(indexed uint256,indexed address,bytes32,uint256,uint256) 184 | handler: handleRewarded 185 | - event: RolledOver(indexed uint256) 186 | handler: handleRolledOver 187 | - event: SponsorshipAndFeesWithdrawn(indexed address,uint256) 188 | handler: handleSponsorshipAndFeesWithdrawn 189 | - event: SponsorshipDeposited(indexed address,uint256) 190 | handler: handleSponsorshipDeposited 191 | - event: Unpaused(indexed address) 192 | handler: handleUnpaused 193 | - event: Withdrawn(indexed address,uint256) 194 | handler: handleWithdrawn 195 | file: ./src/mappingForMCDAwarePool.ts 196 | - kind: ethereum/contract 197 | name: PoolDaiToken 198 | network: mainnet 199 | source: 200 | address: "0x49d716DFe60b37379010A75329ae09428f17118d" 201 | abi: PoolToken 202 | startBlock: 9130000 203 | mapping: 204 | kind: ethereum/events 205 | apiVersion: 0.0.4 206 | language: wasm/assemblyscript 207 | entities: 208 | - Approval 209 | - AuthorizedOperator 210 | - Burned 211 | - Minted 212 | - Redeemed 213 | - RevokedOperator 214 | - Sent 215 | - Transfer 216 | abis: 217 | - name: MCDAwarePool 218 | file: ./abis/MCDAwarePool.json 219 | - name: Pod 220 | file: ./abis/Pod.json 221 | - name: PoolToken 222 | file: ./abis/PoolToken.json 223 | eventHandlers: 224 | - event: Approval(indexed address,indexed address,uint256) 225 | handler: handleApproval 226 | - event: AuthorizedOperator(indexed address,indexed address) 227 | handler: handleAuthorizedOperator 228 | - event: Burned(indexed address,indexed address,uint256,bytes,bytes) 229 | handler: handleBurned 230 | - event: Minted(indexed address,indexed address,uint256,bytes,bytes) 231 | handler: handleMinted 232 | - event: Redeemed(indexed address,indexed address,uint256,bytes,bytes) 233 | handler: handleRedeemed 234 | - event: RevokedOperator(indexed address,indexed address) 235 | handler: handleRevokedOperator 236 | - event: Sent(indexed address,indexed address,indexed address,uint256,bytes,bytes) 237 | handler: handleSent 238 | - event: Transfer(indexed address,indexed address,uint256) 239 | handler: handleTransfer 240 | file: ./src/mappingForPoolToken.ts 241 | - kind: ethereum/contract 242 | name: DaiPod 243 | network: mainnet 244 | source: 245 | address: "0x9F4C5D8d9BE360DF36E67F52aE55C1B137B4d0C4" 246 | abi: Pod 247 | startBlock: 9900000 248 | mapping: 249 | kind: ethereum/events 250 | apiVersion: 0.0.4 251 | language: wasm/assemblyscript 252 | entities: 253 | - PendingDepositWithdrawn 254 | - Redeemed 255 | - RedeemedToPool 256 | - CollateralizationChanged 257 | - Deposited 258 | abis: 259 | - name: Pod 260 | file: ./abis/Pod.json 261 | eventHandlers: 262 | - event: PendingDepositWithdrawn(indexed address,indexed address,uint256,bytes,bytes) 263 | handler: handlePendingDepositWithdrawn 264 | - event: Redeemed(indexed address,indexed address,uint256,uint256,bytes,bytes) 265 | handler: handleRedeemed 266 | - event: RedeemedToPool(indexed address,indexed address,uint256,uint256,bytes,bytes) 267 | handler: handleRedeemedToPool 268 | - event: CollateralizationChanged(indexed uint256,uint256,uint256,uint256) 269 | handler: handleCollateralizationChanged 270 | - event: Deposited(indexed address,indexed address,uint256,uint256,bytes,bytes) 271 | handler: handleDeposited 272 | file: ./src/mappingForPod.ts 273 | - kind: ethereum/contract 274 | name: PoolUsdc 275 | network: mainnet 276 | source: 277 | address: "0x0034Ea9808E620A0EF79261c51AF20614B742B24" 278 | abi: MCDAwarePool 279 | startBlock: 9130000 280 | mapping: 281 | kind: ethereum/events 282 | apiVersion: 0.0.4 283 | language: wasm/assemblyscript 284 | entities: 285 | - AdminAdded 286 | - AdminRemoved 287 | - Committed 288 | - CommittedDepositWithdrawn 289 | - Deposited 290 | - DepositedAndCommitted 291 | - FeeCollected 292 | - NextFeeBeneficiaryChanged 293 | - NextFeeFractionChanged 294 | - OpenDepositWithdrawn 295 | - Opened 296 | - Paused 297 | - Rewarded 298 | - RolledOver 299 | - SponsorshipAndFeesWithdrawn 300 | - SponsorshipDeposited 301 | - Unpaused 302 | - Withdrawn 303 | abis: 304 | - name: MCDAwarePool 305 | file: ./abis/MCDAwarePool.json 306 | - name: Pod 307 | file: ./abis/Pod.json 308 | - name: PoolToken 309 | file: ./abis/PoolToken.json 310 | eventHandlers: 311 | - event: AdminAdded(indexed address) 312 | handler: handleAdminAdded 313 | - event: AdminRemoved(indexed address) 314 | handler: handleAdminRemoved 315 | - event: Committed(indexed uint256) 316 | handler: handleCommitted 317 | - event: CommittedDepositWithdrawn(indexed address,uint256) 318 | handler: handleCommittedDepositWithdrawn 319 | - event: Deposited(indexed address,uint256) 320 | handler: handleDeposited 321 | - event: DepositedAndCommitted(indexed address,uint256) 322 | handler: handleDepositedAndCommitted 323 | - event: FeeCollected(indexed address,uint256,uint256) 324 | handler: handleFeeCollected 325 | - event: NextFeeBeneficiaryChanged(indexed address) 326 | handler: handleNextFeeBeneficiaryChanged 327 | - event: NextFeeFractionChanged(uint256) 328 | handler: handleNextFeeFractionChanged 329 | - event: OpenDepositWithdrawn(indexed address,uint256) 330 | handler: handleOpenDepositWithdrawn 331 | - event: Opened(indexed uint256,indexed address,bytes32,uint256) 332 | handler: handleOpened 333 | - event: Paused(indexed address) 334 | handler: handlePaused 335 | - event: Rewarded(indexed uint256,indexed address,bytes32,uint256,uint256) 336 | handler: handleRewarded 337 | - event: RolledOver(indexed uint256) 338 | handler: handleRolledOver 339 | - event: SponsorshipAndFeesWithdrawn(indexed address,uint256) 340 | handler: handleSponsorshipAndFeesWithdrawn 341 | - event: SponsorshipDeposited(indexed address,uint256) 342 | handler: handleSponsorshipDeposited 343 | - event: Unpaused(indexed address) 344 | handler: handleUnpaused 345 | - event: Withdrawn(indexed address,uint256) 346 | handler: handleWithdrawn 347 | file: ./src/mappingForMCDAwarePool.ts 348 | - kind: ethereum/contract 349 | name: PoolUsdcToken 350 | network: mainnet 351 | source: 352 | address: "0xBD87447F48ad729C5c4b8bcb503e1395F62e8B98" 353 | abi: PoolToken 354 | startBlock: 9130000 355 | mapping: 356 | kind: ethereum/events 357 | apiVersion: 0.0.4 358 | language: wasm/assemblyscript 359 | entities: 360 | - Approval 361 | - AuthorizedOperator 362 | - Burned 363 | - Minted 364 | - Redeemed 365 | - RevokedOperator 366 | - Sent 367 | - Transfer 368 | abis: 369 | - name: MCDAwarePool 370 | file: ./abis/MCDAwarePool.json 371 | - name: Pod 372 | file: ./abis/Pod.json 373 | - name: PoolToken 374 | file: ./abis/PoolToken.json 375 | eventHandlers: 376 | - event: Approval(indexed address,indexed address,uint256) 377 | handler: handleApproval 378 | - event: AuthorizedOperator(indexed address,indexed address) 379 | handler: handleAuthorizedOperator 380 | - event: Burned(indexed address,indexed address,uint256,bytes,bytes) 381 | handler: handleBurned 382 | - event: Minted(indexed address,indexed address,uint256,bytes,bytes) 383 | handler: handleMinted 384 | - event: Redeemed(indexed address,indexed address,uint256,bytes,bytes) 385 | handler: handleRedeemed 386 | - event: RevokedOperator(indexed address,indexed address) 387 | handler: handleRevokedOperator 388 | - event: Sent(indexed address,indexed address,indexed address,uint256,bytes,bytes) 389 | handler: handleSent 390 | - event: Transfer(indexed address,indexed address,uint256) 391 | handler: handleTransfer 392 | file: ./src/mappingForPoolToken.ts 393 | - kind: ethereum/contract 394 | name: UsdcPod 395 | network: mainnet 396 | source: 397 | address: "0x6F5587E191C8b222F634C78111F97c4851663ba4" 398 | abi: Pod 399 | startBlock: 9900000 400 | mapping: 401 | kind: ethereum/events 402 | apiVersion: 0.0.4 403 | language: wasm/assemblyscript 404 | entities: 405 | - PendingDepositWithdrawn 406 | - Redeemed 407 | - RedeemedToPool 408 | - CollateralizationChanged 409 | - Deposited 410 | abis: 411 | - name: Pod 412 | file: ./abis/Pod.json 413 | eventHandlers: 414 | - event: PendingDepositWithdrawn(indexed address,indexed address,uint256,bytes,bytes) 415 | handler: handlePendingDepositWithdrawn 416 | - event: Redeemed(indexed address,indexed address,uint256,uint256,bytes,bytes) 417 | handler: handleRedeemed 418 | - event: RedeemedToPool(indexed address,indexed address,uint256,uint256,bytes,bytes) 419 | handler: handleRedeemedToPool 420 | - event: CollateralizationChanged(indexed uint256,uint256,uint256,uint256) 421 | handler: handleCollateralizationChanged 422 | - event: Deposited(indexed address,indexed address,uint256,uint256,bytes,bytes) 423 | handler: handleDeposited 424 | file: ./src/mappingForPod.ts -------------------------------------------------------------------------------- /abis/PoolToken.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { 6 | "indexed": true, 7 | "internalType": "address", 8 | "name": "owner", 9 | "type": "address" 10 | }, 11 | { 12 | "indexed": true, 13 | "internalType": "address", 14 | "name": "spender", 15 | "type": "address" 16 | }, 17 | { 18 | "indexed": false, 19 | "internalType": "uint256", 20 | "name": "value", 21 | "type": "uint256" 22 | } 23 | ], 24 | "name": "Approval", 25 | "type": "event" 26 | }, 27 | { 28 | "anonymous": false, 29 | "inputs": [ 30 | { 31 | "indexed": true, 32 | "internalType": "address", 33 | "name": "operator", 34 | "type": "address" 35 | }, 36 | { 37 | "indexed": true, 38 | "internalType": "address", 39 | "name": "tokenHolder", 40 | "type": "address" 41 | } 42 | ], 43 | "name": "AuthorizedOperator", 44 | "type": "event" 45 | }, 46 | { 47 | "anonymous": false, 48 | "inputs": [ 49 | { 50 | "indexed": true, 51 | "internalType": "address", 52 | "name": "operator", 53 | "type": "address" 54 | }, 55 | { 56 | "indexed": true, 57 | "internalType": "address", 58 | "name": "from", 59 | "type": "address" 60 | }, 61 | { 62 | "indexed": false, 63 | "internalType": "uint256", 64 | "name": "amount", 65 | "type": "uint256" 66 | }, 67 | { 68 | "indexed": false, 69 | "internalType": "bytes", 70 | "name": "data", 71 | "type": "bytes" 72 | }, 73 | { 74 | "indexed": false, 75 | "internalType": "bytes", 76 | "name": "operatorData", 77 | "type": "bytes" 78 | } 79 | ], 80 | "name": "Burned", 81 | "type": "event" 82 | }, 83 | { 84 | "anonymous": false, 85 | "inputs": [ 86 | { 87 | "indexed": true, 88 | "internalType": "address", 89 | "name": "operator", 90 | "type": "address" 91 | }, 92 | { 93 | "indexed": true, 94 | "internalType": "address", 95 | "name": "to", 96 | "type": "address" 97 | }, 98 | { 99 | "indexed": false, 100 | "internalType": "uint256", 101 | "name": "amount", 102 | "type": "uint256" 103 | }, 104 | { 105 | "indexed": false, 106 | "internalType": "bytes", 107 | "name": "data", 108 | "type": "bytes" 109 | }, 110 | { 111 | "indexed": false, 112 | "internalType": "bytes", 113 | "name": "operatorData", 114 | "type": "bytes" 115 | } 116 | ], 117 | "name": "Minted", 118 | "type": "event" 119 | }, 120 | { 121 | "anonymous": false, 122 | "inputs": [ 123 | { 124 | "indexed": true, 125 | "internalType": "address", 126 | "name": "operator", 127 | "type": "address" 128 | }, 129 | { 130 | "indexed": true, 131 | "internalType": "address", 132 | "name": "from", 133 | "type": "address" 134 | }, 135 | { 136 | "indexed": false, 137 | "internalType": "uint256", 138 | "name": "amount", 139 | "type": "uint256" 140 | }, 141 | { 142 | "indexed": false, 143 | "internalType": "bytes", 144 | "name": "data", 145 | "type": "bytes" 146 | }, 147 | { 148 | "indexed": false, 149 | "internalType": "bytes", 150 | "name": "operatorData", 151 | "type": "bytes" 152 | } 153 | ], 154 | "name": "Redeemed", 155 | "type": "event" 156 | }, 157 | { 158 | "anonymous": false, 159 | "inputs": [ 160 | { 161 | "indexed": true, 162 | "internalType": "address", 163 | "name": "operator", 164 | "type": "address" 165 | }, 166 | { 167 | "indexed": true, 168 | "internalType": "address", 169 | "name": "tokenHolder", 170 | "type": "address" 171 | } 172 | ], 173 | "name": "RevokedOperator", 174 | "type": "event" 175 | }, 176 | { 177 | "anonymous": false, 178 | "inputs": [ 179 | { 180 | "indexed": true, 181 | "internalType": "address", 182 | "name": "operator", 183 | "type": "address" 184 | }, 185 | { 186 | "indexed": true, 187 | "internalType": "address", 188 | "name": "from", 189 | "type": "address" 190 | }, 191 | { 192 | "indexed": true, 193 | "internalType": "address", 194 | "name": "to", 195 | "type": "address" 196 | }, 197 | { 198 | "indexed": false, 199 | "internalType": "uint256", 200 | "name": "amount", 201 | "type": "uint256" 202 | }, 203 | { 204 | "indexed": false, 205 | "internalType": "bytes", 206 | "name": "data", 207 | "type": "bytes" 208 | }, 209 | { 210 | "indexed": false, 211 | "internalType": "bytes", 212 | "name": "operatorData", 213 | "type": "bytes" 214 | } 215 | ], 216 | "name": "Sent", 217 | "type": "event" 218 | }, 219 | { 220 | "anonymous": false, 221 | "inputs": [ 222 | { 223 | "indexed": true, 224 | "internalType": "address", 225 | "name": "from", 226 | "type": "address" 227 | }, 228 | { 229 | "indexed": true, 230 | "internalType": "address", 231 | "name": "to", 232 | "type": "address" 233 | }, 234 | { 235 | "indexed": false, 236 | "internalType": "uint256", 237 | "name": "value", 238 | "type": "uint256" 239 | } 240 | ], 241 | "name": "Transfer", 242 | "type": "event" 243 | }, 244 | { 245 | "constant": true, 246 | "inputs": [ 247 | { 248 | "internalType": "address", 249 | "name": "holder", 250 | "type": "address" 251 | }, 252 | { 253 | "internalType": "address", 254 | "name": "spender", 255 | "type": "address" 256 | } 257 | ], 258 | "name": "allowance", 259 | "outputs": [ 260 | { 261 | "internalType": "uint256", 262 | "name": "", 263 | "type": "uint256" 264 | } 265 | ], 266 | "payable": false, 267 | "stateMutability": "view", 268 | "type": "function" 269 | }, 270 | { 271 | "constant": false, 272 | "inputs": [ 273 | { 274 | "internalType": "address", 275 | "name": "spender", 276 | "type": "address" 277 | }, 278 | { 279 | "internalType": "uint256", 280 | "name": "value", 281 | "type": "uint256" 282 | } 283 | ], 284 | "name": "approve", 285 | "outputs": [ 286 | { 287 | "internalType": "bool", 288 | "name": "", 289 | "type": "bool" 290 | } 291 | ], 292 | "payable": false, 293 | "stateMutability": "nonpayable", 294 | "type": "function" 295 | }, 296 | { 297 | "constant": false, 298 | "inputs": [ 299 | { 300 | "internalType": "address", 301 | "name": "operator", 302 | "type": "address" 303 | } 304 | ], 305 | "name": "authorizeOperator", 306 | "outputs": [], 307 | "payable": false, 308 | "stateMutability": "nonpayable", 309 | "type": "function" 310 | }, 311 | { 312 | "constant": true, 313 | "inputs": [ 314 | { 315 | "internalType": "address", 316 | "name": "_addr", 317 | "type": "address" 318 | } 319 | ], 320 | "name": "balanceOf", 321 | "outputs": [ 322 | { 323 | "internalType": "uint256", 324 | "name": "", 325 | "type": "uint256" 326 | } 327 | ], 328 | "payable": false, 329 | "stateMutability": "view", 330 | "type": "function" 331 | }, 332 | { 333 | "constant": false, 334 | "inputs": [ 335 | { 336 | "internalType": "uint256", 337 | "name": "", 338 | "type": "uint256" 339 | }, 340 | { 341 | "internalType": "bytes", 342 | "name": "", 343 | "type": "bytes" 344 | } 345 | ], 346 | "name": "burn", 347 | "outputs": [], 348 | "payable": false, 349 | "stateMutability": "nonpayable", 350 | "type": "function" 351 | }, 352 | { 353 | "constant": true, 354 | "inputs": [], 355 | "name": "decimals", 356 | "outputs": [ 357 | { 358 | "internalType": "uint8", 359 | "name": "", 360 | "type": "uint8" 361 | } 362 | ], 363 | "payable": false, 364 | "stateMutability": "pure", 365 | "type": "function" 366 | }, 367 | { 368 | "constant": true, 369 | "inputs": [], 370 | "name": "defaultOperators", 371 | "outputs": [ 372 | { 373 | "internalType": "address[]", 374 | "name": "", 375 | "type": "address[]" 376 | } 377 | ], 378 | "payable": false, 379 | "stateMutability": "view", 380 | "type": "function" 381 | }, 382 | { 383 | "constant": true, 384 | "inputs": [], 385 | "name": "granularity", 386 | "outputs": [ 387 | { 388 | "internalType": "uint256", 389 | "name": "", 390 | "type": "uint256" 391 | } 392 | ], 393 | "payable": false, 394 | "stateMutability": "view", 395 | "type": "function" 396 | }, 397 | { 398 | "constant": false, 399 | "inputs": [ 400 | { 401 | "internalType": "string", 402 | "name": "name", 403 | "type": "string" 404 | }, 405 | { 406 | "internalType": "string", 407 | "name": "symbol", 408 | "type": "string" 409 | }, 410 | { 411 | "internalType": "address[]", 412 | "name": "defaultOperators", 413 | "type": "address[]" 414 | }, 415 | { 416 | "internalType": "contract BasePool", 417 | "name": "pool", 418 | "type": "address" 419 | } 420 | ], 421 | "name": "init", 422 | "outputs": [], 423 | "payable": false, 424 | "stateMutability": "nonpayable", 425 | "type": "function" 426 | }, 427 | { 428 | "constant": true, 429 | "inputs": [ 430 | { 431 | "internalType": "address", 432 | "name": "operator", 433 | "type": "address" 434 | }, 435 | { 436 | "internalType": "address", 437 | "name": "tokenHolder", 438 | "type": "address" 439 | } 440 | ], 441 | "name": "isOperatorFor", 442 | "outputs": [ 443 | { 444 | "internalType": "bool", 445 | "name": "", 446 | "type": "bool" 447 | } 448 | ], 449 | "payable": false, 450 | "stateMutability": "view", 451 | "type": "function" 452 | }, 453 | { 454 | "constant": true, 455 | "inputs": [], 456 | "name": "name", 457 | "outputs": [ 458 | { 459 | "internalType": "string", 460 | "name": "", 461 | "type": "string" 462 | } 463 | ], 464 | "payable": false, 465 | "stateMutability": "view", 466 | "type": "function" 467 | }, 468 | { 469 | "constant": false, 470 | "inputs": [ 471 | { 472 | "internalType": "address", 473 | "name": "", 474 | "type": "address" 475 | }, 476 | { 477 | "internalType": "uint256", 478 | "name": "", 479 | "type": "uint256" 480 | }, 481 | { 482 | "internalType": "bytes", 483 | "name": "", 484 | "type": "bytes" 485 | }, 486 | { 487 | "internalType": "bytes", 488 | "name": "", 489 | "type": "bytes" 490 | } 491 | ], 492 | "name": "operatorBurn", 493 | "outputs": [], 494 | "payable": false, 495 | "stateMutability": "nonpayable", 496 | "type": "function" 497 | }, 498 | { 499 | "constant": false, 500 | "inputs": [ 501 | { 502 | "internalType": "address", 503 | "name": "account", 504 | "type": "address" 505 | }, 506 | { 507 | "internalType": "uint256", 508 | "name": "amount", 509 | "type": "uint256" 510 | }, 511 | { 512 | "internalType": "bytes", 513 | "name": "data", 514 | "type": "bytes" 515 | }, 516 | { 517 | "internalType": "bytes", 518 | "name": "operatorData", 519 | "type": "bytes" 520 | } 521 | ], 522 | "name": "operatorRedeem", 523 | "outputs": [], 524 | "payable": false, 525 | "stateMutability": "nonpayable", 526 | "type": "function" 527 | }, 528 | { 529 | "constant": false, 530 | "inputs": [ 531 | { 532 | "internalType": "address", 533 | "name": "sender", 534 | "type": "address" 535 | }, 536 | { 537 | "internalType": "address", 538 | "name": "recipient", 539 | "type": "address" 540 | }, 541 | { 542 | "internalType": "uint256", 543 | "name": "amount", 544 | "type": "uint256" 545 | }, 546 | { 547 | "internalType": "bytes", 548 | "name": "data", 549 | "type": "bytes" 550 | }, 551 | { 552 | "internalType": "bytes", 553 | "name": "operatorData", 554 | "type": "bytes" 555 | } 556 | ], 557 | "name": "operatorSend", 558 | "outputs": [], 559 | "payable": false, 560 | "stateMutability": "nonpayable", 561 | "type": "function" 562 | }, 563 | { 564 | "constant": true, 565 | "inputs": [], 566 | "name": "pool", 567 | "outputs": [ 568 | { 569 | "internalType": "address", 570 | "name": "", 571 | "type": "address" 572 | } 573 | ], 574 | "payable": false, 575 | "stateMutability": "view", 576 | "type": "function" 577 | }, 578 | { 579 | "constant": false, 580 | "inputs": [ 581 | { 582 | "internalType": "uint256", 583 | "name": "amount", 584 | "type": "uint256" 585 | } 586 | ], 587 | "name": "poolMint", 588 | "outputs": [], 589 | "payable": false, 590 | "stateMutability": "nonpayable", 591 | "type": "function" 592 | }, 593 | { 594 | "constant": false, 595 | "inputs": [ 596 | { 597 | "internalType": "address", 598 | "name": "from", 599 | "type": "address" 600 | }, 601 | { 602 | "internalType": "uint256", 603 | "name": "amount", 604 | "type": "uint256" 605 | } 606 | ], 607 | "name": "poolRedeem", 608 | "outputs": [], 609 | "payable": false, 610 | "stateMutability": "nonpayable", 611 | "type": "function" 612 | }, 613 | { 614 | "constant": false, 615 | "inputs": [ 616 | { 617 | "internalType": "uint256", 618 | "name": "amount", 619 | "type": "uint256" 620 | }, 621 | { 622 | "internalType": "bytes", 623 | "name": "data", 624 | "type": "bytes" 625 | } 626 | ], 627 | "name": "redeem", 628 | "outputs": [], 629 | "payable": false, 630 | "stateMutability": "nonpayable", 631 | "type": "function" 632 | }, 633 | { 634 | "constant": false, 635 | "inputs": [ 636 | { 637 | "internalType": "address", 638 | "name": "operator", 639 | "type": "address" 640 | } 641 | ], 642 | "name": "revokeOperator", 643 | "outputs": [], 644 | "payable": false, 645 | "stateMutability": "nonpayable", 646 | "type": "function" 647 | }, 648 | { 649 | "constant": false, 650 | "inputs": [ 651 | { 652 | "internalType": "address", 653 | "name": "recipient", 654 | "type": "address" 655 | }, 656 | { 657 | "internalType": "uint256", 658 | "name": "amount", 659 | "type": "uint256" 660 | }, 661 | { 662 | "internalType": "bytes", 663 | "name": "data", 664 | "type": "bytes" 665 | } 666 | ], 667 | "name": "send", 668 | "outputs": [], 669 | "payable": false, 670 | "stateMutability": "nonpayable", 671 | "type": "function" 672 | }, 673 | { 674 | "constant": true, 675 | "inputs": [], 676 | "name": "symbol", 677 | "outputs": [ 678 | { 679 | "internalType": "string", 680 | "name": "", 681 | "type": "string" 682 | } 683 | ], 684 | "payable": false, 685 | "stateMutability": "view", 686 | "type": "function" 687 | }, 688 | { 689 | "constant": true, 690 | "inputs": [], 691 | "name": "totalSupply", 692 | "outputs": [ 693 | { 694 | "internalType": "uint256", 695 | "name": "", 696 | "type": "uint256" 697 | } 698 | ], 699 | "payable": false, 700 | "stateMutability": "view", 701 | "type": "function" 702 | }, 703 | { 704 | "constant": false, 705 | "inputs": [ 706 | { 707 | "internalType": "address", 708 | "name": "recipient", 709 | "type": "address" 710 | }, 711 | { 712 | "internalType": "uint256", 713 | "name": "amount", 714 | "type": "uint256" 715 | } 716 | ], 717 | "name": "transfer", 718 | "outputs": [ 719 | { 720 | "internalType": "bool", 721 | "name": "", 722 | "type": "bool" 723 | } 724 | ], 725 | "payable": false, 726 | "stateMutability": "nonpayable", 727 | "type": "function" 728 | }, 729 | { 730 | "constant": false, 731 | "inputs": [ 732 | { 733 | "internalType": "address", 734 | "name": "holder", 735 | "type": "address" 736 | }, 737 | { 738 | "internalType": "address", 739 | "name": "recipient", 740 | "type": "address" 741 | }, 742 | { 743 | "internalType": "uint256", 744 | "name": "amount", 745 | "type": "uint256" 746 | } 747 | ], 748 | "name": "transferFrom", 749 | "outputs": [ 750 | { 751 | "internalType": "bool", 752 | "name": "", 753 | "type": "bool" 754 | } 755 | ], 756 | "payable": false, 757 | "stateMutability": "nonpayable", 758 | "type": "function" 759 | }, 760 | { 761 | "constant": true, 762 | "inputs": [], 763 | "name": "recipientWhitelistEnabled", 764 | "outputs": [ 765 | { 766 | "internalType": "bool", 767 | "name": "", 768 | "type": "bool" 769 | } 770 | ], 771 | "payable": false, 772 | "stateMutability": "view", 773 | "type": "function" 774 | }, 775 | { 776 | "constant": true, 777 | "inputs": [ 778 | { 779 | "internalType": "address", 780 | "name": "_recipient", 781 | "type": "address" 782 | } 783 | ], 784 | "name": "recipientWhitelisted", 785 | "outputs": [ 786 | { 787 | "internalType": "bool", 788 | "name": "", 789 | "type": "bool" 790 | } 791 | ], 792 | "payable": false, 793 | "stateMutability": "view", 794 | "type": "function" 795 | }, 796 | { 797 | "constant": false, 798 | "inputs": [ 799 | { 800 | "internalType": "bool", 801 | "name": "_enabled", 802 | "type": "bool" 803 | } 804 | ], 805 | "name": "setRecipientWhitelistEnabled", 806 | "outputs": [], 807 | "payable": false, 808 | "stateMutability": "nonpayable", 809 | "type": "function" 810 | }, 811 | { 812 | "constant": false, 813 | "inputs": [ 814 | { 815 | "internalType": "address", 816 | "name": "_recipient", 817 | "type": "address" 818 | }, 819 | { 820 | "internalType": "bool", 821 | "name": "_whitelisted", 822 | "type": "bool" 823 | } 824 | ], 825 | "name": "setRecipientWhitelisted", 826 | "outputs": [], 827 | "payable": false, 828 | "stateMutability": "nonpayable", 829 | "type": "function" 830 | } 831 | ] -------------------------------------------------------------------------------- /generated/schema.ts: -------------------------------------------------------------------------------- 1 | // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | 3 | import { 4 | TypedMap, 5 | Entity, 6 | Value, 7 | ValueKind, 8 | store, 9 | Address, 10 | Bytes, 11 | BigInt, 12 | BigDecimal 13 | } from "@graphprotocol/graph-ts"; 14 | 15 | export class Draw extends Entity { 16 | constructor(id: string) { 17 | super(); 18 | this.set("id", Value.fromString(id)); 19 | } 20 | 21 | save(): void { 22 | let id = this.get("id"); 23 | assert(id !== null, "Cannot save Draw entity without an ID"); 24 | assert( 25 | id.kind == ValueKind.STRING, 26 | "Cannot save Draw entity with non-string ID. " + 27 | 'Considering using .toHex() to convert the "id" to a string.' 28 | ); 29 | store.set("Draw", id.toString(), this); 30 | } 31 | 32 | static load(id: string): Draw | null { 33 | return store.get("Draw", id) as Draw | null; 34 | } 35 | 36 | get id(): string { 37 | let value = this.get("id"); 38 | return value.toString(); 39 | } 40 | 41 | set id(value: string) { 42 | this.set("id", Value.fromString(value)); 43 | } 44 | 45 | get drawId(): BigInt { 46 | let value = this.get("drawId"); 47 | return value.toBigInt(); 48 | } 49 | 50 | set drawId(value: BigInt) { 51 | this.set("drawId", Value.fromBigInt(value)); 52 | } 53 | 54 | get feeBeneficiary(): Bytes | null { 55 | let value = this.get("feeBeneficiary"); 56 | if (value === null) { 57 | return null; 58 | } else { 59 | return value.toBytes(); 60 | } 61 | } 62 | 63 | set feeBeneficiary(value: Bytes | null) { 64 | if (value === null) { 65 | this.unset("feeBeneficiary"); 66 | } else { 67 | this.set("feeBeneficiary", Value.fromBytes(value as Bytes)); 68 | } 69 | } 70 | 71 | get secretHash(): Bytes | null { 72 | let value = this.get("secretHash"); 73 | if (value === null) { 74 | return null; 75 | } else { 76 | return value.toBytes(); 77 | } 78 | } 79 | 80 | set secretHash(value: Bytes | null) { 81 | if (value === null) { 82 | this.unset("secretHash"); 83 | } else { 84 | this.set("secretHash", Value.fromBytes(value as Bytes)); 85 | } 86 | } 87 | 88 | get feeFraction(): BigInt | null { 89 | let value = this.get("feeFraction"); 90 | if (value === null) { 91 | return null; 92 | } else { 93 | return value.toBigInt(); 94 | } 95 | } 96 | 97 | set feeFraction(value: BigInt | null) { 98 | if (value === null) { 99 | this.unset("feeFraction"); 100 | } else { 101 | this.set("feeFraction", Value.fromBigInt(value as BigInt)); 102 | } 103 | } 104 | 105 | get winner(): Bytes | null { 106 | let value = this.get("winner"); 107 | if (value === null) { 108 | return null; 109 | } else { 110 | return value.toBytes(); 111 | } 112 | } 113 | 114 | set winner(value: Bytes | null) { 115 | if (value === null) { 116 | this.unset("winner"); 117 | } else { 118 | this.set("winner", Value.fromBytes(value as Bytes)); 119 | } 120 | } 121 | 122 | get entropy(): Bytes | null { 123 | let value = this.get("entropy"); 124 | if (value === null) { 125 | return null; 126 | } else { 127 | return value.toBytes(); 128 | } 129 | } 130 | 131 | set entropy(value: Bytes | null) { 132 | if (value === null) { 133 | this.unset("entropy"); 134 | } else { 135 | this.set("entropy", Value.fromBytes(value as Bytes)); 136 | } 137 | } 138 | 139 | get winnings(): BigInt | null { 140 | let value = this.get("winnings"); 141 | if (value === null) { 142 | return null; 143 | } else { 144 | return value.toBigInt(); 145 | } 146 | } 147 | 148 | set winnings(value: BigInt | null) { 149 | if (value === null) { 150 | this.unset("winnings"); 151 | } else { 152 | this.set("winnings", Value.fromBigInt(value as BigInt)); 153 | } 154 | } 155 | 156 | get fee(): BigInt | null { 157 | let value = this.get("fee"); 158 | if (value === null) { 159 | return null; 160 | } else { 161 | return value.toBigInt(); 162 | } 163 | } 164 | 165 | set fee(value: BigInt | null) { 166 | if (value === null) { 167 | this.unset("fee"); 168 | } else { 169 | this.set("fee", Value.fromBigInt(value as BigInt)); 170 | } 171 | } 172 | 173 | get state(): string | null { 174 | let value = this.get("state"); 175 | if (value === null) { 176 | return null; 177 | } else { 178 | return value.toString(); 179 | } 180 | } 181 | 182 | set state(value: string | null) { 183 | if (value === null) { 184 | this.unset("state"); 185 | } else { 186 | this.set("state", Value.fromString(value as string)); 187 | } 188 | } 189 | 190 | get poolContract(): string { 191 | let value = this.get("poolContract"); 192 | return value.toString(); 193 | } 194 | 195 | set poolContract(value: string) { 196 | this.set("poolContract", Value.fromString(value)); 197 | } 198 | 199 | get openedAt(): BigInt { 200 | let value = this.get("openedAt"); 201 | return value.toBigInt(); 202 | } 203 | 204 | set openedAt(value: BigInt) { 205 | this.set("openedAt", Value.fromBigInt(value)); 206 | } 207 | 208 | get committedAt(): BigInt { 209 | let value = this.get("committedAt"); 210 | return value.toBigInt(); 211 | } 212 | 213 | set committedAt(value: BigInt) { 214 | this.set("committedAt", Value.fromBigInt(value)); 215 | } 216 | 217 | get rewardedAt(): BigInt { 218 | let value = this.get("rewardedAt"); 219 | return value.toBigInt(); 220 | } 221 | 222 | set rewardedAt(value: BigInt) { 223 | this.set("rewardedAt", Value.fromBigInt(value)); 224 | } 225 | 226 | get openedAtBlock(): BigInt { 227 | let value = this.get("openedAtBlock"); 228 | return value.toBigInt(); 229 | } 230 | 231 | set openedAtBlock(value: BigInt) { 232 | this.set("openedAtBlock", Value.fromBigInt(value)); 233 | } 234 | 235 | get committedAtBlock(): BigInt { 236 | let value = this.get("committedAtBlock"); 237 | return value.toBigInt(); 238 | } 239 | 240 | set committedAtBlock(value: BigInt) { 241 | this.set("committedAtBlock", Value.fromBigInt(value)); 242 | } 243 | 244 | get rewardedAtBlock(): BigInt { 245 | let value = this.get("rewardedAtBlock"); 246 | return value.toBigInt(); 247 | } 248 | 249 | set rewardedAtBlock(value: BigInt) { 250 | this.set("rewardedAtBlock", Value.fromBigInt(value)); 251 | } 252 | 253 | get balance(): BigInt | null { 254 | let value = this.get("balance"); 255 | if (value === null) { 256 | return null; 257 | } else { 258 | return value.toBigInt(); 259 | } 260 | } 261 | 262 | set balance(value: BigInt | null) { 263 | if (value === null) { 264 | this.unset("balance"); 265 | } else { 266 | this.set("balance", Value.fromBigInt(value as BigInt)); 267 | } 268 | } 269 | 270 | get version(): BigInt { 271 | let value = this.get("version"); 272 | return value.toBigInt(); 273 | } 274 | 275 | set version(value: BigInt) { 276 | this.set("version", Value.fromBigInt(value)); 277 | } 278 | } 279 | 280 | export class Player extends Entity { 281 | constructor(id: string) { 282 | super(); 283 | this.set("id", Value.fromString(id)); 284 | } 285 | 286 | save(): void { 287 | let id = this.get("id"); 288 | assert(id !== null, "Cannot save Player entity without an ID"); 289 | assert( 290 | id.kind == ValueKind.STRING, 291 | "Cannot save Player entity with non-string ID. " + 292 | 'Considering using .toHex() to convert the "id" to a string.' 293 | ); 294 | store.set("Player", id.toString(), this); 295 | } 296 | 297 | static load(id: string): Player | null { 298 | return store.get("Player", id) as Player | null; 299 | } 300 | 301 | get id(): string { 302 | let value = this.get("id"); 303 | return value.toString(); 304 | } 305 | 306 | set id(value: string) { 307 | this.set("id", Value.fromString(value)); 308 | } 309 | 310 | get address(): Bytes { 311 | let value = this.get("address"); 312 | return value.toBytes(); 313 | } 314 | 315 | set address(value: Bytes) { 316 | this.set("address", Value.fromBytes(value)); 317 | } 318 | 319 | get poolContract(): string { 320 | let value = this.get("poolContract"); 321 | return value.toString(); 322 | } 323 | 324 | set poolContract(value: string) { 325 | this.set("poolContract", Value.fromString(value)); 326 | } 327 | 328 | get consolidatedBalance(): BigInt { 329 | let value = this.get("consolidatedBalance"); 330 | return value.toBigInt(); 331 | } 332 | 333 | set consolidatedBalance(value: BigInt) { 334 | this.set("consolidatedBalance", Value.fromBigInt(value)); 335 | } 336 | 337 | get firstDepositDrawId(): BigInt { 338 | let value = this.get("firstDepositDrawId"); 339 | return value.toBigInt(); 340 | } 341 | 342 | set firstDepositDrawId(value: BigInt) { 343 | this.set("firstDepositDrawId", Value.fromBigInt(value)); 344 | } 345 | 346 | get latestBalance(): BigInt { 347 | let value = this.get("latestBalance"); 348 | return value.toBigInt(); 349 | } 350 | 351 | set latestBalance(value: BigInt) { 352 | this.set("latestBalance", Value.fromBigInt(value)); 353 | } 354 | 355 | get latestDrawId(): BigInt { 356 | let value = this.get("latestDrawId"); 357 | return value.toBigInt(); 358 | } 359 | 360 | set latestDrawId(value: BigInt) { 361 | this.set("latestDrawId", Value.fromBigInt(value)); 362 | } 363 | 364 | get winnings(): BigInt { 365 | let value = this.get("winnings"); 366 | return value.toBigInt(); 367 | } 368 | 369 | set winnings(value: BigInt) { 370 | this.set("winnings", Value.fromBigInt(value)); 371 | } 372 | 373 | get version(): BigInt { 374 | let value = this.get("version"); 375 | return value.toBigInt(); 376 | } 377 | 378 | set version(value: BigInt) { 379 | this.set("version", Value.fromBigInt(value)); 380 | } 381 | } 382 | 383 | export class Pod extends Entity { 384 | constructor(id: string) { 385 | super(); 386 | this.set("id", Value.fromString(id)); 387 | } 388 | 389 | save(): void { 390 | let id = this.get("id"); 391 | assert(id !== null, "Cannot save Pod entity without an ID"); 392 | assert( 393 | id.kind == ValueKind.STRING, 394 | "Cannot save Pod entity with non-string ID. " + 395 | 'Considering using .toHex() to convert the "id" to a string.' 396 | ); 397 | store.set("Pod", id.toString(), this); 398 | } 399 | 400 | static load(id: string): Pod | null { 401 | return store.get("Pod", id) as Pod | null; 402 | } 403 | 404 | get id(): string { 405 | let value = this.get("id"); 406 | return value.toString(); 407 | } 408 | 409 | set id(value: string) { 410 | this.set("id", Value.fromString(value)); 411 | } 412 | 413 | get address(): Bytes { 414 | let value = this.get("address"); 415 | return value.toBytes(); 416 | } 417 | 418 | set address(value: Bytes) { 419 | this.set("address", Value.fromBytes(value)); 420 | } 421 | 422 | get podPlayers(): Array { 423 | let value = this.get("podPlayers"); 424 | return value.toStringArray(); 425 | } 426 | 427 | set podPlayers(value: Array) { 428 | this.set("podPlayers", Value.fromStringArray(value)); 429 | } 430 | 431 | get collateralizationEvents(): Array { 432 | let value = this.get("collateralizationEvents"); 433 | return value.toStringArray(); 434 | } 435 | 436 | set collateralizationEvents(value: Array) { 437 | this.set("collateralizationEvents", Value.fromStringArray(value)); 438 | } 439 | 440 | get podPlayersCount(): BigInt | null { 441 | let value = this.get("podPlayersCount"); 442 | if (value === null) { 443 | return null; 444 | } else { 445 | return value.toBigInt(); 446 | } 447 | } 448 | 449 | set podPlayersCount(value: BigInt | null) { 450 | if (value === null) { 451 | this.unset("podPlayersCount"); 452 | } else { 453 | this.set("podPlayersCount", Value.fromBigInt(value as BigInt)); 454 | } 455 | } 456 | 457 | get currentExchangeRateMantissa(): BigInt { 458 | let value = this.get("currentExchangeRateMantissa"); 459 | return value.toBigInt(); 460 | } 461 | 462 | set currentExchangeRateMantissa(value: BigInt) { 463 | this.set("currentExchangeRateMantissa", Value.fromBigInt(value)); 464 | } 465 | 466 | get balanceUnderlying(): BigInt { 467 | let value = this.get("balanceUnderlying"); 468 | return value.toBigInt(); 469 | } 470 | 471 | set balanceUnderlying(value: BigInt) { 472 | this.set("balanceUnderlying", Value.fromBigInt(value)); 473 | } 474 | 475 | get totalPendingDeposits(): BigInt { 476 | let value = this.get("totalPendingDeposits"); 477 | return value.toBigInt(); 478 | } 479 | 480 | set totalPendingDeposits(value: BigInt) { 481 | this.set("totalPendingDeposits", Value.fromBigInt(value)); 482 | } 483 | 484 | get poolContract(): string { 485 | let value = this.get("poolContract"); 486 | return value.toString(); 487 | } 488 | 489 | set poolContract(value: string) { 490 | this.set("poolContract", Value.fromString(value)); 491 | } 492 | 493 | get winnings(): BigInt { 494 | let value = this.get("winnings"); 495 | return value.toBigInt(); 496 | } 497 | 498 | set winnings(value: BigInt) { 499 | this.set("winnings", Value.fromBigInt(value)); 500 | } 501 | 502 | get version(): BigInt { 503 | let value = this.get("version"); 504 | return value.toBigInt(); 505 | } 506 | 507 | set version(value: BigInt) { 508 | this.set("version", Value.fromBigInt(value)); 509 | } 510 | } 511 | 512 | export class CollateralizationEvent extends Entity { 513 | constructor(id: string) { 514 | super(); 515 | this.set("id", Value.fromString(id)); 516 | } 517 | 518 | save(): void { 519 | let id = this.get("id"); 520 | assert( 521 | id !== null, 522 | "Cannot save CollateralizationEvent entity without an ID" 523 | ); 524 | assert( 525 | id.kind == ValueKind.STRING, 526 | "Cannot save CollateralizationEvent entity with non-string ID. " + 527 | 'Considering using .toHex() to convert the "id" to a string.' 528 | ); 529 | store.set("CollateralizationEvent", id.toString(), this); 530 | } 531 | 532 | static load(id: string): CollateralizationEvent | null { 533 | return store.get( 534 | "CollateralizationEvent", 535 | id 536 | ) as CollateralizationEvent | null; 537 | } 538 | 539 | get id(): string { 540 | let value = this.get("id"); 541 | return value.toString(); 542 | } 543 | 544 | set id(value: string) { 545 | this.set("id", Value.fromString(value)); 546 | } 547 | 548 | get pod(): string { 549 | let value = this.get("pod"); 550 | return value.toString(); 551 | } 552 | 553 | set pod(value: string) { 554 | this.set("pod", Value.fromString(value)); 555 | } 556 | 557 | get block(): BigInt { 558 | let value = this.get("block"); 559 | return value.toBigInt(); 560 | } 561 | 562 | set block(value: BigInt) { 563 | this.set("block", Value.fromBigInt(value)); 564 | } 565 | 566 | get createdAt(): BigInt { 567 | let value = this.get("createdAt"); 568 | return value.toBigInt(); 569 | } 570 | 571 | set createdAt(value: BigInt) { 572 | this.set("createdAt", Value.fromBigInt(value)); 573 | } 574 | 575 | get tokenSupply(): BigInt { 576 | let value = this.get("tokenSupply"); 577 | return value.toBigInt(); 578 | } 579 | 580 | set tokenSupply(value: BigInt) { 581 | this.set("tokenSupply", Value.fromBigInt(value)); 582 | } 583 | 584 | get collateral(): BigInt { 585 | let value = this.get("collateral"); 586 | return value.toBigInt(); 587 | } 588 | 589 | set collateral(value: BigInt) { 590 | this.set("collateral", Value.fromBigInt(value)); 591 | } 592 | 593 | get exchangeRateMantissa(): BigInt { 594 | let value = this.get("exchangeRateMantissa"); 595 | return value.toBigInt(); 596 | } 597 | 598 | set exchangeRateMantissa(value: BigInt) { 599 | this.set("exchangeRateMantissa", Value.fromBigInt(value)); 600 | } 601 | } 602 | 603 | export class PodPlayer extends Entity { 604 | constructor(id: string) { 605 | super(); 606 | this.set("id", Value.fromString(id)); 607 | } 608 | 609 | save(): void { 610 | let id = this.get("id"); 611 | assert(id !== null, "Cannot save PodPlayer entity without an ID"); 612 | assert( 613 | id.kind == ValueKind.STRING, 614 | "Cannot save PodPlayer entity with non-string ID. " + 615 | 'Considering using .toHex() to convert the "id" to a string.' 616 | ); 617 | store.set("PodPlayer", id.toString(), this); 618 | } 619 | 620 | static load(id: string): PodPlayer | null { 621 | return store.get("PodPlayer", id) as PodPlayer | null; 622 | } 623 | 624 | get id(): string { 625 | let value = this.get("id"); 626 | return value.toString(); 627 | } 628 | 629 | set id(value: string) { 630 | this.set("id", Value.fromString(value)); 631 | } 632 | 633 | get address(): Bytes { 634 | let value = this.get("address"); 635 | return value.toBytes(); 636 | } 637 | 638 | set address(value: Bytes) { 639 | this.set("address", Value.fromBytes(value)); 640 | } 641 | 642 | get pod(): string { 643 | let value = this.get("pod"); 644 | return value.toString(); 645 | } 646 | 647 | set pod(value: string) { 648 | this.set("pod", Value.fromString(value)); 649 | } 650 | 651 | get balance(): BigInt { 652 | let value = this.get("balance"); 653 | return value.toBigInt(); 654 | } 655 | 656 | set balance(value: BigInt) { 657 | this.set("balance", Value.fromBigInt(value)); 658 | } 659 | 660 | get balanceUnderlying(): BigInt { 661 | let value = this.get("balanceUnderlying"); 662 | return value.toBigInt(); 663 | } 664 | 665 | set balanceUnderlying(value: BigInt) { 666 | this.set("balanceUnderlying", Value.fromBigInt(value)); 667 | } 668 | 669 | get lastDeposit(): BigInt { 670 | let value = this.get("lastDeposit"); 671 | return value.toBigInt(); 672 | } 673 | 674 | set lastDeposit(value: BigInt) { 675 | this.set("lastDeposit", Value.fromBigInt(value)); 676 | } 677 | 678 | get lastDepositDrawId(): BigInt { 679 | let value = this.get("lastDepositDrawId"); 680 | return value.toBigInt(); 681 | } 682 | 683 | set lastDepositDrawId(value: BigInt) { 684 | this.set("lastDepositDrawId", Value.fromBigInt(value)); 685 | } 686 | 687 | get version(): BigInt { 688 | let value = this.get("version"); 689 | return value.toBigInt(); 690 | } 691 | 692 | set version(value: BigInt) { 693 | this.set("version", Value.fromBigInt(value)); 694 | } 695 | } 696 | 697 | export class Sponsor extends Entity { 698 | constructor(id: string) { 699 | super(); 700 | this.set("id", Value.fromString(id)); 701 | } 702 | 703 | save(): void { 704 | let id = this.get("id"); 705 | assert(id !== null, "Cannot save Sponsor entity without an ID"); 706 | assert( 707 | id.kind == ValueKind.STRING, 708 | "Cannot save Sponsor entity with non-string ID. " + 709 | 'Considering using .toHex() to convert the "id" to a string.' 710 | ); 711 | store.set("Sponsor", id.toString(), this); 712 | } 713 | 714 | static load(id: string): Sponsor | null { 715 | return store.get("Sponsor", id) as Sponsor | null; 716 | } 717 | 718 | get id(): string { 719 | let value = this.get("id"); 720 | return value.toString(); 721 | } 722 | 723 | set id(value: string) { 724 | this.set("id", Value.fromString(value)); 725 | } 726 | 727 | get address(): Bytes { 728 | let value = this.get("address"); 729 | return value.toBytes(); 730 | } 731 | 732 | set address(value: Bytes) { 733 | this.set("address", Value.fromBytes(value)); 734 | } 735 | 736 | get poolContract(): string { 737 | let value = this.get("poolContract"); 738 | return value.toString(); 739 | } 740 | 741 | set poolContract(value: string) { 742 | this.set("poolContract", Value.fromString(value)); 743 | } 744 | 745 | get sponsorshipAndFeeBalance(): BigInt { 746 | let value = this.get("sponsorshipAndFeeBalance"); 747 | return value.toBigInt(); 748 | } 749 | 750 | set sponsorshipAndFeeBalance(value: BigInt) { 751 | this.set("sponsorshipAndFeeBalance", Value.fromBigInt(value)); 752 | } 753 | } 754 | 755 | export class Admin extends Entity { 756 | constructor(id: string) { 757 | super(); 758 | this.set("id", Value.fromString(id)); 759 | } 760 | 761 | save(): void { 762 | let id = this.get("id"); 763 | assert(id !== null, "Cannot save Admin entity without an ID"); 764 | assert( 765 | id.kind == ValueKind.STRING, 766 | "Cannot save Admin entity with non-string ID. " + 767 | 'Considering using .toHex() to convert the "id" to a string.' 768 | ); 769 | store.set("Admin", id.toString(), this); 770 | } 771 | 772 | static load(id: string): Admin | null { 773 | return store.get("Admin", id) as Admin | null; 774 | } 775 | 776 | get id(): string { 777 | let value = this.get("id"); 778 | return value.toString(); 779 | } 780 | 781 | set id(value: string) { 782 | this.set("id", Value.fromString(value)); 783 | } 784 | 785 | get address(): Bytes { 786 | let value = this.get("address"); 787 | return value.toBytes(); 788 | } 789 | 790 | set address(value: Bytes) { 791 | this.set("address", Value.fromBytes(value)); 792 | } 793 | 794 | get addedAt(): BigInt { 795 | let value = this.get("addedAt"); 796 | return value.toBigInt(); 797 | } 798 | 799 | set addedAt(value: BigInt) { 800 | this.set("addedAt", Value.fromBigInt(value)); 801 | } 802 | 803 | get poolContract(): string { 804 | let value = this.get("poolContract"); 805 | return value.toString(); 806 | } 807 | 808 | set poolContract(value: string) { 809 | this.set("poolContract", Value.fromString(value)); 810 | } 811 | } 812 | 813 | export class PoolContract extends Entity { 814 | constructor(id: string) { 815 | super(); 816 | this.set("id", Value.fromString(id)); 817 | } 818 | 819 | save(): void { 820 | let id = this.get("id"); 821 | assert(id !== null, "Cannot save PoolContract entity without an ID"); 822 | assert( 823 | id.kind == ValueKind.STRING, 824 | "Cannot save PoolContract entity with non-string ID. " + 825 | 'Considering using .toHex() to convert the "id" to a string.' 826 | ); 827 | store.set("PoolContract", id.toString(), this); 828 | } 829 | 830 | static load(id: string): PoolContract | null { 831 | return store.get("PoolContract", id) as PoolContract | null; 832 | } 833 | 834 | get id(): string { 835 | let value = this.get("id"); 836 | return value.toString(); 837 | } 838 | 839 | set id(value: string) { 840 | this.set("id", Value.fromString(value)); 841 | } 842 | 843 | get draws(): Array { 844 | let value = this.get("draws"); 845 | return value.toStringArray(); 846 | } 847 | 848 | set draws(value: Array) { 849 | this.set("draws", Value.fromStringArray(value)); 850 | } 851 | 852 | get admins(): Array { 853 | let value = this.get("admins"); 854 | return value.toStringArray(); 855 | } 856 | 857 | set admins(value: Array) { 858 | this.set("admins", Value.fromStringArray(value)); 859 | } 860 | 861 | get players(): Array { 862 | let value = this.get("players"); 863 | return value.toStringArray(); 864 | } 865 | 866 | set players(value: Array) { 867 | this.set("players", Value.fromStringArray(value)); 868 | } 869 | 870 | get playersCount(): BigInt | null { 871 | let value = this.get("playersCount"); 872 | if (value === null) { 873 | return null; 874 | } else { 875 | return value.toBigInt(); 876 | } 877 | } 878 | 879 | set playersCount(value: BigInt | null) { 880 | if (value === null) { 881 | this.unset("playersCount"); 882 | } else { 883 | this.set("playersCount", Value.fromBigInt(value as BigInt)); 884 | } 885 | } 886 | 887 | get drawsCount(): BigInt | null { 888 | let value = this.get("drawsCount"); 889 | if (value === null) { 890 | return null; 891 | } else { 892 | return value.toBigInt(); 893 | } 894 | } 895 | 896 | set drawsCount(value: BigInt | null) { 897 | if (value === null) { 898 | this.unset("drawsCount"); 899 | } else { 900 | this.set("drawsCount", Value.fromBigInt(value as BigInt)); 901 | } 902 | } 903 | 904 | get openDrawId(): BigInt { 905 | let value = this.get("openDrawId"); 906 | return value.toBigInt(); 907 | } 908 | 909 | set openDrawId(value: BigInt) { 910 | this.set("openDrawId", Value.fromBigInt(value)); 911 | } 912 | 913 | get committedDrawId(): BigInt { 914 | let value = this.get("committedDrawId"); 915 | return value.toBigInt(); 916 | } 917 | 918 | set committedDrawId(value: BigInt) { 919 | this.set("committedDrawId", Value.fromBigInt(value)); 920 | } 921 | 922 | get paused(): boolean { 923 | let value = this.get("paused"); 924 | return value.toBoolean(); 925 | } 926 | 927 | set paused(value: boolean) { 928 | this.set("paused", Value.fromBoolean(value)); 929 | } 930 | 931 | get poolToken(): string | null { 932 | let value = this.get("poolToken"); 933 | if (value === null) { 934 | return null; 935 | } else { 936 | return value.toString(); 937 | } 938 | } 939 | 940 | set poolToken(value: string | null) { 941 | if (value === null) { 942 | this.unset("poolToken"); 943 | } else { 944 | this.set("poolToken", Value.fromString(value as string)); 945 | } 946 | } 947 | 948 | get openBalance(): BigInt { 949 | let value = this.get("openBalance"); 950 | return value.toBigInt(); 951 | } 952 | 953 | set openBalance(value: BigInt) { 954 | this.set("openBalance", Value.fromBigInt(value)); 955 | } 956 | 957 | get committedBalance(): BigInt { 958 | let value = this.get("committedBalance"); 959 | return value.toBigInt(); 960 | } 961 | 962 | set committedBalance(value: BigInt) { 963 | this.set("committedBalance", Value.fromBigInt(value)); 964 | } 965 | 966 | get sponsorshipAndFeeBalance(): BigInt { 967 | let value = this.get("sponsorshipAndFeeBalance"); 968 | return value.toBigInt(); 969 | } 970 | 971 | set sponsorshipAndFeeBalance(value: BigInt) { 972 | this.set("sponsorshipAndFeeBalance", Value.fromBigInt(value)); 973 | } 974 | 975 | get winnings(): BigInt { 976 | let value = this.get("winnings"); 977 | return value.toBigInt(); 978 | } 979 | 980 | set winnings(value: BigInt) { 981 | this.set("winnings", Value.fromBigInt(value)); 982 | } 983 | 984 | get version(): BigInt { 985 | let value = this.get("version"); 986 | return value.toBigInt(); 987 | } 988 | 989 | set version(value: BigInt) { 990 | this.set("version", Value.fromBigInt(value)); 991 | } 992 | } 993 | 994 | export class PoolTokenContract extends Entity { 995 | constructor(id: string) { 996 | super(); 997 | this.set("id", Value.fromString(id)); 998 | } 999 | 1000 | save(): void { 1001 | let id = this.get("id"); 1002 | assert(id !== null, "Cannot save PoolTokenContract entity without an ID"); 1003 | assert( 1004 | id.kind == ValueKind.STRING, 1005 | "Cannot save PoolTokenContract entity with non-string ID. " + 1006 | 'Considering using .toHex() to convert the "id" to a string.' 1007 | ); 1008 | store.set("PoolTokenContract", id.toString(), this); 1009 | } 1010 | 1011 | static load(id: string): PoolTokenContract | null { 1012 | return store.get("PoolTokenContract", id) as PoolTokenContract | null; 1013 | } 1014 | 1015 | get id(): string { 1016 | let value = this.get("id"); 1017 | return value.toString(); 1018 | } 1019 | 1020 | set id(value: string) { 1021 | this.set("id", Value.fromString(value)); 1022 | } 1023 | 1024 | get name(): string { 1025 | let value = this.get("name"); 1026 | return value.toString(); 1027 | } 1028 | 1029 | set name(value: string) { 1030 | this.set("name", Value.fromString(value)); 1031 | } 1032 | 1033 | get symbol(): string { 1034 | let value = this.get("symbol"); 1035 | return value.toString(); 1036 | } 1037 | 1038 | set symbol(value: string) { 1039 | this.set("symbol", Value.fromString(value)); 1040 | } 1041 | 1042 | get poolContract(): string { 1043 | let value = this.get("poolContract"); 1044 | return value.toString(); 1045 | } 1046 | 1047 | set poolContract(value: string) { 1048 | this.set("poolContract", Value.fromString(value)); 1049 | } 1050 | } 1051 | -------------------------------------------------------------------------------- /generated/PoolDai/PoolToken.ts: -------------------------------------------------------------------------------- 1 | // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | 3 | import { 4 | ethereum, 5 | JSONValue, 6 | TypedMap, 7 | Entity, 8 | Bytes, 9 | Address, 10 | BigInt 11 | } from "@graphprotocol/graph-ts"; 12 | 13 | export class Approval extends ethereum.Event { 14 | get params(): Approval__Params { 15 | return new Approval__Params(this); 16 | } 17 | } 18 | 19 | export class Approval__Params { 20 | _event: Approval; 21 | 22 | constructor(event: Approval) { 23 | this._event = event; 24 | } 25 | 26 | get owner(): Address { 27 | return this._event.parameters[0].value.toAddress(); 28 | } 29 | 30 | get spender(): Address { 31 | return this._event.parameters[1].value.toAddress(); 32 | } 33 | 34 | get value(): BigInt { 35 | return this._event.parameters[2].value.toBigInt(); 36 | } 37 | } 38 | 39 | export class AuthorizedOperator extends ethereum.Event { 40 | get params(): AuthorizedOperator__Params { 41 | return new AuthorizedOperator__Params(this); 42 | } 43 | } 44 | 45 | export class AuthorizedOperator__Params { 46 | _event: AuthorizedOperator; 47 | 48 | constructor(event: AuthorizedOperator) { 49 | this._event = event; 50 | } 51 | 52 | get operator(): Address { 53 | return this._event.parameters[0].value.toAddress(); 54 | } 55 | 56 | get tokenHolder(): Address { 57 | return this._event.parameters[1].value.toAddress(); 58 | } 59 | } 60 | 61 | export class Burned extends ethereum.Event { 62 | get params(): Burned__Params { 63 | return new Burned__Params(this); 64 | } 65 | } 66 | 67 | export class Burned__Params { 68 | _event: Burned; 69 | 70 | constructor(event: Burned) { 71 | this._event = event; 72 | } 73 | 74 | get operator(): Address { 75 | return this._event.parameters[0].value.toAddress(); 76 | } 77 | 78 | get from(): Address { 79 | return this._event.parameters[1].value.toAddress(); 80 | } 81 | 82 | get amount(): BigInt { 83 | return this._event.parameters[2].value.toBigInt(); 84 | } 85 | 86 | get data(): Bytes { 87 | return this._event.parameters[3].value.toBytes(); 88 | } 89 | 90 | get operatorData(): Bytes { 91 | return this._event.parameters[4].value.toBytes(); 92 | } 93 | } 94 | 95 | export class Minted extends ethereum.Event { 96 | get params(): Minted__Params { 97 | return new Minted__Params(this); 98 | } 99 | } 100 | 101 | export class Minted__Params { 102 | _event: Minted; 103 | 104 | constructor(event: Minted) { 105 | this._event = event; 106 | } 107 | 108 | get operator(): Address { 109 | return this._event.parameters[0].value.toAddress(); 110 | } 111 | 112 | get to(): Address { 113 | return this._event.parameters[1].value.toAddress(); 114 | } 115 | 116 | get amount(): BigInt { 117 | return this._event.parameters[2].value.toBigInt(); 118 | } 119 | 120 | get data(): Bytes { 121 | return this._event.parameters[3].value.toBytes(); 122 | } 123 | 124 | get operatorData(): Bytes { 125 | return this._event.parameters[4].value.toBytes(); 126 | } 127 | } 128 | 129 | export class Redeemed extends ethereum.Event { 130 | get params(): Redeemed__Params { 131 | return new Redeemed__Params(this); 132 | } 133 | } 134 | 135 | export class Redeemed__Params { 136 | _event: Redeemed; 137 | 138 | constructor(event: Redeemed) { 139 | this._event = event; 140 | } 141 | 142 | get operator(): Address { 143 | return this._event.parameters[0].value.toAddress(); 144 | } 145 | 146 | get from(): Address { 147 | return this._event.parameters[1].value.toAddress(); 148 | } 149 | 150 | get amount(): BigInt { 151 | return this._event.parameters[2].value.toBigInt(); 152 | } 153 | 154 | get data(): Bytes { 155 | return this._event.parameters[3].value.toBytes(); 156 | } 157 | 158 | get operatorData(): Bytes { 159 | return this._event.parameters[4].value.toBytes(); 160 | } 161 | } 162 | 163 | export class RevokedOperator extends ethereum.Event { 164 | get params(): RevokedOperator__Params { 165 | return new RevokedOperator__Params(this); 166 | } 167 | } 168 | 169 | export class RevokedOperator__Params { 170 | _event: RevokedOperator; 171 | 172 | constructor(event: RevokedOperator) { 173 | this._event = event; 174 | } 175 | 176 | get operator(): Address { 177 | return this._event.parameters[0].value.toAddress(); 178 | } 179 | 180 | get tokenHolder(): Address { 181 | return this._event.parameters[1].value.toAddress(); 182 | } 183 | } 184 | 185 | export class Sent extends ethereum.Event { 186 | get params(): Sent__Params { 187 | return new Sent__Params(this); 188 | } 189 | } 190 | 191 | export class Sent__Params { 192 | _event: Sent; 193 | 194 | constructor(event: Sent) { 195 | this._event = event; 196 | } 197 | 198 | get operator(): Address { 199 | return this._event.parameters[0].value.toAddress(); 200 | } 201 | 202 | get from(): Address { 203 | return this._event.parameters[1].value.toAddress(); 204 | } 205 | 206 | get to(): Address { 207 | return this._event.parameters[2].value.toAddress(); 208 | } 209 | 210 | get amount(): BigInt { 211 | return this._event.parameters[3].value.toBigInt(); 212 | } 213 | 214 | get data(): Bytes { 215 | return this._event.parameters[4].value.toBytes(); 216 | } 217 | 218 | get operatorData(): Bytes { 219 | return this._event.parameters[5].value.toBytes(); 220 | } 221 | } 222 | 223 | export class Transfer extends ethereum.Event { 224 | get params(): Transfer__Params { 225 | return new Transfer__Params(this); 226 | } 227 | } 228 | 229 | export class Transfer__Params { 230 | _event: Transfer; 231 | 232 | constructor(event: Transfer) { 233 | this._event = event; 234 | } 235 | 236 | get from(): Address { 237 | return this._event.parameters[0].value.toAddress(); 238 | } 239 | 240 | get to(): Address { 241 | return this._event.parameters[1].value.toAddress(); 242 | } 243 | 244 | get value(): BigInt { 245 | return this._event.parameters[2].value.toBigInt(); 246 | } 247 | } 248 | 249 | export class PoolToken extends ethereum.SmartContract { 250 | static bind(address: Address): PoolToken { 251 | return new PoolToken("PoolToken", address); 252 | } 253 | 254 | allowance(holder: Address, spender: Address): BigInt { 255 | let result = super.call( 256 | "allowance", 257 | "allowance(address,address):(uint256)", 258 | [ethereum.Value.fromAddress(holder), ethereum.Value.fromAddress(spender)] 259 | ); 260 | 261 | return result[0].toBigInt(); 262 | } 263 | 264 | try_allowance( 265 | holder: Address, 266 | spender: Address 267 | ): ethereum.CallResult { 268 | let result = super.tryCall( 269 | "allowance", 270 | "allowance(address,address):(uint256)", 271 | [ethereum.Value.fromAddress(holder), ethereum.Value.fromAddress(spender)] 272 | ); 273 | if (result.reverted) { 274 | return new ethereum.CallResult(); 275 | } 276 | let value = result.value; 277 | return ethereum.CallResult.fromValue(value[0].toBigInt()); 278 | } 279 | 280 | approve(spender: Address, value: BigInt): boolean { 281 | let result = super.call("approve", "approve(address,uint256):(bool)", [ 282 | ethereum.Value.fromAddress(spender), 283 | ethereum.Value.fromUnsignedBigInt(value) 284 | ]); 285 | 286 | return result[0].toBoolean(); 287 | } 288 | 289 | try_approve(spender: Address, value: BigInt): ethereum.CallResult { 290 | let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ 291 | ethereum.Value.fromAddress(spender), 292 | ethereum.Value.fromUnsignedBigInt(value) 293 | ]); 294 | if (result.reverted) { 295 | return new ethereum.CallResult(); 296 | } 297 | let value = result.value; 298 | return ethereum.CallResult.fromValue(value[0].toBoolean()); 299 | } 300 | 301 | balanceOf(_addr: Address): BigInt { 302 | let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ 303 | ethereum.Value.fromAddress(_addr) 304 | ]); 305 | 306 | return result[0].toBigInt(); 307 | } 308 | 309 | try_balanceOf(_addr: Address): ethereum.CallResult { 310 | let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ 311 | ethereum.Value.fromAddress(_addr) 312 | ]); 313 | if (result.reverted) { 314 | return new ethereum.CallResult(); 315 | } 316 | let value = result.value; 317 | return ethereum.CallResult.fromValue(value[0].toBigInt()); 318 | } 319 | 320 | decimals(): i32 { 321 | let result = super.call("decimals", "decimals():(uint8)", []); 322 | 323 | return result[0].toI32(); 324 | } 325 | 326 | try_decimals(): ethereum.CallResult { 327 | let result = super.tryCall("decimals", "decimals():(uint8)", []); 328 | if (result.reverted) { 329 | return new ethereum.CallResult(); 330 | } 331 | let value = result.value; 332 | return ethereum.CallResult.fromValue(value[0].toI32()); 333 | } 334 | 335 | defaultOperators(): Array
{ 336 | let result = super.call( 337 | "defaultOperators", 338 | "defaultOperators():(address[])", 339 | [] 340 | ); 341 | 342 | return result[0].toAddressArray(); 343 | } 344 | 345 | try_defaultOperators(): ethereum.CallResult> { 346 | let result = super.tryCall( 347 | "defaultOperators", 348 | "defaultOperators():(address[])", 349 | [] 350 | ); 351 | if (result.reverted) { 352 | return new ethereum.CallResult(); 353 | } 354 | let value = result.value; 355 | return ethereum.CallResult.fromValue(value[0].toAddressArray()); 356 | } 357 | 358 | granularity(): BigInt { 359 | let result = super.call("granularity", "granularity():(uint256)", []); 360 | 361 | return result[0].toBigInt(); 362 | } 363 | 364 | try_granularity(): ethereum.CallResult { 365 | let result = super.tryCall("granularity", "granularity():(uint256)", []); 366 | if (result.reverted) { 367 | return new ethereum.CallResult(); 368 | } 369 | let value = result.value; 370 | return ethereum.CallResult.fromValue(value[0].toBigInt()); 371 | } 372 | 373 | isOperatorFor(operator: Address, tokenHolder: Address): boolean { 374 | let result = super.call( 375 | "isOperatorFor", 376 | "isOperatorFor(address,address):(bool)", 377 | [ 378 | ethereum.Value.fromAddress(operator), 379 | ethereum.Value.fromAddress(tokenHolder) 380 | ] 381 | ); 382 | 383 | return result[0].toBoolean(); 384 | } 385 | 386 | try_isOperatorFor( 387 | operator: Address, 388 | tokenHolder: Address 389 | ): ethereum.CallResult { 390 | let result = super.tryCall( 391 | "isOperatorFor", 392 | "isOperatorFor(address,address):(bool)", 393 | [ 394 | ethereum.Value.fromAddress(operator), 395 | ethereum.Value.fromAddress(tokenHolder) 396 | ] 397 | ); 398 | if (result.reverted) { 399 | return new ethereum.CallResult(); 400 | } 401 | let value = result.value; 402 | return ethereum.CallResult.fromValue(value[0].toBoolean()); 403 | } 404 | 405 | name(): string { 406 | let result = super.call("name", "name():(string)", []); 407 | 408 | return result[0].toString(); 409 | } 410 | 411 | try_name(): ethereum.CallResult { 412 | let result = super.tryCall("name", "name():(string)", []); 413 | if (result.reverted) { 414 | return new ethereum.CallResult(); 415 | } 416 | let value = result.value; 417 | return ethereum.CallResult.fromValue(value[0].toString()); 418 | } 419 | 420 | pool(): Address { 421 | let result = super.call("pool", "pool():(address)", []); 422 | 423 | return result[0].toAddress(); 424 | } 425 | 426 | try_pool(): ethereum.CallResult
{ 427 | let result = super.tryCall("pool", "pool():(address)", []); 428 | if (result.reverted) { 429 | return new ethereum.CallResult(); 430 | } 431 | let value = result.value; 432 | return ethereum.CallResult.fromValue(value[0].toAddress()); 433 | } 434 | 435 | symbol(): string { 436 | let result = super.call("symbol", "symbol():(string)", []); 437 | 438 | return result[0].toString(); 439 | } 440 | 441 | try_symbol(): ethereum.CallResult { 442 | let result = super.tryCall("symbol", "symbol():(string)", []); 443 | if (result.reverted) { 444 | return new ethereum.CallResult(); 445 | } 446 | let value = result.value; 447 | return ethereum.CallResult.fromValue(value[0].toString()); 448 | } 449 | 450 | totalSupply(): BigInt { 451 | let result = super.call("totalSupply", "totalSupply():(uint256)", []); 452 | 453 | return result[0].toBigInt(); 454 | } 455 | 456 | try_totalSupply(): ethereum.CallResult { 457 | let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); 458 | if (result.reverted) { 459 | return new ethereum.CallResult(); 460 | } 461 | let value = result.value; 462 | return ethereum.CallResult.fromValue(value[0].toBigInt()); 463 | } 464 | 465 | transfer(recipient: Address, amount: BigInt): boolean { 466 | let result = super.call("transfer", "transfer(address,uint256):(bool)", [ 467 | ethereum.Value.fromAddress(recipient), 468 | ethereum.Value.fromUnsignedBigInt(amount) 469 | ]); 470 | 471 | return result[0].toBoolean(); 472 | } 473 | 474 | try_transfer( 475 | recipient: Address, 476 | amount: BigInt 477 | ): ethereum.CallResult { 478 | let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ 479 | ethereum.Value.fromAddress(recipient), 480 | ethereum.Value.fromUnsignedBigInt(amount) 481 | ]); 482 | if (result.reverted) { 483 | return new ethereum.CallResult(); 484 | } 485 | let value = result.value; 486 | return ethereum.CallResult.fromValue(value[0].toBoolean()); 487 | } 488 | 489 | transferFrom(holder: Address, recipient: Address, amount: BigInt): boolean { 490 | let result = super.call( 491 | "transferFrom", 492 | "transferFrom(address,address,uint256):(bool)", 493 | [ 494 | ethereum.Value.fromAddress(holder), 495 | ethereum.Value.fromAddress(recipient), 496 | ethereum.Value.fromUnsignedBigInt(amount) 497 | ] 498 | ); 499 | 500 | return result[0].toBoolean(); 501 | } 502 | 503 | try_transferFrom( 504 | holder: Address, 505 | recipient: Address, 506 | amount: BigInt 507 | ): ethereum.CallResult { 508 | let result = super.tryCall( 509 | "transferFrom", 510 | "transferFrom(address,address,uint256):(bool)", 511 | [ 512 | ethereum.Value.fromAddress(holder), 513 | ethereum.Value.fromAddress(recipient), 514 | ethereum.Value.fromUnsignedBigInt(amount) 515 | ] 516 | ); 517 | if (result.reverted) { 518 | return new ethereum.CallResult(); 519 | } 520 | let value = result.value; 521 | return ethereum.CallResult.fromValue(value[0].toBoolean()); 522 | } 523 | 524 | recipientWhitelistEnabled(): boolean { 525 | let result = super.call( 526 | "recipientWhitelistEnabled", 527 | "recipientWhitelistEnabled():(bool)", 528 | [] 529 | ); 530 | 531 | return result[0].toBoolean(); 532 | } 533 | 534 | try_recipientWhitelistEnabled(): ethereum.CallResult { 535 | let result = super.tryCall( 536 | "recipientWhitelistEnabled", 537 | "recipientWhitelistEnabled():(bool)", 538 | [] 539 | ); 540 | if (result.reverted) { 541 | return new ethereum.CallResult(); 542 | } 543 | let value = result.value; 544 | return ethereum.CallResult.fromValue(value[0].toBoolean()); 545 | } 546 | 547 | recipientWhitelisted(_recipient: Address): boolean { 548 | let result = super.call( 549 | "recipientWhitelisted", 550 | "recipientWhitelisted(address):(bool)", 551 | [ethereum.Value.fromAddress(_recipient)] 552 | ); 553 | 554 | return result[0].toBoolean(); 555 | } 556 | 557 | try_recipientWhitelisted(_recipient: Address): ethereum.CallResult { 558 | let result = super.tryCall( 559 | "recipientWhitelisted", 560 | "recipientWhitelisted(address):(bool)", 561 | [ethereum.Value.fromAddress(_recipient)] 562 | ); 563 | if (result.reverted) { 564 | return new ethereum.CallResult(); 565 | } 566 | let value = result.value; 567 | return ethereum.CallResult.fromValue(value[0].toBoolean()); 568 | } 569 | } 570 | 571 | export class ApproveCall extends ethereum.Call { 572 | get inputs(): ApproveCall__Inputs { 573 | return new ApproveCall__Inputs(this); 574 | } 575 | 576 | get outputs(): ApproveCall__Outputs { 577 | return new ApproveCall__Outputs(this); 578 | } 579 | } 580 | 581 | export class ApproveCall__Inputs { 582 | _call: ApproveCall; 583 | 584 | constructor(call: ApproveCall) { 585 | this._call = call; 586 | } 587 | 588 | get spender(): Address { 589 | return this._call.inputValues[0].value.toAddress(); 590 | } 591 | 592 | get value(): BigInt { 593 | return this._call.inputValues[1].value.toBigInt(); 594 | } 595 | } 596 | 597 | export class ApproveCall__Outputs { 598 | _call: ApproveCall; 599 | 600 | constructor(call: ApproveCall) { 601 | this._call = call; 602 | } 603 | 604 | get value0(): boolean { 605 | return this._call.outputValues[0].value.toBoolean(); 606 | } 607 | } 608 | 609 | export class AuthorizeOperatorCall extends ethereum.Call { 610 | get inputs(): AuthorizeOperatorCall__Inputs { 611 | return new AuthorizeOperatorCall__Inputs(this); 612 | } 613 | 614 | get outputs(): AuthorizeOperatorCall__Outputs { 615 | return new AuthorizeOperatorCall__Outputs(this); 616 | } 617 | } 618 | 619 | export class AuthorizeOperatorCall__Inputs { 620 | _call: AuthorizeOperatorCall; 621 | 622 | constructor(call: AuthorizeOperatorCall) { 623 | this._call = call; 624 | } 625 | 626 | get operator(): Address { 627 | return this._call.inputValues[0].value.toAddress(); 628 | } 629 | } 630 | 631 | export class AuthorizeOperatorCall__Outputs { 632 | _call: AuthorizeOperatorCall; 633 | 634 | constructor(call: AuthorizeOperatorCall) { 635 | this._call = call; 636 | } 637 | } 638 | 639 | export class BurnCall extends ethereum.Call { 640 | get inputs(): BurnCall__Inputs { 641 | return new BurnCall__Inputs(this); 642 | } 643 | 644 | get outputs(): BurnCall__Outputs { 645 | return new BurnCall__Outputs(this); 646 | } 647 | } 648 | 649 | export class BurnCall__Inputs { 650 | _call: BurnCall; 651 | 652 | constructor(call: BurnCall) { 653 | this._call = call; 654 | } 655 | 656 | get value0(): BigInt { 657 | return this._call.inputValues[0].value.toBigInt(); 658 | } 659 | 660 | get value1(): Bytes { 661 | return this._call.inputValues[1].value.toBytes(); 662 | } 663 | } 664 | 665 | export class BurnCall__Outputs { 666 | _call: BurnCall; 667 | 668 | constructor(call: BurnCall) { 669 | this._call = call; 670 | } 671 | } 672 | 673 | export class InitCall extends ethereum.Call { 674 | get inputs(): InitCall__Inputs { 675 | return new InitCall__Inputs(this); 676 | } 677 | 678 | get outputs(): InitCall__Outputs { 679 | return new InitCall__Outputs(this); 680 | } 681 | } 682 | 683 | export class InitCall__Inputs { 684 | _call: InitCall; 685 | 686 | constructor(call: InitCall) { 687 | this._call = call; 688 | } 689 | 690 | get name(): string { 691 | return this._call.inputValues[0].value.toString(); 692 | } 693 | 694 | get symbol(): string { 695 | return this._call.inputValues[1].value.toString(); 696 | } 697 | 698 | get defaultOperators(): Array
{ 699 | return this._call.inputValues[2].value.toAddressArray(); 700 | } 701 | 702 | get pool(): Address { 703 | return this._call.inputValues[3].value.toAddress(); 704 | } 705 | } 706 | 707 | export class InitCall__Outputs { 708 | _call: InitCall; 709 | 710 | constructor(call: InitCall) { 711 | this._call = call; 712 | } 713 | } 714 | 715 | export class OperatorBurnCall extends ethereum.Call { 716 | get inputs(): OperatorBurnCall__Inputs { 717 | return new OperatorBurnCall__Inputs(this); 718 | } 719 | 720 | get outputs(): OperatorBurnCall__Outputs { 721 | return new OperatorBurnCall__Outputs(this); 722 | } 723 | } 724 | 725 | export class OperatorBurnCall__Inputs { 726 | _call: OperatorBurnCall; 727 | 728 | constructor(call: OperatorBurnCall) { 729 | this._call = call; 730 | } 731 | 732 | get value0(): Address { 733 | return this._call.inputValues[0].value.toAddress(); 734 | } 735 | 736 | get value1(): BigInt { 737 | return this._call.inputValues[1].value.toBigInt(); 738 | } 739 | 740 | get value2(): Bytes { 741 | return this._call.inputValues[2].value.toBytes(); 742 | } 743 | 744 | get value3(): Bytes { 745 | return this._call.inputValues[3].value.toBytes(); 746 | } 747 | } 748 | 749 | export class OperatorBurnCall__Outputs { 750 | _call: OperatorBurnCall; 751 | 752 | constructor(call: OperatorBurnCall) { 753 | this._call = call; 754 | } 755 | } 756 | 757 | export class OperatorRedeemCall extends ethereum.Call { 758 | get inputs(): OperatorRedeemCall__Inputs { 759 | return new OperatorRedeemCall__Inputs(this); 760 | } 761 | 762 | get outputs(): OperatorRedeemCall__Outputs { 763 | return new OperatorRedeemCall__Outputs(this); 764 | } 765 | } 766 | 767 | export class OperatorRedeemCall__Inputs { 768 | _call: OperatorRedeemCall; 769 | 770 | constructor(call: OperatorRedeemCall) { 771 | this._call = call; 772 | } 773 | 774 | get account(): Address { 775 | return this._call.inputValues[0].value.toAddress(); 776 | } 777 | 778 | get amount(): BigInt { 779 | return this._call.inputValues[1].value.toBigInt(); 780 | } 781 | 782 | get data(): Bytes { 783 | return this._call.inputValues[2].value.toBytes(); 784 | } 785 | 786 | get operatorData(): Bytes { 787 | return this._call.inputValues[3].value.toBytes(); 788 | } 789 | } 790 | 791 | export class OperatorRedeemCall__Outputs { 792 | _call: OperatorRedeemCall; 793 | 794 | constructor(call: OperatorRedeemCall) { 795 | this._call = call; 796 | } 797 | } 798 | 799 | export class OperatorSendCall extends ethereum.Call { 800 | get inputs(): OperatorSendCall__Inputs { 801 | return new OperatorSendCall__Inputs(this); 802 | } 803 | 804 | get outputs(): OperatorSendCall__Outputs { 805 | return new OperatorSendCall__Outputs(this); 806 | } 807 | } 808 | 809 | export class OperatorSendCall__Inputs { 810 | _call: OperatorSendCall; 811 | 812 | constructor(call: OperatorSendCall) { 813 | this._call = call; 814 | } 815 | 816 | get sender(): Address { 817 | return this._call.inputValues[0].value.toAddress(); 818 | } 819 | 820 | get recipient(): Address { 821 | return this._call.inputValues[1].value.toAddress(); 822 | } 823 | 824 | get amount(): BigInt { 825 | return this._call.inputValues[2].value.toBigInt(); 826 | } 827 | 828 | get data(): Bytes { 829 | return this._call.inputValues[3].value.toBytes(); 830 | } 831 | 832 | get operatorData(): Bytes { 833 | return this._call.inputValues[4].value.toBytes(); 834 | } 835 | } 836 | 837 | export class OperatorSendCall__Outputs { 838 | _call: OperatorSendCall; 839 | 840 | constructor(call: OperatorSendCall) { 841 | this._call = call; 842 | } 843 | } 844 | 845 | export class PoolMintCall extends ethereum.Call { 846 | get inputs(): PoolMintCall__Inputs { 847 | return new PoolMintCall__Inputs(this); 848 | } 849 | 850 | get outputs(): PoolMintCall__Outputs { 851 | return new PoolMintCall__Outputs(this); 852 | } 853 | } 854 | 855 | export class PoolMintCall__Inputs { 856 | _call: PoolMintCall; 857 | 858 | constructor(call: PoolMintCall) { 859 | this._call = call; 860 | } 861 | 862 | get amount(): BigInt { 863 | return this._call.inputValues[0].value.toBigInt(); 864 | } 865 | } 866 | 867 | export class PoolMintCall__Outputs { 868 | _call: PoolMintCall; 869 | 870 | constructor(call: PoolMintCall) { 871 | this._call = call; 872 | } 873 | } 874 | 875 | export class PoolRedeemCall extends ethereum.Call { 876 | get inputs(): PoolRedeemCall__Inputs { 877 | return new PoolRedeemCall__Inputs(this); 878 | } 879 | 880 | get outputs(): PoolRedeemCall__Outputs { 881 | return new PoolRedeemCall__Outputs(this); 882 | } 883 | } 884 | 885 | export class PoolRedeemCall__Inputs { 886 | _call: PoolRedeemCall; 887 | 888 | constructor(call: PoolRedeemCall) { 889 | this._call = call; 890 | } 891 | 892 | get from(): Address { 893 | return this._call.inputValues[0].value.toAddress(); 894 | } 895 | 896 | get amount(): BigInt { 897 | return this._call.inputValues[1].value.toBigInt(); 898 | } 899 | } 900 | 901 | export class PoolRedeemCall__Outputs { 902 | _call: PoolRedeemCall; 903 | 904 | constructor(call: PoolRedeemCall) { 905 | this._call = call; 906 | } 907 | } 908 | 909 | export class RedeemCall extends ethereum.Call { 910 | get inputs(): RedeemCall__Inputs { 911 | return new RedeemCall__Inputs(this); 912 | } 913 | 914 | get outputs(): RedeemCall__Outputs { 915 | return new RedeemCall__Outputs(this); 916 | } 917 | } 918 | 919 | export class RedeemCall__Inputs { 920 | _call: RedeemCall; 921 | 922 | constructor(call: RedeemCall) { 923 | this._call = call; 924 | } 925 | 926 | get amount(): BigInt { 927 | return this._call.inputValues[0].value.toBigInt(); 928 | } 929 | 930 | get data(): Bytes { 931 | return this._call.inputValues[1].value.toBytes(); 932 | } 933 | } 934 | 935 | export class RedeemCall__Outputs { 936 | _call: RedeemCall; 937 | 938 | constructor(call: RedeemCall) { 939 | this._call = call; 940 | } 941 | } 942 | 943 | export class RevokeOperatorCall extends ethereum.Call { 944 | get inputs(): RevokeOperatorCall__Inputs { 945 | return new RevokeOperatorCall__Inputs(this); 946 | } 947 | 948 | get outputs(): RevokeOperatorCall__Outputs { 949 | return new RevokeOperatorCall__Outputs(this); 950 | } 951 | } 952 | 953 | export class RevokeOperatorCall__Inputs { 954 | _call: RevokeOperatorCall; 955 | 956 | constructor(call: RevokeOperatorCall) { 957 | this._call = call; 958 | } 959 | 960 | get operator(): Address { 961 | return this._call.inputValues[0].value.toAddress(); 962 | } 963 | } 964 | 965 | export class RevokeOperatorCall__Outputs { 966 | _call: RevokeOperatorCall; 967 | 968 | constructor(call: RevokeOperatorCall) { 969 | this._call = call; 970 | } 971 | } 972 | 973 | export class SendCall extends ethereum.Call { 974 | get inputs(): SendCall__Inputs { 975 | return new SendCall__Inputs(this); 976 | } 977 | 978 | get outputs(): SendCall__Outputs { 979 | return new SendCall__Outputs(this); 980 | } 981 | } 982 | 983 | export class SendCall__Inputs { 984 | _call: SendCall; 985 | 986 | constructor(call: SendCall) { 987 | this._call = call; 988 | } 989 | 990 | get recipient(): Address { 991 | return this._call.inputValues[0].value.toAddress(); 992 | } 993 | 994 | get amount(): BigInt { 995 | return this._call.inputValues[1].value.toBigInt(); 996 | } 997 | 998 | get data(): Bytes { 999 | return this._call.inputValues[2].value.toBytes(); 1000 | } 1001 | } 1002 | 1003 | export class SendCall__Outputs { 1004 | _call: SendCall; 1005 | 1006 | constructor(call: SendCall) { 1007 | this._call = call; 1008 | } 1009 | } 1010 | 1011 | export class TransferCall extends ethereum.Call { 1012 | get inputs(): TransferCall__Inputs { 1013 | return new TransferCall__Inputs(this); 1014 | } 1015 | 1016 | get outputs(): TransferCall__Outputs { 1017 | return new TransferCall__Outputs(this); 1018 | } 1019 | } 1020 | 1021 | export class TransferCall__Inputs { 1022 | _call: TransferCall; 1023 | 1024 | constructor(call: TransferCall) { 1025 | this._call = call; 1026 | } 1027 | 1028 | get recipient(): Address { 1029 | return this._call.inputValues[0].value.toAddress(); 1030 | } 1031 | 1032 | get amount(): BigInt { 1033 | return this._call.inputValues[1].value.toBigInt(); 1034 | } 1035 | } 1036 | 1037 | export class TransferCall__Outputs { 1038 | _call: TransferCall; 1039 | 1040 | constructor(call: TransferCall) { 1041 | this._call = call; 1042 | } 1043 | 1044 | get value0(): boolean { 1045 | return this._call.outputValues[0].value.toBoolean(); 1046 | } 1047 | } 1048 | 1049 | export class TransferFromCall extends ethereum.Call { 1050 | get inputs(): TransferFromCall__Inputs { 1051 | return new TransferFromCall__Inputs(this); 1052 | } 1053 | 1054 | get outputs(): TransferFromCall__Outputs { 1055 | return new TransferFromCall__Outputs(this); 1056 | } 1057 | } 1058 | 1059 | export class TransferFromCall__Inputs { 1060 | _call: TransferFromCall; 1061 | 1062 | constructor(call: TransferFromCall) { 1063 | this._call = call; 1064 | } 1065 | 1066 | get holder(): Address { 1067 | return this._call.inputValues[0].value.toAddress(); 1068 | } 1069 | 1070 | get recipient(): Address { 1071 | return this._call.inputValues[1].value.toAddress(); 1072 | } 1073 | 1074 | get amount(): BigInt { 1075 | return this._call.inputValues[2].value.toBigInt(); 1076 | } 1077 | } 1078 | 1079 | export class TransferFromCall__Outputs { 1080 | _call: TransferFromCall; 1081 | 1082 | constructor(call: TransferFromCall) { 1083 | this._call = call; 1084 | } 1085 | 1086 | get value0(): boolean { 1087 | return this._call.outputValues[0].value.toBoolean(); 1088 | } 1089 | } 1090 | 1091 | export class SetRecipientWhitelistEnabledCall extends ethereum.Call { 1092 | get inputs(): SetRecipientWhitelistEnabledCall__Inputs { 1093 | return new SetRecipientWhitelistEnabledCall__Inputs(this); 1094 | } 1095 | 1096 | get outputs(): SetRecipientWhitelistEnabledCall__Outputs { 1097 | return new SetRecipientWhitelistEnabledCall__Outputs(this); 1098 | } 1099 | } 1100 | 1101 | export class SetRecipientWhitelistEnabledCall__Inputs { 1102 | _call: SetRecipientWhitelistEnabledCall; 1103 | 1104 | constructor(call: SetRecipientWhitelistEnabledCall) { 1105 | this._call = call; 1106 | } 1107 | 1108 | get _enabled(): boolean { 1109 | return this._call.inputValues[0].value.toBoolean(); 1110 | } 1111 | } 1112 | 1113 | export class SetRecipientWhitelistEnabledCall__Outputs { 1114 | _call: SetRecipientWhitelistEnabledCall; 1115 | 1116 | constructor(call: SetRecipientWhitelistEnabledCall) { 1117 | this._call = call; 1118 | } 1119 | } 1120 | 1121 | export class SetRecipientWhitelistedCall extends ethereum.Call { 1122 | get inputs(): SetRecipientWhitelistedCall__Inputs { 1123 | return new SetRecipientWhitelistedCall__Inputs(this); 1124 | } 1125 | 1126 | get outputs(): SetRecipientWhitelistedCall__Outputs { 1127 | return new SetRecipientWhitelistedCall__Outputs(this); 1128 | } 1129 | } 1130 | 1131 | export class SetRecipientWhitelistedCall__Inputs { 1132 | _call: SetRecipientWhitelistedCall; 1133 | 1134 | constructor(call: SetRecipientWhitelistedCall) { 1135 | this._call = call; 1136 | } 1137 | 1138 | get _recipient(): Address { 1139 | return this._call.inputValues[0].value.toAddress(); 1140 | } 1141 | 1142 | get _whitelisted(): boolean { 1143 | return this._call.inputValues[1].value.toBoolean(); 1144 | } 1145 | } 1146 | 1147 | export class SetRecipientWhitelistedCall__Outputs { 1148 | _call: SetRecipientWhitelistedCall; 1149 | 1150 | constructor(call: SetRecipientWhitelistedCall) { 1151 | this._call = call; 1152 | } 1153 | } 1154 | -------------------------------------------------------------------------------- /generated/PoolSai/PoolToken.ts: -------------------------------------------------------------------------------- 1 | // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | 3 | import { 4 | ethereum, 5 | JSONValue, 6 | TypedMap, 7 | Entity, 8 | Bytes, 9 | Address, 10 | BigInt 11 | } from "@graphprotocol/graph-ts"; 12 | 13 | export class Approval extends ethereum.Event { 14 | get params(): Approval__Params { 15 | return new Approval__Params(this); 16 | } 17 | } 18 | 19 | export class Approval__Params { 20 | _event: Approval; 21 | 22 | constructor(event: Approval) { 23 | this._event = event; 24 | } 25 | 26 | get owner(): Address { 27 | return this._event.parameters[0].value.toAddress(); 28 | } 29 | 30 | get spender(): Address { 31 | return this._event.parameters[1].value.toAddress(); 32 | } 33 | 34 | get value(): BigInt { 35 | return this._event.parameters[2].value.toBigInt(); 36 | } 37 | } 38 | 39 | export class AuthorizedOperator extends ethereum.Event { 40 | get params(): AuthorizedOperator__Params { 41 | return new AuthorizedOperator__Params(this); 42 | } 43 | } 44 | 45 | export class AuthorizedOperator__Params { 46 | _event: AuthorizedOperator; 47 | 48 | constructor(event: AuthorizedOperator) { 49 | this._event = event; 50 | } 51 | 52 | get operator(): Address { 53 | return this._event.parameters[0].value.toAddress(); 54 | } 55 | 56 | get tokenHolder(): Address { 57 | return this._event.parameters[1].value.toAddress(); 58 | } 59 | } 60 | 61 | export class Burned extends ethereum.Event { 62 | get params(): Burned__Params { 63 | return new Burned__Params(this); 64 | } 65 | } 66 | 67 | export class Burned__Params { 68 | _event: Burned; 69 | 70 | constructor(event: Burned) { 71 | this._event = event; 72 | } 73 | 74 | get operator(): Address { 75 | return this._event.parameters[0].value.toAddress(); 76 | } 77 | 78 | get from(): Address { 79 | return this._event.parameters[1].value.toAddress(); 80 | } 81 | 82 | get amount(): BigInt { 83 | return this._event.parameters[2].value.toBigInt(); 84 | } 85 | 86 | get data(): Bytes { 87 | return this._event.parameters[3].value.toBytes(); 88 | } 89 | 90 | get operatorData(): Bytes { 91 | return this._event.parameters[4].value.toBytes(); 92 | } 93 | } 94 | 95 | export class Minted extends ethereum.Event { 96 | get params(): Minted__Params { 97 | return new Minted__Params(this); 98 | } 99 | } 100 | 101 | export class Minted__Params { 102 | _event: Minted; 103 | 104 | constructor(event: Minted) { 105 | this._event = event; 106 | } 107 | 108 | get operator(): Address { 109 | return this._event.parameters[0].value.toAddress(); 110 | } 111 | 112 | get to(): Address { 113 | return this._event.parameters[1].value.toAddress(); 114 | } 115 | 116 | get amount(): BigInt { 117 | return this._event.parameters[2].value.toBigInt(); 118 | } 119 | 120 | get data(): Bytes { 121 | return this._event.parameters[3].value.toBytes(); 122 | } 123 | 124 | get operatorData(): Bytes { 125 | return this._event.parameters[4].value.toBytes(); 126 | } 127 | } 128 | 129 | export class Redeemed extends ethereum.Event { 130 | get params(): Redeemed__Params { 131 | return new Redeemed__Params(this); 132 | } 133 | } 134 | 135 | export class Redeemed__Params { 136 | _event: Redeemed; 137 | 138 | constructor(event: Redeemed) { 139 | this._event = event; 140 | } 141 | 142 | get operator(): Address { 143 | return this._event.parameters[0].value.toAddress(); 144 | } 145 | 146 | get from(): Address { 147 | return this._event.parameters[1].value.toAddress(); 148 | } 149 | 150 | get amount(): BigInt { 151 | return this._event.parameters[2].value.toBigInt(); 152 | } 153 | 154 | get data(): Bytes { 155 | return this._event.parameters[3].value.toBytes(); 156 | } 157 | 158 | get operatorData(): Bytes { 159 | return this._event.parameters[4].value.toBytes(); 160 | } 161 | } 162 | 163 | export class RevokedOperator extends ethereum.Event { 164 | get params(): RevokedOperator__Params { 165 | return new RevokedOperator__Params(this); 166 | } 167 | } 168 | 169 | export class RevokedOperator__Params { 170 | _event: RevokedOperator; 171 | 172 | constructor(event: RevokedOperator) { 173 | this._event = event; 174 | } 175 | 176 | get operator(): Address { 177 | return this._event.parameters[0].value.toAddress(); 178 | } 179 | 180 | get tokenHolder(): Address { 181 | return this._event.parameters[1].value.toAddress(); 182 | } 183 | } 184 | 185 | export class Sent extends ethereum.Event { 186 | get params(): Sent__Params { 187 | return new Sent__Params(this); 188 | } 189 | } 190 | 191 | export class Sent__Params { 192 | _event: Sent; 193 | 194 | constructor(event: Sent) { 195 | this._event = event; 196 | } 197 | 198 | get operator(): Address { 199 | return this._event.parameters[0].value.toAddress(); 200 | } 201 | 202 | get from(): Address { 203 | return this._event.parameters[1].value.toAddress(); 204 | } 205 | 206 | get to(): Address { 207 | return this._event.parameters[2].value.toAddress(); 208 | } 209 | 210 | get amount(): BigInt { 211 | return this._event.parameters[3].value.toBigInt(); 212 | } 213 | 214 | get data(): Bytes { 215 | return this._event.parameters[4].value.toBytes(); 216 | } 217 | 218 | get operatorData(): Bytes { 219 | return this._event.parameters[5].value.toBytes(); 220 | } 221 | } 222 | 223 | export class Transfer extends ethereum.Event { 224 | get params(): Transfer__Params { 225 | return new Transfer__Params(this); 226 | } 227 | } 228 | 229 | export class Transfer__Params { 230 | _event: Transfer; 231 | 232 | constructor(event: Transfer) { 233 | this._event = event; 234 | } 235 | 236 | get from(): Address { 237 | return this._event.parameters[0].value.toAddress(); 238 | } 239 | 240 | get to(): Address { 241 | return this._event.parameters[1].value.toAddress(); 242 | } 243 | 244 | get value(): BigInt { 245 | return this._event.parameters[2].value.toBigInt(); 246 | } 247 | } 248 | 249 | export class PoolToken extends ethereum.SmartContract { 250 | static bind(address: Address): PoolToken { 251 | return new PoolToken("PoolToken", address); 252 | } 253 | 254 | allowance(holder: Address, spender: Address): BigInt { 255 | let result = super.call( 256 | "allowance", 257 | "allowance(address,address):(uint256)", 258 | [ethereum.Value.fromAddress(holder), ethereum.Value.fromAddress(spender)] 259 | ); 260 | 261 | return result[0].toBigInt(); 262 | } 263 | 264 | try_allowance( 265 | holder: Address, 266 | spender: Address 267 | ): ethereum.CallResult { 268 | let result = super.tryCall( 269 | "allowance", 270 | "allowance(address,address):(uint256)", 271 | [ethereum.Value.fromAddress(holder), ethereum.Value.fromAddress(spender)] 272 | ); 273 | if (result.reverted) { 274 | return new ethereum.CallResult(); 275 | } 276 | let value = result.value; 277 | return ethereum.CallResult.fromValue(value[0].toBigInt()); 278 | } 279 | 280 | approve(spender: Address, value: BigInt): boolean { 281 | let result = super.call("approve", "approve(address,uint256):(bool)", [ 282 | ethereum.Value.fromAddress(spender), 283 | ethereum.Value.fromUnsignedBigInt(value) 284 | ]); 285 | 286 | return result[0].toBoolean(); 287 | } 288 | 289 | try_approve(spender: Address, value: BigInt): ethereum.CallResult { 290 | let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ 291 | ethereum.Value.fromAddress(spender), 292 | ethereum.Value.fromUnsignedBigInt(value) 293 | ]); 294 | if (result.reverted) { 295 | return new ethereum.CallResult(); 296 | } 297 | let value = result.value; 298 | return ethereum.CallResult.fromValue(value[0].toBoolean()); 299 | } 300 | 301 | balanceOf(_addr: Address): BigInt { 302 | let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ 303 | ethereum.Value.fromAddress(_addr) 304 | ]); 305 | 306 | return result[0].toBigInt(); 307 | } 308 | 309 | try_balanceOf(_addr: Address): ethereum.CallResult { 310 | let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ 311 | ethereum.Value.fromAddress(_addr) 312 | ]); 313 | if (result.reverted) { 314 | return new ethereum.CallResult(); 315 | } 316 | let value = result.value; 317 | return ethereum.CallResult.fromValue(value[0].toBigInt()); 318 | } 319 | 320 | decimals(): i32 { 321 | let result = super.call("decimals", "decimals():(uint8)", []); 322 | 323 | return result[0].toI32(); 324 | } 325 | 326 | try_decimals(): ethereum.CallResult { 327 | let result = super.tryCall("decimals", "decimals():(uint8)", []); 328 | if (result.reverted) { 329 | return new ethereum.CallResult(); 330 | } 331 | let value = result.value; 332 | return ethereum.CallResult.fromValue(value[0].toI32()); 333 | } 334 | 335 | defaultOperators(): Array
{ 336 | let result = super.call( 337 | "defaultOperators", 338 | "defaultOperators():(address[])", 339 | [] 340 | ); 341 | 342 | return result[0].toAddressArray(); 343 | } 344 | 345 | try_defaultOperators(): ethereum.CallResult> { 346 | let result = super.tryCall( 347 | "defaultOperators", 348 | "defaultOperators():(address[])", 349 | [] 350 | ); 351 | if (result.reverted) { 352 | return new ethereum.CallResult(); 353 | } 354 | let value = result.value; 355 | return ethereum.CallResult.fromValue(value[0].toAddressArray()); 356 | } 357 | 358 | granularity(): BigInt { 359 | let result = super.call("granularity", "granularity():(uint256)", []); 360 | 361 | return result[0].toBigInt(); 362 | } 363 | 364 | try_granularity(): ethereum.CallResult { 365 | let result = super.tryCall("granularity", "granularity():(uint256)", []); 366 | if (result.reverted) { 367 | return new ethereum.CallResult(); 368 | } 369 | let value = result.value; 370 | return ethereum.CallResult.fromValue(value[0].toBigInt()); 371 | } 372 | 373 | isOperatorFor(operator: Address, tokenHolder: Address): boolean { 374 | let result = super.call( 375 | "isOperatorFor", 376 | "isOperatorFor(address,address):(bool)", 377 | [ 378 | ethereum.Value.fromAddress(operator), 379 | ethereum.Value.fromAddress(tokenHolder) 380 | ] 381 | ); 382 | 383 | return result[0].toBoolean(); 384 | } 385 | 386 | try_isOperatorFor( 387 | operator: Address, 388 | tokenHolder: Address 389 | ): ethereum.CallResult { 390 | let result = super.tryCall( 391 | "isOperatorFor", 392 | "isOperatorFor(address,address):(bool)", 393 | [ 394 | ethereum.Value.fromAddress(operator), 395 | ethereum.Value.fromAddress(tokenHolder) 396 | ] 397 | ); 398 | if (result.reverted) { 399 | return new ethereum.CallResult(); 400 | } 401 | let value = result.value; 402 | return ethereum.CallResult.fromValue(value[0].toBoolean()); 403 | } 404 | 405 | name(): string { 406 | let result = super.call("name", "name():(string)", []); 407 | 408 | return result[0].toString(); 409 | } 410 | 411 | try_name(): ethereum.CallResult { 412 | let result = super.tryCall("name", "name():(string)", []); 413 | if (result.reverted) { 414 | return new ethereum.CallResult(); 415 | } 416 | let value = result.value; 417 | return ethereum.CallResult.fromValue(value[0].toString()); 418 | } 419 | 420 | pool(): Address { 421 | let result = super.call("pool", "pool():(address)", []); 422 | 423 | return result[0].toAddress(); 424 | } 425 | 426 | try_pool(): ethereum.CallResult
{ 427 | let result = super.tryCall("pool", "pool():(address)", []); 428 | if (result.reverted) { 429 | return new ethereum.CallResult(); 430 | } 431 | let value = result.value; 432 | return ethereum.CallResult.fromValue(value[0].toAddress()); 433 | } 434 | 435 | symbol(): string { 436 | let result = super.call("symbol", "symbol():(string)", []); 437 | 438 | return result[0].toString(); 439 | } 440 | 441 | try_symbol(): ethereum.CallResult { 442 | let result = super.tryCall("symbol", "symbol():(string)", []); 443 | if (result.reverted) { 444 | return new ethereum.CallResult(); 445 | } 446 | let value = result.value; 447 | return ethereum.CallResult.fromValue(value[0].toString()); 448 | } 449 | 450 | totalSupply(): BigInt { 451 | let result = super.call("totalSupply", "totalSupply():(uint256)", []); 452 | 453 | return result[0].toBigInt(); 454 | } 455 | 456 | try_totalSupply(): ethereum.CallResult { 457 | let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); 458 | if (result.reverted) { 459 | return new ethereum.CallResult(); 460 | } 461 | let value = result.value; 462 | return ethereum.CallResult.fromValue(value[0].toBigInt()); 463 | } 464 | 465 | transfer(recipient: Address, amount: BigInt): boolean { 466 | let result = super.call("transfer", "transfer(address,uint256):(bool)", [ 467 | ethereum.Value.fromAddress(recipient), 468 | ethereum.Value.fromUnsignedBigInt(amount) 469 | ]); 470 | 471 | return result[0].toBoolean(); 472 | } 473 | 474 | try_transfer( 475 | recipient: Address, 476 | amount: BigInt 477 | ): ethereum.CallResult { 478 | let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ 479 | ethereum.Value.fromAddress(recipient), 480 | ethereum.Value.fromUnsignedBigInt(amount) 481 | ]); 482 | if (result.reverted) { 483 | return new ethereum.CallResult(); 484 | } 485 | let value = result.value; 486 | return ethereum.CallResult.fromValue(value[0].toBoolean()); 487 | } 488 | 489 | transferFrom(holder: Address, recipient: Address, amount: BigInt): boolean { 490 | let result = super.call( 491 | "transferFrom", 492 | "transferFrom(address,address,uint256):(bool)", 493 | [ 494 | ethereum.Value.fromAddress(holder), 495 | ethereum.Value.fromAddress(recipient), 496 | ethereum.Value.fromUnsignedBigInt(amount) 497 | ] 498 | ); 499 | 500 | return result[0].toBoolean(); 501 | } 502 | 503 | try_transferFrom( 504 | holder: Address, 505 | recipient: Address, 506 | amount: BigInt 507 | ): ethereum.CallResult { 508 | let result = super.tryCall( 509 | "transferFrom", 510 | "transferFrom(address,address,uint256):(bool)", 511 | [ 512 | ethereum.Value.fromAddress(holder), 513 | ethereum.Value.fromAddress(recipient), 514 | ethereum.Value.fromUnsignedBigInt(amount) 515 | ] 516 | ); 517 | if (result.reverted) { 518 | return new ethereum.CallResult(); 519 | } 520 | let value = result.value; 521 | return ethereum.CallResult.fromValue(value[0].toBoolean()); 522 | } 523 | 524 | recipientWhitelistEnabled(): boolean { 525 | let result = super.call( 526 | "recipientWhitelistEnabled", 527 | "recipientWhitelistEnabled():(bool)", 528 | [] 529 | ); 530 | 531 | return result[0].toBoolean(); 532 | } 533 | 534 | try_recipientWhitelistEnabled(): ethereum.CallResult { 535 | let result = super.tryCall( 536 | "recipientWhitelistEnabled", 537 | "recipientWhitelistEnabled():(bool)", 538 | [] 539 | ); 540 | if (result.reverted) { 541 | return new ethereum.CallResult(); 542 | } 543 | let value = result.value; 544 | return ethereum.CallResult.fromValue(value[0].toBoolean()); 545 | } 546 | 547 | recipientWhitelisted(_recipient: Address): boolean { 548 | let result = super.call( 549 | "recipientWhitelisted", 550 | "recipientWhitelisted(address):(bool)", 551 | [ethereum.Value.fromAddress(_recipient)] 552 | ); 553 | 554 | return result[0].toBoolean(); 555 | } 556 | 557 | try_recipientWhitelisted(_recipient: Address): ethereum.CallResult { 558 | let result = super.tryCall( 559 | "recipientWhitelisted", 560 | "recipientWhitelisted(address):(bool)", 561 | [ethereum.Value.fromAddress(_recipient)] 562 | ); 563 | if (result.reverted) { 564 | return new ethereum.CallResult(); 565 | } 566 | let value = result.value; 567 | return ethereum.CallResult.fromValue(value[0].toBoolean()); 568 | } 569 | } 570 | 571 | export class ApproveCall extends ethereum.Call { 572 | get inputs(): ApproveCall__Inputs { 573 | return new ApproveCall__Inputs(this); 574 | } 575 | 576 | get outputs(): ApproveCall__Outputs { 577 | return new ApproveCall__Outputs(this); 578 | } 579 | } 580 | 581 | export class ApproveCall__Inputs { 582 | _call: ApproveCall; 583 | 584 | constructor(call: ApproveCall) { 585 | this._call = call; 586 | } 587 | 588 | get spender(): Address { 589 | return this._call.inputValues[0].value.toAddress(); 590 | } 591 | 592 | get value(): BigInt { 593 | return this._call.inputValues[1].value.toBigInt(); 594 | } 595 | } 596 | 597 | export class ApproveCall__Outputs { 598 | _call: ApproveCall; 599 | 600 | constructor(call: ApproveCall) { 601 | this._call = call; 602 | } 603 | 604 | get value0(): boolean { 605 | return this._call.outputValues[0].value.toBoolean(); 606 | } 607 | } 608 | 609 | export class AuthorizeOperatorCall extends ethereum.Call { 610 | get inputs(): AuthorizeOperatorCall__Inputs { 611 | return new AuthorizeOperatorCall__Inputs(this); 612 | } 613 | 614 | get outputs(): AuthorizeOperatorCall__Outputs { 615 | return new AuthorizeOperatorCall__Outputs(this); 616 | } 617 | } 618 | 619 | export class AuthorizeOperatorCall__Inputs { 620 | _call: AuthorizeOperatorCall; 621 | 622 | constructor(call: AuthorizeOperatorCall) { 623 | this._call = call; 624 | } 625 | 626 | get operator(): Address { 627 | return this._call.inputValues[0].value.toAddress(); 628 | } 629 | } 630 | 631 | export class AuthorizeOperatorCall__Outputs { 632 | _call: AuthorizeOperatorCall; 633 | 634 | constructor(call: AuthorizeOperatorCall) { 635 | this._call = call; 636 | } 637 | } 638 | 639 | export class BurnCall extends ethereum.Call { 640 | get inputs(): BurnCall__Inputs { 641 | return new BurnCall__Inputs(this); 642 | } 643 | 644 | get outputs(): BurnCall__Outputs { 645 | return new BurnCall__Outputs(this); 646 | } 647 | } 648 | 649 | export class BurnCall__Inputs { 650 | _call: BurnCall; 651 | 652 | constructor(call: BurnCall) { 653 | this._call = call; 654 | } 655 | 656 | get value0(): BigInt { 657 | return this._call.inputValues[0].value.toBigInt(); 658 | } 659 | 660 | get value1(): Bytes { 661 | return this._call.inputValues[1].value.toBytes(); 662 | } 663 | } 664 | 665 | export class BurnCall__Outputs { 666 | _call: BurnCall; 667 | 668 | constructor(call: BurnCall) { 669 | this._call = call; 670 | } 671 | } 672 | 673 | export class InitCall extends ethereum.Call { 674 | get inputs(): InitCall__Inputs { 675 | return new InitCall__Inputs(this); 676 | } 677 | 678 | get outputs(): InitCall__Outputs { 679 | return new InitCall__Outputs(this); 680 | } 681 | } 682 | 683 | export class InitCall__Inputs { 684 | _call: InitCall; 685 | 686 | constructor(call: InitCall) { 687 | this._call = call; 688 | } 689 | 690 | get name(): string { 691 | return this._call.inputValues[0].value.toString(); 692 | } 693 | 694 | get symbol(): string { 695 | return this._call.inputValues[1].value.toString(); 696 | } 697 | 698 | get defaultOperators(): Array
{ 699 | return this._call.inputValues[2].value.toAddressArray(); 700 | } 701 | 702 | get pool(): Address { 703 | return this._call.inputValues[3].value.toAddress(); 704 | } 705 | } 706 | 707 | export class InitCall__Outputs { 708 | _call: InitCall; 709 | 710 | constructor(call: InitCall) { 711 | this._call = call; 712 | } 713 | } 714 | 715 | export class OperatorBurnCall extends ethereum.Call { 716 | get inputs(): OperatorBurnCall__Inputs { 717 | return new OperatorBurnCall__Inputs(this); 718 | } 719 | 720 | get outputs(): OperatorBurnCall__Outputs { 721 | return new OperatorBurnCall__Outputs(this); 722 | } 723 | } 724 | 725 | export class OperatorBurnCall__Inputs { 726 | _call: OperatorBurnCall; 727 | 728 | constructor(call: OperatorBurnCall) { 729 | this._call = call; 730 | } 731 | 732 | get value0(): Address { 733 | return this._call.inputValues[0].value.toAddress(); 734 | } 735 | 736 | get value1(): BigInt { 737 | return this._call.inputValues[1].value.toBigInt(); 738 | } 739 | 740 | get value2(): Bytes { 741 | return this._call.inputValues[2].value.toBytes(); 742 | } 743 | 744 | get value3(): Bytes { 745 | return this._call.inputValues[3].value.toBytes(); 746 | } 747 | } 748 | 749 | export class OperatorBurnCall__Outputs { 750 | _call: OperatorBurnCall; 751 | 752 | constructor(call: OperatorBurnCall) { 753 | this._call = call; 754 | } 755 | } 756 | 757 | export class OperatorRedeemCall extends ethereum.Call { 758 | get inputs(): OperatorRedeemCall__Inputs { 759 | return new OperatorRedeemCall__Inputs(this); 760 | } 761 | 762 | get outputs(): OperatorRedeemCall__Outputs { 763 | return new OperatorRedeemCall__Outputs(this); 764 | } 765 | } 766 | 767 | export class OperatorRedeemCall__Inputs { 768 | _call: OperatorRedeemCall; 769 | 770 | constructor(call: OperatorRedeemCall) { 771 | this._call = call; 772 | } 773 | 774 | get account(): Address { 775 | return this._call.inputValues[0].value.toAddress(); 776 | } 777 | 778 | get amount(): BigInt { 779 | return this._call.inputValues[1].value.toBigInt(); 780 | } 781 | 782 | get data(): Bytes { 783 | return this._call.inputValues[2].value.toBytes(); 784 | } 785 | 786 | get operatorData(): Bytes { 787 | return this._call.inputValues[3].value.toBytes(); 788 | } 789 | } 790 | 791 | export class OperatorRedeemCall__Outputs { 792 | _call: OperatorRedeemCall; 793 | 794 | constructor(call: OperatorRedeemCall) { 795 | this._call = call; 796 | } 797 | } 798 | 799 | export class OperatorSendCall extends ethereum.Call { 800 | get inputs(): OperatorSendCall__Inputs { 801 | return new OperatorSendCall__Inputs(this); 802 | } 803 | 804 | get outputs(): OperatorSendCall__Outputs { 805 | return new OperatorSendCall__Outputs(this); 806 | } 807 | } 808 | 809 | export class OperatorSendCall__Inputs { 810 | _call: OperatorSendCall; 811 | 812 | constructor(call: OperatorSendCall) { 813 | this._call = call; 814 | } 815 | 816 | get sender(): Address { 817 | return this._call.inputValues[0].value.toAddress(); 818 | } 819 | 820 | get recipient(): Address { 821 | return this._call.inputValues[1].value.toAddress(); 822 | } 823 | 824 | get amount(): BigInt { 825 | return this._call.inputValues[2].value.toBigInt(); 826 | } 827 | 828 | get data(): Bytes { 829 | return this._call.inputValues[3].value.toBytes(); 830 | } 831 | 832 | get operatorData(): Bytes { 833 | return this._call.inputValues[4].value.toBytes(); 834 | } 835 | } 836 | 837 | export class OperatorSendCall__Outputs { 838 | _call: OperatorSendCall; 839 | 840 | constructor(call: OperatorSendCall) { 841 | this._call = call; 842 | } 843 | } 844 | 845 | export class PoolMintCall extends ethereum.Call { 846 | get inputs(): PoolMintCall__Inputs { 847 | return new PoolMintCall__Inputs(this); 848 | } 849 | 850 | get outputs(): PoolMintCall__Outputs { 851 | return new PoolMintCall__Outputs(this); 852 | } 853 | } 854 | 855 | export class PoolMintCall__Inputs { 856 | _call: PoolMintCall; 857 | 858 | constructor(call: PoolMintCall) { 859 | this._call = call; 860 | } 861 | 862 | get amount(): BigInt { 863 | return this._call.inputValues[0].value.toBigInt(); 864 | } 865 | } 866 | 867 | export class PoolMintCall__Outputs { 868 | _call: PoolMintCall; 869 | 870 | constructor(call: PoolMintCall) { 871 | this._call = call; 872 | } 873 | } 874 | 875 | export class PoolRedeemCall extends ethereum.Call { 876 | get inputs(): PoolRedeemCall__Inputs { 877 | return new PoolRedeemCall__Inputs(this); 878 | } 879 | 880 | get outputs(): PoolRedeemCall__Outputs { 881 | return new PoolRedeemCall__Outputs(this); 882 | } 883 | } 884 | 885 | export class PoolRedeemCall__Inputs { 886 | _call: PoolRedeemCall; 887 | 888 | constructor(call: PoolRedeemCall) { 889 | this._call = call; 890 | } 891 | 892 | get from(): Address { 893 | return this._call.inputValues[0].value.toAddress(); 894 | } 895 | 896 | get amount(): BigInt { 897 | return this._call.inputValues[1].value.toBigInt(); 898 | } 899 | } 900 | 901 | export class PoolRedeemCall__Outputs { 902 | _call: PoolRedeemCall; 903 | 904 | constructor(call: PoolRedeemCall) { 905 | this._call = call; 906 | } 907 | } 908 | 909 | export class RedeemCall extends ethereum.Call { 910 | get inputs(): RedeemCall__Inputs { 911 | return new RedeemCall__Inputs(this); 912 | } 913 | 914 | get outputs(): RedeemCall__Outputs { 915 | return new RedeemCall__Outputs(this); 916 | } 917 | } 918 | 919 | export class RedeemCall__Inputs { 920 | _call: RedeemCall; 921 | 922 | constructor(call: RedeemCall) { 923 | this._call = call; 924 | } 925 | 926 | get amount(): BigInt { 927 | return this._call.inputValues[0].value.toBigInt(); 928 | } 929 | 930 | get data(): Bytes { 931 | return this._call.inputValues[1].value.toBytes(); 932 | } 933 | } 934 | 935 | export class RedeemCall__Outputs { 936 | _call: RedeemCall; 937 | 938 | constructor(call: RedeemCall) { 939 | this._call = call; 940 | } 941 | } 942 | 943 | export class RevokeOperatorCall extends ethereum.Call { 944 | get inputs(): RevokeOperatorCall__Inputs { 945 | return new RevokeOperatorCall__Inputs(this); 946 | } 947 | 948 | get outputs(): RevokeOperatorCall__Outputs { 949 | return new RevokeOperatorCall__Outputs(this); 950 | } 951 | } 952 | 953 | export class RevokeOperatorCall__Inputs { 954 | _call: RevokeOperatorCall; 955 | 956 | constructor(call: RevokeOperatorCall) { 957 | this._call = call; 958 | } 959 | 960 | get operator(): Address { 961 | return this._call.inputValues[0].value.toAddress(); 962 | } 963 | } 964 | 965 | export class RevokeOperatorCall__Outputs { 966 | _call: RevokeOperatorCall; 967 | 968 | constructor(call: RevokeOperatorCall) { 969 | this._call = call; 970 | } 971 | } 972 | 973 | export class SendCall extends ethereum.Call { 974 | get inputs(): SendCall__Inputs { 975 | return new SendCall__Inputs(this); 976 | } 977 | 978 | get outputs(): SendCall__Outputs { 979 | return new SendCall__Outputs(this); 980 | } 981 | } 982 | 983 | export class SendCall__Inputs { 984 | _call: SendCall; 985 | 986 | constructor(call: SendCall) { 987 | this._call = call; 988 | } 989 | 990 | get recipient(): Address { 991 | return this._call.inputValues[0].value.toAddress(); 992 | } 993 | 994 | get amount(): BigInt { 995 | return this._call.inputValues[1].value.toBigInt(); 996 | } 997 | 998 | get data(): Bytes { 999 | return this._call.inputValues[2].value.toBytes(); 1000 | } 1001 | } 1002 | 1003 | export class SendCall__Outputs { 1004 | _call: SendCall; 1005 | 1006 | constructor(call: SendCall) { 1007 | this._call = call; 1008 | } 1009 | } 1010 | 1011 | export class TransferCall extends ethereum.Call { 1012 | get inputs(): TransferCall__Inputs { 1013 | return new TransferCall__Inputs(this); 1014 | } 1015 | 1016 | get outputs(): TransferCall__Outputs { 1017 | return new TransferCall__Outputs(this); 1018 | } 1019 | } 1020 | 1021 | export class TransferCall__Inputs { 1022 | _call: TransferCall; 1023 | 1024 | constructor(call: TransferCall) { 1025 | this._call = call; 1026 | } 1027 | 1028 | get recipient(): Address { 1029 | return this._call.inputValues[0].value.toAddress(); 1030 | } 1031 | 1032 | get amount(): BigInt { 1033 | return this._call.inputValues[1].value.toBigInt(); 1034 | } 1035 | } 1036 | 1037 | export class TransferCall__Outputs { 1038 | _call: TransferCall; 1039 | 1040 | constructor(call: TransferCall) { 1041 | this._call = call; 1042 | } 1043 | 1044 | get value0(): boolean { 1045 | return this._call.outputValues[0].value.toBoolean(); 1046 | } 1047 | } 1048 | 1049 | export class TransferFromCall extends ethereum.Call { 1050 | get inputs(): TransferFromCall__Inputs { 1051 | return new TransferFromCall__Inputs(this); 1052 | } 1053 | 1054 | get outputs(): TransferFromCall__Outputs { 1055 | return new TransferFromCall__Outputs(this); 1056 | } 1057 | } 1058 | 1059 | export class TransferFromCall__Inputs { 1060 | _call: TransferFromCall; 1061 | 1062 | constructor(call: TransferFromCall) { 1063 | this._call = call; 1064 | } 1065 | 1066 | get holder(): Address { 1067 | return this._call.inputValues[0].value.toAddress(); 1068 | } 1069 | 1070 | get recipient(): Address { 1071 | return this._call.inputValues[1].value.toAddress(); 1072 | } 1073 | 1074 | get amount(): BigInt { 1075 | return this._call.inputValues[2].value.toBigInt(); 1076 | } 1077 | } 1078 | 1079 | export class TransferFromCall__Outputs { 1080 | _call: TransferFromCall; 1081 | 1082 | constructor(call: TransferFromCall) { 1083 | this._call = call; 1084 | } 1085 | 1086 | get value0(): boolean { 1087 | return this._call.outputValues[0].value.toBoolean(); 1088 | } 1089 | } 1090 | 1091 | export class SetRecipientWhitelistEnabledCall extends ethereum.Call { 1092 | get inputs(): SetRecipientWhitelistEnabledCall__Inputs { 1093 | return new SetRecipientWhitelistEnabledCall__Inputs(this); 1094 | } 1095 | 1096 | get outputs(): SetRecipientWhitelistEnabledCall__Outputs { 1097 | return new SetRecipientWhitelistEnabledCall__Outputs(this); 1098 | } 1099 | } 1100 | 1101 | export class SetRecipientWhitelistEnabledCall__Inputs { 1102 | _call: SetRecipientWhitelistEnabledCall; 1103 | 1104 | constructor(call: SetRecipientWhitelistEnabledCall) { 1105 | this._call = call; 1106 | } 1107 | 1108 | get _enabled(): boolean { 1109 | return this._call.inputValues[0].value.toBoolean(); 1110 | } 1111 | } 1112 | 1113 | export class SetRecipientWhitelistEnabledCall__Outputs { 1114 | _call: SetRecipientWhitelistEnabledCall; 1115 | 1116 | constructor(call: SetRecipientWhitelistEnabledCall) { 1117 | this._call = call; 1118 | } 1119 | } 1120 | 1121 | export class SetRecipientWhitelistedCall extends ethereum.Call { 1122 | get inputs(): SetRecipientWhitelistedCall__Inputs { 1123 | return new SetRecipientWhitelistedCall__Inputs(this); 1124 | } 1125 | 1126 | get outputs(): SetRecipientWhitelistedCall__Outputs { 1127 | return new SetRecipientWhitelistedCall__Outputs(this); 1128 | } 1129 | } 1130 | 1131 | export class SetRecipientWhitelistedCall__Inputs { 1132 | _call: SetRecipientWhitelistedCall; 1133 | 1134 | constructor(call: SetRecipientWhitelistedCall) { 1135 | this._call = call; 1136 | } 1137 | 1138 | get _recipient(): Address { 1139 | return this._call.inputValues[0].value.toAddress(); 1140 | } 1141 | 1142 | get _whitelisted(): boolean { 1143 | return this._call.inputValues[1].value.toBoolean(); 1144 | } 1145 | } 1146 | 1147 | export class SetRecipientWhitelistedCall__Outputs { 1148 | _call: SetRecipientWhitelistedCall; 1149 | 1150 | constructor(call: SetRecipientWhitelistedCall) { 1151 | this._call = call; 1152 | } 1153 | } 1154 | -------------------------------------------------------------------------------- /generated/PoolDaiToken/PoolToken.ts: -------------------------------------------------------------------------------- 1 | // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | 3 | import { 4 | ethereum, 5 | JSONValue, 6 | TypedMap, 7 | Entity, 8 | Bytes, 9 | Address, 10 | BigInt 11 | } from "@graphprotocol/graph-ts"; 12 | 13 | export class Approval extends ethereum.Event { 14 | get params(): Approval__Params { 15 | return new Approval__Params(this); 16 | } 17 | } 18 | 19 | export class Approval__Params { 20 | _event: Approval; 21 | 22 | constructor(event: Approval) { 23 | this._event = event; 24 | } 25 | 26 | get owner(): Address { 27 | return this._event.parameters[0].value.toAddress(); 28 | } 29 | 30 | get spender(): Address { 31 | return this._event.parameters[1].value.toAddress(); 32 | } 33 | 34 | get value(): BigInt { 35 | return this._event.parameters[2].value.toBigInt(); 36 | } 37 | } 38 | 39 | export class AuthorizedOperator extends ethereum.Event { 40 | get params(): AuthorizedOperator__Params { 41 | return new AuthorizedOperator__Params(this); 42 | } 43 | } 44 | 45 | export class AuthorizedOperator__Params { 46 | _event: AuthorizedOperator; 47 | 48 | constructor(event: AuthorizedOperator) { 49 | this._event = event; 50 | } 51 | 52 | get operator(): Address { 53 | return this._event.parameters[0].value.toAddress(); 54 | } 55 | 56 | get tokenHolder(): Address { 57 | return this._event.parameters[1].value.toAddress(); 58 | } 59 | } 60 | 61 | export class Burned extends ethereum.Event { 62 | get params(): Burned__Params { 63 | return new Burned__Params(this); 64 | } 65 | } 66 | 67 | export class Burned__Params { 68 | _event: Burned; 69 | 70 | constructor(event: Burned) { 71 | this._event = event; 72 | } 73 | 74 | get operator(): Address { 75 | return this._event.parameters[0].value.toAddress(); 76 | } 77 | 78 | get from(): Address { 79 | return this._event.parameters[1].value.toAddress(); 80 | } 81 | 82 | get amount(): BigInt { 83 | return this._event.parameters[2].value.toBigInt(); 84 | } 85 | 86 | get data(): Bytes { 87 | return this._event.parameters[3].value.toBytes(); 88 | } 89 | 90 | get operatorData(): Bytes { 91 | return this._event.parameters[4].value.toBytes(); 92 | } 93 | } 94 | 95 | export class Minted extends ethereum.Event { 96 | get params(): Minted__Params { 97 | return new Minted__Params(this); 98 | } 99 | } 100 | 101 | export class Minted__Params { 102 | _event: Minted; 103 | 104 | constructor(event: Minted) { 105 | this._event = event; 106 | } 107 | 108 | get operator(): Address { 109 | return this._event.parameters[0].value.toAddress(); 110 | } 111 | 112 | get to(): Address { 113 | return this._event.parameters[1].value.toAddress(); 114 | } 115 | 116 | get amount(): BigInt { 117 | return this._event.parameters[2].value.toBigInt(); 118 | } 119 | 120 | get data(): Bytes { 121 | return this._event.parameters[3].value.toBytes(); 122 | } 123 | 124 | get operatorData(): Bytes { 125 | return this._event.parameters[4].value.toBytes(); 126 | } 127 | } 128 | 129 | export class Redeemed extends ethereum.Event { 130 | get params(): Redeemed__Params { 131 | return new Redeemed__Params(this); 132 | } 133 | } 134 | 135 | export class Redeemed__Params { 136 | _event: Redeemed; 137 | 138 | constructor(event: Redeemed) { 139 | this._event = event; 140 | } 141 | 142 | get operator(): Address { 143 | return this._event.parameters[0].value.toAddress(); 144 | } 145 | 146 | get from(): Address { 147 | return this._event.parameters[1].value.toAddress(); 148 | } 149 | 150 | get amount(): BigInt { 151 | return this._event.parameters[2].value.toBigInt(); 152 | } 153 | 154 | get data(): Bytes { 155 | return this._event.parameters[3].value.toBytes(); 156 | } 157 | 158 | get operatorData(): Bytes { 159 | return this._event.parameters[4].value.toBytes(); 160 | } 161 | } 162 | 163 | export class RevokedOperator extends ethereum.Event { 164 | get params(): RevokedOperator__Params { 165 | return new RevokedOperator__Params(this); 166 | } 167 | } 168 | 169 | export class RevokedOperator__Params { 170 | _event: RevokedOperator; 171 | 172 | constructor(event: RevokedOperator) { 173 | this._event = event; 174 | } 175 | 176 | get operator(): Address { 177 | return this._event.parameters[0].value.toAddress(); 178 | } 179 | 180 | get tokenHolder(): Address { 181 | return this._event.parameters[1].value.toAddress(); 182 | } 183 | } 184 | 185 | export class Sent extends ethereum.Event { 186 | get params(): Sent__Params { 187 | return new Sent__Params(this); 188 | } 189 | } 190 | 191 | export class Sent__Params { 192 | _event: Sent; 193 | 194 | constructor(event: Sent) { 195 | this._event = event; 196 | } 197 | 198 | get operator(): Address { 199 | return this._event.parameters[0].value.toAddress(); 200 | } 201 | 202 | get from(): Address { 203 | return this._event.parameters[1].value.toAddress(); 204 | } 205 | 206 | get to(): Address { 207 | return this._event.parameters[2].value.toAddress(); 208 | } 209 | 210 | get amount(): BigInt { 211 | return this._event.parameters[3].value.toBigInt(); 212 | } 213 | 214 | get data(): Bytes { 215 | return this._event.parameters[4].value.toBytes(); 216 | } 217 | 218 | get operatorData(): Bytes { 219 | return this._event.parameters[5].value.toBytes(); 220 | } 221 | } 222 | 223 | export class Transfer extends ethereum.Event { 224 | get params(): Transfer__Params { 225 | return new Transfer__Params(this); 226 | } 227 | } 228 | 229 | export class Transfer__Params { 230 | _event: Transfer; 231 | 232 | constructor(event: Transfer) { 233 | this._event = event; 234 | } 235 | 236 | get from(): Address { 237 | return this._event.parameters[0].value.toAddress(); 238 | } 239 | 240 | get to(): Address { 241 | return this._event.parameters[1].value.toAddress(); 242 | } 243 | 244 | get value(): BigInt { 245 | return this._event.parameters[2].value.toBigInt(); 246 | } 247 | } 248 | 249 | export class PoolToken extends ethereum.SmartContract { 250 | static bind(address: Address): PoolToken { 251 | return new PoolToken("PoolToken", address); 252 | } 253 | 254 | allowance(holder: Address, spender: Address): BigInt { 255 | let result = super.call( 256 | "allowance", 257 | "allowance(address,address):(uint256)", 258 | [ethereum.Value.fromAddress(holder), ethereum.Value.fromAddress(spender)] 259 | ); 260 | 261 | return result[0].toBigInt(); 262 | } 263 | 264 | try_allowance( 265 | holder: Address, 266 | spender: Address 267 | ): ethereum.CallResult { 268 | let result = super.tryCall( 269 | "allowance", 270 | "allowance(address,address):(uint256)", 271 | [ethereum.Value.fromAddress(holder), ethereum.Value.fromAddress(spender)] 272 | ); 273 | if (result.reverted) { 274 | return new ethereum.CallResult(); 275 | } 276 | let value = result.value; 277 | return ethereum.CallResult.fromValue(value[0].toBigInt()); 278 | } 279 | 280 | approve(spender: Address, value: BigInt): boolean { 281 | let result = super.call("approve", "approve(address,uint256):(bool)", [ 282 | ethereum.Value.fromAddress(spender), 283 | ethereum.Value.fromUnsignedBigInt(value) 284 | ]); 285 | 286 | return result[0].toBoolean(); 287 | } 288 | 289 | try_approve(spender: Address, value: BigInt): ethereum.CallResult { 290 | let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ 291 | ethereum.Value.fromAddress(spender), 292 | ethereum.Value.fromUnsignedBigInt(value) 293 | ]); 294 | if (result.reverted) { 295 | return new ethereum.CallResult(); 296 | } 297 | let value = result.value; 298 | return ethereum.CallResult.fromValue(value[0].toBoolean()); 299 | } 300 | 301 | balanceOf(_addr: Address): BigInt { 302 | let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ 303 | ethereum.Value.fromAddress(_addr) 304 | ]); 305 | 306 | return result[0].toBigInt(); 307 | } 308 | 309 | try_balanceOf(_addr: Address): ethereum.CallResult { 310 | let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ 311 | ethereum.Value.fromAddress(_addr) 312 | ]); 313 | if (result.reverted) { 314 | return new ethereum.CallResult(); 315 | } 316 | let value = result.value; 317 | return ethereum.CallResult.fromValue(value[0].toBigInt()); 318 | } 319 | 320 | decimals(): i32 { 321 | let result = super.call("decimals", "decimals():(uint8)", []); 322 | 323 | return result[0].toI32(); 324 | } 325 | 326 | try_decimals(): ethereum.CallResult { 327 | let result = super.tryCall("decimals", "decimals():(uint8)", []); 328 | if (result.reverted) { 329 | return new ethereum.CallResult(); 330 | } 331 | let value = result.value; 332 | return ethereum.CallResult.fromValue(value[0].toI32()); 333 | } 334 | 335 | defaultOperators(): Array
{ 336 | let result = super.call( 337 | "defaultOperators", 338 | "defaultOperators():(address[])", 339 | [] 340 | ); 341 | 342 | return result[0].toAddressArray(); 343 | } 344 | 345 | try_defaultOperators(): ethereum.CallResult> { 346 | let result = super.tryCall( 347 | "defaultOperators", 348 | "defaultOperators():(address[])", 349 | [] 350 | ); 351 | if (result.reverted) { 352 | return new ethereum.CallResult(); 353 | } 354 | let value = result.value; 355 | return ethereum.CallResult.fromValue(value[0].toAddressArray()); 356 | } 357 | 358 | granularity(): BigInt { 359 | let result = super.call("granularity", "granularity():(uint256)", []); 360 | 361 | return result[0].toBigInt(); 362 | } 363 | 364 | try_granularity(): ethereum.CallResult { 365 | let result = super.tryCall("granularity", "granularity():(uint256)", []); 366 | if (result.reverted) { 367 | return new ethereum.CallResult(); 368 | } 369 | let value = result.value; 370 | return ethereum.CallResult.fromValue(value[0].toBigInt()); 371 | } 372 | 373 | isOperatorFor(operator: Address, tokenHolder: Address): boolean { 374 | let result = super.call( 375 | "isOperatorFor", 376 | "isOperatorFor(address,address):(bool)", 377 | [ 378 | ethereum.Value.fromAddress(operator), 379 | ethereum.Value.fromAddress(tokenHolder) 380 | ] 381 | ); 382 | 383 | return result[0].toBoolean(); 384 | } 385 | 386 | try_isOperatorFor( 387 | operator: Address, 388 | tokenHolder: Address 389 | ): ethereum.CallResult { 390 | let result = super.tryCall( 391 | "isOperatorFor", 392 | "isOperatorFor(address,address):(bool)", 393 | [ 394 | ethereum.Value.fromAddress(operator), 395 | ethereum.Value.fromAddress(tokenHolder) 396 | ] 397 | ); 398 | if (result.reverted) { 399 | return new ethereum.CallResult(); 400 | } 401 | let value = result.value; 402 | return ethereum.CallResult.fromValue(value[0].toBoolean()); 403 | } 404 | 405 | name(): string { 406 | let result = super.call("name", "name():(string)", []); 407 | 408 | return result[0].toString(); 409 | } 410 | 411 | try_name(): ethereum.CallResult { 412 | let result = super.tryCall("name", "name():(string)", []); 413 | if (result.reverted) { 414 | return new ethereum.CallResult(); 415 | } 416 | let value = result.value; 417 | return ethereum.CallResult.fromValue(value[0].toString()); 418 | } 419 | 420 | pool(): Address { 421 | let result = super.call("pool", "pool():(address)", []); 422 | 423 | return result[0].toAddress(); 424 | } 425 | 426 | try_pool(): ethereum.CallResult
{ 427 | let result = super.tryCall("pool", "pool():(address)", []); 428 | if (result.reverted) { 429 | return new ethereum.CallResult(); 430 | } 431 | let value = result.value; 432 | return ethereum.CallResult.fromValue(value[0].toAddress()); 433 | } 434 | 435 | symbol(): string { 436 | let result = super.call("symbol", "symbol():(string)", []); 437 | 438 | return result[0].toString(); 439 | } 440 | 441 | try_symbol(): ethereum.CallResult { 442 | let result = super.tryCall("symbol", "symbol():(string)", []); 443 | if (result.reverted) { 444 | return new ethereum.CallResult(); 445 | } 446 | let value = result.value; 447 | return ethereum.CallResult.fromValue(value[0].toString()); 448 | } 449 | 450 | totalSupply(): BigInt { 451 | let result = super.call("totalSupply", "totalSupply():(uint256)", []); 452 | 453 | return result[0].toBigInt(); 454 | } 455 | 456 | try_totalSupply(): ethereum.CallResult { 457 | let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); 458 | if (result.reverted) { 459 | return new ethereum.CallResult(); 460 | } 461 | let value = result.value; 462 | return ethereum.CallResult.fromValue(value[0].toBigInt()); 463 | } 464 | 465 | transfer(recipient: Address, amount: BigInt): boolean { 466 | let result = super.call("transfer", "transfer(address,uint256):(bool)", [ 467 | ethereum.Value.fromAddress(recipient), 468 | ethereum.Value.fromUnsignedBigInt(amount) 469 | ]); 470 | 471 | return result[0].toBoolean(); 472 | } 473 | 474 | try_transfer( 475 | recipient: Address, 476 | amount: BigInt 477 | ): ethereum.CallResult { 478 | let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ 479 | ethereum.Value.fromAddress(recipient), 480 | ethereum.Value.fromUnsignedBigInt(amount) 481 | ]); 482 | if (result.reverted) { 483 | return new ethereum.CallResult(); 484 | } 485 | let value = result.value; 486 | return ethereum.CallResult.fromValue(value[0].toBoolean()); 487 | } 488 | 489 | transferFrom(holder: Address, recipient: Address, amount: BigInt): boolean { 490 | let result = super.call( 491 | "transferFrom", 492 | "transferFrom(address,address,uint256):(bool)", 493 | [ 494 | ethereum.Value.fromAddress(holder), 495 | ethereum.Value.fromAddress(recipient), 496 | ethereum.Value.fromUnsignedBigInt(amount) 497 | ] 498 | ); 499 | 500 | return result[0].toBoolean(); 501 | } 502 | 503 | try_transferFrom( 504 | holder: Address, 505 | recipient: Address, 506 | amount: BigInt 507 | ): ethereum.CallResult { 508 | let result = super.tryCall( 509 | "transferFrom", 510 | "transferFrom(address,address,uint256):(bool)", 511 | [ 512 | ethereum.Value.fromAddress(holder), 513 | ethereum.Value.fromAddress(recipient), 514 | ethereum.Value.fromUnsignedBigInt(amount) 515 | ] 516 | ); 517 | if (result.reverted) { 518 | return new ethereum.CallResult(); 519 | } 520 | let value = result.value; 521 | return ethereum.CallResult.fromValue(value[0].toBoolean()); 522 | } 523 | 524 | recipientWhitelistEnabled(): boolean { 525 | let result = super.call( 526 | "recipientWhitelistEnabled", 527 | "recipientWhitelistEnabled():(bool)", 528 | [] 529 | ); 530 | 531 | return result[0].toBoolean(); 532 | } 533 | 534 | try_recipientWhitelistEnabled(): ethereum.CallResult { 535 | let result = super.tryCall( 536 | "recipientWhitelistEnabled", 537 | "recipientWhitelistEnabled():(bool)", 538 | [] 539 | ); 540 | if (result.reverted) { 541 | return new ethereum.CallResult(); 542 | } 543 | let value = result.value; 544 | return ethereum.CallResult.fromValue(value[0].toBoolean()); 545 | } 546 | 547 | recipientWhitelisted(_recipient: Address): boolean { 548 | let result = super.call( 549 | "recipientWhitelisted", 550 | "recipientWhitelisted(address):(bool)", 551 | [ethereum.Value.fromAddress(_recipient)] 552 | ); 553 | 554 | return result[0].toBoolean(); 555 | } 556 | 557 | try_recipientWhitelisted(_recipient: Address): ethereum.CallResult { 558 | let result = super.tryCall( 559 | "recipientWhitelisted", 560 | "recipientWhitelisted(address):(bool)", 561 | [ethereum.Value.fromAddress(_recipient)] 562 | ); 563 | if (result.reverted) { 564 | return new ethereum.CallResult(); 565 | } 566 | let value = result.value; 567 | return ethereum.CallResult.fromValue(value[0].toBoolean()); 568 | } 569 | } 570 | 571 | export class ApproveCall extends ethereum.Call { 572 | get inputs(): ApproveCall__Inputs { 573 | return new ApproveCall__Inputs(this); 574 | } 575 | 576 | get outputs(): ApproveCall__Outputs { 577 | return new ApproveCall__Outputs(this); 578 | } 579 | } 580 | 581 | export class ApproveCall__Inputs { 582 | _call: ApproveCall; 583 | 584 | constructor(call: ApproveCall) { 585 | this._call = call; 586 | } 587 | 588 | get spender(): Address { 589 | return this._call.inputValues[0].value.toAddress(); 590 | } 591 | 592 | get value(): BigInt { 593 | return this._call.inputValues[1].value.toBigInt(); 594 | } 595 | } 596 | 597 | export class ApproveCall__Outputs { 598 | _call: ApproveCall; 599 | 600 | constructor(call: ApproveCall) { 601 | this._call = call; 602 | } 603 | 604 | get value0(): boolean { 605 | return this._call.outputValues[0].value.toBoolean(); 606 | } 607 | } 608 | 609 | export class AuthorizeOperatorCall extends ethereum.Call { 610 | get inputs(): AuthorizeOperatorCall__Inputs { 611 | return new AuthorizeOperatorCall__Inputs(this); 612 | } 613 | 614 | get outputs(): AuthorizeOperatorCall__Outputs { 615 | return new AuthorizeOperatorCall__Outputs(this); 616 | } 617 | } 618 | 619 | export class AuthorizeOperatorCall__Inputs { 620 | _call: AuthorizeOperatorCall; 621 | 622 | constructor(call: AuthorizeOperatorCall) { 623 | this._call = call; 624 | } 625 | 626 | get operator(): Address { 627 | return this._call.inputValues[0].value.toAddress(); 628 | } 629 | } 630 | 631 | export class AuthorizeOperatorCall__Outputs { 632 | _call: AuthorizeOperatorCall; 633 | 634 | constructor(call: AuthorizeOperatorCall) { 635 | this._call = call; 636 | } 637 | } 638 | 639 | export class BurnCall extends ethereum.Call { 640 | get inputs(): BurnCall__Inputs { 641 | return new BurnCall__Inputs(this); 642 | } 643 | 644 | get outputs(): BurnCall__Outputs { 645 | return new BurnCall__Outputs(this); 646 | } 647 | } 648 | 649 | export class BurnCall__Inputs { 650 | _call: BurnCall; 651 | 652 | constructor(call: BurnCall) { 653 | this._call = call; 654 | } 655 | 656 | get value0(): BigInt { 657 | return this._call.inputValues[0].value.toBigInt(); 658 | } 659 | 660 | get value1(): Bytes { 661 | return this._call.inputValues[1].value.toBytes(); 662 | } 663 | } 664 | 665 | export class BurnCall__Outputs { 666 | _call: BurnCall; 667 | 668 | constructor(call: BurnCall) { 669 | this._call = call; 670 | } 671 | } 672 | 673 | export class InitCall extends ethereum.Call { 674 | get inputs(): InitCall__Inputs { 675 | return new InitCall__Inputs(this); 676 | } 677 | 678 | get outputs(): InitCall__Outputs { 679 | return new InitCall__Outputs(this); 680 | } 681 | } 682 | 683 | export class InitCall__Inputs { 684 | _call: InitCall; 685 | 686 | constructor(call: InitCall) { 687 | this._call = call; 688 | } 689 | 690 | get name(): string { 691 | return this._call.inputValues[0].value.toString(); 692 | } 693 | 694 | get symbol(): string { 695 | return this._call.inputValues[1].value.toString(); 696 | } 697 | 698 | get defaultOperators(): Array
{ 699 | return this._call.inputValues[2].value.toAddressArray(); 700 | } 701 | 702 | get pool(): Address { 703 | return this._call.inputValues[3].value.toAddress(); 704 | } 705 | } 706 | 707 | export class InitCall__Outputs { 708 | _call: InitCall; 709 | 710 | constructor(call: InitCall) { 711 | this._call = call; 712 | } 713 | } 714 | 715 | export class OperatorBurnCall extends ethereum.Call { 716 | get inputs(): OperatorBurnCall__Inputs { 717 | return new OperatorBurnCall__Inputs(this); 718 | } 719 | 720 | get outputs(): OperatorBurnCall__Outputs { 721 | return new OperatorBurnCall__Outputs(this); 722 | } 723 | } 724 | 725 | export class OperatorBurnCall__Inputs { 726 | _call: OperatorBurnCall; 727 | 728 | constructor(call: OperatorBurnCall) { 729 | this._call = call; 730 | } 731 | 732 | get value0(): Address { 733 | return this._call.inputValues[0].value.toAddress(); 734 | } 735 | 736 | get value1(): BigInt { 737 | return this._call.inputValues[1].value.toBigInt(); 738 | } 739 | 740 | get value2(): Bytes { 741 | return this._call.inputValues[2].value.toBytes(); 742 | } 743 | 744 | get value3(): Bytes { 745 | return this._call.inputValues[3].value.toBytes(); 746 | } 747 | } 748 | 749 | export class OperatorBurnCall__Outputs { 750 | _call: OperatorBurnCall; 751 | 752 | constructor(call: OperatorBurnCall) { 753 | this._call = call; 754 | } 755 | } 756 | 757 | export class OperatorRedeemCall extends ethereum.Call { 758 | get inputs(): OperatorRedeemCall__Inputs { 759 | return new OperatorRedeemCall__Inputs(this); 760 | } 761 | 762 | get outputs(): OperatorRedeemCall__Outputs { 763 | return new OperatorRedeemCall__Outputs(this); 764 | } 765 | } 766 | 767 | export class OperatorRedeemCall__Inputs { 768 | _call: OperatorRedeemCall; 769 | 770 | constructor(call: OperatorRedeemCall) { 771 | this._call = call; 772 | } 773 | 774 | get account(): Address { 775 | return this._call.inputValues[0].value.toAddress(); 776 | } 777 | 778 | get amount(): BigInt { 779 | return this._call.inputValues[1].value.toBigInt(); 780 | } 781 | 782 | get data(): Bytes { 783 | return this._call.inputValues[2].value.toBytes(); 784 | } 785 | 786 | get operatorData(): Bytes { 787 | return this._call.inputValues[3].value.toBytes(); 788 | } 789 | } 790 | 791 | export class OperatorRedeemCall__Outputs { 792 | _call: OperatorRedeemCall; 793 | 794 | constructor(call: OperatorRedeemCall) { 795 | this._call = call; 796 | } 797 | } 798 | 799 | export class OperatorSendCall extends ethereum.Call { 800 | get inputs(): OperatorSendCall__Inputs { 801 | return new OperatorSendCall__Inputs(this); 802 | } 803 | 804 | get outputs(): OperatorSendCall__Outputs { 805 | return new OperatorSendCall__Outputs(this); 806 | } 807 | } 808 | 809 | export class OperatorSendCall__Inputs { 810 | _call: OperatorSendCall; 811 | 812 | constructor(call: OperatorSendCall) { 813 | this._call = call; 814 | } 815 | 816 | get sender(): Address { 817 | return this._call.inputValues[0].value.toAddress(); 818 | } 819 | 820 | get recipient(): Address { 821 | return this._call.inputValues[1].value.toAddress(); 822 | } 823 | 824 | get amount(): BigInt { 825 | return this._call.inputValues[2].value.toBigInt(); 826 | } 827 | 828 | get data(): Bytes { 829 | return this._call.inputValues[3].value.toBytes(); 830 | } 831 | 832 | get operatorData(): Bytes { 833 | return this._call.inputValues[4].value.toBytes(); 834 | } 835 | } 836 | 837 | export class OperatorSendCall__Outputs { 838 | _call: OperatorSendCall; 839 | 840 | constructor(call: OperatorSendCall) { 841 | this._call = call; 842 | } 843 | } 844 | 845 | export class PoolMintCall extends ethereum.Call { 846 | get inputs(): PoolMintCall__Inputs { 847 | return new PoolMintCall__Inputs(this); 848 | } 849 | 850 | get outputs(): PoolMintCall__Outputs { 851 | return new PoolMintCall__Outputs(this); 852 | } 853 | } 854 | 855 | export class PoolMintCall__Inputs { 856 | _call: PoolMintCall; 857 | 858 | constructor(call: PoolMintCall) { 859 | this._call = call; 860 | } 861 | 862 | get amount(): BigInt { 863 | return this._call.inputValues[0].value.toBigInt(); 864 | } 865 | } 866 | 867 | export class PoolMintCall__Outputs { 868 | _call: PoolMintCall; 869 | 870 | constructor(call: PoolMintCall) { 871 | this._call = call; 872 | } 873 | } 874 | 875 | export class PoolRedeemCall extends ethereum.Call { 876 | get inputs(): PoolRedeemCall__Inputs { 877 | return new PoolRedeemCall__Inputs(this); 878 | } 879 | 880 | get outputs(): PoolRedeemCall__Outputs { 881 | return new PoolRedeemCall__Outputs(this); 882 | } 883 | } 884 | 885 | export class PoolRedeemCall__Inputs { 886 | _call: PoolRedeemCall; 887 | 888 | constructor(call: PoolRedeemCall) { 889 | this._call = call; 890 | } 891 | 892 | get from(): Address { 893 | return this._call.inputValues[0].value.toAddress(); 894 | } 895 | 896 | get amount(): BigInt { 897 | return this._call.inputValues[1].value.toBigInt(); 898 | } 899 | } 900 | 901 | export class PoolRedeemCall__Outputs { 902 | _call: PoolRedeemCall; 903 | 904 | constructor(call: PoolRedeemCall) { 905 | this._call = call; 906 | } 907 | } 908 | 909 | export class RedeemCall extends ethereum.Call { 910 | get inputs(): RedeemCall__Inputs { 911 | return new RedeemCall__Inputs(this); 912 | } 913 | 914 | get outputs(): RedeemCall__Outputs { 915 | return new RedeemCall__Outputs(this); 916 | } 917 | } 918 | 919 | export class RedeemCall__Inputs { 920 | _call: RedeemCall; 921 | 922 | constructor(call: RedeemCall) { 923 | this._call = call; 924 | } 925 | 926 | get amount(): BigInt { 927 | return this._call.inputValues[0].value.toBigInt(); 928 | } 929 | 930 | get data(): Bytes { 931 | return this._call.inputValues[1].value.toBytes(); 932 | } 933 | } 934 | 935 | export class RedeemCall__Outputs { 936 | _call: RedeemCall; 937 | 938 | constructor(call: RedeemCall) { 939 | this._call = call; 940 | } 941 | } 942 | 943 | export class RevokeOperatorCall extends ethereum.Call { 944 | get inputs(): RevokeOperatorCall__Inputs { 945 | return new RevokeOperatorCall__Inputs(this); 946 | } 947 | 948 | get outputs(): RevokeOperatorCall__Outputs { 949 | return new RevokeOperatorCall__Outputs(this); 950 | } 951 | } 952 | 953 | export class RevokeOperatorCall__Inputs { 954 | _call: RevokeOperatorCall; 955 | 956 | constructor(call: RevokeOperatorCall) { 957 | this._call = call; 958 | } 959 | 960 | get operator(): Address { 961 | return this._call.inputValues[0].value.toAddress(); 962 | } 963 | } 964 | 965 | export class RevokeOperatorCall__Outputs { 966 | _call: RevokeOperatorCall; 967 | 968 | constructor(call: RevokeOperatorCall) { 969 | this._call = call; 970 | } 971 | } 972 | 973 | export class SendCall extends ethereum.Call { 974 | get inputs(): SendCall__Inputs { 975 | return new SendCall__Inputs(this); 976 | } 977 | 978 | get outputs(): SendCall__Outputs { 979 | return new SendCall__Outputs(this); 980 | } 981 | } 982 | 983 | export class SendCall__Inputs { 984 | _call: SendCall; 985 | 986 | constructor(call: SendCall) { 987 | this._call = call; 988 | } 989 | 990 | get recipient(): Address { 991 | return this._call.inputValues[0].value.toAddress(); 992 | } 993 | 994 | get amount(): BigInt { 995 | return this._call.inputValues[1].value.toBigInt(); 996 | } 997 | 998 | get data(): Bytes { 999 | return this._call.inputValues[2].value.toBytes(); 1000 | } 1001 | } 1002 | 1003 | export class SendCall__Outputs { 1004 | _call: SendCall; 1005 | 1006 | constructor(call: SendCall) { 1007 | this._call = call; 1008 | } 1009 | } 1010 | 1011 | export class TransferCall extends ethereum.Call { 1012 | get inputs(): TransferCall__Inputs { 1013 | return new TransferCall__Inputs(this); 1014 | } 1015 | 1016 | get outputs(): TransferCall__Outputs { 1017 | return new TransferCall__Outputs(this); 1018 | } 1019 | } 1020 | 1021 | export class TransferCall__Inputs { 1022 | _call: TransferCall; 1023 | 1024 | constructor(call: TransferCall) { 1025 | this._call = call; 1026 | } 1027 | 1028 | get recipient(): Address { 1029 | return this._call.inputValues[0].value.toAddress(); 1030 | } 1031 | 1032 | get amount(): BigInt { 1033 | return this._call.inputValues[1].value.toBigInt(); 1034 | } 1035 | } 1036 | 1037 | export class TransferCall__Outputs { 1038 | _call: TransferCall; 1039 | 1040 | constructor(call: TransferCall) { 1041 | this._call = call; 1042 | } 1043 | 1044 | get value0(): boolean { 1045 | return this._call.outputValues[0].value.toBoolean(); 1046 | } 1047 | } 1048 | 1049 | export class TransferFromCall extends ethereum.Call { 1050 | get inputs(): TransferFromCall__Inputs { 1051 | return new TransferFromCall__Inputs(this); 1052 | } 1053 | 1054 | get outputs(): TransferFromCall__Outputs { 1055 | return new TransferFromCall__Outputs(this); 1056 | } 1057 | } 1058 | 1059 | export class TransferFromCall__Inputs { 1060 | _call: TransferFromCall; 1061 | 1062 | constructor(call: TransferFromCall) { 1063 | this._call = call; 1064 | } 1065 | 1066 | get holder(): Address { 1067 | return this._call.inputValues[0].value.toAddress(); 1068 | } 1069 | 1070 | get recipient(): Address { 1071 | return this._call.inputValues[1].value.toAddress(); 1072 | } 1073 | 1074 | get amount(): BigInt { 1075 | return this._call.inputValues[2].value.toBigInt(); 1076 | } 1077 | } 1078 | 1079 | export class TransferFromCall__Outputs { 1080 | _call: TransferFromCall; 1081 | 1082 | constructor(call: TransferFromCall) { 1083 | this._call = call; 1084 | } 1085 | 1086 | get value0(): boolean { 1087 | return this._call.outputValues[0].value.toBoolean(); 1088 | } 1089 | } 1090 | 1091 | export class SetRecipientWhitelistEnabledCall extends ethereum.Call { 1092 | get inputs(): SetRecipientWhitelistEnabledCall__Inputs { 1093 | return new SetRecipientWhitelistEnabledCall__Inputs(this); 1094 | } 1095 | 1096 | get outputs(): SetRecipientWhitelistEnabledCall__Outputs { 1097 | return new SetRecipientWhitelistEnabledCall__Outputs(this); 1098 | } 1099 | } 1100 | 1101 | export class SetRecipientWhitelistEnabledCall__Inputs { 1102 | _call: SetRecipientWhitelistEnabledCall; 1103 | 1104 | constructor(call: SetRecipientWhitelistEnabledCall) { 1105 | this._call = call; 1106 | } 1107 | 1108 | get _enabled(): boolean { 1109 | return this._call.inputValues[0].value.toBoolean(); 1110 | } 1111 | } 1112 | 1113 | export class SetRecipientWhitelistEnabledCall__Outputs { 1114 | _call: SetRecipientWhitelistEnabledCall; 1115 | 1116 | constructor(call: SetRecipientWhitelistEnabledCall) { 1117 | this._call = call; 1118 | } 1119 | } 1120 | 1121 | export class SetRecipientWhitelistedCall extends ethereum.Call { 1122 | get inputs(): SetRecipientWhitelistedCall__Inputs { 1123 | return new SetRecipientWhitelistedCall__Inputs(this); 1124 | } 1125 | 1126 | get outputs(): SetRecipientWhitelistedCall__Outputs { 1127 | return new SetRecipientWhitelistedCall__Outputs(this); 1128 | } 1129 | } 1130 | 1131 | export class SetRecipientWhitelistedCall__Inputs { 1132 | _call: SetRecipientWhitelistedCall; 1133 | 1134 | constructor(call: SetRecipientWhitelistedCall) { 1135 | this._call = call; 1136 | } 1137 | 1138 | get _recipient(): Address { 1139 | return this._call.inputValues[0].value.toAddress(); 1140 | } 1141 | 1142 | get _whitelisted(): boolean { 1143 | return this._call.inputValues[1].value.toBoolean(); 1144 | } 1145 | } 1146 | 1147 | export class SetRecipientWhitelistedCall__Outputs { 1148 | _call: SetRecipientWhitelistedCall; 1149 | 1150 | constructor(call: SetRecipientWhitelistedCall) { 1151 | this._call = call; 1152 | } 1153 | } 1154 | --------------------------------------------------------------------------------