From 74e2cab17f8974f964cdc3425f7fc467b56f8906 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 25 Sep 2023 12:47:53 +0400 Subject: [PATCH 01/81] Shift TokenRecord and TokenSupply to be immutable entities --- schema.graphql | 4 +- .../arbitrum/src/contracts/JonesStaking.ts | 4 +- subgraphs/arbitrum/src/contracts/Sentiment.ts | 4 +- subgraphs/arbitrum/src/contracts/Silo.ts | 4 +- .../arbitrum/src/contracts/TreasureMining.ts | 4 +- .../arbitrum/src/treasury/OhmCalculations.ts | 14 +++---- .../arbitrum/src/treasury/OwnedLiquidity.ts | 4 +- .../src/contracts/CoolerLoansClearinghouse.ts | 4 +- .../src/liquidity/LiquidityBalancer.ts | 8 ++-- .../ethereum/src/liquidity/LiquidityCurve.ts | 12 +++--- .../src/liquidity/LiquidityFraxSwap.ts | 8 ++-- .../src/liquidity/LiquidityUniswapV2.ts | 8 ++-- .../src/liquidity/LiquidityUniswapV3.ts | 8 ++-- .../ethereum/src/utils/ContractHelper.ts | 40 +++++++++---------- subgraphs/ethereum/src/utils/ERC4626.ts | 4 +- .../ethereum/src/utils/OhmCalculations.ts | 26 ++++++------ subgraphs/ethereum/src/utils/Silo.ts | 4 +- .../ethereum/tests/tokenRecordHelper.test.ts | 14 +++---- .../fantom/src/treasury/OwnedLiquidity.ts | 4 +- .../polygon/src/treasury/OwnedLiquidity.ts | 4 +- subgraphs/shared/src/contracts/ERC20.ts | 4 +- .../shared/src/utils/TokenRecordHelper.ts | 7 +--- .../shared/src/utils/TokenSupplyHelper.ts | 7 +--- 23 files changed, 97 insertions(+), 103 deletions(-) diff --git a/schema.graphql b/schema.graphql index 355dbe76..fb72c565 100644 --- a/schema.graphql +++ b/schema.graphql @@ -66,7 +66,7 @@ type BondDiscount @entity { } # Represents the balance of a specific token in the treasury -type TokenRecord @entity { +type TokenRecord @entity(immutable: true) { id: ID! # YYYY-MM-DD// block: BigInt! timestamp: BigInt! # Unix timestamp in UTC @@ -87,7 +87,7 @@ type TokenRecord @entity { } # Represents a balance that affects the supply of OHM -type TokenSupply @entity { +type TokenSupply @entity(immutable: true) { id: ID! # YYYY-MM-DD//// block: BigInt! timestamp: BigInt! # Unix timestamp in UTC diff --git a/subgraphs/arbitrum/src/contracts/JonesStaking.ts b/subgraphs/arbitrum/src/contracts/JonesStaking.ts index f3196793..6a8b278b 100644 --- a/subgraphs/arbitrum/src/contracts/JonesStaking.ts +++ b/subgraphs/arbitrum/src/contracts/JonesStaking.ts @@ -5,7 +5,7 @@ import { getDecimals } from "../../../shared/src/contracts/ERC20"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { addressesEqual } from "../../../shared/src/utils/StringHelper"; import { - createOrUpdateTokenRecord, + createTokenRecord, getIsTokenLiquid, getTokenRecordValue, } from "../../../shared/src/utils/TokenRecordHelper"; @@ -102,7 +102,7 @@ export const getStakedBalances = ( price = getPrice(tokenAddress, block); } - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( timestamp, getContractName(tokenAddress, "Staked"), tokenAddress, diff --git a/subgraphs/arbitrum/src/contracts/Sentiment.ts b/subgraphs/arbitrum/src/contracts/Sentiment.ts index c0eb59f3..34c1dc07 100644 --- a/subgraphs/arbitrum/src/contracts/Sentiment.ts +++ b/subgraphs/arbitrum/src/contracts/Sentiment.ts @@ -4,7 +4,7 @@ import { TokenSupply } from "../../../shared/generated/schema"; import { ERC20_OHM, SENTIMENT_LTOKEN } from "./Constants"; import { ERC20 } from "../../generated/TokenRecords-arbitrum/ERC20"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { TYPE_LENDING, createOrUpdateTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; +import { TYPE_LENDING, createTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; import { getContractName, getWalletAddressesForContract } from "./Contracts"; export function getSentimentSupply(timestamp: BigInt, blockNumber: BigInt): TokenSupply[] { @@ -30,7 +30,7 @@ export function getSentimentSupply(timestamp: BigInt, blockNumber: BigInt): Toke log.info("getSentimentSupply: Sentiment OHM balance {} for wallet {}", [balance.toString(), getContractName(currentWallet)]); records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM), ERC20_OHM, diff --git a/subgraphs/arbitrum/src/contracts/Silo.ts b/subgraphs/arbitrum/src/contracts/Silo.ts index 4d2b9bd9..08006d31 100644 --- a/subgraphs/arbitrum/src/contracts/Silo.ts +++ b/subgraphs/arbitrum/src/contracts/Silo.ts @@ -4,7 +4,7 @@ import { TokenSupply } from "../../../shared/generated/schema"; import { ERC20_OHM } from "./Constants"; import { ERC20 } from "../../generated/TokenRecords-arbitrum/ERC20"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { TYPE_LENDING, createOrUpdateTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; +import { TYPE_LENDING, createTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; import { getContractName, getWalletAddressesForContract } from "./Contracts"; // Hard-coding this for now. If we wanted this to be generalisable, we would use the Silo Repository contract. @@ -33,7 +33,7 @@ export function getSiloSupply(timestamp: BigInt, blockNumber: BigInt): TokenSupp log.info("getSiloSupply: Silo OHM balance {} for wallet {}", [balance.toString(), getContractName(currentWallet)]); records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM), ERC20_OHM, diff --git a/subgraphs/arbitrum/src/contracts/TreasureMining.ts b/subgraphs/arbitrum/src/contracts/TreasureMining.ts index f518ca92..86daf170 100644 --- a/subgraphs/arbitrum/src/contracts/TreasureMining.ts +++ b/subgraphs/arbitrum/src/contracts/TreasureMining.ts @@ -3,7 +3,7 @@ import { Address, BigDecimal, BigInt } from "@graphprotocol/graph-ts"; import { TokenRecord } from "../../../shared/generated/schema"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { addressesEqual } from "../../../shared/src/utils/StringHelper"; -import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; +import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; import { WALLET_ADDRESSES } from "../../../shared/src/Wallets"; import { TreasureMining } from "../../generated/TokenRecords-arbitrum/TreasureMining"; import { getPrice } from "../price/PriceLookup"; @@ -105,7 +105,7 @@ export const getStakedBalances = ( price = getPrice(tokenAddress, block); } - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( timestamp, getContractName(tokenAddress, "Staked", "veMAGIC"), tokenAddress, diff --git a/subgraphs/arbitrum/src/treasury/OhmCalculations.ts b/subgraphs/arbitrum/src/treasury/OhmCalculations.ts index edafa6bf..037914fb 100644 --- a/subgraphs/arbitrum/src/treasury/OhmCalculations.ts +++ b/subgraphs/arbitrum/src/treasury/OhmCalculations.ts @@ -5,7 +5,7 @@ import { getERC20DecimalBalance } from "../../../shared/src/contracts/ERC20"; import { pushTokenSupplyArray } from "../../../shared/src/utils/ArrayHelper"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { LendingMarketDeployment } from "../../../shared/src/utils/LendingMarketDeployment"; -import { createOrUpdateTokenSupply, TYPE_LENDING, TYPE_LIQUIDITY, TYPE_TOTAL_SUPPLY, TYPE_TREASURY } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createTokenSupply, TYPE_LENDING, TYPE_LIQUIDITY, TYPE_TOTAL_SUPPLY, TYPE_TREASURY } from "../../../shared/src/utils/TokenSupplyHelper"; import { ERC20 } from "../../generated/TokenRecords-arbitrum/ERC20"; import { OlympusLender } from "../../generated/TokenRecords-arbitrum/OlympusLender"; import { CIRCULATING_SUPPLY_WALLETS, ERC20_GOHM_SYNAPSE, ERC20_OHM, OLYMPUS_LENDER, SENTIMENT_DEPLOYMENTS, SENTIMENT_LTOKEN, SILO_ADDRESS, SILO_DEPLOYMENTS } from "../contracts/Constants"; @@ -33,7 +33,7 @@ export function getTotalSupply(timestamp: BigInt, blockNumber: BigInt): TokenSup } const totalSupply = toDecimal(totalSupplyResult.value, decimalsResult.value); - return [createOrUpdateTokenSupply( + return [createTokenSupply( timestamp, getContractName(ERC20_OHM), ERC20_OHM, null, null, null, null, TYPE_TOTAL_SUPPLY, totalSupply, blockNumber)]; } @@ -76,7 +76,7 @@ export function getLendingAMOOHMRecords(timestamp: BigInt, blockNumber: BigInt): } records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM), ERC20_OHM, @@ -122,7 +122,7 @@ function getLendingMarketManualDeploymentOHMRecords(timestamp: BigInt, deploymen // Record the balance at the current block records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM), ERC20_OHM, @@ -225,7 +225,7 @@ export function getTreasuryOHMRecords(timestamp: BigInt, blockNumber: BigInt): T * and the frontend will use the index to convert gOHM to OHM. */ records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_GOHM_SYNAPSE), ERC20_GOHM_SYNAPSE, @@ -248,7 +248,7 @@ export function getTreasuryOHMRecords(timestamp: BigInt, blockNumber: BigInt): T if (balance.equals(BigDecimal.zero())) continue; records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM), ERC20_OHM, @@ -306,7 +306,7 @@ export function getProtocolOwnedLiquiditySupplyRecords( } records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(currentOhmToken), currentOhmToken, diff --git a/subgraphs/arbitrum/src/treasury/OwnedLiquidity.ts b/subgraphs/arbitrum/src/treasury/OwnedLiquidity.ts index a8508226..5b65a238 100644 --- a/subgraphs/arbitrum/src/treasury/OwnedLiquidity.ts +++ b/subgraphs/arbitrum/src/treasury/OwnedLiquidity.ts @@ -4,7 +4,7 @@ import { TokenRecord } from "../../../shared/generated/schema"; import { PriceHandler } from "../../../shared/src/price/PriceHandler"; import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { - createOrUpdateTokenRecord, + createTokenRecord, getIsTokenLiquid, } from "../../../shared/src/utils/TokenRecordHelper"; import { WALLET_ADDRESSES } from "../../../shared/src/Wallets"; @@ -61,7 +61,7 @@ function getOwnedLiquidityBalance( } // Create record - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( timestamp, getContractName(liquidityHandler.getId()), liquidityHandler.getId(), diff --git a/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts b/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts index 2e533c90..58284c8b 100644 --- a/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts +++ b/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts @@ -2,7 +2,7 @@ import { Address, BigInt, log } from "@graphprotocol/graph-ts"; import { TokenRecord } from "../../../shared/generated/schema"; import { CoolerLoansClearinghouse } from "../../generated/ProtocolMetrics/CoolerLoansClearinghouse"; import { COOLER_LOANS_CLEARINGHOUSE } from "../../../shared/src/Wallets"; -import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; +import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; import { BLOCKCHAIN, ERC20_DAI, ERC20_TOKENS, getContractName } from "../utils/Constants"; import { getUSDRate } from "../utils/Price"; import { toDecimal } from "../../../shared/src/utils/Decimals"; @@ -23,7 +23,7 @@ export function getClearinghouseBalance(timestamp: BigInt, blockNumber: BigInt): log.info(`Cooler Loans Clearinghouse receivables balance: {}`, [receivablesBalance.toString()]); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, `${getContractName(ERC20_DAI)} - Borrowed Through Cooler Loans`, ERC20_DAI, diff --git a/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts b/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts index aa5a66cc..43da7536 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts @@ -4,8 +4,8 @@ import { TokenRecord, TokenSupply } from "../../../shared/generated/schema"; import { TokenCategoryPOL } from "../../../shared/src/contracts/TokenDefinition"; import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; -import { createOrUpdateTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; +import { createTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; import { ERC20 } from "../../generated/PriceSnapshot/ERC20"; import { BalancerPoolToken } from "../../generated/ProtocolMetrics/BalancerPoolToken"; import { BalancerVault } from "../../generated/ProtocolMetrics/BalancerVault"; @@ -263,7 +263,7 @@ function getBalancerPoolTokenRecords( [getContractName(poolTokenAddress), balance.toString(), getContractName(walletAddress)], ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(poolTokenAddress), poolTokenAddress, @@ -490,7 +490,7 @@ export function getBalancerPoolTokenQuantity( const tokenBalance = totalQuantity.times(record.balance).div(poolTokenTotalSupply); records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(tokenAddress), tokenAddress, diff --git a/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts b/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts index 91f3d093..6d6e253d 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts @@ -4,8 +4,8 @@ import { log } from "matchstick-as"; import { TokenRecord, TokenSupply } from "../../../shared/generated/schema"; import { TokenDefinition } from "../../../shared/src/contracts/TokenDefinition"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { createOrUpdateTokenRecord, getTokenCategory } from "../../../shared/src/utils/TokenRecordHelper"; -import { createOrUpdateTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createTokenRecord, getTokenCategory } from "../../../shared/src/utils/TokenRecordHelper"; +import { createTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; import { CurvePool } from "../../generated/ProtocolMetrics/CurvePool"; import { CurvePoolV2 } from "../../generated/ProtocolMetrics/CurvePoolV2"; import { ERC20TokenSnapshot, PoolSnapshot } from "../../generated/schema"; @@ -222,7 +222,7 @@ function getCurvePairConvexStakedRecord( balance.toString(), ], ); - return createOrUpdateTokenRecord( + return createTokenRecord( timestamp, getContractName(stakedTokenDefinition.getAddress(), "Staked in Convex"), stakedTokenDefinition.getAddress(), @@ -291,7 +291,7 @@ function getCurvePairFraxLockedRecord( balance.toString(), ], ); - return createOrUpdateTokenRecord( + return createTokenRecord( timestamp, getContractName(stakedTokenDefinition.getAddress(), "Staked in Frax"), stakedTokenDefinition.getAddress(), @@ -353,7 +353,7 @@ function getCurvePairRecord( pairTokenBalanceDecimal.toString(), ]); - return createOrUpdateTokenRecord( + return createTokenRecord( timestamp, getContractName(pairTokenAddress), pairTokenAddress, @@ -607,7 +607,7 @@ export function getCurvePairTokenQuantityRecords( const tokenBalance = totalQuantity.times(record.balance).div(poolSnapshot.totalSupply); records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(tokenAddress), tokenAddress, diff --git a/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts b/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts index 636b6cf3..93f965ed 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts @@ -3,8 +3,8 @@ import { Address, BigDecimal, BigInt, Bytes, log } from "@graphprotocol/graph-ts import { TokenRecord, TokenSupply } from "../../../shared/generated/schema"; import { TokenCategoryPOL } from "../../../shared/src/contracts/TokenDefinition"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; -import { createOrUpdateTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; +import { createTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; import { FraxSwapPool } from "../../generated/ProtocolMetrics/FraxSwapPool"; import { PoolSnapshot } from "../../generated/schema"; import { getOrCreateERC20TokenSnapshot } from "../contracts/ERC20"; @@ -208,7 +208,7 @@ function getFraxSwapPairTokenRecord( return null; } - return createOrUpdateTokenRecord( + return createTokenRecord( timestamp, getContractName(pairAddress), pairAddress, @@ -369,7 +369,7 @@ export function getFraxSwapPairTokenQuantityRecords( const tokenBalance = totalQuantity.times(record.balance).div(poolSnapshot.totalSupply); records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(tokenAddress), tokenAddress, diff --git a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts index ef14ef5c..7f0e4813 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts @@ -3,8 +3,8 @@ import { Address, BigDecimal, BigInt, Bytes, log } from "@graphprotocol/graph-ts import { TokenRecord, TokenSupply } from "../../../shared/generated/schema"; import { TokenCategoryPOL } from "../../../shared/src/contracts/TokenDefinition"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; -import { createOrUpdateTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; +import { createTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; import { UniswapV2Pair } from "../../generated/ProtocolMetrics/UniswapV2Pair"; import { PoolSnapshot } from "../../generated/schema"; import { getOrCreateERC20TokenSnapshot } from "../contracts/ERC20"; @@ -262,7 +262,7 @@ function getUniswapV2PairRecord( const pairTokenBalanceDecimal = toDecimal(pairTokenBalance, pairToken.decimals()); - return createOrUpdateTokenRecord( + return createTokenRecord( timestamp, getContractName(pairAddress), pairAddress, @@ -451,7 +451,7 @@ export function getUniswapV2PairTokenQuantity( const tokenBalance = totalQuantity.times(record.balance).div(poolTokenTotalSupply); records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(tokenAddress), tokenAddress, diff --git a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts index 40047390..58eb0c12 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts @@ -7,8 +7,8 @@ import { getUSDRate } from "../utils/Price"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { getERC20Decimals } from "../contracts/ERC20"; import { UniswapV3PositionManager } from "../../generated/ProtocolMetrics/UniswapV3PositionManager"; -import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; -import { TYPE_LIQUIDITY, createOrUpdateTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; +import { TYPE_LIQUIDITY, createTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; import { TokenCategoryPOL } from "../../../shared/src/contracts/TokenDefinition"; export const UNISWAP_V3_POSITION_MANAGER = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88"; @@ -184,7 +184,7 @@ export function getUniswapV3POLRecords( log.debug("getUniswapV3POLRecords: multiplier: {}", [multiplier.toString()]); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(pairAddress), pairAddress, @@ -325,7 +325,7 @@ export function getUniswapV3OhmSupply( const ohmBalance = balances[ohmIndex]; records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(tokenAddress), tokenAddress, diff --git a/subgraphs/ethereum/src/utils/ContractHelper.ts b/subgraphs/ethereum/src/utils/ContractHelper.ts index 1036dd70..dcc99430 100644 --- a/subgraphs/ethereum/src/utils/ContractHelper.ts +++ b/subgraphs/ethereum/src/utils/ContractHelper.ts @@ -4,7 +4,7 @@ import { TokenRecord } from "../../../shared/generated/schema"; import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { - createOrUpdateTokenRecord, + createTokenRecord, getIsTokenLiquid, getTokenCategory, } from "../../../shared/src/utils/TokenRecordHelper"; @@ -499,7 +499,7 @@ export function getERC20TokenRecordFromWallet( getContractName(walletAddress), blockNumber.toString(), ]); - return createOrUpdateTokenRecord( + return createTokenRecord( timestamp, getContractName(contractAddress), contractAddress, @@ -548,7 +548,7 @@ export function getVendorFinanceRecords( balance = balance.plus(currentDeployment.getAmount()); } - records.push(createOrUpdateTokenRecord( + records.push(createTokenRecord( timestamp, getContractName(contractAddress), contractAddress, @@ -599,7 +599,7 @@ export function getMysoFinanceRecords( balance = balance.plus(currentDeployment.getAmount()); } - records.push(createOrUpdateTokenRecord( + records.push(createTokenRecord( timestamp, getContractName(contractAddress), contractAddress, @@ -727,7 +727,7 @@ export function getAuraLockedBalancesFromWallets( ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(ERC20_AURA_VL), ERC20_AURA_VL, @@ -800,7 +800,7 @@ export function getBtrflyUnlockedBalancesFromWallets( ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress, "Unlocked"), // Needed to differentiate tokenAddress, @@ -873,7 +873,7 @@ export function getTokeStakedBalancesFromWallets( ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress, "Staked"), // Needed to differentiate as there is no token for TOKE tokenAddress, @@ -968,7 +968,7 @@ export function getLiquityStakedBalancesFromWallets( ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress, "Staked"), // Needed to differentiate as there is no token for LQTY tokenAddress, @@ -1118,7 +1118,7 @@ export function getBalancerGaugeBalanceFromWallets( ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress, "Gauge Deposit"), tokenAddress, @@ -1262,7 +1262,7 @@ export function getAuraStakedBalanceFromWallets( ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress, `Staked in ${getContractName(stakingAddress)}`), tokenAddress, @@ -1323,7 +1323,7 @@ export function getAuraPoolEarnedRecords(timestamp: BigInt, contractAddress: str ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(contractAddress, `Rewards from ${getContractName(poolAddress)}`), contractAddress, @@ -1442,7 +1442,7 @@ export function getTokeAllocatorRecords( if (!balance || balance.equals(BigDecimal.zero())) return records; records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress), tokenAddress, @@ -1536,7 +1536,7 @@ export function getRariAllocatorRecords( if (!balance || balance.equals(BigDecimal.zero())) return records; records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress), tokenAddress, @@ -1575,7 +1575,7 @@ export function getOnsenAllocatorRecords( if (!balance || balance.equals(BigDecimal.zero())) return records; records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress), tokenAddress, @@ -1746,7 +1746,7 @@ export function getConvexStakedRecords( blockNumber.ge(BigInt.fromString(CVX_CRV_WRITE_OFF_BLOCK))) { log.info("getConvexStakedRecords: Applying liquid backing multiplier of 0 to {} token record at block {}", [getContractName(ERC20_CVX_CRV), blockNumber.toString()]); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress, getContractName(stakingAddress)), tokenAddress, @@ -1764,7 +1764,7 @@ export function getConvexStakedRecords( } else { records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress, getContractName(stakingAddress)), tokenAddress, @@ -1936,7 +1936,7 @@ export function getLiquityStabilityPoolRecords( ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress, "Stability Pool"), tokenAddress, @@ -2017,7 +2017,7 @@ export function getVeFXSAllocatorRecords( [balance.toString(), getContractName(tokenAddress), blockNumber.toString()], ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress), tokenAddress, @@ -2080,7 +2080,7 @@ export function getVlCvxUnlockedRecords( if (!balance || balance.equals(BigDecimal.zero())) continue; records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, "Convex - Unlocked (vlCVX)", // Manual override tokenAddress, @@ -2129,7 +2129,7 @@ export function getMakerDSRRecords( if (!balance || balance.equals(BigDecimal.zero())) continue; records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, "DAI - Deposited in DSR", // Manual override tokenAddress, diff --git a/subgraphs/ethereum/src/utils/ERC4626.ts b/subgraphs/ethereum/src/utils/ERC4626.ts index 20264151..82ec7672 100644 --- a/subgraphs/ethereum/src/utils/ERC4626.ts +++ b/subgraphs/ethereum/src/utils/ERC4626.ts @@ -3,7 +3,7 @@ import { ERC4626 } from "../../generated/ProtocolMetrics/ERC4626"; import { BLOCKCHAIN, ERC4626_TOKENS, getContractName, getWalletAddressesForContract } from "./Constants"; import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { createOrUpdateTokenRecord, getIsTokenLiquid } from "../../../shared/src/utils/TokenRecordHelper"; +import { createTokenRecord, getIsTokenLiquid } from "../../../shared/src/utils/TokenRecordHelper"; import { getUSDRate } from "./Price"; import { TokenRecord } from "../../../shared/generated/schema"; @@ -41,7 +41,7 @@ function getERC4626TokenRecordFromWallets( } log.debug("getERC4626TokenRecordFromWallets: {} has balanceOf {} {} at block {}", [getContractName(walletAddress), balance.toString(), getContractName(tokenContractAddress), blockNumber.toString()]); - return createOrUpdateTokenRecord( + return createTokenRecord( timestamp, getContractName(tokenContractAddress), tokenContractAddress, diff --git a/subgraphs/ethereum/src/utils/OhmCalculations.ts b/subgraphs/ethereum/src/utils/OhmCalculations.ts index ec138885..80b8ccd2 100644 --- a/subgraphs/ethereum/src/utils/OhmCalculations.ts +++ b/subgraphs/ethereum/src/utils/OhmCalculations.ts @@ -5,7 +5,7 @@ import { getCurrentIndex } from "../../../shared/src/supply/OhmCalculations"; import { pushTokenSupplyArray } from "../../../shared/src/utils/ArrayHelper"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { LendingMarketDeployment } from "../../../shared/src/utils/LendingMarketDeployment"; -import { createOrUpdateTokenSupply, TYPE_BONDS_DEPOSITS, TYPE_BONDS_PREMINTED, TYPE_BONDS_VESTING_DEPOSITS, TYPE_BONDS_VESTING_TOKENS, TYPE_BOOSTED_LIQUIDITY_VAULT, TYPE_LENDING, TYPE_LIQUIDITY, TYPE_OFFSET, TYPE_TOTAL_SUPPLY, TYPE_TREASURY } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createTokenSupply, TYPE_BONDS_DEPOSITS, TYPE_BONDS_PREMINTED, TYPE_BONDS_VESTING_DEPOSITS, TYPE_BONDS_VESTING_TOKENS, TYPE_BOOSTED_LIQUIDITY_VAULT, TYPE_LENDING, TYPE_LIQUIDITY, TYPE_OFFSET, TYPE_TOTAL_SUPPLY, TYPE_TREASURY } from "../../../shared/src/utils/TokenSupplyHelper"; import { OLYMPUS_ASSOCIATION_WALLET } from "../../../shared/src/Wallets"; import { BondManager } from "../../generated/ProtocolMetrics/BondManager"; import { IncurDebt } from "../../generated/ProtocolMetrics/IncurDebt"; @@ -122,7 +122,7 @@ export function getTotalSupplyRecord(timestamp: BigInt, blockNumber: BigInt): To const totalSupply = getTotalSupply(blockNumber); - return createOrUpdateTokenSupply( + return createTokenSupply( timestamp, getContractName(ohmContractAddress), ohmContractAddress, @@ -179,7 +179,7 @@ function getMigrationOffsetRecord(timestamp: BigInt, blockNumber: BigInt): Token offset.toString(), ]); - return createOrUpdateTokenSupply( + return createTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -233,7 +233,7 @@ export function getVestingBondSupplyRecords(timestamp: BigInt, blockNumber: BigI // OHM equivalent to the auction capacity is pre-minted and stored in the teller records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -263,7 +263,7 @@ export function getVestingBondSupplyRecords(timestamp: BigInt, blockNumber: BigI if (timestamp.lt(expiryTimestamp)) { // Vesting user deposits equal to the sold quantity are stored in the bond manager, so we adjust that records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -280,7 +280,7 @@ export function getVestingBondSupplyRecords(timestamp: BigInt, blockNumber: BigI // Vesting bond tokens equal to the auction capacity are stored in the teller, so we adjust that records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -300,7 +300,7 @@ export function getVestingBondSupplyRecords(timestamp: BigInt, blockNumber: BigI // User deposits equal to the sold quantity are stored in the bond manager, so we adjust that // These deposits will eventually be burned records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -350,7 +350,7 @@ function getLendingMarketDeploymentOHMRecords(timestamp: BigInt, deploymentAddre // Record the balance at the current block records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -442,7 +442,7 @@ export function getTreasuryOHMRecords(timestamp: BigInt, blockNumber: BigInt): T if (balance.equals(BigDecimal.zero())) continue; records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ohmContractAddress), ohmContractAddress, @@ -473,7 +473,7 @@ export function getTreasuryOHMRecords(timestamp: BigInt, blockNumber: BigInt): T const ohmBalance = blockNumber.ge(BigInt.fromString(SOHM_INDEX_CORRECTION_BLOCK)) ? balance : ohmIndex.times(balance); records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, `${getContractName(ERC20_OHM_V2)} in sOHM v3`, ERC20_OHM_V2, @@ -499,7 +499,7 @@ export function getTreasuryOHMRecords(timestamp: BigInt, blockNumber: BigInt): T const ohmBalance = ohmIndex.times(balance); records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, `${getContractName(ERC20_OHM_V2)} in gOHM`, ERC20_OHM_V2, @@ -630,7 +630,7 @@ export function getIncurDebtSupplyRecords(timestamp: BigInt, blockNumber: BigInt } records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -683,7 +683,7 @@ export function getBoostedLiquiditySupplyRecords(timestamp: BigInt, blockNumber: } records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, diff --git a/subgraphs/ethereum/src/utils/Silo.ts b/subgraphs/ethereum/src/utils/Silo.ts index 7ad8e3a9..8757ac5f 100644 --- a/subgraphs/ethereum/src/utils/Silo.ts +++ b/subgraphs/ethereum/src/utils/Silo.ts @@ -3,7 +3,7 @@ import { TokenSupply } from "../../../shared/generated/schema"; import { ERC20 } from "../../generated/ProtocolMetrics/ERC20"; import { ERC20_OHM_V2, getContractName, getWalletAddressesForContract } from "./Constants"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { TYPE_LENDING, createOrUpdateTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; +import { TYPE_LENDING, createTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; // Hard-coding this for now. If we wanted this to be generalisable, we would use the Silo Repository contract. const SILO_OHM_COLLATERAL_TOKEN = "0x907136B74abA7D5978341eBA903544134A66B065"; @@ -31,7 +31,7 @@ export function getSiloSupply(timestamp: BigInt, blockNumber: BigInt): TokenSupp log.info("getSiloSupply: Silo OHM balance {} for wallet {}", [balance.toString(), getContractName(currentWallet)]); records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, diff --git a/subgraphs/ethereum/tests/tokenRecordHelper.test.ts b/subgraphs/ethereum/tests/tokenRecordHelper.test.ts index 6255aef0..c690983f 100644 --- a/subgraphs/ethereum/tests/tokenRecordHelper.test.ts +++ b/subgraphs/ethereum/tests/tokenRecordHelper.test.ts @@ -8,7 +8,7 @@ import { TokenDefinition, } from "../../shared/src/contracts/TokenDefinition"; import { - createOrUpdateTokenRecord, + createTokenRecord, getTokenAddressesInCategory, isTokenAddressInCategory, } from "../../shared/src/utils/TokenRecordHelper"; @@ -24,7 +24,7 @@ import { const TIMESTAMP = BigInt.fromString("1"); const createTokenRecord = (): TokenRecord => { - return createOrUpdateTokenRecord( + return createTokenRecord( TIMESTAMP, "name", "tokenAddress", @@ -59,7 +59,7 @@ describe("constructor", () => { }); test("custom multiplier", () => { - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( TIMESTAMP, "name", "tokenAddress", @@ -89,7 +89,7 @@ describe("constructor", () => { describe("value", () => { test("multiplier = 1", () => { - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( TIMESTAMP, "name", "tokenAddress", @@ -109,7 +109,7 @@ describe("value", () => { }); test("multiplier = 0.25", () => { - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( TIMESTAMP, "name", "tokenAddress", @@ -133,7 +133,7 @@ describe("value", () => { const tokenDefinitions = new Map(); tokenDefinitions.set(ERC20_ALCX, new TokenDefinition(ERC20_ALCX, TokenCategoryVolatile, true, false, BigDecimal.fromString("0.5"))); - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( TIMESTAMP, "name", ERC20_ALCX, @@ -157,7 +157,7 @@ describe("value", () => { const tokenDefinitions = new Map(); tokenDefinitions.set(ERC20_ALCX, new TokenDefinition(ERC20_ALCX, TokenCategoryVolatile, true, false, BigDecimal.fromString("0.5"))); - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( TIMESTAMP, "name", ERC20_ALCX, diff --git a/subgraphs/fantom/src/treasury/OwnedLiquidity.ts b/subgraphs/fantom/src/treasury/OwnedLiquidity.ts index b7eb9e54..5c1435ab 100644 --- a/subgraphs/fantom/src/treasury/OwnedLiquidity.ts +++ b/subgraphs/fantom/src/treasury/OwnedLiquidity.ts @@ -4,7 +4,7 @@ import { TokenRecord } from "../../../shared/generated/schema"; import { PriceHandler } from "../../../shared/src/price/PriceHandler"; import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { - createOrUpdateTokenRecord, + createTokenRecord, getIsTokenLiquid, } from "../../../shared/src/utils/TokenRecordHelper"; import { WALLET_ADDRESSES } from "../../../shared/src/Wallets"; @@ -62,7 +62,7 @@ function getOwnedLiquidityBalance( } // Create record - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( timestamp, getContractName(liquidityHandler.getId()), liquidityHandler.getId(), diff --git a/subgraphs/polygon/src/treasury/OwnedLiquidity.ts b/subgraphs/polygon/src/treasury/OwnedLiquidity.ts index fac2bf15..1d3f393b 100644 --- a/subgraphs/polygon/src/treasury/OwnedLiquidity.ts +++ b/subgraphs/polygon/src/treasury/OwnedLiquidity.ts @@ -4,7 +4,7 @@ import { TokenRecord } from "../../../shared/generated/schema"; import { PriceHandler } from "../../../shared/src/price/PriceHandler"; import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { - createOrUpdateTokenRecord, + createTokenRecord, getIsTokenLiquid, } from "../../../shared/src/utils/TokenRecordHelper"; import { WALLET_ADDRESSES } from "../../../shared/src/Wallets"; @@ -62,7 +62,7 @@ function getOwnedLiquidityBalance( } // Create record - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( timestamp, getContractName(liquidityHandler.getId()), liquidityHandler.getId(), diff --git a/subgraphs/shared/src/contracts/ERC20.ts b/subgraphs/shared/src/contracts/ERC20.ts index 2211392f..c181b97a 100644 --- a/subgraphs/shared/src/contracts/ERC20.ts +++ b/subgraphs/shared/src/contracts/ERC20.ts @@ -3,7 +3,7 @@ import { Address, BigDecimal, BigInt, log } from "@graphprotocol/graph-ts"; import { ERC20 } from "../../generated/Price/ERC20"; import { TokenRecord } from "../../generated/schema"; import { toDecimal } from "../utils/Decimals"; -import { createOrUpdateTokenRecord, getIsTokenLiquid } from "../utils/TokenRecordHelper"; +import { createTokenRecord, getIsTokenLiquid } from "../utils/TokenRecordHelper"; import { ContractNameLookup } from "./ContractLookup"; import { TokenDefinition } from "./TokenDefinition"; @@ -103,7 +103,7 @@ export function getERC20TokenRecordFromWallet( ); if (!balance || balance.equals(BigDecimal.zero())) return null; - return createOrUpdateTokenRecord( + return createTokenRecord( timestamp, contractLookup(contractAddress), contractAddress, diff --git a/subgraphs/shared/src/utils/TokenRecordHelper.ts b/subgraphs/shared/src/utils/TokenRecordHelper.ts index c3f87224..c0b5e1fb 100644 --- a/subgraphs/shared/src/utils/TokenRecordHelper.ts +++ b/subgraphs/shared/src/utils/TokenRecordHelper.ts @@ -102,7 +102,7 @@ function getTokenMultiplier(tokenAddress: string, tokenDefinitions: Map/// - // Attempt to fetch the current day's record - const existingRecord = TokenSupply.load(recordId); - - const record = existingRecord ? existingRecord : new TokenSupply(recordId); + const record = new TokenSupply(recordId); record.block = blockNumber; record.date = dateString; From e65aaef70de2e33e5d66bf485731c0458f8f9a71 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 25 Sep 2023 12:49:00 +0400 Subject: [PATCH 02/81] Revert "Shift TokenRecord and TokenSupply to be immutable entities" This reverts commit 74e2cab17f8974f964cdc3425f7fc467b56f8906. --- schema.graphql | 4 +- .../arbitrum/src/contracts/JonesStaking.ts | 4 +- subgraphs/arbitrum/src/contracts/Sentiment.ts | 4 +- subgraphs/arbitrum/src/contracts/Silo.ts | 4 +- .../arbitrum/src/contracts/TreasureMining.ts | 4 +- .../arbitrum/src/treasury/OhmCalculations.ts | 14 +++---- .../arbitrum/src/treasury/OwnedLiquidity.ts | 4 +- .../src/contracts/CoolerLoansClearinghouse.ts | 4 +- .../src/liquidity/LiquidityBalancer.ts | 8 ++-- .../ethereum/src/liquidity/LiquidityCurve.ts | 12 +++--- .../src/liquidity/LiquidityFraxSwap.ts | 8 ++-- .../src/liquidity/LiquidityUniswapV2.ts | 8 ++-- .../src/liquidity/LiquidityUniswapV3.ts | 8 ++-- .../ethereum/src/utils/ContractHelper.ts | 40 +++++++++---------- subgraphs/ethereum/src/utils/ERC4626.ts | 4 +- .../ethereum/src/utils/OhmCalculations.ts | 26 ++++++------ subgraphs/ethereum/src/utils/Silo.ts | 4 +- .../ethereum/tests/tokenRecordHelper.test.ts | 14 +++---- .../fantom/src/treasury/OwnedLiquidity.ts | 4 +- .../polygon/src/treasury/OwnedLiquidity.ts | 4 +- subgraphs/shared/src/contracts/ERC20.ts | 4 +- .../shared/src/utils/TokenRecordHelper.ts | 7 +++- .../shared/src/utils/TokenSupplyHelper.ts | 7 +++- 23 files changed, 103 insertions(+), 97 deletions(-) diff --git a/schema.graphql b/schema.graphql index fb72c565..355dbe76 100644 --- a/schema.graphql +++ b/schema.graphql @@ -66,7 +66,7 @@ type BondDiscount @entity { } # Represents the balance of a specific token in the treasury -type TokenRecord @entity(immutable: true) { +type TokenRecord @entity { id: ID! # YYYY-MM-DD// block: BigInt! timestamp: BigInt! # Unix timestamp in UTC @@ -87,7 +87,7 @@ type TokenRecord @entity(immutable: true) { } # Represents a balance that affects the supply of OHM -type TokenSupply @entity(immutable: true) { +type TokenSupply @entity { id: ID! # YYYY-MM-DD//// block: BigInt! timestamp: BigInt! # Unix timestamp in UTC diff --git a/subgraphs/arbitrum/src/contracts/JonesStaking.ts b/subgraphs/arbitrum/src/contracts/JonesStaking.ts index 6a8b278b..f3196793 100644 --- a/subgraphs/arbitrum/src/contracts/JonesStaking.ts +++ b/subgraphs/arbitrum/src/contracts/JonesStaking.ts @@ -5,7 +5,7 @@ import { getDecimals } from "../../../shared/src/contracts/ERC20"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { addressesEqual } from "../../../shared/src/utils/StringHelper"; import { - createTokenRecord, + createOrUpdateTokenRecord, getIsTokenLiquid, getTokenRecordValue, } from "../../../shared/src/utils/TokenRecordHelper"; @@ -102,7 +102,7 @@ export const getStakedBalances = ( price = getPrice(tokenAddress, block); } - const record = createTokenRecord( + const record = createOrUpdateTokenRecord( timestamp, getContractName(tokenAddress, "Staked"), tokenAddress, diff --git a/subgraphs/arbitrum/src/contracts/Sentiment.ts b/subgraphs/arbitrum/src/contracts/Sentiment.ts index 34c1dc07..c0eb59f3 100644 --- a/subgraphs/arbitrum/src/contracts/Sentiment.ts +++ b/subgraphs/arbitrum/src/contracts/Sentiment.ts @@ -4,7 +4,7 @@ import { TokenSupply } from "../../../shared/generated/schema"; import { ERC20_OHM, SENTIMENT_LTOKEN } from "./Constants"; import { ERC20 } from "../../generated/TokenRecords-arbitrum/ERC20"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { TYPE_LENDING, createTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; +import { TYPE_LENDING, createOrUpdateTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; import { getContractName, getWalletAddressesForContract } from "./Contracts"; export function getSentimentSupply(timestamp: BigInt, blockNumber: BigInt): TokenSupply[] { @@ -30,7 +30,7 @@ export function getSentimentSupply(timestamp: BigInt, blockNumber: BigInt): Toke log.info("getSentimentSupply: Sentiment OHM balance {} for wallet {}", [balance.toString(), getContractName(currentWallet)]); records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(ERC20_OHM), ERC20_OHM, diff --git a/subgraphs/arbitrum/src/contracts/Silo.ts b/subgraphs/arbitrum/src/contracts/Silo.ts index 08006d31..4d2b9bd9 100644 --- a/subgraphs/arbitrum/src/contracts/Silo.ts +++ b/subgraphs/arbitrum/src/contracts/Silo.ts @@ -4,7 +4,7 @@ import { TokenSupply } from "../../../shared/generated/schema"; import { ERC20_OHM } from "./Constants"; import { ERC20 } from "../../generated/TokenRecords-arbitrum/ERC20"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { TYPE_LENDING, createTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; +import { TYPE_LENDING, createOrUpdateTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; import { getContractName, getWalletAddressesForContract } from "./Contracts"; // Hard-coding this for now. If we wanted this to be generalisable, we would use the Silo Repository contract. @@ -33,7 +33,7 @@ export function getSiloSupply(timestamp: BigInt, blockNumber: BigInt): TokenSupp log.info("getSiloSupply: Silo OHM balance {} for wallet {}", [balance.toString(), getContractName(currentWallet)]); records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(ERC20_OHM), ERC20_OHM, diff --git a/subgraphs/arbitrum/src/contracts/TreasureMining.ts b/subgraphs/arbitrum/src/contracts/TreasureMining.ts index 86daf170..f518ca92 100644 --- a/subgraphs/arbitrum/src/contracts/TreasureMining.ts +++ b/subgraphs/arbitrum/src/contracts/TreasureMining.ts @@ -3,7 +3,7 @@ import { Address, BigDecimal, BigInt } from "@graphprotocol/graph-ts"; import { TokenRecord } from "../../../shared/generated/schema"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { addressesEqual } from "../../../shared/src/utils/StringHelper"; -import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; +import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; import { WALLET_ADDRESSES } from "../../../shared/src/Wallets"; import { TreasureMining } from "../../generated/TokenRecords-arbitrum/TreasureMining"; import { getPrice } from "../price/PriceLookup"; @@ -105,7 +105,7 @@ export const getStakedBalances = ( price = getPrice(tokenAddress, block); } - const record = createTokenRecord( + const record = createOrUpdateTokenRecord( timestamp, getContractName(tokenAddress, "Staked", "veMAGIC"), tokenAddress, diff --git a/subgraphs/arbitrum/src/treasury/OhmCalculations.ts b/subgraphs/arbitrum/src/treasury/OhmCalculations.ts index 037914fb..edafa6bf 100644 --- a/subgraphs/arbitrum/src/treasury/OhmCalculations.ts +++ b/subgraphs/arbitrum/src/treasury/OhmCalculations.ts @@ -5,7 +5,7 @@ import { getERC20DecimalBalance } from "../../../shared/src/contracts/ERC20"; import { pushTokenSupplyArray } from "../../../shared/src/utils/ArrayHelper"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { LendingMarketDeployment } from "../../../shared/src/utils/LendingMarketDeployment"; -import { createTokenSupply, TYPE_LENDING, TYPE_LIQUIDITY, TYPE_TOTAL_SUPPLY, TYPE_TREASURY } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createOrUpdateTokenSupply, TYPE_LENDING, TYPE_LIQUIDITY, TYPE_TOTAL_SUPPLY, TYPE_TREASURY } from "../../../shared/src/utils/TokenSupplyHelper"; import { ERC20 } from "../../generated/TokenRecords-arbitrum/ERC20"; import { OlympusLender } from "../../generated/TokenRecords-arbitrum/OlympusLender"; import { CIRCULATING_SUPPLY_WALLETS, ERC20_GOHM_SYNAPSE, ERC20_OHM, OLYMPUS_LENDER, SENTIMENT_DEPLOYMENTS, SENTIMENT_LTOKEN, SILO_ADDRESS, SILO_DEPLOYMENTS } from "../contracts/Constants"; @@ -33,7 +33,7 @@ export function getTotalSupply(timestamp: BigInt, blockNumber: BigInt): TokenSup } const totalSupply = toDecimal(totalSupplyResult.value, decimalsResult.value); - return [createTokenSupply( + return [createOrUpdateTokenSupply( timestamp, getContractName(ERC20_OHM), ERC20_OHM, null, null, null, null, TYPE_TOTAL_SUPPLY, totalSupply, blockNumber)]; } @@ -76,7 +76,7 @@ export function getLendingAMOOHMRecords(timestamp: BigInt, blockNumber: BigInt): } records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(ERC20_OHM), ERC20_OHM, @@ -122,7 +122,7 @@ function getLendingMarketManualDeploymentOHMRecords(timestamp: BigInt, deploymen // Record the balance at the current block records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(ERC20_OHM), ERC20_OHM, @@ -225,7 +225,7 @@ export function getTreasuryOHMRecords(timestamp: BigInt, blockNumber: BigInt): T * and the frontend will use the index to convert gOHM to OHM. */ records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(ERC20_GOHM_SYNAPSE), ERC20_GOHM_SYNAPSE, @@ -248,7 +248,7 @@ export function getTreasuryOHMRecords(timestamp: BigInt, blockNumber: BigInt): T if (balance.equals(BigDecimal.zero())) continue; records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(ERC20_OHM), ERC20_OHM, @@ -306,7 +306,7 @@ export function getProtocolOwnedLiquiditySupplyRecords( } records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(currentOhmToken), currentOhmToken, diff --git a/subgraphs/arbitrum/src/treasury/OwnedLiquidity.ts b/subgraphs/arbitrum/src/treasury/OwnedLiquidity.ts index 5b65a238..a8508226 100644 --- a/subgraphs/arbitrum/src/treasury/OwnedLiquidity.ts +++ b/subgraphs/arbitrum/src/treasury/OwnedLiquidity.ts @@ -4,7 +4,7 @@ import { TokenRecord } from "../../../shared/generated/schema"; import { PriceHandler } from "../../../shared/src/price/PriceHandler"; import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { - createTokenRecord, + createOrUpdateTokenRecord, getIsTokenLiquid, } from "../../../shared/src/utils/TokenRecordHelper"; import { WALLET_ADDRESSES } from "../../../shared/src/Wallets"; @@ -61,7 +61,7 @@ function getOwnedLiquidityBalance( } // Create record - const record = createTokenRecord( + const record = createOrUpdateTokenRecord( timestamp, getContractName(liquidityHandler.getId()), liquidityHandler.getId(), diff --git a/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts b/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts index 58284c8b..2e533c90 100644 --- a/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts +++ b/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts @@ -2,7 +2,7 @@ import { Address, BigInt, log } from "@graphprotocol/graph-ts"; import { TokenRecord } from "../../../shared/generated/schema"; import { CoolerLoansClearinghouse } from "../../generated/ProtocolMetrics/CoolerLoansClearinghouse"; import { COOLER_LOANS_CLEARINGHOUSE } from "../../../shared/src/Wallets"; -import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; +import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; import { BLOCKCHAIN, ERC20_DAI, ERC20_TOKENS, getContractName } from "../utils/Constants"; import { getUSDRate } from "../utils/Price"; import { toDecimal } from "../../../shared/src/utils/Decimals"; @@ -23,7 +23,7 @@ export function getClearinghouseBalance(timestamp: BigInt, blockNumber: BigInt): log.info(`Cooler Loans Clearinghouse receivables balance: {}`, [receivablesBalance.toString()]); records.push( - createTokenRecord( + createOrUpdateTokenRecord( timestamp, `${getContractName(ERC20_DAI)} - Borrowed Through Cooler Loans`, ERC20_DAI, diff --git a/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts b/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts index 43da7536..aa5a66cc 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts @@ -4,8 +4,8 @@ import { TokenRecord, TokenSupply } from "../../../shared/generated/schema"; import { TokenCategoryPOL } from "../../../shared/src/contracts/TokenDefinition"; import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; -import { createTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; +import { createOrUpdateTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; import { ERC20 } from "../../generated/PriceSnapshot/ERC20"; import { BalancerPoolToken } from "../../generated/ProtocolMetrics/BalancerPoolToken"; import { BalancerVault } from "../../generated/ProtocolMetrics/BalancerVault"; @@ -263,7 +263,7 @@ function getBalancerPoolTokenRecords( [getContractName(poolTokenAddress), balance.toString(), getContractName(walletAddress)], ); records.push( - createTokenRecord( + createOrUpdateTokenRecord( timestamp, getContractName(poolTokenAddress), poolTokenAddress, @@ -490,7 +490,7 @@ export function getBalancerPoolTokenQuantity( const tokenBalance = totalQuantity.times(record.balance).div(poolTokenTotalSupply); records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(tokenAddress), tokenAddress, diff --git a/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts b/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts index 6d6e253d..91f3d093 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts @@ -4,8 +4,8 @@ import { log } from "matchstick-as"; import { TokenRecord, TokenSupply } from "../../../shared/generated/schema"; import { TokenDefinition } from "../../../shared/src/contracts/TokenDefinition"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { createTokenRecord, getTokenCategory } from "../../../shared/src/utils/TokenRecordHelper"; -import { createTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createOrUpdateTokenRecord, getTokenCategory } from "../../../shared/src/utils/TokenRecordHelper"; +import { createOrUpdateTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; import { CurvePool } from "../../generated/ProtocolMetrics/CurvePool"; import { CurvePoolV2 } from "../../generated/ProtocolMetrics/CurvePoolV2"; import { ERC20TokenSnapshot, PoolSnapshot } from "../../generated/schema"; @@ -222,7 +222,7 @@ function getCurvePairConvexStakedRecord( balance.toString(), ], ); - return createTokenRecord( + return createOrUpdateTokenRecord( timestamp, getContractName(stakedTokenDefinition.getAddress(), "Staked in Convex"), stakedTokenDefinition.getAddress(), @@ -291,7 +291,7 @@ function getCurvePairFraxLockedRecord( balance.toString(), ], ); - return createTokenRecord( + return createOrUpdateTokenRecord( timestamp, getContractName(stakedTokenDefinition.getAddress(), "Staked in Frax"), stakedTokenDefinition.getAddress(), @@ -353,7 +353,7 @@ function getCurvePairRecord( pairTokenBalanceDecimal.toString(), ]); - return createTokenRecord( + return createOrUpdateTokenRecord( timestamp, getContractName(pairTokenAddress), pairTokenAddress, @@ -607,7 +607,7 @@ export function getCurvePairTokenQuantityRecords( const tokenBalance = totalQuantity.times(record.balance).div(poolSnapshot.totalSupply); records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(tokenAddress), tokenAddress, diff --git a/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts b/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts index 93f965ed..636b6cf3 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts @@ -3,8 +3,8 @@ import { Address, BigDecimal, BigInt, Bytes, log } from "@graphprotocol/graph-ts import { TokenRecord, TokenSupply } from "../../../shared/generated/schema"; import { TokenCategoryPOL } from "../../../shared/src/contracts/TokenDefinition"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; -import { createTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; +import { createOrUpdateTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; import { FraxSwapPool } from "../../generated/ProtocolMetrics/FraxSwapPool"; import { PoolSnapshot } from "../../generated/schema"; import { getOrCreateERC20TokenSnapshot } from "../contracts/ERC20"; @@ -208,7 +208,7 @@ function getFraxSwapPairTokenRecord( return null; } - return createTokenRecord( + return createOrUpdateTokenRecord( timestamp, getContractName(pairAddress), pairAddress, @@ -369,7 +369,7 @@ export function getFraxSwapPairTokenQuantityRecords( const tokenBalance = totalQuantity.times(record.balance).div(poolSnapshot.totalSupply); records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(tokenAddress), tokenAddress, diff --git a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts index 7f0e4813..ef14ef5c 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts @@ -3,8 +3,8 @@ import { Address, BigDecimal, BigInt, Bytes, log } from "@graphprotocol/graph-ts import { TokenRecord, TokenSupply } from "../../../shared/generated/schema"; import { TokenCategoryPOL } from "../../../shared/src/contracts/TokenDefinition"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; -import { createTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; +import { createOrUpdateTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; import { UniswapV2Pair } from "../../generated/ProtocolMetrics/UniswapV2Pair"; import { PoolSnapshot } from "../../generated/schema"; import { getOrCreateERC20TokenSnapshot } from "../contracts/ERC20"; @@ -262,7 +262,7 @@ function getUniswapV2PairRecord( const pairTokenBalanceDecimal = toDecimal(pairTokenBalance, pairToken.decimals()); - return createTokenRecord( + return createOrUpdateTokenRecord( timestamp, getContractName(pairAddress), pairAddress, @@ -451,7 +451,7 @@ export function getUniswapV2PairTokenQuantity( const tokenBalance = totalQuantity.times(record.balance).div(poolTokenTotalSupply); records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(tokenAddress), tokenAddress, diff --git a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts index 58eb0c12..40047390 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts @@ -7,8 +7,8 @@ import { getUSDRate } from "../utils/Price"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { getERC20Decimals } from "../contracts/ERC20"; import { UniswapV3PositionManager } from "../../generated/ProtocolMetrics/UniswapV3PositionManager"; -import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; -import { TYPE_LIQUIDITY, createTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; +import { TYPE_LIQUIDITY, createOrUpdateTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; import { TokenCategoryPOL } from "../../../shared/src/contracts/TokenDefinition"; export const UNISWAP_V3_POSITION_MANAGER = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88"; @@ -184,7 +184,7 @@ export function getUniswapV3POLRecords( log.debug("getUniswapV3POLRecords: multiplier: {}", [multiplier.toString()]); records.push( - createTokenRecord( + createOrUpdateTokenRecord( timestamp, getContractName(pairAddress), pairAddress, @@ -325,7 +325,7 @@ export function getUniswapV3OhmSupply( const ohmBalance = balances[ohmIndex]; records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(tokenAddress), tokenAddress, diff --git a/subgraphs/ethereum/src/utils/ContractHelper.ts b/subgraphs/ethereum/src/utils/ContractHelper.ts index dcc99430..1036dd70 100644 --- a/subgraphs/ethereum/src/utils/ContractHelper.ts +++ b/subgraphs/ethereum/src/utils/ContractHelper.ts @@ -4,7 +4,7 @@ import { TokenRecord } from "../../../shared/generated/schema"; import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { - createTokenRecord, + createOrUpdateTokenRecord, getIsTokenLiquid, getTokenCategory, } from "../../../shared/src/utils/TokenRecordHelper"; @@ -499,7 +499,7 @@ export function getERC20TokenRecordFromWallet( getContractName(walletAddress), blockNumber.toString(), ]); - return createTokenRecord( + return createOrUpdateTokenRecord( timestamp, getContractName(contractAddress), contractAddress, @@ -548,7 +548,7 @@ export function getVendorFinanceRecords( balance = balance.plus(currentDeployment.getAmount()); } - records.push(createTokenRecord( + records.push(createOrUpdateTokenRecord( timestamp, getContractName(contractAddress), contractAddress, @@ -599,7 +599,7 @@ export function getMysoFinanceRecords( balance = balance.plus(currentDeployment.getAmount()); } - records.push(createTokenRecord( + records.push(createOrUpdateTokenRecord( timestamp, getContractName(contractAddress), contractAddress, @@ -727,7 +727,7 @@ export function getAuraLockedBalancesFromWallets( ); records.push( - createTokenRecord( + createOrUpdateTokenRecord( timestamp, getContractName(ERC20_AURA_VL), ERC20_AURA_VL, @@ -800,7 +800,7 @@ export function getBtrflyUnlockedBalancesFromWallets( ); records.push( - createTokenRecord( + createOrUpdateTokenRecord( timestamp, getContractName(tokenAddress, "Unlocked"), // Needed to differentiate tokenAddress, @@ -873,7 +873,7 @@ export function getTokeStakedBalancesFromWallets( ); records.push( - createTokenRecord( + createOrUpdateTokenRecord( timestamp, getContractName(tokenAddress, "Staked"), // Needed to differentiate as there is no token for TOKE tokenAddress, @@ -968,7 +968,7 @@ export function getLiquityStakedBalancesFromWallets( ); records.push( - createTokenRecord( + createOrUpdateTokenRecord( timestamp, getContractName(tokenAddress, "Staked"), // Needed to differentiate as there is no token for LQTY tokenAddress, @@ -1118,7 +1118,7 @@ export function getBalancerGaugeBalanceFromWallets( ); records.push( - createTokenRecord( + createOrUpdateTokenRecord( timestamp, getContractName(tokenAddress, "Gauge Deposit"), tokenAddress, @@ -1262,7 +1262,7 @@ export function getAuraStakedBalanceFromWallets( ); records.push( - createTokenRecord( + createOrUpdateTokenRecord( timestamp, getContractName(tokenAddress, `Staked in ${getContractName(stakingAddress)}`), tokenAddress, @@ -1323,7 +1323,7 @@ export function getAuraPoolEarnedRecords(timestamp: BigInt, contractAddress: str ); records.push( - createTokenRecord( + createOrUpdateTokenRecord( timestamp, getContractName(contractAddress, `Rewards from ${getContractName(poolAddress)}`), contractAddress, @@ -1442,7 +1442,7 @@ export function getTokeAllocatorRecords( if (!balance || balance.equals(BigDecimal.zero())) return records; records.push( - createTokenRecord( + createOrUpdateTokenRecord( timestamp, getContractName(tokenAddress), tokenAddress, @@ -1536,7 +1536,7 @@ export function getRariAllocatorRecords( if (!balance || balance.equals(BigDecimal.zero())) return records; records.push( - createTokenRecord( + createOrUpdateTokenRecord( timestamp, getContractName(tokenAddress), tokenAddress, @@ -1575,7 +1575,7 @@ export function getOnsenAllocatorRecords( if (!balance || balance.equals(BigDecimal.zero())) return records; records.push( - createTokenRecord( + createOrUpdateTokenRecord( timestamp, getContractName(tokenAddress), tokenAddress, @@ -1746,7 +1746,7 @@ export function getConvexStakedRecords( blockNumber.ge(BigInt.fromString(CVX_CRV_WRITE_OFF_BLOCK))) { log.info("getConvexStakedRecords: Applying liquid backing multiplier of 0 to {} token record at block {}", [getContractName(ERC20_CVX_CRV), blockNumber.toString()]); records.push( - createTokenRecord( + createOrUpdateTokenRecord( timestamp, getContractName(tokenAddress, getContractName(stakingAddress)), tokenAddress, @@ -1764,7 +1764,7 @@ export function getConvexStakedRecords( } else { records.push( - createTokenRecord( + createOrUpdateTokenRecord( timestamp, getContractName(tokenAddress, getContractName(stakingAddress)), tokenAddress, @@ -1936,7 +1936,7 @@ export function getLiquityStabilityPoolRecords( ); records.push( - createTokenRecord( + createOrUpdateTokenRecord( timestamp, getContractName(tokenAddress, "Stability Pool"), tokenAddress, @@ -2017,7 +2017,7 @@ export function getVeFXSAllocatorRecords( [balance.toString(), getContractName(tokenAddress), blockNumber.toString()], ); records.push( - createTokenRecord( + createOrUpdateTokenRecord( timestamp, getContractName(tokenAddress), tokenAddress, @@ -2080,7 +2080,7 @@ export function getVlCvxUnlockedRecords( if (!balance || balance.equals(BigDecimal.zero())) continue; records.push( - createTokenRecord( + createOrUpdateTokenRecord( timestamp, "Convex - Unlocked (vlCVX)", // Manual override tokenAddress, @@ -2129,7 +2129,7 @@ export function getMakerDSRRecords( if (!balance || balance.equals(BigDecimal.zero())) continue; records.push( - createTokenRecord( + createOrUpdateTokenRecord( timestamp, "DAI - Deposited in DSR", // Manual override tokenAddress, diff --git a/subgraphs/ethereum/src/utils/ERC4626.ts b/subgraphs/ethereum/src/utils/ERC4626.ts index 82ec7672..20264151 100644 --- a/subgraphs/ethereum/src/utils/ERC4626.ts +++ b/subgraphs/ethereum/src/utils/ERC4626.ts @@ -3,7 +3,7 @@ import { ERC4626 } from "../../generated/ProtocolMetrics/ERC4626"; import { BLOCKCHAIN, ERC4626_TOKENS, getContractName, getWalletAddressesForContract } from "./Constants"; import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { createTokenRecord, getIsTokenLiquid } from "../../../shared/src/utils/TokenRecordHelper"; +import { createOrUpdateTokenRecord, getIsTokenLiquid } from "../../../shared/src/utils/TokenRecordHelper"; import { getUSDRate } from "./Price"; import { TokenRecord } from "../../../shared/generated/schema"; @@ -41,7 +41,7 @@ function getERC4626TokenRecordFromWallets( } log.debug("getERC4626TokenRecordFromWallets: {} has balanceOf {} {} at block {}", [getContractName(walletAddress), balance.toString(), getContractName(tokenContractAddress), blockNumber.toString()]); - return createTokenRecord( + return createOrUpdateTokenRecord( timestamp, getContractName(tokenContractAddress), tokenContractAddress, diff --git a/subgraphs/ethereum/src/utils/OhmCalculations.ts b/subgraphs/ethereum/src/utils/OhmCalculations.ts index 80b8ccd2..ec138885 100644 --- a/subgraphs/ethereum/src/utils/OhmCalculations.ts +++ b/subgraphs/ethereum/src/utils/OhmCalculations.ts @@ -5,7 +5,7 @@ import { getCurrentIndex } from "../../../shared/src/supply/OhmCalculations"; import { pushTokenSupplyArray } from "../../../shared/src/utils/ArrayHelper"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { LendingMarketDeployment } from "../../../shared/src/utils/LendingMarketDeployment"; -import { createTokenSupply, TYPE_BONDS_DEPOSITS, TYPE_BONDS_PREMINTED, TYPE_BONDS_VESTING_DEPOSITS, TYPE_BONDS_VESTING_TOKENS, TYPE_BOOSTED_LIQUIDITY_VAULT, TYPE_LENDING, TYPE_LIQUIDITY, TYPE_OFFSET, TYPE_TOTAL_SUPPLY, TYPE_TREASURY } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createOrUpdateTokenSupply, TYPE_BONDS_DEPOSITS, TYPE_BONDS_PREMINTED, TYPE_BONDS_VESTING_DEPOSITS, TYPE_BONDS_VESTING_TOKENS, TYPE_BOOSTED_LIQUIDITY_VAULT, TYPE_LENDING, TYPE_LIQUIDITY, TYPE_OFFSET, TYPE_TOTAL_SUPPLY, TYPE_TREASURY } from "../../../shared/src/utils/TokenSupplyHelper"; import { OLYMPUS_ASSOCIATION_WALLET } from "../../../shared/src/Wallets"; import { BondManager } from "../../generated/ProtocolMetrics/BondManager"; import { IncurDebt } from "../../generated/ProtocolMetrics/IncurDebt"; @@ -122,7 +122,7 @@ export function getTotalSupplyRecord(timestamp: BigInt, blockNumber: BigInt): To const totalSupply = getTotalSupply(blockNumber); - return createTokenSupply( + return createOrUpdateTokenSupply( timestamp, getContractName(ohmContractAddress), ohmContractAddress, @@ -179,7 +179,7 @@ function getMigrationOffsetRecord(timestamp: BigInt, blockNumber: BigInt): Token offset.toString(), ]); - return createTokenSupply( + return createOrUpdateTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -233,7 +233,7 @@ export function getVestingBondSupplyRecords(timestamp: BigInt, blockNumber: BigI // OHM equivalent to the auction capacity is pre-minted and stored in the teller records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -263,7 +263,7 @@ export function getVestingBondSupplyRecords(timestamp: BigInt, blockNumber: BigI if (timestamp.lt(expiryTimestamp)) { // Vesting user deposits equal to the sold quantity are stored in the bond manager, so we adjust that records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -280,7 +280,7 @@ export function getVestingBondSupplyRecords(timestamp: BigInt, blockNumber: BigI // Vesting bond tokens equal to the auction capacity are stored in the teller, so we adjust that records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -300,7 +300,7 @@ export function getVestingBondSupplyRecords(timestamp: BigInt, blockNumber: BigI // User deposits equal to the sold quantity are stored in the bond manager, so we adjust that // These deposits will eventually be burned records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -350,7 +350,7 @@ function getLendingMarketDeploymentOHMRecords(timestamp: BigInt, deploymentAddre // Record the balance at the current block records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -442,7 +442,7 @@ export function getTreasuryOHMRecords(timestamp: BigInt, blockNumber: BigInt): T if (balance.equals(BigDecimal.zero())) continue; records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(ohmContractAddress), ohmContractAddress, @@ -473,7 +473,7 @@ export function getTreasuryOHMRecords(timestamp: BigInt, blockNumber: BigInt): T const ohmBalance = blockNumber.ge(BigInt.fromString(SOHM_INDEX_CORRECTION_BLOCK)) ? balance : ohmIndex.times(balance); records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, `${getContractName(ERC20_OHM_V2)} in sOHM v3`, ERC20_OHM_V2, @@ -499,7 +499,7 @@ export function getTreasuryOHMRecords(timestamp: BigInt, blockNumber: BigInt): T const ohmBalance = ohmIndex.times(balance); records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, `${getContractName(ERC20_OHM_V2)} in gOHM`, ERC20_OHM_V2, @@ -630,7 +630,7 @@ export function getIncurDebtSupplyRecords(timestamp: BigInt, blockNumber: BigInt } records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -683,7 +683,7 @@ export function getBoostedLiquiditySupplyRecords(timestamp: BigInt, blockNumber: } records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, diff --git a/subgraphs/ethereum/src/utils/Silo.ts b/subgraphs/ethereum/src/utils/Silo.ts index 8757ac5f..7ad8e3a9 100644 --- a/subgraphs/ethereum/src/utils/Silo.ts +++ b/subgraphs/ethereum/src/utils/Silo.ts @@ -3,7 +3,7 @@ import { TokenSupply } from "../../../shared/generated/schema"; import { ERC20 } from "../../generated/ProtocolMetrics/ERC20"; import { ERC20_OHM_V2, getContractName, getWalletAddressesForContract } from "./Constants"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { TYPE_LENDING, createTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; +import { TYPE_LENDING, createOrUpdateTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; // Hard-coding this for now. If we wanted this to be generalisable, we would use the Silo Repository contract. const SILO_OHM_COLLATERAL_TOKEN = "0x907136B74abA7D5978341eBA903544134A66B065"; @@ -31,7 +31,7 @@ export function getSiloSupply(timestamp: BigInt, blockNumber: BigInt): TokenSupp log.info("getSiloSupply: Silo OHM balance {} for wallet {}", [balance.toString(), getContractName(currentWallet)]); records.push( - createTokenSupply( + createOrUpdateTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, diff --git a/subgraphs/ethereum/tests/tokenRecordHelper.test.ts b/subgraphs/ethereum/tests/tokenRecordHelper.test.ts index c690983f..6255aef0 100644 --- a/subgraphs/ethereum/tests/tokenRecordHelper.test.ts +++ b/subgraphs/ethereum/tests/tokenRecordHelper.test.ts @@ -8,7 +8,7 @@ import { TokenDefinition, } from "../../shared/src/contracts/TokenDefinition"; import { - createTokenRecord, + createOrUpdateTokenRecord, getTokenAddressesInCategory, isTokenAddressInCategory, } from "../../shared/src/utils/TokenRecordHelper"; @@ -24,7 +24,7 @@ import { const TIMESTAMP = BigInt.fromString("1"); const createTokenRecord = (): TokenRecord => { - return createTokenRecord( + return createOrUpdateTokenRecord( TIMESTAMP, "name", "tokenAddress", @@ -59,7 +59,7 @@ describe("constructor", () => { }); test("custom multiplier", () => { - const record = createTokenRecord( + const record = createOrUpdateTokenRecord( TIMESTAMP, "name", "tokenAddress", @@ -89,7 +89,7 @@ describe("constructor", () => { describe("value", () => { test("multiplier = 1", () => { - const record = createTokenRecord( + const record = createOrUpdateTokenRecord( TIMESTAMP, "name", "tokenAddress", @@ -109,7 +109,7 @@ describe("value", () => { }); test("multiplier = 0.25", () => { - const record = createTokenRecord( + const record = createOrUpdateTokenRecord( TIMESTAMP, "name", "tokenAddress", @@ -133,7 +133,7 @@ describe("value", () => { const tokenDefinitions = new Map(); tokenDefinitions.set(ERC20_ALCX, new TokenDefinition(ERC20_ALCX, TokenCategoryVolatile, true, false, BigDecimal.fromString("0.5"))); - const record = createTokenRecord( + const record = createOrUpdateTokenRecord( TIMESTAMP, "name", ERC20_ALCX, @@ -157,7 +157,7 @@ describe("value", () => { const tokenDefinitions = new Map(); tokenDefinitions.set(ERC20_ALCX, new TokenDefinition(ERC20_ALCX, TokenCategoryVolatile, true, false, BigDecimal.fromString("0.5"))); - const record = createTokenRecord( + const record = createOrUpdateTokenRecord( TIMESTAMP, "name", ERC20_ALCX, diff --git a/subgraphs/fantom/src/treasury/OwnedLiquidity.ts b/subgraphs/fantom/src/treasury/OwnedLiquidity.ts index 5c1435ab..b7eb9e54 100644 --- a/subgraphs/fantom/src/treasury/OwnedLiquidity.ts +++ b/subgraphs/fantom/src/treasury/OwnedLiquidity.ts @@ -4,7 +4,7 @@ import { TokenRecord } from "../../../shared/generated/schema"; import { PriceHandler } from "../../../shared/src/price/PriceHandler"; import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { - createTokenRecord, + createOrUpdateTokenRecord, getIsTokenLiquid, } from "../../../shared/src/utils/TokenRecordHelper"; import { WALLET_ADDRESSES } from "../../../shared/src/Wallets"; @@ -62,7 +62,7 @@ function getOwnedLiquidityBalance( } // Create record - const record = createTokenRecord( + const record = createOrUpdateTokenRecord( timestamp, getContractName(liquidityHandler.getId()), liquidityHandler.getId(), diff --git a/subgraphs/polygon/src/treasury/OwnedLiquidity.ts b/subgraphs/polygon/src/treasury/OwnedLiquidity.ts index 1d3f393b..fac2bf15 100644 --- a/subgraphs/polygon/src/treasury/OwnedLiquidity.ts +++ b/subgraphs/polygon/src/treasury/OwnedLiquidity.ts @@ -4,7 +4,7 @@ import { TokenRecord } from "../../../shared/generated/schema"; import { PriceHandler } from "../../../shared/src/price/PriceHandler"; import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { - createTokenRecord, + createOrUpdateTokenRecord, getIsTokenLiquid, } from "../../../shared/src/utils/TokenRecordHelper"; import { WALLET_ADDRESSES } from "../../../shared/src/Wallets"; @@ -62,7 +62,7 @@ function getOwnedLiquidityBalance( } // Create record - const record = createTokenRecord( + const record = createOrUpdateTokenRecord( timestamp, getContractName(liquidityHandler.getId()), liquidityHandler.getId(), diff --git a/subgraphs/shared/src/contracts/ERC20.ts b/subgraphs/shared/src/contracts/ERC20.ts index c181b97a..2211392f 100644 --- a/subgraphs/shared/src/contracts/ERC20.ts +++ b/subgraphs/shared/src/contracts/ERC20.ts @@ -3,7 +3,7 @@ import { Address, BigDecimal, BigInt, log } from "@graphprotocol/graph-ts"; import { ERC20 } from "../../generated/Price/ERC20"; import { TokenRecord } from "../../generated/schema"; import { toDecimal } from "../utils/Decimals"; -import { createTokenRecord, getIsTokenLiquid } from "../utils/TokenRecordHelper"; +import { createOrUpdateTokenRecord, getIsTokenLiquid } from "../utils/TokenRecordHelper"; import { ContractNameLookup } from "./ContractLookup"; import { TokenDefinition } from "./TokenDefinition"; @@ -103,7 +103,7 @@ export function getERC20TokenRecordFromWallet( ); if (!balance || balance.equals(BigDecimal.zero())) return null; - return createTokenRecord( + return createOrUpdateTokenRecord( timestamp, contractLookup(contractAddress), contractAddress, diff --git a/subgraphs/shared/src/utils/TokenRecordHelper.ts b/subgraphs/shared/src/utils/TokenRecordHelper.ts index c0b5e1fb..c3f87224 100644 --- a/subgraphs/shared/src/utils/TokenRecordHelper.ts +++ b/subgraphs/shared/src/utils/TokenRecordHelper.ts @@ -102,7 +102,7 @@ function getTokenMultiplier(tokenAddress: string, tokenDefinitions: Map/// - const record = new TokenSupply(recordId); + // Attempt to fetch the current day's record + const existingRecord = TokenSupply.load(recordId); + + const record = existingRecord ? existingRecord : new TokenSupply(recordId); record.block = blockNumber; record.date = dateString; From e403758a308054ae1fa891bedd66a35decdd53b1 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 25 Sep 2023 13:08:37 +0400 Subject: [PATCH 03/81] Improve indexing performance by using Bytes instead of String for record id --- schema.graphql | 21 +- subgraphs/ethereum/generated/schema.ts | 274 +++++++----------- subgraphs/ethereum/src/contracts/ERC20.ts | 4 +- .../src/contracts/StakingPoolSnapshot.ts | 22 +- .../src/liquidity/LiquidityBalancer.ts | 3 +- .../ethereum/src/liquidity/LiquidityCurve.ts | 3 +- .../src/liquidity/LiquidityFraxSwap.ts | 3 +- .../src/liquidity/LiquidityUniswapV2.ts | 3 +- subgraphs/ethereum/src/utils/Price.ts | 3 +- subgraphs/shared/generated/schema.ts | 166 ++++++++--- .../shared/src/utils/TokenRecordHelper.ts | 5 +- .../shared/src/utils/TokenSupplyHelper.ts | 5 +- 12 files changed, 268 insertions(+), 244 deletions(-) diff --git a/schema.graphql b/schema.graphql index 355dbe76..041ec207 100644 --- a/schema.graphql +++ b/schema.graphql @@ -67,7 +67,7 @@ type BondDiscount @entity { # Represents the balance of a specific token in the treasury type TokenRecord @entity { - id: ID! # YYYY-MM-DD// + id: Bytes! # YYYY-MM-DD// block: BigInt! timestamp: BigInt! # Unix timestamp in UTC date: String! @@ -88,7 +88,7 @@ type TokenRecord @entity { # Represents a balance that affects the supply of OHM type TokenSupply @entity { - id: ID! # YYYY-MM-DD//// + id: Bytes! # YYYY-MM-DD//// block: BigInt! timestamp: BigInt! # Unix timestamp in UTC date: String! # YYYY-MM-DD @@ -130,22 +130,15 @@ type GnosisAuction @entity { # Caching type ERC20TokenSnapshot @entity(immutable: true) { - id: ID! # address/block + id: Bytes! # address/block address: Bytes! decimals: Int! totalSupply: BigDecimal } -type ConvexRewardPoolSnapshot @entity(immutable: true) { - id: ID! # lowercase address/block - block: BigInt! - address: Bytes! - stakingToken: Bytes! -} - # TODO migrate to PoolSnapshot type BalancerPoolSnapshot @entity(immutable: true) { - id: ID! # pool id/block + id: Bytes! # pool id/block block: BigInt! pool: Bytes! poolToken: Bytes! @@ -157,7 +150,7 @@ type BalancerPoolSnapshot @entity(immutable: true) { } type PoolSnapshot @entity(immutable: true) { - id: ID! # pool/block + id: Bytes! # pool/block block: BigInt! pool: Bytes! poolToken: Bytes @@ -169,14 +162,14 @@ type PoolSnapshot @entity(immutable: true) { } type TokenPriceSnapshot @entity(immutable: true) { - id: ID! # address/block + id: Bytes! # address/block block: BigInt! token: Bytes! price: BigDecimal! } type StakingPoolSnapshot @entity(immutable: true) { - id: ID! # address/block + id: Bytes! # address/block block: BigInt! contractAddress: Bytes! stakingToken: Bytes # Will not be set if the call reverts diff --git a/subgraphs/ethereum/generated/schema.ts b/subgraphs/ethereum/generated/schema.ts index f535b6cb..0860bd4d 100644 --- a/subgraphs/ethereum/generated/schema.ts +++ b/subgraphs/ethereum/generated/schema.ts @@ -846,9 +846,9 @@ export class BondDiscount extends Entity { } export class TokenRecord extends Entity { - constructor(id: string) { + constructor(id: Bytes) { super(); - this.set("id", Value.fromString(id)); + this.set("id", Value.fromBytes(id)); } save(): void { @@ -856,34 +856,36 @@ export class TokenRecord extends Entity { assert(id != null, "Cannot save TokenRecord entity without an ID"); if (id) { assert( - id.kind == ValueKind.STRING, - `Entities of type TokenRecord must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + id.kind == ValueKind.BYTES, + `Entities of type TokenRecord must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("TokenRecord", id.toString(), this); + store.set("TokenRecord", id.toBytes().toHexString(), this); } } - static loadInBlock(id: string): TokenRecord | null { + static loadInBlock(id: Bytes): TokenRecord | null { return changetype( - store.get_in_block("TokenRecord", id) + store.get_in_block("TokenRecord", id.toHexString()) ); } - static load(id: string): TokenRecord | null { - return changetype(store.get("TokenRecord", id)); + static load(id: Bytes): TokenRecord | null { + return changetype( + store.get("TokenRecord", id.toHexString()) + ); } - get id(): string { + get id(): Bytes { const value = this.get("id"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBytes(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); } get block(): BigInt { @@ -1096,9 +1098,9 @@ export class TokenRecord extends Entity { } export class TokenSupply extends Entity { - constructor(id: string) { + constructor(id: Bytes) { super(); - this.set("id", Value.fromString(id)); + this.set("id", Value.fromBytes(id)); } save(): void { @@ -1106,34 +1108,36 @@ export class TokenSupply extends Entity { assert(id != null, "Cannot save TokenSupply entity without an ID"); if (id) { assert( - id.kind == ValueKind.STRING, - `Entities of type TokenSupply must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + id.kind == ValueKind.BYTES, + `Entities of type TokenSupply must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("TokenSupply", id.toString(), this); + store.set("TokenSupply", id.toBytes().toHexString(), this); } } - static loadInBlock(id: string): TokenSupply | null { + static loadInBlock(id: Bytes): TokenSupply | null { return changetype( - store.get_in_block("TokenSupply", id) + store.get_in_block("TokenSupply", id.toHexString()) ); } - static load(id: string): TokenSupply | null { - return changetype(store.get("TokenSupply", id)); + static load(id: Bytes): TokenSupply | null { + return changetype( + store.get("TokenSupply", id.toHexString()) + ); } - get id(): string { + get id(): Bytes { const value = this.get("id"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBytes(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); } get block(): BigInt { @@ -1589,9 +1593,9 @@ export class GnosisAuction extends Entity { } export class ERC20TokenSnapshot extends Entity { - constructor(id: string) { + constructor(id: Bytes) { super(); - this.set("id", Value.fromString(id)); + this.set("id", Value.fromBytes(id)); } save(): void { @@ -1599,36 +1603,36 @@ export class ERC20TokenSnapshot extends Entity { assert(id != null, "Cannot save ERC20TokenSnapshot entity without an ID"); if (id) { assert( - id.kind == ValueKind.STRING, - `Entities of type ERC20TokenSnapshot must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + id.kind == ValueKind.BYTES, + `Entities of type ERC20TokenSnapshot must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("ERC20TokenSnapshot", id.toString(), this); + store.set("ERC20TokenSnapshot", id.toBytes().toHexString(), this); } } - static loadInBlock(id: string): ERC20TokenSnapshot | null { + static loadInBlock(id: Bytes): ERC20TokenSnapshot | null { return changetype( - store.get_in_block("ERC20TokenSnapshot", id) + store.get_in_block("ERC20TokenSnapshot", id.toHexString()) ); } - static load(id: string): ERC20TokenSnapshot | null { + static load(id: Bytes): ERC20TokenSnapshot | null { return changetype( - store.get("ERC20TokenSnapshot", id) + store.get("ERC20TokenSnapshot", id.toHexString()) ); } - get id(): string { + get id(): Bytes { const value = this.get("id"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBytes(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); } get address(): Bytes { @@ -1675,96 +1679,10 @@ export class ERC20TokenSnapshot extends Entity { } } -export class ConvexRewardPoolSnapshot extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - const id = this.get("id"); - assert( - id != null, - "Cannot save ConvexRewardPoolSnapshot entity without an ID" - ); - if (id) { - assert( - id.kind == ValueKind.STRING, - `Entities of type ConvexRewardPoolSnapshot must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` - ); - store.set("ConvexRewardPoolSnapshot", id.toString(), this); - } - } - - static loadInBlock(id: string): ConvexRewardPoolSnapshot | null { - return changetype( - store.get_in_block("ConvexRewardPoolSnapshot", id) - ); - } - - static load(id: string): ConvexRewardPoolSnapshot | null { - return changetype( - store.get("ConvexRewardPoolSnapshot", id) - ); - } - - get id(): string { - const value = this.get("id"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get block(): BigInt { - const value = this.get("block"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigInt(); - } - } - - set block(value: BigInt) { - this.set("block", Value.fromBigInt(value)); - } - - get address(): Bytes { - const value = this.get("address"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBytes(); - } - } - - set address(value: Bytes) { - this.set("address", Value.fromBytes(value)); - } - - get stakingToken(): Bytes { - const value = this.get("stakingToken"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBytes(); - } - } - - set stakingToken(value: Bytes) { - this.set("stakingToken", Value.fromBytes(value)); - } -} - export class BalancerPoolSnapshot extends Entity { - constructor(id: string) { + constructor(id: Bytes) { super(); - this.set("id", Value.fromString(id)); + this.set("id", Value.fromBytes(id)); } save(): void { @@ -1772,36 +1690,36 @@ export class BalancerPoolSnapshot extends Entity { assert(id != null, "Cannot save BalancerPoolSnapshot entity without an ID"); if (id) { assert( - id.kind == ValueKind.STRING, - `Entities of type BalancerPoolSnapshot must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + id.kind == ValueKind.BYTES, + `Entities of type BalancerPoolSnapshot must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("BalancerPoolSnapshot", id.toString(), this); + store.set("BalancerPoolSnapshot", id.toBytes().toHexString(), this); } } - static loadInBlock(id: string): BalancerPoolSnapshot | null { + static loadInBlock(id: Bytes): BalancerPoolSnapshot | null { return changetype( - store.get_in_block("BalancerPoolSnapshot", id) + store.get_in_block("BalancerPoolSnapshot", id.toHexString()) ); } - static load(id: string): BalancerPoolSnapshot | null { + static load(id: Bytes): BalancerPoolSnapshot | null { return changetype( - store.get("BalancerPoolSnapshot", id) + store.get("BalancerPoolSnapshot", id.toHexString()) ); } - get id(): string { + get id(): Bytes { const value = this.get("id"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBytes(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); } get block(): BigInt { @@ -1910,9 +1828,9 @@ export class BalancerPoolSnapshot extends Entity { } export class PoolSnapshot extends Entity { - constructor(id: string) { + constructor(id: Bytes) { super(); - this.set("id", Value.fromString(id)); + this.set("id", Value.fromBytes(id)); } save(): void { @@ -1920,34 +1838,36 @@ export class PoolSnapshot extends Entity { assert(id != null, "Cannot save PoolSnapshot entity without an ID"); if (id) { assert( - id.kind == ValueKind.STRING, - `Entities of type PoolSnapshot must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + id.kind == ValueKind.BYTES, + `Entities of type PoolSnapshot must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("PoolSnapshot", id.toString(), this); + store.set("PoolSnapshot", id.toBytes().toHexString(), this); } } - static loadInBlock(id: string): PoolSnapshot | null { + static loadInBlock(id: Bytes): PoolSnapshot | null { return changetype( - store.get_in_block("PoolSnapshot", id) + store.get_in_block("PoolSnapshot", id.toHexString()) ); } - static load(id: string): PoolSnapshot | null { - return changetype(store.get("PoolSnapshot", id)); + static load(id: Bytes): PoolSnapshot | null { + return changetype( + store.get("PoolSnapshot", id.toHexString()) + ); } - get id(): string { + get id(): Bytes { const value = this.get("id"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBytes(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); } get block(): BigInt { @@ -2064,9 +1984,9 @@ export class PoolSnapshot extends Entity { } export class TokenPriceSnapshot extends Entity { - constructor(id: string) { + constructor(id: Bytes) { super(); - this.set("id", Value.fromString(id)); + this.set("id", Value.fromBytes(id)); } save(): void { @@ -2074,36 +1994,36 @@ export class TokenPriceSnapshot extends Entity { assert(id != null, "Cannot save TokenPriceSnapshot entity without an ID"); if (id) { assert( - id.kind == ValueKind.STRING, - `Entities of type TokenPriceSnapshot must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + id.kind == ValueKind.BYTES, + `Entities of type TokenPriceSnapshot must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("TokenPriceSnapshot", id.toString(), this); + store.set("TokenPriceSnapshot", id.toBytes().toHexString(), this); } } - static loadInBlock(id: string): TokenPriceSnapshot | null { + static loadInBlock(id: Bytes): TokenPriceSnapshot | null { return changetype( - store.get_in_block("TokenPriceSnapshot", id) + store.get_in_block("TokenPriceSnapshot", id.toHexString()) ); } - static load(id: string): TokenPriceSnapshot | null { + static load(id: Bytes): TokenPriceSnapshot | null { return changetype( - store.get("TokenPriceSnapshot", id) + store.get("TokenPriceSnapshot", id.toHexString()) ); } - get id(): string { + get id(): Bytes { const value = this.get("id"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBytes(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); } get block(): BigInt { @@ -2147,9 +2067,9 @@ export class TokenPriceSnapshot extends Entity { } export class StakingPoolSnapshot extends Entity { - constructor(id: string) { + constructor(id: Bytes) { super(); - this.set("id", Value.fromString(id)); + this.set("id", Value.fromBytes(id)); } save(): void { @@ -2157,36 +2077,36 @@ export class StakingPoolSnapshot extends Entity { assert(id != null, "Cannot save StakingPoolSnapshot entity without an ID"); if (id) { assert( - id.kind == ValueKind.STRING, - `Entities of type StakingPoolSnapshot must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + id.kind == ValueKind.BYTES, + `Entities of type StakingPoolSnapshot must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("StakingPoolSnapshot", id.toString(), this); + store.set("StakingPoolSnapshot", id.toBytes().toHexString(), this); } } - static loadInBlock(id: string): StakingPoolSnapshot | null { + static loadInBlock(id: Bytes): StakingPoolSnapshot | null { return changetype( - store.get_in_block("StakingPoolSnapshot", id) + store.get_in_block("StakingPoolSnapshot", id.toHexString()) ); } - static load(id: string): StakingPoolSnapshot | null { + static load(id: Bytes): StakingPoolSnapshot | null { return changetype( - store.get("StakingPoolSnapshot", id) + store.get("StakingPoolSnapshot", id.toHexString()) ); } - get id(): string { + get id(): Bytes { const value = this.get("id"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBytes(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); } get block(): BigInt { diff --git a/subgraphs/ethereum/src/contracts/ERC20.ts b/subgraphs/ethereum/src/contracts/ERC20.ts index 58ff0075..2ff75b24 100644 --- a/subgraphs/ethereum/src/contracts/ERC20.ts +++ b/subgraphs/ethereum/src/contracts/ERC20.ts @@ -1,4 +1,4 @@ -import { Address, BigInt, log } from "@graphprotocol/graph-ts"; +import { Address, BigInt, Bytes, log } from "@graphprotocol/graph-ts"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { ERC20 } from "../../generated/ProtocolMetrics/ERC20"; @@ -7,7 +7,7 @@ import { getContractName } from "../utils/Constants"; export function getOrCreateERC20TokenSnapshot(address: string, blockNumber: BigInt): ERC20TokenSnapshot { const FUNC = "getOrCreateERC20TokenSnapshot"; - const snapshotId = `${address.toLowerCase()}/${blockNumber.toString()}`; + const snapshotId = Bytes.fromHexString(address).concatI32(blockNumber.toI32()); let token = ERC20TokenSnapshot.load(snapshotId); if (token == null) { token = new ERC20TokenSnapshot(snapshotId); diff --git a/subgraphs/ethereum/src/contracts/StakingPoolSnapshot.ts b/subgraphs/ethereum/src/contracts/StakingPoolSnapshot.ts index 050927be..fffbd6c8 100644 --- a/subgraphs/ethereum/src/contracts/StakingPoolSnapshot.ts +++ b/subgraphs/ethereum/src/contracts/StakingPoolSnapshot.ts @@ -1,4 +1,4 @@ -import { Address, BigInt } from "@graphprotocol/graph-ts"; +import { Address, BigInt, Bytes } from "@graphprotocol/graph-ts"; import { AuraLocker } from "../../generated/ProtocolMetrics/AuraLocker"; import { AuraStaking } from "../../generated/ProtocolMetrics/AuraStaking"; @@ -10,8 +10,12 @@ import { LQTYStaking } from "../../generated/ProtocolMetrics/LQTYStaking"; import { TokemakStaking } from "../../generated/ProtocolMetrics/TokemakStaking"; import { StakingPoolSnapshot } from "../../generated/schema"; +function getSnapshotId(poolName: string, address: string, blockNumber: BigInt): Bytes { + return Bytes.fromUTF8(poolName).concat(Bytes.fromHexString(address)).concatI32(blockNumber.toI32()); +} + export function getOrCreateBalancerGaugeStakingPoolSnapshot(address: string, blockNumber: BigInt): StakingPoolSnapshot { - const snapshotId = `BalancerGauge/${address.toLowerCase()}/${blockNumber.toString()}`; + const snapshotId = getSnapshotId("BalancerGauge", address, blockNumber); let snapshot = StakingPoolSnapshot.load(snapshotId); if (snapshot == null) { snapshot = new StakingPoolSnapshot(snapshotId); @@ -32,7 +36,7 @@ export function getOrCreateBalancerGaugeStakingPoolSnapshot(address: string, blo } export function getOrCreateAuraStakingPoolSnapshot(address: string, blockNumber: BigInt): StakingPoolSnapshot { - const snapshotId = `AuraStaking/${address.toLowerCase()}/${blockNumber.toString()}`; + const snapshotId = getSnapshotId("AuraStaking", address, blockNumber); let snapshot = StakingPoolSnapshot.load(snapshotId); if (snapshot == null) { snapshot = new StakingPoolSnapshot(snapshotId); @@ -53,7 +57,7 @@ export function getOrCreateAuraStakingPoolSnapshot(address: string, blockNumber: } export function getOrCreateConvexStakingPoolSnapshot(address: string, blockNumber: BigInt): StakingPoolSnapshot { - const snapshotId = `ConvexStaking/${address.toLowerCase()}/${blockNumber.toString()}`; + const snapshotId = getSnapshotId("ConvexStaking", address, blockNumber); let snapshot = StakingPoolSnapshot.load(snapshotId); if (snapshot == null) { snapshot = new StakingPoolSnapshot(snapshotId); @@ -74,7 +78,7 @@ export function getOrCreateConvexStakingPoolSnapshot(address: string, blockNumbe } export function getOrCreateFraxStakingPoolSnapshot(address: string, blockNumber: BigInt): StakingPoolSnapshot { - const snapshotId = `FraxStaking/${address.toLowerCase()}/${blockNumber.toString()}`; + const snapshotId = getSnapshotId("FraxStaking", address, blockNumber); let snapshot = StakingPoolSnapshot.load(snapshotId); if (snapshot == null) { snapshot = new StakingPoolSnapshot(snapshotId); @@ -95,7 +99,7 @@ export function getOrCreateFraxStakingPoolSnapshot(address: string, blockNumber: } export function getOrCreateAuraRewardPoolSnapshot(address: string, blockNumber: BigInt): StakingPoolSnapshot { - const snapshotId = `AuraReward/${address.toLowerCase()}/${blockNumber.toString()}`; + const snapshotId = getSnapshotId("AuraReward", address, blockNumber); let snapshot = StakingPoolSnapshot.load(snapshotId); if (snapshot == null) { snapshot = new StakingPoolSnapshot(snapshotId); @@ -116,7 +120,7 @@ export function getOrCreateAuraRewardPoolSnapshot(address: string, blockNumber: } export function getOrCreateLiquityStakingPoolSnapshot(address: string, blockNumber: BigInt): StakingPoolSnapshot { - const snapshotId = `LiquityStaking/${address.toLowerCase()}/${blockNumber.toString()}`; + const snapshotId = getSnapshotId("LiquityStaking", address, blockNumber); let snapshot = StakingPoolSnapshot.load(snapshotId); if (snapshot == null) { snapshot = new StakingPoolSnapshot(snapshotId); @@ -137,7 +141,7 @@ export function getOrCreateLiquityStakingPoolSnapshot(address: string, blockNumb } export function getOrCreateTokemakStakingPoolSnapshot(address: string, blockNumber: BigInt): StakingPoolSnapshot { - const snapshotId = `TokemakStaking/${address.toLowerCase()}/${blockNumber.toString()}`; + const snapshotId = getSnapshotId("TokemakStaking", address, blockNumber); let snapshot = StakingPoolSnapshot.load(snapshotId); if (snapshot == null) { snapshot = new StakingPoolSnapshot(snapshotId); @@ -158,7 +162,7 @@ export function getOrCreateTokemakStakingPoolSnapshot(address: string, blockNumb } export function getOrCreateAuraLockedPoolSnapshot(address: string, blockNumber: BigInt): StakingPoolSnapshot { - const snapshotId = `AuraLocked/${address.toLowerCase()}/${blockNumber.toString()}`; + const snapshotId = getSnapshotId("AuraLocked", address, blockNumber); let snapshot = StakingPoolSnapshot.load(snapshotId); if (snapshot == null) { snapshot = new StakingPoolSnapshot(snapshotId); diff --git a/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts b/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts index aa5a66cc..07969403 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts @@ -39,7 +39,8 @@ function getBalancerVault(vaultAddress: string, _blockNumber: BigInt): BalancerV * @returns snapshot, or null if there was a contract revert */ export function getOrCreateBalancerPoolSnapshot(poolId: string, vaultAddress: string, blockNumber: BigInt): BalancerPoolSnapshot | null { - const snapshotId = `${poolId}/${blockNumber.toString()}`; + // poolId-blockNumber + const snapshotId = Bytes.fromUTF8(poolId).concatI32(blockNumber.toI32()); let snapshot = BalancerPoolSnapshot.load(snapshotId); if (snapshot == null) { log.debug("getOrCreateBalancerPoolSnapshot: Creating new snapshot for pool {} ({}) at block {}", [getContractName(poolId), poolId, blockNumber.toString()]); diff --git a/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts b/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts index 91f3d093..11790168 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts @@ -67,7 +67,8 @@ function getCurvePairToken(pairAddress: string, blockNumber: BigInt): string | n * @returns snapshot, or null if there was a contract revert */ export function getOrCreateCurvePoolSnapshot(pairAddress: string, blockNumber: BigInt): PoolSnapshot | null { - const snapshotId = `${pairAddress}/${blockNumber.toString()}`; + // pairAddress/blockNumber + const snapshotId = Bytes.fromHexString(pairAddress).concatI32(blockNumber.toI32()); let snapshot = PoolSnapshot.load(snapshotId); if (snapshot == null) { log.debug("getOrCreateCurvePoolSnapshot: Creating new snapshot for pool {} ({}) at block {}", [getContractName(pairAddress), pairAddress, blockNumber.toString()]); diff --git a/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts b/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts index 636b6cf3..a9ae229e 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts @@ -27,7 +27,8 @@ import { getUSDRate } from "../utils/Price"; * @returns snapshot, or null if there was a contract revert */ export function getOrCreateFraxPoolSnapshot(pairAddress: string, blockNumber: BigInt): PoolSnapshot | null { - const snapshotId = `${pairAddress}/${blockNumber.toString()}`; + // pairAddress/blockNumber + const snapshotId = Bytes.fromHexString(pairAddress).concatI32(blockNumber.toI32()); let snapshot = PoolSnapshot.load(snapshotId); if (snapshot == null) { log.debug("getOrCreateFraxPoolSnapshot: Creating new snapshot for pool {} ({}) at block {}", [getContractName(pairAddress), pairAddress, blockNumber.toString()]); diff --git a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts index ef14ef5c..2c81ae35 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts @@ -42,7 +42,8 @@ function getUniswapV2Pair( * @returns snapshot, or null if there was a contract revert */ export function getOrCreateUniswapV2PoolSnapshot(pairAddress: string, blockNumber: BigInt): PoolSnapshot | null { - const snapshotId = `${pairAddress}/${blockNumber.toString()}`; + // pairAddress/blockNumber + const snapshotId = Bytes.fromHexString(pairAddress).concatI32(blockNumber.toI32()); let snapshot = PoolSnapshot.load(snapshotId); if (snapshot == null) { log.debug("getOrCreateUniswapV2PoolSnapshot: Creating new snapshot for pool {} ({}) at block {}", [getContractName(pairAddress), pairAddress, blockNumber.toString()]); diff --git a/subgraphs/ethereum/src/utils/Price.ts b/subgraphs/ethereum/src/utils/Price.ts index 4cdcb2df..769b0b16 100644 --- a/subgraphs/ethereum/src/utils/Price.ts +++ b/subgraphs/ethereum/src/utils/Price.ts @@ -611,7 +611,8 @@ function resolvePrice(contractAddress: string, blockNumber: BigInt): BigDecimal } function getOrCreateTokenPriceSnapshot(address: string, blockNumber: BigInt): TokenPriceSnapshot { - const snapshotId = `${address.toLowerCase()}/${blockNumber.toString()}`; + // address/blockNumber + const snapshotId = Bytes.fromHexString(address).concatI32(blockNumber.toI32()); let snapshot = TokenPriceSnapshot.load(snapshotId); if (snapshot == null) { snapshot = new TokenPriceSnapshot(snapshotId); diff --git a/subgraphs/shared/generated/schema.ts b/subgraphs/shared/generated/schema.ts index 687b0317..6c3200f8 100644 --- a/subgraphs/shared/generated/schema.ts +++ b/subgraphs/shared/generated/schema.ts @@ -28,6 +28,10 @@ export class DailyBond extends Entity { } } + static loadInBlock(id: string): DailyBond | null { + return changetype(store.get_in_block("DailyBond", id)); + } + static load(id: string): DailyBond | null { return changetype(store.get("DailyBond", id)); } @@ -116,6 +120,10 @@ export class Rebase extends Entity { } } + static loadInBlock(id: string): Rebase | null { + return changetype(store.get_in_block("Rebase", id)); + } + static load(id: string): Rebase | null { return changetype(store.get("Rebase", id)); } @@ -230,6 +238,12 @@ export class DailyStakingReward extends Entity { } } + static loadInBlock(id: string): DailyStakingReward | null { + return changetype( + store.get_in_block("DailyStakingReward", id) + ); + } + static load(id: string): DailyStakingReward | null { return changetype( store.get("DailyStakingReward", id) @@ -307,6 +321,10 @@ export class Token extends Entity { } } + static loadInBlock(id: string): Token | null { + return changetype(store.get_in_block("Token", id)); + } + static load(id: string): Token | null { return changetype(store.get("Token", id)); } @@ -343,6 +361,12 @@ export class ProtocolMetric extends Entity { } } + static loadInBlock(id: string): ProtocolMetric | null { + return changetype( + store.get_in_block("ProtocolMetric", id) + ); + } + static load(id: string): ProtocolMetric | null { return changetype(store.get("ProtocolMetric", id)); } @@ -693,6 +717,12 @@ export class BondDiscount extends Entity { } } + static loadInBlock(id: string): BondDiscount | null { + return changetype( + store.get_in_block("BondDiscount", id) + ); + } + static load(id: string): BondDiscount | null { return changetype(store.get("BondDiscount", id)); } @@ -816,9 +846,9 @@ export class BondDiscount extends Entity { } export class TokenRecord extends Entity { - constructor(id: string) { + constructor(id: Bytes) { super(); - this.set("id", Value.fromString(id)); + this.set("id", Value.fromBytes(id)); } save(): void { @@ -826,28 +856,36 @@ export class TokenRecord extends Entity { assert(id != null, "Cannot save TokenRecord entity without an ID"); if (id) { assert( - id.kind == ValueKind.STRING, - `Entities of type TokenRecord must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + id.kind == ValueKind.BYTES, + `Entities of type TokenRecord must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("TokenRecord", id.toString(), this); + store.set("TokenRecord", id.toBytes().toHexString(), this); } } - static load(id: string): TokenRecord | null { - return changetype(store.get("TokenRecord", id)); + static loadInBlock(id: Bytes): TokenRecord | null { + return changetype( + store.get_in_block("TokenRecord", id.toHexString()) + ); } - get id(): string { + static load(id: Bytes): TokenRecord | null { + return changetype( + store.get("TokenRecord", id.toHexString()) + ); + } + + get id(): Bytes { const value = this.get("id"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBytes(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); } get block(): BigInt { @@ -1060,9 +1098,9 @@ export class TokenRecord extends Entity { } export class TokenSupply extends Entity { - constructor(id: string) { + constructor(id: Bytes) { super(); - this.set("id", Value.fromString(id)); + this.set("id", Value.fromBytes(id)); } save(): void { @@ -1070,28 +1108,36 @@ export class TokenSupply extends Entity { assert(id != null, "Cannot save TokenSupply entity without an ID"); if (id) { assert( - id.kind == ValueKind.STRING, - `Entities of type TokenSupply must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + id.kind == ValueKind.BYTES, + `Entities of type TokenSupply must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("TokenSupply", id.toString(), this); + store.set("TokenSupply", id.toBytes().toHexString(), this); } } - static load(id: string): TokenSupply | null { - return changetype(store.get("TokenSupply", id)); + static loadInBlock(id: Bytes): TokenSupply | null { + return changetype( + store.get_in_block("TokenSupply", id.toHexString()) + ); } - get id(): string { + static load(id: Bytes): TokenSupply | null { + return changetype( + store.get("TokenSupply", id.toHexString()) + ); + } + + get id(): Bytes { const value = this.get("id"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBytes(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); } get block(): BigInt { @@ -1285,6 +1331,12 @@ export class PriceSnapshot extends Entity { } } + static loadInBlock(id: string): PriceSnapshot | null { + return changetype( + store.get_in_block("PriceSnapshot", id) + ); + } + static load(id: string): PriceSnapshot | null { return changetype(store.get("PriceSnapshot", id)); } @@ -1386,6 +1438,12 @@ export class GnosisAuctionRoot extends Entity { } } + static loadInBlock(id: string): GnosisAuctionRoot | null { + return changetype( + store.get_in_block("GnosisAuctionRoot", id) + ); + } + static load(id: string): GnosisAuctionRoot | null { return changetype( store.get("GnosisAuctionRoot", id) @@ -1437,6 +1495,12 @@ export class GnosisAuction extends Entity { } } + static loadInBlock(id: string): GnosisAuction | null { + return changetype( + store.get_in_block("GnosisAuction", id) + ); + } + static load(id: string): GnosisAuction | null { return changetype(store.get("GnosisAuction", id)); } @@ -1546,6 +1610,12 @@ export class ERC20TokenSnapshot extends Entity { } } + static loadInBlock(id: string): ERC20TokenSnapshot | null { + return changetype( + store.get_in_block("ERC20TokenSnapshot", id) + ); + } + static load(id: string): ERC20TokenSnapshot | null { return changetype( store.get("ERC20TokenSnapshot", id) @@ -1630,6 +1700,12 @@ export class ConvexRewardPoolSnapshot extends Entity { } } + static loadInBlock(id: string): ConvexRewardPoolSnapshot | null { + return changetype( + store.get_in_block("ConvexRewardPoolSnapshot", id) + ); + } + static load(id: string): ConvexRewardPoolSnapshot | null { return changetype( store.get("ConvexRewardPoolSnapshot", id) @@ -1707,6 +1783,12 @@ export class BalancerPoolSnapshot extends Entity { } } + static loadInBlock(id: string): BalancerPoolSnapshot | null { + return changetype( + store.get_in_block("BalancerPoolSnapshot", id) + ); + } + static load(id: string): BalancerPoolSnapshot | null { return changetype( store.get("BalancerPoolSnapshot", id) @@ -1849,6 +1931,12 @@ export class PoolSnapshot extends Entity { } } + static loadInBlock(id: string): PoolSnapshot | null { + return changetype( + store.get_in_block("PoolSnapshot", id) + ); + } + static load(id: string): PoolSnapshot | null { return changetype(store.get("PoolSnapshot", id)); } @@ -1980,9 +2068,9 @@ export class PoolSnapshot extends Entity { } export class TokenPriceSnapshot extends Entity { - constructor(id: string) { + constructor(id: Bytes) { super(); - this.set("id", Value.fromString(id)); + this.set("id", Value.fromBytes(id)); } save(): void { @@ -1990,30 +2078,36 @@ export class TokenPriceSnapshot extends Entity { assert(id != null, "Cannot save TokenPriceSnapshot entity without an ID"); if (id) { assert( - id.kind == ValueKind.STRING, - `Entities of type TokenPriceSnapshot must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + id.kind == ValueKind.BYTES, + `Entities of type TokenPriceSnapshot must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("TokenPriceSnapshot", id.toString(), this); + store.set("TokenPriceSnapshot", id.toBytes().toHexString(), this); } } - static load(id: string): TokenPriceSnapshot | null { + static loadInBlock(id: Bytes): TokenPriceSnapshot | null { return changetype( - store.get("TokenPriceSnapshot", id) + store.get_in_block("TokenPriceSnapshot", id.toHexString()) ); } - get id(): string { + static load(id: Bytes): TokenPriceSnapshot | null { + return changetype( + store.get("TokenPriceSnapshot", id.toHexString()) + ); + } + + get id(): Bytes { const value = this.get("id"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBytes(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); } get block(): BigInt { @@ -2074,6 +2168,12 @@ export class StakingPoolSnapshot extends Entity { } } + static loadInBlock(id: string): StakingPoolSnapshot | null { + return changetype( + store.get_in_block("StakingPoolSnapshot", id) + ); + } + static load(id: string): StakingPoolSnapshot | null { return changetype( store.get("StakingPoolSnapshot", id) diff --git a/subgraphs/shared/src/utils/TokenRecordHelper.ts b/subgraphs/shared/src/utils/TokenRecordHelper.ts index c3f87224..81741821 100644 --- a/subgraphs/shared/src/utils/TokenRecordHelper.ts +++ b/subgraphs/shared/src/utils/TokenRecordHelper.ts @@ -1,4 +1,4 @@ -import { BigDecimal, BigInt, log } from "@graphprotocol/graph-ts"; +import { BigDecimal, BigInt, Bytes, log } from "@graphprotocol/graph-ts"; import { TokenRecord } from "../../generated/schema"; import { TokenDefinition } from "../contracts/TokenDefinition"; @@ -118,7 +118,8 @@ export function createOrUpdateTokenRecord( category: string | null = null, ): TokenRecord { const dateString = getISO8601DateStringFromTimestamp(timestamp); - const recordId = `${dateString}/${sourceName}/${tokenName}`; + // YYYY-MM-DD// + const recordId = Bytes.fromUTF8(dateString).concat(Bytes.fromUTF8(sourceName)).concat(Bytes.fromUTF8(tokenName)); // Attempt to fetch the current day's record const existingRecord = TokenRecord.load(recordId); diff --git a/subgraphs/shared/src/utils/TokenSupplyHelper.ts b/subgraphs/shared/src/utils/TokenSupplyHelper.ts index 1178e121..75b45620 100644 --- a/subgraphs/shared/src/utils/TokenSupplyHelper.ts +++ b/subgraphs/shared/src/utils/TokenSupplyHelper.ts @@ -1,4 +1,4 @@ -import { BigDecimal, BigInt } from "@graphprotocol/graph-ts"; +import { BigDecimal, BigInt, Bytes } from "@graphprotocol/graph-ts"; import { TokenSupply } from "../../generated/schema"; import { getISO8601DateStringFromTimestamp } from "./DateHelper"; @@ -40,7 +40,8 @@ export function createOrUpdateTokenSupply( const poolNameNotNull: string = poolName !== null ? poolName : "Unknown Pool"; const sourceNameNotNull: string = sourceName !== null ? sourceName : ""; - const recordId = `${dateString}/${tokenName}/${type}/${poolNameNotNull}/${sourceNameNotNull}`; // YYYY-MM-DD//// + // YYYY-MM-DD//// + const recordId = Bytes.fromUTF8(dateString).concat(Bytes.fromUTF8(tokenName)).concat(Bytes.fromUTF8(type)).concat(Bytes.fromUTF8(poolNameNotNull)).concat(Bytes.fromUTF8(sourceNameNotNull)); `${dateString}/${tokenName}/${type}/${poolNameNotNull}/${sourceNameNotNull}`; // Attempt to fetch the current day's record const existingRecord = TokenSupply.load(recordId); From 976718f572f1714a9af3550610535919e1c087e2 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 25 Sep 2023 13:10:19 +0400 Subject: [PATCH 04/81] Implement block handler --- subgraphs/ethereum/subgraph.yaml | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/subgraphs/ethereum/subgraph.yaml b/subgraphs/ethereum/subgraph.yaml index 6a253bb5..2ad055f8 100644 --- a/subgraphs/ethereum/subgraph.yaml +++ b/subgraphs/ethereum/subgraph.yaml @@ -1,11 +1,11 @@ -specVersion: 0.0.4 +specVersion: 0.0.8 description: Olympus Protocol Metrics Subgraph repository: https://github.com/OlympusDAO/olympus-protocol-metrics-subgraph features: - grafting -graft: - base: QmSwwBfAoWJLHQeSTagFnkibnkrjeprxcQpXAHk6AVrysA - block: 18185779 # Clearinghouse deployment +# graft: +# base: QmSwwBfAoWJLHQeSTagFnkibnkrjeprxcQpXAHk6AVrysA +# block: 18185779 # Clearinghouse deployment schema: file: ../../schema.graphql dataSources: @@ -657,17 +657,13 @@ dataSources: # Cooler Loans - name: CoolerLoansClearinghouse file: ./abis/CoolerLoansClearinghouse.json - eventHandlers: - - event: LogRebase(indexed uint256,uint256,uint256) - handler: handleMetrics - # This can be re-enabled, but likely needs a reindexing from scratch - # blockHandlers: - # - handler: handleMetricsBlock - # filter: - # kind: polling - # # Every 4 hours - # # 5 blocks per minute * 60 minutes * 4 hours - # every: 1200 + blockHandlers: + - handler: handleMetricsBlock + filter: + kind: polling + # Every 8 hours + # 5 blocks per minute * 60 minutes * 8 hours + every: 2400 file: ./src/protocolMetrics/ProtocolMetrics.ts ### # BondManager and GnosisEasyAuction index Gnosis auction events, used for bond calculations From 96070d50f190d7b00714bf635c15b3dd65209cf1 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 25 Sep 2023 13:19:38 +0400 Subject: [PATCH 05/81] Version bump --- subgraphs/ethereum/CHANGELOG.md | 5 +++++ subgraphs/ethereum/config.json | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/subgraphs/ethereum/CHANGELOG.md b/subgraphs/ethereum/CHANGELOG.md index 6ca76607..f88013c7 100644 --- a/subgraphs/ethereum/CHANGELOG.md +++ b/subgraphs/ethereum/CHANGELOG.md @@ -1,5 +1,10 @@ # Subgraph Changelog +## 5.0.0 (???) + +- Improve indexing performance by using Bytes instead of String for entity ids +- Re-index using a block handler, as the previous event will be deprecated soon + ## 4.13.3 (2023-09-22) - Include Cooler Loans Clearinghouse balances and receivables diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index 74d65c88..ec2e5682 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmZwxg2FCXLV6RfPsph5LeBNoddnZcgeHndBjXbfULiDbs", + "id": "QmQAKcsjQ1TDpWg5jVe79rci76p3ZmFWb5AG73N1NJ5WSF", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "4.13.3" + "version": "4.99.0" } \ No newline at end of file From 32e1bc20b830e825fb7689039d79a22119766a42 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 25 Sep 2023 13:59:22 +0400 Subject: [PATCH 06/81] Shift protocol addresses into a separate file --- .../src/liquidity/LiquidityBalancer.ts | 2 +- .../ethereum/src/liquidity/LiquidityCurve.ts | 2 +- .../src/liquidity/LiquidityFraxSwap.ts | 2 +- .../src/liquidity/LiquidityUniswapV2.ts | 2 +- .../src/liquidity/LiquidityUniswapV3.ts | 3 +- subgraphs/ethereum/src/utils/Constants.ts | 62 ------- .../ethereum/src/utils/ContractHelper.ts | 12 +- subgraphs/ethereum/src/utils/ERC4626.ts | 3 +- .../ethereum/src/utils/ProtocolAddresses.ts | 151 ++++++++++++++++++ subgraphs/ethereum/src/utils/Silo.ts | 3 +- .../ethereum/tests/contractHelper.test.ts | 2 +- subgraphs/ethereum/tests/erc4626.test.ts | 2 +- .../ethereum/tests/liquidityBalancer.test.ts | 2 +- .../tests/liquidityCalculations.test.ts | 2 +- .../ethereum/tests/liquidityCurve.test.ts | 2 +- .../ethereum/tests/liquidityFraxSwap.test.ts | 2 +- .../ethereum/tests/liquidityUniswapV2.test.ts | 2 +- .../ethereum/tests/liquityAllocator.test.ts | 3 +- subgraphs/ethereum/tests/pairHelper.ts | 4 +- subgraphs/ethereum/tests/price.test.ts | 3 +- subgraphs/ethereum/tests/uniswapV3Helper.ts | 2 +- 21 files changed, 178 insertions(+), 90 deletions(-) create mode 100644 subgraphs/ethereum/src/utils/ProtocolAddresses.ts diff --git a/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts b/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts index 07969403..498d281a 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts @@ -16,7 +16,6 @@ import { ERC20_OHM_V2, ERC20_TOKENS, getContractName, - getWalletAddressesForContract, liquidityPairHasToken, } from "../utils/Constants"; import { @@ -24,6 +23,7 @@ import { getBalancerGaugeBalancesFromWallets, } from "../utils/ContractHelper"; import { getUSDRate } from "../utils/Price"; +import { getWalletAddressesForContract } from "../utils/ProtocolAddresses"; function getBalancerVault(vaultAddress: string, _blockNumber: BigInt): BalancerVault { return BalancerVault.bind(Address.fromString(vaultAddress)); diff --git a/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts b/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts index 11790168..a7d77877 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts @@ -19,11 +19,11 @@ import { getContractName, getConvexStakedToken, getFraxStakedToken, - getWalletAddressesForContract, liquidityPairHasToken, } from "../utils/Constants"; import { getConvexStakedBalance, getERC20, getFraxLockedBalance } from "../utils/ContractHelper"; import { getUSDRate } from "../utils/Price"; +import { getWalletAddressesForContract } from "../utils/ProtocolAddresses"; /** * Determines the address of the ERC20 token for a Curve liquidity pair. diff --git a/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts b/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts index a9ae229e..e9741c3f 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts @@ -13,10 +13,10 @@ import { ERC20_OHM_V2, ERC20_TOKENS, getContractName, - getWalletAddressesForContract, liquidityPairHasToken, } from "../utils/Constants"; import { getUSDRate } from "../utils/Price"; +import { getWalletAddressesForContract } from "../utils/ProtocolAddresses"; /** * Returns a PoolSnapshot, which contains cached data about the Frax pool. This diff --git a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts index 2c81ae35..c5f8a03d 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts @@ -13,10 +13,10 @@ import { ERC20_OHM_V2, ERC20_TOKENS, getContractName, - getWalletAddressesForContract, liquidityPairHasToken, } from "../utils/Constants"; import { getUSDRate } from "../utils/Price"; +import { getWalletAddressesForContract } from "../utils/ProtocolAddresses"; /** diff --git a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts index 40047390..ba2f03a7 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts @@ -1,7 +1,7 @@ import { Address, BigDecimal, BigInt, log } from "@graphprotocol/graph-ts"; import { TokenRecord, TokenSupply } from "../../../shared/generated/schema"; -import { BLOCKCHAIN, ERC20_OHM_V2, ERC20_TOKENS, getContractName, getWalletAddressesForContract, liquidityPairHasToken } from "../utils/Constants"; +import { BLOCKCHAIN, ERC20_OHM_V2, ERC20_TOKENS, getContractName, liquidityPairHasToken } from "../utils/Constants"; import { getERC20DecimalBalance, getUniswapV3Pair } from "../utils/ContractHelper"; import { getUSDRate } from "../utils/Price"; import { toDecimal } from "../../../shared/src/utils/Decimals"; @@ -10,6 +10,7 @@ import { UniswapV3PositionManager } from "../../generated/ProtocolMetrics/Uniswa import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; import { TYPE_LIQUIDITY, createOrUpdateTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; import { TokenCategoryPOL } from "../../../shared/src/contracts/TokenDefinition"; +import { getWalletAddressesForContract } from "../utils/ProtocolAddresses"; export const UNISWAP_V3_POSITION_MANAGER = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88"; const Q96 = BigInt.fromI32(2).pow(96); diff --git a/subgraphs/ethereum/src/utils/Constants.ts b/subgraphs/ethereum/src/utils/Constants.ts index f4cc2bc2..923ccaaf 100644 --- a/subgraphs/ethereum/src/utils/Constants.ts +++ b/subgraphs/ethereum/src/utils/Constants.ts @@ -707,68 +707,6 @@ export const liquidityPairHasToken = (pairAddress: string, tokenAddress: string) return getLiquidityPairTokens(pairAddress).includes(tokenAddress.toLowerCase()); }; -// TODO consider merging convex allocator and wallet addresses constants -export const CONVEX_ALLOCATORS = [ - CONVEX_ALLOCATOR1, - CONVEX_ALLOCATOR2, - CONVEX_ALLOCATOR3, - CONVEX_CVX_ALLOCATOR, - CONVEX_CVX_VL_ALLOCATOR, - CONVEX_STAKING_PROXY_FRAXBP, - CONVEX_STAKING_PROXY_OHM_FRAXBP, - DAO_WALLET, -]; - -const TREASURY_BLACKLIST = new Map(); - -/** - * OHM and gOHM in the following wallets are blacklisted (not indexed) as we do not want the value - * being considered as part of the protocol or DAO treasuries. - */ -TREASURY_BLACKLIST.set(ERC20_OHM_V1, WALLET_ADDRESSES); -TREASURY_BLACKLIST.set(ERC20_OHM_V2, WALLET_ADDRESSES); -TREASURY_BLACKLIST.set(ERC20_GOHM, WALLET_ADDRESSES); -TREASURY_BLACKLIST.set(ERC20_SOHM_V1, WALLET_ADDRESSES); -TREASURY_BLACKLIST.set(ERC20_SOHM_V2, WALLET_ADDRESSES); -TREASURY_BLACKLIST.set(ERC20_SOHM_V3, WALLET_ADDRESSES); - -/** - * Some wallets (e.g. {DAO_WALLET}) have specific treasury assets mixed into them. - * For this reason, the wallets to be used differ on a per-contract basis. - * - * This function returns the wallets that should be iterated over for the given - * contract, {contractAddress}. - * - * @param contractAddress - * @returns - */ -export const getWalletAddressesForContract = (contractAddress: string): string[] => { - const walletAddresses = WALLET_ADDRESSES.slice(0); - - // If the contract isn't on the blacklist, return as normal - if (!TREASURY_BLACKLIST.has(contractAddress.toLowerCase())) { - log.debug("getWalletAddressesForContract: token {} is not on treasury blacklist", [contractAddress]); - return walletAddresses; - } - - // Otherwise remove the values in the blacklist - // AssemblyScript doesn't yet have closures, so filter() cannot be used - const walletBlacklist = TREASURY_BLACKLIST.get(contractAddress.toLowerCase()); - for (let i = 0; i < walletBlacklist.length; i++) { - // If the blacklisted address is not in the array, skip - const arrayIndex = walletAddresses.indexOf(walletBlacklist[i]); - if (arrayIndex < 0) { - continue; - } - - // Otherwise the blacklist address is removed from the array in-place - const splicedValues = walletAddresses.splice(arrayIndex, 1); - log.debug("getWalletAddressesForContract: removed values: {}", [splicedValues.toString()]); - } - - return walletAddresses; -}; - const ALLOCATOR_ONSEN_ID = new Map(); ALLOCATOR_ONSEN_ID.set(ERC20_DAI, OHMDAI_ONSEN_ID); ALLOCATOR_ONSEN_ID.set(ERC20_LUSD, OHMLUSD_ONSEN_ID); diff --git a/subgraphs/ethereum/src/utils/ContractHelper.ts b/subgraphs/ethereum/src/utils/ContractHelper.ts index 1036dd70..5b90fc32 100644 --- a/subgraphs/ethereum/src/utils/ContractHelper.ts +++ b/subgraphs/ethereum/src/utils/ContractHelper.ts @@ -8,7 +8,7 @@ import { getIsTokenLiquid, getTokenCategory, } from "../../../shared/src/utils/TokenRecordHelper"; -import { CONVEX_CVX_VL_ALLOCATOR, LUSD_ALLOCATOR, MYSO_LENDING, RARI_ALLOCATOR, VEFXS_ALLOCATOR, VENDOR_LENDING } from "../../../shared/src/Wallets"; +import { CONVEX_CVX_VL_ALLOCATOR, MYSO_LENDING, RARI_ALLOCATOR, VEFXS_ALLOCATOR, VENDOR_LENDING } from "../../../shared/src/Wallets"; import { AuraLocker } from "../../generated/ProtocolMetrics/AuraLocker"; import { AuraStaking } from "../../generated/ProtocolMetrics/AuraStaking"; import { AuraVirtualBalanceRewardPool } from "../../generated/ProtocolMetrics/AuraVirtualBalanceRewardPool"; @@ -18,7 +18,6 @@ import { ERC20 } from "../../generated/ProtocolMetrics/ERC20"; import { FraxFarm } from "../../generated/ProtocolMetrics/FraxFarm"; import { LiquityStabilityPool } from "../../generated/ProtocolMetrics/LiquityStabilityPool"; import { LQTYStaking } from "../../generated/ProtocolMetrics/LQTYStaking"; -import { LUSDAllocatorV2 } from "../../generated/ProtocolMetrics/LUSDAllocatorV2"; import { MakerDSR } from "../../generated/ProtocolMetrics/MakerDSR"; import { MasterChef } from "../../generated/ProtocolMetrics/MasterChef"; import { RariAllocator } from "../../generated/ProtocolMetrics/RariAllocator"; @@ -44,7 +43,6 @@ import { BALANCER_LIQUIDITY_GAUGES, BLOCKCHAIN, CONTRACT_STARTING_BLOCK_MAP, - CONVEX_ALLOCATORS, CONVEX_STAKING_CONTRACTS, ERC20_AURA_VL, ERC20_BTRFLY_V2_RL, @@ -64,7 +62,6 @@ import { getOnsenAllocatorId, getRariAllocatorId, getVendorDeployments, - getWalletAddressesForContract, liquidityPairHasToken, LIQUITY_STABILITY_POOL, LQTY_STAKING, @@ -76,6 +73,7 @@ import { TOKE_STAKING, } from "./Constants"; import { getUSDRate } from "./Price"; +import { CONVEX_ALLOCATORS, getWalletAddressesForContract } from "./ProtocolAddresses"; /** * The Graph recommends only binding a contract once @@ -91,7 +89,6 @@ const contractsRariAllocator = new Map(); const contractsTokeAllocator = new Map(); const contractsMasterChef = new Map(); const contractsVeFXS = new Map(); -const contractsLUSDAllocator = new Map(); /** * Indicates whether a contract exists at a given block number. @@ -1724,8 +1721,9 @@ export function getConvexStakedRecords( const records: TokenRecord[] = []; // Loop through allocators - for (let i = 0; i < CONVEX_ALLOCATORS.length; i++) { - const allocatorAddress = CONVEX_ALLOCATORS[i]; + const convexAllocators = CONVEX_ALLOCATORS; + for (let i = 0; i < convexAllocators.length; i++) { + const allocatorAddress = convexAllocators[i]; // Look through staking contracts for (let j = 0; j < CONVEX_STAKING_CONTRACTS.length; j++) { diff --git a/subgraphs/ethereum/src/utils/ERC4626.ts b/subgraphs/ethereum/src/utils/ERC4626.ts index 20264151..185bb819 100644 --- a/subgraphs/ethereum/src/utils/ERC4626.ts +++ b/subgraphs/ethereum/src/utils/ERC4626.ts @@ -1,11 +1,12 @@ import { Address, BigDecimal, BigInt, log } from "@graphprotocol/graph-ts"; import { ERC4626 } from "../../generated/ProtocolMetrics/ERC4626"; -import { BLOCKCHAIN, ERC4626_TOKENS, getContractName, getWalletAddressesForContract } from "./Constants"; +import { BLOCKCHAIN, ERC4626_TOKENS, getContractName } from "./Constants"; import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { createOrUpdateTokenRecord, getIsTokenLiquid } from "../../../shared/src/utils/TokenRecordHelper"; import { getUSDRate } from "./Price"; import { TokenRecord } from "../../../shared/generated/schema"; +import { getWalletAddressesForContract } from "./ProtocolAddresses"; /** * Returns the balance of the ERC4626 token in the specified wallet. diff --git a/subgraphs/ethereum/src/utils/ProtocolAddresses.ts b/subgraphs/ethereum/src/utils/ProtocolAddresses.ts new file mode 100644 index 00000000..32dd8b49 --- /dev/null +++ b/subgraphs/ethereum/src/utils/ProtocolAddresses.ts @@ -0,0 +1,151 @@ +/** + * Protocol addresses on Ethereum mainnet + */ + +import { log } from "@graphprotocol/graph-ts"; +import { ERC20_GOHM, ERC20_OHM_V1, ERC20_OHM_V2, ERC20_SOHM_V1, ERC20_SOHM_V2, ERC20_SOHM_V3 } from "./Constants"; + +export const TREASURY_ADDRESS_V1 = "0x886CE997aa9ee4F8c2282E182aB72A705762399D".toLowerCase(); +export const TREASURY_ADDRESS_V2 = "0x31f8cc382c9898b273eff4e0b7626a6987c846e8".toLowerCase(); +export const TREASURY_ADDRESS_V3 = "0x9A315BdF513367C0377FB36545857d12e85813Ef".toLowerCase(); + +export const BONDS_DEPOSIT = "0x9025046c6fb25Fb39e720d97a8FD881ED69a1Ef6".toLowerCase(); + +/** + * OHM in this contract is considered burned + * Excluded from treasury market value (double-counting otherwise) + * Included in calculations of protocol-owned OHM + */ +export const BONDS_INVERSE_DEPOSIT = "0xBA42BE149e5260EbA4B82418A6306f55D532eA47".toLowerCase(); + +export const DAO_WALLET = "0x245cc372c84b3645bf0ffe6538620b04a217988b".toLowerCase(); +export const DAO_WORKING_CAPITAL = "0xF65A665D650B5De224F46D729e2bD0885EeA9dA5".toLowerCase(); + +/** + * Not considered protocol- or DAO-owned + */ +export const OLYMPUS_ASSOCIATION_WALLET = "0x4c71db02aeeb336cbd8f3d2cc866911f6e2fbd94".toLowerCase(); + +export const COOLER_LOANS_CLEARINGHOUSE = "0xD6A6E8d9e82534bD65821142fcCd91ec9cF31880".toLowerCase(); +export const TRSRY = "0xa8687A15D4BE32CC8F0a8a7B9704a4C3993D9613".toLowerCase(); + +export const OTC_ESCROW = "0xe3312c3f1ab30878d9686452f7205ebe11e965eb".toLowerCase(); +export const MYSO_LENDING = "0xb339953fc028b9998775c00594a74dd1488ee2c6".toLowerCase(); +export const VENDOR_LENDING = "0x83234a159dbd60a32457df158fafcbdf3d1ccc08".toLowerCase(); + + +export const AAVE_ALLOCATOR = "0x0e1177e47151Be72e5992E0975000E73Ab5fd9D4".toLowerCase(); +export const AAVE_ALLOCATOR_V2 = "0x0d33c811d0fcc711bcb388dfb3a152de445be66f".toLowerCase(); +export const AURA_ALLOCATOR = "0x872ebDd8129Aa328C89f6BF032bBD77a4c4BaC7e".toLowerCase(); +export const AURA_ALLOCATOR_V2 = "0x8CaF91A6bb38D55fB530dEc0faB535FA78d98FaD".toLowerCase(); +export const BALANCER_ALLOCATOR = "0xa9b52a2d0ffdbabdb2cb23ebb7cd879cac6618a6".toLowerCase(); // Incorrect? +export const CONVEX_ALLOCATOR1 = "0x3dF5A355457dB3A4B5C744B8623A7721BF56dF78".toLowerCase(); +export const CONVEX_ALLOCATOR2 = "0x408a9A09d97103022F53300A3A14Ca6c3FF867E8".toLowerCase(); +export const CONVEX_ALLOCATOR3 = "0xDbf0683fC4FC8Ac11e64a6817d3285ec4f2Fc42d".toLowerCase(); +export const CONVEX_CVX_ALLOCATOR = "0xdfc95aaf0a107daae2b350458ded4b7906e7f728".toLowerCase(); +export const CONVEX_CVX_VL_ALLOCATOR = "0x2d643df5de4e9ba063760d475beaa62821c71681".toLowerCase(); +export const CONVEX_STAKING_PROXY_FRAXBP = "0x943C1dfA7dA96e54242bD2c78DD3eF5C7b24b18C".toLowerCase(); +export const CONVEX_STAKING_PROXY_OHM_FRAXBP = "0x75E7f7D871F4B5db0fA9B0f01B7422352Ec9618f".toLowerCase(); +export const LUSD_ALLOCATOR = "0x97b3ef4c558ec456d59cb95c65bfb79046e31fca".toLowerCase(); +export const LUSD_ALLOCATOR_V2 = "0x97b3ef4c558ec456d59cb95c65bfb79046e31fca".toLowerCase(); +export const MAKER_DSR_ALLOCATOR = "0x0EA26319836fF05B8C5C5afD83b8aB17dd46d063".toLowerCase(); +export const MAKER_DSR_ALLOCATOR_PROXY = "0x5db0761487e26B555F5Bfd5E40F4CBC3E1a7d11E".toLowerCase(); +export const RARI_ALLOCATOR = "0x061C8610A784b8A1599De5B1157631e35180d818".toLowerCase(); +export const VEFXS_ALLOCATOR = "0xde7b85f52577b113181921a7aa8fc0c22e309475".toLowerCase(); + +export const CONVEX_ALLOCATORS = [ + CONVEX_ALLOCATOR1, + CONVEX_ALLOCATOR2, + CONVEX_ALLOCATOR3, + CONVEX_CVX_ALLOCATOR, + CONVEX_CVX_VL_ALLOCATOR, + CONVEX_STAKING_PROXY_FRAXBP, + CONVEX_STAKING_PROXY_OHM_FRAXBP, + DAO_WALLET, +]; + +/** + * This set of wallet addresses is common across many tokens, + * and can be used for balance lookups. + * + * Myso and Vendor Finance contracts are NOT included in here, as the deployed amounts are hard-coded. + */ +export const PROTOCOL_ADDRESSES = [ + AAVE_ALLOCATOR_V2, + AAVE_ALLOCATOR, + AURA_ALLOCATOR_V2, + AURA_ALLOCATOR, + BALANCER_ALLOCATOR, + BONDS_DEPOSIT, + BONDS_INVERSE_DEPOSIT, + CONVEX_ALLOCATOR1, + CONVEX_ALLOCATOR2, + CONVEX_ALLOCATOR3, + CONVEX_CVX_ALLOCATOR, + CONVEX_CVX_VL_ALLOCATOR, + CONVEX_STAKING_PROXY_FRAXBP, + CONVEX_STAKING_PROXY_OHM_FRAXBP, + DAO_WALLET, + DAO_WORKING_CAPITAL, + LUSD_ALLOCATOR, + LUSD_ALLOCATOR_V2, + MAKER_DSR_ALLOCATOR_PROXY, + MAKER_DSR_ALLOCATOR, + OTC_ESCROW, + RARI_ALLOCATOR, + TREASURY_ADDRESS_V1, + TREASURY_ADDRESS_V2, + TREASURY_ADDRESS_V3, + TRSRY, + VEFXS_ALLOCATOR, +]; + +const TREASURY_BLACKLIST = new Map(); + +/** + * OHM and gOHM in the following wallets are blacklisted (not indexed) as we do not want the value + * being considered as part of the protocol or DAO treasuries. + */ +TREASURY_BLACKLIST.set(ERC20_OHM_V1, PROTOCOL_ADDRESSES); +TREASURY_BLACKLIST.set(ERC20_OHM_V2, PROTOCOL_ADDRESSES); +TREASURY_BLACKLIST.set(ERC20_GOHM, PROTOCOL_ADDRESSES); +TREASURY_BLACKLIST.set(ERC20_SOHM_V1, PROTOCOL_ADDRESSES); +TREASURY_BLACKLIST.set(ERC20_SOHM_V2, PROTOCOL_ADDRESSES); +TREASURY_BLACKLIST.set(ERC20_SOHM_V3, PROTOCOL_ADDRESSES); + +/** + * Some wallets (e.g. {DAO_WALLET}) have specific treasury assets mixed into them. + * For this reason, the wallets to be used differ on a per-contract basis. + * + * This function returns the wallets that should be iterated over for the given + * contract, {contractAddress}. + * + * @param contractAddress + * @returns + */ +export const getWalletAddressesForContract = (contractAddress: string): string[] => { + const walletAddresses = PROTOCOL_ADDRESSES.slice(0); + + // If the contract isn't on the blacklist, return as normal + if (!TREASURY_BLACKLIST.has(contractAddress.toLowerCase())) { + log.debug("getWalletAddressesForContract: token {} is not on treasury blacklist", [contractAddress]); + return walletAddresses; + } + + // Otherwise remove the values in the blacklist + // AssemblyScript doesn't yet have closures, so filter() cannot be used + const walletBlacklist = TREASURY_BLACKLIST.get(contractAddress.toLowerCase()); + for (let i = 0; i < walletBlacklist.length; i++) { + // If the blacklisted address is not in the array, skip + const arrayIndex = walletAddresses.indexOf(walletBlacklist[i]); + if (arrayIndex < 0) { + continue; + } + + // Otherwise the blacklist address is removed from the array in-place + const splicedValues = walletAddresses.splice(arrayIndex, 1); + log.debug("getWalletAddressesForContract: removed values: {}", [splicedValues.toString()]); + } + + return walletAddresses; +}; diff --git a/subgraphs/ethereum/src/utils/Silo.ts b/subgraphs/ethereum/src/utils/Silo.ts index 7ad8e3a9..5f9c88af 100644 --- a/subgraphs/ethereum/src/utils/Silo.ts +++ b/subgraphs/ethereum/src/utils/Silo.ts @@ -1,9 +1,10 @@ import { Address, BigDecimal, BigInt, log } from "@graphprotocol/graph-ts"; import { TokenSupply } from "../../../shared/generated/schema"; import { ERC20 } from "../../generated/ProtocolMetrics/ERC20"; -import { ERC20_OHM_V2, getContractName, getWalletAddressesForContract } from "./Constants"; +import { ERC20_OHM_V2, getContractName } from "./Constants"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { TYPE_LENDING, createOrUpdateTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; +import { getWalletAddressesForContract } from "./ProtocolAddresses"; // Hard-coding this for now. If we wanted this to be generalisable, we would use the Silo Repository contract. const SILO_OHM_COLLATERAL_TOKEN = "0x907136B74abA7D5978341eBA903544134A66B065"; diff --git a/subgraphs/ethereum/tests/contractHelper.test.ts b/subgraphs/ethereum/tests/contractHelper.test.ts index c71c8ae8..80e651bf 100644 --- a/subgraphs/ethereum/tests/contractHelper.test.ts +++ b/subgraphs/ethereum/tests/contractHelper.test.ts @@ -28,7 +28,6 @@ import { ERC20_OHM_V2, ERC20_TOKE, ERC20_WETH, - getWalletAddressesForContract, LQTY_STAKING, NATIVE_ETH, TOKE_STAKING, @@ -49,6 +48,7 @@ import { mockStablecoinsPriceFeeds } from "./chainlink"; import { ERC20_STANDARD_DECIMALS, mockERC20TotalSupply } from "./erc20Helper"; import { mockAuraEarnedBalance, mockAuraEarnedBalanceZero, mockAuraLockedBalance, mockAuraLockedBalanceZero, mockBalancerGaugeBalance, mockBalancerGaugeBalanceZero, mockConvexStakedBalance, mockConvexStakedBalanceZero, mockEthUsdRate, mockLiquityStakedBalance, mockLiquityStakedBalanceZero, mockTokeStakedBalance, mockTokeStakedBalanceZero } from "./pairHelper"; import { mockWalletBalance, mockZeroWalletBalances } from "./walletHelper"; +import { getWalletAddressesForContract } from "../src/utils/ProtocolAddresses"; const TIMESTAMP: BigInt = BigInt.fromString("1"); const DEFAULT_TOTAL_SUPPLY = BigDecimal.fromString("0"); diff --git a/subgraphs/ethereum/tests/erc4626.test.ts b/subgraphs/ethereum/tests/erc4626.test.ts index 00732cc5..b76dd463 100644 --- a/subgraphs/ethereum/tests/erc4626.test.ts +++ b/subgraphs/ethereum/tests/erc4626.test.ts @@ -5,7 +5,7 @@ import { toBigInt, toDecimal } from "../../shared/src/utils/Decimals"; import { TREASURY_ADDRESS_V3 } from "../../shared/src/Wallets"; import { getAllERC4626Balances } from "../src/utils/ERC4626"; import { mockWalletBalance, mockZeroWalletBalances } from "./walletHelper"; -import { getWalletAddressesForContract } from "../src/utils/Constants"; +import { getWalletAddressesForContract } from "../src/utils/ProtocolAddresses"; const SDAI = "0x83F20F44975D03b1b09e64809B757c47f942BEeA"; const DAI = "0x6B175474E89094C44Da98b954EedeAC495271d0F"; diff --git a/subgraphs/ethereum/tests/liquidityBalancer.test.ts b/subgraphs/ethereum/tests/liquidityBalancer.test.ts index 3aa811ee..d3ec71e6 100644 --- a/subgraphs/ethereum/tests/liquidityBalancer.test.ts +++ b/subgraphs/ethereum/tests/liquidityBalancer.test.ts @@ -20,7 +20,6 @@ import { ERC20_OHM_V1, ERC20_OHM_V2, ERC20_USDC, - getWalletAddressesForContract, POOL_BALANCER_OHM_DAI_WETH_ID, POOL_BALANCER_OHM_V2_BTRFLY_V2_ID, POOL_BALANCER_WETH_FDT_ID, @@ -55,6 +54,7 @@ import { OHM_USD_RESERVE_BLOCK, } from "./pairHelper"; import { mockWalletBalance, mockZeroWalletBalances } from "./walletHelper"; +import { getWalletAddressesForContract } from "../src/utils/ProtocolAddresses"; const TIMESTAMP = BigInt.fromString("1"); diff --git a/subgraphs/ethereum/tests/liquidityCalculations.test.ts b/subgraphs/ethereum/tests/liquidityCalculations.test.ts index 4a767b2f..6c7c8a28 100644 --- a/subgraphs/ethereum/tests/liquidityCalculations.test.ts +++ b/subgraphs/ethereum/tests/liquidityCalculations.test.ts @@ -11,7 +11,6 @@ import { ERC20_DAI, ERC20_OHM_V2, ERC20_WETH, - getWalletAddressesForContract, PAIR_CURVE_OHM_ETH, PAIR_FRAXSWAP_V1_OHM_FRAX, PAIR_UNISWAP_V2_OHM_DAI_V2, @@ -36,6 +35,7 @@ import { OHM_V2_DECIMALS, } from "./pairHelper"; import { mockWalletBalance, mockZeroWalletBalances } from "./walletHelper"; +import { getWalletAddressesForContract } from "../src/utils/ProtocolAddresses"; const PAIR_CURVE_OHM_ETH_TOTAL_SUPPLY = BigDecimal.fromString("100"); const TIMESTAMP = BigInt.fromString("1"); diff --git a/subgraphs/ethereum/tests/liquidityCurve.test.ts b/subgraphs/ethereum/tests/liquidityCurve.test.ts index 879b3f7f..a73dd507 100644 --- a/subgraphs/ethereum/tests/liquidityCurve.test.ts +++ b/subgraphs/ethereum/tests/liquidityCurve.test.ts @@ -29,7 +29,6 @@ import { FRAX_LOCKING_FRAX_USDC, getContractAbbreviation, getContractName, - getWalletAddressesForContract, NATIVE_ETH, PAIR_CURVE_FRAX_USDC, PAIR_CURVE_OHM_ETH, @@ -58,6 +57,7 @@ import { OHM_V2_DECIMALS, } from "./pairHelper"; import { mockWalletBalance, mockZeroWalletBalances } from "./walletHelper"; +import { getWalletAddressesForContract } from "../src/utils/ProtocolAddresses"; const PAIR_CURVE_OHM_ETH_TOTAL_SUPPLY = BigDecimal.fromString("100"); const TIMESTAMP = BigInt.fromString("1"); diff --git a/subgraphs/ethereum/tests/liquidityFraxSwap.test.ts b/subgraphs/ethereum/tests/liquidityFraxSwap.test.ts index 72f23867..c2dc7ed3 100644 --- a/subgraphs/ethereum/tests/liquidityFraxSwap.test.ts +++ b/subgraphs/ethereum/tests/liquidityFraxSwap.test.ts @@ -15,7 +15,6 @@ import { ERC20_OHM_V1, ERC20_OHM_V2, ERC20_USDC, - getWalletAddressesForContract, PAIR_FRAXSWAP_V1_OHM_FRAX, } from "../src/utils/Constants"; import { mockStablecoinsPriceFeeds } from "./chainlink"; @@ -39,6 +38,7 @@ import { OHM_USD_RESERVE_BLOCK, } from "./pairHelper"; import { mockWalletBalance, mockZeroWalletBalances } from "./walletHelper"; +import { getWalletAddressesForContract } from "../src/utils/ProtocolAddresses"; const TIMESTAMP = BigInt.fromString("1"); diff --git a/subgraphs/ethereum/tests/liquidityUniswapV2.test.ts b/subgraphs/ethereum/tests/liquidityUniswapV2.test.ts index 9af43a88..e5725cef 100644 --- a/subgraphs/ethereum/tests/liquidityUniswapV2.test.ts +++ b/subgraphs/ethereum/tests/liquidityUniswapV2.test.ts @@ -15,7 +15,6 @@ import { ERC20_DAI, ERC20_OHM_V1, ERC20_OHM_V2, - getWalletAddressesForContract, PAIR_UNISWAP_V2_OHM_BTRFLY_V1, PAIR_UNISWAP_V2_OHM_DAI, PAIR_UNISWAP_V2_OHM_DAI_V2, @@ -46,6 +45,7 @@ import { OHM_V2_DECIMALS, } from "./pairHelper"; import { mockWalletBalance, mockZeroWalletBalances } from "./walletHelper"; +import { getWalletAddressesForContract } from "../src/utils/ProtocolAddresses"; // Limits the search to the OHM-DAI pairs, otherwise other pairs will be iterated over const pairArrayOverride: PairHandler[] = [ diff --git a/subgraphs/ethereum/tests/liquityAllocator.test.ts b/subgraphs/ethereum/tests/liquityAllocator.test.ts index 79c07bd5..2c51eca7 100644 --- a/subgraphs/ethereum/tests/liquityAllocator.test.ts +++ b/subgraphs/ethereum/tests/liquityAllocator.test.ts @@ -3,12 +3,13 @@ import { assert, beforeEach, clearStore, createMockedFunction, test } from "matc import { toBigInt } from "../../shared/src/utils/Decimals"; import { DAO_WALLET } from "../../shared/src/Wallets"; -import { ERC20_LQTY, ERC20_LUSD, ERC20_TRIBE, ERC20_WETH, getWalletAddressesForContract, LIQUITY_STABILITY_POOL } from "../src/utils/Constants"; +import { ERC20_LQTY, ERC20_LUSD, ERC20_TRIBE, ERC20_WETH, LIQUITY_STABILITY_POOL } from "../src/utils/Constants"; import { getLiquityStabilityPoolRecords, } from "../src/utils/ContractHelper"; import { ERC20_STANDARD_DECIMALS, mockERC20TotalSupply } from "./erc20Helper"; import { OHM_USD_RESERVE_BLOCK } from "./pairHelper"; +import { getWalletAddressesForContract } from "../src/utils/ProtocolAddresses"; const LUSD_BALANCE = "100"; const LUSD_BALANCE_INT = toBigInt(BigDecimal.fromString(LUSD_BALANCE), ERC20_STANDARD_DECIMALS); diff --git a/subgraphs/ethereum/tests/pairHelper.ts b/subgraphs/ethereum/tests/pairHelper.ts index 428b166e..b2376710 100644 --- a/subgraphs/ethereum/tests/pairHelper.ts +++ b/subgraphs/ethereum/tests/pairHelper.ts @@ -15,9 +15,7 @@ import { BALANCER_LIQUIDITY_GAUGE_OHM_WETH, BALANCER_LIQUIDITY_GAUGE_OHM_WSTETH, BALANCER_LIQUIDITY_GAUGE_WETH_FDT, - BALANCER_LIQUIDITY_GAUGES, BALANCER_VAULT, - CONVEX_ALLOCATORS, CONVEX_STAKING_CONTRACTS, ERC20_AURA, ERC20_AURA_BAL, @@ -62,7 +60,6 @@ import { ERC20_WSTETH, FRAX_LOCKING_CONTRACTS, getContractName, - getWalletAddressesForContract, LQTY_STAKING, PAIR_CURVE_FRAX_USDC, PAIR_CURVE_OHM_ETH, @@ -101,6 +98,7 @@ import { import { mockPriceFeed, mockStablecoinsPriceFeeds } from "./chainlink"; import { ERC20_STANDARD_DECIMALS, mockERC20TotalSupply } from "./erc20Helper"; import { mockZeroWalletBalances } from "./walletHelper"; +import { CONVEX_ALLOCATORS, getWalletAddressesForContract } from "../src/utils/ProtocolAddresses"; export const ETH_TRIBE_RESERVE_TRIBE = BigInt.fromString("40963255589554358793575"); export const ETH_TRIBE_RESERVE_ETH = BigInt.fromString("4956325030062526848"); diff --git a/subgraphs/ethereum/tests/price.test.ts b/subgraphs/ethereum/tests/price.test.ts index 41f598c0..7877cbb0 100644 --- a/subgraphs/ethereum/tests/price.test.ts +++ b/subgraphs/ethereum/tests/price.test.ts @@ -31,7 +31,6 @@ import { ERC20_USDC, ERC20_UST, ERC20_WETH, - getWalletAddressesForContract, NATIVE_ETH, PAIR_UNISWAP_V2_OHM_DAI_V2, PAIR_UNISWAP_V2_OHM_DAI_V2_BLOCK, @@ -51,7 +50,6 @@ import { getUSDRate, getUSDRateBalancer } from "../src/utils/Price"; import { mockStablecoinsPriceFeeds } from "./chainlink"; import { ERC20_STANDARD_DECIMALS, mockERC20Balance } from "./erc20Helper"; import { - ETH_PRICE, getERC20UsdRate, getEthUsdRate, getOhmUsdRate, @@ -81,6 +79,7 @@ import { import { TREASURY_ADDRESS_V3 } from "../../shared/src/Wallets"; import { UNISWAP_V3_POSITION_MANAGER } from "../src/liquidity/LiquidityUniswapV3"; import { mockUniswapV3Pair, mockUniswapV3Positions, mockUniswapV3Position } from "./uniswapV3Helper"; +import { getWalletAddressesForContract } from "../src/utils/ProtocolAddresses"; beforeEach(() => { log.debug("beforeEach: Clearing store", []); diff --git a/subgraphs/ethereum/tests/uniswapV3Helper.ts b/subgraphs/ethereum/tests/uniswapV3Helper.ts index d494f1cc..e0af5d9a 100644 --- a/subgraphs/ethereum/tests/uniswapV3Helper.ts +++ b/subgraphs/ethereum/tests/uniswapV3Helper.ts @@ -1,6 +1,6 @@ import { Address, BigInt, ethereum } from "@graphprotocol/graph-ts"; import { createMockedFunction } from "matchstick-as"; -import { getWalletAddressesForContract } from "../src/utils/Constants"; +import { getWalletAddressesForContract } from "../src/utils/ProtocolAddresses"; export function mockUniswapV3Positions( positionManager: string, From cb0f31ae1bd4f0172464f929ad95861b1f0d01fe Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 25 Sep 2023 14:01:22 +0400 Subject: [PATCH 07/81] Shift to new implementation --- subgraphs/ethereum/src/utils/Constants.ts | 2 +- subgraphs/ethereum/tests/contractHelper.test.ts | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/subgraphs/ethereum/src/utils/Constants.ts b/subgraphs/ethereum/src/utils/Constants.ts index 923ccaaf..9ced6888 100644 --- a/subgraphs/ethereum/src/utils/Constants.ts +++ b/subgraphs/ethereum/src/utils/Constants.ts @@ -2,7 +2,7 @@ import { Address, BigDecimal, BigInt, log } from "@graphprotocol/graph-ts"; import { TokenCategoryPOL, TokenCategoryStable, TokenCategoryVolatile, TokenDefinition } from "../../../shared/src/contracts/TokenDefinition"; import { LendingMarketDeployment } from "../../../shared/src/utils/LendingMarketDeployment"; -import { AAVE_ALLOCATOR, AAVE_ALLOCATOR_V2, AURA_ALLOCATOR, AURA_ALLOCATOR_V2, BALANCER_ALLOCATOR, BONDS_DEPOSIT, BONDS_INVERSE_DEPOSIT, CONVEX_ALLOCATOR1, CONVEX_ALLOCATOR2, CONVEX_ALLOCATOR3, CONVEX_CVX_ALLOCATOR, CONVEX_CVX_VL_ALLOCATOR, CONVEX_STAKING_PROXY_FRAXBP, CONVEX_STAKING_PROXY_OHM_FRAXBP, COOLER_LOANS_CLEARINGHOUSE, CROSS_CHAIN_ARBITRUM, CROSS_CHAIN_FANTOM, CROSS_CHAIN_POLYGON, DAO_WALLET, DAO_WORKING_CAPITAL, LUSD_ALLOCATOR, MAKER_DSR_ALLOCATOR, MAKER_DSR_ALLOCATOR_PROXY, MYSO_LENDING, OLYMPUS_ASSOCIATION_WALLET, OTC_ESCROW, RARI_ALLOCATOR, TREASURY_ADDRESS_V1, TREASURY_ADDRESS_V2, TREASURY_ADDRESS_V3, TRSRY, VEFXS_ALLOCATOR, VENDOR_LENDING, WALLET_ADDRESSES } from "../../../shared/src/Wallets"; +import { AAVE_ALLOCATOR, AAVE_ALLOCATOR_V2, AURA_ALLOCATOR, AURA_ALLOCATOR_V2, BALANCER_ALLOCATOR, BONDS_DEPOSIT, BONDS_INVERSE_DEPOSIT, CONVEX_ALLOCATOR1, CONVEX_ALLOCATOR2, CONVEX_ALLOCATOR3, CONVEX_CVX_ALLOCATOR, CONVEX_CVX_VL_ALLOCATOR, CONVEX_STAKING_PROXY_FRAXBP, CONVEX_STAKING_PROXY_OHM_FRAXBP, COOLER_LOANS_CLEARINGHOUSE, CROSS_CHAIN_ARBITRUM, CROSS_CHAIN_FANTOM, CROSS_CHAIN_POLYGON, DAO_WALLET, DAO_WORKING_CAPITAL, LUSD_ALLOCATOR, MAKER_DSR_ALLOCATOR, MAKER_DSR_ALLOCATOR_PROXY, MYSO_LENDING, OLYMPUS_ASSOCIATION_WALLET, OTC_ESCROW, RARI_ALLOCATOR, TREASURY_ADDRESS_V1, TREASURY_ADDRESS_V2, TREASURY_ADDRESS_V3, TRSRY, VEFXS_ALLOCATOR, VENDOR_LENDING } from "../../../shared/src/Wallets"; import { PairHandler, PairHandlerTypes } from "./PairHandler"; export const BLOCKCHAIN = "Ethereum"; diff --git a/subgraphs/ethereum/tests/contractHelper.test.ts b/subgraphs/ethereum/tests/contractHelper.test.ts index 80e651bf..1bd2163a 100644 --- a/subgraphs/ethereum/tests/contractHelper.test.ts +++ b/subgraphs/ethereum/tests/contractHelper.test.ts @@ -8,7 +8,6 @@ import { CONVEX_CVX_VL_ALLOCATOR, DAO_WALLET, TREASURY_ADDRESS_V3, - WALLET_ADDRESSES, } from "../../shared/src/Wallets"; import { AURA_STAKING_AURA_BAL, @@ -187,11 +186,12 @@ describe("get ERC20 token records from wallets", () => { }); test("excludes OHM in treasury wallet addresses", () => { - mockZeroWalletBalances(ERC20_OHM_V2, getWalletAddressesForContract(ERC20_OHM_V2)); + const walletAddresses = getWalletAddressesForContract(ERC20_OHM_V2); + mockZeroWalletBalances(ERC20_OHM_V2, walletAddresses); mockERC20TotalSupply(ERC20_OHM_V2, ERC20_STANDARD_DECIMALS, toBigInt(DEFAULT_TOTAL_SUPPLY, ERC20_STANDARD_DECIMALS)); - for (let i = 0; i < WALLET_ADDRESSES.length; i++) { - mockWalletBalance(ERC20_OHM_V2, WALLET_ADDRESSES[i], toBigInt(BigDecimal.fromString("10"))); + for (let i = 0; i < walletAddresses.length; i++) { + mockWalletBalance(ERC20_OHM_V2, walletAddresses[i], toBigInt(BigDecimal.fromString("10"))); } const blockNumber = BigInt.fromString("14000000"); @@ -210,11 +210,12 @@ describe("get ERC20 token records from wallets", () => { }); test("excludes gOHM in treasury wallet addresses", () => { - mockZeroWalletBalances(ERC20_GOHM, getWalletAddressesForContract(ERC20_GOHM)); + const walletAddresses = getWalletAddressesForContract(ERC20_OHM_V2); + mockZeroWalletBalances(ERC20_GOHM, walletAddresses); mockERC20TotalSupply(ERC20_GOHM, ERC20_STANDARD_DECIMALS, toBigInt(DEFAULT_TOTAL_SUPPLY, ERC20_STANDARD_DECIMALS)); - for (let i = 0; i < WALLET_ADDRESSES.length; i++) { - mockWalletBalance(ERC20_GOHM, WALLET_ADDRESSES[i], toBigInt(BigDecimal.fromString("10"))); + for (let i = 0; i < walletAddresses.length; i++) { + mockWalletBalance(ERC20_GOHM, walletAddresses[i], toBigInt(BigDecimal.fromString("10"))); } const blockNumber = BigInt.fromString("14000000"); From 84d0a2f33d817cc558a68fe54fc804bb30c5598c Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 25 Sep 2023 14:05:05 +0400 Subject: [PATCH 08/81] Test fixes --- subgraphs/ethereum/tests/tokenRecordHelper.test.ts | 1 - subgraphs/shared/tests/price/PriceHandlerBalancer.test.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/subgraphs/ethereum/tests/tokenRecordHelper.test.ts b/subgraphs/ethereum/tests/tokenRecordHelper.test.ts index 6255aef0..fdd75516 100644 --- a/subgraphs/ethereum/tests/tokenRecordHelper.test.ts +++ b/subgraphs/ethereum/tests/tokenRecordHelper.test.ts @@ -48,7 +48,6 @@ describe("constructor", () => { test("basic values", () => { const record = createTokenRecord(); - assert.stringEquals("1970-01-01/source/name", record.id); assert.stringEquals("name", record.token); assert.stringEquals("tokenAddress", record.tokenAddress); assert.stringEquals("source", record.source); diff --git a/subgraphs/shared/tests/price/PriceHandlerBalancer.test.ts b/subgraphs/shared/tests/price/PriceHandlerBalancer.test.ts index 48ef5eec..3e0071f0 100644 --- a/subgraphs/shared/tests/price/PriceHandlerBalancer.test.ts +++ b/subgraphs/shared/tests/price/PriceHandlerBalancer.test.ts @@ -1,4 +1,4 @@ -import { Address, BigDecimal, BigInt, Bytes, ethereum, log } from "@graphprotocol/graph-ts"; +import { Address, BigDecimal, BigInt, Bytes, ethereum } from "@graphprotocol/graph-ts"; import { assert, createMockedFunction, describe, test } from "matchstick-as/assembly/index"; import { CIRCULATING_SUPPLY_WALLETS } from "../../../arbitrum/src/contracts/Constants"; From 4f7729928bdf4990c6502a4779c2df9f9dc10ed1 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 25 Sep 2023 20:07:37 +0400 Subject: [PATCH 09/81] Empty commit From 75fbc3221128822fa5e24a152c66db38016a72d6 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 26 Sep 2023 13:00:31 +0400 Subject: [PATCH 10/81] Make TokenRecord/TokenSupply/ProtocolMetric immutable --- schema.graphql | 53 +++---------------- .../arbitrum/src/contracts/JonesStaking.ts | 4 +- subgraphs/arbitrum/src/contracts/Sentiment.ts | 4 +- subgraphs/arbitrum/src/contracts/Silo.ts | 4 +- .../arbitrum/src/contracts/TreasureMining.ts | 4 +- .../arbitrum/src/treasury/OhmCalculations.ts | 14 ++--- .../arbitrum/src/treasury/OwnedLiquidity.ts | 4 +- subgraphs/ethereum/generated/schema.ts | 28 +++++----- .../src/contracts/CoolerLoansClearinghouse.ts | 4 +- .../src/liquidity/LiquidityBalancer.ts | 8 +-- .../ethereum/src/liquidity/LiquidityCurve.ts | 12 ++--- .../src/liquidity/LiquidityFraxSwap.ts | 8 +-- .../src/liquidity/LiquidityUniswapV2.ts | 8 +-- .../src/liquidity/LiquidityUniswapV3.ts | 8 +-- .../src/protocolMetrics/ProtocolMetrics.ts | 22 +++----- .../ethereum/src/utils/ContractHelper.ts | 40 +++++++------- subgraphs/ethereum/src/utils/ERC4626.ts | 4 +- .../ethereum/src/utils/OhmCalculations.ts | 26 ++++----- subgraphs/ethereum/src/utils/Silo.ts | 4 +- .../ethereum/tests/tokenRecordHelper.test.ts | 14 ++--- .../fantom/src/treasury/OwnedLiquidity.ts | 4 +- .../polygon/src/treasury/OwnedLiquidity.ts | 4 +- subgraphs/shared/src/contracts/ERC20.ts | 4 +- .../shared/src/utils/TokenRecordHelper.ts | 12 ++--- .../shared/src/utils/TokenSupplyHelper.ts | 12 ++--- 25 files changed, 128 insertions(+), 181 deletions(-) diff --git a/schema.graphql b/schema.graphql index 041ec207..4f888742 100644 --- a/schema.graphql +++ b/schema.graphql @@ -1,35 +1,6 @@ -type DailyBond @entity { - id: ID! - timestamp: BigInt! - token: Token! - amount: BigDecimal! - value: BigDecimal! -} - -type Rebase @entity { - id: ID! - amount: BigDecimal! - stakedOhms: BigDecimal! - percentage: BigDecimal! - contract: String! - timestamp: BigInt! - value: BigDecimal! -} - -type DailyStakingReward @entity { - id: ID! - timestamp: BigInt! - amount: BigDecimal! - value: BigDecimal! -} - -type Token @entity { - id: ID! -} - # Stores easily-calculated metrics related to the Olympus protocol -type ProtocolMetric @entity { - id: ID! # YYYY-MM-DD +type ProtocolMetric @entity(immutable: true) { + id: Bytes! # YYYY-MM-DD/ block: BigInt! currentAPY: BigDecimal! currentIndex: BigDecimal! @@ -53,21 +24,9 @@ type ProtocolMetric @entity { treasuryMarketValue: BigDecimal } -type BondDiscount @entity { - id: ID! - timestamp: BigInt! - dai_discount: BigDecimal! - ohmdai_discount: BigDecimal! - frax_discount: BigDecimal! - ohmfrax_discount: BigDecimal! - eth_discount: BigDecimal! - lusd_discount: BigDecimal! - ohmlusd_discount: BigDecimal! -} - # Represents the balance of a specific token in the treasury -type TokenRecord @entity { - id: Bytes! # YYYY-MM-DD// +type TokenRecord @entity(immutable: true) { + id: Bytes! # YYYY-MM-DD/// block: BigInt! timestamp: BigInt! # Unix timestamp in UTC date: String! @@ -87,8 +46,8 @@ type TokenRecord @entity { } # Represents a balance that affects the supply of OHM -type TokenSupply @entity { - id: Bytes! # YYYY-MM-DD//// +type TokenSupply @entity(immutable: true) { + id: Bytes! # YYYY-MM-DD///// block: BigInt! timestamp: BigInt! # Unix timestamp in UTC date: String! # YYYY-MM-DD diff --git a/subgraphs/arbitrum/src/contracts/JonesStaking.ts b/subgraphs/arbitrum/src/contracts/JonesStaking.ts index f3196793..6a8b278b 100644 --- a/subgraphs/arbitrum/src/contracts/JonesStaking.ts +++ b/subgraphs/arbitrum/src/contracts/JonesStaking.ts @@ -5,7 +5,7 @@ import { getDecimals } from "../../../shared/src/contracts/ERC20"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { addressesEqual } from "../../../shared/src/utils/StringHelper"; import { - createOrUpdateTokenRecord, + createTokenRecord, getIsTokenLiquid, getTokenRecordValue, } from "../../../shared/src/utils/TokenRecordHelper"; @@ -102,7 +102,7 @@ export const getStakedBalances = ( price = getPrice(tokenAddress, block); } - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( timestamp, getContractName(tokenAddress, "Staked"), tokenAddress, diff --git a/subgraphs/arbitrum/src/contracts/Sentiment.ts b/subgraphs/arbitrum/src/contracts/Sentiment.ts index c0eb59f3..34c1dc07 100644 --- a/subgraphs/arbitrum/src/contracts/Sentiment.ts +++ b/subgraphs/arbitrum/src/contracts/Sentiment.ts @@ -4,7 +4,7 @@ import { TokenSupply } from "../../../shared/generated/schema"; import { ERC20_OHM, SENTIMENT_LTOKEN } from "./Constants"; import { ERC20 } from "../../generated/TokenRecords-arbitrum/ERC20"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { TYPE_LENDING, createOrUpdateTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; +import { TYPE_LENDING, createTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; import { getContractName, getWalletAddressesForContract } from "./Contracts"; export function getSentimentSupply(timestamp: BigInt, blockNumber: BigInt): TokenSupply[] { @@ -30,7 +30,7 @@ export function getSentimentSupply(timestamp: BigInt, blockNumber: BigInt): Toke log.info("getSentimentSupply: Sentiment OHM balance {} for wallet {}", [balance.toString(), getContractName(currentWallet)]); records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM), ERC20_OHM, diff --git a/subgraphs/arbitrum/src/contracts/Silo.ts b/subgraphs/arbitrum/src/contracts/Silo.ts index 4d2b9bd9..08006d31 100644 --- a/subgraphs/arbitrum/src/contracts/Silo.ts +++ b/subgraphs/arbitrum/src/contracts/Silo.ts @@ -4,7 +4,7 @@ import { TokenSupply } from "../../../shared/generated/schema"; import { ERC20_OHM } from "./Constants"; import { ERC20 } from "../../generated/TokenRecords-arbitrum/ERC20"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { TYPE_LENDING, createOrUpdateTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; +import { TYPE_LENDING, createTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; import { getContractName, getWalletAddressesForContract } from "./Contracts"; // Hard-coding this for now. If we wanted this to be generalisable, we would use the Silo Repository contract. @@ -33,7 +33,7 @@ export function getSiloSupply(timestamp: BigInt, blockNumber: BigInt): TokenSupp log.info("getSiloSupply: Silo OHM balance {} for wallet {}", [balance.toString(), getContractName(currentWallet)]); records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM), ERC20_OHM, diff --git a/subgraphs/arbitrum/src/contracts/TreasureMining.ts b/subgraphs/arbitrum/src/contracts/TreasureMining.ts index f518ca92..86daf170 100644 --- a/subgraphs/arbitrum/src/contracts/TreasureMining.ts +++ b/subgraphs/arbitrum/src/contracts/TreasureMining.ts @@ -3,7 +3,7 @@ import { Address, BigDecimal, BigInt } from "@graphprotocol/graph-ts"; import { TokenRecord } from "../../../shared/generated/schema"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { addressesEqual } from "../../../shared/src/utils/StringHelper"; -import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; +import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; import { WALLET_ADDRESSES } from "../../../shared/src/Wallets"; import { TreasureMining } from "../../generated/TokenRecords-arbitrum/TreasureMining"; import { getPrice } from "../price/PriceLookup"; @@ -105,7 +105,7 @@ export const getStakedBalances = ( price = getPrice(tokenAddress, block); } - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( timestamp, getContractName(tokenAddress, "Staked", "veMAGIC"), tokenAddress, diff --git a/subgraphs/arbitrum/src/treasury/OhmCalculations.ts b/subgraphs/arbitrum/src/treasury/OhmCalculations.ts index edafa6bf..037914fb 100644 --- a/subgraphs/arbitrum/src/treasury/OhmCalculations.ts +++ b/subgraphs/arbitrum/src/treasury/OhmCalculations.ts @@ -5,7 +5,7 @@ import { getERC20DecimalBalance } from "../../../shared/src/contracts/ERC20"; import { pushTokenSupplyArray } from "../../../shared/src/utils/ArrayHelper"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { LendingMarketDeployment } from "../../../shared/src/utils/LendingMarketDeployment"; -import { createOrUpdateTokenSupply, TYPE_LENDING, TYPE_LIQUIDITY, TYPE_TOTAL_SUPPLY, TYPE_TREASURY } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createTokenSupply, TYPE_LENDING, TYPE_LIQUIDITY, TYPE_TOTAL_SUPPLY, TYPE_TREASURY } from "../../../shared/src/utils/TokenSupplyHelper"; import { ERC20 } from "../../generated/TokenRecords-arbitrum/ERC20"; import { OlympusLender } from "../../generated/TokenRecords-arbitrum/OlympusLender"; import { CIRCULATING_SUPPLY_WALLETS, ERC20_GOHM_SYNAPSE, ERC20_OHM, OLYMPUS_LENDER, SENTIMENT_DEPLOYMENTS, SENTIMENT_LTOKEN, SILO_ADDRESS, SILO_DEPLOYMENTS } from "../contracts/Constants"; @@ -33,7 +33,7 @@ export function getTotalSupply(timestamp: BigInt, blockNumber: BigInt): TokenSup } const totalSupply = toDecimal(totalSupplyResult.value, decimalsResult.value); - return [createOrUpdateTokenSupply( + return [createTokenSupply( timestamp, getContractName(ERC20_OHM), ERC20_OHM, null, null, null, null, TYPE_TOTAL_SUPPLY, totalSupply, blockNumber)]; } @@ -76,7 +76,7 @@ export function getLendingAMOOHMRecords(timestamp: BigInt, blockNumber: BigInt): } records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM), ERC20_OHM, @@ -122,7 +122,7 @@ function getLendingMarketManualDeploymentOHMRecords(timestamp: BigInt, deploymen // Record the balance at the current block records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM), ERC20_OHM, @@ -225,7 +225,7 @@ export function getTreasuryOHMRecords(timestamp: BigInt, blockNumber: BigInt): T * and the frontend will use the index to convert gOHM to OHM. */ records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_GOHM_SYNAPSE), ERC20_GOHM_SYNAPSE, @@ -248,7 +248,7 @@ export function getTreasuryOHMRecords(timestamp: BigInt, blockNumber: BigInt): T if (balance.equals(BigDecimal.zero())) continue; records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM), ERC20_OHM, @@ -306,7 +306,7 @@ export function getProtocolOwnedLiquiditySupplyRecords( } records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(currentOhmToken), currentOhmToken, diff --git a/subgraphs/arbitrum/src/treasury/OwnedLiquidity.ts b/subgraphs/arbitrum/src/treasury/OwnedLiquidity.ts index a8508226..5b65a238 100644 --- a/subgraphs/arbitrum/src/treasury/OwnedLiquidity.ts +++ b/subgraphs/arbitrum/src/treasury/OwnedLiquidity.ts @@ -4,7 +4,7 @@ import { TokenRecord } from "../../../shared/generated/schema"; import { PriceHandler } from "../../../shared/src/price/PriceHandler"; import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { - createOrUpdateTokenRecord, + createTokenRecord, getIsTokenLiquid, } from "../../../shared/src/utils/TokenRecordHelper"; import { WALLET_ADDRESSES } from "../../../shared/src/Wallets"; @@ -61,7 +61,7 @@ function getOwnedLiquidityBalance( } // Create record - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( timestamp, getContractName(liquidityHandler.getId()), liquidityHandler.getId(), diff --git a/subgraphs/ethereum/generated/schema.ts b/subgraphs/ethereum/generated/schema.ts index 0860bd4d..7219e30f 100644 --- a/subgraphs/ethereum/generated/schema.ts +++ b/subgraphs/ethereum/generated/schema.ts @@ -344,9 +344,9 @@ export class Token extends Entity { } export class ProtocolMetric extends Entity { - constructor(id: string) { + constructor(id: Bytes) { super(); - this.set("id", Value.fromString(id)); + this.set("id", Value.fromBytes(id)); } save(): void { @@ -354,34 +354,36 @@ export class ProtocolMetric extends Entity { assert(id != null, "Cannot save ProtocolMetric entity without an ID"); if (id) { assert( - id.kind == ValueKind.STRING, - `Entities of type ProtocolMetric must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + id.kind == ValueKind.BYTES, + `Entities of type ProtocolMetric must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("ProtocolMetric", id.toString(), this); + store.set("ProtocolMetric", id.toBytes().toHexString(), this); } } - static loadInBlock(id: string): ProtocolMetric | null { + static loadInBlock(id: Bytes): ProtocolMetric | null { return changetype( - store.get_in_block("ProtocolMetric", id) + store.get_in_block("ProtocolMetric", id.toHexString()) ); } - static load(id: string): ProtocolMetric | null { - return changetype(store.get("ProtocolMetric", id)); + static load(id: Bytes): ProtocolMetric | null { + return changetype( + store.get("ProtocolMetric", id.toHexString()) + ); } - get id(): string { + get id(): Bytes { const value = this.get("id"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBytes(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); } get block(): BigInt { diff --git a/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts b/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts index 2e533c90..58284c8b 100644 --- a/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts +++ b/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts @@ -2,7 +2,7 @@ import { Address, BigInt, log } from "@graphprotocol/graph-ts"; import { TokenRecord } from "../../../shared/generated/schema"; import { CoolerLoansClearinghouse } from "../../generated/ProtocolMetrics/CoolerLoansClearinghouse"; import { COOLER_LOANS_CLEARINGHOUSE } from "../../../shared/src/Wallets"; -import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; +import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; import { BLOCKCHAIN, ERC20_DAI, ERC20_TOKENS, getContractName } from "../utils/Constants"; import { getUSDRate } from "../utils/Price"; import { toDecimal } from "../../../shared/src/utils/Decimals"; @@ -23,7 +23,7 @@ export function getClearinghouseBalance(timestamp: BigInt, blockNumber: BigInt): log.info(`Cooler Loans Clearinghouse receivables balance: {}`, [receivablesBalance.toString()]); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, `${getContractName(ERC20_DAI)} - Borrowed Through Cooler Loans`, ERC20_DAI, diff --git a/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts b/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts index 498d281a..60d34fea 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts @@ -4,8 +4,8 @@ import { TokenRecord, TokenSupply } from "../../../shared/generated/schema"; import { TokenCategoryPOL } from "../../../shared/src/contracts/TokenDefinition"; import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; -import { createOrUpdateTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; +import { createTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; import { ERC20 } from "../../generated/PriceSnapshot/ERC20"; import { BalancerPoolToken } from "../../generated/ProtocolMetrics/BalancerPoolToken"; import { BalancerVault } from "../../generated/ProtocolMetrics/BalancerVault"; @@ -264,7 +264,7 @@ function getBalancerPoolTokenRecords( [getContractName(poolTokenAddress), balance.toString(), getContractName(walletAddress)], ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(poolTokenAddress), poolTokenAddress, @@ -491,7 +491,7 @@ export function getBalancerPoolTokenQuantity( const tokenBalance = totalQuantity.times(record.balance).div(poolTokenTotalSupply); records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(tokenAddress), tokenAddress, diff --git a/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts b/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts index a7d77877..25c83b54 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts @@ -4,8 +4,8 @@ import { log } from "matchstick-as"; import { TokenRecord, TokenSupply } from "../../../shared/generated/schema"; import { TokenDefinition } from "../../../shared/src/contracts/TokenDefinition"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { createOrUpdateTokenRecord, getTokenCategory } from "../../../shared/src/utils/TokenRecordHelper"; -import { createOrUpdateTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createTokenRecord, getTokenCategory } from "../../../shared/src/utils/TokenRecordHelper"; +import { createTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; import { CurvePool } from "../../generated/ProtocolMetrics/CurvePool"; import { CurvePoolV2 } from "../../generated/ProtocolMetrics/CurvePoolV2"; import { ERC20TokenSnapshot, PoolSnapshot } from "../../generated/schema"; @@ -223,7 +223,7 @@ function getCurvePairConvexStakedRecord( balance.toString(), ], ); - return createOrUpdateTokenRecord( + return createTokenRecord( timestamp, getContractName(stakedTokenDefinition.getAddress(), "Staked in Convex"), stakedTokenDefinition.getAddress(), @@ -292,7 +292,7 @@ function getCurvePairFraxLockedRecord( balance.toString(), ], ); - return createOrUpdateTokenRecord( + return createTokenRecord( timestamp, getContractName(stakedTokenDefinition.getAddress(), "Staked in Frax"), stakedTokenDefinition.getAddress(), @@ -354,7 +354,7 @@ function getCurvePairRecord( pairTokenBalanceDecimal.toString(), ]); - return createOrUpdateTokenRecord( + return createTokenRecord( timestamp, getContractName(pairTokenAddress), pairTokenAddress, @@ -608,7 +608,7 @@ export function getCurvePairTokenQuantityRecords( const tokenBalance = totalQuantity.times(record.balance).div(poolSnapshot.totalSupply); records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(tokenAddress), tokenAddress, diff --git a/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts b/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts index e9741c3f..24a532c1 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts @@ -3,8 +3,8 @@ import { Address, BigDecimal, BigInt, Bytes, log } from "@graphprotocol/graph-ts import { TokenRecord, TokenSupply } from "../../../shared/generated/schema"; import { TokenCategoryPOL } from "../../../shared/src/contracts/TokenDefinition"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; -import { createOrUpdateTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; +import { createTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; import { FraxSwapPool } from "../../generated/ProtocolMetrics/FraxSwapPool"; import { PoolSnapshot } from "../../generated/schema"; import { getOrCreateERC20TokenSnapshot } from "../contracts/ERC20"; @@ -209,7 +209,7 @@ function getFraxSwapPairTokenRecord( return null; } - return createOrUpdateTokenRecord( + return createTokenRecord( timestamp, getContractName(pairAddress), pairAddress, @@ -370,7 +370,7 @@ export function getFraxSwapPairTokenQuantityRecords( const tokenBalance = totalQuantity.times(record.balance).div(poolSnapshot.totalSupply); records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(tokenAddress), tokenAddress, diff --git a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts index c5f8a03d..f58f6c21 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts @@ -3,8 +3,8 @@ import { Address, BigDecimal, BigInt, Bytes, log } from "@graphprotocol/graph-ts import { TokenRecord, TokenSupply } from "../../../shared/generated/schema"; import { TokenCategoryPOL } from "../../../shared/src/contracts/TokenDefinition"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; -import { createOrUpdateTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; +import { createTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; import { UniswapV2Pair } from "../../generated/ProtocolMetrics/UniswapV2Pair"; import { PoolSnapshot } from "../../generated/schema"; import { getOrCreateERC20TokenSnapshot } from "../contracts/ERC20"; @@ -263,7 +263,7 @@ function getUniswapV2PairRecord( const pairTokenBalanceDecimal = toDecimal(pairTokenBalance, pairToken.decimals()); - return createOrUpdateTokenRecord( + return createTokenRecord( timestamp, getContractName(pairAddress), pairAddress, @@ -452,7 +452,7 @@ export function getUniswapV2PairTokenQuantity( const tokenBalance = totalQuantity.times(record.balance).div(poolTokenTotalSupply); records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(tokenAddress), tokenAddress, diff --git a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts index ba2f03a7..99552d13 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts @@ -7,8 +7,8 @@ import { getUSDRate } from "../utils/Price"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { getERC20Decimals } from "../contracts/ERC20"; import { UniswapV3PositionManager } from "../../generated/ProtocolMetrics/UniswapV3PositionManager"; -import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; -import { TYPE_LIQUIDITY, createOrUpdateTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; +import { TYPE_LIQUIDITY, createTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; import { TokenCategoryPOL } from "../../../shared/src/contracts/TokenDefinition"; import { getWalletAddressesForContract } from "../utils/ProtocolAddresses"; @@ -185,7 +185,7 @@ export function getUniswapV3POLRecords( log.debug("getUniswapV3POLRecords: multiplier: {}", [multiplier.toString()]); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(pairAddress), pairAddress, @@ -326,7 +326,7 @@ export function getUniswapV3OhmSupply( const ohmBalance = balances[ohmIndex]; records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(tokenAddress), tokenAddress, diff --git a/subgraphs/ethereum/src/protocolMetrics/ProtocolMetrics.ts b/subgraphs/ethereum/src/protocolMetrics/ProtocolMetrics.ts index 7594a10f..a5d79632 100644 --- a/subgraphs/ethereum/src/protocolMetrics/ProtocolMetrics.ts +++ b/subgraphs/ethereum/src/protocolMetrics/ProtocolMetrics.ts @@ -1,4 +1,4 @@ -import { BigInt, log } from "@graphprotocol/graph-ts"; +import { BigInt, Bytes, log } from "@graphprotocol/graph-ts"; import { ethereum } from "@graphprotocol/graph-ts"; import { TokenRecord, TokenSupply } from "../../../shared/generated/schema"; @@ -20,15 +20,14 @@ import { generateTokenRecords, generateTokenSupply } from "../utils/TreasuryCalc import { getAPY_Rebase, getNextOHMRebase } from "./Rebase"; import { getMarketCap, getTreasuryLiquidBacking, getTreasuryLiquidBackingPerGOhmSynthetic, getTreasuryLiquidBackingPerOhmFloating, getTreasuryMarketValue } from "./TreasuryMetrics"; -export function loadOrCreateProtocolMetric(timestamp: BigInt): ProtocolMetric { +export function createProtocolMetric(timestamp: BigInt, blockNumber: BigInt): ProtocolMetric { const dateString = getISO8601DateStringFromTimestamp(timestamp); + // YYYY-MM-DD/ + const recordId = Bytes.fromUTF8(dateString).concatI32(blockNumber.toI32()); - let protocolMetric = ProtocolMetric.load(dateString); - if (protocolMetric == null) { - protocolMetric = new ProtocolMetric(dateString); - protocolMetric.date = dateString; - protocolMetric.timestamp = timestamp; - } + const protocolMetric = new ProtocolMetric(recordId); + protocolMetric.date = dateString; + protocolMetric.timestamp = timestamp; return protocolMetric as ProtocolMetric; } @@ -37,7 +36,7 @@ export function updateProtocolMetrics(block: ethereum.Block, tokenRecords: Token const blockNumber = block.number; log.info("Starting protocol metrics for block {}", [blockNumber.toString()]); - const pm = loadOrCreateProtocolMetric(block.timestamp); + const pm = createProtocolMetric(block.timestamp, block.number); pm.block = blockNumber; @@ -95,11 +94,6 @@ export function handleMetrics(event: LogRebase): void { updateProtocolMetrics(event.block, tokenRecords, tokenSupplies); } -/** - * DO NOT USE IN PRODUCTION - * - * FOR TESTING ONLY - */ export function handleMetricsBlock(block: ethereum.Block): void { log.debug("handleMetrics: *** Indexing block {}", [block.number.toString()]); diff --git a/subgraphs/ethereum/src/utils/ContractHelper.ts b/subgraphs/ethereum/src/utils/ContractHelper.ts index 5b90fc32..71da1571 100644 --- a/subgraphs/ethereum/src/utils/ContractHelper.ts +++ b/subgraphs/ethereum/src/utils/ContractHelper.ts @@ -4,7 +4,7 @@ import { TokenRecord } from "../../../shared/generated/schema"; import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { - createOrUpdateTokenRecord, + createTokenRecord, getIsTokenLiquid, getTokenCategory, } from "../../../shared/src/utils/TokenRecordHelper"; @@ -496,7 +496,7 @@ export function getERC20TokenRecordFromWallet( getContractName(walletAddress), blockNumber.toString(), ]); - return createOrUpdateTokenRecord( + return createTokenRecord( timestamp, getContractName(contractAddress), contractAddress, @@ -545,7 +545,7 @@ export function getVendorFinanceRecords( balance = balance.plus(currentDeployment.getAmount()); } - records.push(createOrUpdateTokenRecord( + records.push(createTokenRecord( timestamp, getContractName(contractAddress), contractAddress, @@ -596,7 +596,7 @@ export function getMysoFinanceRecords( balance = balance.plus(currentDeployment.getAmount()); } - records.push(createOrUpdateTokenRecord( + records.push(createTokenRecord( timestamp, getContractName(contractAddress), contractAddress, @@ -724,7 +724,7 @@ export function getAuraLockedBalancesFromWallets( ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(ERC20_AURA_VL), ERC20_AURA_VL, @@ -797,7 +797,7 @@ export function getBtrflyUnlockedBalancesFromWallets( ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress, "Unlocked"), // Needed to differentiate tokenAddress, @@ -870,7 +870,7 @@ export function getTokeStakedBalancesFromWallets( ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress, "Staked"), // Needed to differentiate as there is no token for TOKE tokenAddress, @@ -965,7 +965,7 @@ export function getLiquityStakedBalancesFromWallets( ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress, "Staked"), // Needed to differentiate as there is no token for LQTY tokenAddress, @@ -1115,7 +1115,7 @@ export function getBalancerGaugeBalanceFromWallets( ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress, "Gauge Deposit"), tokenAddress, @@ -1259,7 +1259,7 @@ export function getAuraStakedBalanceFromWallets( ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress, `Staked in ${getContractName(stakingAddress)}`), tokenAddress, @@ -1320,7 +1320,7 @@ export function getAuraPoolEarnedRecords(timestamp: BigInt, contractAddress: str ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(contractAddress, `Rewards from ${getContractName(poolAddress)}`), contractAddress, @@ -1439,7 +1439,7 @@ export function getTokeAllocatorRecords( if (!balance || balance.equals(BigDecimal.zero())) return records; records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress), tokenAddress, @@ -1533,7 +1533,7 @@ export function getRariAllocatorRecords( if (!balance || balance.equals(BigDecimal.zero())) return records; records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress), tokenAddress, @@ -1572,7 +1572,7 @@ export function getOnsenAllocatorRecords( if (!balance || balance.equals(BigDecimal.zero())) return records; records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress), tokenAddress, @@ -1744,7 +1744,7 @@ export function getConvexStakedRecords( blockNumber.ge(BigInt.fromString(CVX_CRV_WRITE_OFF_BLOCK))) { log.info("getConvexStakedRecords: Applying liquid backing multiplier of 0 to {} token record at block {}", [getContractName(ERC20_CVX_CRV), blockNumber.toString()]); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress, getContractName(stakingAddress)), tokenAddress, @@ -1762,7 +1762,7 @@ export function getConvexStakedRecords( } else { records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress, getContractName(stakingAddress)), tokenAddress, @@ -1934,7 +1934,7 @@ export function getLiquityStabilityPoolRecords( ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress, "Stability Pool"), tokenAddress, @@ -2015,7 +2015,7 @@ export function getVeFXSAllocatorRecords( [balance.toString(), getContractName(tokenAddress), blockNumber.toString()], ); records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, getContractName(tokenAddress), tokenAddress, @@ -2078,7 +2078,7 @@ export function getVlCvxUnlockedRecords( if (!balance || balance.equals(BigDecimal.zero())) continue; records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, "Convex - Unlocked (vlCVX)", // Manual override tokenAddress, @@ -2127,7 +2127,7 @@ export function getMakerDSRRecords( if (!balance || balance.equals(BigDecimal.zero())) continue; records.push( - createOrUpdateTokenRecord( + createTokenRecord( timestamp, "DAI - Deposited in DSR", // Manual override tokenAddress, diff --git a/subgraphs/ethereum/src/utils/ERC4626.ts b/subgraphs/ethereum/src/utils/ERC4626.ts index 185bb819..1715621c 100644 --- a/subgraphs/ethereum/src/utils/ERC4626.ts +++ b/subgraphs/ethereum/src/utils/ERC4626.ts @@ -3,7 +3,7 @@ import { ERC4626 } from "../../generated/ProtocolMetrics/ERC4626"; import { BLOCKCHAIN, ERC4626_TOKENS, getContractName } from "./Constants"; import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { createOrUpdateTokenRecord, getIsTokenLiquid } from "../../../shared/src/utils/TokenRecordHelper"; +import { createTokenRecord, getIsTokenLiquid } from "../../../shared/src/utils/TokenRecordHelper"; import { getUSDRate } from "./Price"; import { TokenRecord } from "../../../shared/generated/schema"; import { getWalletAddressesForContract } from "./ProtocolAddresses"; @@ -42,7 +42,7 @@ function getERC4626TokenRecordFromWallets( } log.debug("getERC4626TokenRecordFromWallets: {} has balanceOf {} {} at block {}", [getContractName(walletAddress), balance.toString(), getContractName(tokenContractAddress), blockNumber.toString()]); - return createOrUpdateTokenRecord( + return createTokenRecord( timestamp, getContractName(tokenContractAddress), tokenContractAddress, diff --git a/subgraphs/ethereum/src/utils/OhmCalculations.ts b/subgraphs/ethereum/src/utils/OhmCalculations.ts index ec138885..80b8ccd2 100644 --- a/subgraphs/ethereum/src/utils/OhmCalculations.ts +++ b/subgraphs/ethereum/src/utils/OhmCalculations.ts @@ -5,7 +5,7 @@ import { getCurrentIndex } from "../../../shared/src/supply/OhmCalculations"; import { pushTokenSupplyArray } from "../../../shared/src/utils/ArrayHelper"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { LendingMarketDeployment } from "../../../shared/src/utils/LendingMarketDeployment"; -import { createOrUpdateTokenSupply, TYPE_BONDS_DEPOSITS, TYPE_BONDS_PREMINTED, TYPE_BONDS_VESTING_DEPOSITS, TYPE_BONDS_VESTING_TOKENS, TYPE_BOOSTED_LIQUIDITY_VAULT, TYPE_LENDING, TYPE_LIQUIDITY, TYPE_OFFSET, TYPE_TOTAL_SUPPLY, TYPE_TREASURY } from "../../../shared/src/utils/TokenSupplyHelper"; +import { createTokenSupply, TYPE_BONDS_DEPOSITS, TYPE_BONDS_PREMINTED, TYPE_BONDS_VESTING_DEPOSITS, TYPE_BONDS_VESTING_TOKENS, TYPE_BOOSTED_LIQUIDITY_VAULT, TYPE_LENDING, TYPE_LIQUIDITY, TYPE_OFFSET, TYPE_TOTAL_SUPPLY, TYPE_TREASURY } from "../../../shared/src/utils/TokenSupplyHelper"; import { OLYMPUS_ASSOCIATION_WALLET } from "../../../shared/src/Wallets"; import { BondManager } from "../../generated/ProtocolMetrics/BondManager"; import { IncurDebt } from "../../generated/ProtocolMetrics/IncurDebt"; @@ -122,7 +122,7 @@ export function getTotalSupplyRecord(timestamp: BigInt, blockNumber: BigInt): To const totalSupply = getTotalSupply(blockNumber); - return createOrUpdateTokenSupply( + return createTokenSupply( timestamp, getContractName(ohmContractAddress), ohmContractAddress, @@ -179,7 +179,7 @@ function getMigrationOffsetRecord(timestamp: BigInt, blockNumber: BigInt): Token offset.toString(), ]); - return createOrUpdateTokenSupply( + return createTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -233,7 +233,7 @@ export function getVestingBondSupplyRecords(timestamp: BigInt, blockNumber: BigI // OHM equivalent to the auction capacity is pre-minted and stored in the teller records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -263,7 +263,7 @@ export function getVestingBondSupplyRecords(timestamp: BigInt, blockNumber: BigI if (timestamp.lt(expiryTimestamp)) { // Vesting user deposits equal to the sold quantity are stored in the bond manager, so we adjust that records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -280,7 +280,7 @@ export function getVestingBondSupplyRecords(timestamp: BigInt, blockNumber: BigI // Vesting bond tokens equal to the auction capacity are stored in the teller, so we adjust that records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -300,7 +300,7 @@ export function getVestingBondSupplyRecords(timestamp: BigInt, blockNumber: BigI // User deposits equal to the sold quantity are stored in the bond manager, so we adjust that // These deposits will eventually be burned records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -350,7 +350,7 @@ function getLendingMarketDeploymentOHMRecords(timestamp: BigInt, deploymentAddre // Record the balance at the current block records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -442,7 +442,7 @@ export function getTreasuryOHMRecords(timestamp: BigInt, blockNumber: BigInt): T if (balance.equals(BigDecimal.zero())) continue; records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ohmContractAddress), ohmContractAddress, @@ -473,7 +473,7 @@ export function getTreasuryOHMRecords(timestamp: BigInt, blockNumber: BigInt): T const ohmBalance = blockNumber.ge(BigInt.fromString(SOHM_INDEX_CORRECTION_BLOCK)) ? balance : ohmIndex.times(balance); records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, `${getContractName(ERC20_OHM_V2)} in sOHM v3`, ERC20_OHM_V2, @@ -499,7 +499,7 @@ export function getTreasuryOHMRecords(timestamp: BigInt, blockNumber: BigInt): T const ohmBalance = ohmIndex.times(balance); records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, `${getContractName(ERC20_OHM_V2)} in gOHM`, ERC20_OHM_V2, @@ -630,7 +630,7 @@ export function getIncurDebtSupplyRecords(timestamp: BigInt, blockNumber: BigInt } records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, @@ -683,7 +683,7 @@ export function getBoostedLiquiditySupplyRecords(timestamp: BigInt, blockNumber: } records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, diff --git a/subgraphs/ethereum/src/utils/Silo.ts b/subgraphs/ethereum/src/utils/Silo.ts index 5f9c88af..08a32261 100644 --- a/subgraphs/ethereum/src/utils/Silo.ts +++ b/subgraphs/ethereum/src/utils/Silo.ts @@ -3,7 +3,7 @@ import { TokenSupply } from "../../../shared/generated/schema"; import { ERC20 } from "../../generated/ProtocolMetrics/ERC20"; import { ERC20_OHM_V2, getContractName } from "./Constants"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { TYPE_LENDING, createOrUpdateTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; +import { TYPE_LENDING, createTokenSupply } from "../../../shared/src/utils/TokenSupplyHelper"; import { getWalletAddressesForContract } from "./ProtocolAddresses"; // Hard-coding this for now. If we wanted this to be generalisable, we would use the Silo Repository contract. @@ -32,7 +32,7 @@ export function getSiloSupply(timestamp: BigInt, blockNumber: BigInt): TokenSupp log.info("getSiloSupply: Silo OHM balance {} for wallet {}", [balance.toString(), getContractName(currentWallet)]); records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, getContractName(ERC20_OHM_V2), ERC20_OHM_V2, diff --git a/subgraphs/ethereum/tests/tokenRecordHelper.test.ts b/subgraphs/ethereum/tests/tokenRecordHelper.test.ts index fdd75516..753aa9c1 100644 --- a/subgraphs/ethereum/tests/tokenRecordHelper.test.ts +++ b/subgraphs/ethereum/tests/tokenRecordHelper.test.ts @@ -8,7 +8,7 @@ import { TokenDefinition, } from "../../shared/src/contracts/TokenDefinition"; import { - createOrUpdateTokenRecord, + createTokenRecord, getTokenAddressesInCategory, isTokenAddressInCategory, } from "../../shared/src/utils/TokenRecordHelper"; @@ -24,7 +24,7 @@ import { const TIMESTAMP = BigInt.fromString("1"); const createTokenRecord = (): TokenRecord => { - return createOrUpdateTokenRecord( + return createTokenRecord( TIMESTAMP, "name", "tokenAddress", @@ -58,7 +58,7 @@ describe("constructor", () => { }); test("custom multiplier", () => { - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( TIMESTAMP, "name", "tokenAddress", @@ -88,7 +88,7 @@ describe("constructor", () => { describe("value", () => { test("multiplier = 1", () => { - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( TIMESTAMP, "name", "tokenAddress", @@ -108,7 +108,7 @@ describe("value", () => { }); test("multiplier = 0.25", () => { - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( TIMESTAMP, "name", "tokenAddress", @@ -132,7 +132,7 @@ describe("value", () => { const tokenDefinitions = new Map(); tokenDefinitions.set(ERC20_ALCX, new TokenDefinition(ERC20_ALCX, TokenCategoryVolatile, true, false, BigDecimal.fromString("0.5"))); - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( TIMESTAMP, "name", ERC20_ALCX, @@ -156,7 +156,7 @@ describe("value", () => { const tokenDefinitions = new Map(); tokenDefinitions.set(ERC20_ALCX, new TokenDefinition(ERC20_ALCX, TokenCategoryVolatile, true, false, BigDecimal.fromString("0.5"))); - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( TIMESTAMP, "name", ERC20_ALCX, diff --git a/subgraphs/fantom/src/treasury/OwnedLiquidity.ts b/subgraphs/fantom/src/treasury/OwnedLiquidity.ts index b7eb9e54..5c1435ab 100644 --- a/subgraphs/fantom/src/treasury/OwnedLiquidity.ts +++ b/subgraphs/fantom/src/treasury/OwnedLiquidity.ts @@ -4,7 +4,7 @@ import { TokenRecord } from "../../../shared/generated/schema"; import { PriceHandler } from "../../../shared/src/price/PriceHandler"; import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { - createOrUpdateTokenRecord, + createTokenRecord, getIsTokenLiquid, } from "../../../shared/src/utils/TokenRecordHelper"; import { WALLET_ADDRESSES } from "../../../shared/src/Wallets"; @@ -62,7 +62,7 @@ function getOwnedLiquidityBalance( } // Create record - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( timestamp, getContractName(liquidityHandler.getId()), liquidityHandler.getId(), diff --git a/subgraphs/polygon/src/treasury/OwnedLiquidity.ts b/subgraphs/polygon/src/treasury/OwnedLiquidity.ts index fac2bf15..1d3f393b 100644 --- a/subgraphs/polygon/src/treasury/OwnedLiquidity.ts +++ b/subgraphs/polygon/src/treasury/OwnedLiquidity.ts @@ -4,7 +4,7 @@ import { TokenRecord } from "../../../shared/generated/schema"; import { PriceHandler } from "../../../shared/src/price/PriceHandler"; import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { - createOrUpdateTokenRecord, + createTokenRecord, getIsTokenLiquid, } from "../../../shared/src/utils/TokenRecordHelper"; import { WALLET_ADDRESSES } from "../../../shared/src/Wallets"; @@ -62,7 +62,7 @@ function getOwnedLiquidityBalance( } // Create record - const record = createOrUpdateTokenRecord( + const record = createTokenRecord( timestamp, getContractName(liquidityHandler.getId()), liquidityHandler.getId(), diff --git a/subgraphs/shared/src/contracts/ERC20.ts b/subgraphs/shared/src/contracts/ERC20.ts index 2211392f..c181b97a 100644 --- a/subgraphs/shared/src/contracts/ERC20.ts +++ b/subgraphs/shared/src/contracts/ERC20.ts @@ -3,7 +3,7 @@ import { Address, BigDecimal, BigInt, log } from "@graphprotocol/graph-ts"; import { ERC20 } from "../../generated/Price/ERC20"; import { TokenRecord } from "../../generated/schema"; import { toDecimal } from "../utils/Decimals"; -import { createOrUpdateTokenRecord, getIsTokenLiquid } from "../utils/TokenRecordHelper"; +import { createTokenRecord, getIsTokenLiquid } from "../utils/TokenRecordHelper"; import { ContractNameLookup } from "./ContractLookup"; import { TokenDefinition } from "./TokenDefinition"; @@ -103,7 +103,7 @@ export function getERC20TokenRecordFromWallet( ); if (!balance || balance.equals(BigDecimal.zero())) return null; - return createOrUpdateTokenRecord( + return createTokenRecord( timestamp, contractLookup(contractAddress), contractAddress, diff --git a/subgraphs/shared/src/utils/TokenRecordHelper.ts b/subgraphs/shared/src/utils/TokenRecordHelper.ts index 81741821..69d8b643 100644 --- a/subgraphs/shared/src/utils/TokenRecordHelper.ts +++ b/subgraphs/shared/src/utils/TokenRecordHelper.ts @@ -102,7 +102,7 @@ function getTokenMultiplier(tokenAddress: string, tokenDefinitions: Map/ - const recordId = Bytes.fromUTF8(dateString).concat(Bytes.fromUTF8(sourceName)).concat(Bytes.fromUTF8(tokenName)); - - // Attempt to fetch the current day's record - const existingRecord = TokenRecord.load(recordId); - - const record = existingRecord ? existingRecord : new TokenRecord(recordId); + // YYYY-MM-DD/// + const recordId = Bytes.fromUTF8(dateString).concatI32(blockNumber.toI32()).concat(Bytes.fromUTF8(sourceName)).concat(Bytes.fromUTF8(tokenName)); + const record = new TokenRecord(recordId); record.block = blockNumber; record.date = dateString; diff --git a/subgraphs/shared/src/utils/TokenSupplyHelper.ts b/subgraphs/shared/src/utils/TokenSupplyHelper.ts index 75b45620..10e1e1d9 100644 --- a/subgraphs/shared/src/utils/TokenSupplyHelper.ts +++ b/subgraphs/shared/src/utils/TokenSupplyHelper.ts @@ -21,7 +21,7 @@ export const TYPE_TREASURY = "Treasury"; * and saves the record. * @returns */ -export function createOrUpdateTokenSupply( +export function createTokenSupply( timestamp: BigInt, tokenName: string, tokenAddress: string, @@ -40,13 +40,9 @@ export function createOrUpdateTokenSupply( const poolNameNotNull: string = poolName !== null ? poolName : "Unknown Pool"; const sourceNameNotNull: string = sourceName !== null ? sourceName : ""; - // YYYY-MM-DD//// - const recordId = Bytes.fromUTF8(dateString).concat(Bytes.fromUTF8(tokenName)).concat(Bytes.fromUTF8(type)).concat(Bytes.fromUTF8(poolNameNotNull)).concat(Bytes.fromUTF8(sourceNameNotNull)); `${dateString}/${tokenName}/${type}/${poolNameNotNull}/${sourceNameNotNull}`; - - // Attempt to fetch the current day's record - const existingRecord = TokenSupply.load(recordId); - - const record = existingRecord ? existingRecord : new TokenSupply(recordId); + // YYYY-MM-DD///// + const recordId = Bytes.fromUTF8(dateString).concatI32(blockNumber.toI32()).concat(Bytes.fromUTF8(tokenName)).concat(Bytes.fromUTF8(type)).concat(Bytes.fromUTF8(poolNameNotNull)).concat(Bytes.fromUTF8(sourceNameNotNull)); `${dateString}/${tokenName}/${type}/${poolNameNotNull}/${sourceNameNotNull}`; + const record = new TokenSupply(recordId); record.block = blockNumber; record.date = dateString; From c6346fb3bc40d0e54bf6d4b336aa96be482542c6 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 26 Sep 2023 13:00:38 +0400 Subject: [PATCH 11/81] Remove old bonding code --- subgraphs/ethereum/src/bonds/BondDiscounts.ts | 236 ---------- subgraphs/ethereum/src/bonds/DAIBondV1.ts | 12 - subgraphs/ethereum/src/bonds/DAIBondV2.ts | 12 - subgraphs/ethereum/src/bonds/DAIBondV3.ts | 12 - subgraphs/ethereum/src/bonds/DailyBond.ts | 31 -- subgraphs/ethereum/src/bonds/ETHBondV1.ts | 13 - subgraphs/ethereum/src/bonds/FRAXBondV1.ts | 12 - subgraphs/ethereum/src/bonds/LUSDBondV1.ts | 12 - subgraphs/ethereum/src/bonds/OHMDAIBondV1.ts | 18 - subgraphs/ethereum/src/bonds/OHMDAIBondV2.ts | 18 - subgraphs/ethereum/src/bonds/OHMDAIBondV3.ts | 18 - subgraphs/ethereum/src/bonds/OHMDAIBondV4.ts | 18 - subgraphs/ethereum/src/bonds/OHMETHBondV1.ts | 18 - subgraphs/ethereum/src/bonds/OHMFRAXBondV1.ts | 18 - subgraphs/ethereum/src/bonds/OHMFRAXBondV2.ts | 18 - subgraphs/ethereum/src/bonds/OHMLUSDBondV1.ts | 18 - subgraphs/ethereum/subgraph.yaml | 440 +----------------- 17 files changed, 2 insertions(+), 922 deletions(-) delete mode 100644 subgraphs/ethereum/src/bonds/BondDiscounts.ts delete mode 100644 subgraphs/ethereum/src/bonds/DAIBondV1.ts delete mode 100644 subgraphs/ethereum/src/bonds/DAIBondV2.ts delete mode 100644 subgraphs/ethereum/src/bonds/DAIBondV3.ts delete mode 100644 subgraphs/ethereum/src/bonds/DailyBond.ts delete mode 100644 subgraphs/ethereum/src/bonds/ETHBondV1.ts delete mode 100644 subgraphs/ethereum/src/bonds/FRAXBondV1.ts delete mode 100644 subgraphs/ethereum/src/bonds/LUSDBondV1.ts delete mode 100644 subgraphs/ethereum/src/bonds/OHMDAIBondV1.ts delete mode 100644 subgraphs/ethereum/src/bonds/OHMDAIBondV2.ts delete mode 100644 subgraphs/ethereum/src/bonds/OHMDAIBondV3.ts delete mode 100644 subgraphs/ethereum/src/bonds/OHMDAIBondV4.ts delete mode 100644 subgraphs/ethereum/src/bonds/OHMETHBondV1.ts delete mode 100644 subgraphs/ethereum/src/bonds/OHMFRAXBondV1.ts delete mode 100644 subgraphs/ethereum/src/bonds/OHMFRAXBondV2.ts delete mode 100644 subgraphs/ethereum/src/bonds/OHMLUSDBondV1.ts diff --git a/subgraphs/ethereum/src/bonds/BondDiscounts.ts b/subgraphs/ethereum/src/bonds/BondDiscounts.ts deleted file mode 100644 index df23549e..00000000 --- a/subgraphs/ethereum/src/bonds/BondDiscounts.ts +++ /dev/null @@ -1,236 +0,0 @@ -import { Address, BigDecimal, BigInt, log } from "@graphprotocol/graph-ts"; - -import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { DAIBondV1 } from "../../generated/BondDiscounts/DAIBondV1"; -import { DAIBondV2 } from "../../generated/BondDiscounts/DAIBondV2"; -import { DAIBondV3 } from "../../generated/BondDiscounts/DAIBondV3"; -import { ETHBondV1 } from "../../generated/BondDiscounts/ETHBondV1"; -import { FRAXBondV1 } from "../../generated/BondDiscounts/FRAXBondV1"; -import { LUSDBondV1 } from "../../generated/BondDiscounts/LUSDBondV1"; -import { OHMDAIBondV1 } from "../../generated/BondDiscounts/OHMDAIBondV1"; -import { OHMDAIBondV2 } from "../../generated/BondDiscounts/OHMDAIBondV2"; -import { OHMDAIBondV3 } from "../../generated/BondDiscounts/OHMDAIBondV3"; -import { OHMDAIBondV4 } from "../../generated/BondDiscounts/OHMDAIBondV4"; -import { OHMFRAXBondV1 } from "../../generated/BondDiscounts/OHMFRAXBondV1"; -import { OHMFRAXBondV2 } from "../../generated/BondDiscounts/OHMFRAXBondV2"; -import { OHMLUSDBondV1 } from "../../generated/BondDiscounts/OHMLUSDBondV1"; -import { StakeCall } from "../../generated/BondDiscounts/OlympusStakingV3"; -import { BondDiscount } from "../../generated/schema"; -import { - DAIBOND_CONTRACTS1, - DAIBOND_CONTRACTS1_BLOCK, - DAIBOND_CONTRACTS2, - DAIBOND_CONTRACTS2_BLOCK, - DAIBOND_CONTRACTS3, - DAIBOND_CONTRACTS3_BLOCK, - ERC20_OHM_V2, - ETHBOND_CONTRACT1, - ETHBOND_CONTRACT1_BLOCK, - FRAXBOND_CONTRACT1, - FRAXBOND_CONTRACT1_BLOCK, - LUSDBOND_CONTRACT1, - LUSDBOND_CONTRACT1_BLOCK, - OHMDAISLPBOND_CONTRACT1, - OHMDAISLPBOND_CONTRACT1_BLOCK, - OHMDAISLPBOND_CONTRACT2, - OHMDAISLPBOND_CONTRACT2_BLOCK, - OHMDAISLPBOND_CONTRACT3, - OHMDAISLPBOND_CONTRACT3_BLOCK, - OHMDAISLPBOND_CONTRACT4, - OHMDAISLPBOND_CONTRACT4_BLOCK, - OHMFRAXLPBOND_CONTRACT1, - OHMFRAXLPBOND_CONTRACT1_BLOCK, - OHMFRAXLPBOND_CONTRACT2, - OHMFRAXLPBOND_CONTRACT2_BLOCK, - OHMLUSDBOND_CONTRACT1, - OHMLUSDBOND_CONTRACT1_BLOCK, -} from "../utils/Constants"; -import { hourFromTimestamp } from "../utils/Dates"; -import { getUSDRate } from "../utils/Price"; - -export function loadOrCreateBondDiscount(timestamp: BigInt): BondDiscount { - const hourTimestamp = hourFromTimestamp(timestamp); - - let bondDiscount = BondDiscount.load(hourTimestamp); - if (bondDiscount == null) { - bondDiscount = new BondDiscount(hourTimestamp); - bondDiscount.timestamp = timestamp; - bondDiscount.dai_discount = BigDecimal.fromString("0"); - bondDiscount.ohmdai_discount = BigDecimal.fromString("0"); - bondDiscount.frax_discount = BigDecimal.fromString("0"); - bondDiscount.ohmfrax_discount = BigDecimal.fromString("0"); - bondDiscount.eth_discount = BigDecimal.fromString("0"); - bondDiscount.lusd_discount = BigDecimal.fromString("0"); - bondDiscount.ohmlusd_discount = BigDecimal.fromString("0"); - bondDiscount.save(); - } - return bondDiscount as BondDiscount; -} - -export function updateBondDiscounts(blockNumber: BigInt): void { - const bd = loadOrCreateBondDiscount(blockNumber); - const ohmRate = getUSDRate(ERC20_OHM_V2, blockNumber); - - // OHMDAI - if (blockNumber.gt(BigInt.fromString(OHMDAISLPBOND_CONTRACT1_BLOCK))) { - const bond = OHMDAIBondV1.bind(Address.fromString(OHMDAISLPBOND_CONTRACT1)); - // bd.ohmdai_discount = ohmRate.div(toDecimal(bond.bondPriceInUSD(), 18)).minus(BigDecimal.fromString("1")).times(BigDecimal.fromString("100")) - } - if (blockNumber.gt(BigInt.fromString(OHMDAISLPBOND_CONTRACT2_BLOCK))) { - const bond = OHMDAIBondV2.bind(Address.fromString(OHMDAISLPBOND_CONTRACT2)); - // bd.ohmdai_discount = ohmRate.div(toDecimal(bond.bondPriceInUSD(), 18)).minus(BigDecimal.fromString("1")).times(BigDecimal.fromString("100")) - } - if (blockNumber.gt(BigInt.fromString(OHMDAISLPBOND_CONTRACT3_BLOCK))) { - const bond = OHMDAIBondV3.bind(Address.fromString(OHMDAISLPBOND_CONTRACT3)); - // bd.ohmdai_discount = ohmRate.div(toDecimal(bond.bondPriceInUSD(), 18)).minus(BigDecimal.fromString("1")).times(BigDecimal.fromString("100")) - } - if (blockNumber.gt(BigInt.fromString(OHMDAISLPBOND_CONTRACT4_BLOCK))) { - const bond = OHMDAIBondV4.bind(Address.fromString(OHMDAISLPBOND_CONTRACT4)); - const price_call = bond.try_bondPriceInUSD(); - if (price_call.reverted === false && price_call.value.gt(BigInt.fromI32(0))) { - bd.ohmdai_discount = ohmRate.div(toDecimal(price_call.value, 18)); - bd.ohmdai_discount = bd.ohmdai_discount.minus(BigDecimal.fromString("1")); - bd.ohmdai_discount = bd.ohmdai_discount.times(BigDecimal.fromString("100")); - log.debug("OHMDAI Discount OHM price {} Bond Price {} Discount {}", [ - ohmRate.toString(), - price_call.value.toString(), - bd.ohmfrax_discount.toString(), - ]); - } - } - - // DAI - if (blockNumber.gt(BigInt.fromString(DAIBOND_CONTRACTS1_BLOCK))) { - const bond = DAIBondV1.bind(Address.fromString(DAIBOND_CONTRACTS1)); - // bd.dai_discount = ohmRate.div(toDecimal(bond.bondPriceInUSD(), 18)).minus(BigDecimal.fromString("1")).times(BigDecimal.fromString("100")) - } - if (blockNumber.gt(BigInt.fromString(DAIBOND_CONTRACTS2_BLOCK))) { - const bond = DAIBondV2.bind(Address.fromString(DAIBOND_CONTRACTS2)); - const price_call = bond.try_bondPriceInUSD(); - if (price_call.reverted === false && price_call.value.gt(BigInt.fromI32(0))) { - bd.dai_discount = ohmRate.div(toDecimal(price_call.value, 18)); - bd.dai_discount = bd.dai_discount.minus(BigDecimal.fromString("1")); - bd.dai_discount = bd.dai_discount.times(BigDecimal.fromString("100")); - log.debug("DAI Discount OHM price {} Bond Price {} Discount {}", [ - ohmRate.toString(), - price_call.value.toString(), - bd.ohmfrax_discount.toString(), - ]); - } - } - - if (blockNumber.gt(BigInt.fromString(DAIBOND_CONTRACTS3_BLOCK))) { - const bond = DAIBondV3.bind(Address.fromString(DAIBOND_CONTRACTS3)); - const price_call = bond.try_bondPriceInUSD(); - if (price_call.reverted === false && price_call.value.gt(BigInt.fromI32(0))) { - bd.dai_discount = ohmRate.div(toDecimal(price_call.value, 18)); - bd.dai_discount = bd.dai_discount.minus(BigDecimal.fromString("1")); - bd.dai_discount = bd.dai_discount.times(BigDecimal.fromString("100")); - log.debug("DAI Discount OHM price {} Bond Price {} Discount {}", [ - ohmRate.toString(), - price_call.value.toString(), - bd.ohmfrax_discount.toString(), - ]); - } - } - - // OHMFRAX - if (blockNumber.gt(BigInt.fromString(OHMFRAXLPBOND_CONTRACT1_BLOCK))) { - const bond = OHMFRAXBondV1.bind(Address.fromString(OHMFRAXLPBOND_CONTRACT1)); - const price_call = bond.try_bondPriceInUSD(); - if (price_call.reverted === false && price_call.value.gt(BigInt.fromI32(0))) { - bd.ohmfrax_discount = ohmRate.div(toDecimal(price_call.value, 18)); - bd.ohmfrax_discount = bd.ohmfrax_discount.minus(BigDecimal.fromString("1")); - bd.ohmfrax_discount = bd.ohmfrax_discount.times(BigDecimal.fromString("100")); - log.debug("OHMFRAX Discount OHM price {} Bond Price {} Discount {}", [ - ohmRate.toString(), - price_call.value.toString(), - bd.ohmfrax_discount.toString(), - ]); - } - } - if (blockNumber.gt(BigInt.fromString(OHMFRAXLPBOND_CONTRACT2_BLOCK))) { - const bond = OHMFRAXBondV2.bind(Address.fromString(OHMFRAXLPBOND_CONTRACT2)); - const price_call = bond.try_bondPriceInUSD(); - if (price_call.reverted === false && price_call.value.gt(BigInt.fromI32(0))) { - bd.ohmfrax_discount = ohmRate.div(toDecimal(price_call.value, 18)); - bd.ohmfrax_discount = bd.ohmfrax_discount.minus(BigDecimal.fromString("1")); - bd.ohmfrax_discount = bd.ohmfrax_discount.times(BigDecimal.fromString("100")); - log.debug("OHMFRAX Discount OHM price {} Bond Price {} Discount {}", [ - ohmRate.toString(), - price_call.value.toString(), - bd.ohmfrax_discount.toString(), - ]); - } - } - - // FRAX - if (blockNumber.gt(BigInt.fromString(FRAXBOND_CONTRACT1_BLOCK))) { - const bond = FRAXBondV1.bind(Address.fromString(FRAXBOND_CONTRACT1)); - const price_call = bond.try_bondPriceInUSD(); - if (price_call.reverted === false && price_call.value.gt(BigInt.fromI32(0))) { - bd.frax_discount = ohmRate.div(toDecimal(price_call.value, 18)); - bd.frax_discount = bd.frax_discount.minus(BigDecimal.fromString("1")); - bd.frax_discount = bd.frax_discount.times(BigDecimal.fromString("100")); - log.debug("FRAX Discount OHM price {} Bond Price {} Discount {}", [ - ohmRate.toString(), - price_call.value.toString(), - bd.ohmfrax_discount.toString(), - ]); - } - } - - // ETH - if (blockNumber.gt(BigInt.fromString(ETHBOND_CONTRACT1_BLOCK))) { - const bond = ETHBondV1.bind(Address.fromString(ETHBOND_CONTRACT1)); - const price_call = bond.try_bondPriceInUSD(); - if (price_call.reverted === false && price_call.value.gt(BigInt.fromI32(0))) { - bd.eth_discount = ohmRate.div(toDecimal(price_call.value, 18)); - bd.eth_discount = bd.eth_discount.minus(BigDecimal.fromString("1")); - bd.eth_discount = bd.eth_discount.times(BigDecimal.fromString("100")); - log.debug("ETH Discount OHM price {} Bond Price {} Discount {}", [ - ohmRate.toString(), - price_call.value.toString(), - bd.ohmfrax_discount.toString(), - ]); - } - } - - // LUSD - if (blockNumber.gt(BigInt.fromString(LUSDBOND_CONTRACT1_BLOCK))) { - const bond = LUSDBondV1.bind(Address.fromString(LUSDBOND_CONTRACT1)); - const price_call = bond.try_bondPriceInUSD(); - if (price_call.reverted === false && price_call.value.gt(BigInt.fromI32(0))) { - bd.lusd_discount = ohmRate.div(toDecimal(price_call.value, 18)); - bd.lusd_discount = bd.lusd_discount.minus(BigDecimal.fromString("1")); - bd.lusd_discount = bd.lusd_discount.times(BigDecimal.fromString("100")); - log.debug("LUSD Discount OHM price {} Bond Price {} Discount {}", [ - ohmRate.toString(), - price_call.value.toString(), - bd.ohmfrax_discount.toString(), - ]); - } - } - - // OHMLUSD - if (blockNumber.gt(BigInt.fromString(OHMLUSDBOND_CONTRACT1_BLOCK))) { - const bond = OHMLUSDBondV1.bind(Address.fromString(OHMLUSDBOND_CONTRACT1)); - const price_call = bond.try_bondPriceInUSD(); - if (price_call.reverted === false && price_call.value.gt(BigInt.fromI32(0))) { - bd.ohmlusd_discount = ohmRate.div(toDecimal(price_call.value, 18)); - bd.ohmlusd_discount = bd.ohmlusd_discount.minus(BigDecimal.fromString("1")); - bd.ohmlusd_discount = bd.ohmlusd_discount.times(BigDecimal.fromString("100")); - log.debug("OHMLUSD Discount OHM price {} Bond Price {} Discount {}", [ - ohmRate.toString(), - price_call.value.toString(), - bd.ohmfrax_discount.toString(), - ]); - } - } - - bd.save(); -} - -export function handleBondDiscounts(call: StakeCall): void { - updateBondDiscounts(call.block.number); -} diff --git a/subgraphs/ethereum/src/bonds/DAIBondV1.ts b/subgraphs/ethereum/src/bonds/DAIBondV1.ts deleted file mode 100644 index dbf768f0..00000000 --- a/subgraphs/ethereum/src/bonds/DAIBondV1.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { DepositCall } from "../../generated/DAIBondV1/DAIBondV1"; -import { DAIBOND_TOKEN } from "../utils/Constants"; -import { loadOrCreateToken } from "../utils/Tokens"; -import { createDailyBondRecord } from "./DailyBond"; - -export function handleDeposit(call: DepositCall): void { - const token = loadOrCreateToken(DAIBOND_TOKEN); - const amount = toDecimal(call.inputs.amount_, 18); - - createDailyBondRecord(call.block.timestamp, token, amount, amount); -} diff --git a/subgraphs/ethereum/src/bonds/DAIBondV2.ts b/subgraphs/ethereum/src/bonds/DAIBondV2.ts deleted file mode 100644 index 5c76e197..00000000 --- a/subgraphs/ethereum/src/bonds/DAIBondV2.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { DepositCall } from "../../generated/DAIBondV2/DAIBondV2"; -import { DAIBOND_TOKEN } from "../utils/Constants"; -import { loadOrCreateToken } from "../utils/Tokens"; -import { createDailyBondRecord } from "./DailyBond"; - -export function handleDeposit(call: DepositCall): void { - const token = loadOrCreateToken(DAIBOND_TOKEN); - const amount = toDecimal(call.inputs._amount, 18); - - createDailyBondRecord(call.block.timestamp, token, amount, amount); -} diff --git a/subgraphs/ethereum/src/bonds/DAIBondV3.ts b/subgraphs/ethereum/src/bonds/DAIBondV3.ts deleted file mode 100644 index 107c2e4f..00000000 --- a/subgraphs/ethereum/src/bonds/DAIBondV3.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { DepositCall } from "../../generated/DAIBondV3/DAIBondV3"; -import { DAIBOND_TOKEN } from "../utils/Constants"; -import { loadOrCreateToken } from "../utils/Tokens"; -import { createDailyBondRecord } from "./DailyBond"; - -export function handleDeposit(call: DepositCall): void { - const token = loadOrCreateToken(DAIBOND_TOKEN); - const amount = toDecimal(call.inputs._amount, 18); - - createDailyBondRecord(call.block.timestamp, token, amount, amount); -} diff --git a/subgraphs/ethereum/src/bonds/DailyBond.ts b/subgraphs/ethereum/src/bonds/DailyBond.ts deleted file mode 100644 index 1903f4e1..00000000 --- a/subgraphs/ethereum/src/bonds/DailyBond.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { BigDecimal, BigInt } from "@graphprotocol/graph-ts"; - -import { DailyBond, Token } from "../../generated/schema"; -import { dayFromTimestamp } from "../utils/Dates"; - -export function loadOrCreateDailyBond(timestamp: BigInt, token: Token): DailyBond { - const day_timestamp = dayFromTimestamp(timestamp); - const id = day_timestamp + token.id; - let dailyBond = DailyBond.load(id); - if (dailyBond == null) { - dailyBond = new DailyBond(id); - dailyBond.amount = new BigDecimal(new BigInt(0)); - dailyBond.value = new BigDecimal(new BigInt(0)); - dailyBond.timestamp = BigInt.fromString(day_timestamp); - dailyBond.token = token.id; - dailyBond.save(); - } - return dailyBond as DailyBond; -} - -export function createDailyBondRecord( - timestamp: BigInt, - token: Token, - amount: BigDecimal, - value: BigDecimal, -): void { - const dailyBond = loadOrCreateDailyBond(timestamp, token); - dailyBond.amount = dailyBond.amount.plus(amount); - dailyBond.value = dailyBond.amount.plus(value); - dailyBond.save(); -} diff --git a/subgraphs/ethereum/src/bonds/ETHBondV1.ts b/subgraphs/ethereum/src/bonds/ETHBondV1.ts deleted file mode 100644 index 33487763..00000000 --- a/subgraphs/ethereum/src/bonds/ETHBondV1.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { DepositCall } from "../../generated/FRAXBondV1/FRAXBondV1"; -import { ETHBOND_TOKEN } from "../utils/Constants"; -import { getBaseEthUsdRate } from "../utils/PriceBase"; -import { loadOrCreateToken } from "../utils/Tokens"; -import { createDailyBondRecord } from "./DailyBond"; - -export function handleDeposit(call: DepositCall): void { - const token = loadOrCreateToken(ETHBOND_TOKEN); - const amount = toDecimal(call.inputs._amount, 18); - - createDailyBondRecord(call.block.timestamp, token, amount, amount.times(getBaseEthUsdRate())); -} diff --git a/subgraphs/ethereum/src/bonds/FRAXBondV1.ts b/subgraphs/ethereum/src/bonds/FRAXBondV1.ts deleted file mode 100644 index bf8e1693..00000000 --- a/subgraphs/ethereum/src/bonds/FRAXBondV1.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { DepositCall } from "../../generated/FRAXBondV1/FRAXBondV1"; -import { FRAXBOND_TOKEN } from "../utils/Constants"; -import { loadOrCreateToken } from "../utils/Tokens"; -import { createDailyBondRecord } from "./DailyBond"; - -export function handleDeposit(call: DepositCall): void { - const token = loadOrCreateToken(FRAXBOND_TOKEN); - const amount = toDecimal(call.inputs._amount, 18); - - createDailyBondRecord(call.block.timestamp, token, amount, amount); -} diff --git a/subgraphs/ethereum/src/bonds/LUSDBondV1.ts b/subgraphs/ethereum/src/bonds/LUSDBondV1.ts deleted file mode 100644 index 9da38c6e..00000000 --- a/subgraphs/ethereum/src/bonds/LUSDBondV1.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { DepositCall } from "../../generated/LUSDBondV1/LUSDBondV1"; -import { LUSDBOND_TOKEN } from "../utils/Constants"; -import { loadOrCreateToken } from "../utils/Tokens"; -import { createDailyBondRecord } from "./DailyBond"; - -export function handleDeposit(call: DepositCall): void { - const token = loadOrCreateToken(LUSDBOND_TOKEN); - const amount = toDecimal(call.inputs._amount, 18); - - createDailyBondRecord(call.block.timestamp, token, amount, amount); -} diff --git a/subgraphs/ethereum/src/bonds/OHMDAIBondV1.ts b/subgraphs/ethereum/src/bonds/OHMDAIBondV1.ts deleted file mode 100644 index e9e7464e..00000000 --- a/subgraphs/ethereum/src/bonds/OHMDAIBondV1.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { DepositBondPrincipleCall } from "../../generated/OHMDAIBondV1/OHMDAIBondV1"; -import { getOhmUSDPairValue } from "../liquidity/LiquidityUniswapV2"; -import { OHMDAILPBOND_TOKEN, PAIR_UNISWAP_V2_OHM_DAI } from "../utils/Constants"; -import { loadOrCreateToken } from "../utils/Tokens"; -import { createDailyBondRecord } from "./DailyBond"; - -export function handleDeposit(call: DepositBondPrincipleCall): void { - const token = loadOrCreateToken(OHMDAILPBOND_TOKEN); - const amount = toDecimal(call.inputs.amountToDeposit_, 18); - - createDailyBondRecord( - call.block.timestamp, - token, - amount, - getOhmUSDPairValue(call.inputs.amountToDeposit_, PAIR_UNISWAP_V2_OHM_DAI, call.block.number), - ); -} diff --git a/subgraphs/ethereum/src/bonds/OHMDAIBondV2.ts b/subgraphs/ethereum/src/bonds/OHMDAIBondV2.ts deleted file mode 100644 index a9736e47..00000000 --- a/subgraphs/ethereum/src/bonds/OHMDAIBondV2.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { DepositCall } from "../../generated/OHMDAIBondV2/OHMDAIBondV2"; -import { getOhmUSDPairValue } from "../liquidity/LiquidityUniswapV2"; -import { OHMDAILPBOND_TOKEN, PAIR_UNISWAP_V2_OHM_DAI } from "../utils/Constants"; -import { loadOrCreateToken } from "../utils/Tokens"; -import { createDailyBondRecord } from "./DailyBond"; - -export function handleDeposit(call: DepositCall): void { - const token = loadOrCreateToken(OHMDAILPBOND_TOKEN); - const amount = toDecimal(call.inputs.amount_, 18); - - createDailyBondRecord( - call.block.timestamp, - token, - amount, - getOhmUSDPairValue(call.inputs.amount_, PAIR_UNISWAP_V2_OHM_DAI, call.block.number), - ); -} diff --git a/subgraphs/ethereum/src/bonds/OHMDAIBondV3.ts b/subgraphs/ethereum/src/bonds/OHMDAIBondV3.ts deleted file mode 100644 index 8d40645e..00000000 --- a/subgraphs/ethereum/src/bonds/OHMDAIBondV3.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { DepositCall } from "../../generated/OHMDAIBondV3/OHMDAIBondV3"; -import { getOhmUSDPairValue } from "../liquidity/LiquidityUniswapV2"; -import { OHMDAILPBOND_TOKEN, PAIR_UNISWAP_V2_OHM_DAI } from "../utils/Constants"; -import { loadOrCreateToken } from "../utils/Tokens"; -import { createDailyBondRecord } from "./DailyBond"; - -export function handleDeposit(call: DepositCall): void { - const token = loadOrCreateToken(OHMDAILPBOND_TOKEN); - const amount = toDecimal(call.inputs._amount, 18); - - createDailyBondRecord( - call.block.timestamp, - token, - amount, - getOhmUSDPairValue(call.inputs._amount, PAIR_UNISWAP_V2_OHM_DAI, call.block.number), - ); -} diff --git a/subgraphs/ethereum/src/bonds/OHMDAIBondV4.ts b/subgraphs/ethereum/src/bonds/OHMDAIBondV4.ts deleted file mode 100644 index dbc4b7e4..00000000 --- a/subgraphs/ethereum/src/bonds/OHMDAIBondV4.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { DepositCall } from "../../generated/OHMDAIBondV4/OHMDAIBondV4"; -import { getOhmUSDPairValue } from "../liquidity/LiquidityUniswapV2"; -import { OHMDAILPBOND_TOKEN, PAIR_UNISWAP_V2_OHM_DAI } from "../utils/Constants"; -import { loadOrCreateToken } from "../utils/Tokens"; -import { createDailyBondRecord } from "./DailyBond"; - -export function handleDeposit(call: DepositCall): void { - const token = loadOrCreateToken(OHMDAILPBOND_TOKEN); - const amount = toDecimal(call.inputs._amount, 18); - - createDailyBondRecord( - call.block.timestamp, - token, - amount, - getOhmUSDPairValue(call.inputs._amount, PAIR_UNISWAP_V2_OHM_DAI, call.block.number), - ); -} diff --git a/subgraphs/ethereum/src/bonds/OHMETHBondV1.ts b/subgraphs/ethereum/src/bonds/OHMETHBondV1.ts deleted file mode 100644 index 49b7cb74..00000000 --- a/subgraphs/ethereum/src/bonds/OHMETHBondV1.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { DepositCall } from "../../generated/OHMDAIBondV4/OHMDAIBondV4"; -import { getOhmUSDPairValue } from "../liquidity/LiquidityUniswapV2"; -import { OHMETHLPBOND_TOKEN, PAIR_UNISWAP_V2_OHM_ETH } from "../utils/Constants"; -import { loadOrCreateToken } from "../utils/Tokens"; -import { createDailyBondRecord } from "./DailyBond"; - -export function handleDeposit(call: DepositCall): void { - const token = loadOrCreateToken(OHMETHLPBOND_TOKEN); - const amount = toDecimal(call.inputs._amount, 18); - - createDailyBondRecord( - call.block.timestamp, - token, - amount, - getOhmUSDPairValue(call.inputs._amount, PAIR_UNISWAP_V2_OHM_ETH, call.block.number), - ); -} diff --git a/subgraphs/ethereum/src/bonds/OHMFRAXBondV1.ts b/subgraphs/ethereum/src/bonds/OHMFRAXBondV1.ts deleted file mode 100644 index bd2849e2..00000000 --- a/subgraphs/ethereum/src/bonds/OHMFRAXBondV1.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { DepositCall } from "../../generated/OHMFRAXBondV1/OHMFRAXBondV1"; -import { getOhmUSDPairValue } from "../liquidity/LiquidityUniswapV2"; -import { OHMFRAXLPBOND_TOKEN, PAIR_UNISWAP_V2_OHM_FRAX } from "../utils/Constants"; -import { loadOrCreateToken } from "../utils/Tokens"; -import { createDailyBondRecord } from "./DailyBond"; - -export function handleDeposit(call: DepositCall): void { - const token = loadOrCreateToken(OHMFRAXLPBOND_TOKEN); - const amount = toDecimal(call.inputs._amount, 18); - - createDailyBondRecord( - call.block.timestamp, - token, - amount, - getOhmUSDPairValue(call.inputs._amount, PAIR_UNISWAP_V2_OHM_FRAX, call.block.number), - ); -} diff --git a/subgraphs/ethereum/src/bonds/OHMFRAXBondV2.ts b/subgraphs/ethereum/src/bonds/OHMFRAXBondV2.ts deleted file mode 100644 index 00db15d4..00000000 --- a/subgraphs/ethereum/src/bonds/OHMFRAXBondV2.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { DepositCall } from "../../generated/OHMFRAXBondV2/OHMFRAXBondV2"; -import { getOhmUSDPairValue } from "../liquidity/LiquidityUniswapV2"; -import { OHMFRAXLPBOND_TOKEN, PAIR_UNISWAP_V2_OHM_FRAX } from "../utils/Constants"; -import { loadOrCreateToken } from "../utils/Tokens"; -import { createDailyBondRecord } from "./DailyBond"; - -export function handleDeposit(call: DepositCall): void { - const token = loadOrCreateToken(OHMFRAXLPBOND_TOKEN); - const amount = toDecimal(call.inputs._amount, 18); - - createDailyBondRecord( - call.block.timestamp, - token, - amount, - getOhmUSDPairValue(call.inputs._amount, PAIR_UNISWAP_V2_OHM_FRAX, call.block.number), - ); -} diff --git a/subgraphs/ethereum/src/bonds/OHMLUSDBondV1.ts b/subgraphs/ethereum/src/bonds/OHMLUSDBondV1.ts deleted file mode 100644 index c3ff7155..00000000 --- a/subgraphs/ethereum/src/bonds/OHMLUSDBondV1.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { DepositCall } from "../../generated/OHMDAIBondV4/OHMDAIBondV4"; -import { getOhmUSDPairValue } from "../liquidity/LiquidityUniswapV2"; -import { OHMLUSDLPBOND_TOKEN, PAIR_UNISWAP_V2_OHM_LUSD } from "../utils/Constants"; -import { loadOrCreateToken } from "../utils/Tokens"; -import { createDailyBondRecord } from "./DailyBond"; - -export function handleDeposit(call: DepositCall): void { - const token = loadOrCreateToken(OHMLUSDLPBOND_TOKEN); - const amount = toDecimal(call.inputs._amount, 18); - - createDailyBondRecord( - call.block.timestamp, - token, - amount, - getOhmUSDPairValue(call.inputs._amount, PAIR_UNISWAP_V2_OHM_LUSD, call.block.number), - ); -} diff --git a/subgraphs/ethereum/subgraph.yaml b/subgraphs/ethereum/subgraph.yaml index 2ad055f8..2d1a2402 100644 --- a/subgraphs/ethereum/subgraph.yaml +++ b/subgraphs/ethereum/subgraph.yaml @@ -1,8 +1,8 @@ specVersion: 0.0.8 description: Olympus Protocol Metrics Subgraph repository: https://github.com/OlympusDAO/olympus-protocol-metrics-subgraph -features: - - grafting +# features: +# - grafting # graft: # base: QmSwwBfAoWJLHQeSTagFnkibnkrjeprxcQpXAHk6AVrysA # block: 18185779 # Clearinghouse deployment @@ -109,442 +109,6 @@ dataSources: # - function: rebase(uint256,uint256) # handler: rebaseFunction # file: ./src/sOlympus/sOlympusERC20V3.ts - # #DAI Bond Contract V1 - # - kind: ethereum/contract - # name: DAIBondV1 - # network: mainnet - # source: - # address: "0xa64ed1b66cb2838ef2a198d8345c0ce6967a2a3c" - # abi: DAIBondV1 - # startBlock: 14690000 - # mapping: - # kind: ethereum/events - # apiVersion: 0.0.6 - # language: wasm/assemblyscript - # entities: - # - DAIBondDeposit - # abis: - # - name: DAIBondV1 - # file: ./abis/DAIBondV1.json - # callHandlers: - # - function: deposit(uint256,uint256,address) - # handler: handleDeposit - # file: ./src/bonds/DAIBondV1.ts - # #DAI Bond Contract V2 - # - kind: ethereum/contract - # name: DAIBondV2 - # network: mainnet - # source: - # address: "0xd03056323b7a63e2095ae97fa1ad92e4820ff045" - # abi: DAIBondV2 - # startBlock: 14690000 - # mapping: - # kind: ethereum/events - # apiVersion: 0.0.6 - # language: wasm/assemblyscript - # entities: - # - DAIBondDeposit - # abis: - # - name: DAIBondV2 - # file: ./abis/DAIBondV2.json - # callHandlers: - # - function: deposit(uint256,uint256,address) - # handler: handleDeposit - # file: ./src/bonds/DAIBondV2.ts - # #DAI Bond Contract V3 - # - kind: ethereum/contract - # name: DAIBondV3 - # network: mainnet - # source: - # address: "0x575409F8d77c12B05feD8B455815f0e54797381c" - # abi: DAIBondV3 - # startBlock: 14690000 - # mapping: - # kind: ethereum/events - # apiVersion: 0.0.6 - # language: wasm/assemblyscript - # entities: - # - DAIBondDeposit - # abis: - # - name: DAIBondV3 - # file: ./abis/DAIBondV3.json - # callHandlers: - # - function: deposit(uint256,uint256,address) - # handler: handleDeposit - # file: ./src/bonds/DAIBondV3.ts - # #OHM DAI LP Bond Contract V1 - # - kind: ethereum/contract - # name: OHMDAIBondV1 - # network: mainnet - # source: - # address: "0xd27001d1aAEd5f002C722Ad729de88a91239fF29" - # abi: OHMDAIBondV1 - # startBlock: 14690000 - # mapping: - # kind: ethereum/events - # apiVersion: 0.0.6 - # language: wasm/assemblyscript - # entities: - # - OHMDAIBondV1 - # abis: - # - name: OHMDAIBondV1 - # file: ./abis/OHMDAIBondV1.json - # # Needed for price lookup - # - name: ERC20 - # file: ../shared/abis/ERC20.json - # - name: UniswapV2Pair - # file: ../shared/abis/UniswapV2Pair.json - # - name: BalancerVault - # file: ../shared/abis/BalancerVault.json - # - name: BalancerPoolToken - # file: ../shared/abis/BalancerPoolToken.json - # callHandlers: - # - function: depositBondPrinciple(uint256) - # handler: handleDeposit - # file: ./src/bonds/OHMDAIBondV1.ts - # #OHM DAI LP Bond Contract V2 - # - kind: ethereum/contract - # name: OHMDAIBondV2 - # network: mainnet - # source: - # address: "0x13e8484a86327f5882d1340ed0d7643a29548536" - # abi: OHMDAIBondV2 - # startBlock: 14690000 - # mapping: - # kind: ethereum/events - # apiVersion: 0.0.6 - # language: wasm/assemblyscript - # entities: - # - OHMDAIBondV2 - # abis: - # - name: OHMDAIBondV2 - # file: ./abis/OHMDAIBondV2.json - # # Needed for price lookup - # - name: ERC20 - # file: ../shared/abis/ERC20.json - # - name: UniswapV2Pair - # file: ../shared/abis/UniswapV2Pair.json - # - name: BalancerVault - # file: ../shared/abis/BalancerVault.json - # - name: BalancerPoolToken - # file: ../shared/abis/BalancerPoolToken.json - # callHandlers: - # - function: deposit(uint256,uint256,address) - # handler: handleDeposit - # file: ./src/bonds/OHMDAIBondV2.ts - # #OHM DAI LP Bond Contract V3 - # - kind: ethereum/contract - # name: OHMDAIBondV3 - # network: mainnet - # source: - # address: "0x996668c46fc0b764afda88d83eb58afc933a1626" - # abi: OHMDAIBondV3 - # startBlock: 14690000 - # mapping: - # kind: ethereum/events - # apiVersion: 0.0.6 - # language: wasm/assemblyscript - # entities: - # - OHMDAIBondV3 - # abis: - # - name: OHMDAIBondV3 - # file: ./abis/OHMDAIBondV3.json - # # Needed for price lookup - # - name: ERC20 - # file: ../shared/abis/ERC20.json - # - name: UniswapV2Pair - # file: ../shared/abis/UniswapV2Pair.json - # - name: BalancerVault - # file: ../shared/abis/BalancerVault.json - # - name: BalancerPoolToken - # file: ../shared/abis/BalancerPoolToken.json - # callHandlers: - # - function: deposit(uint256,uint256,address) - # handler: handleDeposit - # file: ./src/bonds/OHMDAIBondV3.ts - # #OHM DAI LP Bond Contract V4 - # - kind: ethereum/contract - # name: OHMDAIBondV4 - # network: mainnet - # source: - # address: "0x956c43998316b6a2F21f89a1539f73fB5B78c151" - # abi: OHMDAIBondV4 - # startBlock: 14690000 - # mapping: - # kind: ethereum/events - # apiVersion: 0.0.6 - # language: wasm/assemblyscript - # entities: - # - OHMDAIBondV4 - # abis: - # - name: OHMDAIBondV4 - # file: ./abis/OHMDAIBondV4.json - # # Needed for price lookup - # - name: ERC20 - # file: ../shared/abis/ERC20.json - # - name: UniswapV2Pair - # file: ../shared/abis/UniswapV2Pair.json - # - name: BalancerVault - # file: ../shared/abis/BalancerVault.json - # - name: BalancerPoolToken - # file: ../shared/abis/BalancerPoolToken.json - # callHandlers: - # - function: deposit(uint256,uint256,address) - # handler: handleDeposit - # file: ./src/bonds/OHMDAIBondV4.ts - # # FRAX-OHM v1 - # - kind: ethereum/contract - # name: OHMFRAXBondV1 - # network: mainnet - # source: - # address: "0x539b6c906244ac34e348bbe77885cdfa994a3776" - # abi: OHMFRAXBondV1 - # startBlock: 14690000 - # mapping: - # kind: ethereum/events - # apiVersion: 0.0.6 - # language: wasm/assemblyscript - # entities: - # - OHMFRAXBondV1 - # abis: - # - name: OHMFRAXBondV1 - # file: ./abis/OHMFRAXBondV1.json - # # Needed for price lookup - # - name: ERC20 - # file: ../shared/abis/ERC20.json - # - name: UniswapV2Pair - # file: ../shared/abis/UniswapV2Pair.json - # - name: BalancerVault - # file: ../shared/abis/BalancerVault.json - # - name: BalancerPoolToken - # file: ../shared/abis/BalancerPoolToken.json - # callHandlers: - # - function: deposit(uint256,uint256,address) - # handler: handleDeposit - # file: ./src/bonds/OHMFRAXBondV1.ts - # # FRAX-OHM v2 - # - kind: ethereum/contract - # name: OHMFRAXBondV2 - # network: mainnet - # source: - # address: "0xc20cfff07076858a7e642e396180ec390e5a02f7" - # abi: OHMFRAXBondV2 - # startBlock: 14690000 - # mapping: - # kind: ethereum/events - # apiVersion: 0.0.6 - # language: wasm/assemblyscript - # entities: - # - OHMFRAXBondV2 - # abis: - # - name: OHMFRAXBondV2 - # file: ./abis/OHMFRAXBondV2.json - # # Needed for price lookup - # - name: ERC20 - # file: ../shared/abis/ERC20.json - # - name: UniswapV2Pair - # file: ../shared/abis/UniswapV2Pair.json - # - name: BalancerVault - # file: ../shared/abis/BalancerVault.json - # - name: BalancerPoolToken - # file: ../shared/abis/BalancerPoolToken.json - # callHandlers: - # - function: deposit(uint256,uint256,address) - # handler: handleDeposit - # file: ./src/bonds/OHMFRAXBondV2.ts - # # FRAX v1 - # - kind: ethereum/contract - # name: FRAXBondV1 - # network: mainnet - # source: - # address: "0x8510c8c2B6891E04864fa196693D44E6B6ec2514" - # abi: FRAXBondV1 - # startBlock: 14690000 - # mapping: - # kind: ethereum/events - # apiVersion: 0.0.6 - # language: wasm/assemblyscript - # entities: - # - FRAXBondV1 - # abis: - # - name: FRAXBondV1 - # file: ./abis/FRAXBondV1.json - # callHandlers: - # - function: deposit(uint256,uint256,address) - # handler: handleDeposit - # file: ./src/bonds/FRAXBondV1.ts - # #WETH - # - kind: ethereum/contract - # name: ETHBondV1 - # network: mainnet - # source: - # address: "0xe6295201cd1ff13ced5f063a5421c39a1d236f1c" - # abi: ETHBondV1 - # startBlock: 14690000 - # mapping: - # kind: ethereum/events - # apiVersion: 0.0.6 - # language: wasm/assemblyscript - # entities: - # - ETHBondV1 - # abis: - # - name: ETHBondV1 - # file: ./abis/ETHBondV1.json - # - name: UniswapV2Pair - # file: ../shared/abis/UniswapV2Pair.json - # callHandlers: - # - function: deposit(uint256,uint256,address) - # handler: handleDeposit - # file: ./src/bonds/ETHBondV1.ts - # #LUSD - # - kind: ethereum/contract - # name: LUSDBondV1 - # network: mainnet - # source: - # address: "0x10c0f93f64e3c8d0a1b0f4b87d6155fd9e89d08d" - # abi: LUSDBondV1 - # startBlock: 14690000 - # mapping: - # kind: ethereum/events - # apiVersion: 0.0.6 - # language: wasm/assemblyscript - # entities: - # - LUSDBondV1 - # abis: - # - name: LUSDBondV1 - # file: ./abis/LUSDBondV1.json - # callHandlers: - # - function: deposit(uint256,uint256,address) - # handler: handleDeposit - # file: ./src/bonds/LUSDBondV1.ts - # # LUSD-OHM v2 - # - kind: ethereum/contract - # name: OHMLUSDBondV1 - # network: mainnet - # source: - # address: "0xfb1776299e7804dd8016303df9c07a65c80f67b6" - # abi: OHMLUSDBondV1 - # startBlock: 14690000 - # mapping: - # kind: ethereum/events - # apiVersion: 0.0.6 - # language: wasm/assemblyscript - # entities: - # - OHMLUSDBondV1 - # abis: - # - name: OHMLUSDBondV1 - # file: ./abis/LUSDBondV1.json - # # Needed for price lookup - # - name: ERC20 - # file: ../shared/abis/ERC20.json - # - name: UniswapV2Pair - # file: ../shared/abis/UniswapV2Pair.json - # - name: BalancerVault - # file: ../shared/abis/BalancerVault.json - # - name: BalancerPoolToken - # file: ../shared/abis/BalancerPoolToken.json - # callHandlers: - # - function: deposit(uint256,uint256,address) - # handler: handleDeposit - # file: ./src/bonds/OHMLUSDBondV1.ts - # # ETH-OHM v2 - # - kind: ethereum/contract - # name: OHMETHBondV1 - # network: mainnet - # source: - # address: "0xB6C9dc843dEc44Aa305217c2BbC58B44438B6E16" - # abi: OHMETHBondV1 - # startBlock: 14690000 - # mapping: - # kind: ethereum/events - # apiVersion: 0.0.6 - # language: wasm/assemblyscript - # entities: - # - OHMETHBondV1 - # abis: - # - name: OHMETHBondV1 - # file: ./abis/OHMETHBondV1.json - # # Needed for price lookup - # - name: ERC20 - # file: ../shared/abis/ERC20.json - # - name: UniswapV2Pair - # file: ../shared/abis/UniswapV2Pair.json - # - name: BalancerVault - # file: ../shared/abis/BalancerVault.json - # - name: BalancerPoolToken - # file: ../shared/abis/BalancerPoolToken.json - # callHandlers: - # - function: deposit(uint256,uint256,address) - # handler: handleDeposit - # file: ./src/bonds/OHMETHBondV1.ts - # - kind: ethereum/contract - # name: BondDiscounts - # network: mainnet - # source: - # address: "0xB63cac384247597756545b500253ff8E607a8020" - # abi: OlympusStakingV3 - # startBlock: 14690000 - # mapping: - # kind: ethereum/events - # apiVersion: 0.0.6 - # language: wasm/assemblyscript - # entities: - # - BondDiscount - # abis: - # - name: OlympusStakingV1 - # file: ./abis/OlympusStakingV1.json - # - name: OlympusStakingV2 - # file: ./abis/OlympusStakingV2.json - # - name: OlympusStakingV3 - # file: ./abis/OlympusStakingV3.json - # - name: sOlympusERC20 - # file: ./abis/sOlympusERC20.json - # - name: sOlympusERC20V2 - # file: ./abis/sOlympusERC20V2.json - # - name: sOlympusERC20V3 - # file: ./abis/sOlympusERC20V3.json - # - name: OlympusERC20 - # file: ./abis/OlympusERC20.json - # # Needed for price lookup - # - name: ERC20 - # file: ../shared/abis/ERC20.json - # - name: UniswapV2Pair - # file: ../shared/abis/UniswapV2Pair.json - # - name: BalancerVault - # file: ../shared/abis/BalancerVault.json - # - name: BalancerPoolToken - # file: ../shared/abis/BalancerPoolToken.json - # # Required for bond discounts - # - name: DAIBondV1 - # file: ./abis/DAIBondV1.json - # - name: DAIBondV2 - # file: ./abis/DAIBondV2.json - # - name: DAIBondV3 - # file: ./abis/DAIBondV3.json - # - name: OHMDAIBondV1 - # file: ./abis/OHMDAIBondV1.json - # - name: OHMDAIBondV2 - # file: ./abis/OHMDAIBondV2.json - # - name: OHMDAIBondV3 - # file: ./abis/OHMDAIBondV3.json - # - name: OHMDAIBondV4 - # file: ./abis/OHMDAIBondV4.json - # - name: OHMFRAXBondV1 - # file: ./abis/OHMFRAXBondV1.json - # - name: OHMFRAXBondV2 - # file: ./abis/OHMFRAXBondV2.json - # - name: FRAXBondV1 - # file: ./abis/FRAXBondV1.json - # - name: ETHBondV1 - # file: ./abis/ETHBondV1.json - # - name: LUSDBondV1 - # file: ./abis/LUSDBondV1.json - # - name: OHMLUSDBondV1 - # file: ./abis/OHMLUSDBondV1.json - # callHandlers: - # - function: stake(address,uint256,bool,bool) - # handler: handleBondDiscounts - # file: ./src/bonds/BondDiscounts.ts - kind: ethereum/contract name: ProtocolMetrics network: mainnet From 5fd9d1d6490ec7a4bdc53485a873f6b2dde25f67 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 26 Sep 2023 13:04:22 +0400 Subject: [PATCH 12/81] Remove old code --- .../BondDiscounts/BalancerPoolToken.ts | 1688 ----------------- .../generated/BondDiscounts/BalancerVault.ts | 1688 ----------------- .../generated/BondDiscounts/DAIBondV1.ts | 1054 ---------- .../generated/BondDiscounts/DAIBondV2.ts | 1158 ----------- .../generated/BondDiscounts/DAIBondV3.ts | 1298 ------------- .../ethereum/generated/BondDiscounts/ERC20.ts | 394 ---- .../generated/BondDiscounts/ETHBondV1.ts | 1261 ------------ .../generated/BondDiscounts/FRAXBondV1.ts | 1298 ------------- .../generated/BondDiscounts/LUSDBondV1.ts | 1298 ------------- .../generated/BondDiscounts/OHMDAIBondV1.ts | 1018 ---------- .../generated/BondDiscounts/OHMDAIBondV2.ts | 953 ---------- .../generated/BondDiscounts/OHMDAIBondV3.ts | 1158 ----------- .../generated/BondDiscounts/OHMDAIBondV4.ts | 1298 ------------- .../generated/BondDiscounts/OHMFRAXBondV1.ts | 1132 ----------- .../generated/BondDiscounts/OHMFRAXBondV2.ts | 1298 ------------- .../generated/BondDiscounts/OHMLUSDBondV1.ts | 1298 ------------- .../generated/BondDiscounts/OlympusERC20.ts | 1184 ------------ .../BondDiscounts/OlympusStakingV1.ts | 451 ----- .../BondDiscounts/OlympusStakingV2.ts | 828 -------- .../BondDiscounts/OlympusStakingV3.ts | 982 ---------- .../generated/BondDiscounts/UniswapV2Pair.ts | 1092 ----------- .../generated/BondDiscounts/sOlympusERC20.ts | 964 ---------- .../BondDiscounts/sOlympusERC20V2.ts | 1277 ------------- .../BondDiscounts/sOlympusERC20V3.ts | 1194 ------------ .../ethereum/generated/DAIBondV1/DAIBondV1.ts | 1054 ---------- .../ethereum/generated/DAIBondV2/DAIBondV2.ts | 1158 ----------- .../ethereum/generated/DAIBondV3/DAIBondV3.ts | 1298 ------------- .../ethereum/generated/ETHBondV1/ETHBondV1.ts | 1261 ------------ .../generated/ETHBondV1/UniswapV2Pair.ts | 1092 ----------- .../generated/FRAXBondV1/FRAXBondV1.ts | 1298 ------------- .../generated/LUSDBondV1/LUSDBondV1.ts | 1298 ------------- .../OHMDAIBondV1/BalancerPoolToken.ts | 1688 ----------------- .../generated/OHMDAIBondV1/BalancerVault.ts | 1688 ----------------- .../ethereum/generated/OHMDAIBondV1/ERC20.ts | 394 ---- .../generated/OHMDAIBondV1/OHMDAIBondV1.ts | 1018 ---------- .../generated/OHMDAIBondV1/UniswapV2Pair.ts | 1092 ----------- .../OHMDAIBondV2/BalancerPoolToken.ts | 1688 ----------------- .../generated/OHMDAIBondV2/BalancerVault.ts | 1688 ----------------- .../ethereum/generated/OHMDAIBondV2/ERC20.ts | 394 ---- .../generated/OHMDAIBondV2/OHMDAIBondV2.ts | 953 ---------- .../generated/OHMDAIBondV2/UniswapV2Pair.ts | 1092 ----------- .../OHMDAIBondV3/BalancerPoolToken.ts | 1688 ----------------- .../generated/OHMDAIBondV3/BalancerVault.ts | 1688 ----------------- .../ethereum/generated/OHMDAIBondV3/ERC20.ts | 394 ---- .../generated/OHMDAIBondV3/OHMDAIBondV3.ts | 1158 ----------- .../generated/OHMDAIBondV3/UniswapV2Pair.ts | 1092 ----------- .../OHMDAIBondV4/BalancerPoolToken.ts | 1688 ----------------- .../generated/OHMDAIBondV4/BalancerVault.ts | 1688 ----------------- .../ethereum/generated/OHMDAIBondV4/ERC20.ts | 394 ---- .../generated/OHMDAIBondV4/OHMDAIBondV4.ts | 1298 ------------- .../generated/OHMDAIBondV4/UniswapV2Pair.ts | 1092 ----------- .../OHMETHBondV1/BalancerPoolToken.ts | 1688 ----------------- .../generated/OHMETHBondV1/BalancerVault.ts | 1688 ----------------- .../ethereum/generated/OHMETHBondV1/ERC20.ts | 394 ---- .../generated/OHMETHBondV1/OHMETHBondV1.ts | 1298 ------------- .../generated/OHMETHBondV1/UniswapV2Pair.ts | 1092 ----------- .../OHMFRAXBondV1/BalancerPoolToken.ts | 1688 ----------------- .../generated/OHMFRAXBondV1/BalancerVault.ts | 1688 ----------------- .../ethereum/generated/OHMFRAXBondV1/ERC20.ts | 394 ---- .../generated/OHMFRAXBondV1/OHMFRAXBondV1.ts | 1132 ----------- .../generated/OHMFRAXBondV1/UniswapV2Pair.ts | 1092 ----------- .../OHMFRAXBondV2/BalancerPoolToken.ts | 1688 ----------------- .../generated/OHMFRAXBondV2/BalancerVault.ts | 1688 ----------------- .../ethereum/generated/OHMFRAXBondV2/ERC20.ts | 394 ---- .../generated/OHMFRAXBondV2/OHMFRAXBondV2.ts | 1298 ------------- .../generated/OHMFRAXBondV2/UniswapV2Pair.ts | 1092 ----------- .../OHMLUSDBondV1/BalancerPoolToken.ts | 1688 ----------------- .../generated/OHMLUSDBondV1/BalancerVault.ts | 1688 ----------------- .../ethereum/generated/OHMLUSDBondV1/ERC20.ts | 394 ---- .../generated/OHMLUSDBondV1/OHMLUSDBondV1.ts | 1298 ------------- .../generated/OHMLUSDBondV1/UniswapV2Pair.ts | 1092 ----------- .../PriceSnapshot/BalancerPoolToken.ts | 1688 ----------------- .../generated/PriceSnapshot/BalancerVault.ts | 1688 ----------------- .../ethereum/generated/PriceSnapshot/ERC20.ts | 394 ---- .../generated/PriceSnapshot/UniswapV2Pair.ts | 1092 ----------- .../PriceSnapshot/sOlympusERC20V2.ts | 1277 ------------- .../PriceSnapshot/sOlympusERC20V3.ts | 1194 ------------ .../sOlympusERC20V1/BalancerPoolToken.ts | 1688 ----------------- .../sOlympusERC20V1/BalancerVault.ts | 1688 ----------------- .../generated/sOlympusERC20V1/ERC20.ts | 394 ---- .../generated/sOlympusERC20V1/OlympusERC20.ts | 1184 ------------ .../sOlympusERC20V1/OlympusStakingV1.ts | 451 ----- .../sOlympusERC20V1/UniswapV2Pair.ts | 1092 ----------- .../sOlympusERC20V1/sOlympusERC20.ts | 964 ---------- .../sOlympusERC20V2/BalancerPoolToken.ts | 1688 ----------------- .../sOlympusERC20V2/BalancerVault.ts | 1688 ----------------- .../generated/sOlympusERC20V2/ERC20.ts | 394 ---- .../generated/sOlympusERC20V2/OlympusERC20.ts | 1184 ------------ .../sOlympusERC20V2/OlympusStakingV2.ts | 828 -------- .../sOlympusERC20V2/UniswapV2Pair.ts | 1092 ----------- .../sOlympusERC20V2/sOlympusERC20V2.ts | 1277 ------------- .../sOlympusERC20V3/BalancerPoolToken.ts | 1688 ----------------- .../sOlympusERC20V3/BalancerVault.ts | 1688 ----------------- .../generated/sOlympusERC20V3/ERC20.ts | 394 ---- .../generated/sOlympusERC20V3/OlympusERC20.ts | 1184 ------------ .../sOlympusERC20V3/OlympusStakingV3.ts | 982 ---------- .../sOlympusERC20V3/UniswapV2Pair.ts | 1092 ----------- .../sOlympusERC20V3/sOlympusERC20V3.ts | 1194 ------------ subgraphs/ethereum/generated/schema.ts | 479 ----- .../src/liquidity/LiquidityBalancer.ts | 2 +- .../ethereum/src/sOlympus/sOlympusERC20V1.ts | 3 - .../ethereum/src/sOlympus/sOlympusERC20V2.ts | 3 - .../ethereum/src/sOlympus/sOlympusERC20V3.ts | 3 - .../ethereum/src/utils/DailyStakingReward.ts | 31 - subgraphs/ethereum/src/utils/Tokens.ts | 11 - 105 files changed, 1 insertion(+), 115770 deletions(-) delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/BalancerPoolToken.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/BalancerVault.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/DAIBondV1.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/DAIBondV2.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/DAIBondV3.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/ERC20.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/ETHBondV1.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/FRAXBondV1.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/LUSDBondV1.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/OHMDAIBondV1.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/OHMDAIBondV2.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/OHMDAIBondV3.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/OHMDAIBondV4.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/OHMFRAXBondV1.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/OHMFRAXBondV2.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/OHMLUSDBondV1.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/OlympusERC20.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/OlympusStakingV1.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/OlympusStakingV2.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/OlympusStakingV3.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/UniswapV2Pair.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/sOlympusERC20.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/sOlympusERC20V2.ts delete mode 100644 subgraphs/ethereum/generated/BondDiscounts/sOlympusERC20V3.ts delete mode 100644 subgraphs/ethereum/generated/DAIBondV1/DAIBondV1.ts delete mode 100644 subgraphs/ethereum/generated/DAIBondV2/DAIBondV2.ts delete mode 100644 subgraphs/ethereum/generated/DAIBondV3/DAIBondV3.ts delete mode 100644 subgraphs/ethereum/generated/ETHBondV1/ETHBondV1.ts delete mode 100644 subgraphs/ethereum/generated/ETHBondV1/UniswapV2Pair.ts delete mode 100644 subgraphs/ethereum/generated/FRAXBondV1/FRAXBondV1.ts delete mode 100644 subgraphs/ethereum/generated/LUSDBondV1/LUSDBondV1.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV1/BalancerPoolToken.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV1/BalancerVault.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV1/ERC20.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV1/OHMDAIBondV1.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV1/UniswapV2Pair.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV2/BalancerPoolToken.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV2/BalancerVault.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV2/ERC20.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV2/OHMDAIBondV2.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV2/UniswapV2Pair.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV3/BalancerPoolToken.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV3/BalancerVault.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV3/ERC20.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV3/OHMDAIBondV3.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV3/UniswapV2Pair.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV4/BalancerPoolToken.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV4/BalancerVault.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV4/ERC20.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV4/OHMDAIBondV4.ts delete mode 100644 subgraphs/ethereum/generated/OHMDAIBondV4/UniswapV2Pair.ts delete mode 100644 subgraphs/ethereum/generated/OHMETHBondV1/BalancerPoolToken.ts delete mode 100644 subgraphs/ethereum/generated/OHMETHBondV1/BalancerVault.ts delete mode 100644 subgraphs/ethereum/generated/OHMETHBondV1/ERC20.ts delete mode 100644 subgraphs/ethereum/generated/OHMETHBondV1/OHMETHBondV1.ts delete mode 100644 subgraphs/ethereum/generated/OHMETHBondV1/UniswapV2Pair.ts delete mode 100644 subgraphs/ethereum/generated/OHMFRAXBondV1/BalancerPoolToken.ts delete mode 100644 subgraphs/ethereum/generated/OHMFRAXBondV1/BalancerVault.ts delete mode 100644 subgraphs/ethereum/generated/OHMFRAXBondV1/ERC20.ts delete mode 100644 subgraphs/ethereum/generated/OHMFRAXBondV1/OHMFRAXBondV1.ts delete mode 100644 subgraphs/ethereum/generated/OHMFRAXBondV1/UniswapV2Pair.ts delete mode 100644 subgraphs/ethereum/generated/OHMFRAXBondV2/BalancerPoolToken.ts delete mode 100644 subgraphs/ethereum/generated/OHMFRAXBondV2/BalancerVault.ts delete mode 100644 subgraphs/ethereum/generated/OHMFRAXBondV2/ERC20.ts delete mode 100644 subgraphs/ethereum/generated/OHMFRAXBondV2/OHMFRAXBondV2.ts delete mode 100644 subgraphs/ethereum/generated/OHMFRAXBondV2/UniswapV2Pair.ts delete mode 100644 subgraphs/ethereum/generated/OHMLUSDBondV1/BalancerPoolToken.ts delete mode 100644 subgraphs/ethereum/generated/OHMLUSDBondV1/BalancerVault.ts delete mode 100644 subgraphs/ethereum/generated/OHMLUSDBondV1/ERC20.ts delete mode 100644 subgraphs/ethereum/generated/OHMLUSDBondV1/OHMLUSDBondV1.ts delete mode 100644 subgraphs/ethereum/generated/OHMLUSDBondV1/UniswapV2Pair.ts delete mode 100644 subgraphs/ethereum/generated/PriceSnapshot/BalancerPoolToken.ts delete mode 100644 subgraphs/ethereum/generated/PriceSnapshot/BalancerVault.ts delete mode 100644 subgraphs/ethereum/generated/PriceSnapshot/ERC20.ts delete mode 100644 subgraphs/ethereum/generated/PriceSnapshot/UniswapV2Pair.ts delete mode 100644 subgraphs/ethereum/generated/PriceSnapshot/sOlympusERC20V2.ts delete mode 100644 subgraphs/ethereum/generated/PriceSnapshot/sOlympusERC20V3.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V1/BalancerPoolToken.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V1/BalancerVault.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V1/ERC20.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V1/OlympusERC20.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V1/OlympusStakingV1.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V1/UniswapV2Pair.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V1/sOlympusERC20.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V2/BalancerPoolToken.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V2/BalancerVault.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V2/ERC20.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V2/OlympusERC20.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V2/OlympusStakingV2.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V2/UniswapV2Pair.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V2/sOlympusERC20V2.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V3/BalancerPoolToken.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V3/BalancerVault.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V3/ERC20.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V3/OlympusERC20.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V3/OlympusStakingV3.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V3/UniswapV2Pair.ts delete mode 100644 subgraphs/ethereum/generated/sOlympusERC20V3/sOlympusERC20V3.ts delete mode 100644 subgraphs/ethereum/src/utils/DailyStakingReward.ts delete mode 100644 subgraphs/ethereum/src/utils/Tokens.ts diff --git a/subgraphs/ethereum/generated/BondDiscounts/BalancerPoolToken.ts b/subgraphs/ethereum/generated/BondDiscounts/BalancerPoolToken.ts deleted file mode 100644 index e1efa45b..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/BalancerPoolToken.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class SwapFeePercentageChanged extends ethereum.Event { - get params(): SwapFeePercentageChanged__Params { - return new SwapFeePercentageChanged__Params(this); - } -} - -export class SwapFeePercentageChanged__Params { - _event: SwapFeePercentageChanged; - - constructor(event: SwapFeePercentageChanged) { - this._event = event; - } - - get swapFeePercentage(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BalancerPoolToken__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerPoolToken__onExitPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onJoinPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onSwapInputRequestStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get tokenIn(): Address { - return this[1].toAddress(); - } - - get tokenOut(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get poolId(): Bytes { - return this[4].toBytes(); - } - - get lastChangeBlock(): BigInt { - return this[5].toBigInt(); - } - - get from(): Address { - return this[6].toAddress(); - } - - get to(): Address { - return this[7].toAddress(); - } - - get userData(): Bytes { - return this[8].toBytes(); - } -} - -export class BalancerPoolToken__queryExitResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptIn(): BigInt { - return this.value0; - } - - getAmountsOut(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__queryJoinResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptOut(): BigInt { - return this.value0; - } - - getAmountsIn(): Array { - return this.value1; - } -} - -export class BalancerPoolToken extends ethereum.SmartContract { - static bind(address: Address): BalancerPoolToken { - return new BalancerPoolToken("BalancerPoolToken", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getInvariant(): BigInt { - const result = super.call("getInvariant", "getInvariant():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getInvariant(): ethereum.CallResult { - const result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getLastInvariant(): BigInt { - const result = super.call( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getLastInvariant(): ethereum.CallResult { - const result = super.tryCall( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getNormalizedWeights(): Array { - const result = super.call( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - - return result[0].toBigIntArray(); - } - - try_getNormalizedWeights(): ethereum.CallResult> { - const result = super.tryCall( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getOwner(): Address { - const result = super.call("getOwner", "getOwner():(address)", []); - - return result[0].toAddress(); - } - - try_getOwner(): ethereum.CallResult
{ - const result = super.tryCall("getOwner", "getOwner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getPausedState(): BalancerPoolToken__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerPoolToken__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerPoolToken__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPoolId(): Bytes { - const result = super.call("getPoolId", "getPoolId():(bytes32)", []); - - return result[0].toBytes(); - } - - try_getPoolId(): ethereum.CallResult { - const result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getRate(): BigInt { - const result = super.call("getRate", "getRate():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getRate(): ethereum.CallResult { - const result = super.tryCall("getRate", "getRate():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getSwapFeePercentage(): BigInt { - const result = super.call( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getSwapFeePercentage(): ethereum.CallResult { - const result = super.tryCall( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getVault(): Address { - const result = super.call("getVault", "getVault():(address)", []); - - return result[0].toAddress(); - } - - try_getVault(): ethereum.CallResult
{ - const result = super.tryCall("getVault", "getVault():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - increaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onExitPoolResult { - const result = super.call( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onExitPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onExitPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onJoinPoolResult { - const result = super.call( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onJoinPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onJoinPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): BigInt { - const result = super.call( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - - return result[0].toBigInt(); - } - - try_onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryExitResult { - const result = super.call( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryExitResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryExitResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryJoinResult { - const result = super.call( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryJoinResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryJoinResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get vault(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get name(): string { - return this._call.inputValues[1].value.toString(); - } - - get symbol(): string { - return this._call.inputValues[2].value.toString(); - } - - get tokens(): Array
{ - return this._call.inputValues[3].value.toAddressArray(); - } - - get normalizedWeights(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[7].value.toBigInt(); - } - - get owner(): Address { - return this._call.inputValues[8].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DecreaseApprovalCall extends ethereum.Call { - get inputs(): DecreaseApprovalCall__Inputs { - return new DecreaseApprovalCall__Inputs(this); - } - - get outputs(): DecreaseApprovalCall__Outputs { - return new DecreaseApprovalCall__Outputs(this); - } -} - -export class DecreaseApprovalCall__Inputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseApprovalCall__Outputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseApprovalCall extends ethereum.Call { - get inputs(): IncreaseApprovalCall__Inputs { - return new IncreaseApprovalCall__Inputs(this); - } - - get outputs(): IncreaseApprovalCall__Outputs { - return new IncreaseApprovalCall__Outputs(this); - } -} - -export class IncreaseApprovalCall__Inputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseApprovalCall__Outputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class OnExitPoolCall extends ethereum.Call { - get inputs(): OnExitPoolCall__Inputs { - return new OnExitPoolCall__Inputs(this); - } - - get outputs(): OnExitPoolCall__Outputs { - return new OnExitPoolCall__Outputs(this); - } -} - -export class OnExitPoolCall__Inputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnExitPoolCall__Outputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class OnJoinPoolCall extends ethereum.Call { - get inputs(): OnJoinPoolCall__Inputs { - return new OnJoinPoolCall__Inputs(this); - } - - get outputs(): OnJoinPoolCall__Outputs { - return new OnJoinPoolCall__Outputs(this); - } -} - -export class OnJoinPoolCall__Inputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnJoinPoolCall__Outputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class QueryExitCall extends ethereum.Call { - get inputs(): QueryExitCall__Inputs { - return new QueryExitCall__Inputs(this); - } - - get outputs(): QueryExitCall__Outputs { - return new QueryExitCall__Outputs(this); - } -} - -export class QueryExitCall__Inputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryExitCall__Outputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get bptIn(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsOut(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class QueryJoinCall extends ethereum.Call { - get inputs(): QueryJoinCall__Inputs { - return new QueryJoinCall__Inputs(this); - } - - get outputs(): QueryJoinCall__Outputs { - return new QueryJoinCall__Outputs(this); - } -} - -export class QueryJoinCall__Inputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryJoinCall__Outputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get bptOut(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsIn(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetSwapFeePercentageCall extends ethereum.Call { - get inputs(): SetSwapFeePercentageCall__Inputs { - return new SetSwapFeePercentageCall__Inputs(this); - } - - get outputs(): SetSwapFeePercentageCall__Outputs { - return new SetSwapFeePercentageCall__Outputs(this); - } -} - -export class SetSwapFeePercentageCall__Inputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetSwapFeePercentageCall__Outputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/BalancerVault.ts b/subgraphs/ethereum/generated/BondDiscounts/BalancerVault.ts deleted file mode 100644 index 41f94648..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/BalancerVault.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class AuthorizerChanged extends ethereum.Event { - get params(): AuthorizerChanged__Params { - return new AuthorizerChanged__Params(this); - } -} - -export class AuthorizerChanged__Params { - _event: AuthorizerChanged; - - constructor(event: AuthorizerChanged) { - this._event = event; - } - - get newAuthorizer(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class ExternalBalanceTransfer extends ethereum.Event { - get params(): ExternalBalanceTransfer__Params { - return new ExternalBalanceTransfer__Params(this); - } -} - -export class ExternalBalanceTransfer__Params { - _event: ExternalBalanceTransfer; - - constructor(event: ExternalBalanceTransfer) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get recipient(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class FlashLoan extends ethereum.Event { - get params(): FlashLoan__Params { - return new FlashLoan__Params(this); - } -} - -export class FlashLoan__Params { - _event: FlashLoan; - - constructor(event: FlashLoan) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get feeAmount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class InternalBalanceChanged extends ethereum.Event { - get params(): InternalBalanceChanged__Params { - return new InternalBalanceChanged__Params(this); - } -} - -export class InternalBalanceChanged__Params { - _event: InternalBalanceChanged; - - constructor(event: InternalBalanceChanged) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get delta(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class PoolBalanceChanged extends ethereum.Event { - get params(): PoolBalanceChanged__Params { - return new PoolBalanceChanged__Params(this); - } -} - -export class PoolBalanceChanged__Params { - _event: PoolBalanceChanged; - - constructor(event: PoolBalanceChanged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get liquidityProvider(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokens(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } - - get deltas(): Array { - return this._event.parameters[3].value.toBigIntArray(); - } - - get protocolFeeAmounts(): Array { - return this._event.parameters[4].value.toBigIntArray(); - } -} - -export class PoolBalanceManaged extends ethereum.Event { - get params(): PoolBalanceManaged__Params { - return new PoolBalanceManaged__Params(this); - } -} - -export class PoolBalanceManaged__Params { - _event: PoolBalanceManaged; - - constructor(event: PoolBalanceManaged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get assetManager(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get cashDelta(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get managedDelta(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class PoolRegistered extends ethereum.Event { - get params(): PoolRegistered__Params { - return new PoolRegistered__Params(this); - } -} - -export class PoolRegistered__Params { - _event: PoolRegistered; - - constructor(event: PoolRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get poolAddress(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get specialization(): i32 { - return this._event.parameters[2].value.toI32(); - } -} - -export class RelayerApprovalChanged extends ethereum.Event { - get params(): RelayerApprovalChanged__Params { - return new RelayerApprovalChanged__Params(this); - } -} - -export class RelayerApprovalChanged__Params { - _event: RelayerApprovalChanged; - - constructor(event: RelayerApprovalChanged) { - this._event = event; - } - - get relayer(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get approved(): boolean { - return this._event.parameters[2].value.toBoolean(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokenIn(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokenOut(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amountIn(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amountOut(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class TokensDeregistered extends ethereum.Event { - get params(): TokensDeregistered__Params { - return new TokensDeregistered__Params(this); - } -} - -export class TokensDeregistered__Params { - _event: TokensDeregistered; - - constructor(event: TokensDeregistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } -} - -export class TokensRegistered extends ethereum.Event { - get params(): TokensRegistered__Params { - return new TokensRegistered__Params(this); - } -} - -export class TokensRegistered__Params { - _event: TokensRegistered; - - constructor(event: TokensRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } -} - -export class BalancerVault__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerVault__getPoolResult { - value0: Address; - value1: i32; - - constructor(value0: Address, value1: i32) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddress(this.value0)); - map.set( - "value1", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) - ); - return map; - } - - getValue0(): Address { - return this.value0; - } - - getValue1(): i32 { - return this.value1; - } -} - -export class BalancerVault__getPoolTokenInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: Address; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: Address) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromAddress(this.value3)); - return map; - } - - getCash(): BigInt { - return this.value0; - } - - getManaged(): BigInt { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } - - getAssetManager(): Address { - return this.value3; - } -} - -export class BalancerVault__getPoolTokensResult { - value0: Array
; - value1: Array; - value2: BigInt; - - constructor(value0: Array
, value1: Array, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddressArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getTokens(): Array
{ - return this.value0; - } - - getBalances(): Array { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } -} - -export class BalancerVault__queryBatchSwapInputSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BalancerVault__queryBatchSwapInputFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class BalancerVault extends ethereum.SmartContract { - static bind(address: Address): BalancerVault { - return new BalancerVault("BalancerVault", address); - } - - WETH(): Address { - const result = super.call("WETH", "WETH():(address)", []); - - return result[0].toAddress(); - } - - try_WETH(): ethereum.CallResult
{ - const result = super.tryCall("WETH", "WETH():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getDomainSeparator(): Bytes { - const result = super.call( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_getDomainSeparator(): ethereum.CallResult { - const result = super.tryCall( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getInternalBalance(user: Address, tokens: Array
): Array { - const result = super.call( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - - return result[0].toBigIntArray(); - } - - try_getInternalBalance( - user: Address, - tokens: Array
- ): ethereum.CallResult> { - const result = super.tryCall( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getNextNonce(user: Address): BigInt { - const result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ - ethereum.Value.fromAddress(user) - ]); - - return result[0].toBigInt(); - } - - try_getNextNonce(user: Address): ethereum.CallResult { - const result = super.tryCall( - "getNextNonce", - "getNextNonce(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getPausedState(): BalancerVault__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerVault__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerVault__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPool(poolId: Bytes): BalancerVault__getPoolResult { - const result = super.call("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - - return new BalancerVault__getPoolResult( - result[0].toAddress(), - result[1].toI32() - ); - } - - try_getPool( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolResult(value[0].toAddress(), value[1].toI32()) - ); - } - - getPoolTokenInfo( - poolId: Bytes, - token: Address - ): BalancerVault__getPoolTokenInfoResult { - const result = super.call( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - - return new BalancerVault__getPoolTokenInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toAddress() - ); - } - - try_getPoolTokenInfo( - poolId: Bytes, - token: Address - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokenInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toAddress() - ) - ); - } - - getPoolTokens(poolId: Bytes): BalancerVault__getPoolTokensResult { - const result = super.call( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - - return new BalancerVault__getPoolTokensResult( - result[0].toAddressArray(), - result[1].toBigIntArray(), - result[2].toBigInt() - ); - } - - try_getPoolTokens( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokensResult( - value[0].toAddressArray(), - value[1].toBigIntArray(), - value[2].toBigInt() - ) - ); - } - - getProtocolFeesCollector(): Address { - const result = super.call( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_getProtocolFeesCollector(): ethereum.CallResult
{ - const result = super.tryCall( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - hasApprovedRelayer(user: Address, relayer: Address): boolean { - const result = super.call( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - - return result[0].toBoolean(); - } - - try_hasApprovedRelayer( - user: Address, - relayer: Address - ): ethereum.CallResult { - const result = super.tryCall( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): Array { - const result = super.call( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - - return result[0].toBigIntArray(); - } - - try_queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): ethereum.CallResult> { - const result = super.tryCall( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - registerPool(specialization: i32): Bytes { - const result = super.call("registerPool", "registerPool(uint8):(bytes32)", [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization)) - ]); - - return result[0].toBytes(); - } - - try_registerPool(specialization: i32): ethereum.CallResult { - const result = super.tryCall( - "registerPool", - "registerPool(uint8):(bytes32)", - [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization))] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get authorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get weth(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class BatchSwapCall extends ethereum.Call { - get inputs(): BatchSwapCall__Inputs { - return new BatchSwapCall__Inputs(this); - } - - get outputs(): BatchSwapCall__Outputs { - return new BatchSwapCall__Outputs(this); - } -} - -export class BatchSwapCall__Inputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - BatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): BatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } - - get limits(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get deadline(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } -} - -export class BatchSwapCall__Outputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get assetDeltas(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class BatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class DeregisterTokensCall extends ethereum.Call { - get inputs(): DeregisterTokensCall__Inputs { - return new DeregisterTokensCall__Inputs(this); - } - - get outputs(): DeregisterTokensCall__Outputs { - return new DeregisterTokensCall__Outputs(this); - } -} - -export class DeregisterTokensCall__Inputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } -} - -export class DeregisterTokensCall__Outputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } -} - -export class ExitPoolCall extends ethereum.Call { - get inputs(): ExitPoolCall__Inputs { - return new ExitPoolCall__Inputs(this); - } - - get outputs(): ExitPoolCall__Outputs { - return new ExitPoolCall__Outputs(this); - } -} - -export class ExitPoolCall__Inputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): ExitPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class ExitPoolCall__Outputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } -} - -export class ExitPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get minAmountsOut(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class FlashLoanCall extends ethereum.Call { - get inputs(): FlashLoanCall__Inputs { - return new FlashLoanCall__Inputs(this); - } - - get outputs(): FlashLoanCall__Outputs { - return new FlashLoanCall__Outputs(this); - } -} - -export class FlashLoanCall__Inputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get amounts(): Array { - return this._call.inputValues[2].value.toBigIntArray(); - } - - get userData(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class FlashLoanCall__Outputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } -} - -export class JoinPoolCall extends ethereum.Call { - get inputs(): JoinPoolCall__Inputs { - return new JoinPoolCall__Inputs(this); - } - - get outputs(): JoinPoolCall__Outputs { - return new JoinPoolCall__Outputs(this); - } -} - -export class JoinPoolCall__Inputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): JoinPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class JoinPoolCall__Outputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } -} - -export class JoinPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get maxAmountsIn(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get fromInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class ManagePoolBalanceCall extends ethereum.Call { - get inputs(): ManagePoolBalanceCall__Inputs { - return new ManagePoolBalanceCall__Inputs(this); - } - - get outputs(): ManagePoolBalanceCall__Outputs { - return new ManagePoolBalanceCall__Outputs(this); - } -} - -export class ManagePoolBalanceCall__Inputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManagePoolBalanceCallOpsStruct - >(); - } -} - -export class ManagePoolBalanceCall__Outputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } -} - -export class ManagePoolBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get poolId(): Bytes { - return this[1].toBytes(); - } - - get token(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } -} - -export class ManageUserBalanceCall extends ethereum.Call { - get inputs(): ManageUserBalanceCall__Inputs { - return new ManageUserBalanceCall__Inputs(this); - } - - get outputs(): ManageUserBalanceCall__Outputs { - return new ManageUserBalanceCall__Outputs(this); - } -} - -export class ManageUserBalanceCall__Inputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManageUserBalanceCallOpsStruct - >(); - } -} - -export class ManageUserBalanceCall__Outputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } -} - -export class ManageUserBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get asset(): Address { - return this[1].toAddress(); - } - - get amount(): BigInt { - return this[2].toBigInt(); - } - - get sender(): Address { - return this[3].toAddress(); - } - - get recipient(): Address { - return this[4].toAddress(); - } -} - -export class QueryBatchSwapCall extends ethereum.Call { - get inputs(): QueryBatchSwapCall__Inputs { - return new QueryBatchSwapCall__Inputs(this); - } - - get outputs(): QueryBatchSwapCall__Outputs { - return new QueryBatchSwapCall__Outputs(this); - } -} - -export class QueryBatchSwapCall__Inputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - QueryBatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): QueryBatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class QueryBatchSwapCall__Outputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class QueryBatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class QueryBatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class RegisterPoolCall extends ethereum.Call { - get inputs(): RegisterPoolCall__Inputs { - return new RegisterPoolCall__Inputs(this); - } - - get outputs(): RegisterPoolCall__Outputs { - return new RegisterPoolCall__Outputs(this); - } -} - -export class RegisterPoolCall__Inputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get specialization(): i32 { - return this._call.inputValues[0].value.toI32(); - } -} - -export class RegisterPoolCall__Outputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get value0(): Bytes { - return this._call.outputValues[0].value.toBytes(); - } -} - -export class RegisterTokensCall extends ethereum.Call { - get inputs(): RegisterTokensCall__Inputs { - return new RegisterTokensCall__Inputs(this); - } - - get outputs(): RegisterTokensCall__Outputs { - return new RegisterTokensCall__Outputs(this); - } -} - -export class RegisterTokensCall__Inputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } -} - -export class RegisterTokensCall__Outputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } -} - -export class SetAuthorizerCall extends ethereum.Call { - get inputs(): SetAuthorizerCall__Inputs { - return new SetAuthorizerCall__Inputs(this); - } - - get outputs(): SetAuthorizerCall__Outputs { - return new SetAuthorizerCall__Outputs(this); - } -} - -export class SetAuthorizerCall__Inputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } - - get newAuthorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetAuthorizerCall__Outputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetRelayerApprovalCall extends ethereum.Call { - get inputs(): SetRelayerApprovalCall__Inputs { - return new SetRelayerApprovalCall__Inputs(this); - } - - get outputs(): SetRelayerApprovalCall__Outputs { - return new SetRelayerApprovalCall__Outputs(this); - } -} - -export class SetRelayerApprovalCall__Inputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get relayer(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get approved(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } -} - -export class SetRelayerApprovalCall__Outputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get singleSwap(): SwapCallSingleSwapStruct { - return changetype( - this._call.inputValues[0].value.toTuple() - ); - } - - get funds(): SwapCallFundsStruct { - return changetype( - this._call.inputValues[1].value.toTuple() - ); - } - - get limit(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amountCalculated(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class SwapCallSingleSwapStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get kind(): i32 { - return this[1].toI32(); - } - - get assetIn(): Address { - return this[2].toAddress(); - } - - get assetOut(): Address { - return this[3].toAddress(); - } - - get amount(): BigInt { - return this[4].toBigInt(); - } - - get userData(): Bytes { - return this[5].toBytes(); - } -} - -export class SwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/DAIBondV1.ts b/subgraphs/ethereum/generated/BondDiscounts/DAIBondV1.ts deleted file mode 100644 index a13088e3..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/DAIBondV1.ts +++ /dev/null @@ -1,1054 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class DAIBondV1__depositorInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getValue(): BigInt { - return this.value0; - } - - getPayoutRemaining(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getVestingPeriod(): BigInt { - return this.value3; - } -} - -export class DAIBondV1__getDepositorInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - get_value(): BigInt { - return this.value0; - } - - get_payoutRemaining(): BigInt { - return this.value1; - } - - get_lastBlock(): BigInt { - return this.value2; - } - - get_vestingPeriod(): BigInt { - return this.value3; - } -} - -export class DAIBondV1 extends ethereum.SmartContract { - static bind(address: Address): DAIBondV1 { - return new DAIBondV1("DAIBondV1", address); - } - - DAI(): Address { - const result = super.call("DAI", "DAI():(address)", []); - - return result[0].toAddress(); - } - - try_DAI(): ethereum.CallResult
{ - const result = super.tryCall("DAI", "DAI():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - DAOShare(): BigInt { - const result = super.call("DAOShare", "DAOShare():(uint256)", []); - - return result[0].toBigInt(); - } - - try_DAOShare(): ethereum.CallResult { - const result = super.tryCall("DAOShare", "DAOShare():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - DAOWallet(): Address { - const result = super.call("DAOWallet", "DAOWallet():(address)", []); - - return result[0].toAddress(); - } - - try_DAOWallet(): ethereum.CallResult
{ - const result = super.tryCall("DAOWallet", "DAOWallet():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondControlVariable(): BigInt { - const result = super.call( - "bondControlVariable", - "bondControlVariable():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_bondControlVariable(): ethereum.CallResult { - const result = super.tryCall( - "bondControlVariable", - "bondControlVariable():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculateBondInterest(value_: BigInt): BigInt { - const result = super.call( - "calculateBondInterest", - "calculateBondInterest(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(value_)] - ); - - return result[0].toBigInt(); - } - - try_calculateBondInterest(value_: BigInt): ethereum.CallResult { - const result = super.tryCall( - "calculateBondInterest", - "calculateBondInterest(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(value_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculatePendingPayout(depositor_: Address): BigInt { - const result = super.call( - "calculatePendingPayout", - "calculatePendingPayout(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - - return result[0].toBigInt(); - } - - try_calculatePendingPayout(depositor_: Address): ethereum.CallResult { - const result = super.tryCall( - "calculatePendingPayout", - "calculatePendingPayout(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculatePercentVested(depositor_: Address): BigInt { - const result = super.call( - "calculatePercentVested", - "calculatePercentVested(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - - return result[0].toBigInt(); - } - - try_calculatePercentVested(depositor_: Address): ethereum.CallResult { - const result = super.tryCall( - "calculatePercentVested", - "calculatePercentVested(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculatePremium(): BigInt { - const result = super.call( - "calculatePremium", - "calculatePremium():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_calculatePremium(): ethereum.CallResult { - const result = super.tryCall( - "calculatePremium", - "calculatePremium():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - circulatingOHMContract(): Address { - const result = super.call( - "circulatingOHMContract", - "circulatingOHMContract():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_circulatingOHMContract(): ethereum.CallResult
{ - const result = super.tryCall( - "circulatingOHMContract", - "circulatingOHMContract():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - deposit(amount_: BigInt, maxPremium_: BigInt, depositor_: Address): boolean { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(amount_), - ethereum.Value.fromUnsignedBigInt(maxPremium_), - ethereum.Value.fromAddress(depositor_) - ] - ); - - return result[0].toBoolean(); - } - - try_deposit( - amount_: BigInt, - maxPremium_: BigInt, - depositor_: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(amount_), - ethereum.Value.fromUnsignedBigInt(maxPremium_), - ethereum.Value.fromAddress(depositor_) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - depositWithPermit( - amount_: BigInt, - maxPremium_: BigInt, - depositor_: Address, - deadline: BigInt, - v: i32, - r: Bytes, - s: Bytes - ): boolean { - const result = super.call( - "depositWithPermit", - "depositWithPermit(uint256,uint256,address,uint256,uint8,bytes32,bytes32):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(amount_), - ethereum.Value.fromUnsignedBigInt(maxPremium_), - ethereum.Value.fromAddress(depositor_), - ethereum.Value.fromUnsignedBigInt(deadline), - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(v)), - ethereum.Value.fromFixedBytes(r), - ethereum.Value.fromFixedBytes(s) - ] - ); - - return result[0].toBoolean(); - } - - try_depositWithPermit( - amount_: BigInt, - maxPremium_: BigInt, - depositor_: Address, - deadline: BigInt, - v: i32, - r: Bytes, - s: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "depositWithPermit", - "depositWithPermit(uint256,uint256,address,uint256,uint8,bytes32,bytes32):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(amount_), - ethereum.Value.fromUnsignedBigInt(maxPremium_), - ethereum.Value.fromAddress(depositor_), - ethereum.Value.fromUnsignedBigInt(deadline), - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(v)), - ethereum.Value.fromFixedBytes(r), - ethereum.Value.fromFixedBytes(s) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - depositorInfo(param0: Address): DAIBondV1__depositorInfoResult { - const result = super.call( - "depositorInfo", - "depositorInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new DAIBondV1__depositorInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_depositorInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "depositorInfo", - "depositorInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new DAIBondV1__depositorInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - getDepositorInfo(address_: Address): DAIBondV1__getDepositorInfoResult { - const result = super.call( - "getDepositorInfo", - "getDepositorInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(address_)] - ); - - return new DAIBondV1__getDepositorInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_getDepositorInfo( - address_: Address - ): ethereum.CallResult { - const result = super.tryCall( - "getDepositorInfo", - "getDepositorInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(address_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new DAIBondV1__getDepositorInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - getMaxPayoutAmount(): BigInt { - const result = super.call( - "getMaxPayoutAmount", - "getMaxPayoutAmount():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getMaxPayoutAmount(): ethereum.CallResult { - const result = super.tryCall( - "getMaxPayoutAmount", - "getMaxPayoutAmount():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxPayoutPercent(): BigInt { - const result = super.call( - "maxPayoutPercent", - "maxPayoutPercent():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_maxPayoutPercent(): ethereum.CallResult { - const result = super.tryCall( - "maxPayoutPercent", - "maxPayoutPercent():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - minPremium(): BigInt { - const result = super.call("minPremium", "minPremium():(uint256)", []); - - return result[0].toBigInt(); - } - - try_minPremium(): ethereum.CallResult { - const result = super.tryCall("minPremium", "minPremium():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - owner(): Address { - const result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - const result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - redeem(): boolean { - const result = super.call("redeem", "redeem():(bool)", []); - - return result[0].toBoolean(); - } - - try_redeem(): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - setBondTerms( - bondControlVariable_: BigInt, - vestingPeriodInBlocks_: BigInt, - minPremium_: BigInt, - maxPayout_: BigInt, - DAOShare_: BigInt - ): boolean { - const result = super.call( - "setBondTerms", - "setBondTerms(uint256,uint256,uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(bondControlVariable_), - ethereum.Value.fromUnsignedBigInt(vestingPeriodInBlocks_), - ethereum.Value.fromUnsignedBigInt(minPremium_), - ethereum.Value.fromUnsignedBigInt(maxPayout_), - ethereum.Value.fromUnsignedBigInt(DAOShare_) - ] - ); - - return result[0].toBoolean(); - } - - try_setBondTerms( - bondControlVariable_: BigInt, - vestingPeriodInBlocks_: BigInt, - minPremium_: BigInt, - maxPayout_: BigInt, - DAOShare_: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "setBondTerms", - "setBondTerms(uint256,uint256,uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(bondControlVariable_), - ethereum.Value.fromUnsignedBigInt(vestingPeriodInBlocks_), - ethereum.Value.fromUnsignedBigInt(minPremium_), - ethereum.Value.fromUnsignedBigInt(maxPayout_), - ethereum.Value.fromUnsignedBigInt(DAOShare_) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - stakingContract(): Address { - const result = super.call( - "stakingContract", - "stakingContract():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_stakingContract(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingContract", - "stakingContract():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - toggleUseCircForDebtRatio(): boolean { - const result = super.call( - "toggleUseCircForDebtRatio", - "toggleUseCircForDebtRatio():(bool)", - [] - ); - - return result[0].toBoolean(); - } - - try_toggleUseCircForDebtRatio(): ethereum.CallResult { - const result = super.tryCall( - "toggleUseCircForDebtRatio", - "toggleUseCircForDebtRatio():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - useCircForDebtRatio(): boolean { - const result = super.call( - "useCircForDebtRatio", - "useCircForDebtRatio():(bool)", - [] - ); - - return result[0].toBoolean(); - } - - try_useCircForDebtRatio(): ethereum.CallResult { - const result = super.tryCall( - "useCircForDebtRatio", - "useCircForDebtRatio():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - vestingPeriodInBlocks(): BigInt { - const result = super.call( - "vestingPeriodInBlocks", - "vestingPeriodInBlocks():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_vestingPeriodInBlocks(): ethereum.CallResult { - const result = super.tryCall( - "vestingPeriodInBlocks", - "vestingPeriodInBlocks():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get DAI_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get OHM_(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get treasury_(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get stakingContract_(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get DAOWallet_(): Address { - return this._call.inputValues[4].value.toAddress(); - } - - get circulatingOHMContract_(): Address { - return this._call.inputValues[5].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get amount_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get maxPremium_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get depositor_(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DepositWithPermitCall extends ethereum.Call { - get inputs(): DepositWithPermitCall__Inputs { - return new DepositWithPermitCall__Inputs(this); - } - - get outputs(): DepositWithPermitCall__Outputs { - return new DepositWithPermitCall__Outputs(this); - } -} - -export class DepositWithPermitCall__Inputs { - _call: DepositWithPermitCall; - - constructor(call: DepositWithPermitCall) { - this._call = call; - } - - get amount_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get maxPremium_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get depositor_(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class DepositWithPermitCall__Outputs { - _call: DepositWithPermitCall; - - constructor(call: DepositWithPermitCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RenounceOwnershipCall extends ethereum.Call { - get inputs(): RenounceOwnershipCall__Inputs { - return new RenounceOwnershipCall__Inputs(this); - } - - get outputs(): RenounceOwnershipCall__Outputs { - return new RenounceOwnershipCall__Outputs(this); - } -} - -export class RenounceOwnershipCall__Inputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall__Outputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get bondControlVariable_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get vestingPeriodInBlocks_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get minPremium_(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get maxPayout_(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get DAOShare_(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class ToggleUseCircForDebtRatioCall extends ethereum.Call { - get inputs(): ToggleUseCircForDebtRatioCall__Inputs { - return new ToggleUseCircForDebtRatioCall__Inputs(this); - } - - get outputs(): ToggleUseCircForDebtRatioCall__Outputs { - return new ToggleUseCircForDebtRatioCall__Outputs(this); - } -} - -export class ToggleUseCircForDebtRatioCall__Inputs { - _call: ToggleUseCircForDebtRatioCall; - - constructor(call: ToggleUseCircForDebtRatioCall) { - this._call = call; - } -} - -export class ToggleUseCircForDebtRatioCall__Outputs { - _call: ToggleUseCircForDebtRatioCall; - - constructor(call: ToggleUseCircForDebtRatioCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/DAIBondV2.ts b/subgraphs/ethereum/generated/BondDiscounts/DAIBondV2.ts deleted file mode 100644 index 0209c620..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/DAIBondV2.ts +++ /dev/null @@ -1,1158 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get payout(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class DAIBondV2__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } -} - -export class DAIBondV2__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getValueRemaining(): BigInt { - return this.value0; - } - - getPayoutRemaining(): BigInt { - return this.value1; - } - - getVestingPeriod(): BigInt { - return this.value2; - } - - getLastBlock(): BigInt { - return this.value3; - } - - getPricePaid(): BigInt { - return this.value4; - } -} - -export class DAIBondV2__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getFee(): BigInt { - return this.value4; - } -} - -export class DAIBondV2 extends ethereum.SmartContract { - static bind(address: Address): DAIBondV2 { - return new DAIBondV2("DAIBondV2", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): DAIBondV2__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256)", - [] - ); - - return new DAIBondV2__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new DAIBondV2__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): DAIBondV2__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new DAIBondV2__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new DAIBondV2__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isLiquidityBond(): boolean { - const result = super.call("isLiquidityBond", "isLiquidityBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_isLiquidityBond(): ethereum.CallResult { - const result = super.tryCall( - "isLiquidityBond", - "isLiquidityBond():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - manager(): Address { - const result = super.call("manager", "manager():(address)", []); - - return result[0].toAddress(); - } - - try_manager(): ethereum.CallResult
{ - const result = super.tryCall("manager", "manager():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_stake: boolean): BigInt { - const result = super.call("redeem", "redeem(bool):(uint256)", [ - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem(_stake: boolean): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(bool):(uint256)", [ - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - setBondTerms( - _vestingTerm: BigInt, - _minimumPrice: BigInt, - _maxPayout: BigInt, - _fee: BigInt - ): boolean { - const result = super.call( - "setBondTerms", - "setBondTerms(uint256,uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(_vestingTerm), - ethereum.Value.fromUnsignedBigInt(_minimumPrice), - ethereum.Value.fromUnsignedBigInt(_maxPayout), - ethereum.Value.fromUnsignedBigInt(_fee) - ] - ); - - return result[0].toBoolean(); - } - - try_setBondTerms( - _vestingTerm: BigInt, - _minimumPrice: BigInt, - _maxPayout: BigInt, - _fee: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "setBondTerms", - "setBondTerms(uint256,uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(_vestingTerm), - ethereum.Value.fromUnsignedBigInt(_minimumPrice), - ethereum.Value.fromUnsignedBigInt(_maxPayout), - ethereum.Value.fromUnsignedBigInt(_fee) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - setStaking(_staking: Address): boolean { - const result = super.call("setStaking", "setStaking(address):(bool)", [ - ethereum.Value.fromAddress(_staking) - ]); - - return result[0].toBoolean(); - } - - try_setStaking(_staking: Address): ethereum.CallResult { - const result = super.tryCall("setStaking", "setStaking(address):(bool)", [ - ethereum.Value.fromAddress(_staking) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - terms(): DAIBondV2__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new DAIBondV2__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new DAIBondV2__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _bondCalculator(): Address { - return this._call.inputValues[4].value.toAddress(); - } - - get _controlVariable(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _stake(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _fee(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/DAIBondV3.ts b/subgraphs/ethereum/generated/BondDiscounts/DAIBondV3.ts deleted file mode 100644 index 519af220..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/DAIBondV3.ts +++ /dev/null @@ -1,1298 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ControlVariableAdjustment extends ethereum.Event { - get params(): ControlVariableAdjustment__Params { - return new ControlVariableAdjustment__Params(this); - } -} - -export class ControlVariableAdjustment__Params { - _event: ControlVariableAdjustment; - - constructor(event: ControlVariableAdjustment) { - this._event = event; - } - - get initialBCV(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get newBCV(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get adjustment(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get addition(): boolean { - return this._event.parameters[3].value.toBoolean(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class DAIBondV3__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: boolean, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } - - getBuffer(): BigInt { - return this.value3; - } - - getLastBlock(): BigInt { - return this.value4; - } -} - -export class DAIBondV3__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getPayout(): BigInt { - return this.value0; - } - - getVesting(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getPricePaid(): BigInt { - return this.value3; - } -} - -export class DAIBondV3__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getFee(): BigInt { - return this.value4; - } - - getMaxDebt(): BigInt { - return this.value5; - } -} - -export class DAIBondV3 extends ethereum.SmartContract { - static bind(address: Address): DAIBondV3 { - return new DAIBondV3("DAIBondV3", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): DAIBondV3__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - - return new DAIBondV3__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new DAIBondV3__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): DAIBondV3__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new DAIBondV3__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new DAIBondV3__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - currentDebt(): BigInt { - const result = super.call("currentDebt", "currentDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_currentDebt(): ethereum.CallResult { - const result = super.tryCall("currentDebt", "currentDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtDecay(): BigInt { - const result = super.call("debtDecay", "debtDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtDecay(): ethereum.CallResult { - const result = super.tryCall("debtDecay", "debtDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isLiquidityBond(): boolean { - const result = super.call("isLiquidityBond", "isLiquidityBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_isLiquidityBond(): ethereum.CallResult { - const result = super.tryCall( - "isLiquidityBond", - "isLiquidityBond():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - lastDecay(): BigInt { - const result = super.call("lastDecay", "lastDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_lastDecay(): ethereum.CallResult { - const result = super.tryCall("lastDecay", "lastDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - policy(): Address { - const result = super.call("policy", "policy():(address)", []); - - return result[0].toAddress(); - } - - try_policy(): ethereum.CallResult
{ - const result = super.tryCall("policy", "policy():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_recipient: Address, _stake: boolean): BigInt { - const result = super.call("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem( - _recipient: Address, - _stake: boolean - ): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - stakingHelper(): Address { - const result = super.call("stakingHelper", "stakingHelper():(address)", []); - - return result[0].toAddress(); - } - - try_stakingHelper(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingHelper", - "stakingHelper():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - standardizedDebtRatio(): BigInt { - const result = super.call( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_standardizedDebtRatio(): ethereum.CallResult { - const result = super.tryCall( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - terms(): DAIBondV3__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new DAIBondV3__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new DAIBondV3__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - useHelper(): boolean { - const result = super.call("useHelper", "useHelper():(bool)", []); - - return result[0].toBoolean(); - } - - try_useHelper(): ethereum.CallResult { - const result = super.tryCall("useHelper", "useHelper():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _bondCalculator(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class InitializeBondTermsCall extends ethereum.Call { - get inputs(): InitializeBondTermsCall__Inputs { - return new InitializeBondTermsCall__Inputs(this); - } - - get outputs(): InitializeBondTermsCall__Outputs { - return new InitializeBondTermsCall__Outputs(this); - } -} - -export class InitializeBondTermsCall__Inputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } - - get _controlVariable(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _fee(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _maxDebt(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get _initialDebt(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } -} - -export class InitializeBondTermsCall__Outputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _stake(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _buffer(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _parameter(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _input(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _helper(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/ERC20.ts b/subgraphs/ethereum/generated/BondDiscounts/ERC20.ts deleted file mode 100644 index bbe93783..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/ERC20.ts +++ /dev/null @@ -1,394 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ERC20 extends ethereum.SmartContract { - static bind(address: Address): ERC20 { - return new ERC20("ERC20", address); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - approve(_spender: Address, _value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_approve(_spender: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transferFrom(_from: Address, _to: Address, _value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - _from: Address, - _to: Address, - _value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - balanceOf(_owner: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(_owner: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - transfer(_to: Address, _value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(_to: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - allowance(_owner: Address, _spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - _owner: Address, - _spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get _spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get _from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DefaultCall extends ethereum.Call { - get inputs(): DefaultCall__Inputs { - return new DefaultCall__Inputs(this); - } - - get outputs(): DefaultCall__Outputs { - return new DefaultCall__Outputs(this); - } -} - -export class DefaultCall__Inputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} - -export class DefaultCall__Outputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/ETHBondV1.ts b/subgraphs/ethereum/generated/BondDiscounts/ETHBondV1.ts deleted file mode 100644 index 73bc556f..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/ETHBondV1.ts +++ /dev/null @@ -1,1261 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ControlVariableAdjustment extends ethereum.Event { - get params(): ControlVariableAdjustment__Params { - return new ControlVariableAdjustment__Params(this); - } -} - -export class ControlVariableAdjustment__Params { - _event: ControlVariableAdjustment; - - constructor(event: ControlVariableAdjustment) { - this._event = event; - } - - get initialBCV(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get newBCV(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get adjustment(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get addition(): boolean { - return this._event.parameters[3].value.toBoolean(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class ETHBondV1__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: boolean, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } - - getBuffer(): BigInt { - return this.value3; - } - - getLastBlock(): BigInt { - return this.value4; - } -} - -export class ETHBondV1__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getPayout(): BigInt { - return this.value0; - } - - getVesting(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getPricePaid(): BigInt { - return this.value3; - } -} - -export class ETHBondV1__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getMaxDebt(): BigInt { - return this.value4; - } -} - -export class ETHBondV1 extends ethereum.SmartContract { - static bind(address: Address): ETHBondV1 { - return new ETHBondV1("ETHBondV1", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): ETHBondV1__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - - return new ETHBondV1__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new ETHBondV1__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - assetPrice(): BigInt { - const result = super.call("assetPrice", "assetPrice():(int256)", []); - - return result[0].toBigInt(); - } - - try_assetPrice(): ethereum.CallResult { - const result = super.tryCall("assetPrice", "assetPrice():(int256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondInfo(param0: Address): ETHBondV1__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new ETHBondV1__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new ETHBondV1__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - currentDebt(): BigInt { - const result = super.call("currentDebt", "currentDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_currentDebt(): ethereum.CallResult { - const result = super.tryCall("currentDebt", "currentDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtDecay(): BigInt { - const result = super.call("debtDecay", "debtDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtDecay(): ethereum.CallResult { - const result = super.tryCall("debtDecay", "debtDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - lastDecay(): BigInt { - const result = super.call("lastDecay", "lastDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_lastDecay(): ethereum.CallResult { - const result = super.tryCall("lastDecay", "lastDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - policy(): Address { - const result = super.call("policy", "policy():(address)", []); - - return result[0].toAddress(); - } - - try_policy(): ethereum.CallResult
{ - const result = super.tryCall("policy", "policy():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_recipient: Address, _stake: boolean): BigInt { - const result = super.call("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem( - _recipient: Address, - _stake: boolean - ): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - stakingHelper(): Address { - const result = super.call("stakingHelper", "stakingHelper():(address)", []); - - return result[0].toAddress(); - } - - try_stakingHelper(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingHelper", - "stakingHelper():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - standardizedDebtRatio(): BigInt { - const result = super.call( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_standardizedDebtRatio(): ethereum.CallResult { - const result = super.tryCall( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - terms(): ETHBondV1__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new ETHBondV1__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new ETHBondV1__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - useHelper(): boolean { - const result = super.call("useHelper", "useHelper():(bool)", []); - - return result[0].toBoolean(); - } - - try_useHelper(): ethereum.CallResult { - const result = super.tryCall("useHelper", "useHelper():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _feed(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class InitializeBondTermsCall extends ethereum.Call { - get inputs(): InitializeBondTermsCall__Inputs { - return new InitializeBondTermsCall__Inputs(this); - } - - get outputs(): InitializeBondTermsCall__Outputs { - return new InitializeBondTermsCall__Outputs(this); - } -} - -export class InitializeBondTermsCall__Inputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } - - get _controlVariable(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _maxDebt(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _initialDebt(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } -} - -export class InitializeBondTermsCall__Outputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _stake(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _buffer(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _parameter(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _input(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _helper(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/FRAXBondV1.ts b/subgraphs/ethereum/generated/BondDiscounts/FRAXBondV1.ts deleted file mode 100644 index 2ddf98e3..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/FRAXBondV1.ts +++ /dev/null @@ -1,1298 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ControlVariableAdjustment extends ethereum.Event { - get params(): ControlVariableAdjustment__Params { - return new ControlVariableAdjustment__Params(this); - } -} - -export class ControlVariableAdjustment__Params { - _event: ControlVariableAdjustment; - - constructor(event: ControlVariableAdjustment) { - this._event = event; - } - - get initialBCV(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get newBCV(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get adjustment(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get addition(): boolean { - return this._event.parameters[3].value.toBoolean(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class FRAXBondV1__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: boolean, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } - - getBuffer(): BigInt { - return this.value3; - } - - getLastBlock(): BigInt { - return this.value4; - } -} - -export class FRAXBondV1__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getPayout(): BigInt { - return this.value0; - } - - getVesting(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getPricePaid(): BigInt { - return this.value3; - } -} - -export class FRAXBondV1__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getFee(): BigInt { - return this.value4; - } - - getMaxDebt(): BigInt { - return this.value5; - } -} - -export class FRAXBondV1 extends ethereum.SmartContract { - static bind(address: Address): FRAXBondV1 { - return new FRAXBondV1("FRAXBondV1", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): FRAXBondV1__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - - return new FRAXBondV1__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new FRAXBondV1__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): FRAXBondV1__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new FRAXBondV1__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new FRAXBondV1__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - currentDebt(): BigInt { - const result = super.call("currentDebt", "currentDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_currentDebt(): ethereum.CallResult { - const result = super.tryCall("currentDebt", "currentDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtDecay(): BigInt { - const result = super.call("debtDecay", "debtDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtDecay(): ethereum.CallResult { - const result = super.tryCall("debtDecay", "debtDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isLiquidityBond(): boolean { - const result = super.call("isLiquidityBond", "isLiquidityBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_isLiquidityBond(): ethereum.CallResult { - const result = super.tryCall( - "isLiquidityBond", - "isLiquidityBond():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - lastDecay(): BigInt { - const result = super.call("lastDecay", "lastDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_lastDecay(): ethereum.CallResult { - const result = super.tryCall("lastDecay", "lastDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - policy(): Address { - const result = super.call("policy", "policy():(address)", []); - - return result[0].toAddress(); - } - - try_policy(): ethereum.CallResult
{ - const result = super.tryCall("policy", "policy():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_recipient: Address, _stake: boolean): BigInt { - const result = super.call("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem( - _recipient: Address, - _stake: boolean - ): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - stakingHelper(): Address { - const result = super.call("stakingHelper", "stakingHelper():(address)", []); - - return result[0].toAddress(); - } - - try_stakingHelper(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingHelper", - "stakingHelper():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - standardizedDebtRatio(): BigInt { - const result = super.call( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_standardizedDebtRatio(): ethereum.CallResult { - const result = super.tryCall( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - terms(): FRAXBondV1__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new FRAXBondV1__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new FRAXBondV1__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - useHelper(): boolean { - const result = super.call("useHelper", "useHelper():(bool)", []); - - return result[0].toBoolean(); - } - - try_useHelper(): ethereum.CallResult { - const result = super.tryCall("useHelper", "useHelper():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _bondCalculator(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class InitializeBondTermsCall extends ethereum.Call { - get inputs(): InitializeBondTermsCall__Inputs { - return new InitializeBondTermsCall__Inputs(this); - } - - get outputs(): InitializeBondTermsCall__Outputs { - return new InitializeBondTermsCall__Outputs(this); - } -} - -export class InitializeBondTermsCall__Inputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } - - get _controlVariable(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _fee(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _maxDebt(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get _initialDebt(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } -} - -export class InitializeBondTermsCall__Outputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _stake(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _buffer(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _parameter(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _input(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _helper(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/LUSDBondV1.ts b/subgraphs/ethereum/generated/BondDiscounts/LUSDBondV1.ts deleted file mode 100644 index d49ea6db..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/LUSDBondV1.ts +++ /dev/null @@ -1,1298 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ControlVariableAdjustment extends ethereum.Event { - get params(): ControlVariableAdjustment__Params { - return new ControlVariableAdjustment__Params(this); - } -} - -export class ControlVariableAdjustment__Params { - _event: ControlVariableAdjustment; - - constructor(event: ControlVariableAdjustment) { - this._event = event; - } - - get initialBCV(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get newBCV(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get adjustment(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get addition(): boolean { - return this._event.parameters[3].value.toBoolean(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class LUSDBondV1__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: boolean, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } - - getBuffer(): BigInt { - return this.value3; - } - - getLastBlock(): BigInt { - return this.value4; - } -} - -export class LUSDBondV1__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getPayout(): BigInt { - return this.value0; - } - - getVesting(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getPricePaid(): BigInt { - return this.value3; - } -} - -export class LUSDBondV1__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getFee(): BigInt { - return this.value4; - } - - getMaxDebt(): BigInt { - return this.value5; - } -} - -export class LUSDBondV1 extends ethereum.SmartContract { - static bind(address: Address): LUSDBondV1 { - return new LUSDBondV1("LUSDBondV1", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): LUSDBondV1__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - - return new LUSDBondV1__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new LUSDBondV1__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): LUSDBondV1__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new LUSDBondV1__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new LUSDBondV1__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - currentDebt(): BigInt { - const result = super.call("currentDebt", "currentDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_currentDebt(): ethereum.CallResult { - const result = super.tryCall("currentDebt", "currentDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtDecay(): BigInt { - const result = super.call("debtDecay", "debtDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtDecay(): ethereum.CallResult { - const result = super.tryCall("debtDecay", "debtDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isLiquidityBond(): boolean { - const result = super.call("isLiquidityBond", "isLiquidityBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_isLiquidityBond(): ethereum.CallResult { - const result = super.tryCall( - "isLiquidityBond", - "isLiquidityBond():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - lastDecay(): BigInt { - const result = super.call("lastDecay", "lastDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_lastDecay(): ethereum.CallResult { - const result = super.tryCall("lastDecay", "lastDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - policy(): Address { - const result = super.call("policy", "policy():(address)", []); - - return result[0].toAddress(); - } - - try_policy(): ethereum.CallResult
{ - const result = super.tryCall("policy", "policy():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_recipient: Address, _stake: boolean): BigInt { - const result = super.call("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem( - _recipient: Address, - _stake: boolean - ): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - stakingHelper(): Address { - const result = super.call("stakingHelper", "stakingHelper():(address)", []); - - return result[0].toAddress(); - } - - try_stakingHelper(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingHelper", - "stakingHelper():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - standardizedDebtRatio(): BigInt { - const result = super.call( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_standardizedDebtRatio(): ethereum.CallResult { - const result = super.tryCall( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - terms(): LUSDBondV1__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new LUSDBondV1__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new LUSDBondV1__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - useHelper(): boolean { - const result = super.call("useHelper", "useHelper():(bool)", []); - - return result[0].toBoolean(); - } - - try_useHelper(): ethereum.CallResult { - const result = super.tryCall("useHelper", "useHelper():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _bondCalculator(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class InitializeBondTermsCall extends ethereum.Call { - get inputs(): InitializeBondTermsCall__Inputs { - return new InitializeBondTermsCall__Inputs(this); - } - - get outputs(): InitializeBondTermsCall__Outputs { - return new InitializeBondTermsCall__Outputs(this); - } -} - -export class InitializeBondTermsCall__Inputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } - - get _controlVariable(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _fee(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _maxDebt(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get _initialDebt(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } -} - -export class InitializeBondTermsCall__Outputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _stake(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _buffer(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _parameter(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _input(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _helper(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/OHMDAIBondV1.ts b/subgraphs/ethereum/generated/BondDiscounts/OHMDAIBondV1.ts deleted file mode 100644 index 107de93c..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/OHMDAIBondV1.ts +++ /dev/null @@ -1,1018 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OHMDAIBondV1__depositorInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getPrincipleValue(): BigInt { - return this.value0; - } - - getPayoutRemaining(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getVestingPeriod(): BigInt { - return this.value3; - } -} - -export class OHMDAIBondV1__getDepositorInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - get_principleValue(): BigInt { - return this.value0; - } - - get_payoutRemaining(): BigInt { - return this.value1; - } - - get_lastBlock(): BigInt { - return this.value2; - } - - get_vestingPeriod(): BigInt { - return this.value3; - } -} - -export class OHMDAIBondV1 extends ethereum.SmartContract { - static bind(address: Address): OHMDAIBondV1 { - return new OHMDAIBondV1("OHMDAIBondV1", address); - } - - DAOShare(): BigInt { - const result = super.call("DAOShare", "DAOShare():(uint256)", []); - - return result[0].toBigInt(); - } - - try_DAOShare(): ethereum.CallResult { - const result = super.tryCall("DAOShare", "DAOShare():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - DAOWallet(): Address { - const result = super.call("DAOWallet", "DAOWallet():(address)", []); - - return result[0].toAddress(); - } - - try_DAOWallet(): ethereum.CallResult
{ - const result = super.tryCall("DAOWallet", "DAOWallet():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondControlVariable(): BigInt { - const result = super.call( - "bondControlVariable", - "bondControlVariable():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_bondControlVariable(): ethereum.CallResult { - const result = super.tryCall( - "bondControlVariable", - "bondControlVariable():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculateBondInterest(amountToDeposit_: BigInt): BigInt { - const result = super.call( - "calculateBondInterest", - "calculateBondInterest(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amountToDeposit_)] - ); - - return result[0].toBigInt(); - } - - try_calculateBondInterest( - amountToDeposit_: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "calculateBondInterest", - "calculateBondInterest(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amountToDeposit_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculatePendingPayout(depositor_: Address): BigInt { - const result = super.call( - "calculatePendingPayout", - "calculatePendingPayout(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - - return result[0].toBigInt(); - } - - try_calculatePendingPayout(depositor_: Address): ethereum.CallResult { - const result = super.tryCall( - "calculatePendingPayout", - "calculatePendingPayout(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculatePercentVested(depositor_: Address): BigInt { - const result = super.call( - "calculatePercentVested", - "calculatePercentVested(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - - return result[0].toBigInt(); - } - - try_calculatePercentVested(depositor_: Address): ethereum.CallResult { - const result = super.tryCall( - "calculatePercentVested", - "calculatePercentVested(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculatePremium(): BigInt { - const result = super.call( - "calculatePremium", - "calculatePremium():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_calculatePremium(): ethereum.CallResult { - const result = super.tryCall( - "calculatePremium", - "calculatePremium():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - depositBondPrinciple(amountToDeposit_: BigInt): boolean { - const result = super.call( - "depositBondPrinciple", - "depositBondPrinciple(uint256):(bool)", - [ethereum.Value.fromUnsignedBigInt(amountToDeposit_)] - ); - - return result[0].toBoolean(); - } - - try_depositBondPrinciple( - amountToDeposit_: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "depositBondPrinciple", - "depositBondPrinciple(uint256):(bool)", - [ethereum.Value.fromUnsignedBigInt(amountToDeposit_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - depositBondPrincipleWithPermit( - amountToDeposit_: BigInt, - deadline: BigInt, - v: i32, - r: Bytes, - s: Bytes - ): boolean { - const result = super.call( - "depositBondPrincipleWithPermit", - "depositBondPrincipleWithPermit(uint256,uint256,uint8,bytes32,bytes32):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(amountToDeposit_), - ethereum.Value.fromUnsignedBigInt(deadline), - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(v)), - ethereum.Value.fromFixedBytes(r), - ethereum.Value.fromFixedBytes(s) - ] - ); - - return result[0].toBoolean(); - } - - try_depositBondPrincipleWithPermit( - amountToDeposit_: BigInt, - deadline: BigInt, - v: i32, - r: Bytes, - s: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "depositBondPrincipleWithPermit", - "depositBondPrincipleWithPermit(uint256,uint256,uint8,bytes32,bytes32):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(amountToDeposit_), - ethereum.Value.fromUnsignedBigInt(deadline), - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(v)), - ethereum.Value.fromFixedBytes(r), - ethereum.Value.fromFixedBytes(s) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - depositorInfo(param0: Address): OHMDAIBondV1__depositorInfoResult { - const result = super.call( - "depositorInfo", - "depositorInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new OHMDAIBondV1__depositorInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_depositorInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "depositorInfo", - "depositorInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMDAIBondV1__depositorInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - getDepositorInfo( - depositorAddress_: Address - ): OHMDAIBondV1__getDepositorInfoResult { - const result = super.call( - "getDepositorInfo", - "getDepositorInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(depositorAddress_)] - ); - - return new OHMDAIBondV1__getDepositorInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_getDepositorInfo( - depositorAddress_: Address - ): ethereum.CallResult { - const result = super.tryCall( - "getDepositorInfo", - "getDepositorInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(depositorAddress_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMDAIBondV1__getDepositorInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - initialize(principleToken_: Address, OHM_: Address): boolean { - const result = super.call( - "initialize", - "initialize(address,address):(bool)", - [ - ethereum.Value.fromAddress(principleToken_), - ethereum.Value.fromAddress(OHM_) - ] - ); - - return result[0].toBoolean(); - } - - try_initialize( - principleToken_: Address, - OHM_: Address - ): ethereum.CallResult { - const result = super.tryCall( - "initialize", - "initialize(address,address):(bool)", - [ - ethereum.Value.fromAddress(principleToken_), - ethereum.Value.fromAddress(OHM_) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - isInitialized(): boolean { - const result = super.call("isInitialized", "isInitialized():(bool)", []); - - return result[0].toBoolean(); - } - - try_isInitialized(): ethereum.CallResult { - const result = super.tryCall("isInitialized", "isInitialized():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - minPremium(): BigInt { - const result = super.call("minPremium", "minPremium():(uint256)", []); - - return result[0].toBigInt(); - } - - try_minPremium(): ethereum.CallResult { - const result = super.tryCall("minPremium", "minPremium():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - owner(): Address { - const result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - const result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - principleToken(): Address { - const result = super.call("principleToken", "principleToken():(address)", []); - - return result[0].toAddress(); - } - - try_principleToken(): ethereum.CallResult
{ - const result = super.tryCall( - "principleToken", - "principleToken():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - redeemBond(): boolean { - const result = super.call("redeemBond", "redeemBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_redeemBond(): ethereum.CallResult { - const result = super.tryCall("redeemBond", "redeemBond():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - setAddresses( - bondCalculator_: Address, - treasury_: Address, - stakingContract_: Address, - DAOWallet_: Address, - DAOShare_: BigInt - ): boolean { - const result = super.call( - "setAddresses", - "setAddresses(address,address,address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(bondCalculator_), - ethereum.Value.fromAddress(treasury_), - ethereum.Value.fromAddress(stakingContract_), - ethereum.Value.fromAddress(DAOWallet_), - ethereum.Value.fromUnsignedBigInt(DAOShare_) - ] - ); - - return result[0].toBoolean(); - } - - try_setAddresses( - bondCalculator_: Address, - treasury_: Address, - stakingContract_: Address, - DAOWallet_: Address, - DAOShare_: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "setAddresses", - "setAddresses(address,address,address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(bondCalculator_), - ethereum.Value.fromAddress(treasury_), - ethereum.Value.fromAddress(stakingContract_), - ethereum.Value.fromAddress(DAOWallet_), - ethereum.Value.fromUnsignedBigInt(DAOShare_) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - setBondTerms( - bondControlVariable_: BigInt, - vestingPeriodInBlocks_: BigInt, - minPremium_: BigInt - ): boolean { - const result = super.call( - "setBondTerms", - "setBondTerms(uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(bondControlVariable_), - ethereum.Value.fromUnsignedBigInt(vestingPeriodInBlocks_), - ethereum.Value.fromUnsignedBigInt(minPremium_) - ] - ); - - return result[0].toBoolean(); - } - - try_setBondTerms( - bondControlVariable_: BigInt, - vestingPeriodInBlocks_: BigInt, - minPremium_: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "setBondTerms", - "setBondTerms(uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(bondControlVariable_), - ethereum.Value.fromUnsignedBigInt(vestingPeriodInBlocks_), - ethereum.Value.fromUnsignedBigInt(minPremium_) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - stakingContract(): Address { - const result = super.call( - "stakingContract", - "stakingContract():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_stakingContract(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingContract", - "stakingContract():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - vestingPeriodInBlocks(): BigInt { - const result = super.call( - "vestingPeriodInBlocks", - "vestingPeriodInBlocks():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_vestingPeriodInBlocks(): ethereum.CallResult { - const result = super.tryCall( - "vestingPeriodInBlocks", - "vestingPeriodInBlocks():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class DepositBondPrincipleCall extends ethereum.Call { - get inputs(): DepositBondPrincipleCall__Inputs { - return new DepositBondPrincipleCall__Inputs(this); - } - - get outputs(): DepositBondPrincipleCall__Outputs { - return new DepositBondPrincipleCall__Outputs(this); - } -} - -export class DepositBondPrincipleCall__Inputs { - _call: DepositBondPrincipleCall; - - constructor(call: DepositBondPrincipleCall) { - this._call = call; - } - - get amountToDeposit_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class DepositBondPrincipleCall__Outputs { - _call: DepositBondPrincipleCall; - - constructor(call: DepositBondPrincipleCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DepositBondPrincipleWithPermitCall extends ethereum.Call { - get inputs(): DepositBondPrincipleWithPermitCall__Inputs { - return new DepositBondPrincipleWithPermitCall__Inputs(this); - } - - get outputs(): DepositBondPrincipleWithPermitCall__Outputs { - return new DepositBondPrincipleWithPermitCall__Outputs(this); - } -} - -export class DepositBondPrincipleWithPermitCall__Inputs { - _call: DepositBondPrincipleWithPermitCall; - - constructor(call: DepositBondPrincipleWithPermitCall) { - this._call = call; - } - - get amountToDeposit_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[2].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[4].value.toBytes(); - } -} - -export class DepositBondPrincipleWithPermitCall__Outputs { - _call: DepositBondPrincipleWithPermitCall; - - constructor(call: DepositBondPrincipleWithPermitCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get principleToken_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get OHM_(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemBondCall extends ethereum.Call { - get inputs(): RedeemBondCall__Inputs { - return new RedeemBondCall__Inputs(this); - } - - get outputs(): RedeemBondCall__Outputs { - return new RedeemBondCall__Outputs(this); - } -} - -export class RedeemBondCall__Inputs { - _call: RedeemBondCall; - - constructor(call: RedeemBondCall) { - this._call = call; - } -} - -export class RedeemBondCall__Outputs { - _call: RedeemBondCall; - - constructor(call: RedeemBondCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RenounceOwnershipCall extends ethereum.Call { - get inputs(): RenounceOwnershipCall__Inputs { - return new RenounceOwnershipCall__Inputs(this); - } - - get outputs(): RenounceOwnershipCall__Outputs { - return new RenounceOwnershipCall__Outputs(this); - } -} - -export class RenounceOwnershipCall__Inputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall__Outputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class SetAddressesCall extends ethereum.Call { - get inputs(): SetAddressesCall__Inputs { - return new SetAddressesCall__Inputs(this); - } - - get outputs(): SetAddressesCall__Outputs { - return new SetAddressesCall__Outputs(this); - } -} - -export class SetAddressesCall__Inputs { - _call: SetAddressesCall; - - constructor(call: SetAddressesCall) { - this._call = call; - } - - get bondCalculator_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get treasury_(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get stakingContract_(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get DAOWallet_(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get DAOShare_(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } -} - -export class SetAddressesCall__Outputs { - _call: SetAddressesCall; - - constructor(call: SetAddressesCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get bondControlVariable_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get vestingPeriodInBlocks_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get minPremium_(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/OHMDAIBondV2.ts b/subgraphs/ethereum/generated/BondDiscounts/OHMDAIBondV2.ts deleted file mode 100644 index 355c07ac..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/OHMDAIBondV2.ts +++ /dev/null @@ -1,953 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OHMDAIBondV2__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getValueRemaining(): BigInt { - return this.value0; - } - - getPayoutRemaining(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getVestingPeriod(): BigInt { - return this.value3; - } - - getPricePaid(): BigInt { - return this.value4; - } -} - -export class OHMDAIBondV2 extends ethereum.SmartContract { - static bind(address: Address): OHMDAIBondV2 { - return new OHMDAIBondV2("OHMDAIBondV2", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - DAOShare(): BigInt { - const result = super.call("DAOShare", "DAOShare():(uint256)", []); - - return result[0].toBigInt(); - } - - try_DAOShare(): ethereum.CallResult { - const result = super.tryCall("DAOShare", "DAOShare():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - LP(): Address { - const result = super.call("LP", "LP():(address)", []); - - return result[0].toAddress(); - } - - try_LP(): ethereum.CallResult
{ - const result = super.tryCall("LP", "LP():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): OHMDAIBondV2__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new OHMDAIBondV2__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMDAIBondV2__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInDAI(): BigInt { - const result = super.call("bondPriceInDAI", "bondPriceInDAI():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInDAI(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInDAI", - "bondPriceInDAI():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceWithoutFloor(): BigInt { - const result = super.call( - "bondPriceWithoutFloor", - "bondPriceWithoutFloor():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_bondPriceWithoutFloor(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceWithoutFloor", - "bondPriceWithoutFloor():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - circulatingOHMContract(): Address { - const result = super.call( - "circulatingOHMContract", - "circulatingOHMContract():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_circulatingOHMContract(): ethereum.CallResult
{ - const result = super.tryCall( - "circulatingOHMContract", - "circulatingOHMContract():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - controlVariable(): BigInt { - const result = super.call( - "controlVariable", - "controlVariable():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_controlVariable(): ethereum.CallResult { - const result = super.tryCall( - "controlVariable", - "controlVariable():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(amount_: BigInt, maxPremium_: BigInt, depositor_: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(amount_), - ethereum.Value.fromUnsignedBigInt(maxPremium_), - ethereum.Value.fromAddress(depositor_) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - amount_: BigInt, - maxPremium_: BigInt, - depositor_: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(amount_), - ethereum.Value.fromUnsignedBigInt(maxPremium_), - ethereum.Value.fromAddress(depositor_) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - distributor(): Address { - const result = super.call("distributor", "distributor():(address)", []); - - return result[0].toAddress(); - } - - try_distributor(): ethereum.CallResult
{ - const result = super.tryCall("distributor", "distributor():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - manager(): Address { - const result = super.call("manager", "manager():(address)", []); - - return result[0].toAddress(); - } - - try_manager(): ethereum.CallResult
{ - const result = super.tryCall("manager", "manager():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxPayoutPercent(): BigInt { - const result = super.call( - "maxPayoutPercent", - "maxPayoutPercent():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_maxPayoutPercent(): ethereum.CallResult { - const result = super.tryCall( - "maxPayoutPercent", - "maxPayoutPercent():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - minimumPrice(): BigInt { - const result = super.call("minimumPrice", "minimumPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_minimumPrice(): ethereum.CallResult { - const result = super.tryCall("minimumPrice", "minimumPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(value_: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(value_) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(value_: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(value_) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(depositor_: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(depositor_: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(depositor_: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(depositor_: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - recoverLostToken(token_: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(token_)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(token_: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(token_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(): BigInt { - const result = super.call("redeem", "redeem():(uint256)", []); - - return result[0].toBigInt(); - } - - try_redeem(): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - setBondTerm( - controlVariable_: BigInt, - vestingTerm_: BigInt, - minPrice_: BigInt, - maxPayout_: BigInt, - DAOShare_: BigInt - ): boolean { - const result = super.call( - "setBondTerm", - "setBondTerm(uint256,uint256,uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(controlVariable_), - ethereum.Value.fromUnsignedBigInt(vestingTerm_), - ethereum.Value.fromUnsignedBigInt(minPrice_), - ethereum.Value.fromUnsignedBigInt(maxPayout_), - ethereum.Value.fromUnsignedBigInt(DAOShare_) - ] - ); - - return result[0].toBoolean(); - } - - try_setBondTerm( - controlVariable_: BigInt, - vestingTerm_: BigInt, - minPrice_: BigInt, - maxPayout_: BigInt, - DAOShare_: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "setBondTerm", - "setBondTerm(uint256,uint256,uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(controlVariable_), - ethereum.Value.fromUnsignedBigInt(vestingTerm_), - ethereum.Value.fromUnsignedBigInt(minPrice_), - ethereum.Value.fromUnsignedBigInt(maxPayout_), - ethereum.Value.fromUnsignedBigInt(DAOShare_) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - vestingTerm(): BigInt { - const result = super.call("vestingTerm", "vestingTerm():(uint256)", []); - - return result[0].toBigInt(); - } - - try_vestingTerm(): ethereum.CallResult { - const result = super.tryCall("vestingTerm", "vestingTerm():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get OHM_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get LP_(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get treasury_(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get distributor_(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get DAO_(): Address { - return this._call.inputValues[4].value.toAddress(); - } - - get circulatingOHMContract_(): Address { - return this._call.inputValues[5].value.toAddress(); - } - - get bondCalculator_(): Address { - return this._call.inputValues[6].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get amount_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get maxPremium_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get depositor_(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get token_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetBondTermCall extends ethereum.Call { - get inputs(): SetBondTermCall__Inputs { - return new SetBondTermCall__Inputs(this); - } - - get outputs(): SetBondTermCall__Outputs { - return new SetBondTermCall__Outputs(this); - } -} - -export class SetBondTermCall__Inputs { - _call: SetBondTermCall; - - constructor(call: SetBondTermCall) { - this._call = call; - } - - get controlVariable_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get vestingTerm_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get minPrice_(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get maxPayout_(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get DAOShare_(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } -} - -export class SetBondTermCall__Outputs { - _call: SetBondTermCall; - - constructor(call: SetBondTermCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/OHMDAIBondV3.ts b/subgraphs/ethereum/generated/BondDiscounts/OHMDAIBondV3.ts deleted file mode 100644 index 168e4aba..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/OHMDAIBondV3.ts +++ /dev/null @@ -1,1158 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get payout(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OHMDAIBondV3__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } -} - -export class OHMDAIBondV3__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getValueRemaining(): BigInt { - return this.value0; - } - - getPayoutRemaining(): BigInt { - return this.value1; - } - - getVestingPeriod(): BigInt { - return this.value2; - } - - getLastBlock(): BigInt { - return this.value3; - } - - getPricePaid(): BigInt { - return this.value4; - } -} - -export class OHMDAIBondV3__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getFee(): BigInt { - return this.value4; - } -} - -export class OHMDAIBondV3 extends ethereum.SmartContract { - static bind(address: Address): OHMDAIBondV3 { - return new OHMDAIBondV3("OHMDAIBondV3", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): OHMDAIBondV3__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256)", - [] - ); - - return new OHMDAIBondV3__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMDAIBondV3__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): OHMDAIBondV3__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new OHMDAIBondV3__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMDAIBondV3__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isLiquidityBond(): boolean { - const result = super.call("isLiquidityBond", "isLiquidityBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_isLiquidityBond(): ethereum.CallResult { - const result = super.tryCall( - "isLiquidityBond", - "isLiquidityBond():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - manager(): Address { - const result = super.call("manager", "manager():(address)", []); - - return result[0].toAddress(); - } - - try_manager(): ethereum.CallResult
{ - const result = super.tryCall("manager", "manager():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_stake: boolean): BigInt { - const result = super.call("redeem", "redeem(bool):(uint256)", [ - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem(_stake: boolean): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(bool):(uint256)", [ - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - setBondTerms( - _vestingTerm: BigInt, - _minimumPrice: BigInt, - _maxPayout: BigInt, - _fee: BigInt - ): boolean { - const result = super.call( - "setBondTerms", - "setBondTerms(uint256,uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(_vestingTerm), - ethereum.Value.fromUnsignedBigInt(_minimumPrice), - ethereum.Value.fromUnsignedBigInt(_maxPayout), - ethereum.Value.fromUnsignedBigInt(_fee) - ] - ); - - return result[0].toBoolean(); - } - - try_setBondTerms( - _vestingTerm: BigInt, - _minimumPrice: BigInt, - _maxPayout: BigInt, - _fee: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "setBondTerms", - "setBondTerms(uint256,uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(_vestingTerm), - ethereum.Value.fromUnsignedBigInt(_minimumPrice), - ethereum.Value.fromUnsignedBigInt(_maxPayout), - ethereum.Value.fromUnsignedBigInt(_fee) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - setStaking(_staking: Address): boolean { - const result = super.call("setStaking", "setStaking(address):(bool)", [ - ethereum.Value.fromAddress(_staking) - ]); - - return result[0].toBoolean(); - } - - try_setStaking(_staking: Address): ethereum.CallResult { - const result = super.tryCall("setStaking", "setStaking(address):(bool)", [ - ethereum.Value.fromAddress(_staking) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - terms(): OHMDAIBondV3__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new OHMDAIBondV3__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMDAIBondV3__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _bondCalculator(): Address { - return this._call.inputValues[4].value.toAddress(); - } - - get _controlVariable(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _stake(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _fee(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/OHMDAIBondV4.ts b/subgraphs/ethereum/generated/BondDiscounts/OHMDAIBondV4.ts deleted file mode 100644 index 90b5128f..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/OHMDAIBondV4.ts +++ /dev/null @@ -1,1298 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ControlVariableAdjustment extends ethereum.Event { - get params(): ControlVariableAdjustment__Params { - return new ControlVariableAdjustment__Params(this); - } -} - -export class ControlVariableAdjustment__Params { - _event: ControlVariableAdjustment; - - constructor(event: ControlVariableAdjustment) { - this._event = event; - } - - get initialBCV(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get newBCV(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get adjustment(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get addition(): boolean { - return this._event.parameters[3].value.toBoolean(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OHMDAIBondV4__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: boolean, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } - - getBuffer(): BigInt { - return this.value3; - } - - getLastBlock(): BigInt { - return this.value4; - } -} - -export class OHMDAIBondV4__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getPayout(): BigInt { - return this.value0; - } - - getVesting(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getPricePaid(): BigInt { - return this.value3; - } -} - -export class OHMDAIBondV4__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getFee(): BigInt { - return this.value4; - } - - getMaxDebt(): BigInt { - return this.value5; - } -} - -export class OHMDAIBondV4 extends ethereum.SmartContract { - static bind(address: Address): OHMDAIBondV4 { - return new OHMDAIBondV4("OHMDAIBondV4", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): OHMDAIBondV4__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - - return new OHMDAIBondV4__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMDAIBondV4__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): OHMDAIBondV4__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new OHMDAIBondV4__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMDAIBondV4__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - currentDebt(): BigInt { - const result = super.call("currentDebt", "currentDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_currentDebt(): ethereum.CallResult { - const result = super.tryCall("currentDebt", "currentDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtDecay(): BigInt { - const result = super.call("debtDecay", "debtDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtDecay(): ethereum.CallResult { - const result = super.tryCall("debtDecay", "debtDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isLiquidityBond(): boolean { - const result = super.call("isLiquidityBond", "isLiquidityBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_isLiquidityBond(): ethereum.CallResult { - const result = super.tryCall( - "isLiquidityBond", - "isLiquidityBond():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - lastDecay(): BigInt { - const result = super.call("lastDecay", "lastDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_lastDecay(): ethereum.CallResult { - const result = super.tryCall("lastDecay", "lastDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - policy(): Address { - const result = super.call("policy", "policy():(address)", []); - - return result[0].toAddress(); - } - - try_policy(): ethereum.CallResult
{ - const result = super.tryCall("policy", "policy():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_recipient: Address, _stake: boolean): BigInt { - const result = super.call("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem( - _recipient: Address, - _stake: boolean - ): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - stakingHelper(): Address { - const result = super.call("stakingHelper", "stakingHelper():(address)", []); - - return result[0].toAddress(); - } - - try_stakingHelper(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingHelper", - "stakingHelper():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - standardizedDebtRatio(): BigInt { - const result = super.call( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_standardizedDebtRatio(): ethereum.CallResult { - const result = super.tryCall( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - terms(): OHMDAIBondV4__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new OHMDAIBondV4__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMDAIBondV4__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - useHelper(): boolean { - const result = super.call("useHelper", "useHelper():(bool)", []); - - return result[0].toBoolean(); - } - - try_useHelper(): ethereum.CallResult { - const result = super.tryCall("useHelper", "useHelper():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _bondCalculator(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class InitializeBondTermsCall extends ethereum.Call { - get inputs(): InitializeBondTermsCall__Inputs { - return new InitializeBondTermsCall__Inputs(this); - } - - get outputs(): InitializeBondTermsCall__Outputs { - return new InitializeBondTermsCall__Outputs(this); - } -} - -export class InitializeBondTermsCall__Inputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } - - get _controlVariable(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _fee(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _maxDebt(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get _initialDebt(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } -} - -export class InitializeBondTermsCall__Outputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _stake(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _buffer(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _parameter(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _input(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _helper(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/OHMFRAXBondV1.ts b/subgraphs/ethereum/generated/BondDiscounts/OHMFRAXBondV1.ts deleted file mode 100644 index 432e0591..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/OHMFRAXBondV1.ts +++ /dev/null @@ -1,1132 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get payout(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OHMFRAXBondV1__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } -} - -export class OHMFRAXBondV1__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getValueRemaining(): BigInt { - return this.value0; - } - - getPayoutRemaining(): BigInt { - return this.value1; - } - - getVestingPeriod(): BigInt { - return this.value2; - } - - getLastBlock(): BigInt { - return this.value3; - } - - getPricePaid(): BigInt { - return this.value4; - } -} - -export class OHMFRAXBondV1__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getFee(): BigInt { - return this.value4; - } - - getMaxDebt(): BigInt { - return this.value5; - } -} - -export class OHMFRAXBondV1 extends ethereum.SmartContract { - static bind(address: Address): OHMFRAXBondV1 { - return new OHMFRAXBondV1("OHMFRAXBondV1", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): OHMFRAXBondV1__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256)", - [] - ); - - return new OHMFRAXBondV1__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMFRAXBondV1__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): OHMFRAXBondV1__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new OHMFRAXBondV1__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMFRAXBondV1__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isLiquidityBond(): boolean { - const result = super.call("isLiquidityBond", "isLiquidityBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_isLiquidityBond(): ethereum.CallResult { - const result = super.tryCall( - "isLiquidityBond", - "isLiquidityBond():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - manager(): Address { - const result = super.call("manager", "manager():(address)", []); - - return result[0].toAddress(); - } - - try_manager(): ethereum.CallResult
{ - const result = super.tryCall("manager", "manager():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_stake: boolean): BigInt { - const result = super.call("redeem", "redeem(bool):(uint256)", [ - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem(_stake: boolean): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(bool):(uint256)", [ - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - terms(): OHMFRAXBondV1__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new OHMFRAXBondV1__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMFRAXBondV1__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _bondCalculator(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class InitializeBondTermsCall extends ethereum.Call { - get inputs(): InitializeBondTermsCall__Inputs { - return new InitializeBondTermsCall__Inputs(this); - } - - get outputs(): InitializeBondTermsCall__Outputs { - return new InitializeBondTermsCall__Outputs(this); - } -} - -export class InitializeBondTermsCall__Inputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } - - get _controlVariable(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _fee(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _maxDebt(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } -} - -export class InitializeBondTermsCall__Outputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _stake(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _parameter(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _input(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/OHMFRAXBondV2.ts b/subgraphs/ethereum/generated/BondDiscounts/OHMFRAXBondV2.ts deleted file mode 100644 index 634d0641..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/OHMFRAXBondV2.ts +++ /dev/null @@ -1,1298 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ControlVariableAdjustment extends ethereum.Event { - get params(): ControlVariableAdjustment__Params { - return new ControlVariableAdjustment__Params(this); - } -} - -export class ControlVariableAdjustment__Params { - _event: ControlVariableAdjustment; - - constructor(event: ControlVariableAdjustment) { - this._event = event; - } - - get initialBCV(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get newBCV(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get adjustment(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get addition(): boolean { - return this._event.parameters[3].value.toBoolean(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OHMFRAXBondV2__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: boolean, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } - - getBuffer(): BigInt { - return this.value3; - } - - getLastBlock(): BigInt { - return this.value4; - } -} - -export class OHMFRAXBondV2__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getPayout(): BigInt { - return this.value0; - } - - getVesting(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getPricePaid(): BigInt { - return this.value3; - } -} - -export class OHMFRAXBondV2__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getFee(): BigInt { - return this.value4; - } - - getMaxDebt(): BigInt { - return this.value5; - } -} - -export class OHMFRAXBondV2 extends ethereum.SmartContract { - static bind(address: Address): OHMFRAXBondV2 { - return new OHMFRAXBondV2("OHMFRAXBondV2", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): OHMFRAXBondV2__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - - return new OHMFRAXBondV2__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMFRAXBondV2__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): OHMFRAXBondV2__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new OHMFRAXBondV2__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMFRAXBondV2__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - currentDebt(): BigInt { - const result = super.call("currentDebt", "currentDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_currentDebt(): ethereum.CallResult { - const result = super.tryCall("currentDebt", "currentDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtDecay(): BigInt { - const result = super.call("debtDecay", "debtDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtDecay(): ethereum.CallResult { - const result = super.tryCall("debtDecay", "debtDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isLiquidityBond(): boolean { - const result = super.call("isLiquidityBond", "isLiquidityBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_isLiquidityBond(): ethereum.CallResult { - const result = super.tryCall( - "isLiquidityBond", - "isLiquidityBond():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - lastDecay(): BigInt { - const result = super.call("lastDecay", "lastDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_lastDecay(): ethereum.CallResult { - const result = super.tryCall("lastDecay", "lastDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - policy(): Address { - const result = super.call("policy", "policy():(address)", []); - - return result[0].toAddress(); - } - - try_policy(): ethereum.CallResult
{ - const result = super.tryCall("policy", "policy():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_recipient: Address, _stake: boolean): BigInt { - const result = super.call("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem( - _recipient: Address, - _stake: boolean - ): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - stakingHelper(): Address { - const result = super.call("stakingHelper", "stakingHelper():(address)", []); - - return result[0].toAddress(); - } - - try_stakingHelper(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingHelper", - "stakingHelper():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - standardizedDebtRatio(): BigInt { - const result = super.call( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_standardizedDebtRatio(): ethereum.CallResult { - const result = super.tryCall( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - terms(): OHMFRAXBondV2__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new OHMFRAXBondV2__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMFRAXBondV2__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - useHelper(): boolean { - const result = super.call("useHelper", "useHelper():(bool)", []); - - return result[0].toBoolean(); - } - - try_useHelper(): ethereum.CallResult { - const result = super.tryCall("useHelper", "useHelper():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _bondCalculator(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class InitializeBondTermsCall extends ethereum.Call { - get inputs(): InitializeBondTermsCall__Inputs { - return new InitializeBondTermsCall__Inputs(this); - } - - get outputs(): InitializeBondTermsCall__Outputs { - return new InitializeBondTermsCall__Outputs(this); - } -} - -export class InitializeBondTermsCall__Inputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } - - get _controlVariable(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _fee(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _maxDebt(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get _initialDebt(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } -} - -export class InitializeBondTermsCall__Outputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _stake(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _buffer(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _parameter(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _input(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _helper(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/OHMLUSDBondV1.ts b/subgraphs/ethereum/generated/BondDiscounts/OHMLUSDBondV1.ts deleted file mode 100644 index 10e765fe..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/OHMLUSDBondV1.ts +++ /dev/null @@ -1,1298 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ControlVariableAdjustment extends ethereum.Event { - get params(): ControlVariableAdjustment__Params { - return new ControlVariableAdjustment__Params(this); - } -} - -export class ControlVariableAdjustment__Params { - _event: ControlVariableAdjustment; - - constructor(event: ControlVariableAdjustment) { - this._event = event; - } - - get initialBCV(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get newBCV(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get adjustment(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get addition(): boolean { - return this._event.parameters[3].value.toBoolean(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OHMLUSDBondV1__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: boolean, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } - - getBuffer(): BigInt { - return this.value3; - } - - getLastBlock(): BigInt { - return this.value4; - } -} - -export class OHMLUSDBondV1__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getPayout(): BigInt { - return this.value0; - } - - getVesting(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getPricePaid(): BigInt { - return this.value3; - } -} - -export class OHMLUSDBondV1__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getFee(): BigInt { - return this.value4; - } - - getMaxDebt(): BigInt { - return this.value5; - } -} - -export class OHMLUSDBondV1 extends ethereum.SmartContract { - static bind(address: Address): OHMLUSDBondV1 { - return new OHMLUSDBondV1("OHMLUSDBondV1", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): OHMLUSDBondV1__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - - return new OHMLUSDBondV1__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMLUSDBondV1__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): OHMLUSDBondV1__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new OHMLUSDBondV1__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMLUSDBondV1__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - currentDebt(): BigInt { - const result = super.call("currentDebt", "currentDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_currentDebt(): ethereum.CallResult { - const result = super.tryCall("currentDebt", "currentDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtDecay(): BigInt { - const result = super.call("debtDecay", "debtDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtDecay(): ethereum.CallResult { - const result = super.tryCall("debtDecay", "debtDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isLiquidityBond(): boolean { - const result = super.call("isLiquidityBond", "isLiquidityBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_isLiquidityBond(): ethereum.CallResult { - const result = super.tryCall( - "isLiquidityBond", - "isLiquidityBond():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - lastDecay(): BigInt { - const result = super.call("lastDecay", "lastDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_lastDecay(): ethereum.CallResult { - const result = super.tryCall("lastDecay", "lastDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - policy(): Address { - const result = super.call("policy", "policy():(address)", []); - - return result[0].toAddress(); - } - - try_policy(): ethereum.CallResult
{ - const result = super.tryCall("policy", "policy():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_recipient: Address, _stake: boolean): BigInt { - const result = super.call("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem( - _recipient: Address, - _stake: boolean - ): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - stakingHelper(): Address { - const result = super.call("stakingHelper", "stakingHelper():(address)", []); - - return result[0].toAddress(); - } - - try_stakingHelper(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingHelper", - "stakingHelper():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - standardizedDebtRatio(): BigInt { - const result = super.call( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_standardizedDebtRatio(): ethereum.CallResult { - const result = super.tryCall( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - terms(): OHMLUSDBondV1__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new OHMLUSDBondV1__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMLUSDBondV1__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - useHelper(): boolean { - const result = super.call("useHelper", "useHelper():(bool)", []); - - return result[0].toBoolean(); - } - - try_useHelper(): ethereum.CallResult { - const result = super.tryCall("useHelper", "useHelper():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _bondCalculator(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class InitializeBondTermsCall extends ethereum.Call { - get inputs(): InitializeBondTermsCall__Inputs { - return new InitializeBondTermsCall__Inputs(this); - } - - get outputs(): InitializeBondTermsCall__Outputs { - return new InitializeBondTermsCall__Outputs(this); - } -} - -export class InitializeBondTermsCall__Inputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } - - get _controlVariable(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _fee(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _maxDebt(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get _initialDebt(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } -} - -export class InitializeBondTermsCall__Outputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _stake(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _buffer(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _parameter(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _input(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _helper(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/OlympusERC20.ts b/subgraphs/ethereum/generated/BondDiscounts/OlympusERC20.ts deleted file mode 100644 index d544f05c..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/OlympusERC20.ts +++ /dev/null @@ -1,1184 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class TWAPEpochChanged extends ethereum.Event { - get params(): TWAPEpochChanged__Params { - return new TWAPEpochChanged__Params(this); - } -} - -export class TWAPEpochChanged__Params { - _event: TWAPEpochChanged; - - constructor(event: TWAPEpochChanged) { - this._event = event; - } - - get previousTWAPEpochPeriod(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get newTWAPEpochPeriod(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class TWAPOracleChanged extends ethereum.Event { - get params(): TWAPOracleChanged__Params { - return new TWAPOracleChanged__Params(this); - } -} - -export class TWAPOracleChanged__Params { - _event: TWAPOracleChanged; - - constructor(event: TWAPOracleChanged) { - this._event = event; - } - - get previousTWAPOracle(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newTWAPOracle(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class TWAPSourceAdded extends ethereum.Event { - get params(): TWAPSourceAdded__Params { - return new TWAPSourceAdded__Params(this); - } -} - -export class TWAPSourceAdded__Params { - _event: TWAPSourceAdded; - - constructor(event: TWAPSourceAdded) { - this._event = event; - } - - get newTWAPSource(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class TWAPSourceRemoved extends ethereum.Event { - get params(): TWAPSourceRemoved__Params { - return new TWAPSourceRemoved__Params(this); - } -} - -export class TWAPSourceRemoved__Params { - _event: TWAPSourceRemoved; - - constructor(event: TWAPSourceRemoved) { - this._event = event; - } - - get removedTWAPSource(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class OlympusERC20 extends ethereum.SmartContract { - static bind(address: Address): OlympusERC20 { - return new OlympusERC20("OlympusERC20", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { - const result = super.call( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseAllowance( - spender: Address, - subtractedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - increaseAllowance(spender: Address, addedValue: BigInt): boolean { - const result = super.call( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseAllowance( - spender: Address, - addedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - owner(): Address { - const result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - const result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - setVault(vault_: Address): boolean { - const result = super.call("setVault", "setVault(address):(bool)", [ - ethereum.Value.fromAddress(vault_) - ]); - - return result[0].toBoolean(); - } - - try_setVault(vault_: Address): ethereum.CallResult { - const result = super.tryCall("setVault", "setVault(address):(bool)", [ - ethereum.Value.fromAddress(vault_) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - twapEpochPeriod(): BigInt { - const result = super.call( - "twapEpochPeriod", - "twapEpochPeriod():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_twapEpochPeriod(): ethereum.CallResult { - const result = super.tryCall( - "twapEpochPeriod", - "twapEpochPeriod():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - twapOracle(): Address { - const result = super.call("twapOracle", "twapOracle():(address)", []); - - return result[0].toAddress(); - } - - try_twapOracle(): ethereum.CallResult
{ - const result = super.tryCall("twapOracle", "twapOracle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - vault(): Address { - const result = super.call("vault", "vault():(address)", []); - - return result[0].toAddress(); - } - - try_vault(): ethereum.CallResult
{ - const result = super.tryCall("vault", "vault():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class _burnFromCall extends ethereum.Call { - get inputs(): _burnFromCall__Inputs { - return new _burnFromCall__Inputs(this); - } - - get outputs(): _burnFromCall__Outputs { - return new _burnFromCall__Outputs(this); - } -} - -export class _burnFromCall__Inputs { - _call: _burnFromCall; - - constructor(call: _burnFromCall) { - this._call = call; - } - - get account_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class _burnFromCall__Outputs { - _call: _burnFromCall; - - constructor(call: _burnFromCall) { - this._call = call; - } -} - -export class AddTWAPSourceCall extends ethereum.Call { - get inputs(): AddTWAPSourceCall__Inputs { - return new AddTWAPSourceCall__Inputs(this); - } - - get outputs(): AddTWAPSourceCall__Outputs { - return new AddTWAPSourceCall__Outputs(this); - } -} - -export class AddTWAPSourceCall__Inputs { - _call: AddTWAPSourceCall; - - constructor(call: AddTWAPSourceCall) { - this._call = call; - } - - get newTWAPSourceDexPool_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class AddTWAPSourceCall__Outputs { - _call: AddTWAPSourceCall; - - constructor(call: AddTWAPSourceCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class BurnCall extends ethereum.Call { - get inputs(): BurnCall__Inputs { - return new BurnCall__Inputs(this); - } - - get outputs(): BurnCall__Outputs { - return new BurnCall__Outputs(this); - } -} - -export class BurnCall__Inputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class BurnCall__Outputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } -} - -export class BurnFromCall extends ethereum.Call { - get inputs(): BurnFromCall__Inputs { - return new BurnFromCall__Inputs(this); - } - - get outputs(): BurnFromCall__Outputs { - return new BurnFromCall__Outputs(this); - } -} - -export class BurnFromCall__Inputs { - _call: BurnFromCall; - - constructor(call: BurnFromCall) { - this._call = call; - } - - get account_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class BurnFromCall__Outputs { - _call: BurnFromCall; - - constructor(call: BurnFromCall) { - this._call = call; - } -} - -export class ChangeTWAPEpochPeriodCall extends ethereum.Call { - get inputs(): ChangeTWAPEpochPeriodCall__Inputs { - return new ChangeTWAPEpochPeriodCall__Inputs(this); - } - - get outputs(): ChangeTWAPEpochPeriodCall__Outputs { - return new ChangeTWAPEpochPeriodCall__Outputs(this); - } -} - -export class ChangeTWAPEpochPeriodCall__Inputs { - _call: ChangeTWAPEpochPeriodCall; - - constructor(call: ChangeTWAPEpochPeriodCall) { - this._call = call; - } - - get newTWAPEpochPeriod_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class ChangeTWAPEpochPeriodCall__Outputs { - _call: ChangeTWAPEpochPeriodCall; - - constructor(call: ChangeTWAPEpochPeriodCall) { - this._call = call; - } -} - -export class ChangeTWAPOracleCall extends ethereum.Call { - get inputs(): ChangeTWAPOracleCall__Inputs { - return new ChangeTWAPOracleCall__Inputs(this); - } - - get outputs(): ChangeTWAPOracleCall__Outputs { - return new ChangeTWAPOracleCall__Outputs(this); - } -} - -export class ChangeTWAPOracleCall__Inputs { - _call: ChangeTWAPOracleCall; - - constructor(call: ChangeTWAPOracleCall) { - this._call = call; - } - - get newTWAPOracle_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class ChangeTWAPOracleCall__Outputs { - _call: ChangeTWAPOracleCall; - - constructor(call: ChangeTWAPOracleCall) { - this._call = call; - } -} - -export class DecreaseAllowanceCall extends ethereum.Call { - get inputs(): DecreaseAllowanceCall__Inputs { - return new DecreaseAllowanceCall__Inputs(this); - } - - get outputs(): DecreaseAllowanceCall__Outputs { - return new DecreaseAllowanceCall__Outputs(this); - } -} - -export class DecreaseAllowanceCall__Inputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get subtractedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseAllowanceCall__Outputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseAllowanceCall extends ethereum.Call { - get inputs(): IncreaseAllowanceCall__Inputs { - return new IncreaseAllowanceCall__Inputs(this); - } - - get outputs(): IncreaseAllowanceCall__Outputs { - return new IncreaseAllowanceCall__Outputs(this); - } -} - -export class IncreaseAllowanceCall__Inputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get addedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseAllowanceCall__Outputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class MintCall extends ethereum.Call { - get inputs(): MintCall__Inputs { - return new MintCall__Inputs(this); - } - - get outputs(): MintCall__Outputs { - return new MintCall__Outputs(this); - } -} - -export class MintCall__Inputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get account_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class MintCall__Outputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class RemoveTWAPSourceCall extends ethereum.Call { - get inputs(): RemoveTWAPSourceCall__Inputs { - return new RemoveTWAPSourceCall__Inputs(this); - } - - get outputs(): RemoveTWAPSourceCall__Outputs { - return new RemoveTWAPSourceCall__Outputs(this); - } -} - -export class RemoveTWAPSourceCall__Inputs { - _call: RemoveTWAPSourceCall; - - constructor(call: RemoveTWAPSourceCall) { - this._call = call; - } - - get twapSourceToRemove_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RemoveTWAPSourceCall__Outputs { - _call: RemoveTWAPSourceCall; - - constructor(call: RemoveTWAPSourceCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall extends ethereum.Call { - get inputs(): RenounceOwnershipCall__Inputs { - return new RenounceOwnershipCall__Inputs(this); - } - - get outputs(): RenounceOwnershipCall__Outputs { - return new RenounceOwnershipCall__Outputs(this); - } -} - -export class RenounceOwnershipCall__Inputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall__Outputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class SetVaultCall extends ethereum.Call { - get inputs(): SetVaultCall__Inputs { - return new SetVaultCall__Inputs(this); - } - - get outputs(): SetVaultCall__Outputs { - return new SetVaultCall__Outputs(this); - } -} - -export class SetVaultCall__Inputs { - _call: SetVaultCall; - - constructor(call: SetVaultCall) { - this._call = call; - } - - get vault_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetVaultCall__Outputs { - _call: SetVaultCall; - - constructor(call: SetVaultCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/OlympusStakingV1.ts b/subgraphs/ethereum/generated/BondDiscounts/OlympusStakingV1.ts deleted file mode 100644 index f1cf85d7..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/OlympusStakingV1.ts +++ /dev/null @@ -1,451 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OlympusStakingV1 extends ethereum.SmartContract { - static bind(address: Address): OlympusStakingV1 { - return new OlympusStakingV1("OlympusStakingV1", address); - } - - epochLengthInBlocks(): BigInt { - const result = super.call( - "epochLengthInBlocks", - "epochLengthInBlocks():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_epochLengthInBlocks(): ethereum.CallResult { - const result = super.tryCall( - "epochLengthInBlocks", - "epochLengthInBlocks():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - ohm(): Address { - const result = super.call("ohm", "ohm():(address)", []); - - return result[0].toAddress(); - } - - try_ohm(): ethereum.CallResult
{ - const result = super.tryCall("ohm", "ohm():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - ohmToDistributeNextEpoch(): BigInt { - const result = super.call( - "ohmToDistributeNextEpoch", - "ohmToDistributeNextEpoch():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_ohmToDistributeNextEpoch(): ethereum.CallResult { - const result = super.tryCall( - "ohmToDistributeNextEpoch", - "ohmToDistributeNextEpoch():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - owner(): Address { - const result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - const result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - sOHM(): Address { - const result = super.call("sOHM", "sOHM():(address)", []); - - return result[0].toAddress(); - } - - try_sOHM(): ethereum.CallResult
{ - const result = super.tryCall("sOHM", "sOHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - stakeOHM(amountToStake_: BigInt): boolean { - const result = super.call("stakeOHM", "stakeOHM(uint256):(bool)", [ - ethereum.Value.fromUnsignedBigInt(amountToStake_) - ]); - - return result[0].toBoolean(); - } - - try_stakeOHM(amountToStake_: BigInt): ethereum.CallResult { - const result = super.tryCall("stakeOHM", "stakeOHM(uint256):(bool)", [ - ethereum.Value.fromUnsignedBigInt(amountToStake_) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - unstakeOHM(amountToWithdraw_: BigInt): boolean { - const result = super.call("unstakeOHM", "unstakeOHM(uint256):(bool)", [ - ethereum.Value.fromUnsignedBigInt(amountToWithdraw_) - ]); - - return result[0].toBoolean(); - } - - try_unstakeOHM(amountToWithdraw_: BigInt): ethereum.CallResult { - const result = super.tryCall("unstakeOHM", "unstakeOHM(uint256):(bool)", [ - ethereum.Value.fromUnsignedBigInt(amountToWithdraw_) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get ohmTokenAddress_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get sOHM_(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get epochLengthInBlocks_(): i32 { - return this._call.inputValues[2].value.toI32(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall extends ethereum.Call { - get inputs(): RenounceOwnershipCall__Inputs { - return new RenounceOwnershipCall__Inputs(this); - } - - get outputs(): RenounceOwnershipCall__Outputs { - return new RenounceOwnershipCall__Outputs(this); - } -} - -export class RenounceOwnershipCall__Inputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall__Outputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class SetEpochLengthintBlockCall extends ethereum.Call { - get inputs(): SetEpochLengthintBlockCall__Inputs { - return new SetEpochLengthintBlockCall__Inputs(this); - } - - get outputs(): SetEpochLengthintBlockCall__Outputs { - return new SetEpochLengthintBlockCall__Outputs(this); - } -} - -export class SetEpochLengthintBlockCall__Inputs { - _call: SetEpochLengthintBlockCall; - - constructor(call: SetEpochLengthintBlockCall) { - this._call = call; - } - - get newEpochLengthInBlocks_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetEpochLengthintBlockCall__Outputs { - _call: SetEpochLengthintBlockCall; - - constructor(call: SetEpochLengthintBlockCall) { - this._call = call; - } -} - -export class StakeOHMCall extends ethereum.Call { - get inputs(): StakeOHMCall__Inputs { - return new StakeOHMCall__Inputs(this); - } - - get outputs(): StakeOHMCall__Outputs { - return new StakeOHMCall__Outputs(this); - } -} - -export class StakeOHMCall__Inputs { - _call: StakeOHMCall; - - constructor(call: StakeOHMCall) { - this._call = call; - } - - get amountToStake_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class StakeOHMCall__Outputs { - _call: StakeOHMCall; - - constructor(call: StakeOHMCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class StakeOHMWithPermitCall extends ethereum.Call { - get inputs(): StakeOHMWithPermitCall__Inputs { - return new StakeOHMWithPermitCall__Inputs(this); - } - - get outputs(): StakeOHMWithPermitCall__Outputs { - return new StakeOHMWithPermitCall__Outputs(this); - } -} - -export class StakeOHMWithPermitCall__Inputs { - _call: StakeOHMWithPermitCall; - - constructor(call: StakeOHMWithPermitCall) { - this._call = call; - } - - get amountToStake_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get deadline_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get v_(): i32 { - return this._call.inputValues[2].value.toI32(); - } - - get r_(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } - - get s_(): Bytes { - return this._call.inputValues[4].value.toBytes(); - } -} - -export class StakeOHMWithPermitCall__Outputs { - _call: StakeOHMWithPermitCall; - - constructor(call: StakeOHMWithPermitCall) { - this._call = call; - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} - -export class UnstakeOHMCall extends ethereum.Call { - get inputs(): UnstakeOHMCall__Inputs { - return new UnstakeOHMCall__Inputs(this); - } - - get outputs(): UnstakeOHMCall__Outputs { - return new UnstakeOHMCall__Outputs(this); - } -} - -export class UnstakeOHMCall__Inputs { - _call: UnstakeOHMCall; - - constructor(call: UnstakeOHMCall) { - this._call = call; - } - - get amountToWithdraw_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class UnstakeOHMCall__Outputs { - _call: UnstakeOHMCall; - - constructor(call: UnstakeOHMCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class UnstakeOHMWithPermitCall extends ethereum.Call { - get inputs(): UnstakeOHMWithPermitCall__Inputs { - return new UnstakeOHMWithPermitCall__Inputs(this); - } - - get outputs(): UnstakeOHMWithPermitCall__Outputs { - return new UnstakeOHMWithPermitCall__Outputs(this); - } -} - -export class UnstakeOHMWithPermitCall__Inputs { - _call: UnstakeOHMWithPermitCall; - - constructor(call: UnstakeOHMWithPermitCall) { - this._call = call; - } - - get amountToWithdraw_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get deadline_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get v_(): i32 { - return this._call.inputValues[2].value.toI32(); - } - - get r_(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } - - get s_(): Bytes { - return this._call.inputValues[4].value.toBytes(); - } -} - -export class UnstakeOHMWithPermitCall__Outputs { - _call: UnstakeOHMWithPermitCall; - - constructor(call: UnstakeOHMWithPermitCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/OlympusStakingV2.ts b/subgraphs/ethereum/generated/BondDiscounts/OlympusStakingV2.ts deleted file mode 100644 index d294fa3b..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/OlympusStakingV2.ts +++ /dev/null @@ -1,828 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OlympusStakingV2__epochResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getLength(): BigInt { - return this.value0; - } - - getNumber(): BigInt { - return this.value1; - } - - getEndBlock(): BigInt { - return this.value2; - } - - getDistribute(): BigInt { - return this.value3; - } -} - -export class OlympusStakingV2__warmupInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: boolean; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: boolean) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromBoolean(this.value3)); - return map; - } - - getDeposit(): BigInt { - return this.value0; - } - - getGons(): BigInt { - return this.value1; - } - - getExpiry(): BigInt { - return this.value2; - } - - getLock(): boolean { - return this.value3; - } -} - -export class OlympusStakingV2 extends ethereum.SmartContract { - static bind(address: Address): OlympusStakingV2 { - return new OlympusStakingV2("OlympusStakingV2", address); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - contractBalance(): BigInt { - const result = super.call( - "contractBalance", - "contractBalance():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_contractBalance(): ethereum.CallResult { - const result = super.tryCall( - "contractBalance", - "contractBalance():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - distributor(): Address { - const result = super.call("distributor", "distributor():(address)", []); - - return result[0].toAddress(); - } - - try_distributor(): ethereum.CallResult
{ - const result = super.tryCall("distributor", "distributor():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - epoch(): OlympusStakingV2__epochResult { - const result = super.call( - "epoch", - "epoch():(uint256,uint256,uint256,uint256)", - [] - ); - - return new OlympusStakingV2__epochResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_epoch(): ethereum.CallResult { - const result = super.tryCall( - "epoch", - "epoch():(uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OlympusStakingV2__epochResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - index(): BigInt { - const result = super.call("index", "index():(uint256)", []); - - return result[0].toBigInt(); - } - - try_index(): ethereum.CallResult { - const result = super.tryCall("index", "index():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - locker(): Address { - const result = super.call("locker", "locker():(address)", []); - - return result[0].toAddress(); - } - - try_locker(): ethereum.CallResult
{ - const result = super.tryCall("locker", "locker():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - manager(): Address { - const result = super.call("manager", "manager():(address)", []); - - return result[0].toAddress(); - } - - try_manager(): ethereum.CallResult
{ - const result = super.tryCall("manager", "manager():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - sOHM(): Address { - const result = super.call("sOHM", "sOHM():(address)", []); - - return result[0].toAddress(); - } - - try_sOHM(): ethereum.CallResult
{ - const result = super.tryCall("sOHM", "sOHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - stake(_amount: BigInt, _recipient: Address): boolean { - const result = super.call("stake", "stake(uint256,address):(bool)", [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromAddress(_recipient) - ]); - - return result[0].toBoolean(); - } - - try_stake( - _amount: BigInt, - _recipient: Address - ): ethereum.CallResult { - const result = super.tryCall("stake", "stake(uint256,address):(bool)", [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromAddress(_recipient) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalBonus(): BigInt { - const result = super.call("totalBonus", "totalBonus():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalBonus(): ethereum.CallResult { - const result = super.tryCall("totalBonus", "totalBonus():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - warmupContract(): Address { - const result = super.call("warmupContract", "warmupContract():(address)", []); - - return result[0].toAddress(); - } - - try_warmupContract(): ethereum.CallResult
{ - const result = super.tryCall( - "warmupContract", - "warmupContract():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - warmupInfo(param0: Address): OlympusStakingV2__warmupInfoResult { - const result = super.call( - "warmupInfo", - "warmupInfo(address):(uint256,uint256,uint256,bool)", - [ethereum.Value.fromAddress(param0)] - ); - - return new OlympusStakingV2__warmupInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBoolean() - ); - } - - try_warmupInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "warmupInfo", - "warmupInfo(address):(uint256,uint256,uint256,bool)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OlympusStakingV2__warmupInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBoolean() - ) - ); - } - - warmupPeriod(): BigInt { - const result = super.call("warmupPeriod", "warmupPeriod():(uint256)", []); - - return result[0].toBigInt(); - } - - try_warmupPeriod(): ethereum.CallResult { - const result = super.tryCall("warmupPeriod", "warmupPeriod():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _sOHM(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _epochLength(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _firstEpochNumber(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _firstEpochBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ClaimCall extends ethereum.Call { - get inputs(): ClaimCall__Inputs { - return new ClaimCall__Inputs(this); - } - - get outputs(): ClaimCall__Outputs { - return new ClaimCall__Outputs(this); - } -} - -export class ClaimCall__Inputs { - _call: ClaimCall; - - constructor(call: ClaimCall) { - this._call = call; - } - - get _recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class ClaimCall__Outputs { - _call: ClaimCall; - - constructor(call: ClaimCall) { - this._call = call; - } -} - -export class ForfeitCall extends ethereum.Call { - get inputs(): ForfeitCall__Inputs { - return new ForfeitCall__Inputs(this); - } - - get outputs(): ForfeitCall__Outputs { - return new ForfeitCall__Outputs(this); - } -} - -export class ForfeitCall__Inputs { - _call: ForfeitCall; - - constructor(call: ForfeitCall) { - this._call = call; - } -} - -export class ForfeitCall__Outputs { - _call: ForfeitCall; - - constructor(call: ForfeitCall) { - this._call = call; - } -} - -export class GiveLockBonusCall extends ethereum.Call { - get inputs(): GiveLockBonusCall__Inputs { - return new GiveLockBonusCall__Inputs(this); - } - - get outputs(): GiveLockBonusCall__Outputs { - return new GiveLockBonusCall__Outputs(this); - } -} - -export class GiveLockBonusCall__Inputs { - _call: GiveLockBonusCall; - - constructor(call: GiveLockBonusCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class GiveLockBonusCall__Outputs { - _call: GiveLockBonusCall; - - constructor(call: GiveLockBonusCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RebaseCall extends ethereum.Call { - get inputs(): RebaseCall__Inputs { - return new RebaseCall__Inputs(this); - } - - get outputs(): RebaseCall__Outputs { - return new RebaseCall__Outputs(this); - } -} - -export class RebaseCall__Inputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } -} - -export class RebaseCall__Outputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class ReturnLockBonusCall extends ethereum.Call { - get inputs(): ReturnLockBonusCall__Inputs { - return new ReturnLockBonusCall__Inputs(this); - } - - get outputs(): ReturnLockBonusCall__Outputs { - return new ReturnLockBonusCall__Outputs(this); - } -} - -export class ReturnLockBonusCall__Inputs { - _call: ReturnLockBonusCall; - - constructor(call: ReturnLockBonusCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class ReturnLockBonusCall__Outputs { - _call: ReturnLockBonusCall; - - constructor(call: ReturnLockBonusCall) { - this._call = call; - } -} - -export class SetContractCall extends ethereum.Call { - get inputs(): SetContractCall__Inputs { - return new SetContractCall__Inputs(this); - } - - get outputs(): SetContractCall__Outputs { - return new SetContractCall__Outputs(this); - } -} - -export class SetContractCall__Inputs { - _call: SetContractCall; - - constructor(call: SetContractCall) { - this._call = call; - } - - get _contract(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _address(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class SetContractCall__Outputs { - _call: SetContractCall; - - constructor(call: SetContractCall) { - this._call = call; - } -} - -export class SetWarmupCall extends ethereum.Call { - get inputs(): SetWarmupCall__Inputs { - return new SetWarmupCall__Inputs(this); - } - - get outputs(): SetWarmupCall__Outputs { - return new SetWarmupCall__Outputs(this); - } -} - -export class SetWarmupCall__Inputs { - _call: SetWarmupCall; - - constructor(call: SetWarmupCall) { - this._call = call; - } - - get _warmupPeriod(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetWarmupCall__Outputs { - _call: SetWarmupCall; - - constructor(call: SetWarmupCall) { - this._call = call; - } -} - -export class StakeCall extends ethereum.Call { - get inputs(): StakeCall__Inputs { - return new StakeCall__Inputs(this); - } - - get outputs(): StakeCall__Outputs { - return new StakeCall__Outputs(this); - } -} - -export class StakeCall__Inputs { - _call: StakeCall; - - constructor(call: StakeCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class StakeCall__Outputs { - _call: StakeCall; - - constructor(call: StakeCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class ToggleDepositLockCall extends ethereum.Call { - get inputs(): ToggleDepositLockCall__Inputs { - return new ToggleDepositLockCall__Inputs(this); - } - - get outputs(): ToggleDepositLockCall__Outputs { - return new ToggleDepositLockCall__Outputs(this); - } -} - -export class ToggleDepositLockCall__Inputs { - _call: ToggleDepositLockCall; - - constructor(call: ToggleDepositLockCall) { - this._call = call; - } -} - -export class ToggleDepositLockCall__Outputs { - _call: ToggleDepositLockCall; - - constructor(call: ToggleDepositLockCall) { - this._call = call; - } -} - -export class UnstakeCall extends ethereum.Call { - get inputs(): UnstakeCall__Inputs { - return new UnstakeCall__Inputs(this); - } - - get outputs(): UnstakeCall__Outputs { - return new UnstakeCall__Outputs(this); - } -} - -export class UnstakeCall__Inputs { - _call: UnstakeCall; - - constructor(call: UnstakeCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _trigger(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class UnstakeCall__Outputs { - _call: UnstakeCall; - - constructor(call: UnstakeCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/OlympusStakingV3.ts b/subgraphs/ethereum/generated/BondDiscounts/OlympusStakingV3.ts deleted file mode 100644 index 2144e453..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/OlympusStakingV3.ts +++ /dev/null @@ -1,982 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class AuthorityUpdated extends ethereum.Event { - get params(): AuthorityUpdated__Params { - return new AuthorityUpdated__Params(this); - } -} - -export class AuthorityUpdated__Params { - _event: AuthorityUpdated; - - constructor(event: AuthorityUpdated) { - this._event = event; - } - - get authority(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class DistributorSet extends ethereum.Event { - get params(): DistributorSet__Params { - return new DistributorSet__Params(this); - } -} - -export class DistributorSet__Params { - _event: DistributorSet; - - constructor(event: DistributorSet) { - this._event = event; - } - - get distributor(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class WarmupSet extends ethereum.Event { - get params(): WarmupSet__Params { - return new WarmupSet__Params(this); - } -} - -export class WarmupSet__Params { - _event: WarmupSet; - - constructor(event: WarmupSet) { - this._event = event; - } - - get warmup(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class OlympusStakingV3__epochResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getLength(): BigInt { - return this.value0; - } - - getNumber(): BigInt { - return this.value1; - } - - getEnd(): BigInt { - return this.value2; - } - - getDistribute(): BigInt { - return this.value3; - } -} - -export class OlympusStakingV3__warmupInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: boolean; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: boolean) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromBoolean(this.value3)); - return map; - } - - getDeposit(): BigInt { - return this.value0; - } - - getGons(): BigInt { - return this.value1; - } - - getExpiry(): BigInt { - return this.value2; - } - - getLock(): boolean { - return this.value3; - } -} - -export class OlympusStakingV3 extends ethereum.SmartContract { - static bind(address: Address): OlympusStakingV3 { - return new OlympusStakingV3("OlympusStakingV3", address); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - authority(): Address { - const result = super.call("authority", "authority():(address)", []); - - return result[0].toAddress(); - } - - try_authority(): ethereum.CallResult
{ - const result = super.tryCall("authority", "authority():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - claim(_to: Address, _rebasing: boolean): BigInt { - const result = super.call("claim", "claim(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromBoolean(_rebasing) - ]); - - return result[0].toBigInt(); - } - - try_claim(_to: Address, _rebasing: boolean): ethereum.CallResult { - const result = super.tryCall("claim", "claim(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromBoolean(_rebasing) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - distributor(): Address { - const result = super.call("distributor", "distributor():(address)", []); - - return result[0].toAddress(); - } - - try_distributor(): ethereum.CallResult
{ - const result = super.tryCall("distributor", "distributor():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - epoch(): OlympusStakingV3__epochResult { - const result = super.call( - "epoch", - "epoch():(uint256,uint256,uint256,uint256)", - [] - ); - - return new OlympusStakingV3__epochResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_epoch(): ethereum.CallResult { - const result = super.tryCall( - "epoch", - "epoch():(uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OlympusStakingV3__epochResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - forfeit(): BigInt { - const result = super.call("forfeit", "forfeit():(uint256)", []); - - return result[0].toBigInt(); - } - - try_forfeit(): ethereum.CallResult { - const result = super.tryCall("forfeit", "forfeit():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - gOHM(): Address { - const result = super.call("gOHM", "gOHM():(address)", []); - - return result[0].toAddress(); - } - - try_gOHM(): ethereum.CallResult
{ - const result = super.tryCall("gOHM", "gOHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - index(): BigInt { - const result = super.call("index", "index():(uint256)", []); - - return result[0].toBigInt(); - } - - try_index(): ethereum.CallResult { - const result = super.tryCall("index", "index():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - rebase(): BigInt { - const result = super.call("rebase", "rebase():(uint256)", []); - - return result[0].toBigInt(); - } - - try_rebase(): ethereum.CallResult { - const result = super.tryCall("rebase", "rebase():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - sOHM(): Address { - const result = super.call("sOHM", "sOHM():(address)", []); - - return result[0].toAddress(); - } - - try_sOHM(): ethereum.CallResult
{ - const result = super.tryCall("sOHM", "sOHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - secondsToNextEpoch(): BigInt { - const result = super.call( - "secondsToNextEpoch", - "secondsToNextEpoch():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_secondsToNextEpoch(): ethereum.CallResult { - const result = super.tryCall( - "secondsToNextEpoch", - "secondsToNextEpoch():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - stake( - _to: Address, - _amount: BigInt, - _rebasing: boolean, - _claim: boolean - ): BigInt { - const result = super.call( - "stake", - "stake(address,uint256,bool,bool):(uint256)", - [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromBoolean(_rebasing), - ethereum.Value.fromBoolean(_claim) - ] - ); - - return result[0].toBigInt(); - } - - try_stake( - _to: Address, - _amount: BigInt, - _rebasing: boolean, - _claim: boolean - ): ethereum.CallResult { - const result = super.tryCall( - "stake", - "stake(address,uint256,bool,bool):(uint256)", - [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromBoolean(_rebasing), - ethereum.Value.fromBoolean(_claim) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - supplyInWarmup(): BigInt { - const result = super.call("supplyInWarmup", "supplyInWarmup():(uint256)", []); - - return result[0].toBigInt(); - } - - try_supplyInWarmup(): ethereum.CallResult { - const result = super.tryCall( - "supplyInWarmup", - "supplyInWarmup():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - unstake( - _to: Address, - _amount: BigInt, - _trigger: boolean, - _rebasing: boolean - ): BigInt { - const result = super.call( - "unstake", - "unstake(address,uint256,bool,bool):(uint256)", - [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromBoolean(_trigger), - ethereum.Value.fromBoolean(_rebasing) - ] - ); - - return result[0].toBigInt(); - } - - try_unstake( - _to: Address, - _amount: BigInt, - _trigger: boolean, - _rebasing: boolean - ): ethereum.CallResult { - const result = super.tryCall( - "unstake", - "unstake(address,uint256,bool,bool):(uint256)", - [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromBoolean(_trigger), - ethereum.Value.fromBoolean(_rebasing) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - unwrap(_to: Address, _amount: BigInt): BigInt { - const result = super.call("unwrap", "unwrap(address,uint256):(uint256)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_amount) - ]); - - return result[0].toBigInt(); - } - - try_unwrap(_to: Address, _amount: BigInt): ethereum.CallResult { - const result = super.tryCall("unwrap", "unwrap(address,uint256):(uint256)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - warmupInfo(param0: Address): OlympusStakingV3__warmupInfoResult { - const result = super.call( - "warmupInfo", - "warmupInfo(address):(uint256,uint256,uint256,bool)", - [ethereum.Value.fromAddress(param0)] - ); - - return new OlympusStakingV3__warmupInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBoolean() - ); - } - - try_warmupInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "warmupInfo", - "warmupInfo(address):(uint256,uint256,uint256,bool)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OlympusStakingV3__warmupInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBoolean() - ) - ); - } - - warmupPeriod(): BigInt { - const result = super.call("warmupPeriod", "warmupPeriod():(uint256)", []); - - return result[0].toBigInt(); - } - - try_warmupPeriod(): ethereum.CallResult { - const result = super.tryCall("warmupPeriod", "warmupPeriod():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - wrap(_to: Address, _amount: BigInt): BigInt { - const result = super.call("wrap", "wrap(address,uint256):(uint256)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_amount) - ]); - - return result[0].toBigInt(); - } - - try_wrap(_to: Address, _amount: BigInt): ethereum.CallResult { - const result = super.tryCall("wrap", "wrap(address,uint256):(uint256)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _ohm(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _sOHM(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _gOHM(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _epochLength(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _firstEpochNumber(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _firstEpochTime(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get _authority(): Address { - return this._call.inputValues[6].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ClaimCall extends ethereum.Call { - get inputs(): ClaimCall__Inputs { - return new ClaimCall__Inputs(this); - } - - get outputs(): ClaimCall__Outputs { - return new ClaimCall__Outputs(this); - } -} - -export class ClaimCall__Inputs { - _call: ClaimCall; - - constructor(call: ClaimCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _rebasing(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class ClaimCall__Outputs { - _call: ClaimCall; - - constructor(call: ClaimCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class ForfeitCall extends ethereum.Call { - get inputs(): ForfeitCall__Inputs { - return new ForfeitCall__Inputs(this); - } - - get outputs(): ForfeitCall__Outputs { - return new ForfeitCall__Outputs(this); - } -} - -export class ForfeitCall__Inputs { - _call: ForfeitCall; - - constructor(call: ForfeitCall) { - this._call = call; - } -} - -export class ForfeitCall__Outputs { - _call: ForfeitCall; - - constructor(call: ForfeitCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RebaseCall extends ethereum.Call { - get inputs(): RebaseCall__Inputs { - return new RebaseCall__Inputs(this); - } - - get outputs(): RebaseCall__Outputs { - return new RebaseCall__Outputs(this); - } -} - -export class RebaseCall__Inputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } -} - -export class RebaseCall__Outputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class SetAuthorityCall extends ethereum.Call { - get inputs(): SetAuthorityCall__Inputs { - return new SetAuthorityCall__Inputs(this); - } - - get outputs(): SetAuthorityCall__Outputs { - return new SetAuthorityCall__Outputs(this); - } -} - -export class SetAuthorityCall__Inputs { - _call: SetAuthorityCall; - - constructor(call: SetAuthorityCall) { - this._call = call; - } - - get _newAuthority(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetAuthorityCall__Outputs { - _call: SetAuthorityCall; - - constructor(call: SetAuthorityCall) { - this._call = call; - } -} - -export class SetDistributorCall extends ethereum.Call { - get inputs(): SetDistributorCall__Inputs { - return new SetDistributorCall__Inputs(this); - } - - get outputs(): SetDistributorCall__Outputs { - return new SetDistributorCall__Outputs(this); - } -} - -export class SetDistributorCall__Inputs { - _call: SetDistributorCall; - - constructor(call: SetDistributorCall) { - this._call = call; - } - - get _distributor(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetDistributorCall__Outputs { - _call: SetDistributorCall; - - constructor(call: SetDistributorCall) { - this._call = call; - } -} - -export class SetWarmupLengthCall extends ethereum.Call { - get inputs(): SetWarmupLengthCall__Inputs { - return new SetWarmupLengthCall__Inputs(this); - } - - get outputs(): SetWarmupLengthCall__Outputs { - return new SetWarmupLengthCall__Outputs(this); - } -} - -export class SetWarmupLengthCall__Inputs { - _call: SetWarmupLengthCall; - - constructor(call: SetWarmupLengthCall) { - this._call = call; - } - - get _warmupPeriod(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetWarmupLengthCall__Outputs { - _call: SetWarmupLengthCall; - - constructor(call: SetWarmupLengthCall) { - this._call = call; - } -} - -export class StakeCall extends ethereum.Call { - get inputs(): StakeCall__Inputs { - return new StakeCall__Inputs(this); - } - - get outputs(): StakeCall__Outputs { - return new StakeCall__Outputs(this); - } -} - -export class StakeCall__Inputs { - _call: StakeCall; - - constructor(call: StakeCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _rebasing(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } - - get _claim(): boolean { - return this._call.inputValues[3].value.toBoolean(); - } -} - -export class StakeCall__Outputs { - _call: StakeCall; - - constructor(call: StakeCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class ToggleLockCall extends ethereum.Call { - get inputs(): ToggleLockCall__Inputs { - return new ToggleLockCall__Inputs(this); - } - - get outputs(): ToggleLockCall__Outputs { - return new ToggleLockCall__Outputs(this); - } -} - -export class ToggleLockCall__Inputs { - _call: ToggleLockCall; - - constructor(call: ToggleLockCall) { - this._call = call; - } -} - -export class ToggleLockCall__Outputs { - _call: ToggleLockCall; - - constructor(call: ToggleLockCall) { - this._call = call; - } -} - -export class UnstakeCall extends ethereum.Call { - get inputs(): UnstakeCall__Inputs { - return new UnstakeCall__Inputs(this); - } - - get outputs(): UnstakeCall__Outputs { - return new UnstakeCall__Outputs(this); - } -} - -export class UnstakeCall__Inputs { - _call: UnstakeCall; - - constructor(call: UnstakeCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _trigger(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } - - get _rebasing(): boolean { - return this._call.inputValues[3].value.toBoolean(); - } -} - -export class UnstakeCall__Outputs { - _call: UnstakeCall; - - constructor(call: UnstakeCall) { - this._call = call; - } - - get amount_(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class UnwrapCall extends ethereum.Call { - get inputs(): UnwrapCall__Inputs { - return new UnwrapCall__Inputs(this); - } - - get outputs(): UnwrapCall__Outputs { - return new UnwrapCall__Outputs(this); - } -} - -export class UnwrapCall__Inputs { - _call: UnwrapCall; - - constructor(call: UnwrapCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class UnwrapCall__Outputs { - _call: UnwrapCall; - - constructor(call: UnwrapCall) { - this._call = call; - } - - get sBalance_(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class WrapCall extends ethereum.Call { - get inputs(): WrapCall__Inputs { - return new WrapCall__Inputs(this); - } - - get outputs(): WrapCall__Outputs { - return new WrapCall__Outputs(this); - } -} - -export class WrapCall__Inputs { - _call: WrapCall; - - constructor(call: WrapCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class WrapCall__Outputs { - _call: WrapCall; - - constructor(call: WrapCall) { - this._call = call; - } - - get gBalance_(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/UniswapV2Pair.ts b/subgraphs/ethereum/generated/BondDiscounts/UniswapV2Pair.ts deleted file mode 100644 index b36eea33..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/UniswapV2Pair.ts +++ /dev/null @@ -1,1092 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Burn extends ethereum.Event { - get params(): Burn__Params { - return new Burn__Params(this); - } -} - -export class Burn__Params { - _event: Burn; - - constructor(event: Burn) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[3].value.toAddress(); - } -} - -export class Mint extends ethereum.Event { - get params(): Mint__Params { - return new Mint__Params(this); - } -} - -export class Mint__Params { - _event: Mint; - - constructor(event: Mint) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0In(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1In(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get amount0Out(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[5].value.toAddress(); - } -} - -export class Sync extends ethereum.Event { - get params(): Sync__Params { - return new Sync__Params(this); - } -} - -export class Sync__Params { - _event: Sync; - - constructor(event: Sync) { - this._event = event; - } - - get reserve0(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get reserve1(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class UniswapV2Pair__burnResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } - - getAmount0(): BigInt { - return this.value0; - } - - getAmount1(): BigInt { - return this.value1; - } -} - -export class UniswapV2Pair__getReservesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - get_reserve0(): BigInt { - return this.value0; - } - - get_reserve1(): BigInt { - return this.value1; - } - - get_blockTimestampLast(): BigInt { - return this.value2; - } -} - -export class UniswapV2Pair extends ethereum.SmartContract { - static bind(address: Address): UniswapV2Pair { - return new UniswapV2Pair("UniswapV2Pair", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - MINIMUM_LIQUIDITY(): BigInt { - const result = super.call( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_MINIMUM_LIQUIDITY(): ethereum.CallResult { - const result = super.tryCall( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(param0: Address, param1: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - - return result[0].toBigInt(); - } - - try_allowance(param0: Address, param1: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(param0: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(param0: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - burn(to: Address): UniswapV2Pair__burnResult { - const result = super.call("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return new UniswapV2Pair__burnResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_burn(to: Address): ethereum.CallResult { - const result = super.tryCall("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__burnResult(value[0].toBigInt(), value[1].toBigInt()) - ); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - factory(): Address { - const result = super.call("factory", "factory():(address)", []); - - return result[0].toAddress(); - } - - try_factory(): ethereum.CallResult
{ - const result = super.tryCall("factory", "factory():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getReserves(): UniswapV2Pair__getReservesResult { - const result = super.call( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - - return new UniswapV2Pair__getReservesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getReserves(): ethereum.CallResult { - const result = super.tryCall( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__getReservesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - kLast(): BigInt { - const result = super.call("kLast", "kLast():(uint256)", []); - - return result[0].toBigInt(); - } - - try_kLast(): ethereum.CallResult { - const result = super.tryCall("kLast", "kLast():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - mint(to: Address): BigInt { - const result = super.call("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return result[0].toBigInt(); - } - - try_mint(to: Address): ethereum.CallResult { - const result = super.tryCall("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(param0: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_nonces(param0: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price0CumulativeLast(): BigInt { - const result = super.call( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price0CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price1CumulativeLast(): BigInt { - const result = super.call( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price1CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - token0(): Address { - const result = super.call("token0", "token0():(address)", []); - - return result[0].toAddress(); - } - - try_token0(): ethereum.CallResult
{ - const result = super.tryCall("token0", "token0():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - token1(): Address { - const result = super.call("token1", "token1():(address)", []); - - return result[0].toAddress(); - } - - try_token1(): ethereum.CallResult
{ - const result = super.tryCall("token1", "token1():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class BurnCall extends ethereum.Call { - get inputs(): BurnCall__Inputs { - return new BurnCall__Inputs(this); - } - - get outputs(): BurnCall__Outputs { - return new BurnCall__Outputs(this); - } -} - -export class BurnCall__Inputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class BurnCall__Outputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get amount0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amount1(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _token0(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _token1(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class MintCall extends ethereum.Call { - get inputs(): MintCall__Inputs { - return new MintCall__Inputs(this); - } - - get outputs(): MintCall__Outputs { - return new MintCall__Outputs(this); - } -} - -export class MintCall__Inputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class MintCall__Outputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get liquidity(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class SkimCall extends ethereum.Call { - get inputs(): SkimCall__Inputs { - return new SkimCall__Inputs(this); - } - - get outputs(): SkimCall__Outputs { - return new SkimCall__Outputs(this); - } -} - -export class SkimCall__Inputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SkimCall__Outputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amount0Out(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get to(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get data(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } -} - -export class SyncCall extends ethereum.Call { - get inputs(): SyncCall__Inputs { - return new SyncCall__Inputs(this); - } - - get outputs(): SyncCall__Outputs { - return new SyncCall__Outputs(this); - } -} - -export class SyncCall__Inputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class SyncCall__Outputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/sOlympusERC20.ts b/subgraphs/ethereum/generated/BondDiscounts/sOlympusERC20.ts deleted file mode 100644 index de3202f6..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/sOlympusERC20.ts +++ /dev/null @@ -1,964 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class LogMonetaryPolicyUpdated extends ethereum.Event { - get params(): LogMonetaryPolicyUpdated__Params { - return new LogMonetaryPolicyUpdated__Params(this); - } -} - -export class LogMonetaryPolicyUpdated__Params { - _event: LogMonetaryPolicyUpdated; - - constructor(event: LogMonetaryPolicyUpdated) { - this._event = event; - } - - get monetaryPolicy(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class LogRebase extends ethereum.Event { - get params(): LogRebase__Params { - return new LogRebase__Params(this); - } -} - -export class LogRebase__Params { - _event: LogRebase; - - constructor(event: LogRebase) { - this._event = event; - } - - get epoch(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get totalSupply(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class sOlympusERC20 extends ethereum.SmartContract { - static bind(address: Address): sOlympusERC20 { - return new sOlympusERC20("sOlympusERC20", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner_: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner_), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - owner_: Address, - spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner_), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(who: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(who) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(who: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(who) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - circulatingSupply(): BigInt { - const result = super.call( - "circulatingSupply", - "circulatingSupply():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_circulatingSupply(): ethereum.CallResult { - const result = super.tryCall( - "circulatingSupply", - "circulatingSupply():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { - const result = super.call( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseAllowance( - spender: Address, - subtractedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - increaseAllowance(spender: Address, addedValue: BigInt): boolean { - const result = super.call( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseAllowance( - spender: Address, - addedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - monetaryPolicy(): Address { - const result = super.call("monetaryPolicy", "monetaryPolicy():(address)", []); - - return result[0].toAddress(); - } - - try_monetaryPolicy(): ethereum.CallResult
{ - const result = super.tryCall( - "monetaryPolicy", - "monetaryPolicy():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - owner(): Address { - const result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - const result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - rebase(olyProfit: BigInt): BigInt { - const result = super.call("rebase", "rebase(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(olyProfit) - ]); - - return result[0].toBigInt(); - } - - try_rebase(olyProfit: BigInt): ethereum.CallResult { - const result = super.tryCall("rebase", "rebase(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(olyProfit) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - stakingContract(): Address { - const result = super.call( - "stakingContract", - "stakingContract():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_stakingContract(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingContract", - "stakingContract():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DecreaseAllowanceCall extends ethereum.Call { - get inputs(): DecreaseAllowanceCall__Inputs { - return new DecreaseAllowanceCall__Inputs(this); - } - - get outputs(): DecreaseAllowanceCall__Outputs { - return new DecreaseAllowanceCall__Outputs(this); - } -} - -export class DecreaseAllowanceCall__Inputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get subtractedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseAllowanceCall__Outputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseAllowanceCall extends ethereum.Call { - get inputs(): IncreaseAllowanceCall__Inputs { - return new IncreaseAllowanceCall__Inputs(this); - } - - get outputs(): IncreaseAllowanceCall__Outputs { - return new IncreaseAllowanceCall__Outputs(this); - } -} - -export class IncreaseAllowanceCall__Inputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get addedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseAllowanceCall__Outputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class RebaseCall extends ethereum.Call { - get inputs(): RebaseCall__Inputs { - return new RebaseCall__Inputs(this); - } - - get outputs(): RebaseCall__Outputs { - return new RebaseCall__Outputs(this); - } -} - -export class RebaseCall__Inputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } - - get olyProfit(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class RebaseCall__Outputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceOwnershipCall extends ethereum.Call { - get inputs(): RenounceOwnershipCall__Inputs { - return new RenounceOwnershipCall__Inputs(this); - } - - get outputs(): RenounceOwnershipCall__Outputs { - return new RenounceOwnershipCall__Outputs(this); - } -} - -export class RenounceOwnershipCall__Inputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall__Outputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class SetMonetaryPolicyCall extends ethereum.Call { - get inputs(): SetMonetaryPolicyCall__Inputs { - return new SetMonetaryPolicyCall__Inputs(this); - } - - get outputs(): SetMonetaryPolicyCall__Outputs { - return new SetMonetaryPolicyCall__Outputs(this); - } -} - -export class SetMonetaryPolicyCall__Inputs { - _call: SetMonetaryPolicyCall; - - constructor(call: SetMonetaryPolicyCall) { - this._call = call; - } - - get monetaryPolicy_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetMonetaryPolicyCall__Outputs { - _call: SetMonetaryPolicyCall; - - constructor(call: SetMonetaryPolicyCall) { - this._call = call; - } -} - -export class SetStakingContractCall extends ethereum.Call { - get inputs(): SetStakingContractCall__Inputs { - return new SetStakingContractCall__Inputs(this); - } - - get outputs(): SetStakingContractCall__Outputs { - return new SetStakingContractCall__Outputs(this); - } -} - -export class SetStakingContractCall__Inputs { - _call: SetStakingContractCall; - - constructor(call: SetStakingContractCall) { - this._call = call; - } - - get newStakingContract_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetStakingContractCall__Outputs { - _call: SetStakingContractCall; - - constructor(call: SetStakingContractCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/sOlympusERC20V2.ts b/subgraphs/ethereum/generated/BondDiscounts/sOlympusERC20V2.ts deleted file mode 100644 index a4184728..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/sOlympusERC20V2.ts +++ /dev/null @@ -1,1277 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class LogRebase extends ethereum.Event { - get params(): LogRebase__Params { - return new LogRebase__Params(this); - } -} - -export class LogRebase__Params { - _event: LogRebase; - - constructor(event: LogRebase) { - this._event = event; - } - - get epoch(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get rebase(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get index(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class LogStakingContractUpdated extends ethereum.Event { - get params(): LogStakingContractUpdated__Params { - return new LogStakingContractUpdated__Params(this); - } -} - -export class LogStakingContractUpdated__Params { - _event: LogStakingContractUpdated; - - constructor(event: LogStakingContractUpdated) { - this._event = event; - } - - get stakingContract(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class LogSupply extends ethereum.Event { - get params(): LogSupply__Params { - return new LogSupply__Params(this); - } -} - -export class LogSupply__Params { - _event: LogSupply; - - constructor(event: LogSupply) { - this._event = event; - } - - get epoch(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get timestamp(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get totalSupply(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class sOlympusERC20V2__rebasesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - value6: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt, - value6: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - this.value6 = value6; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - map.set("value6", ethereum.Value.fromUnsignedBigInt(this.value6)); - return map; - } - - getEpoch(): BigInt { - return this.value0; - } - - getRebase(): BigInt { - return this.value1; - } - - getTotalStakedBefore(): BigInt { - return this.value2; - } - - getTotalStakedAfter(): BigInt { - return this.value3; - } - - getAmountRebased(): BigInt { - return this.value4; - } - - getIndex(): BigInt { - return this.value5; - } - - getBlockNumberOccured(): BigInt { - return this.value6; - } -} - -export class sOlympusERC20V2 extends ethereum.SmartContract { - static bind(address: Address): sOlympusERC20V2 { - return new sOlympusERC20V2("sOlympusERC20V2", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - INDEX(): BigInt { - const result = super.call("INDEX", "INDEX():(uint256)", []); - - return result[0].toBigInt(); - } - - try_INDEX(): ethereum.CallResult { - const result = super.tryCall("INDEX", "INDEX():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner_: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner_), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - owner_: Address, - spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner_), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceForGons(gons: BigInt): BigInt { - const result = super.call( - "balanceForGons", - "balanceForGons(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(gons)] - ); - - return result[0].toBigInt(); - } - - try_balanceForGons(gons: BigInt): ethereum.CallResult { - const result = super.tryCall( - "balanceForGons", - "balanceForGons(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(gons)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - balanceOf(who: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(who) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(who: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(who) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - circulatingSupply(): BigInt { - const result = super.call( - "circulatingSupply", - "circulatingSupply():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_circulatingSupply(): ethereum.CallResult { - const result = super.tryCall( - "circulatingSupply", - "circulatingSupply():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { - const result = super.call( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseAllowance( - spender: Address, - subtractedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - gonsForBalance(amount: BigInt): BigInt { - const result = super.call( - "gonsForBalance", - "gonsForBalance(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amount)] - ); - - return result[0].toBigInt(); - } - - try_gonsForBalance(amount: BigInt): ethereum.CallResult { - const result = super.tryCall( - "gonsForBalance", - "gonsForBalance(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amount)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - increaseAllowance(spender: Address, addedValue: BigInt): boolean { - const result = super.call( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseAllowance( - spender: Address, - addedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - index(): BigInt { - const result = super.call("index", "index():(uint256)", []); - - return result[0].toBigInt(); - } - - try_index(): ethereum.CallResult { - const result = super.tryCall("index", "index():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - initialize(stakingContract_: Address): boolean { - const result = super.call("initialize", "initialize(address):(bool)", [ - ethereum.Value.fromAddress(stakingContract_) - ]); - - return result[0].toBoolean(); - } - - try_initialize(stakingContract_: Address): ethereum.CallResult { - const result = super.tryCall("initialize", "initialize(address):(bool)", [ - ethereum.Value.fromAddress(stakingContract_) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - initializer(): Address { - const result = super.call("initializer", "initializer():(address)", []); - - return result[0].toAddress(); - } - - try_initializer(): ethereum.CallResult
{ - const result = super.tryCall("initializer", "initializer():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - manager(): Address { - const result = super.call("manager", "manager():(address)", []); - - return result[0].toAddress(); - } - - try_manager(): ethereum.CallResult
{ - const result = super.tryCall("manager", "manager():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - rebase(profit_: BigInt, epoch_: BigInt): BigInt { - const result = super.call("rebase", "rebase(uint256,uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(profit_), - ethereum.Value.fromUnsignedBigInt(epoch_) - ]); - - return result[0].toBigInt(); - } - - try_rebase(profit_: BigInt, epoch_: BigInt): ethereum.CallResult { - const result = super.tryCall("rebase", "rebase(uint256,uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(profit_), - ethereum.Value.fromUnsignedBigInt(epoch_) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - rebases(param0: BigInt): sOlympusERC20V2__rebasesResult { - const result = super.call( - "rebases", - "rebases(uint256):(uint256,uint256,uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromUnsignedBigInt(param0)] - ); - - return new sOlympusERC20V2__rebasesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt(), - result[6].toBigInt() - ); - } - - try_rebases( - param0: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "rebases", - "rebases(uint256):(uint256,uint256,uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromUnsignedBigInt(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new sOlympusERC20V2__rebasesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt(), - value[6].toBigInt() - ) - ); - } - - setIndex(_INDEX: BigInt): boolean { - const result = super.call("setIndex", "setIndex(uint256):(bool)", [ - ethereum.Value.fromUnsignedBigInt(_INDEX) - ]); - - return result[0].toBoolean(); - } - - try_setIndex(_INDEX: BigInt): ethereum.CallResult { - const result = super.tryCall("setIndex", "setIndex(uint256):(bool)", [ - ethereum.Value.fromUnsignedBigInt(_INDEX) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - stakingContract(): Address { - const result = super.call( - "stakingContract", - "stakingContract():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_stakingContract(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingContract", - "stakingContract():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DecreaseAllowanceCall extends ethereum.Call { - get inputs(): DecreaseAllowanceCall__Inputs { - return new DecreaseAllowanceCall__Inputs(this); - } - - get outputs(): DecreaseAllowanceCall__Outputs { - return new DecreaseAllowanceCall__Outputs(this); - } -} - -export class DecreaseAllowanceCall__Inputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get subtractedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseAllowanceCall__Outputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseAllowanceCall extends ethereum.Call { - get inputs(): IncreaseAllowanceCall__Inputs { - return new IncreaseAllowanceCall__Inputs(this); - } - - get outputs(): IncreaseAllowanceCall__Outputs { - return new IncreaseAllowanceCall__Outputs(this); - } -} - -export class IncreaseAllowanceCall__Inputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get addedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseAllowanceCall__Outputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get stakingContract_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RebaseCall extends ethereum.Call { - get inputs(): RebaseCall__Inputs { - return new RebaseCall__Inputs(this); - } - - get outputs(): RebaseCall__Outputs { - return new RebaseCall__Outputs(this); - } -} - -export class RebaseCall__Inputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } - - get profit_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get epoch_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class RebaseCall__Outputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetIndexCall extends ethereum.Call { - get inputs(): SetIndexCall__Inputs { - return new SetIndexCall__Inputs(this); - } - - get outputs(): SetIndexCall__Outputs { - return new SetIndexCall__Outputs(this); - } -} - -export class SetIndexCall__Inputs { - _call: SetIndexCall; - - constructor(call: SetIndexCall) { - this._call = call; - } - - get _INDEX(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetIndexCall__Outputs { - _call: SetIndexCall; - - constructor(call: SetIndexCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/BondDiscounts/sOlympusERC20V3.ts b/subgraphs/ethereum/generated/BondDiscounts/sOlympusERC20V3.ts deleted file mode 100644 index 49fac1e0..00000000 --- a/subgraphs/ethereum/generated/BondDiscounts/sOlympusERC20V3.ts +++ /dev/null @@ -1,1194 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class LogRebase extends ethereum.Event { - get params(): LogRebase__Params { - return new LogRebase__Params(this); - } -} - -export class LogRebase__Params { - _event: LogRebase; - - constructor(event: LogRebase) { - this._event = event; - } - - get epoch(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get rebase(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get index(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class LogStakingContractUpdated extends ethereum.Event { - get params(): LogStakingContractUpdated__Params { - return new LogStakingContractUpdated__Params(this); - } -} - -export class LogStakingContractUpdated__Params { - _event: LogStakingContractUpdated; - - constructor(event: LogStakingContractUpdated) { - this._event = event; - } - - get stakingContract(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class LogSupply extends ethereum.Event { - get params(): LogSupply__Params { - return new LogSupply__Params(this); - } -} - -export class LogSupply__Params { - _event: LogSupply; - - constructor(event: LogSupply) { - this._event = event; - } - - get epoch(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get totalSupply(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class sOlympusERC20V3__rebasesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - value6: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt, - value6: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - this.value6 = value6; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - map.set("value6", ethereum.Value.fromUnsignedBigInt(this.value6)); - return map; - } - - getEpoch(): BigInt { - return this.value0; - } - - getRebase(): BigInt { - return this.value1; - } - - getTotalStakedBefore(): BigInt { - return this.value2; - } - - getTotalStakedAfter(): BigInt { - return this.value3; - } - - getAmountRebased(): BigInt { - return this.value4; - } - - getIndex(): BigInt { - return this.value5; - } - - getBlockNumberOccured(): BigInt { - return this.value6; - } -} - -export class sOlympusERC20V3 extends ethereum.SmartContract { - static bind(address: Address): sOlympusERC20V3 { - return new sOlympusERC20V3("sOlympusERC20V3", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner_: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner_), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - owner_: Address, - spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner_), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceForGons(gons: BigInt): BigInt { - const result = super.call( - "balanceForGons", - "balanceForGons(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(gons)] - ); - - return result[0].toBigInt(); - } - - try_balanceForGons(gons: BigInt): ethereum.CallResult { - const result = super.tryCall( - "balanceForGons", - "balanceForGons(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(gons)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - balanceOf(who: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(who) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(who: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(who) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - circulatingSupply(): BigInt { - const result = super.call( - "circulatingSupply", - "circulatingSupply():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_circulatingSupply(): ethereum.CallResult { - const result = super.tryCall( - "circulatingSupply", - "circulatingSupply():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtBalances(param0: Address): BigInt { - const result = super.call("debtBalances", "debtBalances(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_debtBalances(param0: Address): ethereum.CallResult { - const result = super.tryCall( - "debtBalances", - "debtBalances(address):(uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { - const result = super.call( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseAllowance( - spender: Address, - subtractedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - fromG(amount: BigInt): BigInt { - const result = super.call("fromG", "fromG(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBigInt(); - } - - try_fromG(amount: BigInt): ethereum.CallResult { - const result = super.tryCall("fromG", "fromG(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - gOHM(): Address { - const result = super.call("gOHM", "gOHM():(address)", []); - - return result[0].toAddress(); - } - - try_gOHM(): ethereum.CallResult
{ - const result = super.tryCall("gOHM", "gOHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - gonsForBalance(amount: BigInt): BigInt { - const result = super.call( - "gonsForBalance", - "gonsForBalance(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amount)] - ); - - return result[0].toBigInt(); - } - - try_gonsForBalance(amount: BigInt): ethereum.CallResult { - const result = super.tryCall( - "gonsForBalance", - "gonsForBalance(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amount)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - increaseAllowance(spender: Address, addedValue: BigInt): boolean { - const result = super.call( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseAllowance( - spender: Address, - addedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - index(): BigInt { - const result = super.call("index", "index():(uint256)", []); - - return result[0].toBigInt(); - } - - try_index(): ethereum.CallResult { - const result = super.tryCall("index", "index():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - rebase(profit_: BigInt, epoch_: BigInt): BigInt { - const result = super.call("rebase", "rebase(uint256,uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(profit_), - ethereum.Value.fromUnsignedBigInt(epoch_) - ]); - - return result[0].toBigInt(); - } - - try_rebase(profit_: BigInt, epoch_: BigInt): ethereum.CallResult { - const result = super.tryCall("rebase", "rebase(uint256,uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(profit_), - ethereum.Value.fromUnsignedBigInt(epoch_) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - rebases(param0: BigInt): sOlympusERC20V3__rebasesResult { - const result = super.call( - "rebases", - "rebases(uint256):(uint256,uint256,uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromUnsignedBigInt(param0)] - ); - - return new sOlympusERC20V3__rebasesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt(), - result[6].toBigInt() - ); - } - - try_rebases( - param0: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "rebases", - "rebases(uint256):(uint256,uint256,uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromUnsignedBigInt(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new sOlympusERC20V3__rebasesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt(), - value[6].toBigInt() - ) - ); - } - - stakingContract(): Address { - const result = super.call( - "stakingContract", - "stakingContract():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_stakingContract(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingContract", - "stakingContract():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - toG(amount: BigInt): BigInt { - const result = super.call("toG", "toG(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBigInt(); - } - - try_toG(amount: BigInt): ethereum.CallResult { - const result = super.tryCall("toG", "toG(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class ChangeDebtCall extends ethereum.Call { - get inputs(): ChangeDebtCall__Inputs { - return new ChangeDebtCall__Inputs(this); - } - - get outputs(): ChangeDebtCall__Outputs { - return new ChangeDebtCall__Outputs(this); - } -} - -export class ChangeDebtCall__Inputs { - _call: ChangeDebtCall; - - constructor(call: ChangeDebtCall) { - this._call = call; - } - - get amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get debtor(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get add(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } -} - -export class ChangeDebtCall__Outputs { - _call: ChangeDebtCall; - - constructor(call: ChangeDebtCall) { - this._call = call; - } -} - -export class DecreaseAllowanceCall extends ethereum.Call { - get inputs(): DecreaseAllowanceCall__Inputs { - return new DecreaseAllowanceCall__Inputs(this); - } - - get outputs(): DecreaseAllowanceCall__Outputs { - return new DecreaseAllowanceCall__Outputs(this); - } -} - -export class DecreaseAllowanceCall__Inputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get subtractedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseAllowanceCall__Outputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseAllowanceCall extends ethereum.Call { - get inputs(): IncreaseAllowanceCall__Inputs { - return new IncreaseAllowanceCall__Inputs(this); - } - - get outputs(): IncreaseAllowanceCall__Outputs { - return new IncreaseAllowanceCall__Outputs(this); - } -} - -export class IncreaseAllowanceCall__Inputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get addedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseAllowanceCall__Outputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _stakingContract(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class RebaseCall extends ethereum.Call { - get inputs(): RebaseCall__Inputs { - return new RebaseCall__Inputs(this); - } - - get outputs(): RebaseCall__Outputs { - return new RebaseCall__Outputs(this); - } -} - -export class RebaseCall__Inputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } - - get profit_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get epoch_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class RebaseCall__Outputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class SetIndexCall extends ethereum.Call { - get inputs(): SetIndexCall__Inputs { - return new SetIndexCall__Inputs(this); - } - - get outputs(): SetIndexCall__Outputs { - return new SetIndexCall__Outputs(this); - } -} - -export class SetIndexCall__Inputs { - _call: SetIndexCall; - - constructor(call: SetIndexCall) { - this._call = call; - } - - get _index(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetIndexCall__Outputs { - _call: SetIndexCall; - - constructor(call: SetIndexCall) { - this._call = call; - } -} - -export class SetgOHMCall extends ethereum.Call { - get inputs(): SetgOHMCall__Inputs { - return new SetgOHMCall__Inputs(this); - } - - get outputs(): SetgOHMCall__Outputs { - return new SetgOHMCall__Outputs(this); - } -} - -export class SetgOHMCall__Inputs { - _call: SetgOHMCall; - - constructor(call: SetgOHMCall) { - this._call = call; - } - - get _gOHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetgOHMCall__Outputs { - _call: SetgOHMCall; - - constructor(call: SetgOHMCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/DAIBondV1/DAIBondV1.ts b/subgraphs/ethereum/generated/DAIBondV1/DAIBondV1.ts deleted file mode 100644 index a13088e3..00000000 --- a/subgraphs/ethereum/generated/DAIBondV1/DAIBondV1.ts +++ /dev/null @@ -1,1054 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class DAIBondV1__depositorInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getValue(): BigInt { - return this.value0; - } - - getPayoutRemaining(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getVestingPeriod(): BigInt { - return this.value3; - } -} - -export class DAIBondV1__getDepositorInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - get_value(): BigInt { - return this.value0; - } - - get_payoutRemaining(): BigInt { - return this.value1; - } - - get_lastBlock(): BigInt { - return this.value2; - } - - get_vestingPeriod(): BigInt { - return this.value3; - } -} - -export class DAIBondV1 extends ethereum.SmartContract { - static bind(address: Address): DAIBondV1 { - return new DAIBondV1("DAIBondV1", address); - } - - DAI(): Address { - const result = super.call("DAI", "DAI():(address)", []); - - return result[0].toAddress(); - } - - try_DAI(): ethereum.CallResult
{ - const result = super.tryCall("DAI", "DAI():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - DAOShare(): BigInt { - const result = super.call("DAOShare", "DAOShare():(uint256)", []); - - return result[0].toBigInt(); - } - - try_DAOShare(): ethereum.CallResult { - const result = super.tryCall("DAOShare", "DAOShare():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - DAOWallet(): Address { - const result = super.call("DAOWallet", "DAOWallet():(address)", []); - - return result[0].toAddress(); - } - - try_DAOWallet(): ethereum.CallResult
{ - const result = super.tryCall("DAOWallet", "DAOWallet():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondControlVariable(): BigInt { - const result = super.call( - "bondControlVariable", - "bondControlVariable():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_bondControlVariable(): ethereum.CallResult { - const result = super.tryCall( - "bondControlVariable", - "bondControlVariable():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculateBondInterest(value_: BigInt): BigInt { - const result = super.call( - "calculateBondInterest", - "calculateBondInterest(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(value_)] - ); - - return result[0].toBigInt(); - } - - try_calculateBondInterest(value_: BigInt): ethereum.CallResult { - const result = super.tryCall( - "calculateBondInterest", - "calculateBondInterest(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(value_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculatePendingPayout(depositor_: Address): BigInt { - const result = super.call( - "calculatePendingPayout", - "calculatePendingPayout(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - - return result[0].toBigInt(); - } - - try_calculatePendingPayout(depositor_: Address): ethereum.CallResult { - const result = super.tryCall( - "calculatePendingPayout", - "calculatePendingPayout(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculatePercentVested(depositor_: Address): BigInt { - const result = super.call( - "calculatePercentVested", - "calculatePercentVested(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - - return result[0].toBigInt(); - } - - try_calculatePercentVested(depositor_: Address): ethereum.CallResult { - const result = super.tryCall( - "calculatePercentVested", - "calculatePercentVested(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculatePremium(): BigInt { - const result = super.call( - "calculatePremium", - "calculatePremium():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_calculatePremium(): ethereum.CallResult { - const result = super.tryCall( - "calculatePremium", - "calculatePremium():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - circulatingOHMContract(): Address { - const result = super.call( - "circulatingOHMContract", - "circulatingOHMContract():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_circulatingOHMContract(): ethereum.CallResult
{ - const result = super.tryCall( - "circulatingOHMContract", - "circulatingOHMContract():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - deposit(amount_: BigInt, maxPremium_: BigInt, depositor_: Address): boolean { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(amount_), - ethereum.Value.fromUnsignedBigInt(maxPremium_), - ethereum.Value.fromAddress(depositor_) - ] - ); - - return result[0].toBoolean(); - } - - try_deposit( - amount_: BigInt, - maxPremium_: BigInt, - depositor_: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(amount_), - ethereum.Value.fromUnsignedBigInt(maxPremium_), - ethereum.Value.fromAddress(depositor_) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - depositWithPermit( - amount_: BigInt, - maxPremium_: BigInt, - depositor_: Address, - deadline: BigInt, - v: i32, - r: Bytes, - s: Bytes - ): boolean { - const result = super.call( - "depositWithPermit", - "depositWithPermit(uint256,uint256,address,uint256,uint8,bytes32,bytes32):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(amount_), - ethereum.Value.fromUnsignedBigInt(maxPremium_), - ethereum.Value.fromAddress(depositor_), - ethereum.Value.fromUnsignedBigInt(deadline), - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(v)), - ethereum.Value.fromFixedBytes(r), - ethereum.Value.fromFixedBytes(s) - ] - ); - - return result[0].toBoolean(); - } - - try_depositWithPermit( - amount_: BigInt, - maxPremium_: BigInt, - depositor_: Address, - deadline: BigInt, - v: i32, - r: Bytes, - s: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "depositWithPermit", - "depositWithPermit(uint256,uint256,address,uint256,uint8,bytes32,bytes32):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(amount_), - ethereum.Value.fromUnsignedBigInt(maxPremium_), - ethereum.Value.fromAddress(depositor_), - ethereum.Value.fromUnsignedBigInt(deadline), - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(v)), - ethereum.Value.fromFixedBytes(r), - ethereum.Value.fromFixedBytes(s) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - depositorInfo(param0: Address): DAIBondV1__depositorInfoResult { - const result = super.call( - "depositorInfo", - "depositorInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new DAIBondV1__depositorInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_depositorInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "depositorInfo", - "depositorInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new DAIBondV1__depositorInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - getDepositorInfo(address_: Address): DAIBondV1__getDepositorInfoResult { - const result = super.call( - "getDepositorInfo", - "getDepositorInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(address_)] - ); - - return new DAIBondV1__getDepositorInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_getDepositorInfo( - address_: Address - ): ethereum.CallResult { - const result = super.tryCall( - "getDepositorInfo", - "getDepositorInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(address_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new DAIBondV1__getDepositorInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - getMaxPayoutAmount(): BigInt { - const result = super.call( - "getMaxPayoutAmount", - "getMaxPayoutAmount():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getMaxPayoutAmount(): ethereum.CallResult { - const result = super.tryCall( - "getMaxPayoutAmount", - "getMaxPayoutAmount():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxPayoutPercent(): BigInt { - const result = super.call( - "maxPayoutPercent", - "maxPayoutPercent():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_maxPayoutPercent(): ethereum.CallResult { - const result = super.tryCall( - "maxPayoutPercent", - "maxPayoutPercent():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - minPremium(): BigInt { - const result = super.call("minPremium", "minPremium():(uint256)", []); - - return result[0].toBigInt(); - } - - try_minPremium(): ethereum.CallResult { - const result = super.tryCall("minPremium", "minPremium():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - owner(): Address { - const result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - const result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - redeem(): boolean { - const result = super.call("redeem", "redeem():(bool)", []); - - return result[0].toBoolean(); - } - - try_redeem(): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - setBondTerms( - bondControlVariable_: BigInt, - vestingPeriodInBlocks_: BigInt, - minPremium_: BigInt, - maxPayout_: BigInt, - DAOShare_: BigInt - ): boolean { - const result = super.call( - "setBondTerms", - "setBondTerms(uint256,uint256,uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(bondControlVariable_), - ethereum.Value.fromUnsignedBigInt(vestingPeriodInBlocks_), - ethereum.Value.fromUnsignedBigInt(minPremium_), - ethereum.Value.fromUnsignedBigInt(maxPayout_), - ethereum.Value.fromUnsignedBigInt(DAOShare_) - ] - ); - - return result[0].toBoolean(); - } - - try_setBondTerms( - bondControlVariable_: BigInt, - vestingPeriodInBlocks_: BigInt, - minPremium_: BigInt, - maxPayout_: BigInt, - DAOShare_: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "setBondTerms", - "setBondTerms(uint256,uint256,uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(bondControlVariable_), - ethereum.Value.fromUnsignedBigInt(vestingPeriodInBlocks_), - ethereum.Value.fromUnsignedBigInt(minPremium_), - ethereum.Value.fromUnsignedBigInt(maxPayout_), - ethereum.Value.fromUnsignedBigInt(DAOShare_) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - stakingContract(): Address { - const result = super.call( - "stakingContract", - "stakingContract():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_stakingContract(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingContract", - "stakingContract():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - toggleUseCircForDebtRatio(): boolean { - const result = super.call( - "toggleUseCircForDebtRatio", - "toggleUseCircForDebtRatio():(bool)", - [] - ); - - return result[0].toBoolean(); - } - - try_toggleUseCircForDebtRatio(): ethereum.CallResult { - const result = super.tryCall( - "toggleUseCircForDebtRatio", - "toggleUseCircForDebtRatio():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - useCircForDebtRatio(): boolean { - const result = super.call( - "useCircForDebtRatio", - "useCircForDebtRatio():(bool)", - [] - ); - - return result[0].toBoolean(); - } - - try_useCircForDebtRatio(): ethereum.CallResult { - const result = super.tryCall( - "useCircForDebtRatio", - "useCircForDebtRatio():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - vestingPeriodInBlocks(): BigInt { - const result = super.call( - "vestingPeriodInBlocks", - "vestingPeriodInBlocks():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_vestingPeriodInBlocks(): ethereum.CallResult { - const result = super.tryCall( - "vestingPeriodInBlocks", - "vestingPeriodInBlocks():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get DAI_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get OHM_(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get treasury_(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get stakingContract_(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get DAOWallet_(): Address { - return this._call.inputValues[4].value.toAddress(); - } - - get circulatingOHMContract_(): Address { - return this._call.inputValues[5].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get amount_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get maxPremium_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get depositor_(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DepositWithPermitCall extends ethereum.Call { - get inputs(): DepositWithPermitCall__Inputs { - return new DepositWithPermitCall__Inputs(this); - } - - get outputs(): DepositWithPermitCall__Outputs { - return new DepositWithPermitCall__Outputs(this); - } -} - -export class DepositWithPermitCall__Inputs { - _call: DepositWithPermitCall; - - constructor(call: DepositWithPermitCall) { - this._call = call; - } - - get amount_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get maxPremium_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get depositor_(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class DepositWithPermitCall__Outputs { - _call: DepositWithPermitCall; - - constructor(call: DepositWithPermitCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RenounceOwnershipCall extends ethereum.Call { - get inputs(): RenounceOwnershipCall__Inputs { - return new RenounceOwnershipCall__Inputs(this); - } - - get outputs(): RenounceOwnershipCall__Outputs { - return new RenounceOwnershipCall__Outputs(this); - } -} - -export class RenounceOwnershipCall__Inputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall__Outputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get bondControlVariable_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get vestingPeriodInBlocks_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get minPremium_(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get maxPayout_(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get DAOShare_(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class ToggleUseCircForDebtRatioCall extends ethereum.Call { - get inputs(): ToggleUseCircForDebtRatioCall__Inputs { - return new ToggleUseCircForDebtRatioCall__Inputs(this); - } - - get outputs(): ToggleUseCircForDebtRatioCall__Outputs { - return new ToggleUseCircForDebtRatioCall__Outputs(this); - } -} - -export class ToggleUseCircForDebtRatioCall__Inputs { - _call: ToggleUseCircForDebtRatioCall; - - constructor(call: ToggleUseCircForDebtRatioCall) { - this._call = call; - } -} - -export class ToggleUseCircForDebtRatioCall__Outputs { - _call: ToggleUseCircForDebtRatioCall; - - constructor(call: ToggleUseCircForDebtRatioCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/DAIBondV2/DAIBondV2.ts b/subgraphs/ethereum/generated/DAIBondV2/DAIBondV2.ts deleted file mode 100644 index 0209c620..00000000 --- a/subgraphs/ethereum/generated/DAIBondV2/DAIBondV2.ts +++ /dev/null @@ -1,1158 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get payout(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class DAIBondV2__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } -} - -export class DAIBondV2__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getValueRemaining(): BigInt { - return this.value0; - } - - getPayoutRemaining(): BigInt { - return this.value1; - } - - getVestingPeriod(): BigInt { - return this.value2; - } - - getLastBlock(): BigInt { - return this.value3; - } - - getPricePaid(): BigInt { - return this.value4; - } -} - -export class DAIBondV2__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getFee(): BigInt { - return this.value4; - } -} - -export class DAIBondV2 extends ethereum.SmartContract { - static bind(address: Address): DAIBondV2 { - return new DAIBondV2("DAIBondV2", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): DAIBondV2__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256)", - [] - ); - - return new DAIBondV2__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new DAIBondV2__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): DAIBondV2__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new DAIBondV2__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new DAIBondV2__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isLiquidityBond(): boolean { - const result = super.call("isLiquidityBond", "isLiquidityBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_isLiquidityBond(): ethereum.CallResult { - const result = super.tryCall( - "isLiquidityBond", - "isLiquidityBond():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - manager(): Address { - const result = super.call("manager", "manager():(address)", []); - - return result[0].toAddress(); - } - - try_manager(): ethereum.CallResult
{ - const result = super.tryCall("manager", "manager():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_stake: boolean): BigInt { - const result = super.call("redeem", "redeem(bool):(uint256)", [ - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem(_stake: boolean): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(bool):(uint256)", [ - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - setBondTerms( - _vestingTerm: BigInt, - _minimumPrice: BigInt, - _maxPayout: BigInt, - _fee: BigInt - ): boolean { - const result = super.call( - "setBondTerms", - "setBondTerms(uint256,uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(_vestingTerm), - ethereum.Value.fromUnsignedBigInt(_minimumPrice), - ethereum.Value.fromUnsignedBigInt(_maxPayout), - ethereum.Value.fromUnsignedBigInt(_fee) - ] - ); - - return result[0].toBoolean(); - } - - try_setBondTerms( - _vestingTerm: BigInt, - _minimumPrice: BigInt, - _maxPayout: BigInt, - _fee: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "setBondTerms", - "setBondTerms(uint256,uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(_vestingTerm), - ethereum.Value.fromUnsignedBigInt(_minimumPrice), - ethereum.Value.fromUnsignedBigInt(_maxPayout), - ethereum.Value.fromUnsignedBigInt(_fee) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - setStaking(_staking: Address): boolean { - const result = super.call("setStaking", "setStaking(address):(bool)", [ - ethereum.Value.fromAddress(_staking) - ]); - - return result[0].toBoolean(); - } - - try_setStaking(_staking: Address): ethereum.CallResult { - const result = super.tryCall("setStaking", "setStaking(address):(bool)", [ - ethereum.Value.fromAddress(_staking) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - terms(): DAIBondV2__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new DAIBondV2__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new DAIBondV2__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _bondCalculator(): Address { - return this._call.inputValues[4].value.toAddress(); - } - - get _controlVariable(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _stake(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _fee(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/DAIBondV3/DAIBondV3.ts b/subgraphs/ethereum/generated/DAIBondV3/DAIBondV3.ts deleted file mode 100644 index 519af220..00000000 --- a/subgraphs/ethereum/generated/DAIBondV3/DAIBondV3.ts +++ /dev/null @@ -1,1298 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ControlVariableAdjustment extends ethereum.Event { - get params(): ControlVariableAdjustment__Params { - return new ControlVariableAdjustment__Params(this); - } -} - -export class ControlVariableAdjustment__Params { - _event: ControlVariableAdjustment; - - constructor(event: ControlVariableAdjustment) { - this._event = event; - } - - get initialBCV(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get newBCV(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get adjustment(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get addition(): boolean { - return this._event.parameters[3].value.toBoolean(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class DAIBondV3__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: boolean, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } - - getBuffer(): BigInt { - return this.value3; - } - - getLastBlock(): BigInt { - return this.value4; - } -} - -export class DAIBondV3__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getPayout(): BigInt { - return this.value0; - } - - getVesting(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getPricePaid(): BigInt { - return this.value3; - } -} - -export class DAIBondV3__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getFee(): BigInt { - return this.value4; - } - - getMaxDebt(): BigInt { - return this.value5; - } -} - -export class DAIBondV3 extends ethereum.SmartContract { - static bind(address: Address): DAIBondV3 { - return new DAIBondV3("DAIBondV3", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): DAIBondV3__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - - return new DAIBondV3__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new DAIBondV3__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): DAIBondV3__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new DAIBondV3__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new DAIBondV3__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - currentDebt(): BigInt { - const result = super.call("currentDebt", "currentDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_currentDebt(): ethereum.CallResult { - const result = super.tryCall("currentDebt", "currentDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtDecay(): BigInt { - const result = super.call("debtDecay", "debtDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtDecay(): ethereum.CallResult { - const result = super.tryCall("debtDecay", "debtDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isLiquidityBond(): boolean { - const result = super.call("isLiquidityBond", "isLiquidityBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_isLiquidityBond(): ethereum.CallResult { - const result = super.tryCall( - "isLiquidityBond", - "isLiquidityBond():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - lastDecay(): BigInt { - const result = super.call("lastDecay", "lastDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_lastDecay(): ethereum.CallResult { - const result = super.tryCall("lastDecay", "lastDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - policy(): Address { - const result = super.call("policy", "policy():(address)", []); - - return result[0].toAddress(); - } - - try_policy(): ethereum.CallResult
{ - const result = super.tryCall("policy", "policy():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_recipient: Address, _stake: boolean): BigInt { - const result = super.call("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem( - _recipient: Address, - _stake: boolean - ): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - stakingHelper(): Address { - const result = super.call("stakingHelper", "stakingHelper():(address)", []); - - return result[0].toAddress(); - } - - try_stakingHelper(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingHelper", - "stakingHelper():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - standardizedDebtRatio(): BigInt { - const result = super.call( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_standardizedDebtRatio(): ethereum.CallResult { - const result = super.tryCall( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - terms(): DAIBondV3__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new DAIBondV3__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new DAIBondV3__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - useHelper(): boolean { - const result = super.call("useHelper", "useHelper():(bool)", []); - - return result[0].toBoolean(); - } - - try_useHelper(): ethereum.CallResult { - const result = super.tryCall("useHelper", "useHelper():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _bondCalculator(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class InitializeBondTermsCall extends ethereum.Call { - get inputs(): InitializeBondTermsCall__Inputs { - return new InitializeBondTermsCall__Inputs(this); - } - - get outputs(): InitializeBondTermsCall__Outputs { - return new InitializeBondTermsCall__Outputs(this); - } -} - -export class InitializeBondTermsCall__Inputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } - - get _controlVariable(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _fee(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _maxDebt(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get _initialDebt(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } -} - -export class InitializeBondTermsCall__Outputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _stake(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _buffer(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _parameter(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _input(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _helper(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/ETHBondV1/ETHBondV1.ts b/subgraphs/ethereum/generated/ETHBondV1/ETHBondV1.ts deleted file mode 100644 index 73bc556f..00000000 --- a/subgraphs/ethereum/generated/ETHBondV1/ETHBondV1.ts +++ /dev/null @@ -1,1261 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ControlVariableAdjustment extends ethereum.Event { - get params(): ControlVariableAdjustment__Params { - return new ControlVariableAdjustment__Params(this); - } -} - -export class ControlVariableAdjustment__Params { - _event: ControlVariableAdjustment; - - constructor(event: ControlVariableAdjustment) { - this._event = event; - } - - get initialBCV(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get newBCV(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get adjustment(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get addition(): boolean { - return this._event.parameters[3].value.toBoolean(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class ETHBondV1__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: boolean, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } - - getBuffer(): BigInt { - return this.value3; - } - - getLastBlock(): BigInt { - return this.value4; - } -} - -export class ETHBondV1__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getPayout(): BigInt { - return this.value0; - } - - getVesting(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getPricePaid(): BigInt { - return this.value3; - } -} - -export class ETHBondV1__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getMaxDebt(): BigInt { - return this.value4; - } -} - -export class ETHBondV1 extends ethereum.SmartContract { - static bind(address: Address): ETHBondV1 { - return new ETHBondV1("ETHBondV1", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): ETHBondV1__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - - return new ETHBondV1__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new ETHBondV1__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - assetPrice(): BigInt { - const result = super.call("assetPrice", "assetPrice():(int256)", []); - - return result[0].toBigInt(); - } - - try_assetPrice(): ethereum.CallResult { - const result = super.tryCall("assetPrice", "assetPrice():(int256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondInfo(param0: Address): ETHBondV1__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new ETHBondV1__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new ETHBondV1__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - currentDebt(): BigInt { - const result = super.call("currentDebt", "currentDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_currentDebt(): ethereum.CallResult { - const result = super.tryCall("currentDebt", "currentDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtDecay(): BigInt { - const result = super.call("debtDecay", "debtDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtDecay(): ethereum.CallResult { - const result = super.tryCall("debtDecay", "debtDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - lastDecay(): BigInt { - const result = super.call("lastDecay", "lastDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_lastDecay(): ethereum.CallResult { - const result = super.tryCall("lastDecay", "lastDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - policy(): Address { - const result = super.call("policy", "policy():(address)", []); - - return result[0].toAddress(); - } - - try_policy(): ethereum.CallResult
{ - const result = super.tryCall("policy", "policy():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_recipient: Address, _stake: boolean): BigInt { - const result = super.call("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem( - _recipient: Address, - _stake: boolean - ): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - stakingHelper(): Address { - const result = super.call("stakingHelper", "stakingHelper():(address)", []); - - return result[0].toAddress(); - } - - try_stakingHelper(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingHelper", - "stakingHelper():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - standardizedDebtRatio(): BigInt { - const result = super.call( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_standardizedDebtRatio(): ethereum.CallResult { - const result = super.tryCall( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - terms(): ETHBondV1__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new ETHBondV1__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new ETHBondV1__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - useHelper(): boolean { - const result = super.call("useHelper", "useHelper():(bool)", []); - - return result[0].toBoolean(); - } - - try_useHelper(): ethereum.CallResult { - const result = super.tryCall("useHelper", "useHelper():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _feed(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class InitializeBondTermsCall extends ethereum.Call { - get inputs(): InitializeBondTermsCall__Inputs { - return new InitializeBondTermsCall__Inputs(this); - } - - get outputs(): InitializeBondTermsCall__Outputs { - return new InitializeBondTermsCall__Outputs(this); - } -} - -export class InitializeBondTermsCall__Inputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } - - get _controlVariable(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _maxDebt(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _initialDebt(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } -} - -export class InitializeBondTermsCall__Outputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _stake(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _buffer(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _parameter(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _input(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _helper(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/ETHBondV1/UniswapV2Pair.ts b/subgraphs/ethereum/generated/ETHBondV1/UniswapV2Pair.ts deleted file mode 100644 index b36eea33..00000000 --- a/subgraphs/ethereum/generated/ETHBondV1/UniswapV2Pair.ts +++ /dev/null @@ -1,1092 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Burn extends ethereum.Event { - get params(): Burn__Params { - return new Burn__Params(this); - } -} - -export class Burn__Params { - _event: Burn; - - constructor(event: Burn) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[3].value.toAddress(); - } -} - -export class Mint extends ethereum.Event { - get params(): Mint__Params { - return new Mint__Params(this); - } -} - -export class Mint__Params { - _event: Mint; - - constructor(event: Mint) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0In(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1In(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get amount0Out(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[5].value.toAddress(); - } -} - -export class Sync extends ethereum.Event { - get params(): Sync__Params { - return new Sync__Params(this); - } -} - -export class Sync__Params { - _event: Sync; - - constructor(event: Sync) { - this._event = event; - } - - get reserve0(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get reserve1(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class UniswapV2Pair__burnResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } - - getAmount0(): BigInt { - return this.value0; - } - - getAmount1(): BigInt { - return this.value1; - } -} - -export class UniswapV2Pair__getReservesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - get_reserve0(): BigInt { - return this.value0; - } - - get_reserve1(): BigInt { - return this.value1; - } - - get_blockTimestampLast(): BigInt { - return this.value2; - } -} - -export class UniswapV2Pair extends ethereum.SmartContract { - static bind(address: Address): UniswapV2Pair { - return new UniswapV2Pair("UniswapV2Pair", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - MINIMUM_LIQUIDITY(): BigInt { - const result = super.call( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_MINIMUM_LIQUIDITY(): ethereum.CallResult { - const result = super.tryCall( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(param0: Address, param1: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - - return result[0].toBigInt(); - } - - try_allowance(param0: Address, param1: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(param0: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(param0: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - burn(to: Address): UniswapV2Pair__burnResult { - const result = super.call("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return new UniswapV2Pair__burnResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_burn(to: Address): ethereum.CallResult { - const result = super.tryCall("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__burnResult(value[0].toBigInt(), value[1].toBigInt()) - ); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - factory(): Address { - const result = super.call("factory", "factory():(address)", []); - - return result[0].toAddress(); - } - - try_factory(): ethereum.CallResult
{ - const result = super.tryCall("factory", "factory():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getReserves(): UniswapV2Pair__getReservesResult { - const result = super.call( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - - return new UniswapV2Pair__getReservesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getReserves(): ethereum.CallResult { - const result = super.tryCall( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__getReservesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - kLast(): BigInt { - const result = super.call("kLast", "kLast():(uint256)", []); - - return result[0].toBigInt(); - } - - try_kLast(): ethereum.CallResult { - const result = super.tryCall("kLast", "kLast():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - mint(to: Address): BigInt { - const result = super.call("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return result[0].toBigInt(); - } - - try_mint(to: Address): ethereum.CallResult { - const result = super.tryCall("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(param0: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_nonces(param0: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price0CumulativeLast(): BigInt { - const result = super.call( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price0CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price1CumulativeLast(): BigInt { - const result = super.call( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price1CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - token0(): Address { - const result = super.call("token0", "token0():(address)", []); - - return result[0].toAddress(); - } - - try_token0(): ethereum.CallResult
{ - const result = super.tryCall("token0", "token0():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - token1(): Address { - const result = super.call("token1", "token1():(address)", []); - - return result[0].toAddress(); - } - - try_token1(): ethereum.CallResult
{ - const result = super.tryCall("token1", "token1():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class BurnCall extends ethereum.Call { - get inputs(): BurnCall__Inputs { - return new BurnCall__Inputs(this); - } - - get outputs(): BurnCall__Outputs { - return new BurnCall__Outputs(this); - } -} - -export class BurnCall__Inputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class BurnCall__Outputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get amount0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amount1(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _token0(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _token1(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class MintCall extends ethereum.Call { - get inputs(): MintCall__Inputs { - return new MintCall__Inputs(this); - } - - get outputs(): MintCall__Outputs { - return new MintCall__Outputs(this); - } -} - -export class MintCall__Inputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class MintCall__Outputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get liquidity(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class SkimCall extends ethereum.Call { - get inputs(): SkimCall__Inputs { - return new SkimCall__Inputs(this); - } - - get outputs(): SkimCall__Outputs { - return new SkimCall__Outputs(this); - } -} - -export class SkimCall__Inputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SkimCall__Outputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amount0Out(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get to(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get data(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } -} - -export class SyncCall extends ethereum.Call { - get inputs(): SyncCall__Inputs { - return new SyncCall__Inputs(this); - } - - get outputs(): SyncCall__Outputs { - return new SyncCall__Outputs(this); - } -} - -export class SyncCall__Inputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class SyncCall__Outputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/FRAXBondV1/FRAXBondV1.ts b/subgraphs/ethereum/generated/FRAXBondV1/FRAXBondV1.ts deleted file mode 100644 index 2ddf98e3..00000000 --- a/subgraphs/ethereum/generated/FRAXBondV1/FRAXBondV1.ts +++ /dev/null @@ -1,1298 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ControlVariableAdjustment extends ethereum.Event { - get params(): ControlVariableAdjustment__Params { - return new ControlVariableAdjustment__Params(this); - } -} - -export class ControlVariableAdjustment__Params { - _event: ControlVariableAdjustment; - - constructor(event: ControlVariableAdjustment) { - this._event = event; - } - - get initialBCV(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get newBCV(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get adjustment(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get addition(): boolean { - return this._event.parameters[3].value.toBoolean(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class FRAXBondV1__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: boolean, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } - - getBuffer(): BigInt { - return this.value3; - } - - getLastBlock(): BigInt { - return this.value4; - } -} - -export class FRAXBondV1__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getPayout(): BigInt { - return this.value0; - } - - getVesting(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getPricePaid(): BigInt { - return this.value3; - } -} - -export class FRAXBondV1__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getFee(): BigInt { - return this.value4; - } - - getMaxDebt(): BigInt { - return this.value5; - } -} - -export class FRAXBondV1 extends ethereum.SmartContract { - static bind(address: Address): FRAXBondV1 { - return new FRAXBondV1("FRAXBondV1", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): FRAXBondV1__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - - return new FRAXBondV1__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new FRAXBondV1__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): FRAXBondV1__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new FRAXBondV1__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new FRAXBondV1__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - currentDebt(): BigInt { - const result = super.call("currentDebt", "currentDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_currentDebt(): ethereum.CallResult { - const result = super.tryCall("currentDebt", "currentDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtDecay(): BigInt { - const result = super.call("debtDecay", "debtDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtDecay(): ethereum.CallResult { - const result = super.tryCall("debtDecay", "debtDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isLiquidityBond(): boolean { - const result = super.call("isLiquidityBond", "isLiquidityBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_isLiquidityBond(): ethereum.CallResult { - const result = super.tryCall( - "isLiquidityBond", - "isLiquidityBond():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - lastDecay(): BigInt { - const result = super.call("lastDecay", "lastDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_lastDecay(): ethereum.CallResult { - const result = super.tryCall("lastDecay", "lastDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - policy(): Address { - const result = super.call("policy", "policy():(address)", []); - - return result[0].toAddress(); - } - - try_policy(): ethereum.CallResult
{ - const result = super.tryCall("policy", "policy():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_recipient: Address, _stake: boolean): BigInt { - const result = super.call("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem( - _recipient: Address, - _stake: boolean - ): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - stakingHelper(): Address { - const result = super.call("stakingHelper", "stakingHelper():(address)", []); - - return result[0].toAddress(); - } - - try_stakingHelper(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingHelper", - "stakingHelper():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - standardizedDebtRatio(): BigInt { - const result = super.call( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_standardizedDebtRatio(): ethereum.CallResult { - const result = super.tryCall( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - terms(): FRAXBondV1__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new FRAXBondV1__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new FRAXBondV1__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - useHelper(): boolean { - const result = super.call("useHelper", "useHelper():(bool)", []); - - return result[0].toBoolean(); - } - - try_useHelper(): ethereum.CallResult { - const result = super.tryCall("useHelper", "useHelper():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _bondCalculator(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class InitializeBondTermsCall extends ethereum.Call { - get inputs(): InitializeBondTermsCall__Inputs { - return new InitializeBondTermsCall__Inputs(this); - } - - get outputs(): InitializeBondTermsCall__Outputs { - return new InitializeBondTermsCall__Outputs(this); - } -} - -export class InitializeBondTermsCall__Inputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } - - get _controlVariable(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _fee(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _maxDebt(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get _initialDebt(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } -} - -export class InitializeBondTermsCall__Outputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _stake(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _buffer(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _parameter(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _input(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _helper(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/LUSDBondV1/LUSDBondV1.ts b/subgraphs/ethereum/generated/LUSDBondV1/LUSDBondV1.ts deleted file mode 100644 index d49ea6db..00000000 --- a/subgraphs/ethereum/generated/LUSDBondV1/LUSDBondV1.ts +++ /dev/null @@ -1,1298 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ControlVariableAdjustment extends ethereum.Event { - get params(): ControlVariableAdjustment__Params { - return new ControlVariableAdjustment__Params(this); - } -} - -export class ControlVariableAdjustment__Params { - _event: ControlVariableAdjustment; - - constructor(event: ControlVariableAdjustment) { - this._event = event; - } - - get initialBCV(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get newBCV(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get adjustment(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get addition(): boolean { - return this._event.parameters[3].value.toBoolean(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class LUSDBondV1__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: boolean, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } - - getBuffer(): BigInt { - return this.value3; - } - - getLastBlock(): BigInt { - return this.value4; - } -} - -export class LUSDBondV1__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getPayout(): BigInt { - return this.value0; - } - - getVesting(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getPricePaid(): BigInt { - return this.value3; - } -} - -export class LUSDBondV1__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getFee(): BigInt { - return this.value4; - } - - getMaxDebt(): BigInt { - return this.value5; - } -} - -export class LUSDBondV1 extends ethereum.SmartContract { - static bind(address: Address): LUSDBondV1 { - return new LUSDBondV1("LUSDBondV1", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): LUSDBondV1__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - - return new LUSDBondV1__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new LUSDBondV1__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): LUSDBondV1__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new LUSDBondV1__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new LUSDBondV1__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - currentDebt(): BigInt { - const result = super.call("currentDebt", "currentDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_currentDebt(): ethereum.CallResult { - const result = super.tryCall("currentDebt", "currentDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtDecay(): BigInt { - const result = super.call("debtDecay", "debtDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtDecay(): ethereum.CallResult { - const result = super.tryCall("debtDecay", "debtDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isLiquidityBond(): boolean { - const result = super.call("isLiquidityBond", "isLiquidityBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_isLiquidityBond(): ethereum.CallResult { - const result = super.tryCall( - "isLiquidityBond", - "isLiquidityBond():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - lastDecay(): BigInt { - const result = super.call("lastDecay", "lastDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_lastDecay(): ethereum.CallResult { - const result = super.tryCall("lastDecay", "lastDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - policy(): Address { - const result = super.call("policy", "policy():(address)", []); - - return result[0].toAddress(); - } - - try_policy(): ethereum.CallResult
{ - const result = super.tryCall("policy", "policy():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_recipient: Address, _stake: boolean): BigInt { - const result = super.call("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem( - _recipient: Address, - _stake: boolean - ): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - stakingHelper(): Address { - const result = super.call("stakingHelper", "stakingHelper():(address)", []); - - return result[0].toAddress(); - } - - try_stakingHelper(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingHelper", - "stakingHelper():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - standardizedDebtRatio(): BigInt { - const result = super.call( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_standardizedDebtRatio(): ethereum.CallResult { - const result = super.tryCall( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - terms(): LUSDBondV1__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new LUSDBondV1__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new LUSDBondV1__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - useHelper(): boolean { - const result = super.call("useHelper", "useHelper():(bool)", []); - - return result[0].toBoolean(); - } - - try_useHelper(): ethereum.CallResult { - const result = super.tryCall("useHelper", "useHelper():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _bondCalculator(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class InitializeBondTermsCall extends ethereum.Call { - get inputs(): InitializeBondTermsCall__Inputs { - return new InitializeBondTermsCall__Inputs(this); - } - - get outputs(): InitializeBondTermsCall__Outputs { - return new InitializeBondTermsCall__Outputs(this); - } -} - -export class InitializeBondTermsCall__Inputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } - - get _controlVariable(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _fee(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _maxDebt(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get _initialDebt(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } -} - -export class InitializeBondTermsCall__Outputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _stake(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _buffer(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _parameter(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _input(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _helper(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV1/BalancerPoolToken.ts b/subgraphs/ethereum/generated/OHMDAIBondV1/BalancerPoolToken.ts deleted file mode 100644 index e1efa45b..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV1/BalancerPoolToken.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class SwapFeePercentageChanged extends ethereum.Event { - get params(): SwapFeePercentageChanged__Params { - return new SwapFeePercentageChanged__Params(this); - } -} - -export class SwapFeePercentageChanged__Params { - _event: SwapFeePercentageChanged; - - constructor(event: SwapFeePercentageChanged) { - this._event = event; - } - - get swapFeePercentage(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BalancerPoolToken__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerPoolToken__onExitPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onJoinPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onSwapInputRequestStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get tokenIn(): Address { - return this[1].toAddress(); - } - - get tokenOut(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get poolId(): Bytes { - return this[4].toBytes(); - } - - get lastChangeBlock(): BigInt { - return this[5].toBigInt(); - } - - get from(): Address { - return this[6].toAddress(); - } - - get to(): Address { - return this[7].toAddress(); - } - - get userData(): Bytes { - return this[8].toBytes(); - } -} - -export class BalancerPoolToken__queryExitResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptIn(): BigInt { - return this.value0; - } - - getAmountsOut(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__queryJoinResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptOut(): BigInt { - return this.value0; - } - - getAmountsIn(): Array { - return this.value1; - } -} - -export class BalancerPoolToken extends ethereum.SmartContract { - static bind(address: Address): BalancerPoolToken { - return new BalancerPoolToken("BalancerPoolToken", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getInvariant(): BigInt { - const result = super.call("getInvariant", "getInvariant():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getInvariant(): ethereum.CallResult { - const result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getLastInvariant(): BigInt { - const result = super.call( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getLastInvariant(): ethereum.CallResult { - const result = super.tryCall( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getNormalizedWeights(): Array { - const result = super.call( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - - return result[0].toBigIntArray(); - } - - try_getNormalizedWeights(): ethereum.CallResult> { - const result = super.tryCall( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getOwner(): Address { - const result = super.call("getOwner", "getOwner():(address)", []); - - return result[0].toAddress(); - } - - try_getOwner(): ethereum.CallResult
{ - const result = super.tryCall("getOwner", "getOwner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getPausedState(): BalancerPoolToken__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerPoolToken__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerPoolToken__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPoolId(): Bytes { - const result = super.call("getPoolId", "getPoolId():(bytes32)", []); - - return result[0].toBytes(); - } - - try_getPoolId(): ethereum.CallResult { - const result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getRate(): BigInt { - const result = super.call("getRate", "getRate():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getRate(): ethereum.CallResult { - const result = super.tryCall("getRate", "getRate():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getSwapFeePercentage(): BigInt { - const result = super.call( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getSwapFeePercentage(): ethereum.CallResult { - const result = super.tryCall( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getVault(): Address { - const result = super.call("getVault", "getVault():(address)", []); - - return result[0].toAddress(); - } - - try_getVault(): ethereum.CallResult
{ - const result = super.tryCall("getVault", "getVault():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - increaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onExitPoolResult { - const result = super.call( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onExitPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onExitPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onJoinPoolResult { - const result = super.call( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onJoinPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onJoinPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): BigInt { - const result = super.call( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - - return result[0].toBigInt(); - } - - try_onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryExitResult { - const result = super.call( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryExitResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryExitResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryJoinResult { - const result = super.call( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryJoinResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryJoinResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get vault(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get name(): string { - return this._call.inputValues[1].value.toString(); - } - - get symbol(): string { - return this._call.inputValues[2].value.toString(); - } - - get tokens(): Array
{ - return this._call.inputValues[3].value.toAddressArray(); - } - - get normalizedWeights(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[7].value.toBigInt(); - } - - get owner(): Address { - return this._call.inputValues[8].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DecreaseApprovalCall extends ethereum.Call { - get inputs(): DecreaseApprovalCall__Inputs { - return new DecreaseApprovalCall__Inputs(this); - } - - get outputs(): DecreaseApprovalCall__Outputs { - return new DecreaseApprovalCall__Outputs(this); - } -} - -export class DecreaseApprovalCall__Inputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseApprovalCall__Outputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseApprovalCall extends ethereum.Call { - get inputs(): IncreaseApprovalCall__Inputs { - return new IncreaseApprovalCall__Inputs(this); - } - - get outputs(): IncreaseApprovalCall__Outputs { - return new IncreaseApprovalCall__Outputs(this); - } -} - -export class IncreaseApprovalCall__Inputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseApprovalCall__Outputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class OnExitPoolCall extends ethereum.Call { - get inputs(): OnExitPoolCall__Inputs { - return new OnExitPoolCall__Inputs(this); - } - - get outputs(): OnExitPoolCall__Outputs { - return new OnExitPoolCall__Outputs(this); - } -} - -export class OnExitPoolCall__Inputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnExitPoolCall__Outputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class OnJoinPoolCall extends ethereum.Call { - get inputs(): OnJoinPoolCall__Inputs { - return new OnJoinPoolCall__Inputs(this); - } - - get outputs(): OnJoinPoolCall__Outputs { - return new OnJoinPoolCall__Outputs(this); - } -} - -export class OnJoinPoolCall__Inputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnJoinPoolCall__Outputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class QueryExitCall extends ethereum.Call { - get inputs(): QueryExitCall__Inputs { - return new QueryExitCall__Inputs(this); - } - - get outputs(): QueryExitCall__Outputs { - return new QueryExitCall__Outputs(this); - } -} - -export class QueryExitCall__Inputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryExitCall__Outputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get bptIn(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsOut(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class QueryJoinCall extends ethereum.Call { - get inputs(): QueryJoinCall__Inputs { - return new QueryJoinCall__Inputs(this); - } - - get outputs(): QueryJoinCall__Outputs { - return new QueryJoinCall__Outputs(this); - } -} - -export class QueryJoinCall__Inputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryJoinCall__Outputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get bptOut(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsIn(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetSwapFeePercentageCall extends ethereum.Call { - get inputs(): SetSwapFeePercentageCall__Inputs { - return new SetSwapFeePercentageCall__Inputs(this); - } - - get outputs(): SetSwapFeePercentageCall__Outputs { - return new SetSwapFeePercentageCall__Outputs(this); - } -} - -export class SetSwapFeePercentageCall__Inputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetSwapFeePercentageCall__Outputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV1/BalancerVault.ts b/subgraphs/ethereum/generated/OHMDAIBondV1/BalancerVault.ts deleted file mode 100644 index 41f94648..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV1/BalancerVault.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class AuthorizerChanged extends ethereum.Event { - get params(): AuthorizerChanged__Params { - return new AuthorizerChanged__Params(this); - } -} - -export class AuthorizerChanged__Params { - _event: AuthorizerChanged; - - constructor(event: AuthorizerChanged) { - this._event = event; - } - - get newAuthorizer(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class ExternalBalanceTransfer extends ethereum.Event { - get params(): ExternalBalanceTransfer__Params { - return new ExternalBalanceTransfer__Params(this); - } -} - -export class ExternalBalanceTransfer__Params { - _event: ExternalBalanceTransfer; - - constructor(event: ExternalBalanceTransfer) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get recipient(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class FlashLoan extends ethereum.Event { - get params(): FlashLoan__Params { - return new FlashLoan__Params(this); - } -} - -export class FlashLoan__Params { - _event: FlashLoan; - - constructor(event: FlashLoan) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get feeAmount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class InternalBalanceChanged extends ethereum.Event { - get params(): InternalBalanceChanged__Params { - return new InternalBalanceChanged__Params(this); - } -} - -export class InternalBalanceChanged__Params { - _event: InternalBalanceChanged; - - constructor(event: InternalBalanceChanged) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get delta(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class PoolBalanceChanged extends ethereum.Event { - get params(): PoolBalanceChanged__Params { - return new PoolBalanceChanged__Params(this); - } -} - -export class PoolBalanceChanged__Params { - _event: PoolBalanceChanged; - - constructor(event: PoolBalanceChanged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get liquidityProvider(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokens(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } - - get deltas(): Array { - return this._event.parameters[3].value.toBigIntArray(); - } - - get protocolFeeAmounts(): Array { - return this._event.parameters[4].value.toBigIntArray(); - } -} - -export class PoolBalanceManaged extends ethereum.Event { - get params(): PoolBalanceManaged__Params { - return new PoolBalanceManaged__Params(this); - } -} - -export class PoolBalanceManaged__Params { - _event: PoolBalanceManaged; - - constructor(event: PoolBalanceManaged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get assetManager(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get cashDelta(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get managedDelta(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class PoolRegistered extends ethereum.Event { - get params(): PoolRegistered__Params { - return new PoolRegistered__Params(this); - } -} - -export class PoolRegistered__Params { - _event: PoolRegistered; - - constructor(event: PoolRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get poolAddress(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get specialization(): i32 { - return this._event.parameters[2].value.toI32(); - } -} - -export class RelayerApprovalChanged extends ethereum.Event { - get params(): RelayerApprovalChanged__Params { - return new RelayerApprovalChanged__Params(this); - } -} - -export class RelayerApprovalChanged__Params { - _event: RelayerApprovalChanged; - - constructor(event: RelayerApprovalChanged) { - this._event = event; - } - - get relayer(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get approved(): boolean { - return this._event.parameters[2].value.toBoolean(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokenIn(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokenOut(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amountIn(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amountOut(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class TokensDeregistered extends ethereum.Event { - get params(): TokensDeregistered__Params { - return new TokensDeregistered__Params(this); - } -} - -export class TokensDeregistered__Params { - _event: TokensDeregistered; - - constructor(event: TokensDeregistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } -} - -export class TokensRegistered extends ethereum.Event { - get params(): TokensRegistered__Params { - return new TokensRegistered__Params(this); - } -} - -export class TokensRegistered__Params { - _event: TokensRegistered; - - constructor(event: TokensRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } -} - -export class BalancerVault__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerVault__getPoolResult { - value0: Address; - value1: i32; - - constructor(value0: Address, value1: i32) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddress(this.value0)); - map.set( - "value1", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) - ); - return map; - } - - getValue0(): Address { - return this.value0; - } - - getValue1(): i32 { - return this.value1; - } -} - -export class BalancerVault__getPoolTokenInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: Address; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: Address) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromAddress(this.value3)); - return map; - } - - getCash(): BigInt { - return this.value0; - } - - getManaged(): BigInt { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } - - getAssetManager(): Address { - return this.value3; - } -} - -export class BalancerVault__getPoolTokensResult { - value0: Array
; - value1: Array; - value2: BigInt; - - constructor(value0: Array
, value1: Array, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddressArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getTokens(): Array
{ - return this.value0; - } - - getBalances(): Array { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } -} - -export class BalancerVault__queryBatchSwapInputSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BalancerVault__queryBatchSwapInputFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class BalancerVault extends ethereum.SmartContract { - static bind(address: Address): BalancerVault { - return new BalancerVault("BalancerVault", address); - } - - WETH(): Address { - const result = super.call("WETH", "WETH():(address)", []); - - return result[0].toAddress(); - } - - try_WETH(): ethereum.CallResult
{ - const result = super.tryCall("WETH", "WETH():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getDomainSeparator(): Bytes { - const result = super.call( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_getDomainSeparator(): ethereum.CallResult { - const result = super.tryCall( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getInternalBalance(user: Address, tokens: Array
): Array { - const result = super.call( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - - return result[0].toBigIntArray(); - } - - try_getInternalBalance( - user: Address, - tokens: Array
- ): ethereum.CallResult> { - const result = super.tryCall( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getNextNonce(user: Address): BigInt { - const result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ - ethereum.Value.fromAddress(user) - ]); - - return result[0].toBigInt(); - } - - try_getNextNonce(user: Address): ethereum.CallResult { - const result = super.tryCall( - "getNextNonce", - "getNextNonce(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getPausedState(): BalancerVault__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerVault__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerVault__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPool(poolId: Bytes): BalancerVault__getPoolResult { - const result = super.call("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - - return new BalancerVault__getPoolResult( - result[0].toAddress(), - result[1].toI32() - ); - } - - try_getPool( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolResult(value[0].toAddress(), value[1].toI32()) - ); - } - - getPoolTokenInfo( - poolId: Bytes, - token: Address - ): BalancerVault__getPoolTokenInfoResult { - const result = super.call( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - - return new BalancerVault__getPoolTokenInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toAddress() - ); - } - - try_getPoolTokenInfo( - poolId: Bytes, - token: Address - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokenInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toAddress() - ) - ); - } - - getPoolTokens(poolId: Bytes): BalancerVault__getPoolTokensResult { - const result = super.call( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - - return new BalancerVault__getPoolTokensResult( - result[0].toAddressArray(), - result[1].toBigIntArray(), - result[2].toBigInt() - ); - } - - try_getPoolTokens( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokensResult( - value[0].toAddressArray(), - value[1].toBigIntArray(), - value[2].toBigInt() - ) - ); - } - - getProtocolFeesCollector(): Address { - const result = super.call( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_getProtocolFeesCollector(): ethereum.CallResult
{ - const result = super.tryCall( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - hasApprovedRelayer(user: Address, relayer: Address): boolean { - const result = super.call( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - - return result[0].toBoolean(); - } - - try_hasApprovedRelayer( - user: Address, - relayer: Address - ): ethereum.CallResult { - const result = super.tryCall( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): Array { - const result = super.call( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - - return result[0].toBigIntArray(); - } - - try_queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): ethereum.CallResult> { - const result = super.tryCall( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - registerPool(specialization: i32): Bytes { - const result = super.call("registerPool", "registerPool(uint8):(bytes32)", [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization)) - ]); - - return result[0].toBytes(); - } - - try_registerPool(specialization: i32): ethereum.CallResult { - const result = super.tryCall( - "registerPool", - "registerPool(uint8):(bytes32)", - [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization))] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get authorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get weth(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class BatchSwapCall extends ethereum.Call { - get inputs(): BatchSwapCall__Inputs { - return new BatchSwapCall__Inputs(this); - } - - get outputs(): BatchSwapCall__Outputs { - return new BatchSwapCall__Outputs(this); - } -} - -export class BatchSwapCall__Inputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - BatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): BatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } - - get limits(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get deadline(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } -} - -export class BatchSwapCall__Outputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get assetDeltas(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class BatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class DeregisterTokensCall extends ethereum.Call { - get inputs(): DeregisterTokensCall__Inputs { - return new DeregisterTokensCall__Inputs(this); - } - - get outputs(): DeregisterTokensCall__Outputs { - return new DeregisterTokensCall__Outputs(this); - } -} - -export class DeregisterTokensCall__Inputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } -} - -export class DeregisterTokensCall__Outputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } -} - -export class ExitPoolCall extends ethereum.Call { - get inputs(): ExitPoolCall__Inputs { - return new ExitPoolCall__Inputs(this); - } - - get outputs(): ExitPoolCall__Outputs { - return new ExitPoolCall__Outputs(this); - } -} - -export class ExitPoolCall__Inputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): ExitPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class ExitPoolCall__Outputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } -} - -export class ExitPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get minAmountsOut(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class FlashLoanCall extends ethereum.Call { - get inputs(): FlashLoanCall__Inputs { - return new FlashLoanCall__Inputs(this); - } - - get outputs(): FlashLoanCall__Outputs { - return new FlashLoanCall__Outputs(this); - } -} - -export class FlashLoanCall__Inputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get amounts(): Array { - return this._call.inputValues[2].value.toBigIntArray(); - } - - get userData(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class FlashLoanCall__Outputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } -} - -export class JoinPoolCall extends ethereum.Call { - get inputs(): JoinPoolCall__Inputs { - return new JoinPoolCall__Inputs(this); - } - - get outputs(): JoinPoolCall__Outputs { - return new JoinPoolCall__Outputs(this); - } -} - -export class JoinPoolCall__Inputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): JoinPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class JoinPoolCall__Outputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } -} - -export class JoinPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get maxAmountsIn(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get fromInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class ManagePoolBalanceCall extends ethereum.Call { - get inputs(): ManagePoolBalanceCall__Inputs { - return new ManagePoolBalanceCall__Inputs(this); - } - - get outputs(): ManagePoolBalanceCall__Outputs { - return new ManagePoolBalanceCall__Outputs(this); - } -} - -export class ManagePoolBalanceCall__Inputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManagePoolBalanceCallOpsStruct - >(); - } -} - -export class ManagePoolBalanceCall__Outputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } -} - -export class ManagePoolBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get poolId(): Bytes { - return this[1].toBytes(); - } - - get token(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } -} - -export class ManageUserBalanceCall extends ethereum.Call { - get inputs(): ManageUserBalanceCall__Inputs { - return new ManageUserBalanceCall__Inputs(this); - } - - get outputs(): ManageUserBalanceCall__Outputs { - return new ManageUserBalanceCall__Outputs(this); - } -} - -export class ManageUserBalanceCall__Inputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManageUserBalanceCallOpsStruct - >(); - } -} - -export class ManageUserBalanceCall__Outputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } -} - -export class ManageUserBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get asset(): Address { - return this[1].toAddress(); - } - - get amount(): BigInt { - return this[2].toBigInt(); - } - - get sender(): Address { - return this[3].toAddress(); - } - - get recipient(): Address { - return this[4].toAddress(); - } -} - -export class QueryBatchSwapCall extends ethereum.Call { - get inputs(): QueryBatchSwapCall__Inputs { - return new QueryBatchSwapCall__Inputs(this); - } - - get outputs(): QueryBatchSwapCall__Outputs { - return new QueryBatchSwapCall__Outputs(this); - } -} - -export class QueryBatchSwapCall__Inputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - QueryBatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): QueryBatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class QueryBatchSwapCall__Outputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class QueryBatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class QueryBatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class RegisterPoolCall extends ethereum.Call { - get inputs(): RegisterPoolCall__Inputs { - return new RegisterPoolCall__Inputs(this); - } - - get outputs(): RegisterPoolCall__Outputs { - return new RegisterPoolCall__Outputs(this); - } -} - -export class RegisterPoolCall__Inputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get specialization(): i32 { - return this._call.inputValues[0].value.toI32(); - } -} - -export class RegisterPoolCall__Outputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get value0(): Bytes { - return this._call.outputValues[0].value.toBytes(); - } -} - -export class RegisterTokensCall extends ethereum.Call { - get inputs(): RegisterTokensCall__Inputs { - return new RegisterTokensCall__Inputs(this); - } - - get outputs(): RegisterTokensCall__Outputs { - return new RegisterTokensCall__Outputs(this); - } -} - -export class RegisterTokensCall__Inputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } -} - -export class RegisterTokensCall__Outputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } -} - -export class SetAuthorizerCall extends ethereum.Call { - get inputs(): SetAuthorizerCall__Inputs { - return new SetAuthorizerCall__Inputs(this); - } - - get outputs(): SetAuthorizerCall__Outputs { - return new SetAuthorizerCall__Outputs(this); - } -} - -export class SetAuthorizerCall__Inputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } - - get newAuthorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetAuthorizerCall__Outputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetRelayerApprovalCall extends ethereum.Call { - get inputs(): SetRelayerApprovalCall__Inputs { - return new SetRelayerApprovalCall__Inputs(this); - } - - get outputs(): SetRelayerApprovalCall__Outputs { - return new SetRelayerApprovalCall__Outputs(this); - } -} - -export class SetRelayerApprovalCall__Inputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get relayer(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get approved(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } -} - -export class SetRelayerApprovalCall__Outputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get singleSwap(): SwapCallSingleSwapStruct { - return changetype( - this._call.inputValues[0].value.toTuple() - ); - } - - get funds(): SwapCallFundsStruct { - return changetype( - this._call.inputValues[1].value.toTuple() - ); - } - - get limit(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amountCalculated(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class SwapCallSingleSwapStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get kind(): i32 { - return this[1].toI32(); - } - - get assetIn(): Address { - return this[2].toAddress(); - } - - get assetOut(): Address { - return this[3].toAddress(); - } - - get amount(): BigInt { - return this[4].toBigInt(); - } - - get userData(): Bytes { - return this[5].toBytes(); - } -} - -export class SwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV1/ERC20.ts b/subgraphs/ethereum/generated/OHMDAIBondV1/ERC20.ts deleted file mode 100644 index bbe93783..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV1/ERC20.ts +++ /dev/null @@ -1,394 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ERC20 extends ethereum.SmartContract { - static bind(address: Address): ERC20 { - return new ERC20("ERC20", address); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - approve(_spender: Address, _value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_approve(_spender: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transferFrom(_from: Address, _to: Address, _value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - _from: Address, - _to: Address, - _value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - balanceOf(_owner: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(_owner: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - transfer(_to: Address, _value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(_to: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - allowance(_owner: Address, _spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - _owner: Address, - _spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get _spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get _from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DefaultCall extends ethereum.Call { - get inputs(): DefaultCall__Inputs { - return new DefaultCall__Inputs(this); - } - - get outputs(): DefaultCall__Outputs { - return new DefaultCall__Outputs(this); - } -} - -export class DefaultCall__Inputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} - -export class DefaultCall__Outputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV1/OHMDAIBondV1.ts b/subgraphs/ethereum/generated/OHMDAIBondV1/OHMDAIBondV1.ts deleted file mode 100644 index 107de93c..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV1/OHMDAIBondV1.ts +++ /dev/null @@ -1,1018 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OHMDAIBondV1__depositorInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getPrincipleValue(): BigInt { - return this.value0; - } - - getPayoutRemaining(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getVestingPeriod(): BigInt { - return this.value3; - } -} - -export class OHMDAIBondV1__getDepositorInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - get_principleValue(): BigInt { - return this.value0; - } - - get_payoutRemaining(): BigInt { - return this.value1; - } - - get_lastBlock(): BigInt { - return this.value2; - } - - get_vestingPeriod(): BigInt { - return this.value3; - } -} - -export class OHMDAIBondV1 extends ethereum.SmartContract { - static bind(address: Address): OHMDAIBondV1 { - return new OHMDAIBondV1("OHMDAIBondV1", address); - } - - DAOShare(): BigInt { - const result = super.call("DAOShare", "DAOShare():(uint256)", []); - - return result[0].toBigInt(); - } - - try_DAOShare(): ethereum.CallResult { - const result = super.tryCall("DAOShare", "DAOShare():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - DAOWallet(): Address { - const result = super.call("DAOWallet", "DAOWallet():(address)", []); - - return result[0].toAddress(); - } - - try_DAOWallet(): ethereum.CallResult
{ - const result = super.tryCall("DAOWallet", "DAOWallet():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondControlVariable(): BigInt { - const result = super.call( - "bondControlVariable", - "bondControlVariable():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_bondControlVariable(): ethereum.CallResult { - const result = super.tryCall( - "bondControlVariable", - "bondControlVariable():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculateBondInterest(amountToDeposit_: BigInt): BigInt { - const result = super.call( - "calculateBondInterest", - "calculateBondInterest(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amountToDeposit_)] - ); - - return result[0].toBigInt(); - } - - try_calculateBondInterest( - amountToDeposit_: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "calculateBondInterest", - "calculateBondInterest(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amountToDeposit_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculatePendingPayout(depositor_: Address): BigInt { - const result = super.call( - "calculatePendingPayout", - "calculatePendingPayout(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - - return result[0].toBigInt(); - } - - try_calculatePendingPayout(depositor_: Address): ethereum.CallResult { - const result = super.tryCall( - "calculatePendingPayout", - "calculatePendingPayout(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculatePercentVested(depositor_: Address): BigInt { - const result = super.call( - "calculatePercentVested", - "calculatePercentVested(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - - return result[0].toBigInt(); - } - - try_calculatePercentVested(depositor_: Address): ethereum.CallResult { - const result = super.tryCall( - "calculatePercentVested", - "calculatePercentVested(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calculatePremium(): BigInt { - const result = super.call( - "calculatePremium", - "calculatePremium():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_calculatePremium(): ethereum.CallResult { - const result = super.tryCall( - "calculatePremium", - "calculatePremium():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - depositBondPrinciple(amountToDeposit_: BigInt): boolean { - const result = super.call( - "depositBondPrinciple", - "depositBondPrinciple(uint256):(bool)", - [ethereum.Value.fromUnsignedBigInt(amountToDeposit_)] - ); - - return result[0].toBoolean(); - } - - try_depositBondPrinciple( - amountToDeposit_: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "depositBondPrinciple", - "depositBondPrinciple(uint256):(bool)", - [ethereum.Value.fromUnsignedBigInt(amountToDeposit_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - depositBondPrincipleWithPermit( - amountToDeposit_: BigInt, - deadline: BigInt, - v: i32, - r: Bytes, - s: Bytes - ): boolean { - const result = super.call( - "depositBondPrincipleWithPermit", - "depositBondPrincipleWithPermit(uint256,uint256,uint8,bytes32,bytes32):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(amountToDeposit_), - ethereum.Value.fromUnsignedBigInt(deadline), - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(v)), - ethereum.Value.fromFixedBytes(r), - ethereum.Value.fromFixedBytes(s) - ] - ); - - return result[0].toBoolean(); - } - - try_depositBondPrincipleWithPermit( - amountToDeposit_: BigInt, - deadline: BigInt, - v: i32, - r: Bytes, - s: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "depositBondPrincipleWithPermit", - "depositBondPrincipleWithPermit(uint256,uint256,uint8,bytes32,bytes32):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(amountToDeposit_), - ethereum.Value.fromUnsignedBigInt(deadline), - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(v)), - ethereum.Value.fromFixedBytes(r), - ethereum.Value.fromFixedBytes(s) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - depositorInfo(param0: Address): OHMDAIBondV1__depositorInfoResult { - const result = super.call( - "depositorInfo", - "depositorInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new OHMDAIBondV1__depositorInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_depositorInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "depositorInfo", - "depositorInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMDAIBondV1__depositorInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - getDepositorInfo( - depositorAddress_: Address - ): OHMDAIBondV1__getDepositorInfoResult { - const result = super.call( - "getDepositorInfo", - "getDepositorInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(depositorAddress_)] - ); - - return new OHMDAIBondV1__getDepositorInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_getDepositorInfo( - depositorAddress_: Address - ): ethereum.CallResult { - const result = super.tryCall( - "getDepositorInfo", - "getDepositorInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(depositorAddress_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMDAIBondV1__getDepositorInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - initialize(principleToken_: Address, OHM_: Address): boolean { - const result = super.call( - "initialize", - "initialize(address,address):(bool)", - [ - ethereum.Value.fromAddress(principleToken_), - ethereum.Value.fromAddress(OHM_) - ] - ); - - return result[0].toBoolean(); - } - - try_initialize( - principleToken_: Address, - OHM_: Address - ): ethereum.CallResult { - const result = super.tryCall( - "initialize", - "initialize(address,address):(bool)", - [ - ethereum.Value.fromAddress(principleToken_), - ethereum.Value.fromAddress(OHM_) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - isInitialized(): boolean { - const result = super.call("isInitialized", "isInitialized():(bool)", []); - - return result[0].toBoolean(); - } - - try_isInitialized(): ethereum.CallResult { - const result = super.tryCall("isInitialized", "isInitialized():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - minPremium(): BigInt { - const result = super.call("minPremium", "minPremium():(uint256)", []); - - return result[0].toBigInt(); - } - - try_minPremium(): ethereum.CallResult { - const result = super.tryCall("minPremium", "minPremium():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - owner(): Address { - const result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - const result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - principleToken(): Address { - const result = super.call("principleToken", "principleToken():(address)", []); - - return result[0].toAddress(); - } - - try_principleToken(): ethereum.CallResult
{ - const result = super.tryCall( - "principleToken", - "principleToken():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - redeemBond(): boolean { - const result = super.call("redeemBond", "redeemBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_redeemBond(): ethereum.CallResult { - const result = super.tryCall("redeemBond", "redeemBond():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - setAddresses( - bondCalculator_: Address, - treasury_: Address, - stakingContract_: Address, - DAOWallet_: Address, - DAOShare_: BigInt - ): boolean { - const result = super.call( - "setAddresses", - "setAddresses(address,address,address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(bondCalculator_), - ethereum.Value.fromAddress(treasury_), - ethereum.Value.fromAddress(stakingContract_), - ethereum.Value.fromAddress(DAOWallet_), - ethereum.Value.fromUnsignedBigInt(DAOShare_) - ] - ); - - return result[0].toBoolean(); - } - - try_setAddresses( - bondCalculator_: Address, - treasury_: Address, - stakingContract_: Address, - DAOWallet_: Address, - DAOShare_: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "setAddresses", - "setAddresses(address,address,address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(bondCalculator_), - ethereum.Value.fromAddress(treasury_), - ethereum.Value.fromAddress(stakingContract_), - ethereum.Value.fromAddress(DAOWallet_), - ethereum.Value.fromUnsignedBigInt(DAOShare_) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - setBondTerms( - bondControlVariable_: BigInt, - vestingPeriodInBlocks_: BigInt, - minPremium_: BigInt - ): boolean { - const result = super.call( - "setBondTerms", - "setBondTerms(uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(bondControlVariable_), - ethereum.Value.fromUnsignedBigInt(vestingPeriodInBlocks_), - ethereum.Value.fromUnsignedBigInt(minPremium_) - ] - ); - - return result[0].toBoolean(); - } - - try_setBondTerms( - bondControlVariable_: BigInt, - vestingPeriodInBlocks_: BigInt, - minPremium_: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "setBondTerms", - "setBondTerms(uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(bondControlVariable_), - ethereum.Value.fromUnsignedBigInt(vestingPeriodInBlocks_), - ethereum.Value.fromUnsignedBigInt(minPremium_) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - stakingContract(): Address { - const result = super.call( - "stakingContract", - "stakingContract():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_stakingContract(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingContract", - "stakingContract():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - vestingPeriodInBlocks(): BigInt { - const result = super.call( - "vestingPeriodInBlocks", - "vestingPeriodInBlocks():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_vestingPeriodInBlocks(): ethereum.CallResult { - const result = super.tryCall( - "vestingPeriodInBlocks", - "vestingPeriodInBlocks():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class DepositBondPrincipleCall extends ethereum.Call { - get inputs(): DepositBondPrincipleCall__Inputs { - return new DepositBondPrincipleCall__Inputs(this); - } - - get outputs(): DepositBondPrincipleCall__Outputs { - return new DepositBondPrincipleCall__Outputs(this); - } -} - -export class DepositBondPrincipleCall__Inputs { - _call: DepositBondPrincipleCall; - - constructor(call: DepositBondPrincipleCall) { - this._call = call; - } - - get amountToDeposit_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class DepositBondPrincipleCall__Outputs { - _call: DepositBondPrincipleCall; - - constructor(call: DepositBondPrincipleCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DepositBondPrincipleWithPermitCall extends ethereum.Call { - get inputs(): DepositBondPrincipleWithPermitCall__Inputs { - return new DepositBondPrincipleWithPermitCall__Inputs(this); - } - - get outputs(): DepositBondPrincipleWithPermitCall__Outputs { - return new DepositBondPrincipleWithPermitCall__Outputs(this); - } -} - -export class DepositBondPrincipleWithPermitCall__Inputs { - _call: DepositBondPrincipleWithPermitCall; - - constructor(call: DepositBondPrincipleWithPermitCall) { - this._call = call; - } - - get amountToDeposit_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[2].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[4].value.toBytes(); - } -} - -export class DepositBondPrincipleWithPermitCall__Outputs { - _call: DepositBondPrincipleWithPermitCall; - - constructor(call: DepositBondPrincipleWithPermitCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get principleToken_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get OHM_(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemBondCall extends ethereum.Call { - get inputs(): RedeemBondCall__Inputs { - return new RedeemBondCall__Inputs(this); - } - - get outputs(): RedeemBondCall__Outputs { - return new RedeemBondCall__Outputs(this); - } -} - -export class RedeemBondCall__Inputs { - _call: RedeemBondCall; - - constructor(call: RedeemBondCall) { - this._call = call; - } -} - -export class RedeemBondCall__Outputs { - _call: RedeemBondCall; - - constructor(call: RedeemBondCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RenounceOwnershipCall extends ethereum.Call { - get inputs(): RenounceOwnershipCall__Inputs { - return new RenounceOwnershipCall__Inputs(this); - } - - get outputs(): RenounceOwnershipCall__Outputs { - return new RenounceOwnershipCall__Outputs(this); - } -} - -export class RenounceOwnershipCall__Inputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall__Outputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class SetAddressesCall extends ethereum.Call { - get inputs(): SetAddressesCall__Inputs { - return new SetAddressesCall__Inputs(this); - } - - get outputs(): SetAddressesCall__Outputs { - return new SetAddressesCall__Outputs(this); - } -} - -export class SetAddressesCall__Inputs { - _call: SetAddressesCall; - - constructor(call: SetAddressesCall) { - this._call = call; - } - - get bondCalculator_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get treasury_(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get stakingContract_(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get DAOWallet_(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get DAOShare_(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } -} - -export class SetAddressesCall__Outputs { - _call: SetAddressesCall; - - constructor(call: SetAddressesCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get bondControlVariable_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get vestingPeriodInBlocks_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get minPremium_(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV1/UniswapV2Pair.ts b/subgraphs/ethereum/generated/OHMDAIBondV1/UniswapV2Pair.ts deleted file mode 100644 index b36eea33..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV1/UniswapV2Pair.ts +++ /dev/null @@ -1,1092 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Burn extends ethereum.Event { - get params(): Burn__Params { - return new Burn__Params(this); - } -} - -export class Burn__Params { - _event: Burn; - - constructor(event: Burn) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[3].value.toAddress(); - } -} - -export class Mint extends ethereum.Event { - get params(): Mint__Params { - return new Mint__Params(this); - } -} - -export class Mint__Params { - _event: Mint; - - constructor(event: Mint) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0In(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1In(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get amount0Out(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[5].value.toAddress(); - } -} - -export class Sync extends ethereum.Event { - get params(): Sync__Params { - return new Sync__Params(this); - } -} - -export class Sync__Params { - _event: Sync; - - constructor(event: Sync) { - this._event = event; - } - - get reserve0(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get reserve1(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class UniswapV2Pair__burnResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } - - getAmount0(): BigInt { - return this.value0; - } - - getAmount1(): BigInt { - return this.value1; - } -} - -export class UniswapV2Pair__getReservesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - get_reserve0(): BigInt { - return this.value0; - } - - get_reserve1(): BigInt { - return this.value1; - } - - get_blockTimestampLast(): BigInt { - return this.value2; - } -} - -export class UniswapV2Pair extends ethereum.SmartContract { - static bind(address: Address): UniswapV2Pair { - return new UniswapV2Pair("UniswapV2Pair", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - MINIMUM_LIQUIDITY(): BigInt { - const result = super.call( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_MINIMUM_LIQUIDITY(): ethereum.CallResult { - const result = super.tryCall( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(param0: Address, param1: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - - return result[0].toBigInt(); - } - - try_allowance(param0: Address, param1: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(param0: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(param0: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - burn(to: Address): UniswapV2Pair__burnResult { - const result = super.call("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return new UniswapV2Pair__burnResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_burn(to: Address): ethereum.CallResult { - const result = super.tryCall("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__burnResult(value[0].toBigInt(), value[1].toBigInt()) - ); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - factory(): Address { - const result = super.call("factory", "factory():(address)", []); - - return result[0].toAddress(); - } - - try_factory(): ethereum.CallResult
{ - const result = super.tryCall("factory", "factory():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getReserves(): UniswapV2Pair__getReservesResult { - const result = super.call( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - - return new UniswapV2Pair__getReservesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getReserves(): ethereum.CallResult { - const result = super.tryCall( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__getReservesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - kLast(): BigInt { - const result = super.call("kLast", "kLast():(uint256)", []); - - return result[0].toBigInt(); - } - - try_kLast(): ethereum.CallResult { - const result = super.tryCall("kLast", "kLast():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - mint(to: Address): BigInt { - const result = super.call("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return result[0].toBigInt(); - } - - try_mint(to: Address): ethereum.CallResult { - const result = super.tryCall("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(param0: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_nonces(param0: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price0CumulativeLast(): BigInt { - const result = super.call( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price0CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price1CumulativeLast(): BigInt { - const result = super.call( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price1CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - token0(): Address { - const result = super.call("token0", "token0():(address)", []); - - return result[0].toAddress(); - } - - try_token0(): ethereum.CallResult
{ - const result = super.tryCall("token0", "token0():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - token1(): Address { - const result = super.call("token1", "token1():(address)", []); - - return result[0].toAddress(); - } - - try_token1(): ethereum.CallResult
{ - const result = super.tryCall("token1", "token1():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class BurnCall extends ethereum.Call { - get inputs(): BurnCall__Inputs { - return new BurnCall__Inputs(this); - } - - get outputs(): BurnCall__Outputs { - return new BurnCall__Outputs(this); - } -} - -export class BurnCall__Inputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class BurnCall__Outputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get amount0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amount1(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _token0(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _token1(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class MintCall extends ethereum.Call { - get inputs(): MintCall__Inputs { - return new MintCall__Inputs(this); - } - - get outputs(): MintCall__Outputs { - return new MintCall__Outputs(this); - } -} - -export class MintCall__Inputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class MintCall__Outputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get liquidity(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class SkimCall extends ethereum.Call { - get inputs(): SkimCall__Inputs { - return new SkimCall__Inputs(this); - } - - get outputs(): SkimCall__Outputs { - return new SkimCall__Outputs(this); - } -} - -export class SkimCall__Inputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SkimCall__Outputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amount0Out(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get to(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get data(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } -} - -export class SyncCall extends ethereum.Call { - get inputs(): SyncCall__Inputs { - return new SyncCall__Inputs(this); - } - - get outputs(): SyncCall__Outputs { - return new SyncCall__Outputs(this); - } -} - -export class SyncCall__Inputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class SyncCall__Outputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV2/BalancerPoolToken.ts b/subgraphs/ethereum/generated/OHMDAIBondV2/BalancerPoolToken.ts deleted file mode 100644 index e1efa45b..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV2/BalancerPoolToken.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class SwapFeePercentageChanged extends ethereum.Event { - get params(): SwapFeePercentageChanged__Params { - return new SwapFeePercentageChanged__Params(this); - } -} - -export class SwapFeePercentageChanged__Params { - _event: SwapFeePercentageChanged; - - constructor(event: SwapFeePercentageChanged) { - this._event = event; - } - - get swapFeePercentage(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BalancerPoolToken__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerPoolToken__onExitPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onJoinPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onSwapInputRequestStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get tokenIn(): Address { - return this[1].toAddress(); - } - - get tokenOut(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get poolId(): Bytes { - return this[4].toBytes(); - } - - get lastChangeBlock(): BigInt { - return this[5].toBigInt(); - } - - get from(): Address { - return this[6].toAddress(); - } - - get to(): Address { - return this[7].toAddress(); - } - - get userData(): Bytes { - return this[8].toBytes(); - } -} - -export class BalancerPoolToken__queryExitResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptIn(): BigInt { - return this.value0; - } - - getAmountsOut(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__queryJoinResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptOut(): BigInt { - return this.value0; - } - - getAmountsIn(): Array { - return this.value1; - } -} - -export class BalancerPoolToken extends ethereum.SmartContract { - static bind(address: Address): BalancerPoolToken { - return new BalancerPoolToken("BalancerPoolToken", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getInvariant(): BigInt { - const result = super.call("getInvariant", "getInvariant():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getInvariant(): ethereum.CallResult { - const result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getLastInvariant(): BigInt { - const result = super.call( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getLastInvariant(): ethereum.CallResult { - const result = super.tryCall( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getNormalizedWeights(): Array { - const result = super.call( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - - return result[0].toBigIntArray(); - } - - try_getNormalizedWeights(): ethereum.CallResult> { - const result = super.tryCall( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getOwner(): Address { - const result = super.call("getOwner", "getOwner():(address)", []); - - return result[0].toAddress(); - } - - try_getOwner(): ethereum.CallResult
{ - const result = super.tryCall("getOwner", "getOwner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getPausedState(): BalancerPoolToken__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerPoolToken__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerPoolToken__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPoolId(): Bytes { - const result = super.call("getPoolId", "getPoolId():(bytes32)", []); - - return result[0].toBytes(); - } - - try_getPoolId(): ethereum.CallResult { - const result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getRate(): BigInt { - const result = super.call("getRate", "getRate():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getRate(): ethereum.CallResult { - const result = super.tryCall("getRate", "getRate():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getSwapFeePercentage(): BigInt { - const result = super.call( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getSwapFeePercentage(): ethereum.CallResult { - const result = super.tryCall( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getVault(): Address { - const result = super.call("getVault", "getVault():(address)", []); - - return result[0].toAddress(); - } - - try_getVault(): ethereum.CallResult
{ - const result = super.tryCall("getVault", "getVault():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - increaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onExitPoolResult { - const result = super.call( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onExitPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onExitPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onJoinPoolResult { - const result = super.call( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onJoinPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onJoinPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): BigInt { - const result = super.call( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - - return result[0].toBigInt(); - } - - try_onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryExitResult { - const result = super.call( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryExitResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryExitResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryJoinResult { - const result = super.call( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryJoinResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryJoinResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get vault(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get name(): string { - return this._call.inputValues[1].value.toString(); - } - - get symbol(): string { - return this._call.inputValues[2].value.toString(); - } - - get tokens(): Array
{ - return this._call.inputValues[3].value.toAddressArray(); - } - - get normalizedWeights(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[7].value.toBigInt(); - } - - get owner(): Address { - return this._call.inputValues[8].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DecreaseApprovalCall extends ethereum.Call { - get inputs(): DecreaseApprovalCall__Inputs { - return new DecreaseApprovalCall__Inputs(this); - } - - get outputs(): DecreaseApprovalCall__Outputs { - return new DecreaseApprovalCall__Outputs(this); - } -} - -export class DecreaseApprovalCall__Inputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseApprovalCall__Outputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseApprovalCall extends ethereum.Call { - get inputs(): IncreaseApprovalCall__Inputs { - return new IncreaseApprovalCall__Inputs(this); - } - - get outputs(): IncreaseApprovalCall__Outputs { - return new IncreaseApprovalCall__Outputs(this); - } -} - -export class IncreaseApprovalCall__Inputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseApprovalCall__Outputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class OnExitPoolCall extends ethereum.Call { - get inputs(): OnExitPoolCall__Inputs { - return new OnExitPoolCall__Inputs(this); - } - - get outputs(): OnExitPoolCall__Outputs { - return new OnExitPoolCall__Outputs(this); - } -} - -export class OnExitPoolCall__Inputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnExitPoolCall__Outputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class OnJoinPoolCall extends ethereum.Call { - get inputs(): OnJoinPoolCall__Inputs { - return new OnJoinPoolCall__Inputs(this); - } - - get outputs(): OnJoinPoolCall__Outputs { - return new OnJoinPoolCall__Outputs(this); - } -} - -export class OnJoinPoolCall__Inputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnJoinPoolCall__Outputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class QueryExitCall extends ethereum.Call { - get inputs(): QueryExitCall__Inputs { - return new QueryExitCall__Inputs(this); - } - - get outputs(): QueryExitCall__Outputs { - return new QueryExitCall__Outputs(this); - } -} - -export class QueryExitCall__Inputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryExitCall__Outputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get bptIn(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsOut(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class QueryJoinCall extends ethereum.Call { - get inputs(): QueryJoinCall__Inputs { - return new QueryJoinCall__Inputs(this); - } - - get outputs(): QueryJoinCall__Outputs { - return new QueryJoinCall__Outputs(this); - } -} - -export class QueryJoinCall__Inputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryJoinCall__Outputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get bptOut(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsIn(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetSwapFeePercentageCall extends ethereum.Call { - get inputs(): SetSwapFeePercentageCall__Inputs { - return new SetSwapFeePercentageCall__Inputs(this); - } - - get outputs(): SetSwapFeePercentageCall__Outputs { - return new SetSwapFeePercentageCall__Outputs(this); - } -} - -export class SetSwapFeePercentageCall__Inputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetSwapFeePercentageCall__Outputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV2/BalancerVault.ts b/subgraphs/ethereum/generated/OHMDAIBondV2/BalancerVault.ts deleted file mode 100644 index 41f94648..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV2/BalancerVault.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class AuthorizerChanged extends ethereum.Event { - get params(): AuthorizerChanged__Params { - return new AuthorizerChanged__Params(this); - } -} - -export class AuthorizerChanged__Params { - _event: AuthorizerChanged; - - constructor(event: AuthorizerChanged) { - this._event = event; - } - - get newAuthorizer(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class ExternalBalanceTransfer extends ethereum.Event { - get params(): ExternalBalanceTransfer__Params { - return new ExternalBalanceTransfer__Params(this); - } -} - -export class ExternalBalanceTransfer__Params { - _event: ExternalBalanceTransfer; - - constructor(event: ExternalBalanceTransfer) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get recipient(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class FlashLoan extends ethereum.Event { - get params(): FlashLoan__Params { - return new FlashLoan__Params(this); - } -} - -export class FlashLoan__Params { - _event: FlashLoan; - - constructor(event: FlashLoan) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get feeAmount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class InternalBalanceChanged extends ethereum.Event { - get params(): InternalBalanceChanged__Params { - return new InternalBalanceChanged__Params(this); - } -} - -export class InternalBalanceChanged__Params { - _event: InternalBalanceChanged; - - constructor(event: InternalBalanceChanged) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get delta(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class PoolBalanceChanged extends ethereum.Event { - get params(): PoolBalanceChanged__Params { - return new PoolBalanceChanged__Params(this); - } -} - -export class PoolBalanceChanged__Params { - _event: PoolBalanceChanged; - - constructor(event: PoolBalanceChanged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get liquidityProvider(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokens(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } - - get deltas(): Array { - return this._event.parameters[3].value.toBigIntArray(); - } - - get protocolFeeAmounts(): Array { - return this._event.parameters[4].value.toBigIntArray(); - } -} - -export class PoolBalanceManaged extends ethereum.Event { - get params(): PoolBalanceManaged__Params { - return new PoolBalanceManaged__Params(this); - } -} - -export class PoolBalanceManaged__Params { - _event: PoolBalanceManaged; - - constructor(event: PoolBalanceManaged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get assetManager(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get cashDelta(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get managedDelta(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class PoolRegistered extends ethereum.Event { - get params(): PoolRegistered__Params { - return new PoolRegistered__Params(this); - } -} - -export class PoolRegistered__Params { - _event: PoolRegistered; - - constructor(event: PoolRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get poolAddress(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get specialization(): i32 { - return this._event.parameters[2].value.toI32(); - } -} - -export class RelayerApprovalChanged extends ethereum.Event { - get params(): RelayerApprovalChanged__Params { - return new RelayerApprovalChanged__Params(this); - } -} - -export class RelayerApprovalChanged__Params { - _event: RelayerApprovalChanged; - - constructor(event: RelayerApprovalChanged) { - this._event = event; - } - - get relayer(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get approved(): boolean { - return this._event.parameters[2].value.toBoolean(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokenIn(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokenOut(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amountIn(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amountOut(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class TokensDeregistered extends ethereum.Event { - get params(): TokensDeregistered__Params { - return new TokensDeregistered__Params(this); - } -} - -export class TokensDeregistered__Params { - _event: TokensDeregistered; - - constructor(event: TokensDeregistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } -} - -export class TokensRegistered extends ethereum.Event { - get params(): TokensRegistered__Params { - return new TokensRegistered__Params(this); - } -} - -export class TokensRegistered__Params { - _event: TokensRegistered; - - constructor(event: TokensRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } -} - -export class BalancerVault__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerVault__getPoolResult { - value0: Address; - value1: i32; - - constructor(value0: Address, value1: i32) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddress(this.value0)); - map.set( - "value1", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) - ); - return map; - } - - getValue0(): Address { - return this.value0; - } - - getValue1(): i32 { - return this.value1; - } -} - -export class BalancerVault__getPoolTokenInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: Address; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: Address) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromAddress(this.value3)); - return map; - } - - getCash(): BigInt { - return this.value0; - } - - getManaged(): BigInt { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } - - getAssetManager(): Address { - return this.value3; - } -} - -export class BalancerVault__getPoolTokensResult { - value0: Array
; - value1: Array; - value2: BigInt; - - constructor(value0: Array
, value1: Array, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddressArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getTokens(): Array
{ - return this.value0; - } - - getBalances(): Array { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } -} - -export class BalancerVault__queryBatchSwapInputSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BalancerVault__queryBatchSwapInputFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class BalancerVault extends ethereum.SmartContract { - static bind(address: Address): BalancerVault { - return new BalancerVault("BalancerVault", address); - } - - WETH(): Address { - const result = super.call("WETH", "WETH():(address)", []); - - return result[0].toAddress(); - } - - try_WETH(): ethereum.CallResult
{ - const result = super.tryCall("WETH", "WETH():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getDomainSeparator(): Bytes { - const result = super.call( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_getDomainSeparator(): ethereum.CallResult { - const result = super.tryCall( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getInternalBalance(user: Address, tokens: Array
): Array { - const result = super.call( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - - return result[0].toBigIntArray(); - } - - try_getInternalBalance( - user: Address, - tokens: Array
- ): ethereum.CallResult> { - const result = super.tryCall( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getNextNonce(user: Address): BigInt { - const result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ - ethereum.Value.fromAddress(user) - ]); - - return result[0].toBigInt(); - } - - try_getNextNonce(user: Address): ethereum.CallResult { - const result = super.tryCall( - "getNextNonce", - "getNextNonce(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getPausedState(): BalancerVault__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerVault__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerVault__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPool(poolId: Bytes): BalancerVault__getPoolResult { - const result = super.call("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - - return new BalancerVault__getPoolResult( - result[0].toAddress(), - result[1].toI32() - ); - } - - try_getPool( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolResult(value[0].toAddress(), value[1].toI32()) - ); - } - - getPoolTokenInfo( - poolId: Bytes, - token: Address - ): BalancerVault__getPoolTokenInfoResult { - const result = super.call( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - - return new BalancerVault__getPoolTokenInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toAddress() - ); - } - - try_getPoolTokenInfo( - poolId: Bytes, - token: Address - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokenInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toAddress() - ) - ); - } - - getPoolTokens(poolId: Bytes): BalancerVault__getPoolTokensResult { - const result = super.call( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - - return new BalancerVault__getPoolTokensResult( - result[0].toAddressArray(), - result[1].toBigIntArray(), - result[2].toBigInt() - ); - } - - try_getPoolTokens( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokensResult( - value[0].toAddressArray(), - value[1].toBigIntArray(), - value[2].toBigInt() - ) - ); - } - - getProtocolFeesCollector(): Address { - const result = super.call( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_getProtocolFeesCollector(): ethereum.CallResult
{ - const result = super.tryCall( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - hasApprovedRelayer(user: Address, relayer: Address): boolean { - const result = super.call( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - - return result[0].toBoolean(); - } - - try_hasApprovedRelayer( - user: Address, - relayer: Address - ): ethereum.CallResult { - const result = super.tryCall( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): Array { - const result = super.call( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - - return result[0].toBigIntArray(); - } - - try_queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): ethereum.CallResult> { - const result = super.tryCall( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - registerPool(specialization: i32): Bytes { - const result = super.call("registerPool", "registerPool(uint8):(bytes32)", [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization)) - ]); - - return result[0].toBytes(); - } - - try_registerPool(specialization: i32): ethereum.CallResult { - const result = super.tryCall( - "registerPool", - "registerPool(uint8):(bytes32)", - [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization))] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get authorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get weth(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class BatchSwapCall extends ethereum.Call { - get inputs(): BatchSwapCall__Inputs { - return new BatchSwapCall__Inputs(this); - } - - get outputs(): BatchSwapCall__Outputs { - return new BatchSwapCall__Outputs(this); - } -} - -export class BatchSwapCall__Inputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - BatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): BatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } - - get limits(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get deadline(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } -} - -export class BatchSwapCall__Outputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get assetDeltas(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class BatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class DeregisterTokensCall extends ethereum.Call { - get inputs(): DeregisterTokensCall__Inputs { - return new DeregisterTokensCall__Inputs(this); - } - - get outputs(): DeregisterTokensCall__Outputs { - return new DeregisterTokensCall__Outputs(this); - } -} - -export class DeregisterTokensCall__Inputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } -} - -export class DeregisterTokensCall__Outputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } -} - -export class ExitPoolCall extends ethereum.Call { - get inputs(): ExitPoolCall__Inputs { - return new ExitPoolCall__Inputs(this); - } - - get outputs(): ExitPoolCall__Outputs { - return new ExitPoolCall__Outputs(this); - } -} - -export class ExitPoolCall__Inputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): ExitPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class ExitPoolCall__Outputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } -} - -export class ExitPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get minAmountsOut(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class FlashLoanCall extends ethereum.Call { - get inputs(): FlashLoanCall__Inputs { - return new FlashLoanCall__Inputs(this); - } - - get outputs(): FlashLoanCall__Outputs { - return new FlashLoanCall__Outputs(this); - } -} - -export class FlashLoanCall__Inputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get amounts(): Array { - return this._call.inputValues[2].value.toBigIntArray(); - } - - get userData(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class FlashLoanCall__Outputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } -} - -export class JoinPoolCall extends ethereum.Call { - get inputs(): JoinPoolCall__Inputs { - return new JoinPoolCall__Inputs(this); - } - - get outputs(): JoinPoolCall__Outputs { - return new JoinPoolCall__Outputs(this); - } -} - -export class JoinPoolCall__Inputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): JoinPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class JoinPoolCall__Outputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } -} - -export class JoinPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get maxAmountsIn(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get fromInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class ManagePoolBalanceCall extends ethereum.Call { - get inputs(): ManagePoolBalanceCall__Inputs { - return new ManagePoolBalanceCall__Inputs(this); - } - - get outputs(): ManagePoolBalanceCall__Outputs { - return new ManagePoolBalanceCall__Outputs(this); - } -} - -export class ManagePoolBalanceCall__Inputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManagePoolBalanceCallOpsStruct - >(); - } -} - -export class ManagePoolBalanceCall__Outputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } -} - -export class ManagePoolBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get poolId(): Bytes { - return this[1].toBytes(); - } - - get token(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } -} - -export class ManageUserBalanceCall extends ethereum.Call { - get inputs(): ManageUserBalanceCall__Inputs { - return new ManageUserBalanceCall__Inputs(this); - } - - get outputs(): ManageUserBalanceCall__Outputs { - return new ManageUserBalanceCall__Outputs(this); - } -} - -export class ManageUserBalanceCall__Inputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManageUserBalanceCallOpsStruct - >(); - } -} - -export class ManageUserBalanceCall__Outputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } -} - -export class ManageUserBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get asset(): Address { - return this[1].toAddress(); - } - - get amount(): BigInt { - return this[2].toBigInt(); - } - - get sender(): Address { - return this[3].toAddress(); - } - - get recipient(): Address { - return this[4].toAddress(); - } -} - -export class QueryBatchSwapCall extends ethereum.Call { - get inputs(): QueryBatchSwapCall__Inputs { - return new QueryBatchSwapCall__Inputs(this); - } - - get outputs(): QueryBatchSwapCall__Outputs { - return new QueryBatchSwapCall__Outputs(this); - } -} - -export class QueryBatchSwapCall__Inputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - QueryBatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): QueryBatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class QueryBatchSwapCall__Outputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class QueryBatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class QueryBatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class RegisterPoolCall extends ethereum.Call { - get inputs(): RegisterPoolCall__Inputs { - return new RegisterPoolCall__Inputs(this); - } - - get outputs(): RegisterPoolCall__Outputs { - return new RegisterPoolCall__Outputs(this); - } -} - -export class RegisterPoolCall__Inputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get specialization(): i32 { - return this._call.inputValues[0].value.toI32(); - } -} - -export class RegisterPoolCall__Outputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get value0(): Bytes { - return this._call.outputValues[0].value.toBytes(); - } -} - -export class RegisterTokensCall extends ethereum.Call { - get inputs(): RegisterTokensCall__Inputs { - return new RegisterTokensCall__Inputs(this); - } - - get outputs(): RegisterTokensCall__Outputs { - return new RegisterTokensCall__Outputs(this); - } -} - -export class RegisterTokensCall__Inputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } -} - -export class RegisterTokensCall__Outputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } -} - -export class SetAuthorizerCall extends ethereum.Call { - get inputs(): SetAuthorizerCall__Inputs { - return new SetAuthorizerCall__Inputs(this); - } - - get outputs(): SetAuthorizerCall__Outputs { - return new SetAuthorizerCall__Outputs(this); - } -} - -export class SetAuthorizerCall__Inputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } - - get newAuthorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetAuthorizerCall__Outputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetRelayerApprovalCall extends ethereum.Call { - get inputs(): SetRelayerApprovalCall__Inputs { - return new SetRelayerApprovalCall__Inputs(this); - } - - get outputs(): SetRelayerApprovalCall__Outputs { - return new SetRelayerApprovalCall__Outputs(this); - } -} - -export class SetRelayerApprovalCall__Inputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get relayer(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get approved(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } -} - -export class SetRelayerApprovalCall__Outputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get singleSwap(): SwapCallSingleSwapStruct { - return changetype( - this._call.inputValues[0].value.toTuple() - ); - } - - get funds(): SwapCallFundsStruct { - return changetype( - this._call.inputValues[1].value.toTuple() - ); - } - - get limit(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amountCalculated(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class SwapCallSingleSwapStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get kind(): i32 { - return this[1].toI32(); - } - - get assetIn(): Address { - return this[2].toAddress(); - } - - get assetOut(): Address { - return this[3].toAddress(); - } - - get amount(): BigInt { - return this[4].toBigInt(); - } - - get userData(): Bytes { - return this[5].toBytes(); - } -} - -export class SwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV2/ERC20.ts b/subgraphs/ethereum/generated/OHMDAIBondV2/ERC20.ts deleted file mode 100644 index bbe93783..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV2/ERC20.ts +++ /dev/null @@ -1,394 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ERC20 extends ethereum.SmartContract { - static bind(address: Address): ERC20 { - return new ERC20("ERC20", address); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - approve(_spender: Address, _value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_approve(_spender: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transferFrom(_from: Address, _to: Address, _value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - _from: Address, - _to: Address, - _value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - balanceOf(_owner: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(_owner: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - transfer(_to: Address, _value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(_to: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - allowance(_owner: Address, _spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - _owner: Address, - _spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get _spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get _from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DefaultCall extends ethereum.Call { - get inputs(): DefaultCall__Inputs { - return new DefaultCall__Inputs(this); - } - - get outputs(): DefaultCall__Outputs { - return new DefaultCall__Outputs(this); - } -} - -export class DefaultCall__Inputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} - -export class DefaultCall__Outputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV2/OHMDAIBondV2.ts b/subgraphs/ethereum/generated/OHMDAIBondV2/OHMDAIBondV2.ts deleted file mode 100644 index 355c07ac..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV2/OHMDAIBondV2.ts +++ /dev/null @@ -1,953 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OHMDAIBondV2__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getValueRemaining(): BigInt { - return this.value0; - } - - getPayoutRemaining(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getVestingPeriod(): BigInt { - return this.value3; - } - - getPricePaid(): BigInt { - return this.value4; - } -} - -export class OHMDAIBondV2 extends ethereum.SmartContract { - static bind(address: Address): OHMDAIBondV2 { - return new OHMDAIBondV2("OHMDAIBondV2", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - DAOShare(): BigInt { - const result = super.call("DAOShare", "DAOShare():(uint256)", []); - - return result[0].toBigInt(); - } - - try_DAOShare(): ethereum.CallResult { - const result = super.tryCall("DAOShare", "DAOShare():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - LP(): Address { - const result = super.call("LP", "LP():(address)", []); - - return result[0].toAddress(); - } - - try_LP(): ethereum.CallResult
{ - const result = super.tryCall("LP", "LP():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): OHMDAIBondV2__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new OHMDAIBondV2__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMDAIBondV2__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInDAI(): BigInt { - const result = super.call("bondPriceInDAI", "bondPriceInDAI():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInDAI(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInDAI", - "bondPriceInDAI():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceWithoutFloor(): BigInt { - const result = super.call( - "bondPriceWithoutFloor", - "bondPriceWithoutFloor():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_bondPriceWithoutFloor(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceWithoutFloor", - "bondPriceWithoutFloor():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - circulatingOHMContract(): Address { - const result = super.call( - "circulatingOHMContract", - "circulatingOHMContract():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_circulatingOHMContract(): ethereum.CallResult
{ - const result = super.tryCall( - "circulatingOHMContract", - "circulatingOHMContract():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - controlVariable(): BigInt { - const result = super.call( - "controlVariable", - "controlVariable():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_controlVariable(): ethereum.CallResult { - const result = super.tryCall( - "controlVariable", - "controlVariable():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(amount_: BigInt, maxPremium_: BigInt, depositor_: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(amount_), - ethereum.Value.fromUnsignedBigInt(maxPremium_), - ethereum.Value.fromAddress(depositor_) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - amount_: BigInt, - maxPremium_: BigInt, - depositor_: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(amount_), - ethereum.Value.fromUnsignedBigInt(maxPremium_), - ethereum.Value.fromAddress(depositor_) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - distributor(): Address { - const result = super.call("distributor", "distributor():(address)", []); - - return result[0].toAddress(); - } - - try_distributor(): ethereum.CallResult
{ - const result = super.tryCall("distributor", "distributor():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - manager(): Address { - const result = super.call("manager", "manager():(address)", []); - - return result[0].toAddress(); - } - - try_manager(): ethereum.CallResult
{ - const result = super.tryCall("manager", "manager():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxPayoutPercent(): BigInt { - const result = super.call( - "maxPayoutPercent", - "maxPayoutPercent():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_maxPayoutPercent(): ethereum.CallResult { - const result = super.tryCall( - "maxPayoutPercent", - "maxPayoutPercent():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - minimumPrice(): BigInt { - const result = super.call("minimumPrice", "minimumPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_minimumPrice(): ethereum.CallResult { - const result = super.tryCall("minimumPrice", "minimumPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(value_: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(value_) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(value_: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(value_) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(depositor_: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(depositor_: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(depositor_: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(depositor_: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(depositor_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - recoverLostToken(token_: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(token_)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(token_: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(token_)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(): BigInt { - const result = super.call("redeem", "redeem():(uint256)", []); - - return result[0].toBigInt(); - } - - try_redeem(): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - setBondTerm( - controlVariable_: BigInt, - vestingTerm_: BigInt, - minPrice_: BigInt, - maxPayout_: BigInt, - DAOShare_: BigInt - ): boolean { - const result = super.call( - "setBondTerm", - "setBondTerm(uint256,uint256,uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(controlVariable_), - ethereum.Value.fromUnsignedBigInt(vestingTerm_), - ethereum.Value.fromUnsignedBigInt(minPrice_), - ethereum.Value.fromUnsignedBigInt(maxPayout_), - ethereum.Value.fromUnsignedBigInt(DAOShare_) - ] - ); - - return result[0].toBoolean(); - } - - try_setBondTerm( - controlVariable_: BigInt, - vestingTerm_: BigInt, - minPrice_: BigInt, - maxPayout_: BigInt, - DAOShare_: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "setBondTerm", - "setBondTerm(uint256,uint256,uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(controlVariable_), - ethereum.Value.fromUnsignedBigInt(vestingTerm_), - ethereum.Value.fromUnsignedBigInt(minPrice_), - ethereum.Value.fromUnsignedBigInt(maxPayout_), - ethereum.Value.fromUnsignedBigInt(DAOShare_) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - vestingTerm(): BigInt { - const result = super.call("vestingTerm", "vestingTerm():(uint256)", []); - - return result[0].toBigInt(); - } - - try_vestingTerm(): ethereum.CallResult { - const result = super.tryCall("vestingTerm", "vestingTerm():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get OHM_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get LP_(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get treasury_(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get distributor_(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get DAO_(): Address { - return this._call.inputValues[4].value.toAddress(); - } - - get circulatingOHMContract_(): Address { - return this._call.inputValues[5].value.toAddress(); - } - - get bondCalculator_(): Address { - return this._call.inputValues[6].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get amount_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get maxPremium_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get depositor_(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get token_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetBondTermCall extends ethereum.Call { - get inputs(): SetBondTermCall__Inputs { - return new SetBondTermCall__Inputs(this); - } - - get outputs(): SetBondTermCall__Outputs { - return new SetBondTermCall__Outputs(this); - } -} - -export class SetBondTermCall__Inputs { - _call: SetBondTermCall; - - constructor(call: SetBondTermCall) { - this._call = call; - } - - get controlVariable_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get vestingTerm_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get minPrice_(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get maxPayout_(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get DAOShare_(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } -} - -export class SetBondTermCall__Outputs { - _call: SetBondTermCall; - - constructor(call: SetBondTermCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV2/UniswapV2Pair.ts b/subgraphs/ethereum/generated/OHMDAIBondV2/UniswapV2Pair.ts deleted file mode 100644 index b36eea33..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV2/UniswapV2Pair.ts +++ /dev/null @@ -1,1092 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Burn extends ethereum.Event { - get params(): Burn__Params { - return new Burn__Params(this); - } -} - -export class Burn__Params { - _event: Burn; - - constructor(event: Burn) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[3].value.toAddress(); - } -} - -export class Mint extends ethereum.Event { - get params(): Mint__Params { - return new Mint__Params(this); - } -} - -export class Mint__Params { - _event: Mint; - - constructor(event: Mint) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0In(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1In(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get amount0Out(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[5].value.toAddress(); - } -} - -export class Sync extends ethereum.Event { - get params(): Sync__Params { - return new Sync__Params(this); - } -} - -export class Sync__Params { - _event: Sync; - - constructor(event: Sync) { - this._event = event; - } - - get reserve0(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get reserve1(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class UniswapV2Pair__burnResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } - - getAmount0(): BigInt { - return this.value0; - } - - getAmount1(): BigInt { - return this.value1; - } -} - -export class UniswapV2Pair__getReservesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - get_reserve0(): BigInt { - return this.value0; - } - - get_reserve1(): BigInt { - return this.value1; - } - - get_blockTimestampLast(): BigInt { - return this.value2; - } -} - -export class UniswapV2Pair extends ethereum.SmartContract { - static bind(address: Address): UniswapV2Pair { - return new UniswapV2Pair("UniswapV2Pair", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - MINIMUM_LIQUIDITY(): BigInt { - const result = super.call( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_MINIMUM_LIQUIDITY(): ethereum.CallResult { - const result = super.tryCall( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(param0: Address, param1: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - - return result[0].toBigInt(); - } - - try_allowance(param0: Address, param1: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(param0: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(param0: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - burn(to: Address): UniswapV2Pair__burnResult { - const result = super.call("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return new UniswapV2Pair__burnResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_burn(to: Address): ethereum.CallResult { - const result = super.tryCall("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__burnResult(value[0].toBigInt(), value[1].toBigInt()) - ); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - factory(): Address { - const result = super.call("factory", "factory():(address)", []); - - return result[0].toAddress(); - } - - try_factory(): ethereum.CallResult
{ - const result = super.tryCall("factory", "factory():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getReserves(): UniswapV2Pair__getReservesResult { - const result = super.call( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - - return new UniswapV2Pair__getReservesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getReserves(): ethereum.CallResult { - const result = super.tryCall( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__getReservesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - kLast(): BigInt { - const result = super.call("kLast", "kLast():(uint256)", []); - - return result[0].toBigInt(); - } - - try_kLast(): ethereum.CallResult { - const result = super.tryCall("kLast", "kLast():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - mint(to: Address): BigInt { - const result = super.call("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return result[0].toBigInt(); - } - - try_mint(to: Address): ethereum.CallResult { - const result = super.tryCall("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(param0: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_nonces(param0: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price0CumulativeLast(): BigInt { - const result = super.call( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price0CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price1CumulativeLast(): BigInt { - const result = super.call( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price1CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - token0(): Address { - const result = super.call("token0", "token0():(address)", []); - - return result[0].toAddress(); - } - - try_token0(): ethereum.CallResult
{ - const result = super.tryCall("token0", "token0():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - token1(): Address { - const result = super.call("token1", "token1():(address)", []); - - return result[0].toAddress(); - } - - try_token1(): ethereum.CallResult
{ - const result = super.tryCall("token1", "token1():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class BurnCall extends ethereum.Call { - get inputs(): BurnCall__Inputs { - return new BurnCall__Inputs(this); - } - - get outputs(): BurnCall__Outputs { - return new BurnCall__Outputs(this); - } -} - -export class BurnCall__Inputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class BurnCall__Outputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get amount0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amount1(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _token0(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _token1(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class MintCall extends ethereum.Call { - get inputs(): MintCall__Inputs { - return new MintCall__Inputs(this); - } - - get outputs(): MintCall__Outputs { - return new MintCall__Outputs(this); - } -} - -export class MintCall__Inputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class MintCall__Outputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get liquidity(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class SkimCall extends ethereum.Call { - get inputs(): SkimCall__Inputs { - return new SkimCall__Inputs(this); - } - - get outputs(): SkimCall__Outputs { - return new SkimCall__Outputs(this); - } -} - -export class SkimCall__Inputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SkimCall__Outputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amount0Out(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get to(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get data(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } -} - -export class SyncCall extends ethereum.Call { - get inputs(): SyncCall__Inputs { - return new SyncCall__Inputs(this); - } - - get outputs(): SyncCall__Outputs { - return new SyncCall__Outputs(this); - } -} - -export class SyncCall__Inputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class SyncCall__Outputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV3/BalancerPoolToken.ts b/subgraphs/ethereum/generated/OHMDAIBondV3/BalancerPoolToken.ts deleted file mode 100644 index e1efa45b..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV3/BalancerPoolToken.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class SwapFeePercentageChanged extends ethereum.Event { - get params(): SwapFeePercentageChanged__Params { - return new SwapFeePercentageChanged__Params(this); - } -} - -export class SwapFeePercentageChanged__Params { - _event: SwapFeePercentageChanged; - - constructor(event: SwapFeePercentageChanged) { - this._event = event; - } - - get swapFeePercentage(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BalancerPoolToken__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerPoolToken__onExitPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onJoinPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onSwapInputRequestStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get tokenIn(): Address { - return this[1].toAddress(); - } - - get tokenOut(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get poolId(): Bytes { - return this[4].toBytes(); - } - - get lastChangeBlock(): BigInt { - return this[5].toBigInt(); - } - - get from(): Address { - return this[6].toAddress(); - } - - get to(): Address { - return this[7].toAddress(); - } - - get userData(): Bytes { - return this[8].toBytes(); - } -} - -export class BalancerPoolToken__queryExitResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptIn(): BigInt { - return this.value0; - } - - getAmountsOut(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__queryJoinResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptOut(): BigInt { - return this.value0; - } - - getAmountsIn(): Array { - return this.value1; - } -} - -export class BalancerPoolToken extends ethereum.SmartContract { - static bind(address: Address): BalancerPoolToken { - return new BalancerPoolToken("BalancerPoolToken", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getInvariant(): BigInt { - const result = super.call("getInvariant", "getInvariant():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getInvariant(): ethereum.CallResult { - const result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getLastInvariant(): BigInt { - const result = super.call( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getLastInvariant(): ethereum.CallResult { - const result = super.tryCall( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getNormalizedWeights(): Array { - const result = super.call( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - - return result[0].toBigIntArray(); - } - - try_getNormalizedWeights(): ethereum.CallResult> { - const result = super.tryCall( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getOwner(): Address { - const result = super.call("getOwner", "getOwner():(address)", []); - - return result[0].toAddress(); - } - - try_getOwner(): ethereum.CallResult
{ - const result = super.tryCall("getOwner", "getOwner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getPausedState(): BalancerPoolToken__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerPoolToken__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerPoolToken__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPoolId(): Bytes { - const result = super.call("getPoolId", "getPoolId():(bytes32)", []); - - return result[0].toBytes(); - } - - try_getPoolId(): ethereum.CallResult { - const result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getRate(): BigInt { - const result = super.call("getRate", "getRate():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getRate(): ethereum.CallResult { - const result = super.tryCall("getRate", "getRate():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getSwapFeePercentage(): BigInt { - const result = super.call( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getSwapFeePercentage(): ethereum.CallResult { - const result = super.tryCall( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getVault(): Address { - const result = super.call("getVault", "getVault():(address)", []); - - return result[0].toAddress(); - } - - try_getVault(): ethereum.CallResult
{ - const result = super.tryCall("getVault", "getVault():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - increaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onExitPoolResult { - const result = super.call( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onExitPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onExitPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onJoinPoolResult { - const result = super.call( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onJoinPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onJoinPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): BigInt { - const result = super.call( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - - return result[0].toBigInt(); - } - - try_onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryExitResult { - const result = super.call( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryExitResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryExitResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryJoinResult { - const result = super.call( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryJoinResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryJoinResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get vault(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get name(): string { - return this._call.inputValues[1].value.toString(); - } - - get symbol(): string { - return this._call.inputValues[2].value.toString(); - } - - get tokens(): Array
{ - return this._call.inputValues[3].value.toAddressArray(); - } - - get normalizedWeights(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[7].value.toBigInt(); - } - - get owner(): Address { - return this._call.inputValues[8].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DecreaseApprovalCall extends ethereum.Call { - get inputs(): DecreaseApprovalCall__Inputs { - return new DecreaseApprovalCall__Inputs(this); - } - - get outputs(): DecreaseApprovalCall__Outputs { - return new DecreaseApprovalCall__Outputs(this); - } -} - -export class DecreaseApprovalCall__Inputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseApprovalCall__Outputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseApprovalCall extends ethereum.Call { - get inputs(): IncreaseApprovalCall__Inputs { - return new IncreaseApprovalCall__Inputs(this); - } - - get outputs(): IncreaseApprovalCall__Outputs { - return new IncreaseApprovalCall__Outputs(this); - } -} - -export class IncreaseApprovalCall__Inputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseApprovalCall__Outputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class OnExitPoolCall extends ethereum.Call { - get inputs(): OnExitPoolCall__Inputs { - return new OnExitPoolCall__Inputs(this); - } - - get outputs(): OnExitPoolCall__Outputs { - return new OnExitPoolCall__Outputs(this); - } -} - -export class OnExitPoolCall__Inputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnExitPoolCall__Outputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class OnJoinPoolCall extends ethereum.Call { - get inputs(): OnJoinPoolCall__Inputs { - return new OnJoinPoolCall__Inputs(this); - } - - get outputs(): OnJoinPoolCall__Outputs { - return new OnJoinPoolCall__Outputs(this); - } -} - -export class OnJoinPoolCall__Inputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnJoinPoolCall__Outputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class QueryExitCall extends ethereum.Call { - get inputs(): QueryExitCall__Inputs { - return new QueryExitCall__Inputs(this); - } - - get outputs(): QueryExitCall__Outputs { - return new QueryExitCall__Outputs(this); - } -} - -export class QueryExitCall__Inputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryExitCall__Outputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get bptIn(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsOut(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class QueryJoinCall extends ethereum.Call { - get inputs(): QueryJoinCall__Inputs { - return new QueryJoinCall__Inputs(this); - } - - get outputs(): QueryJoinCall__Outputs { - return new QueryJoinCall__Outputs(this); - } -} - -export class QueryJoinCall__Inputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryJoinCall__Outputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get bptOut(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsIn(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetSwapFeePercentageCall extends ethereum.Call { - get inputs(): SetSwapFeePercentageCall__Inputs { - return new SetSwapFeePercentageCall__Inputs(this); - } - - get outputs(): SetSwapFeePercentageCall__Outputs { - return new SetSwapFeePercentageCall__Outputs(this); - } -} - -export class SetSwapFeePercentageCall__Inputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetSwapFeePercentageCall__Outputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV3/BalancerVault.ts b/subgraphs/ethereum/generated/OHMDAIBondV3/BalancerVault.ts deleted file mode 100644 index 41f94648..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV3/BalancerVault.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class AuthorizerChanged extends ethereum.Event { - get params(): AuthorizerChanged__Params { - return new AuthorizerChanged__Params(this); - } -} - -export class AuthorizerChanged__Params { - _event: AuthorizerChanged; - - constructor(event: AuthorizerChanged) { - this._event = event; - } - - get newAuthorizer(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class ExternalBalanceTransfer extends ethereum.Event { - get params(): ExternalBalanceTransfer__Params { - return new ExternalBalanceTransfer__Params(this); - } -} - -export class ExternalBalanceTransfer__Params { - _event: ExternalBalanceTransfer; - - constructor(event: ExternalBalanceTransfer) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get recipient(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class FlashLoan extends ethereum.Event { - get params(): FlashLoan__Params { - return new FlashLoan__Params(this); - } -} - -export class FlashLoan__Params { - _event: FlashLoan; - - constructor(event: FlashLoan) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get feeAmount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class InternalBalanceChanged extends ethereum.Event { - get params(): InternalBalanceChanged__Params { - return new InternalBalanceChanged__Params(this); - } -} - -export class InternalBalanceChanged__Params { - _event: InternalBalanceChanged; - - constructor(event: InternalBalanceChanged) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get delta(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class PoolBalanceChanged extends ethereum.Event { - get params(): PoolBalanceChanged__Params { - return new PoolBalanceChanged__Params(this); - } -} - -export class PoolBalanceChanged__Params { - _event: PoolBalanceChanged; - - constructor(event: PoolBalanceChanged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get liquidityProvider(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokens(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } - - get deltas(): Array { - return this._event.parameters[3].value.toBigIntArray(); - } - - get protocolFeeAmounts(): Array { - return this._event.parameters[4].value.toBigIntArray(); - } -} - -export class PoolBalanceManaged extends ethereum.Event { - get params(): PoolBalanceManaged__Params { - return new PoolBalanceManaged__Params(this); - } -} - -export class PoolBalanceManaged__Params { - _event: PoolBalanceManaged; - - constructor(event: PoolBalanceManaged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get assetManager(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get cashDelta(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get managedDelta(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class PoolRegistered extends ethereum.Event { - get params(): PoolRegistered__Params { - return new PoolRegistered__Params(this); - } -} - -export class PoolRegistered__Params { - _event: PoolRegistered; - - constructor(event: PoolRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get poolAddress(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get specialization(): i32 { - return this._event.parameters[2].value.toI32(); - } -} - -export class RelayerApprovalChanged extends ethereum.Event { - get params(): RelayerApprovalChanged__Params { - return new RelayerApprovalChanged__Params(this); - } -} - -export class RelayerApprovalChanged__Params { - _event: RelayerApprovalChanged; - - constructor(event: RelayerApprovalChanged) { - this._event = event; - } - - get relayer(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get approved(): boolean { - return this._event.parameters[2].value.toBoolean(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokenIn(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokenOut(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amountIn(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amountOut(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class TokensDeregistered extends ethereum.Event { - get params(): TokensDeregistered__Params { - return new TokensDeregistered__Params(this); - } -} - -export class TokensDeregistered__Params { - _event: TokensDeregistered; - - constructor(event: TokensDeregistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } -} - -export class TokensRegistered extends ethereum.Event { - get params(): TokensRegistered__Params { - return new TokensRegistered__Params(this); - } -} - -export class TokensRegistered__Params { - _event: TokensRegistered; - - constructor(event: TokensRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } -} - -export class BalancerVault__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerVault__getPoolResult { - value0: Address; - value1: i32; - - constructor(value0: Address, value1: i32) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddress(this.value0)); - map.set( - "value1", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) - ); - return map; - } - - getValue0(): Address { - return this.value0; - } - - getValue1(): i32 { - return this.value1; - } -} - -export class BalancerVault__getPoolTokenInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: Address; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: Address) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromAddress(this.value3)); - return map; - } - - getCash(): BigInt { - return this.value0; - } - - getManaged(): BigInt { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } - - getAssetManager(): Address { - return this.value3; - } -} - -export class BalancerVault__getPoolTokensResult { - value0: Array
; - value1: Array; - value2: BigInt; - - constructor(value0: Array
, value1: Array, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddressArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getTokens(): Array
{ - return this.value0; - } - - getBalances(): Array { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } -} - -export class BalancerVault__queryBatchSwapInputSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BalancerVault__queryBatchSwapInputFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class BalancerVault extends ethereum.SmartContract { - static bind(address: Address): BalancerVault { - return new BalancerVault("BalancerVault", address); - } - - WETH(): Address { - const result = super.call("WETH", "WETH():(address)", []); - - return result[0].toAddress(); - } - - try_WETH(): ethereum.CallResult
{ - const result = super.tryCall("WETH", "WETH():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getDomainSeparator(): Bytes { - const result = super.call( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_getDomainSeparator(): ethereum.CallResult { - const result = super.tryCall( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getInternalBalance(user: Address, tokens: Array
): Array { - const result = super.call( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - - return result[0].toBigIntArray(); - } - - try_getInternalBalance( - user: Address, - tokens: Array
- ): ethereum.CallResult> { - const result = super.tryCall( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getNextNonce(user: Address): BigInt { - const result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ - ethereum.Value.fromAddress(user) - ]); - - return result[0].toBigInt(); - } - - try_getNextNonce(user: Address): ethereum.CallResult { - const result = super.tryCall( - "getNextNonce", - "getNextNonce(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getPausedState(): BalancerVault__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerVault__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerVault__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPool(poolId: Bytes): BalancerVault__getPoolResult { - const result = super.call("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - - return new BalancerVault__getPoolResult( - result[0].toAddress(), - result[1].toI32() - ); - } - - try_getPool( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolResult(value[0].toAddress(), value[1].toI32()) - ); - } - - getPoolTokenInfo( - poolId: Bytes, - token: Address - ): BalancerVault__getPoolTokenInfoResult { - const result = super.call( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - - return new BalancerVault__getPoolTokenInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toAddress() - ); - } - - try_getPoolTokenInfo( - poolId: Bytes, - token: Address - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokenInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toAddress() - ) - ); - } - - getPoolTokens(poolId: Bytes): BalancerVault__getPoolTokensResult { - const result = super.call( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - - return new BalancerVault__getPoolTokensResult( - result[0].toAddressArray(), - result[1].toBigIntArray(), - result[2].toBigInt() - ); - } - - try_getPoolTokens( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokensResult( - value[0].toAddressArray(), - value[1].toBigIntArray(), - value[2].toBigInt() - ) - ); - } - - getProtocolFeesCollector(): Address { - const result = super.call( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_getProtocolFeesCollector(): ethereum.CallResult
{ - const result = super.tryCall( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - hasApprovedRelayer(user: Address, relayer: Address): boolean { - const result = super.call( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - - return result[0].toBoolean(); - } - - try_hasApprovedRelayer( - user: Address, - relayer: Address - ): ethereum.CallResult { - const result = super.tryCall( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): Array { - const result = super.call( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - - return result[0].toBigIntArray(); - } - - try_queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): ethereum.CallResult> { - const result = super.tryCall( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - registerPool(specialization: i32): Bytes { - const result = super.call("registerPool", "registerPool(uint8):(bytes32)", [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization)) - ]); - - return result[0].toBytes(); - } - - try_registerPool(specialization: i32): ethereum.CallResult { - const result = super.tryCall( - "registerPool", - "registerPool(uint8):(bytes32)", - [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization))] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get authorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get weth(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class BatchSwapCall extends ethereum.Call { - get inputs(): BatchSwapCall__Inputs { - return new BatchSwapCall__Inputs(this); - } - - get outputs(): BatchSwapCall__Outputs { - return new BatchSwapCall__Outputs(this); - } -} - -export class BatchSwapCall__Inputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - BatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): BatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } - - get limits(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get deadline(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } -} - -export class BatchSwapCall__Outputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get assetDeltas(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class BatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class DeregisterTokensCall extends ethereum.Call { - get inputs(): DeregisterTokensCall__Inputs { - return new DeregisterTokensCall__Inputs(this); - } - - get outputs(): DeregisterTokensCall__Outputs { - return new DeregisterTokensCall__Outputs(this); - } -} - -export class DeregisterTokensCall__Inputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } -} - -export class DeregisterTokensCall__Outputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } -} - -export class ExitPoolCall extends ethereum.Call { - get inputs(): ExitPoolCall__Inputs { - return new ExitPoolCall__Inputs(this); - } - - get outputs(): ExitPoolCall__Outputs { - return new ExitPoolCall__Outputs(this); - } -} - -export class ExitPoolCall__Inputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): ExitPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class ExitPoolCall__Outputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } -} - -export class ExitPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get minAmountsOut(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class FlashLoanCall extends ethereum.Call { - get inputs(): FlashLoanCall__Inputs { - return new FlashLoanCall__Inputs(this); - } - - get outputs(): FlashLoanCall__Outputs { - return new FlashLoanCall__Outputs(this); - } -} - -export class FlashLoanCall__Inputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get amounts(): Array { - return this._call.inputValues[2].value.toBigIntArray(); - } - - get userData(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class FlashLoanCall__Outputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } -} - -export class JoinPoolCall extends ethereum.Call { - get inputs(): JoinPoolCall__Inputs { - return new JoinPoolCall__Inputs(this); - } - - get outputs(): JoinPoolCall__Outputs { - return new JoinPoolCall__Outputs(this); - } -} - -export class JoinPoolCall__Inputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): JoinPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class JoinPoolCall__Outputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } -} - -export class JoinPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get maxAmountsIn(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get fromInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class ManagePoolBalanceCall extends ethereum.Call { - get inputs(): ManagePoolBalanceCall__Inputs { - return new ManagePoolBalanceCall__Inputs(this); - } - - get outputs(): ManagePoolBalanceCall__Outputs { - return new ManagePoolBalanceCall__Outputs(this); - } -} - -export class ManagePoolBalanceCall__Inputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManagePoolBalanceCallOpsStruct - >(); - } -} - -export class ManagePoolBalanceCall__Outputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } -} - -export class ManagePoolBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get poolId(): Bytes { - return this[1].toBytes(); - } - - get token(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } -} - -export class ManageUserBalanceCall extends ethereum.Call { - get inputs(): ManageUserBalanceCall__Inputs { - return new ManageUserBalanceCall__Inputs(this); - } - - get outputs(): ManageUserBalanceCall__Outputs { - return new ManageUserBalanceCall__Outputs(this); - } -} - -export class ManageUserBalanceCall__Inputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManageUserBalanceCallOpsStruct - >(); - } -} - -export class ManageUserBalanceCall__Outputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } -} - -export class ManageUserBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get asset(): Address { - return this[1].toAddress(); - } - - get amount(): BigInt { - return this[2].toBigInt(); - } - - get sender(): Address { - return this[3].toAddress(); - } - - get recipient(): Address { - return this[4].toAddress(); - } -} - -export class QueryBatchSwapCall extends ethereum.Call { - get inputs(): QueryBatchSwapCall__Inputs { - return new QueryBatchSwapCall__Inputs(this); - } - - get outputs(): QueryBatchSwapCall__Outputs { - return new QueryBatchSwapCall__Outputs(this); - } -} - -export class QueryBatchSwapCall__Inputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - QueryBatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): QueryBatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class QueryBatchSwapCall__Outputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class QueryBatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class QueryBatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class RegisterPoolCall extends ethereum.Call { - get inputs(): RegisterPoolCall__Inputs { - return new RegisterPoolCall__Inputs(this); - } - - get outputs(): RegisterPoolCall__Outputs { - return new RegisterPoolCall__Outputs(this); - } -} - -export class RegisterPoolCall__Inputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get specialization(): i32 { - return this._call.inputValues[0].value.toI32(); - } -} - -export class RegisterPoolCall__Outputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get value0(): Bytes { - return this._call.outputValues[0].value.toBytes(); - } -} - -export class RegisterTokensCall extends ethereum.Call { - get inputs(): RegisterTokensCall__Inputs { - return new RegisterTokensCall__Inputs(this); - } - - get outputs(): RegisterTokensCall__Outputs { - return new RegisterTokensCall__Outputs(this); - } -} - -export class RegisterTokensCall__Inputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } -} - -export class RegisterTokensCall__Outputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } -} - -export class SetAuthorizerCall extends ethereum.Call { - get inputs(): SetAuthorizerCall__Inputs { - return new SetAuthorizerCall__Inputs(this); - } - - get outputs(): SetAuthorizerCall__Outputs { - return new SetAuthorizerCall__Outputs(this); - } -} - -export class SetAuthorizerCall__Inputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } - - get newAuthorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetAuthorizerCall__Outputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetRelayerApprovalCall extends ethereum.Call { - get inputs(): SetRelayerApprovalCall__Inputs { - return new SetRelayerApprovalCall__Inputs(this); - } - - get outputs(): SetRelayerApprovalCall__Outputs { - return new SetRelayerApprovalCall__Outputs(this); - } -} - -export class SetRelayerApprovalCall__Inputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get relayer(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get approved(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } -} - -export class SetRelayerApprovalCall__Outputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get singleSwap(): SwapCallSingleSwapStruct { - return changetype( - this._call.inputValues[0].value.toTuple() - ); - } - - get funds(): SwapCallFundsStruct { - return changetype( - this._call.inputValues[1].value.toTuple() - ); - } - - get limit(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amountCalculated(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class SwapCallSingleSwapStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get kind(): i32 { - return this[1].toI32(); - } - - get assetIn(): Address { - return this[2].toAddress(); - } - - get assetOut(): Address { - return this[3].toAddress(); - } - - get amount(): BigInt { - return this[4].toBigInt(); - } - - get userData(): Bytes { - return this[5].toBytes(); - } -} - -export class SwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV3/ERC20.ts b/subgraphs/ethereum/generated/OHMDAIBondV3/ERC20.ts deleted file mode 100644 index bbe93783..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV3/ERC20.ts +++ /dev/null @@ -1,394 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ERC20 extends ethereum.SmartContract { - static bind(address: Address): ERC20 { - return new ERC20("ERC20", address); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - approve(_spender: Address, _value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_approve(_spender: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transferFrom(_from: Address, _to: Address, _value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - _from: Address, - _to: Address, - _value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - balanceOf(_owner: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(_owner: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - transfer(_to: Address, _value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(_to: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - allowance(_owner: Address, _spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - _owner: Address, - _spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get _spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get _from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DefaultCall extends ethereum.Call { - get inputs(): DefaultCall__Inputs { - return new DefaultCall__Inputs(this); - } - - get outputs(): DefaultCall__Outputs { - return new DefaultCall__Outputs(this); - } -} - -export class DefaultCall__Inputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} - -export class DefaultCall__Outputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV3/OHMDAIBondV3.ts b/subgraphs/ethereum/generated/OHMDAIBondV3/OHMDAIBondV3.ts deleted file mode 100644 index 168e4aba..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV3/OHMDAIBondV3.ts +++ /dev/null @@ -1,1158 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get payout(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OHMDAIBondV3__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } -} - -export class OHMDAIBondV3__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getValueRemaining(): BigInt { - return this.value0; - } - - getPayoutRemaining(): BigInt { - return this.value1; - } - - getVestingPeriod(): BigInt { - return this.value2; - } - - getLastBlock(): BigInt { - return this.value3; - } - - getPricePaid(): BigInt { - return this.value4; - } -} - -export class OHMDAIBondV3__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getFee(): BigInt { - return this.value4; - } -} - -export class OHMDAIBondV3 extends ethereum.SmartContract { - static bind(address: Address): OHMDAIBondV3 { - return new OHMDAIBondV3("OHMDAIBondV3", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): OHMDAIBondV3__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256)", - [] - ); - - return new OHMDAIBondV3__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMDAIBondV3__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): OHMDAIBondV3__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new OHMDAIBondV3__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMDAIBondV3__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isLiquidityBond(): boolean { - const result = super.call("isLiquidityBond", "isLiquidityBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_isLiquidityBond(): ethereum.CallResult { - const result = super.tryCall( - "isLiquidityBond", - "isLiquidityBond():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - manager(): Address { - const result = super.call("manager", "manager():(address)", []); - - return result[0].toAddress(); - } - - try_manager(): ethereum.CallResult
{ - const result = super.tryCall("manager", "manager():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_stake: boolean): BigInt { - const result = super.call("redeem", "redeem(bool):(uint256)", [ - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem(_stake: boolean): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(bool):(uint256)", [ - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - setBondTerms( - _vestingTerm: BigInt, - _minimumPrice: BigInt, - _maxPayout: BigInt, - _fee: BigInt - ): boolean { - const result = super.call( - "setBondTerms", - "setBondTerms(uint256,uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(_vestingTerm), - ethereum.Value.fromUnsignedBigInt(_minimumPrice), - ethereum.Value.fromUnsignedBigInt(_maxPayout), - ethereum.Value.fromUnsignedBigInt(_fee) - ] - ); - - return result[0].toBoolean(); - } - - try_setBondTerms( - _vestingTerm: BigInt, - _minimumPrice: BigInt, - _maxPayout: BigInt, - _fee: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "setBondTerms", - "setBondTerms(uint256,uint256,uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(_vestingTerm), - ethereum.Value.fromUnsignedBigInt(_minimumPrice), - ethereum.Value.fromUnsignedBigInt(_maxPayout), - ethereum.Value.fromUnsignedBigInt(_fee) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - setStaking(_staking: Address): boolean { - const result = super.call("setStaking", "setStaking(address):(bool)", [ - ethereum.Value.fromAddress(_staking) - ]); - - return result[0].toBoolean(); - } - - try_setStaking(_staking: Address): ethereum.CallResult { - const result = super.tryCall("setStaking", "setStaking(address):(bool)", [ - ethereum.Value.fromAddress(_staking) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - terms(): OHMDAIBondV3__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new OHMDAIBondV3__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMDAIBondV3__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _bondCalculator(): Address { - return this._call.inputValues[4].value.toAddress(); - } - - get _controlVariable(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _stake(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _fee(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV3/UniswapV2Pair.ts b/subgraphs/ethereum/generated/OHMDAIBondV3/UniswapV2Pair.ts deleted file mode 100644 index b36eea33..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV3/UniswapV2Pair.ts +++ /dev/null @@ -1,1092 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Burn extends ethereum.Event { - get params(): Burn__Params { - return new Burn__Params(this); - } -} - -export class Burn__Params { - _event: Burn; - - constructor(event: Burn) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[3].value.toAddress(); - } -} - -export class Mint extends ethereum.Event { - get params(): Mint__Params { - return new Mint__Params(this); - } -} - -export class Mint__Params { - _event: Mint; - - constructor(event: Mint) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0In(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1In(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get amount0Out(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[5].value.toAddress(); - } -} - -export class Sync extends ethereum.Event { - get params(): Sync__Params { - return new Sync__Params(this); - } -} - -export class Sync__Params { - _event: Sync; - - constructor(event: Sync) { - this._event = event; - } - - get reserve0(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get reserve1(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class UniswapV2Pair__burnResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } - - getAmount0(): BigInt { - return this.value0; - } - - getAmount1(): BigInt { - return this.value1; - } -} - -export class UniswapV2Pair__getReservesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - get_reserve0(): BigInt { - return this.value0; - } - - get_reserve1(): BigInt { - return this.value1; - } - - get_blockTimestampLast(): BigInt { - return this.value2; - } -} - -export class UniswapV2Pair extends ethereum.SmartContract { - static bind(address: Address): UniswapV2Pair { - return new UniswapV2Pair("UniswapV2Pair", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - MINIMUM_LIQUIDITY(): BigInt { - const result = super.call( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_MINIMUM_LIQUIDITY(): ethereum.CallResult { - const result = super.tryCall( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(param0: Address, param1: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - - return result[0].toBigInt(); - } - - try_allowance(param0: Address, param1: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(param0: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(param0: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - burn(to: Address): UniswapV2Pair__burnResult { - const result = super.call("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return new UniswapV2Pair__burnResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_burn(to: Address): ethereum.CallResult { - const result = super.tryCall("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__burnResult(value[0].toBigInt(), value[1].toBigInt()) - ); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - factory(): Address { - const result = super.call("factory", "factory():(address)", []); - - return result[0].toAddress(); - } - - try_factory(): ethereum.CallResult
{ - const result = super.tryCall("factory", "factory():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getReserves(): UniswapV2Pair__getReservesResult { - const result = super.call( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - - return new UniswapV2Pair__getReservesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getReserves(): ethereum.CallResult { - const result = super.tryCall( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__getReservesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - kLast(): BigInt { - const result = super.call("kLast", "kLast():(uint256)", []); - - return result[0].toBigInt(); - } - - try_kLast(): ethereum.CallResult { - const result = super.tryCall("kLast", "kLast():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - mint(to: Address): BigInt { - const result = super.call("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return result[0].toBigInt(); - } - - try_mint(to: Address): ethereum.CallResult { - const result = super.tryCall("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(param0: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_nonces(param0: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price0CumulativeLast(): BigInt { - const result = super.call( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price0CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price1CumulativeLast(): BigInt { - const result = super.call( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price1CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - token0(): Address { - const result = super.call("token0", "token0():(address)", []); - - return result[0].toAddress(); - } - - try_token0(): ethereum.CallResult
{ - const result = super.tryCall("token0", "token0():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - token1(): Address { - const result = super.call("token1", "token1():(address)", []); - - return result[0].toAddress(); - } - - try_token1(): ethereum.CallResult
{ - const result = super.tryCall("token1", "token1():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class BurnCall extends ethereum.Call { - get inputs(): BurnCall__Inputs { - return new BurnCall__Inputs(this); - } - - get outputs(): BurnCall__Outputs { - return new BurnCall__Outputs(this); - } -} - -export class BurnCall__Inputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class BurnCall__Outputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get amount0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amount1(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _token0(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _token1(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class MintCall extends ethereum.Call { - get inputs(): MintCall__Inputs { - return new MintCall__Inputs(this); - } - - get outputs(): MintCall__Outputs { - return new MintCall__Outputs(this); - } -} - -export class MintCall__Inputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class MintCall__Outputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get liquidity(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class SkimCall extends ethereum.Call { - get inputs(): SkimCall__Inputs { - return new SkimCall__Inputs(this); - } - - get outputs(): SkimCall__Outputs { - return new SkimCall__Outputs(this); - } -} - -export class SkimCall__Inputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SkimCall__Outputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amount0Out(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get to(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get data(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } -} - -export class SyncCall extends ethereum.Call { - get inputs(): SyncCall__Inputs { - return new SyncCall__Inputs(this); - } - - get outputs(): SyncCall__Outputs { - return new SyncCall__Outputs(this); - } -} - -export class SyncCall__Inputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class SyncCall__Outputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV4/BalancerPoolToken.ts b/subgraphs/ethereum/generated/OHMDAIBondV4/BalancerPoolToken.ts deleted file mode 100644 index e1efa45b..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV4/BalancerPoolToken.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class SwapFeePercentageChanged extends ethereum.Event { - get params(): SwapFeePercentageChanged__Params { - return new SwapFeePercentageChanged__Params(this); - } -} - -export class SwapFeePercentageChanged__Params { - _event: SwapFeePercentageChanged; - - constructor(event: SwapFeePercentageChanged) { - this._event = event; - } - - get swapFeePercentage(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BalancerPoolToken__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerPoolToken__onExitPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onJoinPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onSwapInputRequestStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get tokenIn(): Address { - return this[1].toAddress(); - } - - get tokenOut(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get poolId(): Bytes { - return this[4].toBytes(); - } - - get lastChangeBlock(): BigInt { - return this[5].toBigInt(); - } - - get from(): Address { - return this[6].toAddress(); - } - - get to(): Address { - return this[7].toAddress(); - } - - get userData(): Bytes { - return this[8].toBytes(); - } -} - -export class BalancerPoolToken__queryExitResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptIn(): BigInt { - return this.value0; - } - - getAmountsOut(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__queryJoinResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptOut(): BigInt { - return this.value0; - } - - getAmountsIn(): Array { - return this.value1; - } -} - -export class BalancerPoolToken extends ethereum.SmartContract { - static bind(address: Address): BalancerPoolToken { - return new BalancerPoolToken("BalancerPoolToken", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getInvariant(): BigInt { - const result = super.call("getInvariant", "getInvariant():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getInvariant(): ethereum.CallResult { - const result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getLastInvariant(): BigInt { - const result = super.call( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getLastInvariant(): ethereum.CallResult { - const result = super.tryCall( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getNormalizedWeights(): Array { - const result = super.call( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - - return result[0].toBigIntArray(); - } - - try_getNormalizedWeights(): ethereum.CallResult> { - const result = super.tryCall( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getOwner(): Address { - const result = super.call("getOwner", "getOwner():(address)", []); - - return result[0].toAddress(); - } - - try_getOwner(): ethereum.CallResult
{ - const result = super.tryCall("getOwner", "getOwner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getPausedState(): BalancerPoolToken__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerPoolToken__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerPoolToken__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPoolId(): Bytes { - const result = super.call("getPoolId", "getPoolId():(bytes32)", []); - - return result[0].toBytes(); - } - - try_getPoolId(): ethereum.CallResult { - const result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getRate(): BigInt { - const result = super.call("getRate", "getRate():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getRate(): ethereum.CallResult { - const result = super.tryCall("getRate", "getRate():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getSwapFeePercentage(): BigInt { - const result = super.call( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getSwapFeePercentage(): ethereum.CallResult { - const result = super.tryCall( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getVault(): Address { - const result = super.call("getVault", "getVault():(address)", []); - - return result[0].toAddress(); - } - - try_getVault(): ethereum.CallResult
{ - const result = super.tryCall("getVault", "getVault():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - increaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onExitPoolResult { - const result = super.call( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onExitPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onExitPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onJoinPoolResult { - const result = super.call( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onJoinPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onJoinPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): BigInt { - const result = super.call( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - - return result[0].toBigInt(); - } - - try_onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryExitResult { - const result = super.call( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryExitResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryExitResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryJoinResult { - const result = super.call( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryJoinResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryJoinResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get vault(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get name(): string { - return this._call.inputValues[1].value.toString(); - } - - get symbol(): string { - return this._call.inputValues[2].value.toString(); - } - - get tokens(): Array
{ - return this._call.inputValues[3].value.toAddressArray(); - } - - get normalizedWeights(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[7].value.toBigInt(); - } - - get owner(): Address { - return this._call.inputValues[8].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DecreaseApprovalCall extends ethereum.Call { - get inputs(): DecreaseApprovalCall__Inputs { - return new DecreaseApprovalCall__Inputs(this); - } - - get outputs(): DecreaseApprovalCall__Outputs { - return new DecreaseApprovalCall__Outputs(this); - } -} - -export class DecreaseApprovalCall__Inputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseApprovalCall__Outputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseApprovalCall extends ethereum.Call { - get inputs(): IncreaseApprovalCall__Inputs { - return new IncreaseApprovalCall__Inputs(this); - } - - get outputs(): IncreaseApprovalCall__Outputs { - return new IncreaseApprovalCall__Outputs(this); - } -} - -export class IncreaseApprovalCall__Inputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseApprovalCall__Outputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class OnExitPoolCall extends ethereum.Call { - get inputs(): OnExitPoolCall__Inputs { - return new OnExitPoolCall__Inputs(this); - } - - get outputs(): OnExitPoolCall__Outputs { - return new OnExitPoolCall__Outputs(this); - } -} - -export class OnExitPoolCall__Inputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnExitPoolCall__Outputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class OnJoinPoolCall extends ethereum.Call { - get inputs(): OnJoinPoolCall__Inputs { - return new OnJoinPoolCall__Inputs(this); - } - - get outputs(): OnJoinPoolCall__Outputs { - return new OnJoinPoolCall__Outputs(this); - } -} - -export class OnJoinPoolCall__Inputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnJoinPoolCall__Outputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class QueryExitCall extends ethereum.Call { - get inputs(): QueryExitCall__Inputs { - return new QueryExitCall__Inputs(this); - } - - get outputs(): QueryExitCall__Outputs { - return new QueryExitCall__Outputs(this); - } -} - -export class QueryExitCall__Inputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryExitCall__Outputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get bptIn(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsOut(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class QueryJoinCall extends ethereum.Call { - get inputs(): QueryJoinCall__Inputs { - return new QueryJoinCall__Inputs(this); - } - - get outputs(): QueryJoinCall__Outputs { - return new QueryJoinCall__Outputs(this); - } -} - -export class QueryJoinCall__Inputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryJoinCall__Outputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get bptOut(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsIn(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetSwapFeePercentageCall extends ethereum.Call { - get inputs(): SetSwapFeePercentageCall__Inputs { - return new SetSwapFeePercentageCall__Inputs(this); - } - - get outputs(): SetSwapFeePercentageCall__Outputs { - return new SetSwapFeePercentageCall__Outputs(this); - } -} - -export class SetSwapFeePercentageCall__Inputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetSwapFeePercentageCall__Outputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV4/BalancerVault.ts b/subgraphs/ethereum/generated/OHMDAIBondV4/BalancerVault.ts deleted file mode 100644 index 41f94648..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV4/BalancerVault.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class AuthorizerChanged extends ethereum.Event { - get params(): AuthorizerChanged__Params { - return new AuthorizerChanged__Params(this); - } -} - -export class AuthorizerChanged__Params { - _event: AuthorizerChanged; - - constructor(event: AuthorizerChanged) { - this._event = event; - } - - get newAuthorizer(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class ExternalBalanceTransfer extends ethereum.Event { - get params(): ExternalBalanceTransfer__Params { - return new ExternalBalanceTransfer__Params(this); - } -} - -export class ExternalBalanceTransfer__Params { - _event: ExternalBalanceTransfer; - - constructor(event: ExternalBalanceTransfer) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get recipient(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class FlashLoan extends ethereum.Event { - get params(): FlashLoan__Params { - return new FlashLoan__Params(this); - } -} - -export class FlashLoan__Params { - _event: FlashLoan; - - constructor(event: FlashLoan) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get feeAmount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class InternalBalanceChanged extends ethereum.Event { - get params(): InternalBalanceChanged__Params { - return new InternalBalanceChanged__Params(this); - } -} - -export class InternalBalanceChanged__Params { - _event: InternalBalanceChanged; - - constructor(event: InternalBalanceChanged) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get delta(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class PoolBalanceChanged extends ethereum.Event { - get params(): PoolBalanceChanged__Params { - return new PoolBalanceChanged__Params(this); - } -} - -export class PoolBalanceChanged__Params { - _event: PoolBalanceChanged; - - constructor(event: PoolBalanceChanged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get liquidityProvider(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokens(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } - - get deltas(): Array { - return this._event.parameters[3].value.toBigIntArray(); - } - - get protocolFeeAmounts(): Array { - return this._event.parameters[4].value.toBigIntArray(); - } -} - -export class PoolBalanceManaged extends ethereum.Event { - get params(): PoolBalanceManaged__Params { - return new PoolBalanceManaged__Params(this); - } -} - -export class PoolBalanceManaged__Params { - _event: PoolBalanceManaged; - - constructor(event: PoolBalanceManaged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get assetManager(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get cashDelta(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get managedDelta(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class PoolRegistered extends ethereum.Event { - get params(): PoolRegistered__Params { - return new PoolRegistered__Params(this); - } -} - -export class PoolRegistered__Params { - _event: PoolRegistered; - - constructor(event: PoolRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get poolAddress(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get specialization(): i32 { - return this._event.parameters[2].value.toI32(); - } -} - -export class RelayerApprovalChanged extends ethereum.Event { - get params(): RelayerApprovalChanged__Params { - return new RelayerApprovalChanged__Params(this); - } -} - -export class RelayerApprovalChanged__Params { - _event: RelayerApprovalChanged; - - constructor(event: RelayerApprovalChanged) { - this._event = event; - } - - get relayer(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get approved(): boolean { - return this._event.parameters[2].value.toBoolean(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokenIn(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokenOut(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amountIn(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amountOut(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class TokensDeregistered extends ethereum.Event { - get params(): TokensDeregistered__Params { - return new TokensDeregistered__Params(this); - } -} - -export class TokensDeregistered__Params { - _event: TokensDeregistered; - - constructor(event: TokensDeregistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } -} - -export class TokensRegistered extends ethereum.Event { - get params(): TokensRegistered__Params { - return new TokensRegistered__Params(this); - } -} - -export class TokensRegistered__Params { - _event: TokensRegistered; - - constructor(event: TokensRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } -} - -export class BalancerVault__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerVault__getPoolResult { - value0: Address; - value1: i32; - - constructor(value0: Address, value1: i32) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddress(this.value0)); - map.set( - "value1", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) - ); - return map; - } - - getValue0(): Address { - return this.value0; - } - - getValue1(): i32 { - return this.value1; - } -} - -export class BalancerVault__getPoolTokenInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: Address; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: Address) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromAddress(this.value3)); - return map; - } - - getCash(): BigInt { - return this.value0; - } - - getManaged(): BigInt { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } - - getAssetManager(): Address { - return this.value3; - } -} - -export class BalancerVault__getPoolTokensResult { - value0: Array
; - value1: Array; - value2: BigInt; - - constructor(value0: Array
, value1: Array, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddressArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getTokens(): Array
{ - return this.value0; - } - - getBalances(): Array { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } -} - -export class BalancerVault__queryBatchSwapInputSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BalancerVault__queryBatchSwapInputFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class BalancerVault extends ethereum.SmartContract { - static bind(address: Address): BalancerVault { - return new BalancerVault("BalancerVault", address); - } - - WETH(): Address { - const result = super.call("WETH", "WETH():(address)", []); - - return result[0].toAddress(); - } - - try_WETH(): ethereum.CallResult
{ - const result = super.tryCall("WETH", "WETH():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getDomainSeparator(): Bytes { - const result = super.call( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_getDomainSeparator(): ethereum.CallResult { - const result = super.tryCall( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getInternalBalance(user: Address, tokens: Array
): Array { - const result = super.call( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - - return result[0].toBigIntArray(); - } - - try_getInternalBalance( - user: Address, - tokens: Array
- ): ethereum.CallResult> { - const result = super.tryCall( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getNextNonce(user: Address): BigInt { - const result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ - ethereum.Value.fromAddress(user) - ]); - - return result[0].toBigInt(); - } - - try_getNextNonce(user: Address): ethereum.CallResult { - const result = super.tryCall( - "getNextNonce", - "getNextNonce(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getPausedState(): BalancerVault__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerVault__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerVault__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPool(poolId: Bytes): BalancerVault__getPoolResult { - const result = super.call("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - - return new BalancerVault__getPoolResult( - result[0].toAddress(), - result[1].toI32() - ); - } - - try_getPool( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolResult(value[0].toAddress(), value[1].toI32()) - ); - } - - getPoolTokenInfo( - poolId: Bytes, - token: Address - ): BalancerVault__getPoolTokenInfoResult { - const result = super.call( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - - return new BalancerVault__getPoolTokenInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toAddress() - ); - } - - try_getPoolTokenInfo( - poolId: Bytes, - token: Address - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokenInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toAddress() - ) - ); - } - - getPoolTokens(poolId: Bytes): BalancerVault__getPoolTokensResult { - const result = super.call( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - - return new BalancerVault__getPoolTokensResult( - result[0].toAddressArray(), - result[1].toBigIntArray(), - result[2].toBigInt() - ); - } - - try_getPoolTokens( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokensResult( - value[0].toAddressArray(), - value[1].toBigIntArray(), - value[2].toBigInt() - ) - ); - } - - getProtocolFeesCollector(): Address { - const result = super.call( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_getProtocolFeesCollector(): ethereum.CallResult
{ - const result = super.tryCall( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - hasApprovedRelayer(user: Address, relayer: Address): boolean { - const result = super.call( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - - return result[0].toBoolean(); - } - - try_hasApprovedRelayer( - user: Address, - relayer: Address - ): ethereum.CallResult { - const result = super.tryCall( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): Array { - const result = super.call( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - - return result[0].toBigIntArray(); - } - - try_queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): ethereum.CallResult> { - const result = super.tryCall( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - registerPool(specialization: i32): Bytes { - const result = super.call("registerPool", "registerPool(uint8):(bytes32)", [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization)) - ]); - - return result[0].toBytes(); - } - - try_registerPool(specialization: i32): ethereum.CallResult { - const result = super.tryCall( - "registerPool", - "registerPool(uint8):(bytes32)", - [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization))] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get authorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get weth(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class BatchSwapCall extends ethereum.Call { - get inputs(): BatchSwapCall__Inputs { - return new BatchSwapCall__Inputs(this); - } - - get outputs(): BatchSwapCall__Outputs { - return new BatchSwapCall__Outputs(this); - } -} - -export class BatchSwapCall__Inputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - BatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): BatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } - - get limits(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get deadline(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } -} - -export class BatchSwapCall__Outputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get assetDeltas(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class BatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class DeregisterTokensCall extends ethereum.Call { - get inputs(): DeregisterTokensCall__Inputs { - return new DeregisterTokensCall__Inputs(this); - } - - get outputs(): DeregisterTokensCall__Outputs { - return new DeregisterTokensCall__Outputs(this); - } -} - -export class DeregisterTokensCall__Inputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } -} - -export class DeregisterTokensCall__Outputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } -} - -export class ExitPoolCall extends ethereum.Call { - get inputs(): ExitPoolCall__Inputs { - return new ExitPoolCall__Inputs(this); - } - - get outputs(): ExitPoolCall__Outputs { - return new ExitPoolCall__Outputs(this); - } -} - -export class ExitPoolCall__Inputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): ExitPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class ExitPoolCall__Outputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } -} - -export class ExitPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get minAmountsOut(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class FlashLoanCall extends ethereum.Call { - get inputs(): FlashLoanCall__Inputs { - return new FlashLoanCall__Inputs(this); - } - - get outputs(): FlashLoanCall__Outputs { - return new FlashLoanCall__Outputs(this); - } -} - -export class FlashLoanCall__Inputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get amounts(): Array { - return this._call.inputValues[2].value.toBigIntArray(); - } - - get userData(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class FlashLoanCall__Outputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } -} - -export class JoinPoolCall extends ethereum.Call { - get inputs(): JoinPoolCall__Inputs { - return new JoinPoolCall__Inputs(this); - } - - get outputs(): JoinPoolCall__Outputs { - return new JoinPoolCall__Outputs(this); - } -} - -export class JoinPoolCall__Inputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): JoinPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class JoinPoolCall__Outputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } -} - -export class JoinPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get maxAmountsIn(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get fromInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class ManagePoolBalanceCall extends ethereum.Call { - get inputs(): ManagePoolBalanceCall__Inputs { - return new ManagePoolBalanceCall__Inputs(this); - } - - get outputs(): ManagePoolBalanceCall__Outputs { - return new ManagePoolBalanceCall__Outputs(this); - } -} - -export class ManagePoolBalanceCall__Inputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManagePoolBalanceCallOpsStruct - >(); - } -} - -export class ManagePoolBalanceCall__Outputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } -} - -export class ManagePoolBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get poolId(): Bytes { - return this[1].toBytes(); - } - - get token(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } -} - -export class ManageUserBalanceCall extends ethereum.Call { - get inputs(): ManageUserBalanceCall__Inputs { - return new ManageUserBalanceCall__Inputs(this); - } - - get outputs(): ManageUserBalanceCall__Outputs { - return new ManageUserBalanceCall__Outputs(this); - } -} - -export class ManageUserBalanceCall__Inputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManageUserBalanceCallOpsStruct - >(); - } -} - -export class ManageUserBalanceCall__Outputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } -} - -export class ManageUserBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get asset(): Address { - return this[1].toAddress(); - } - - get amount(): BigInt { - return this[2].toBigInt(); - } - - get sender(): Address { - return this[3].toAddress(); - } - - get recipient(): Address { - return this[4].toAddress(); - } -} - -export class QueryBatchSwapCall extends ethereum.Call { - get inputs(): QueryBatchSwapCall__Inputs { - return new QueryBatchSwapCall__Inputs(this); - } - - get outputs(): QueryBatchSwapCall__Outputs { - return new QueryBatchSwapCall__Outputs(this); - } -} - -export class QueryBatchSwapCall__Inputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - QueryBatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): QueryBatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class QueryBatchSwapCall__Outputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class QueryBatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class QueryBatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class RegisterPoolCall extends ethereum.Call { - get inputs(): RegisterPoolCall__Inputs { - return new RegisterPoolCall__Inputs(this); - } - - get outputs(): RegisterPoolCall__Outputs { - return new RegisterPoolCall__Outputs(this); - } -} - -export class RegisterPoolCall__Inputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get specialization(): i32 { - return this._call.inputValues[0].value.toI32(); - } -} - -export class RegisterPoolCall__Outputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get value0(): Bytes { - return this._call.outputValues[0].value.toBytes(); - } -} - -export class RegisterTokensCall extends ethereum.Call { - get inputs(): RegisterTokensCall__Inputs { - return new RegisterTokensCall__Inputs(this); - } - - get outputs(): RegisterTokensCall__Outputs { - return new RegisterTokensCall__Outputs(this); - } -} - -export class RegisterTokensCall__Inputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } -} - -export class RegisterTokensCall__Outputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } -} - -export class SetAuthorizerCall extends ethereum.Call { - get inputs(): SetAuthorizerCall__Inputs { - return new SetAuthorizerCall__Inputs(this); - } - - get outputs(): SetAuthorizerCall__Outputs { - return new SetAuthorizerCall__Outputs(this); - } -} - -export class SetAuthorizerCall__Inputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } - - get newAuthorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetAuthorizerCall__Outputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetRelayerApprovalCall extends ethereum.Call { - get inputs(): SetRelayerApprovalCall__Inputs { - return new SetRelayerApprovalCall__Inputs(this); - } - - get outputs(): SetRelayerApprovalCall__Outputs { - return new SetRelayerApprovalCall__Outputs(this); - } -} - -export class SetRelayerApprovalCall__Inputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get relayer(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get approved(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } -} - -export class SetRelayerApprovalCall__Outputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get singleSwap(): SwapCallSingleSwapStruct { - return changetype( - this._call.inputValues[0].value.toTuple() - ); - } - - get funds(): SwapCallFundsStruct { - return changetype( - this._call.inputValues[1].value.toTuple() - ); - } - - get limit(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amountCalculated(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class SwapCallSingleSwapStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get kind(): i32 { - return this[1].toI32(); - } - - get assetIn(): Address { - return this[2].toAddress(); - } - - get assetOut(): Address { - return this[3].toAddress(); - } - - get amount(): BigInt { - return this[4].toBigInt(); - } - - get userData(): Bytes { - return this[5].toBytes(); - } -} - -export class SwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV4/ERC20.ts b/subgraphs/ethereum/generated/OHMDAIBondV4/ERC20.ts deleted file mode 100644 index bbe93783..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV4/ERC20.ts +++ /dev/null @@ -1,394 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ERC20 extends ethereum.SmartContract { - static bind(address: Address): ERC20 { - return new ERC20("ERC20", address); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - approve(_spender: Address, _value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_approve(_spender: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transferFrom(_from: Address, _to: Address, _value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - _from: Address, - _to: Address, - _value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - balanceOf(_owner: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(_owner: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - transfer(_to: Address, _value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(_to: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - allowance(_owner: Address, _spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - _owner: Address, - _spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get _spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get _from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DefaultCall extends ethereum.Call { - get inputs(): DefaultCall__Inputs { - return new DefaultCall__Inputs(this); - } - - get outputs(): DefaultCall__Outputs { - return new DefaultCall__Outputs(this); - } -} - -export class DefaultCall__Inputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} - -export class DefaultCall__Outputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV4/OHMDAIBondV4.ts b/subgraphs/ethereum/generated/OHMDAIBondV4/OHMDAIBondV4.ts deleted file mode 100644 index 90b5128f..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV4/OHMDAIBondV4.ts +++ /dev/null @@ -1,1298 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ControlVariableAdjustment extends ethereum.Event { - get params(): ControlVariableAdjustment__Params { - return new ControlVariableAdjustment__Params(this); - } -} - -export class ControlVariableAdjustment__Params { - _event: ControlVariableAdjustment; - - constructor(event: ControlVariableAdjustment) { - this._event = event; - } - - get initialBCV(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get newBCV(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get adjustment(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get addition(): boolean { - return this._event.parameters[3].value.toBoolean(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OHMDAIBondV4__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: boolean, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } - - getBuffer(): BigInt { - return this.value3; - } - - getLastBlock(): BigInt { - return this.value4; - } -} - -export class OHMDAIBondV4__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getPayout(): BigInt { - return this.value0; - } - - getVesting(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getPricePaid(): BigInt { - return this.value3; - } -} - -export class OHMDAIBondV4__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getFee(): BigInt { - return this.value4; - } - - getMaxDebt(): BigInt { - return this.value5; - } -} - -export class OHMDAIBondV4 extends ethereum.SmartContract { - static bind(address: Address): OHMDAIBondV4 { - return new OHMDAIBondV4("OHMDAIBondV4", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): OHMDAIBondV4__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - - return new OHMDAIBondV4__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMDAIBondV4__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): OHMDAIBondV4__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new OHMDAIBondV4__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMDAIBondV4__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - currentDebt(): BigInt { - const result = super.call("currentDebt", "currentDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_currentDebt(): ethereum.CallResult { - const result = super.tryCall("currentDebt", "currentDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtDecay(): BigInt { - const result = super.call("debtDecay", "debtDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtDecay(): ethereum.CallResult { - const result = super.tryCall("debtDecay", "debtDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isLiquidityBond(): boolean { - const result = super.call("isLiquidityBond", "isLiquidityBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_isLiquidityBond(): ethereum.CallResult { - const result = super.tryCall( - "isLiquidityBond", - "isLiquidityBond():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - lastDecay(): BigInt { - const result = super.call("lastDecay", "lastDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_lastDecay(): ethereum.CallResult { - const result = super.tryCall("lastDecay", "lastDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - policy(): Address { - const result = super.call("policy", "policy():(address)", []); - - return result[0].toAddress(); - } - - try_policy(): ethereum.CallResult
{ - const result = super.tryCall("policy", "policy():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_recipient: Address, _stake: boolean): BigInt { - const result = super.call("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem( - _recipient: Address, - _stake: boolean - ): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - stakingHelper(): Address { - const result = super.call("stakingHelper", "stakingHelper():(address)", []); - - return result[0].toAddress(); - } - - try_stakingHelper(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingHelper", - "stakingHelper():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - standardizedDebtRatio(): BigInt { - const result = super.call( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_standardizedDebtRatio(): ethereum.CallResult { - const result = super.tryCall( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - terms(): OHMDAIBondV4__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new OHMDAIBondV4__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMDAIBondV4__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - useHelper(): boolean { - const result = super.call("useHelper", "useHelper():(bool)", []); - - return result[0].toBoolean(); - } - - try_useHelper(): ethereum.CallResult { - const result = super.tryCall("useHelper", "useHelper():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _bondCalculator(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class InitializeBondTermsCall extends ethereum.Call { - get inputs(): InitializeBondTermsCall__Inputs { - return new InitializeBondTermsCall__Inputs(this); - } - - get outputs(): InitializeBondTermsCall__Outputs { - return new InitializeBondTermsCall__Outputs(this); - } -} - -export class InitializeBondTermsCall__Inputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } - - get _controlVariable(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _fee(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _maxDebt(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get _initialDebt(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } -} - -export class InitializeBondTermsCall__Outputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _stake(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _buffer(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _parameter(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _input(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _helper(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/OHMDAIBondV4/UniswapV2Pair.ts b/subgraphs/ethereum/generated/OHMDAIBondV4/UniswapV2Pair.ts deleted file mode 100644 index b36eea33..00000000 --- a/subgraphs/ethereum/generated/OHMDAIBondV4/UniswapV2Pair.ts +++ /dev/null @@ -1,1092 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Burn extends ethereum.Event { - get params(): Burn__Params { - return new Burn__Params(this); - } -} - -export class Burn__Params { - _event: Burn; - - constructor(event: Burn) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[3].value.toAddress(); - } -} - -export class Mint extends ethereum.Event { - get params(): Mint__Params { - return new Mint__Params(this); - } -} - -export class Mint__Params { - _event: Mint; - - constructor(event: Mint) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0In(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1In(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get amount0Out(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[5].value.toAddress(); - } -} - -export class Sync extends ethereum.Event { - get params(): Sync__Params { - return new Sync__Params(this); - } -} - -export class Sync__Params { - _event: Sync; - - constructor(event: Sync) { - this._event = event; - } - - get reserve0(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get reserve1(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class UniswapV2Pair__burnResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } - - getAmount0(): BigInt { - return this.value0; - } - - getAmount1(): BigInt { - return this.value1; - } -} - -export class UniswapV2Pair__getReservesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - get_reserve0(): BigInt { - return this.value0; - } - - get_reserve1(): BigInt { - return this.value1; - } - - get_blockTimestampLast(): BigInt { - return this.value2; - } -} - -export class UniswapV2Pair extends ethereum.SmartContract { - static bind(address: Address): UniswapV2Pair { - return new UniswapV2Pair("UniswapV2Pair", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - MINIMUM_LIQUIDITY(): BigInt { - const result = super.call( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_MINIMUM_LIQUIDITY(): ethereum.CallResult { - const result = super.tryCall( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(param0: Address, param1: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - - return result[0].toBigInt(); - } - - try_allowance(param0: Address, param1: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(param0: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(param0: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - burn(to: Address): UniswapV2Pair__burnResult { - const result = super.call("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return new UniswapV2Pair__burnResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_burn(to: Address): ethereum.CallResult { - const result = super.tryCall("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__burnResult(value[0].toBigInt(), value[1].toBigInt()) - ); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - factory(): Address { - const result = super.call("factory", "factory():(address)", []); - - return result[0].toAddress(); - } - - try_factory(): ethereum.CallResult
{ - const result = super.tryCall("factory", "factory():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getReserves(): UniswapV2Pair__getReservesResult { - const result = super.call( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - - return new UniswapV2Pair__getReservesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getReserves(): ethereum.CallResult { - const result = super.tryCall( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__getReservesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - kLast(): BigInt { - const result = super.call("kLast", "kLast():(uint256)", []); - - return result[0].toBigInt(); - } - - try_kLast(): ethereum.CallResult { - const result = super.tryCall("kLast", "kLast():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - mint(to: Address): BigInt { - const result = super.call("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return result[0].toBigInt(); - } - - try_mint(to: Address): ethereum.CallResult { - const result = super.tryCall("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(param0: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_nonces(param0: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price0CumulativeLast(): BigInt { - const result = super.call( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price0CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price1CumulativeLast(): BigInt { - const result = super.call( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price1CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - token0(): Address { - const result = super.call("token0", "token0():(address)", []); - - return result[0].toAddress(); - } - - try_token0(): ethereum.CallResult
{ - const result = super.tryCall("token0", "token0():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - token1(): Address { - const result = super.call("token1", "token1():(address)", []); - - return result[0].toAddress(); - } - - try_token1(): ethereum.CallResult
{ - const result = super.tryCall("token1", "token1():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class BurnCall extends ethereum.Call { - get inputs(): BurnCall__Inputs { - return new BurnCall__Inputs(this); - } - - get outputs(): BurnCall__Outputs { - return new BurnCall__Outputs(this); - } -} - -export class BurnCall__Inputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class BurnCall__Outputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get amount0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amount1(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _token0(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _token1(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class MintCall extends ethereum.Call { - get inputs(): MintCall__Inputs { - return new MintCall__Inputs(this); - } - - get outputs(): MintCall__Outputs { - return new MintCall__Outputs(this); - } -} - -export class MintCall__Inputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class MintCall__Outputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get liquidity(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class SkimCall extends ethereum.Call { - get inputs(): SkimCall__Inputs { - return new SkimCall__Inputs(this); - } - - get outputs(): SkimCall__Outputs { - return new SkimCall__Outputs(this); - } -} - -export class SkimCall__Inputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SkimCall__Outputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amount0Out(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get to(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get data(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } -} - -export class SyncCall extends ethereum.Call { - get inputs(): SyncCall__Inputs { - return new SyncCall__Inputs(this); - } - - get outputs(): SyncCall__Outputs { - return new SyncCall__Outputs(this); - } -} - -export class SyncCall__Inputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class SyncCall__Outputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMETHBondV1/BalancerPoolToken.ts b/subgraphs/ethereum/generated/OHMETHBondV1/BalancerPoolToken.ts deleted file mode 100644 index e1efa45b..00000000 --- a/subgraphs/ethereum/generated/OHMETHBondV1/BalancerPoolToken.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class SwapFeePercentageChanged extends ethereum.Event { - get params(): SwapFeePercentageChanged__Params { - return new SwapFeePercentageChanged__Params(this); - } -} - -export class SwapFeePercentageChanged__Params { - _event: SwapFeePercentageChanged; - - constructor(event: SwapFeePercentageChanged) { - this._event = event; - } - - get swapFeePercentage(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BalancerPoolToken__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerPoolToken__onExitPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onJoinPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onSwapInputRequestStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get tokenIn(): Address { - return this[1].toAddress(); - } - - get tokenOut(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get poolId(): Bytes { - return this[4].toBytes(); - } - - get lastChangeBlock(): BigInt { - return this[5].toBigInt(); - } - - get from(): Address { - return this[6].toAddress(); - } - - get to(): Address { - return this[7].toAddress(); - } - - get userData(): Bytes { - return this[8].toBytes(); - } -} - -export class BalancerPoolToken__queryExitResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptIn(): BigInt { - return this.value0; - } - - getAmountsOut(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__queryJoinResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptOut(): BigInt { - return this.value0; - } - - getAmountsIn(): Array { - return this.value1; - } -} - -export class BalancerPoolToken extends ethereum.SmartContract { - static bind(address: Address): BalancerPoolToken { - return new BalancerPoolToken("BalancerPoolToken", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getInvariant(): BigInt { - const result = super.call("getInvariant", "getInvariant():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getInvariant(): ethereum.CallResult { - const result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getLastInvariant(): BigInt { - const result = super.call( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getLastInvariant(): ethereum.CallResult { - const result = super.tryCall( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getNormalizedWeights(): Array { - const result = super.call( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - - return result[0].toBigIntArray(); - } - - try_getNormalizedWeights(): ethereum.CallResult> { - const result = super.tryCall( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getOwner(): Address { - const result = super.call("getOwner", "getOwner():(address)", []); - - return result[0].toAddress(); - } - - try_getOwner(): ethereum.CallResult
{ - const result = super.tryCall("getOwner", "getOwner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getPausedState(): BalancerPoolToken__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerPoolToken__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerPoolToken__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPoolId(): Bytes { - const result = super.call("getPoolId", "getPoolId():(bytes32)", []); - - return result[0].toBytes(); - } - - try_getPoolId(): ethereum.CallResult { - const result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getRate(): BigInt { - const result = super.call("getRate", "getRate():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getRate(): ethereum.CallResult { - const result = super.tryCall("getRate", "getRate():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getSwapFeePercentage(): BigInt { - const result = super.call( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getSwapFeePercentage(): ethereum.CallResult { - const result = super.tryCall( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getVault(): Address { - const result = super.call("getVault", "getVault():(address)", []); - - return result[0].toAddress(); - } - - try_getVault(): ethereum.CallResult
{ - const result = super.tryCall("getVault", "getVault():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - increaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onExitPoolResult { - const result = super.call( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onExitPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onExitPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onJoinPoolResult { - const result = super.call( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onJoinPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onJoinPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): BigInt { - const result = super.call( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - - return result[0].toBigInt(); - } - - try_onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryExitResult { - const result = super.call( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryExitResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryExitResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryJoinResult { - const result = super.call( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryJoinResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryJoinResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get vault(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get name(): string { - return this._call.inputValues[1].value.toString(); - } - - get symbol(): string { - return this._call.inputValues[2].value.toString(); - } - - get tokens(): Array
{ - return this._call.inputValues[3].value.toAddressArray(); - } - - get normalizedWeights(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[7].value.toBigInt(); - } - - get owner(): Address { - return this._call.inputValues[8].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DecreaseApprovalCall extends ethereum.Call { - get inputs(): DecreaseApprovalCall__Inputs { - return new DecreaseApprovalCall__Inputs(this); - } - - get outputs(): DecreaseApprovalCall__Outputs { - return new DecreaseApprovalCall__Outputs(this); - } -} - -export class DecreaseApprovalCall__Inputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseApprovalCall__Outputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseApprovalCall extends ethereum.Call { - get inputs(): IncreaseApprovalCall__Inputs { - return new IncreaseApprovalCall__Inputs(this); - } - - get outputs(): IncreaseApprovalCall__Outputs { - return new IncreaseApprovalCall__Outputs(this); - } -} - -export class IncreaseApprovalCall__Inputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseApprovalCall__Outputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class OnExitPoolCall extends ethereum.Call { - get inputs(): OnExitPoolCall__Inputs { - return new OnExitPoolCall__Inputs(this); - } - - get outputs(): OnExitPoolCall__Outputs { - return new OnExitPoolCall__Outputs(this); - } -} - -export class OnExitPoolCall__Inputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnExitPoolCall__Outputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class OnJoinPoolCall extends ethereum.Call { - get inputs(): OnJoinPoolCall__Inputs { - return new OnJoinPoolCall__Inputs(this); - } - - get outputs(): OnJoinPoolCall__Outputs { - return new OnJoinPoolCall__Outputs(this); - } -} - -export class OnJoinPoolCall__Inputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnJoinPoolCall__Outputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class QueryExitCall extends ethereum.Call { - get inputs(): QueryExitCall__Inputs { - return new QueryExitCall__Inputs(this); - } - - get outputs(): QueryExitCall__Outputs { - return new QueryExitCall__Outputs(this); - } -} - -export class QueryExitCall__Inputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryExitCall__Outputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get bptIn(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsOut(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class QueryJoinCall extends ethereum.Call { - get inputs(): QueryJoinCall__Inputs { - return new QueryJoinCall__Inputs(this); - } - - get outputs(): QueryJoinCall__Outputs { - return new QueryJoinCall__Outputs(this); - } -} - -export class QueryJoinCall__Inputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryJoinCall__Outputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get bptOut(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsIn(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetSwapFeePercentageCall extends ethereum.Call { - get inputs(): SetSwapFeePercentageCall__Inputs { - return new SetSwapFeePercentageCall__Inputs(this); - } - - get outputs(): SetSwapFeePercentageCall__Outputs { - return new SetSwapFeePercentageCall__Outputs(this); - } -} - -export class SetSwapFeePercentageCall__Inputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetSwapFeePercentageCall__Outputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMETHBondV1/BalancerVault.ts b/subgraphs/ethereum/generated/OHMETHBondV1/BalancerVault.ts deleted file mode 100644 index 41f94648..00000000 --- a/subgraphs/ethereum/generated/OHMETHBondV1/BalancerVault.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class AuthorizerChanged extends ethereum.Event { - get params(): AuthorizerChanged__Params { - return new AuthorizerChanged__Params(this); - } -} - -export class AuthorizerChanged__Params { - _event: AuthorizerChanged; - - constructor(event: AuthorizerChanged) { - this._event = event; - } - - get newAuthorizer(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class ExternalBalanceTransfer extends ethereum.Event { - get params(): ExternalBalanceTransfer__Params { - return new ExternalBalanceTransfer__Params(this); - } -} - -export class ExternalBalanceTransfer__Params { - _event: ExternalBalanceTransfer; - - constructor(event: ExternalBalanceTransfer) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get recipient(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class FlashLoan extends ethereum.Event { - get params(): FlashLoan__Params { - return new FlashLoan__Params(this); - } -} - -export class FlashLoan__Params { - _event: FlashLoan; - - constructor(event: FlashLoan) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get feeAmount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class InternalBalanceChanged extends ethereum.Event { - get params(): InternalBalanceChanged__Params { - return new InternalBalanceChanged__Params(this); - } -} - -export class InternalBalanceChanged__Params { - _event: InternalBalanceChanged; - - constructor(event: InternalBalanceChanged) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get delta(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class PoolBalanceChanged extends ethereum.Event { - get params(): PoolBalanceChanged__Params { - return new PoolBalanceChanged__Params(this); - } -} - -export class PoolBalanceChanged__Params { - _event: PoolBalanceChanged; - - constructor(event: PoolBalanceChanged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get liquidityProvider(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokens(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } - - get deltas(): Array { - return this._event.parameters[3].value.toBigIntArray(); - } - - get protocolFeeAmounts(): Array { - return this._event.parameters[4].value.toBigIntArray(); - } -} - -export class PoolBalanceManaged extends ethereum.Event { - get params(): PoolBalanceManaged__Params { - return new PoolBalanceManaged__Params(this); - } -} - -export class PoolBalanceManaged__Params { - _event: PoolBalanceManaged; - - constructor(event: PoolBalanceManaged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get assetManager(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get cashDelta(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get managedDelta(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class PoolRegistered extends ethereum.Event { - get params(): PoolRegistered__Params { - return new PoolRegistered__Params(this); - } -} - -export class PoolRegistered__Params { - _event: PoolRegistered; - - constructor(event: PoolRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get poolAddress(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get specialization(): i32 { - return this._event.parameters[2].value.toI32(); - } -} - -export class RelayerApprovalChanged extends ethereum.Event { - get params(): RelayerApprovalChanged__Params { - return new RelayerApprovalChanged__Params(this); - } -} - -export class RelayerApprovalChanged__Params { - _event: RelayerApprovalChanged; - - constructor(event: RelayerApprovalChanged) { - this._event = event; - } - - get relayer(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get approved(): boolean { - return this._event.parameters[2].value.toBoolean(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokenIn(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokenOut(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amountIn(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amountOut(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class TokensDeregistered extends ethereum.Event { - get params(): TokensDeregistered__Params { - return new TokensDeregistered__Params(this); - } -} - -export class TokensDeregistered__Params { - _event: TokensDeregistered; - - constructor(event: TokensDeregistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } -} - -export class TokensRegistered extends ethereum.Event { - get params(): TokensRegistered__Params { - return new TokensRegistered__Params(this); - } -} - -export class TokensRegistered__Params { - _event: TokensRegistered; - - constructor(event: TokensRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } -} - -export class BalancerVault__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerVault__getPoolResult { - value0: Address; - value1: i32; - - constructor(value0: Address, value1: i32) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddress(this.value0)); - map.set( - "value1", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) - ); - return map; - } - - getValue0(): Address { - return this.value0; - } - - getValue1(): i32 { - return this.value1; - } -} - -export class BalancerVault__getPoolTokenInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: Address; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: Address) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromAddress(this.value3)); - return map; - } - - getCash(): BigInt { - return this.value0; - } - - getManaged(): BigInt { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } - - getAssetManager(): Address { - return this.value3; - } -} - -export class BalancerVault__getPoolTokensResult { - value0: Array
; - value1: Array; - value2: BigInt; - - constructor(value0: Array
, value1: Array, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddressArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getTokens(): Array
{ - return this.value0; - } - - getBalances(): Array { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } -} - -export class BalancerVault__queryBatchSwapInputSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BalancerVault__queryBatchSwapInputFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class BalancerVault extends ethereum.SmartContract { - static bind(address: Address): BalancerVault { - return new BalancerVault("BalancerVault", address); - } - - WETH(): Address { - const result = super.call("WETH", "WETH():(address)", []); - - return result[0].toAddress(); - } - - try_WETH(): ethereum.CallResult
{ - const result = super.tryCall("WETH", "WETH():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getDomainSeparator(): Bytes { - const result = super.call( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_getDomainSeparator(): ethereum.CallResult { - const result = super.tryCall( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getInternalBalance(user: Address, tokens: Array
): Array { - const result = super.call( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - - return result[0].toBigIntArray(); - } - - try_getInternalBalance( - user: Address, - tokens: Array
- ): ethereum.CallResult> { - const result = super.tryCall( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getNextNonce(user: Address): BigInt { - const result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ - ethereum.Value.fromAddress(user) - ]); - - return result[0].toBigInt(); - } - - try_getNextNonce(user: Address): ethereum.CallResult { - const result = super.tryCall( - "getNextNonce", - "getNextNonce(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getPausedState(): BalancerVault__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerVault__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerVault__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPool(poolId: Bytes): BalancerVault__getPoolResult { - const result = super.call("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - - return new BalancerVault__getPoolResult( - result[0].toAddress(), - result[1].toI32() - ); - } - - try_getPool( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolResult(value[0].toAddress(), value[1].toI32()) - ); - } - - getPoolTokenInfo( - poolId: Bytes, - token: Address - ): BalancerVault__getPoolTokenInfoResult { - const result = super.call( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - - return new BalancerVault__getPoolTokenInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toAddress() - ); - } - - try_getPoolTokenInfo( - poolId: Bytes, - token: Address - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokenInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toAddress() - ) - ); - } - - getPoolTokens(poolId: Bytes): BalancerVault__getPoolTokensResult { - const result = super.call( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - - return new BalancerVault__getPoolTokensResult( - result[0].toAddressArray(), - result[1].toBigIntArray(), - result[2].toBigInt() - ); - } - - try_getPoolTokens( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokensResult( - value[0].toAddressArray(), - value[1].toBigIntArray(), - value[2].toBigInt() - ) - ); - } - - getProtocolFeesCollector(): Address { - const result = super.call( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_getProtocolFeesCollector(): ethereum.CallResult
{ - const result = super.tryCall( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - hasApprovedRelayer(user: Address, relayer: Address): boolean { - const result = super.call( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - - return result[0].toBoolean(); - } - - try_hasApprovedRelayer( - user: Address, - relayer: Address - ): ethereum.CallResult { - const result = super.tryCall( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): Array { - const result = super.call( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - - return result[0].toBigIntArray(); - } - - try_queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): ethereum.CallResult> { - const result = super.tryCall( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - registerPool(specialization: i32): Bytes { - const result = super.call("registerPool", "registerPool(uint8):(bytes32)", [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization)) - ]); - - return result[0].toBytes(); - } - - try_registerPool(specialization: i32): ethereum.CallResult { - const result = super.tryCall( - "registerPool", - "registerPool(uint8):(bytes32)", - [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization))] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get authorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get weth(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class BatchSwapCall extends ethereum.Call { - get inputs(): BatchSwapCall__Inputs { - return new BatchSwapCall__Inputs(this); - } - - get outputs(): BatchSwapCall__Outputs { - return new BatchSwapCall__Outputs(this); - } -} - -export class BatchSwapCall__Inputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - BatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): BatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } - - get limits(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get deadline(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } -} - -export class BatchSwapCall__Outputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get assetDeltas(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class BatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class DeregisterTokensCall extends ethereum.Call { - get inputs(): DeregisterTokensCall__Inputs { - return new DeregisterTokensCall__Inputs(this); - } - - get outputs(): DeregisterTokensCall__Outputs { - return new DeregisterTokensCall__Outputs(this); - } -} - -export class DeregisterTokensCall__Inputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } -} - -export class DeregisterTokensCall__Outputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } -} - -export class ExitPoolCall extends ethereum.Call { - get inputs(): ExitPoolCall__Inputs { - return new ExitPoolCall__Inputs(this); - } - - get outputs(): ExitPoolCall__Outputs { - return new ExitPoolCall__Outputs(this); - } -} - -export class ExitPoolCall__Inputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): ExitPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class ExitPoolCall__Outputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } -} - -export class ExitPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get minAmountsOut(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class FlashLoanCall extends ethereum.Call { - get inputs(): FlashLoanCall__Inputs { - return new FlashLoanCall__Inputs(this); - } - - get outputs(): FlashLoanCall__Outputs { - return new FlashLoanCall__Outputs(this); - } -} - -export class FlashLoanCall__Inputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get amounts(): Array { - return this._call.inputValues[2].value.toBigIntArray(); - } - - get userData(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class FlashLoanCall__Outputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } -} - -export class JoinPoolCall extends ethereum.Call { - get inputs(): JoinPoolCall__Inputs { - return new JoinPoolCall__Inputs(this); - } - - get outputs(): JoinPoolCall__Outputs { - return new JoinPoolCall__Outputs(this); - } -} - -export class JoinPoolCall__Inputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): JoinPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class JoinPoolCall__Outputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } -} - -export class JoinPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get maxAmountsIn(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get fromInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class ManagePoolBalanceCall extends ethereum.Call { - get inputs(): ManagePoolBalanceCall__Inputs { - return new ManagePoolBalanceCall__Inputs(this); - } - - get outputs(): ManagePoolBalanceCall__Outputs { - return new ManagePoolBalanceCall__Outputs(this); - } -} - -export class ManagePoolBalanceCall__Inputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManagePoolBalanceCallOpsStruct - >(); - } -} - -export class ManagePoolBalanceCall__Outputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } -} - -export class ManagePoolBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get poolId(): Bytes { - return this[1].toBytes(); - } - - get token(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } -} - -export class ManageUserBalanceCall extends ethereum.Call { - get inputs(): ManageUserBalanceCall__Inputs { - return new ManageUserBalanceCall__Inputs(this); - } - - get outputs(): ManageUserBalanceCall__Outputs { - return new ManageUserBalanceCall__Outputs(this); - } -} - -export class ManageUserBalanceCall__Inputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManageUserBalanceCallOpsStruct - >(); - } -} - -export class ManageUserBalanceCall__Outputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } -} - -export class ManageUserBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get asset(): Address { - return this[1].toAddress(); - } - - get amount(): BigInt { - return this[2].toBigInt(); - } - - get sender(): Address { - return this[3].toAddress(); - } - - get recipient(): Address { - return this[4].toAddress(); - } -} - -export class QueryBatchSwapCall extends ethereum.Call { - get inputs(): QueryBatchSwapCall__Inputs { - return new QueryBatchSwapCall__Inputs(this); - } - - get outputs(): QueryBatchSwapCall__Outputs { - return new QueryBatchSwapCall__Outputs(this); - } -} - -export class QueryBatchSwapCall__Inputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - QueryBatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): QueryBatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class QueryBatchSwapCall__Outputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class QueryBatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class QueryBatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class RegisterPoolCall extends ethereum.Call { - get inputs(): RegisterPoolCall__Inputs { - return new RegisterPoolCall__Inputs(this); - } - - get outputs(): RegisterPoolCall__Outputs { - return new RegisterPoolCall__Outputs(this); - } -} - -export class RegisterPoolCall__Inputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get specialization(): i32 { - return this._call.inputValues[0].value.toI32(); - } -} - -export class RegisterPoolCall__Outputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get value0(): Bytes { - return this._call.outputValues[0].value.toBytes(); - } -} - -export class RegisterTokensCall extends ethereum.Call { - get inputs(): RegisterTokensCall__Inputs { - return new RegisterTokensCall__Inputs(this); - } - - get outputs(): RegisterTokensCall__Outputs { - return new RegisterTokensCall__Outputs(this); - } -} - -export class RegisterTokensCall__Inputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } -} - -export class RegisterTokensCall__Outputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } -} - -export class SetAuthorizerCall extends ethereum.Call { - get inputs(): SetAuthorizerCall__Inputs { - return new SetAuthorizerCall__Inputs(this); - } - - get outputs(): SetAuthorizerCall__Outputs { - return new SetAuthorizerCall__Outputs(this); - } -} - -export class SetAuthorizerCall__Inputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } - - get newAuthorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetAuthorizerCall__Outputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetRelayerApprovalCall extends ethereum.Call { - get inputs(): SetRelayerApprovalCall__Inputs { - return new SetRelayerApprovalCall__Inputs(this); - } - - get outputs(): SetRelayerApprovalCall__Outputs { - return new SetRelayerApprovalCall__Outputs(this); - } -} - -export class SetRelayerApprovalCall__Inputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get relayer(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get approved(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } -} - -export class SetRelayerApprovalCall__Outputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get singleSwap(): SwapCallSingleSwapStruct { - return changetype( - this._call.inputValues[0].value.toTuple() - ); - } - - get funds(): SwapCallFundsStruct { - return changetype( - this._call.inputValues[1].value.toTuple() - ); - } - - get limit(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amountCalculated(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class SwapCallSingleSwapStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get kind(): i32 { - return this[1].toI32(); - } - - get assetIn(): Address { - return this[2].toAddress(); - } - - get assetOut(): Address { - return this[3].toAddress(); - } - - get amount(): BigInt { - return this[4].toBigInt(); - } - - get userData(): Bytes { - return this[5].toBytes(); - } -} - -export class SwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMETHBondV1/ERC20.ts b/subgraphs/ethereum/generated/OHMETHBondV1/ERC20.ts deleted file mode 100644 index bbe93783..00000000 --- a/subgraphs/ethereum/generated/OHMETHBondV1/ERC20.ts +++ /dev/null @@ -1,394 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ERC20 extends ethereum.SmartContract { - static bind(address: Address): ERC20 { - return new ERC20("ERC20", address); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - approve(_spender: Address, _value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_approve(_spender: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transferFrom(_from: Address, _to: Address, _value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - _from: Address, - _to: Address, - _value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - balanceOf(_owner: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(_owner: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - transfer(_to: Address, _value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(_to: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - allowance(_owner: Address, _spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - _owner: Address, - _spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get _spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get _from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DefaultCall extends ethereum.Call { - get inputs(): DefaultCall__Inputs { - return new DefaultCall__Inputs(this); - } - - get outputs(): DefaultCall__Outputs { - return new DefaultCall__Outputs(this); - } -} - -export class DefaultCall__Inputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} - -export class DefaultCall__Outputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/OHMETHBondV1/OHMETHBondV1.ts b/subgraphs/ethereum/generated/OHMETHBondV1/OHMETHBondV1.ts deleted file mode 100644 index 2446cdeb..00000000 --- a/subgraphs/ethereum/generated/OHMETHBondV1/OHMETHBondV1.ts +++ /dev/null @@ -1,1298 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ControlVariableAdjustment extends ethereum.Event { - get params(): ControlVariableAdjustment__Params { - return new ControlVariableAdjustment__Params(this); - } -} - -export class ControlVariableAdjustment__Params { - _event: ControlVariableAdjustment; - - constructor(event: ControlVariableAdjustment) { - this._event = event; - } - - get initialBCV(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get newBCV(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get adjustment(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get addition(): boolean { - return this._event.parameters[3].value.toBoolean(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OHMETHBondV1__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: boolean, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } - - getBuffer(): BigInt { - return this.value3; - } - - getLastBlock(): BigInt { - return this.value4; - } -} - -export class OHMETHBondV1__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getPayout(): BigInt { - return this.value0; - } - - getVesting(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getPricePaid(): BigInt { - return this.value3; - } -} - -export class OHMETHBondV1__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getFee(): BigInt { - return this.value4; - } - - getMaxDebt(): BigInt { - return this.value5; - } -} - -export class OHMETHBondV1 extends ethereum.SmartContract { - static bind(address: Address): OHMETHBondV1 { - return new OHMETHBondV1("OHMETHBondV1", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): OHMETHBondV1__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - - return new OHMETHBondV1__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMETHBondV1__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): OHMETHBondV1__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new OHMETHBondV1__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMETHBondV1__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - currentDebt(): BigInt { - const result = super.call("currentDebt", "currentDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_currentDebt(): ethereum.CallResult { - const result = super.tryCall("currentDebt", "currentDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtDecay(): BigInt { - const result = super.call("debtDecay", "debtDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtDecay(): ethereum.CallResult { - const result = super.tryCall("debtDecay", "debtDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isLiquidityBond(): boolean { - const result = super.call("isLiquidityBond", "isLiquidityBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_isLiquidityBond(): ethereum.CallResult { - const result = super.tryCall( - "isLiquidityBond", - "isLiquidityBond():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - lastDecay(): BigInt { - const result = super.call("lastDecay", "lastDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_lastDecay(): ethereum.CallResult { - const result = super.tryCall("lastDecay", "lastDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - policy(): Address { - const result = super.call("policy", "policy():(address)", []); - - return result[0].toAddress(); - } - - try_policy(): ethereum.CallResult
{ - const result = super.tryCall("policy", "policy():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_recipient: Address, _stake: boolean): BigInt { - const result = super.call("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem( - _recipient: Address, - _stake: boolean - ): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - stakingHelper(): Address { - const result = super.call("stakingHelper", "stakingHelper():(address)", []); - - return result[0].toAddress(); - } - - try_stakingHelper(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingHelper", - "stakingHelper():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - standardizedDebtRatio(): BigInt { - const result = super.call( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_standardizedDebtRatio(): ethereum.CallResult { - const result = super.tryCall( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - terms(): OHMETHBondV1__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new OHMETHBondV1__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMETHBondV1__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - useHelper(): boolean { - const result = super.call("useHelper", "useHelper():(bool)", []); - - return result[0].toBoolean(); - } - - try_useHelper(): ethereum.CallResult { - const result = super.tryCall("useHelper", "useHelper():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _bondCalculator(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class InitializeBondTermsCall extends ethereum.Call { - get inputs(): InitializeBondTermsCall__Inputs { - return new InitializeBondTermsCall__Inputs(this); - } - - get outputs(): InitializeBondTermsCall__Outputs { - return new InitializeBondTermsCall__Outputs(this); - } -} - -export class InitializeBondTermsCall__Inputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } - - get _controlVariable(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _fee(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _maxDebt(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get _initialDebt(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } -} - -export class InitializeBondTermsCall__Outputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _stake(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _buffer(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _parameter(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _input(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _helper(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/OHMETHBondV1/UniswapV2Pair.ts b/subgraphs/ethereum/generated/OHMETHBondV1/UniswapV2Pair.ts deleted file mode 100644 index b36eea33..00000000 --- a/subgraphs/ethereum/generated/OHMETHBondV1/UniswapV2Pair.ts +++ /dev/null @@ -1,1092 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Burn extends ethereum.Event { - get params(): Burn__Params { - return new Burn__Params(this); - } -} - -export class Burn__Params { - _event: Burn; - - constructor(event: Burn) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[3].value.toAddress(); - } -} - -export class Mint extends ethereum.Event { - get params(): Mint__Params { - return new Mint__Params(this); - } -} - -export class Mint__Params { - _event: Mint; - - constructor(event: Mint) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0In(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1In(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get amount0Out(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[5].value.toAddress(); - } -} - -export class Sync extends ethereum.Event { - get params(): Sync__Params { - return new Sync__Params(this); - } -} - -export class Sync__Params { - _event: Sync; - - constructor(event: Sync) { - this._event = event; - } - - get reserve0(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get reserve1(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class UniswapV2Pair__burnResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } - - getAmount0(): BigInt { - return this.value0; - } - - getAmount1(): BigInt { - return this.value1; - } -} - -export class UniswapV2Pair__getReservesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - get_reserve0(): BigInt { - return this.value0; - } - - get_reserve1(): BigInt { - return this.value1; - } - - get_blockTimestampLast(): BigInt { - return this.value2; - } -} - -export class UniswapV2Pair extends ethereum.SmartContract { - static bind(address: Address): UniswapV2Pair { - return new UniswapV2Pair("UniswapV2Pair", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - MINIMUM_LIQUIDITY(): BigInt { - const result = super.call( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_MINIMUM_LIQUIDITY(): ethereum.CallResult { - const result = super.tryCall( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(param0: Address, param1: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - - return result[0].toBigInt(); - } - - try_allowance(param0: Address, param1: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(param0: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(param0: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - burn(to: Address): UniswapV2Pair__burnResult { - const result = super.call("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return new UniswapV2Pair__burnResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_burn(to: Address): ethereum.CallResult { - const result = super.tryCall("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__burnResult(value[0].toBigInt(), value[1].toBigInt()) - ); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - factory(): Address { - const result = super.call("factory", "factory():(address)", []); - - return result[0].toAddress(); - } - - try_factory(): ethereum.CallResult
{ - const result = super.tryCall("factory", "factory():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getReserves(): UniswapV2Pair__getReservesResult { - const result = super.call( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - - return new UniswapV2Pair__getReservesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getReserves(): ethereum.CallResult { - const result = super.tryCall( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__getReservesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - kLast(): BigInt { - const result = super.call("kLast", "kLast():(uint256)", []); - - return result[0].toBigInt(); - } - - try_kLast(): ethereum.CallResult { - const result = super.tryCall("kLast", "kLast():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - mint(to: Address): BigInt { - const result = super.call("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return result[0].toBigInt(); - } - - try_mint(to: Address): ethereum.CallResult { - const result = super.tryCall("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(param0: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_nonces(param0: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price0CumulativeLast(): BigInt { - const result = super.call( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price0CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price1CumulativeLast(): BigInt { - const result = super.call( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price1CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - token0(): Address { - const result = super.call("token0", "token0():(address)", []); - - return result[0].toAddress(); - } - - try_token0(): ethereum.CallResult
{ - const result = super.tryCall("token0", "token0():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - token1(): Address { - const result = super.call("token1", "token1():(address)", []); - - return result[0].toAddress(); - } - - try_token1(): ethereum.CallResult
{ - const result = super.tryCall("token1", "token1():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class BurnCall extends ethereum.Call { - get inputs(): BurnCall__Inputs { - return new BurnCall__Inputs(this); - } - - get outputs(): BurnCall__Outputs { - return new BurnCall__Outputs(this); - } -} - -export class BurnCall__Inputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class BurnCall__Outputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get amount0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amount1(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _token0(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _token1(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class MintCall extends ethereum.Call { - get inputs(): MintCall__Inputs { - return new MintCall__Inputs(this); - } - - get outputs(): MintCall__Outputs { - return new MintCall__Outputs(this); - } -} - -export class MintCall__Inputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class MintCall__Outputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get liquidity(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class SkimCall extends ethereum.Call { - get inputs(): SkimCall__Inputs { - return new SkimCall__Inputs(this); - } - - get outputs(): SkimCall__Outputs { - return new SkimCall__Outputs(this); - } -} - -export class SkimCall__Inputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SkimCall__Outputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amount0Out(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get to(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get data(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } -} - -export class SyncCall extends ethereum.Call { - get inputs(): SyncCall__Inputs { - return new SyncCall__Inputs(this); - } - - get outputs(): SyncCall__Outputs { - return new SyncCall__Outputs(this); - } -} - -export class SyncCall__Inputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class SyncCall__Outputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMFRAXBondV1/BalancerPoolToken.ts b/subgraphs/ethereum/generated/OHMFRAXBondV1/BalancerPoolToken.ts deleted file mode 100644 index e1efa45b..00000000 --- a/subgraphs/ethereum/generated/OHMFRAXBondV1/BalancerPoolToken.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class SwapFeePercentageChanged extends ethereum.Event { - get params(): SwapFeePercentageChanged__Params { - return new SwapFeePercentageChanged__Params(this); - } -} - -export class SwapFeePercentageChanged__Params { - _event: SwapFeePercentageChanged; - - constructor(event: SwapFeePercentageChanged) { - this._event = event; - } - - get swapFeePercentage(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BalancerPoolToken__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerPoolToken__onExitPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onJoinPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onSwapInputRequestStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get tokenIn(): Address { - return this[1].toAddress(); - } - - get tokenOut(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get poolId(): Bytes { - return this[4].toBytes(); - } - - get lastChangeBlock(): BigInt { - return this[5].toBigInt(); - } - - get from(): Address { - return this[6].toAddress(); - } - - get to(): Address { - return this[7].toAddress(); - } - - get userData(): Bytes { - return this[8].toBytes(); - } -} - -export class BalancerPoolToken__queryExitResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptIn(): BigInt { - return this.value0; - } - - getAmountsOut(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__queryJoinResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptOut(): BigInt { - return this.value0; - } - - getAmountsIn(): Array { - return this.value1; - } -} - -export class BalancerPoolToken extends ethereum.SmartContract { - static bind(address: Address): BalancerPoolToken { - return new BalancerPoolToken("BalancerPoolToken", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getInvariant(): BigInt { - const result = super.call("getInvariant", "getInvariant():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getInvariant(): ethereum.CallResult { - const result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getLastInvariant(): BigInt { - const result = super.call( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getLastInvariant(): ethereum.CallResult { - const result = super.tryCall( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getNormalizedWeights(): Array { - const result = super.call( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - - return result[0].toBigIntArray(); - } - - try_getNormalizedWeights(): ethereum.CallResult> { - const result = super.tryCall( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getOwner(): Address { - const result = super.call("getOwner", "getOwner():(address)", []); - - return result[0].toAddress(); - } - - try_getOwner(): ethereum.CallResult
{ - const result = super.tryCall("getOwner", "getOwner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getPausedState(): BalancerPoolToken__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerPoolToken__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerPoolToken__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPoolId(): Bytes { - const result = super.call("getPoolId", "getPoolId():(bytes32)", []); - - return result[0].toBytes(); - } - - try_getPoolId(): ethereum.CallResult { - const result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getRate(): BigInt { - const result = super.call("getRate", "getRate():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getRate(): ethereum.CallResult { - const result = super.tryCall("getRate", "getRate():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getSwapFeePercentage(): BigInt { - const result = super.call( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getSwapFeePercentage(): ethereum.CallResult { - const result = super.tryCall( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getVault(): Address { - const result = super.call("getVault", "getVault():(address)", []); - - return result[0].toAddress(); - } - - try_getVault(): ethereum.CallResult
{ - const result = super.tryCall("getVault", "getVault():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - increaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onExitPoolResult { - const result = super.call( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onExitPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onExitPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onJoinPoolResult { - const result = super.call( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onJoinPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onJoinPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): BigInt { - const result = super.call( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - - return result[0].toBigInt(); - } - - try_onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryExitResult { - const result = super.call( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryExitResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryExitResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryJoinResult { - const result = super.call( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryJoinResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryJoinResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get vault(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get name(): string { - return this._call.inputValues[1].value.toString(); - } - - get symbol(): string { - return this._call.inputValues[2].value.toString(); - } - - get tokens(): Array
{ - return this._call.inputValues[3].value.toAddressArray(); - } - - get normalizedWeights(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[7].value.toBigInt(); - } - - get owner(): Address { - return this._call.inputValues[8].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DecreaseApprovalCall extends ethereum.Call { - get inputs(): DecreaseApprovalCall__Inputs { - return new DecreaseApprovalCall__Inputs(this); - } - - get outputs(): DecreaseApprovalCall__Outputs { - return new DecreaseApprovalCall__Outputs(this); - } -} - -export class DecreaseApprovalCall__Inputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseApprovalCall__Outputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseApprovalCall extends ethereum.Call { - get inputs(): IncreaseApprovalCall__Inputs { - return new IncreaseApprovalCall__Inputs(this); - } - - get outputs(): IncreaseApprovalCall__Outputs { - return new IncreaseApprovalCall__Outputs(this); - } -} - -export class IncreaseApprovalCall__Inputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseApprovalCall__Outputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class OnExitPoolCall extends ethereum.Call { - get inputs(): OnExitPoolCall__Inputs { - return new OnExitPoolCall__Inputs(this); - } - - get outputs(): OnExitPoolCall__Outputs { - return new OnExitPoolCall__Outputs(this); - } -} - -export class OnExitPoolCall__Inputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnExitPoolCall__Outputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class OnJoinPoolCall extends ethereum.Call { - get inputs(): OnJoinPoolCall__Inputs { - return new OnJoinPoolCall__Inputs(this); - } - - get outputs(): OnJoinPoolCall__Outputs { - return new OnJoinPoolCall__Outputs(this); - } -} - -export class OnJoinPoolCall__Inputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnJoinPoolCall__Outputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class QueryExitCall extends ethereum.Call { - get inputs(): QueryExitCall__Inputs { - return new QueryExitCall__Inputs(this); - } - - get outputs(): QueryExitCall__Outputs { - return new QueryExitCall__Outputs(this); - } -} - -export class QueryExitCall__Inputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryExitCall__Outputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get bptIn(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsOut(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class QueryJoinCall extends ethereum.Call { - get inputs(): QueryJoinCall__Inputs { - return new QueryJoinCall__Inputs(this); - } - - get outputs(): QueryJoinCall__Outputs { - return new QueryJoinCall__Outputs(this); - } -} - -export class QueryJoinCall__Inputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryJoinCall__Outputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get bptOut(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsIn(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetSwapFeePercentageCall extends ethereum.Call { - get inputs(): SetSwapFeePercentageCall__Inputs { - return new SetSwapFeePercentageCall__Inputs(this); - } - - get outputs(): SetSwapFeePercentageCall__Outputs { - return new SetSwapFeePercentageCall__Outputs(this); - } -} - -export class SetSwapFeePercentageCall__Inputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetSwapFeePercentageCall__Outputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMFRAXBondV1/BalancerVault.ts b/subgraphs/ethereum/generated/OHMFRAXBondV1/BalancerVault.ts deleted file mode 100644 index 41f94648..00000000 --- a/subgraphs/ethereum/generated/OHMFRAXBondV1/BalancerVault.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class AuthorizerChanged extends ethereum.Event { - get params(): AuthorizerChanged__Params { - return new AuthorizerChanged__Params(this); - } -} - -export class AuthorizerChanged__Params { - _event: AuthorizerChanged; - - constructor(event: AuthorizerChanged) { - this._event = event; - } - - get newAuthorizer(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class ExternalBalanceTransfer extends ethereum.Event { - get params(): ExternalBalanceTransfer__Params { - return new ExternalBalanceTransfer__Params(this); - } -} - -export class ExternalBalanceTransfer__Params { - _event: ExternalBalanceTransfer; - - constructor(event: ExternalBalanceTransfer) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get recipient(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class FlashLoan extends ethereum.Event { - get params(): FlashLoan__Params { - return new FlashLoan__Params(this); - } -} - -export class FlashLoan__Params { - _event: FlashLoan; - - constructor(event: FlashLoan) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get feeAmount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class InternalBalanceChanged extends ethereum.Event { - get params(): InternalBalanceChanged__Params { - return new InternalBalanceChanged__Params(this); - } -} - -export class InternalBalanceChanged__Params { - _event: InternalBalanceChanged; - - constructor(event: InternalBalanceChanged) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get delta(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class PoolBalanceChanged extends ethereum.Event { - get params(): PoolBalanceChanged__Params { - return new PoolBalanceChanged__Params(this); - } -} - -export class PoolBalanceChanged__Params { - _event: PoolBalanceChanged; - - constructor(event: PoolBalanceChanged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get liquidityProvider(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokens(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } - - get deltas(): Array { - return this._event.parameters[3].value.toBigIntArray(); - } - - get protocolFeeAmounts(): Array { - return this._event.parameters[4].value.toBigIntArray(); - } -} - -export class PoolBalanceManaged extends ethereum.Event { - get params(): PoolBalanceManaged__Params { - return new PoolBalanceManaged__Params(this); - } -} - -export class PoolBalanceManaged__Params { - _event: PoolBalanceManaged; - - constructor(event: PoolBalanceManaged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get assetManager(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get cashDelta(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get managedDelta(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class PoolRegistered extends ethereum.Event { - get params(): PoolRegistered__Params { - return new PoolRegistered__Params(this); - } -} - -export class PoolRegistered__Params { - _event: PoolRegistered; - - constructor(event: PoolRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get poolAddress(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get specialization(): i32 { - return this._event.parameters[2].value.toI32(); - } -} - -export class RelayerApprovalChanged extends ethereum.Event { - get params(): RelayerApprovalChanged__Params { - return new RelayerApprovalChanged__Params(this); - } -} - -export class RelayerApprovalChanged__Params { - _event: RelayerApprovalChanged; - - constructor(event: RelayerApprovalChanged) { - this._event = event; - } - - get relayer(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get approved(): boolean { - return this._event.parameters[2].value.toBoolean(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokenIn(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokenOut(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amountIn(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amountOut(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class TokensDeregistered extends ethereum.Event { - get params(): TokensDeregistered__Params { - return new TokensDeregistered__Params(this); - } -} - -export class TokensDeregistered__Params { - _event: TokensDeregistered; - - constructor(event: TokensDeregistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } -} - -export class TokensRegistered extends ethereum.Event { - get params(): TokensRegistered__Params { - return new TokensRegistered__Params(this); - } -} - -export class TokensRegistered__Params { - _event: TokensRegistered; - - constructor(event: TokensRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } -} - -export class BalancerVault__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerVault__getPoolResult { - value0: Address; - value1: i32; - - constructor(value0: Address, value1: i32) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddress(this.value0)); - map.set( - "value1", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) - ); - return map; - } - - getValue0(): Address { - return this.value0; - } - - getValue1(): i32 { - return this.value1; - } -} - -export class BalancerVault__getPoolTokenInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: Address; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: Address) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromAddress(this.value3)); - return map; - } - - getCash(): BigInt { - return this.value0; - } - - getManaged(): BigInt { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } - - getAssetManager(): Address { - return this.value3; - } -} - -export class BalancerVault__getPoolTokensResult { - value0: Array
; - value1: Array; - value2: BigInt; - - constructor(value0: Array
, value1: Array, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddressArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getTokens(): Array
{ - return this.value0; - } - - getBalances(): Array { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } -} - -export class BalancerVault__queryBatchSwapInputSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BalancerVault__queryBatchSwapInputFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class BalancerVault extends ethereum.SmartContract { - static bind(address: Address): BalancerVault { - return new BalancerVault("BalancerVault", address); - } - - WETH(): Address { - const result = super.call("WETH", "WETH():(address)", []); - - return result[0].toAddress(); - } - - try_WETH(): ethereum.CallResult
{ - const result = super.tryCall("WETH", "WETH():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getDomainSeparator(): Bytes { - const result = super.call( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_getDomainSeparator(): ethereum.CallResult { - const result = super.tryCall( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getInternalBalance(user: Address, tokens: Array
): Array { - const result = super.call( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - - return result[0].toBigIntArray(); - } - - try_getInternalBalance( - user: Address, - tokens: Array
- ): ethereum.CallResult> { - const result = super.tryCall( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getNextNonce(user: Address): BigInt { - const result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ - ethereum.Value.fromAddress(user) - ]); - - return result[0].toBigInt(); - } - - try_getNextNonce(user: Address): ethereum.CallResult { - const result = super.tryCall( - "getNextNonce", - "getNextNonce(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getPausedState(): BalancerVault__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerVault__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerVault__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPool(poolId: Bytes): BalancerVault__getPoolResult { - const result = super.call("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - - return new BalancerVault__getPoolResult( - result[0].toAddress(), - result[1].toI32() - ); - } - - try_getPool( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolResult(value[0].toAddress(), value[1].toI32()) - ); - } - - getPoolTokenInfo( - poolId: Bytes, - token: Address - ): BalancerVault__getPoolTokenInfoResult { - const result = super.call( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - - return new BalancerVault__getPoolTokenInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toAddress() - ); - } - - try_getPoolTokenInfo( - poolId: Bytes, - token: Address - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokenInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toAddress() - ) - ); - } - - getPoolTokens(poolId: Bytes): BalancerVault__getPoolTokensResult { - const result = super.call( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - - return new BalancerVault__getPoolTokensResult( - result[0].toAddressArray(), - result[1].toBigIntArray(), - result[2].toBigInt() - ); - } - - try_getPoolTokens( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokensResult( - value[0].toAddressArray(), - value[1].toBigIntArray(), - value[2].toBigInt() - ) - ); - } - - getProtocolFeesCollector(): Address { - const result = super.call( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_getProtocolFeesCollector(): ethereum.CallResult
{ - const result = super.tryCall( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - hasApprovedRelayer(user: Address, relayer: Address): boolean { - const result = super.call( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - - return result[0].toBoolean(); - } - - try_hasApprovedRelayer( - user: Address, - relayer: Address - ): ethereum.CallResult { - const result = super.tryCall( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): Array { - const result = super.call( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - - return result[0].toBigIntArray(); - } - - try_queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): ethereum.CallResult> { - const result = super.tryCall( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - registerPool(specialization: i32): Bytes { - const result = super.call("registerPool", "registerPool(uint8):(bytes32)", [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization)) - ]); - - return result[0].toBytes(); - } - - try_registerPool(specialization: i32): ethereum.CallResult { - const result = super.tryCall( - "registerPool", - "registerPool(uint8):(bytes32)", - [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization))] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get authorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get weth(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class BatchSwapCall extends ethereum.Call { - get inputs(): BatchSwapCall__Inputs { - return new BatchSwapCall__Inputs(this); - } - - get outputs(): BatchSwapCall__Outputs { - return new BatchSwapCall__Outputs(this); - } -} - -export class BatchSwapCall__Inputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - BatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): BatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } - - get limits(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get deadline(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } -} - -export class BatchSwapCall__Outputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get assetDeltas(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class BatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class DeregisterTokensCall extends ethereum.Call { - get inputs(): DeregisterTokensCall__Inputs { - return new DeregisterTokensCall__Inputs(this); - } - - get outputs(): DeregisterTokensCall__Outputs { - return new DeregisterTokensCall__Outputs(this); - } -} - -export class DeregisterTokensCall__Inputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } -} - -export class DeregisterTokensCall__Outputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } -} - -export class ExitPoolCall extends ethereum.Call { - get inputs(): ExitPoolCall__Inputs { - return new ExitPoolCall__Inputs(this); - } - - get outputs(): ExitPoolCall__Outputs { - return new ExitPoolCall__Outputs(this); - } -} - -export class ExitPoolCall__Inputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): ExitPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class ExitPoolCall__Outputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } -} - -export class ExitPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get minAmountsOut(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class FlashLoanCall extends ethereum.Call { - get inputs(): FlashLoanCall__Inputs { - return new FlashLoanCall__Inputs(this); - } - - get outputs(): FlashLoanCall__Outputs { - return new FlashLoanCall__Outputs(this); - } -} - -export class FlashLoanCall__Inputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get amounts(): Array { - return this._call.inputValues[2].value.toBigIntArray(); - } - - get userData(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class FlashLoanCall__Outputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } -} - -export class JoinPoolCall extends ethereum.Call { - get inputs(): JoinPoolCall__Inputs { - return new JoinPoolCall__Inputs(this); - } - - get outputs(): JoinPoolCall__Outputs { - return new JoinPoolCall__Outputs(this); - } -} - -export class JoinPoolCall__Inputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): JoinPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class JoinPoolCall__Outputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } -} - -export class JoinPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get maxAmountsIn(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get fromInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class ManagePoolBalanceCall extends ethereum.Call { - get inputs(): ManagePoolBalanceCall__Inputs { - return new ManagePoolBalanceCall__Inputs(this); - } - - get outputs(): ManagePoolBalanceCall__Outputs { - return new ManagePoolBalanceCall__Outputs(this); - } -} - -export class ManagePoolBalanceCall__Inputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManagePoolBalanceCallOpsStruct - >(); - } -} - -export class ManagePoolBalanceCall__Outputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } -} - -export class ManagePoolBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get poolId(): Bytes { - return this[1].toBytes(); - } - - get token(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } -} - -export class ManageUserBalanceCall extends ethereum.Call { - get inputs(): ManageUserBalanceCall__Inputs { - return new ManageUserBalanceCall__Inputs(this); - } - - get outputs(): ManageUserBalanceCall__Outputs { - return new ManageUserBalanceCall__Outputs(this); - } -} - -export class ManageUserBalanceCall__Inputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManageUserBalanceCallOpsStruct - >(); - } -} - -export class ManageUserBalanceCall__Outputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } -} - -export class ManageUserBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get asset(): Address { - return this[1].toAddress(); - } - - get amount(): BigInt { - return this[2].toBigInt(); - } - - get sender(): Address { - return this[3].toAddress(); - } - - get recipient(): Address { - return this[4].toAddress(); - } -} - -export class QueryBatchSwapCall extends ethereum.Call { - get inputs(): QueryBatchSwapCall__Inputs { - return new QueryBatchSwapCall__Inputs(this); - } - - get outputs(): QueryBatchSwapCall__Outputs { - return new QueryBatchSwapCall__Outputs(this); - } -} - -export class QueryBatchSwapCall__Inputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - QueryBatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): QueryBatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class QueryBatchSwapCall__Outputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class QueryBatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class QueryBatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class RegisterPoolCall extends ethereum.Call { - get inputs(): RegisterPoolCall__Inputs { - return new RegisterPoolCall__Inputs(this); - } - - get outputs(): RegisterPoolCall__Outputs { - return new RegisterPoolCall__Outputs(this); - } -} - -export class RegisterPoolCall__Inputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get specialization(): i32 { - return this._call.inputValues[0].value.toI32(); - } -} - -export class RegisterPoolCall__Outputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get value0(): Bytes { - return this._call.outputValues[0].value.toBytes(); - } -} - -export class RegisterTokensCall extends ethereum.Call { - get inputs(): RegisterTokensCall__Inputs { - return new RegisterTokensCall__Inputs(this); - } - - get outputs(): RegisterTokensCall__Outputs { - return new RegisterTokensCall__Outputs(this); - } -} - -export class RegisterTokensCall__Inputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } -} - -export class RegisterTokensCall__Outputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } -} - -export class SetAuthorizerCall extends ethereum.Call { - get inputs(): SetAuthorizerCall__Inputs { - return new SetAuthorizerCall__Inputs(this); - } - - get outputs(): SetAuthorizerCall__Outputs { - return new SetAuthorizerCall__Outputs(this); - } -} - -export class SetAuthorizerCall__Inputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } - - get newAuthorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetAuthorizerCall__Outputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetRelayerApprovalCall extends ethereum.Call { - get inputs(): SetRelayerApprovalCall__Inputs { - return new SetRelayerApprovalCall__Inputs(this); - } - - get outputs(): SetRelayerApprovalCall__Outputs { - return new SetRelayerApprovalCall__Outputs(this); - } -} - -export class SetRelayerApprovalCall__Inputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get relayer(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get approved(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } -} - -export class SetRelayerApprovalCall__Outputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get singleSwap(): SwapCallSingleSwapStruct { - return changetype( - this._call.inputValues[0].value.toTuple() - ); - } - - get funds(): SwapCallFundsStruct { - return changetype( - this._call.inputValues[1].value.toTuple() - ); - } - - get limit(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amountCalculated(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class SwapCallSingleSwapStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get kind(): i32 { - return this[1].toI32(); - } - - get assetIn(): Address { - return this[2].toAddress(); - } - - get assetOut(): Address { - return this[3].toAddress(); - } - - get amount(): BigInt { - return this[4].toBigInt(); - } - - get userData(): Bytes { - return this[5].toBytes(); - } -} - -export class SwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMFRAXBondV1/ERC20.ts b/subgraphs/ethereum/generated/OHMFRAXBondV1/ERC20.ts deleted file mode 100644 index bbe93783..00000000 --- a/subgraphs/ethereum/generated/OHMFRAXBondV1/ERC20.ts +++ /dev/null @@ -1,394 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ERC20 extends ethereum.SmartContract { - static bind(address: Address): ERC20 { - return new ERC20("ERC20", address); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - approve(_spender: Address, _value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_approve(_spender: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transferFrom(_from: Address, _to: Address, _value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - _from: Address, - _to: Address, - _value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - balanceOf(_owner: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(_owner: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - transfer(_to: Address, _value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(_to: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - allowance(_owner: Address, _spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - _owner: Address, - _spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get _spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get _from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DefaultCall extends ethereum.Call { - get inputs(): DefaultCall__Inputs { - return new DefaultCall__Inputs(this); - } - - get outputs(): DefaultCall__Outputs { - return new DefaultCall__Outputs(this); - } -} - -export class DefaultCall__Inputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} - -export class DefaultCall__Outputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/OHMFRAXBondV1/OHMFRAXBondV1.ts b/subgraphs/ethereum/generated/OHMFRAXBondV1/OHMFRAXBondV1.ts deleted file mode 100644 index 432e0591..00000000 --- a/subgraphs/ethereum/generated/OHMFRAXBondV1/OHMFRAXBondV1.ts +++ /dev/null @@ -1,1132 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get payout(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OHMFRAXBondV1__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } -} - -export class OHMFRAXBondV1__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getValueRemaining(): BigInt { - return this.value0; - } - - getPayoutRemaining(): BigInt { - return this.value1; - } - - getVestingPeriod(): BigInt { - return this.value2; - } - - getLastBlock(): BigInt { - return this.value3; - } - - getPricePaid(): BigInt { - return this.value4; - } -} - -export class OHMFRAXBondV1__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getFee(): BigInt { - return this.value4; - } - - getMaxDebt(): BigInt { - return this.value5; - } -} - -export class OHMFRAXBondV1 extends ethereum.SmartContract { - static bind(address: Address): OHMFRAXBondV1 { - return new OHMFRAXBondV1("OHMFRAXBondV1", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): OHMFRAXBondV1__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256)", - [] - ); - - return new OHMFRAXBondV1__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMFRAXBondV1__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): OHMFRAXBondV1__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new OHMFRAXBondV1__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMFRAXBondV1__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isLiquidityBond(): boolean { - const result = super.call("isLiquidityBond", "isLiquidityBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_isLiquidityBond(): ethereum.CallResult { - const result = super.tryCall( - "isLiquidityBond", - "isLiquidityBond():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - manager(): Address { - const result = super.call("manager", "manager():(address)", []); - - return result[0].toAddress(); - } - - try_manager(): ethereum.CallResult
{ - const result = super.tryCall("manager", "manager():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_stake: boolean): BigInt { - const result = super.call("redeem", "redeem(bool):(uint256)", [ - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem(_stake: boolean): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(bool):(uint256)", [ - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - terms(): OHMFRAXBondV1__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new OHMFRAXBondV1__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMFRAXBondV1__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _bondCalculator(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class InitializeBondTermsCall extends ethereum.Call { - get inputs(): InitializeBondTermsCall__Inputs { - return new InitializeBondTermsCall__Inputs(this); - } - - get outputs(): InitializeBondTermsCall__Outputs { - return new InitializeBondTermsCall__Outputs(this); - } -} - -export class InitializeBondTermsCall__Inputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } - - get _controlVariable(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _fee(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _maxDebt(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } -} - -export class InitializeBondTermsCall__Outputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _stake(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _parameter(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _input(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/OHMFRAXBondV1/UniswapV2Pair.ts b/subgraphs/ethereum/generated/OHMFRAXBondV1/UniswapV2Pair.ts deleted file mode 100644 index b36eea33..00000000 --- a/subgraphs/ethereum/generated/OHMFRAXBondV1/UniswapV2Pair.ts +++ /dev/null @@ -1,1092 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Burn extends ethereum.Event { - get params(): Burn__Params { - return new Burn__Params(this); - } -} - -export class Burn__Params { - _event: Burn; - - constructor(event: Burn) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[3].value.toAddress(); - } -} - -export class Mint extends ethereum.Event { - get params(): Mint__Params { - return new Mint__Params(this); - } -} - -export class Mint__Params { - _event: Mint; - - constructor(event: Mint) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0In(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1In(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get amount0Out(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[5].value.toAddress(); - } -} - -export class Sync extends ethereum.Event { - get params(): Sync__Params { - return new Sync__Params(this); - } -} - -export class Sync__Params { - _event: Sync; - - constructor(event: Sync) { - this._event = event; - } - - get reserve0(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get reserve1(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class UniswapV2Pair__burnResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } - - getAmount0(): BigInt { - return this.value0; - } - - getAmount1(): BigInt { - return this.value1; - } -} - -export class UniswapV2Pair__getReservesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - get_reserve0(): BigInt { - return this.value0; - } - - get_reserve1(): BigInt { - return this.value1; - } - - get_blockTimestampLast(): BigInt { - return this.value2; - } -} - -export class UniswapV2Pair extends ethereum.SmartContract { - static bind(address: Address): UniswapV2Pair { - return new UniswapV2Pair("UniswapV2Pair", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - MINIMUM_LIQUIDITY(): BigInt { - const result = super.call( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_MINIMUM_LIQUIDITY(): ethereum.CallResult { - const result = super.tryCall( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(param0: Address, param1: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - - return result[0].toBigInt(); - } - - try_allowance(param0: Address, param1: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(param0: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(param0: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - burn(to: Address): UniswapV2Pair__burnResult { - const result = super.call("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return new UniswapV2Pair__burnResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_burn(to: Address): ethereum.CallResult { - const result = super.tryCall("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__burnResult(value[0].toBigInt(), value[1].toBigInt()) - ); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - factory(): Address { - const result = super.call("factory", "factory():(address)", []); - - return result[0].toAddress(); - } - - try_factory(): ethereum.CallResult
{ - const result = super.tryCall("factory", "factory():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getReserves(): UniswapV2Pair__getReservesResult { - const result = super.call( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - - return new UniswapV2Pair__getReservesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getReserves(): ethereum.CallResult { - const result = super.tryCall( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__getReservesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - kLast(): BigInt { - const result = super.call("kLast", "kLast():(uint256)", []); - - return result[0].toBigInt(); - } - - try_kLast(): ethereum.CallResult { - const result = super.tryCall("kLast", "kLast():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - mint(to: Address): BigInt { - const result = super.call("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return result[0].toBigInt(); - } - - try_mint(to: Address): ethereum.CallResult { - const result = super.tryCall("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(param0: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_nonces(param0: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price0CumulativeLast(): BigInt { - const result = super.call( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price0CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price1CumulativeLast(): BigInt { - const result = super.call( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price1CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - token0(): Address { - const result = super.call("token0", "token0():(address)", []); - - return result[0].toAddress(); - } - - try_token0(): ethereum.CallResult
{ - const result = super.tryCall("token0", "token0():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - token1(): Address { - const result = super.call("token1", "token1():(address)", []); - - return result[0].toAddress(); - } - - try_token1(): ethereum.CallResult
{ - const result = super.tryCall("token1", "token1():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class BurnCall extends ethereum.Call { - get inputs(): BurnCall__Inputs { - return new BurnCall__Inputs(this); - } - - get outputs(): BurnCall__Outputs { - return new BurnCall__Outputs(this); - } -} - -export class BurnCall__Inputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class BurnCall__Outputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get amount0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amount1(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _token0(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _token1(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class MintCall extends ethereum.Call { - get inputs(): MintCall__Inputs { - return new MintCall__Inputs(this); - } - - get outputs(): MintCall__Outputs { - return new MintCall__Outputs(this); - } -} - -export class MintCall__Inputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class MintCall__Outputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get liquidity(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class SkimCall extends ethereum.Call { - get inputs(): SkimCall__Inputs { - return new SkimCall__Inputs(this); - } - - get outputs(): SkimCall__Outputs { - return new SkimCall__Outputs(this); - } -} - -export class SkimCall__Inputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SkimCall__Outputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amount0Out(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get to(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get data(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } -} - -export class SyncCall extends ethereum.Call { - get inputs(): SyncCall__Inputs { - return new SyncCall__Inputs(this); - } - - get outputs(): SyncCall__Outputs { - return new SyncCall__Outputs(this); - } -} - -export class SyncCall__Inputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class SyncCall__Outputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMFRAXBondV2/BalancerPoolToken.ts b/subgraphs/ethereum/generated/OHMFRAXBondV2/BalancerPoolToken.ts deleted file mode 100644 index e1efa45b..00000000 --- a/subgraphs/ethereum/generated/OHMFRAXBondV2/BalancerPoolToken.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class SwapFeePercentageChanged extends ethereum.Event { - get params(): SwapFeePercentageChanged__Params { - return new SwapFeePercentageChanged__Params(this); - } -} - -export class SwapFeePercentageChanged__Params { - _event: SwapFeePercentageChanged; - - constructor(event: SwapFeePercentageChanged) { - this._event = event; - } - - get swapFeePercentage(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BalancerPoolToken__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerPoolToken__onExitPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onJoinPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onSwapInputRequestStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get tokenIn(): Address { - return this[1].toAddress(); - } - - get tokenOut(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get poolId(): Bytes { - return this[4].toBytes(); - } - - get lastChangeBlock(): BigInt { - return this[5].toBigInt(); - } - - get from(): Address { - return this[6].toAddress(); - } - - get to(): Address { - return this[7].toAddress(); - } - - get userData(): Bytes { - return this[8].toBytes(); - } -} - -export class BalancerPoolToken__queryExitResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptIn(): BigInt { - return this.value0; - } - - getAmountsOut(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__queryJoinResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptOut(): BigInt { - return this.value0; - } - - getAmountsIn(): Array { - return this.value1; - } -} - -export class BalancerPoolToken extends ethereum.SmartContract { - static bind(address: Address): BalancerPoolToken { - return new BalancerPoolToken("BalancerPoolToken", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getInvariant(): BigInt { - const result = super.call("getInvariant", "getInvariant():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getInvariant(): ethereum.CallResult { - const result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getLastInvariant(): BigInt { - const result = super.call( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getLastInvariant(): ethereum.CallResult { - const result = super.tryCall( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getNormalizedWeights(): Array { - const result = super.call( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - - return result[0].toBigIntArray(); - } - - try_getNormalizedWeights(): ethereum.CallResult> { - const result = super.tryCall( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getOwner(): Address { - const result = super.call("getOwner", "getOwner():(address)", []); - - return result[0].toAddress(); - } - - try_getOwner(): ethereum.CallResult
{ - const result = super.tryCall("getOwner", "getOwner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getPausedState(): BalancerPoolToken__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerPoolToken__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerPoolToken__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPoolId(): Bytes { - const result = super.call("getPoolId", "getPoolId():(bytes32)", []); - - return result[0].toBytes(); - } - - try_getPoolId(): ethereum.CallResult { - const result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getRate(): BigInt { - const result = super.call("getRate", "getRate():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getRate(): ethereum.CallResult { - const result = super.tryCall("getRate", "getRate():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getSwapFeePercentage(): BigInt { - const result = super.call( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getSwapFeePercentage(): ethereum.CallResult { - const result = super.tryCall( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getVault(): Address { - const result = super.call("getVault", "getVault():(address)", []); - - return result[0].toAddress(); - } - - try_getVault(): ethereum.CallResult
{ - const result = super.tryCall("getVault", "getVault():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - increaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onExitPoolResult { - const result = super.call( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onExitPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onExitPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onJoinPoolResult { - const result = super.call( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onJoinPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onJoinPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): BigInt { - const result = super.call( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - - return result[0].toBigInt(); - } - - try_onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryExitResult { - const result = super.call( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryExitResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryExitResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryJoinResult { - const result = super.call( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryJoinResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryJoinResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get vault(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get name(): string { - return this._call.inputValues[1].value.toString(); - } - - get symbol(): string { - return this._call.inputValues[2].value.toString(); - } - - get tokens(): Array
{ - return this._call.inputValues[3].value.toAddressArray(); - } - - get normalizedWeights(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[7].value.toBigInt(); - } - - get owner(): Address { - return this._call.inputValues[8].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DecreaseApprovalCall extends ethereum.Call { - get inputs(): DecreaseApprovalCall__Inputs { - return new DecreaseApprovalCall__Inputs(this); - } - - get outputs(): DecreaseApprovalCall__Outputs { - return new DecreaseApprovalCall__Outputs(this); - } -} - -export class DecreaseApprovalCall__Inputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseApprovalCall__Outputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseApprovalCall extends ethereum.Call { - get inputs(): IncreaseApprovalCall__Inputs { - return new IncreaseApprovalCall__Inputs(this); - } - - get outputs(): IncreaseApprovalCall__Outputs { - return new IncreaseApprovalCall__Outputs(this); - } -} - -export class IncreaseApprovalCall__Inputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseApprovalCall__Outputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class OnExitPoolCall extends ethereum.Call { - get inputs(): OnExitPoolCall__Inputs { - return new OnExitPoolCall__Inputs(this); - } - - get outputs(): OnExitPoolCall__Outputs { - return new OnExitPoolCall__Outputs(this); - } -} - -export class OnExitPoolCall__Inputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnExitPoolCall__Outputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class OnJoinPoolCall extends ethereum.Call { - get inputs(): OnJoinPoolCall__Inputs { - return new OnJoinPoolCall__Inputs(this); - } - - get outputs(): OnJoinPoolCall__Outputs { - return new OnJoinPoolCall__Outputs(this); - } -} - -export class OnJoinPoolCall__Inputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnJoinPoolCall__Outputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class QueryExitCall extends ethereum.Call { - get inputs(): QueryExitCall__Inputs { - return new QueryExitCall__Inputs(this); - } - - get outputs(): QueryExitCall__Outputs { - return new QueryExitCall__Outputs(this); - } -} - -export class QueryExitCall__Inputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryExitCall__Outputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get bptIn(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsOut(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class QueryJoinCall extends ethereum.Call { - get inputs(): QueryJoinCall__Inputs { - return new QueryJoinCall__Inputs(this); - } - - get outputs(): QueryJoinCall__Outputs { - return new QueryJoinCall__Outputs(this); - } -} - -export class QueryJoinCall__Inputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryJoinCall__Outputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get bptOut(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsIn(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetSwapFeePercentageCall extends ethereum.Call { - get inputs(): SetSwapFeePercentageCall__Inputs { - return new SetSwapFeePercentageCall__Inputs(this); - } - - get outputs(): SetSwapFeePercentageCall__Outputs { - return new SetSwapFeePercentageCall__Outputs(this); - } -} - -export class SetSwapFeePercentageCall__Inputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetSwapFeePercentageCall__Outputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMFRAXBondV2/BalancerVault.ts b/subgraphs/ethereum/generated/OHMFRAXBondV2/BalancerVault.ts deleted file mode 100644 index 41f94648..00000000 --- a/subgraphs/ethereum/generated/OHMFRAXBondV2/BalancerVault.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class AuthorizerChanged extends ethereum.Event { - get params(): AuthorizerChanged__Params { - return new AuthorizerChanged__Params(this); - } -} - -export class AuthorizerChanged__Params { - _event: AuthorizerChanged; - - constructor(event: AuthorizerChanged) { - this._event = event; - } - - get newAuthorizer(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class ExternalBalanceTransfer extends ethereum.Event { - get params(): ExternalBalanceTransfer__Params { - return new ExternalBalanceTransfer__Params(this); - } -} - -export class ExternalBalanceTransfer__Params { - _event: ExternalBalanceTransfer; - - constructor(event: ExternalBalanceTransfer) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get recipient(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class FlashLoan extends ethereum.Event { - get params(): FlashLoan__Params { - return new FlashLoan__Params(this); - } -} - -export class FlashLoan__Params { - _event: FlashLoan; - - constructor(event: FlashLoan) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get feeAmount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class InternalBalanceChanged extends ethereum.Event { - get params(): InternalBalanceChanged__Params { - return new InternalBalanceChanged__Params(this); - } -} - -export class InternalBalanceChanged__Params { - _event: InternalBalanceChanged; - - constructor(event: InternalBalanceChanged) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get delta(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class PoolBalanceChanged extends ethereum.Event { - get params(): PoolBalanceChanged__Params { - return new PoolBalanceChanged__Params(this); - } -} - -export class PoolBalanceChanged__Params { - _event: PoolBalanceChanged; - - constructor(event: PoolBalanceChanged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get liquidityProvider(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokens(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } - - get deltas(): Array { - return this._event.parameters[3].value.toBigIntArray(); - } - - get protocolFeeAmounts(): Array { - return this._event.parameters[4].value.toBigIntArray(); - } -} - -export class PoolBalanceManaged extends ethereum.Event { - get params(): PoolBalanceManaged__Params { - return new PoolBalanceManaged__Params(this); - } -} - -export class PoolBalanceManaged__Params { - _event: PoolBalanceManaged; - - constructor(event: PoolBalanceManaged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get assetManager(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get cashDelta(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get managedDelta(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class PoolRegistered extends ethereum.Event { - get params(): PoolRegistered__Params { - return new PoolRegistered__Params(this); - } -} - -export class PoolRegistered__Params { - _event: PoolRegistered; - - constructor(event: PoolRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get poolAddress(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get specialization(): i32 { - return this._event.parameters[2].value.toI32(); - } -} - -export class RelayerApprovalChanged extends ethereum.Event { - get params(): RelayerApprovalChanged__Params { - return new RelayerApprovalChanged__Params(this); - } -} - -export class RelayerApprovalChanged__Params { - _event: RelayerApprovalChanged; - - constructor(event: RelayerApprovalChanged) { - this._event = event; - } - - get relayer(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get approved(): boolean { - return this._event.parameters[2].value.toBoolean(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokenIn(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokenOut(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amountIn(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amountOut(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class TokensDeregistered extends ethereum.Event { - get params(): TokensDeregistered__Params { - return new TokensDeregistered__Params(this); - } -} - -export class TokensDeregistered__Params { - _event: TokensDeregistered; - - constructor(event: TokensDeregistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } -} - -export class TokensRegistered extends ethereum.Event { - get params(): TokensRegistered__Params { - return new TokensRegistered__Params(this); - } -} - -export class TokensRegistered__Params { - _event: TokensRegistered; - - constructor(event: TokensRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } -} - -export class BalancerVault__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerVault__getPoolResult { - value0: Address; - value1: i32; - - constructor(value0: Address, value1: i32) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddress(this.value0)); - map.set( - "value1", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) - ); - return map; - } - - getValue0(): Address { - return this.value0; - } - - getValue1(): i32 { - return this.value1; - } -} - -export class BalancerVault__getPoolTokenInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: Address; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: Address) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromAddress(this.value3)); - return map; - } - - getCash(): BigInt { - return this.value0; - } - - getManaged(): BigInt { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } - - getAssetManager(): Address { - return this.value3; - } -} - -export class BalancerVault__getPoolTokensResult { - value0: Array
; - value1: Array; - value2: BigInt; - - constructor(value0: Array
, value1: Array, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddressArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getTokens(): Array
{ - return this.value0; - } - - getBalances(): Array { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } -} - -export class BalancerVault__queryBatchSwapInputSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BalancerVault__queryBatchSwapInputFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class BalancerVault extends ethereum.SmartContract { - static bind(address: Address): BalancerVault { - return new BalancerVault("BalancerVault", address); - } - - WETH(): Address { - const result = super.call("WETH", "WETH():(address)", []); - - return result[0].toAddress(); - } - - try_WETH(): ethereum.CallResult
{ - const result = super.tryCall("WETH", "WETH():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getDomainSeparator(): Bytes { - const result = super.call( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_getDomainSeparator(): ethereum.CallResult { - const result = super.tryCall( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getInternalBalance(user: Address, tokens: Array
): Array { - const result = super.call( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - - return result[0].toBigIntArray(); - } - - try_getInternalBalance( - user: Address, - tokens: Array
- ): ethereum.CallResult> { - const result = super.tryCall( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getNextNonce(user: Address): BigInt { - const result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ - ethereum.Value.fromAddress(user) - ]); - - return result[0].toBigInt(); - } - - try_getNextNonce(user: Address): ethereum.CallResult { - const result = super.tryCall( - "getNextNonce", - "getNextNonce(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getPausedState(): BalancerVault__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerVault__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerVault__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPool(poolId: Bytes): BalancerVault__getPoolResult { - const result = super.call("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - - return new BalancerVault__getPoolResult( - result[0].toAddress(), - result[1].toI32() - ); - } - - try_getPool( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolResult(value[0].toAddress(), value[1].toI32()) - ); - } - - getPoolTokenInfo( - poolId: Bytes, - token: Address - ): BalancerVault__getPoolTokenInfoResult { - const result = super.call( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - - return new BalancerVault__getPoolTokenInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toAddress() - ); - } - - try_getPoolTokenInfo( - poolId: Bytes, - token: Address - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokenInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toAddress() - ) - ); - } - - getPoolTokens(poolId: Bytes): BalancerVault__getPoolTokensResult { - const result = super.call( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - - return new BalancerVault__getPoolTokensResult( - result[0].toAddressArray(), - result[1].toBigIntArray(), - result[2].toBigInt() - ); - } - - try_getPoolTokens( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokensResult( - value[0].toAddressArray(), - value[1].toBigIntArray(), - value[2].toBigInt() - ) - ); - } - - getProtocolFeesCollector(): Address { - const result = super.call( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_getProtocolFeesCollector(): ethereum.CallResult
{ - const result = super.tryCall( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - hasApprovedRelayer(user: Address, relayer: Address): boolean { - const result = super.call( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - - return result[0].toBoolean(); - } - - try_hasApprovedRelayer( - user: Address, - relayer: Address - ): ethereum.CallResult { - const result = super.tryCall( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): Array { - const result = super.call( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - - return result[0].toBigIntArray(); - } - - try_queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): ethereum.CallResult> { - const result = super.tryCall( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - registerPool(specialization: i32): Bytes { - const result = super.call("registerPool", "registerPool(uint8):(bytes32)", [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization)) - ]); - - return result[0].toBytes(); - } - - try_registerPool(specialization: i32): ethereum.CallResult { - const result = super.tryCall( - "registerPool", - "registerPool(uint8):(bytes32)", - [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization))] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get authorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get weth(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class BatchSwapCall extends ethereum.Call { - get inputs(): BatchSwapCall__Inputs { - return new BatchSwapCall__Inputs(this); - } - - get outputs(): BatchSwapCall__Outputs { - return new BatchSwapCall__Outputs(this); - } -} - -export class BatchSwapCall__Inputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - BatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): BatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } - - get limits(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get deadline(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } -} - -export class BatchSwapCall__Outputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get assetDeltas(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class BatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class DeregisterTokensCall extends ethereum.Call { - get inputs(): DeregisterTokensCall__Inputs { - return new DeregisterTokensCall__Inputs(this); - } - - get outputs(): DeregisterTokensCall__Outputs { - return new DeregisterTokensCall__Outputs(this); - } -} - -export class DeregisterTokensCall__Inputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } -} - -export class DeregisterTokensCall__Outputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } -} - -export class ExitPoolCall extends ethereum.Call { - get inputs(): ExitPoolCall__Inputs { - return new ExitPoolCall__Inputs(this); - } - - get outputs(): ExitPoolCall__Outputs { - return new ExitPoolCall__Outputs(this); - } -} - -export class ExitPoolCall__Inputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): ExitPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class ExitPoolCall__Outputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } -} - -export class ExitPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get minAmountsOut(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class FlashLoanCall extends ethereum.Call { - get inputs(): FlashLoanCall__Inputs { - return new FlashLoanCall__Inputs(this); - } - - get outputs(): FlashLoanCall__Outputs { - return new FlashLoanCall__Outputs(this); - } -} - -export class FlashLoanCall__Inputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get amounts(): Array { - return this._call.inputValues[2].value.toBigIntArray(); - } - - get userData(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class FlashLoanCall__Outputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } -} - -export class JoinPoolCall extends ethereum.Call { - get inputs(): JoinPoolCall__Inputs { - return new JoinPoolCall__Inputs(this); - } - - get outputs(): JoinPoolCall__Outputs { - return new JoinPoolCall__Outputs(this); - } -} - -export class JoinPoolCall__Inputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): JoinPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class JoinPoolCall__Outputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } -} - -export class JoinPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get maxAmountsIn(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get fromInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class ManagePoolBalanceCall extends ethereum.Call { - get inputs(): ManagePoolBalanceCall__Inputs { - return new ManagePoolBalanceCall__Inputs(this); - } - - get outputs(): ManagePoolBalanceCall__Outputs { - return new ManagePoolBalanceCall__Outputs(this); - } -} - -export class ManagePoolBalanceCall__Inputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManagePoolBalanceCallOpsStruct - >(); - } -} - -export class ManagePoolBalanceCall__Outputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } -} - -export class ManagePoolBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get poolId(): Bytes { - return this[1].toBytes(); - } - - get token(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } -} - -export class ManageUserBalanceCall extends ethereum.Call { - get inputs(): ManageUserBalanceCall__Inputs { - return new ManageUserBalanceCall__Inputs(this); - } - - get outputs(): ManageUserBalanceCall__Outputs { - return new ManageUserBalanceCall__Outputs(this); - } -} - -export class ManageUserBalanceCall__Inputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManageUserBalanceCallOpsStruct - >(); - } -} - -export class ManageUserBalanceCall__Outputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } -} - -export class ManageUserBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get asset(): Address { - return this[1].toAddress(); - } - - get amount(): BigInt { - return this[2].toBigInt(); - } - - get sender(): Address { - return this[3].toAddress(); - } - - get recipient(): Address { - return this[4].toAddress(); - } -} - -export class QueryBatchSwapCall extends ethereum.Call { - get inputs(): QueryBatchSwapCall__Inputs { - return new QueryBatchSwapCall__Inputs(this); - } - - get outputs(): QueryBatchSwapCall__Outputs { - return new QueryBatchSwapCall__Outputs(this); - } -} - -export class QueryBatchSwapCall__Inputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - QueryBatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): QueryBatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class QueryBatchSwapCall__Outputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class QueryBatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class QueryBatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class RegisterPoolCall extends ethereum.Call { - get inputs(): RegisterPoolCall__Inputs { - return new RegisterPoolCall__Inputs(this); - } - - get outputs(): RegisterPoolCall__Outputs { - return new RegisterPoolCall__Outputs(this); - } -} - -export class RegisterPoolCall__Inputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get specialization(): i32 { - return this._call.inputValues[0].value.toI32(); - } -} - -export class RegisterPoolCall__Outputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get value0(): Bytes { - return this._call.outputValues[0].value.toBytes(); - } -} - -export class RegisterTokensCall extends ethereum.Call { - get inputs(): RegisterTokensCall__Inputs { - return new RegisterTokensCall__Inputs(this); - } - - get outputs(): RegisterTokensCall__Outputs { - return new RegisterTokensCall__Outputs(this); - } -} - -export class RegisterTokensCall__Inputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } -} - -export class RegisterTokensCall__Outputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } -} - -export class SetAuthorizerCall extends ethereum.Call { - get inputs(): SetAuthorizerCall__Inputs { - return new SetAuthorizerCall__Inputs(this); - } - - get outputs(): SetAuthorizerCall__Outputs { - return new SetAuthorizerCall__Outputs(this); - } -} - -export class SetAuthorizerCall__Inputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } - - get newAuthorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetAuthorizerCall__Outputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetRelayerApprovalCall extends ethereum.Call { - get inputs(): SetRelayerApprovalCall__Inputs { - return new SetRelayerApprovalCall__Inputs(this); - } - - get outputs(): SetRelayerApprovalCall__Outputs { - return new SetRelayerApprovalCall__Outputs(this); - } -} - -export class SetRelayerApprovalCall__Inputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get relayer(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get approved(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } -} - -export class SetRelayerApprovalCall__Outputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get singleSwap(): SwapCallSingleSwapStruct { - return changetype( - this._call.inputValues[0].value.toTuple() - ); - } - - get funds(): SwapCallFundsStruct { - return changetype( - this._call.inputValues[1].value.toTuple() - ); - } - - get limit(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amountCalculated(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class SwapCallSingleSwapStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get kind(): i32 { - return this[1].toI32(); - } - - get assetIn(): Address { - return this[2].toAddress(); - } - - get assetOut(): Address { - return this[3].toAddress(); - } - - get amount(): BigInt { - return this[4].toBigInt(); - } - - get userData(): Bytes { - return this[5].toBytes(); - } -} - -export class SwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMFRAXBondV2/ERC20.ts b/subgraphs/ethereum/generated/OHMFRAXBondV2/ERC20.ts deleted file mode 100644 index bbe93783..00000000 --- a/subgraphs/ethereum/generated/OHMFRAXBondV2/ERC20.ts +++ /dev/null @@ -1,394 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ERC20 extends ethereum.SmartContract { - static bind(address: Address): ERC20 { - return new ERC20("ERC20", address); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - approve(_spender: Address, _value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_approve(_spender: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transferFrom(_from: Address, _to: Address, _value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - _from: Address, - _to: Address, - _value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - balanceOf(_owner: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(_owner: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - transfer(_to: Address, _value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(_to: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - allowance(_owner: Address, _spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - _owner: Address, - _spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get _spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get _from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DefaultCall extends ethereum.Call { - get inputs(): DefaultCall__Inputs { - return new DefaultCall__Inputs(this); - } - - get outputs(): DefaultCall__Outputs { - return new DefaultCall__Outputs(this); - } -} - -export class DefaultCall__Inputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} - -export class DefaultCall__Outputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/OHMFRAXBondV2/OHMFRAXBondV2.ts b/subgraphs/ethereum/generated/OHMFRAXBondV2/OHMFRAXBondV2.ts deleted file mode 100644 index 634d0641..00000000 --- a/subgraphs/ethereum/generated/OHMFRAXBondV2/OHMFRAXBondV2.ts +++ /dev/null @@ -1,1298 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ControlVariableAdjustment extends ethereum.Event { - get params(): ControlVariableAdjustment__Params { - return new ControlVariableAdjustment__Params(this); - } -} - -export class ControlVariableAdjustment__Params { - _event: ControlVariableAdjustment; - - constructor(event: ControlVariableAdjustment) { - this._event = event; - } - - get initialBCV(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get newBCV(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get adjustment(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get addition(): boolean { - return this._event.parameters[3].value.toBoolean(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OHMFRAXBondV2__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: boolean, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } - - getBuffer(): BigInt { - return this.value3; - } - - getLastBlock(): BigInt { - return this.value4; - } -} - -export class OHMFRAXBondV2__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getPayout(): BigInt { - return this.value0; - } - - getVesting(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getPricePaid(): BigInt { - return this.value3; - } -} - -export class OHMFRAXBondV2__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getFee(): BigInt { - return this.value4; - } - - getMaxDebt(): BigInt { - return this.value5; - } -} - -export class OHMFRAXBondV2 extends ethereum.SmartContract { - static bind(address: Address): OHMFRAXBondV2 { - return new OHMFRAXBondV2("OHMFRAXBondV2", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): OHMFRAXBondV2__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - - return new OHMFRAXBondV2__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMFRAXBondV2__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): OHMFRAXBondV2__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new OHMFRAXBondV2__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMFRAXBondV2__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - currentDebt(): BigInt { - const result = super.call("currentDebt", "currentDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_currentDebt(): ethereum.CallResult { - const result = super.tryCall("currentDebt", "currentDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtDecay(): BigInt { - const result = super.call("debtDecay", "debtDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtDecay(): ethereum.CallResult { - const result = super.tryCall("debtDecay", "debtDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isLiquidityBond(): boolean { - const result = super.call("isLiquidityBond", "isLiquidityBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_isLiquidityBond(): ethereum.CallResult { - const result = super.tryCall( - "isLiquidityBond", - "isLiquidityBond():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - lastDecay(): BigInt { - const result = super.call("lastDecay", "lastDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_lastDecay(): ethereum.CallResult { - const result = super.tryCall("lastDecay", "lastDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - policy(): Address { - const result = super.call("policy", "policy():(address)", []); - - return result[0].toAddress(); - } - - try_policy(): ethereum.CallResult
{ - const result = super.tryCall("policy", "policy():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_recipient: Address, _stake: boolean): BigInt { - const result = super.call("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem( - _recipient: Address, - _stake: boolean - ): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - stakingHelper(): Address { - const result = super.call("stakingHelper", "stakingHelper():(address)", []); - - return result[0].toAddress(); - } - - try_stakingHelper(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingHelper", - "stakingHelper():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - standardizedDebtRatio(): BigInt { - const result = super.call( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_standardizedDebtRatio(): ethereum.CallResult { - const result = super.tryCall( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - terms(): OHMFRAXBondV2__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new OHMFRAXBondV2__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMFRAXBondV2__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - useHelper(): boolean { - const result = super.call("useHelper", "useHelper():(bool)", []); - - return result[0].toBoolean(); - } - - try_useHelper(): ethereum.CallResult { - const result = super.tryCall("useHelper", "useHelper():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _bondCalculator(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class InitializeBondTermsCall extends ethereum.Call { - get inputs(): InitializeBondTermsCall__Inputs { - return new InitializeBondTermsCall__Inputs(this); - } - - get outputs(): InitializeBondTermsCall__Outputs { - return new InitializeBondTermsCall__Outputs(this); - } -} - -export class InitializeBondTermsCall__Inputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } - - get _controlVariable(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _fee(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _maxDebt(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get _initialDebt(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } -} - -export class InitializeBondTermsCall__Outputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _stake(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _buffer(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _parameter(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _input(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _helper(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/OHMFRAXBondV2/UniswapV2Pair.ts b/subgraphs/ethereum/generated/OHMFRAXBondV2/UniswapV2Pair.ts deleted file mode 100644 index b36eea33..00000000 --- a/subgraphs/ethereum/generated/OHMFRAXBondV2/UniswapV2Pair.ts +++ /dev/null @@ -1,1092 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Burn extends ethereum.Event { - get params(): Burn__Params { - return new Burn__Params(this); - } -} - -export class Burn__Params { - _event: Burn; - - constructor(event: Burn) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[3].value.toAddress(); - } -} - -export class Mint extends ethereum.Event { - get params(): Mint__Params { - return new Mint__Params(this); - } -} - -export class Mint__Params { - _event: Mint; - - constructor(event: Mint) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0In(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1In(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get amount0Out(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[5].value.toAddress(); - } -} - -export class Sync extends ethereum.Event { - get params(): Sync__Params { - return new Sync__Params(this); - } -} - -export class Sync__Params { - _event: Sync; - - constructor(event: Sync) { - this._event = event; - } - - get reserve0(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get reserve1(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class UniswapV2Pair__burnResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } - - getAmount0(): BigInt { - return this.value0; - } - - getAmount1(): BigInt { - return this.value1; - } -} - -export class UniswapV2Pair__getReservesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - get_reserve0(): BigInt { - return this.value0; - } - - get_reserve1(): BigInt { - return this.value1; - } - - get_blockTimestampLast(): BigInt { - return this.value2; - } -} - -export class UniswapV2Pair extends ethereum.SmartContract { - static bind(address: Address): UniswapV2Pair { - return new UniswapV2Pair("UniswapV2Pair", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - MINIMUM_LIQUIDITY(): BigInt { - const result = super.call( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_MINIMUM_LIQUIDITY(): ethereum.CallResult { - const result = super.tryCall( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(param0: Address, param1: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - - return result[0].toBigInt(); - } - - try_allowance(param0: Address, param1: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(param0: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(param0: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - burn(to: Address): UniswapV2Pair__burnResult { - const result = super.call("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return new UniswapV2Pair__burnResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_burn(to: Address): ethereum.CallResult { - const result = super.tryCall("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__burnResult(value[0].toBigInt(), value[1].toBigInt()) - ); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - factory(): Address { - const result = super.call("factory", "factory():(address)", []); - - return result[0].toAddress(); - } - - try_factory(): ethereum.CallResult
{ - const result = super.tryCall("factory", "factory():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getReserves(): UniswapV2Pair__getReservesResult { - const result = super.call( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - - return new UniswapV2Pair__getReservesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getReserves(): ethereum.CallResult { - const result = super.tryCall( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__getReservesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - kLast(): BigInt { - const result = super.call("kLast", "kLast():(uint256)", []); - - return result[0].toBigInt(); - } - - try_kLast(): ethereum.CallResult { - const result = super.tryCall("kLast", "kLast():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - mint(to: Address): BigInt { - const result = super.call("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return result[0].toBigInt(); - } - - try_mint(to: Address): ethereum.CallResult { - const result = super.tryCall("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(param0: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_nonces(param0: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price0CumulativeLast(): BigInt { - const result = super.call( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price0CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price1CumulativeLast(): BigInt { - const result = super.call( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price1CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - token0(): Address { - const result = super.call("token0", "token0():(address)", []); - - return result[0].toAddress(); - } - - try_token0(): ethereum.CallResult
{ - const result = super.tryCall("token0", "token0():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - token1(): Address { - const result = super.call("token1", "token1():(address)", []); - - return result[0].toAddress(); - } - - try_token1(): ethereum.CallResult
{ - const result = super.tryCall("token1", "token1():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class BurnCall extends ethereum.Call { - get inputs(): BurnCall__Inputs { - return new BurnCall__Inputs(this); - } - - get outputs(): BurnCall__Outputs { - return new BurnCall__Outputs(this); - } -} - -export class BurnCall__Inputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class BurnCall__Outputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get amount0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amount1(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _token0(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _token1(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class MintCall extends ethereum.Call { - get inputs(): MintCall__Inputs { - return new MintCall__Inputs(this); - } - - get outputs(): MintCall__Outputs { - return new MintCall__Outputs(this); - } -} - -export class MintCall__Inputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class MintCall__Outputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get liquidity(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class SkimCall extends ethereum.Call { - get inputs(): SkimCall__Inputs { - return new SkimCall__Inputs(this); - } - - get outputs(): SkimCall__Outputs { - return new SkimCall__Outputs(this); - } -} - -export class SkimCall__Inputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SkimCall__Outputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amount0Out(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get to(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get data(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } -} - -export class SyncCall extends ethereum.Call { - get inputs(): SyncCall__Inputs { - return new SyncCall__Inputs(this); - } - - get outputs(): SyncCall__Outputs { - return new SyncCall__Outputs(this); - } -} - -export class SyncCall__Inputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class SyncCall__Outputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMLUSDBondV1/BalancerPoolToken.ts b/subgraphs/ethereum/generated/OHMLUSDBondV1/BalancerPoolToken.ts deleted file mode 100644 index e1efa45b..00000000 --- a/subgraphs/ethereum/generated/OHMLUSDBondV1/BalancerPoolToken.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class SwapFeePercentageChanged extends ethereum.Event { - get params(): SwapFeePercentageChanged__Params { - return new SwapFeePercentageChanged__Params(this); - } -} - -export class SwapFeePercentageChanged__Params { - _event: SwapFeePercentageChanged; - - constructor(event: SwapFeePercentageChanged) { - this._event = event; - } - - get swapFeePercentage(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BalancerPoolToken__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerPoolToken__onExitPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onJoinPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onSwapInputRequestStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get tokenIn(): Address { - return this[1].toAddress(); - } - - get tokenOut(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get poolId(): Bytes { - return this[4].toBytes(); - } - - get lastChangeBlock(): BigInt { - return this[5].toBigInt(); - } - - get from(): Address { - return this[6].toAddress(); - } - - get to(): Address { - return this[7].toAddress(); - } - - get userData(): Bytes { - return this[8].toBytes(); - } -} - -export class BalancerPoolToken__queryExitResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptIn(): BigInt { - return this.value0; - } - - getAmountsOut(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__queryJoinResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptOut(): BigInt { - return this.value0; - } - - getAmountsIn(): Array { - return this.value1; - } -} - -export class BalancerPoolToken extends ethereum.SmartContract { - static bind(address: Address): BalancerPoolToken { - return new BalancerPoolToken("BalancerPoolToken", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getInvariant(): BigInt { - const result = super.call("getInvariant", "getInvariant():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getInvariant(): ethereum.CallResult { - const result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getLastInvariant(): BigInt { - const result = super.call( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getLastInvariant(): ethereum.CallResult { - const result = super.tryCall( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getNormalizedWeights(): Array { - const result = super.call( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - - return result[0].toBigIntArray(); - } - - try_getNormalizedWeights(): ethereum.CallResult> { - const result = super.tryCall( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getOwner(): Address { - const result = super.call("getOwner", "getOwner():(address)", []); - - return result[0].toAddress(); - } - - try_getOwner(): ethereum.CallResult
{ - const result = super.tryCall("getOwner", "getOwner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getPausedState(): BalancerPoolToken__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerPoolToken__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerPoolToken__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPoolId(): Bytes { - const result = super.call("getPoolId", "getPoolId():(bytes32)", []); - - return result[0].toBytes(); - } - - try_getPoolId(): ethereum.CallResult { - const result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getRate(): BigInt { - const result = super.call("getRate", "getRate():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getRate(): ethereum.CallResult { - const result = super.tryCall("getRate", "getRate():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getSwapFeePercentage(): BigInt { - const result = super.call( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getSwapFeePercentage(): ethereum.CallResult { - const result = super.tryCall( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getVault(): Address { - const result = super.call("getVault", "getVault():(address)", []); - - return result[0].toAddress(); - } - - try_getVault(): ethereum.CallResult
{ - const result = super.tryCall("getVault", "getVault():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - increaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onExitPoolResult { - const result = super.call( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onExitPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onExitPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onJoinPoolResult { - const result = super.call( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onJoinPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onJoinPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): BigInt { - const result = super.call( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - - return result[0].toBigInt(); - } - - try_onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryExitResult { - const result = super.call( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryExitResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryExitResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryJoinResult { - const result = super.call( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryJoinResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryJoinResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get vault(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get name(): string { - return this._call.inputValues[1].value.toString(); - } - - get symbol(): string { - return this._call.inputValues[2].value.toString(); - } - - get tokens(): Array
{ - return this._call.inputValues[3].value.toAddressArray(); - } - - get normalizedWeights(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[7].value.toBigInt(); - } - - get owner(): Address { - return this._call.inputValues[8].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DecreaseApprovalCall extends ethereum.Call { - get inputs(): DecreaseApprovalCall__Inputs { - return new DecreaseApprovalCall__Inputs(this); - } - - get outputs(): DecreaseApprovalCall__Outputs { - return new DecreaseApprovalCall__Outputs(this); - } -} - -export class DecreaseApprovalCall__Inputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseApprovalCall__Outputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseApprovalCall extends ethereum.Call { - get inputs(): IncreaseApprovalCall__Inputs { - return new IncreaseApprovalCall__Inputs(this); - } - - get outputs(): IncreaseApprovalCall__Outputs { - return new IncreaseApprovalCall__Outputs(this); - } -} - -export class IncreaseApprovalCall__Inputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseApprovalCall__Outputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class OnExitPoolCall extends ethereum.Call { - get inputs(): OnExitPoolCall__Inputs { - return new OnExitPoolCall__Inputs(this); - } - - get outputs(): OnExitPoolCall__Outputs { - return new OnExitPoolCall__Outputs(this); - } -} - -export class OnExitPoolCall__Inputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnExitPoolCall__Outputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class OnJoinPoolCall extends ethereum.Call { - get inputs(): OnJoinPoolCall__Inputs { - return new OnJoinPoolCall__Inputs(this); - } - - get outputs(): OnJoinPoolCall__Outputs { - return new OnJoinPoolCall__Outputs(this); - } -} - -export class OnJoinPoolCall__Inputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnJoinPoolCall__Outputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class QueryExitCall extends ethereum.Call { - get inputs(): QueryExitCall__Inputs { - return new QueryExitCall__Inputs(this); - } - - get outputs(): QueryExitCall__Outputs { - return new QueryExitCall__Outputs(this); - } -} - -export class QueryExitCall__Inputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryExitCall__Outputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get bptIn(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsOut(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class QueryJoinCall extends ethereum.Call { - get inputs(): QueryJoinCall__Inputs { - return new QueryJoinCall__Inputs(this); - } - - get outputs(): QueryJoinCall__Outputs { - return new QueryJoinCall__Outputs(this); - } -} - -export class QueryJoinCall__Inputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryJoinCall__Outputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get bptOut(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsIn(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetSwapFeePercentageCall extends ethereum.Call { - get inputs(): SetSwapFeePercentageCall__Inputs { - return new SetSwapFeePercentageCall__Inputs(this); - } - - get outputs(): SetSwapFeePercentageCall__Outputs { - return new SetSwapFeePercentageCall__Outputs(this); - } -} - -export class SetSwapFeePercentageCall__Inputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetSwapFeePercentageCall__Outputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMLUSDBondV1/BalancerVault.ts b/subgraphs/ethereum/generated/OHMLUSDBondV1/BalancerVault.ts deleted file mode 100644 index 41f94648..00000000 --- a/subgraphs/ethereum/generated/OHMLUSDBondV1/BalancerVault.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class AuthorizerChanged extends ethereum.Event { - get params(): AuthorizerChanged__Params { - return new AuthorizerChanged__Params(this); - } -} - -export class AuthorizerChanged__Params { - _event: AuthorizerChanged; - - constructor(event: AuthorizerChanged) { - this._event = event; - } - - get newAuthorizer(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class ExternalBalanceTransfer extends ethereum.Event { - get params(): ExternalBalanceTransfer__Params { - return new ExternalBalanceTransfer__Params(this); - } -} - -export class ExternalBalanceTransfer__Params { - _event: ExternalBalanceTransfer; - - constructor(event: ExternalBalanceTransfer) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get recipient(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class FlashLoan extends ethereum.Event { - get params(): FlashLoan__Params { - return new FlashLoan__Params(this); - } -} - -export class FlashLoan__Params { - _event: FlashLoan; - - constructor(event: FlashLoan) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get feeAmount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class InternalBalanceChanged extends ethereum.Event { - get params(): InternalBalanceChanged__Params { - return new InternalBalanceChanged__Params(this); - } -} - -export class InternalBalanceChanged__Params { - _event: InternalBalanceChanged; - - constructor(event: InternalBalanceChanged) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get delta(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class PoolBalanceChanged extends ethereum.Event { - get params(): PoolBalanceChanged__Params { - return new PoolBalanceChanged__Params(this); - } -} - -export class PoolBalanceChanged__Params { - _event: PoolBalanceChanged; - - constructor(event: PoolBalanceChanged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get liquidityProvider(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokens(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } - - get deltas(): Array { - return this._event.parameters[3].value.toBigIntArray(); - } - - get protocolFeeAmounts(): Array { - return this._event.parameters[4].value.toBigIntArray(); - } -} - -export class PoolBalanceManaged extends ethereum.Event { - get params(): PoolBalanceManaged__Params { - return new PoolBalanceManaged__Params(this); - } -} - -export class PoolBalanceManaged__Params { - _event: PoolBalanceManaged; - - constructor(event: PoolBalanceManaged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get assetManager(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get cashDelta(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get managedDelta(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class PoolRegistered extends ethereum.Event { - get params(): PoolRegistered__Params { - return new PoolRegistered__Params(this); - } -} - -export class PoolRegistered__Params { - _event: PoolRegistered; - - constructor(event: PoolRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get poolAddress(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get specialization(): i32 { - return this._event.parameters[2].value.toI32(); - } -} - -export class RelayerApprovalChanged extends ethereum.Event { - get params(): RelayerApprovalChanged__Params { - return new RelayerApprovalChanged__Params(this); - } -} - -export class RelayerApprovalChanged__Params { - _event: RelayerApprovalChanged; - - constructor(event: RelayerApprovalChanged) { - this._event = event; - } - - get relayer(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get approved(): boolean { - return this._event.parameters[2].value.toBoolean(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokenIn(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokenOut(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amountIn(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amountOut(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class TokensDeregistered extends ethereum.Event { - get params(): TokensDeregistered__Params { - return new TokensDeregistered__Params(this); - } -} - -export class TokensDeregistered__Params { - _event: TokensDeregistered; - - constructor(event: TokensDeregistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } -} - -export class TokensRegistered extends ethereum.Event { - get params(): TokensRegistered__Params { - return new TokensRegistered__Params(this); - } -} - -export class TokensRegistered__Params { - _event: TokensRegistered; - - constructor(event: TokensRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } -} - -export class BalancerVault__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerVault__getPoolResult { - value0: Address; - value1: i32; - - constructor(value0: Address, value1: i32) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddress(this.value0)); - map.set( - "value1", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) - ); - return map; - } - - getValue0(): Address { - return this.value0; - } - - getValue1(): i32 { - return this.value1; - } -} - -export class BalancerVault__getPoolTokenInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: Address; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: Address) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromAddress(this.value3)); - return map; - } - - getCash(): BigInt { - return this.value0; - } - - getManaged(): BigInt { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } - - getAssetManager(): Address { - return this.value3; - } -} - -export class BalancerVault__getPoolTokensResult { - value0: Array
; - value1: Array; - value2: BigInt; - - constructor(value0: Array
, value1: Array, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddressArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getTokens(): Array
{ - return this.value0; - } - - getBalances(): Array { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } -} - -export class BalancerVault__queryBatchSwapInputSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BalancerVault__queryBatchSwapInputFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class BalancerVault extends ethereum.SmartContract { - static bind(address: Address): BalancerVault { - return new BalancerVault("BalancerVault", address); - } - - WETH(): Address { - const result = super.call("WETH", "WETH():(address)", []); - - return result[0].toAddress(); - } - - try_WETH(): ethereum.CallResult
{ - const result = super.tryCall("WETH", "WETH():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getDomainSeparator(): Bytes { - const result = super.call( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_getDomainSeparator(): ethereum.CallResult { - const result = super.tryCall( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getInternalBalance(user: Address, tokens: Array
): Array { - const result = super.call( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - - return result[0].toBigIntArray(); - } - - try_getInternalBalance( - user: Address, - tokens: Array
- ): ethereum.CallResult> { - const result = super.tryCall( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getNextNonce(user: Address): BigInt { - const result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ - ethereum.Value.fromAddress(user) - ]); - - return result[0].toBigInt(); - } - - try_getNextNonce(user: Address): ethereum.CallResult { - const result = super.tryCall( - "getNextNonce", - "getNextNonce(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getPausedState(): BalancerVault__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerVault__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerVault__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPool(poolId: Bytes): BalancerVault__getPoolResult { - const result = super.call("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - - return new BalancerVault__getPoolResult( - result[0].toAddress(), - result[1].toI32() - ); - } - - try_getPool( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolResult(value[0].toAddress(), value[1].toI32()) - ); - } - - getPoolTokenInfo( - poolId: Bytes, - token: Address - ): BalancerVault__getPoolTokenInfoResult { - const result = super.call( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - - return new BalancerVault__getPoolTokenInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toAddress() - ); - } - - try_getPoolTokenInfo( - poolId: Bytes, - token: Address - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokenInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toAddress() - ) - ); - } - - getPoolTokens(poolId: Bytes): BalancerVault__getPoolTokensResult { - const result = super.call( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - - return new BalancerVault__getPoolTokensResult( - result[0].toAddressArray(), - result[1].toBigIntArray(), - result[2].toBigInt() - ); - } - - try_getPoolTokens( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokensResult( - value[0].toAddressArray(), - value[1].toBigIntArray(), - value[2].toBigInt() - ) - ); - } - - getProtocolFeesCollector(): Address { - const result = super.call( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_getProtocolFeesCollector(): ethereum.CallResult
{ - const result = super.tryCall( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - hasApprovedRelayer(user: Address, relayer: Address): boolean { - const result = super.call( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - - return result[0].toBoolean(); - } - - try_hasApprovedRelayer( - user: Address, - relayer: Address - ): ethereum.CallResult { - const result = super.tryCall( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): Array { - const result = super.call( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - - return result[0].toBigIntArray(); - } - - try_queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): ethereum.CallResult> { - const result = super.tryCall( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - registerPool(specialization: i32): Bytes { - const result = super.call("registerPool", "registerPool(uint8):(bytes32)", [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization)) - ]); - - return result[0].toBytes(); - } - - try_registerPool(specialization: i32): ethereum.CallResult { - const result = super.tryCall( - "registerPool", - "registerPool(uint8):(bytes32)", - [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization))] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get authorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get weth(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class BatchSwapCall extends ethereum.Call { - get inputs(): BatchSwapCall__Inputs { - return new BatchSwapCall__Inputs(this); - } - - get outputs(): BatchSwapCall__Outputs { - return new BatchSwapCall__Outputs(this); - } -} - -export class BatchSwapCall__Inputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - BatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): BatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } - - get limits(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get deadline(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } -} - -export class BatchSwapCall__Outputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get assetDeltas(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class BatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class DeregisterTokensCall extends ethereum.Call { - get inputs(): DeregisterTokensCall__Inputs { - return new DeregisterTokensCall__Inputs(this); - } - - get outputs(): DeregisterTokensCall__Outputs { - return new DeregisterTokensCall__Outputs(this); - } -} - -export class DeregisterTokensCall__Inputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } -} - -export class DeregisterTokensCall__Outputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } -} - -export class ExitPoolCall extends ethereum.Call { - get inputs(): ExitPoolCall__Inputs { - return new ExitPoolCall__Inputs(this); - } - - get outputs(): ExitPoolCall__Outputs { - return new ExitPoolCall__Outputs(this); - } -} - -export class ExitPoolCall__Inputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): ExitPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class ExitPoolCall__Outputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } -} - -export class ExitPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get minAmountsOut(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class FlashLoanCall extends ethereum.Call { - get inputs(): FlashLoanCall__Inputs { - return new FlashLoanCall__Inputs(this); - } - - get outputs(): FlashLoanCall__Outputs { - return new FlashLoanCall__Outputs(this); - } -} - -export class FlashLoanCall__Inputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get amounts(): Array { - return this._call.inputValues[2].value.toBigIntArray(); - } - - get userData(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class FlashLoanCall__Outputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } -} - -export class JoinPoolCall extends ethereum.Call { - get inputs(): JoinPoolCall__Inputs { - return new JoinPoolCall__Inputs(this); - } - - get outputs(): JoinPoolCall__Outputs { - return new JoinPoolCall__Outputs(this); - } -} - -export class JoinPoolCall__Inputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): JoinPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class JoinPoolCall__Outputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } -} - -export class JoinPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get maxAmountsIn(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get fromInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class ManagePoolBalanceCall extends ethereum.Call { - get inputs(): ManagePoolBalanceCall__Inputs { - return new ManagePoolBalanceCall__Inputs(this); - } - - get outputs(): ManagePoolBalanceCall__Outputs { - return new ManagePoolBalanceCall__Outputs(this); - } -} - -export class ManagePoolBalanceCall__Inputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManagePoolBalanceCallOpsStruct - >(); - } -} - -export class ManagePoolBalanceCall__Outputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } -} - -export class ManagePoolBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get poolId(): Bytes { - return this[1].toBytes(); - } - - get token(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } -} - -export class ManageUserBalanceCall extends ethereum.Call { - get inputs(): ManageUserBalanceCall__Inputs { - return new ManageUserBalanceCall__Inputs(this); - } - - get outputs(): ManageUserBalanceCall__Outputs { - return new ManageUserBalanceCall__Outputs(this); - } -} - -export class ManageUserBalanceCall__Inputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManageUserBalanceCallOpsStruct - >(); - } -} - -export class ManageUserBalanceCall__Outputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } -} - -export class ManageUserBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get asset(): Address { - return this[1].toAddress(); - } - - get amount(): BigInt { - return this[2].toBigInt(); - } - - get sender(): Address { - return this[3].toAddress(); - } - - get recipient(): Address { - return this[4].toAddress(); - } -} - -export class QueryBatchSwapCall extends ethereum.Call { - get inputs(): QueryBatchSwapCall__Inputs { - return new QueryBatchSwapCall__Inputs(this); - } - - get outputs(): QueryBatchSwapCall__Outputs { - return new QueryBatchSwapCall__Outputs(this); - } -} - -export class QueryBatchSwapCall__Inputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - QueryBatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): QueryBatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class QueryBatchSwapCall__Outputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class QueryBatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class QueryBatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class RegisterPoolCall extends ethereum.Call { - get inputs(): RegisterPoolCall__Inputs { - return new RegisterPoolCall__Inputs(this); - } - - get outputs(): RegisterPoolCall__Outputs { - return new RegisterPoolCall__Outputs(this); - } -} - -export class RegisterPoolCall__Inputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get specialization(): i32 { - return this._call.inputValues[0].value.toI32(); - } -} - -export class RegisterPoolCall__Outputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get value0(): Bytes { - return this._call.outputValues[0].value.toBytes(); - } -} - -export class RegisterTokensCall extends ethereum.Call { - get inputs(): RegisterTokensCall__Inputs { - return new RegisterTokensCall__Inputs(this); - } - - get outputs(): RegisterTokensCall__Outputs { - return new RegisterTokensCall__Outputs(this); - } -} - -export class RegisterTokensCall__Inputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } -} - -export class RegisterTokensCall__Outputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } -} - -export class SetAuthorizerCall extends ethereum.Call { - get inputs(): SetAuthorizerCall__Inputs { - return new SetAuthorizerCall__Inputs(this); - } - - get outputs(): SetAuthorizerCall__Outputs { - return new SetAuthorizerCall__Outputs(this); - } -} - -export class SetAuthorizerCall__Inputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } - - get newAuthorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetAuthorizerCall__Outputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetRelayerApprovalCall extends ethereum.Call { - get inputs(): SetRelayerApprovalCall__Inputs { - return new SetRelayerApprovalCall__Inputs(this); - } - - get outputs(): SetRelayerApprovalCall__Outputs { - return new SetRelayerApprovalCall__Outputs(this); - } -} - -export class SetRelayerApprovalCall__Inputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get relayer(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get approved(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } -} - -export class SetRelayerApprovalCall__Outputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get singleSwap(): SwapCallSingleSwapStruct { - return changetype( - this._call.inputValues[0].value.toTuple() - ); - } - - get funds(): SwapCallFundsStruct { - return changetype( - this._call.inputValues[1].value.toTuple() - ); - } - - get limit(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amountCalculated(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class SwapCallSingleSwapStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get kind(): i32 { - return this[1].toI32(); - } - - get assetIn(): Address { - return this[2].toAddress(); - } - - get assetOut(): Address { - return this[3].toAddress(); - } - - get amount(): BigInt { - return this[4].toBigInt(); - } - - get userData(): Bytes { - return this[5].toBytes(); - } -} - -export class SwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/OHMLUSDBondV1/ERC20.ts b/subgraphs/ethereum/generated/OHMLUSDBondV1/ERC20.ts deleted file mode 100644 index bbe93783..00000000 --- a/subgraphs/ethereum/generated/OHMLUSDBondV1/ERC20.ts +++ /dev/null @@ -1,394 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ERC20 extends ethereum.SmartContract { - static bind(address: Address): ERC20 { - return new ERC20("ERC20", address); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - approve(_spender: Address, _value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_approve(_spender: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transferFrom(_from: Address, _to: Address, _value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - _from: Address, - _to: Address, - _value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - balanceOf(_owner: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(_owner: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - transfer(_to: Address, _value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(_to: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - allowance(_owner: Address, _spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - _owner: Address, - _spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get _spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get _from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DefaultCall extends ethereum.Call { - get inputs(): DefaultCall__Inputs { - return new DefaultCall__Inputs(this); - } - - get outputs(): DefaultCall__Outputs { - return new DefaultCall__Outputs(this); - } -} - -export class DefaultCall__Inputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} - -export class DefaultCall__Outputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/OHMLUSDBondV1/OHMLUSDBondV1.ts b/subgraphs/ethereum/generated/OHMLUSDBondV1/OHMLUSDBondV1.ts deleted file mode 100644 index 10e765fe..00000000 --- a/subgraphs/ethereum/generated/OHMLUSDBondV1/OHMLUSDBondV1.ts +++ /dev/null @@ -1,1298 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class BondCreated extends ethereum.Event { - get params(): BondCreated__Params { - return new BondCreated__Params(this); - } -} - -export class BondCreated__Params { - _event: BondCreated; - - constructor(event: BondCreated) { - this._event = event; - } - - get deposit(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get expires(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get priceInUSD(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class BondPriceChanged extends ethereum.Event { - get params(): BondPriceChanged__Params { - return new BondPriceChanged__Params(this); - } -} - -export class BondPriceChanged__Params { - _event: BondPriceChanged; - - constructor(event: BondPriceChanged) { - this._event = event; - } - - get priceInUSD(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get internalPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get debtRatio(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BondRedeemed extends ethereum.Event { - get params(): BondRedeemed__Params { - return new BondRedeemed__Params(this); - } -} - -export class BondRedeemed__Params { - _event: BondRedeemed; - - constructor(event: BondRedeemed) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get payout(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get remaining(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ControlVariableAdjustment extends ethereum.Event { - get params(): ControlVariableAdjustment__Params { - return new ControlVariableAdjustment__Params(this); - } -} - -export class ControlVariableAdjustment__Params { - _event: ControlVariableAdjustment; - - constructor(event: ControlVariableAdjustment) { - this._event = event; - } - - get initialBCV(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get newBCV(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get adjustment(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get addition(): boolean { - return this._event.parameters[3].value.toBoolean(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OHMLUSDBondV1__adjustmentResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: boolean, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getAdd(): boolean { - return this.value0; - } - - getRate(): BigInt { - return this.value1; - } - - getTarget(): BigInt { - return this.value2; - } - - getBuffer(): BigInt { - return this.value3; - } - - getLastBlock(): BigInt { - return this.value4; - } -} - -export class OHMLUSDBondV1__bondInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getPayout(): BigInt { - return this.value0; - } - - getVesting(): BigInt { - return this.value1; - } - - getLastBlock(): BigInt { - return this.value2; - } - - getPricePaid(): BigInt { - return this.value3; - } -} - -export class OHMLUSDBondV1__termsResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - return map; - } - - getControlVariable(): BigInt { - return this.value0; - } - - getVestingTerm(): BigInt { - return this.value1; - } - - getMinimumPrice(): BigInt { - return this.value2; - } - - getMaxPayout(): BigInt { - return this.value3; - } - - getFee(): BigInt { - return this.value4; - } - - getMaxDebt(): BigInt { - return this.value5; - } -} - -export class OHMLUSDBondV1 extends ethereum.SmartContract { - static bind(address: Address): OHMLUSDBondV1 { - return new OHMLUSDBondV1("OHMLUSDBondV1", address); - } - - DAO(): Address { - const result = super.call("DAO", "DAO():(address)", []); - - return result[0].toAddress(); - } - - try_DAO(): ethereum.CallResult
{ - const result = super.tryCall("DAO", "DAO():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - adjustment(): OHMLUSDBondV1__adjustmentResult { - const result = super.call( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - - return new OHMLUSDBondV1__adjustmentResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_adjustment(): ethereum.CallResult { - const result = super.tryCall( - "adjustment", - "adjustment():(bool,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMLUSDBondV1__adjustmentResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - bondCalculator(): Address { - const result = super.call("bondCalculator", "bondCalculator():(address)", []); - - return result[0].toAddress(); - } - - try_bondCalculator(): ethereum.CallResult
{ - const result = super.tryCall( - "bondCalculator", - "bondCalculator():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - bondInfo(param0: Address): OHMLUSDBondV1__bondInfoResult { - const result = super.call( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - - return new OHMLUSDBondV1__bondInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_bondInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "bondInfo", - "bondInfo(address):(uint256,uint256,uint256,uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMLUSDBondV1__bondInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - bondPrice(): BigInt { - const result = super.call("bondPrice", "bondPrice():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPrice(): ethereum.CallResult { - const result = super.tryCall("bondPrice", "bondPrice():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - bondPriceInUSD(): BigInt { - const result = super.call("bondPriceInUSD", "bondPriceInUSD():(uint256)", []); - - return result[0].toBigInt(); - } - - try_bondPriceInUSD(): ethereum.CallResult { - const result = super.tryCall( - "bondPriceInUSD", - "bondPriceInUSD():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - currentDebt(): BigInt { - const result = super.call("currentDebt", "currentDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_currentDebt(): ethereum.CallResult { - const result = super.tryCall("currentDebt", "currentDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtDecay(): BigInt { - const result = super.call("debtDecay", "debtDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtDecay(): ethereum.CallResult { - const result = super.tryCall("debtDecay", "debtDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtRatio(): BigInt { - const result = super.call("debtRatio", "debtRatio():(uint256)", []); - - return result[0].toBigInt(); - } - - try_debtRatio(): ethereum.CallResult { - const result = super.tryCall("debtRatio", "debtRatio():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - deposit(_amount: BigInt, _maxPrice: BigInt, _depositor: Address): BigInt { - const result = super.call( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - - return result[0].toBigInt(); - } - - try_deposit( - _amount: BigInt, - _maxPrice: BigInt, - _depositor: Address - ): ethereum.CallResult { - const result = super.tryCall( - "deposit", - "deposit(uint256,uint256,address):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromUnsignedBigInt(_maxPrice), - ethereum.Value.fromAddress(_depositor) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - isLiquidityBond(): boolean { - const result = super.call("isLiquidityBond", "isLiquidityBond():(bool)", []); - - return result[0].toBoolean(); - } - - try_isLiquidityBond(): ethereum.CallResult { - const result = super.tryCall( - "isLiquidityBond", - "isLiquidityBond():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - lastDecay(): BigInt { - const result = super.call("lastDecay", "lastDecay():(uint256)", []); - - return result[0].toBigInt(); - } - - try_lastDecay(): ethereum.CallResult { - const result = super.tryCall("lastDecay", "lastDecay():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxPayout(): BigInt { - const result = super.call("maxPayout", "maxPayout():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxPayout(): ethereum.CallResult { - const result = super.tryCall("maxPayout", "maxPayout():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - payoutFor(_value: BigInt): BigInt { - const result = super.call("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBigInt(); - } - - try_payoutFor(_value: BigInt): ethereum.CallResult { - const result = super.tryCall("payoutFor", "payoutFor(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - pendingPayoutFor(_depositor: Address): BigInt { - const result = super.call( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_pendingPayoutFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "pendingPayoutFor", - "pendingPayoutFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - percentVestedFor(_depositor: Address): BigInt { - const result = super.call( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - - return result[0].toBigInt(); - } - - try_percentVestedFor(_depositor: Address): ethereum.CallResult { - const result = super.tryCall( - "percentVestedFor", - "percentVestedFor(address):(uint256)", - [ethereum.Value.fromAddress(_depositor)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - policy(): Address { - const result = super.call("policy", "policy():(address)", []); - - return result[0].toAddress(); - } - - try_policy(): ethereum.CallResult
{ - const result = super.tryCall("policy", "policy():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - principle(): Address { - const result = super.call("principle", "principle():(address)", []); - - return result[0].toAddress(); - } - - try_principle(): ethereum.CallResult
{ - const result = super.tryCall("principle", "principle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - recoverLostToken(_token: Address): boolean { - const result = super.call( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - - return result[0].toBoolean(); - } - - try_recoverLostToken(_token: Address): ethereum.CallResult { - const result = super.tryCall( - "recoverLostToken", - "recoverLostToken(address):(bool)", - [ethereum.Value.fromAddress(_token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - redeem(_recipient: Address, _stake: boolean): BigInt { - const result = super.call("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - - return result[0].toBigInt(); - } - - try_redeem( - _recipient: Address, - _stake: boolean - ): ethereum.CallResult { - const result = super.tryCall("redeem", "redeem(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_recipient), - ethereum.Value.fromBoolean(_stake) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - staking(): Address { - const result = super.call("staking", "staking():(address)", []); - - return result[0].toAddress(); - } - - try_staking(): ethereum.CallResult
{ - const result = super.tryCall("staking", "staking():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - stakingHelper(): Address { - const result = super.call("stakingHelper", "stakingHelper():(address)", []); - - return result[0].toAddress(); - } - - try_stakingHelper(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingHelper", - "stakingHelper():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - standardizedDebtRatio(): BigInt { - const result = super.call( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_standardizedDebtRatio(): ethereum.CallResult { - const result = super.tryCall( - "standardizedDebtRatio", - "standardizedDebtRatio():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - terms(): OHMLUSDBondV1__termsResult { - const result = super.call( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - - return new OHMLUSDBondV1__termsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt() - ); - } - - try_terms(): ethereum.CallResult { - const result = super.tryCall( - "terms", - "terms():(uint256,uint256,uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OHMLUSDBondV1__termsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt() - ) - ); - } - - totalDebt(): BigInt { - const result = super.call("totalDebt", "totalDebt():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalDebt(): ethereum.CallResult { - const result = super.tryCall("totalDebt", "totalDebt():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - useHelper(): boolean { - const result = super.call("useHelper", "useHelper():(bool)", []); - - return result[0].toBoolean(); - } - - try_useHelper(): ethereum.CallResult { - const result = super.tryCall("useHelper", "useHelper():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _principle(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _DAO(): Address { - return this._call.inputValues[3].value.toAddress(); - } - - get _bondCalculator(): Address { - return this._call.inputValues[4].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DepositCall extends ethereum.Call { - get inputs(): DepositCall__Inputs { - return new DepositCall__Inputs(this); - } - - get outputs(): DepositCall__Outputs { - return new DepositCall__Outputs(this); - } -} - -export class DepositCall__Inputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _maxPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _depositor(): Address { - return this._call.inputValues[2].value.toAddress(); - } -} - -export class DepositCall__Outputs { - _call: DepositCall; - - constructor(call: DepositCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class InitializeBondTermsCall extends ethereum.Call { - get inputs(): InitializeBondTermsCall__Inputs { - return new InitializeBondTermsCall__Inputs(this); - } - - get outputs(): InitializeBondTermsCall__Outputs { - return new InitializeBondTermsCall__Outputs(this); - } -} - -export class InitializeBondTermsCall__Inputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } - - get _controlVariable(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _vestingTerm(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _minimumPrice(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _maxPayout(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _fee(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _maxDebt(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get _initialDebt(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } -} - -export class InitializeBondTermsCall__Outputs { - _call: InitializeBondTermsCall; - - constructor(call: InitializeBondTermsCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RecoverLostTokenCall extends ethereum.Call { - get inputs(): RecoverLostTokenCall__Inputs { - return new RecoverLostTokenCall__Inputs(this); - } - - get outputs(): RecoverLostTokenCall__Outputs { - return new RecoverLostTokenCall__Outputs(this); - } -} - -export class RecoverLostTokenCall__Inputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get _token(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RecoverLostTokenCall__Outputs { - _call: RecoverLostTokenCall; - - constructor(call: RecoverLostTokenCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class RedeemCall extends ethereum.Call { - get inputs(): RedeemCall__Inputs { - return new RedeemCall__Inputs(this); - } - - get outputs(): RedeemCall__Outputs { - return new RedeemCall__Outputs(this); - } -} - -export class RedeemCall__Inputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get _recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _stake(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class RedeemCall__Outputs { - _call: RedeemCall; - - constructor(call: RedeemCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetAdjustmentCall extends ethereum.Call { - get inputs(): SetAdjustmentCall__Inputs { - return new SetAdjustmentCall__Inputs(this); - } - - get outputs(): SetAdjustmentCall__Outputs { - return new SetAdjustmentCall__Outputs(this); - } -} - -export class SetAdjustmentCall__Inputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } - - get _addition(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } - - get _increment(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _target(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _buffer(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SetAdjustmentCall__Outputs { - _call: SetAdjustmentCall; - - constructor(call: SetAdjustmentCall) { - this._call = call; - } -} - -export class SetBondTermsCall extends ethereum.Call { - get inputs(): SetBondTermsCall__Inputs { - return new SetBondTermsCall__Inputs(this); - } - - get outputs(): SetBondTermsCall__Outputs { - return new SetBondTermsCall__Outputs(this); - } -} - -export class SetBondTermsCall__Inputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } - - get _parameter(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _input(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class SetBondTermsCall__Outputs { - _call: SetBondTermsCall; - - constructor(call: SetBondTermsCall) { - this._call = call; - } -} - -export class SetStakingCall extends ethereum.Call { - get inputs(): SetStakingCall__Inputs { - return new SetStakingCall__Inputs(this); - } - - get outputs(): SetStakingCall__Outputs { - return new SetStakingCall__Outputs(this); - } -} - -export class SetStakingCall__Inputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } - - get _staking(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _helper(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class SetStakingCall__Outputs { - _call: SetStakingCall; - - constructor(call: SetStakingCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/OHMLUSDBondV1/UniswapV2Pair.ts b/subgraphs/ethereum/generated/OHMLUSDBondV1/UniswapV2Pair.ts deleted file mode 100644 index b36eea33..00000000 --- a/subgraphs/ethereum/generated/OHMLUSDBondV1/UniswapV2Pair.ts +++ /dev/null @@ -1,1092 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Burn extends ethereum.Event { - get params(): Burn__Params { - return new Burn__Params(this); - } -} - -export class Burn__Params { - _event: Burn; - - constructor(event: Burn) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[3].value.toAddress(); - } -} - -export class Mint extends ethereum.Event { - get params(): Mint__Params { - return new Mint__Params(this); - } -} - -export class Mint__Params { - _event: Mint; - - constructor(event: Mint) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0In(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1In(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get amount0Out(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[5].value.toAddress(); - } -} - -export class Sync extends ethereum.Event { - get params(): Sync__Params { - return new Sync__Params(this); - } -} - -export class Sync__Params { - _event: Sync; - - constructor(event: Sync) { - this._event = event; - } - - get reserve0(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get reserve1(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class UniswapV2Pair__burnResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } - - getAmount0(): BigInt { - return this.value0; - } - - getAmount1(): BigInt { - return this.value1; - } -} - -export class UniswapV2Pair__getReservesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - get_reserve0(): BigInt { - return this.value0; - } - - get_reserve1(): BigInt { - return this.value1; - } - - get_blockTimestampLast(): BigInt { - return this.value2; - } -} - -export class UniswapV2Pair extends ethereum.SmartContract { - static bind(address: Address): UniswapV2Pair { - return new UniswapV2Pair("UniswapV2Pair", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - MINIMUM_LIQUIDITY(): BigInt { - const result = super.call( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_MINIMUM_LIQUIDITY(): ethereum.CallResult { - const result = super.tryCall( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(param0: Address, param1: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - - return result[0].toBigInt(); - } - - try_allowance(param0: Address, param1: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(param0: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(param0: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - burn(to: Address): UniswapV2Pair__burnResult { - const result = super.call("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return new UniswapV2Pair__burnResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_burn(to: Address): ethereum.CallResult { - const result = super.tryCall("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__burnResult(value[0].toBigInt(), value[1].toBigInt()) - ); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - factory(): Address { - const result = super.call("factory", "factory():(address)", []); - - return result[0].toAddress(); - } - - try_factory(): ethereum.CallResult
{ - const result = super.tryCall("factory", "factory():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getReserves(): UniswapV2Pair__getReservesResult { - const result = super.call( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - - return new UniswapV2Pair__getReservesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getReserves(): ethereum.CallResult { - const result = super.tryCall( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__getReservesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - kLast(): BigInt { - const result = super.call("kLast", "kLast():(uint256)", []); - - return result[0].toBigInt(); - } - - try_kLast(): ethereum.CallResult { - const result = super.tryCall("kLast", "kLast():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - mint(to: Address): BigInt { - const result = super.call("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return result[0].toBigInt(); - } - - try_mint(to: Address): ethereum.CallResult { - const result = super.tryCall("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(param0: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_nonces(param0: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price0CumulativeLast(): BigInt { - const result = super.call( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price0CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price1CumulativeLast(): BigInt { - const result = super.call( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price1CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - token0(): Address { - const result = super.call("token0", "token0():(address)", []); - - return result[0].toAddress(); - } - - try_token0(): ethereum.CallResult
{ - const result = super.tryCall("token0", "token0():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - token1(): Address { - const result = super.call("token1", "token1():(address)", []); - - return result[0].toAddress(); - } - - try_token1(): ethereum.CallResult
{ - const result = super.tryCall("token1", "token1():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class BurnCall extends ethereum.Call { - get inputs(): BurnCall__Inputs { - return new BurnCall__Inputs(this); - } - - get outputs(): BurnCall__Outputs { - return new BurnCall__Outputs(this); - } -} - -export class BurnCall__Inputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class BurnCall__Outputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get amount0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amount1(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _token0(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _token1(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class MintCall extends ethereum.Call { - get inputs(): MintCall__Inputs { - return new MintCall__Inputs(this); - } - - get outputs(): MintCall__Outputs { - return new MintCall__Outputs(this); - } -} - -export class MintCall__Inputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class MintCall__Outputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get liquidity(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class SkimCall extends ethereum.Call { - get inputs(): SkimCall__Inputs { - return new SkimCall__Inputs(this); - } - - get outputs(): SkimCall__Outputs { - return new SkimCall__Outputs(this); - } -} - -export class SkimCall__Inputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SkimCall__Outputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amount0Out(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get to(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get data(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } -} - -export class SyncCall extends ethereum.Call { - get inputs(): SyncCall__Inputs { - return new SyncCall__Inputs(this); - } - - get outputs(): SyncCall__Outputs { - return new SyncCall__Outputs(this); - } -} - -export class SyncCall__Inputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class SyncCall__Outputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/PriceSnapshot/BalancerPoolToken.ts b/subgraphs/ethereum/generated/PriceSnapshot/BalancerPoolToken.ts deleted file mode 100644 index e1efa45b..00000000 --- a/subgraphs/ethereum/generated/PriceSnapshot/BalancerPoolToken.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class SwapFeePercentageChanged extends ethereum.Event { - get params(): SwapFeePercentageChanged__Params { - return new SwapFeePercentageChanged__Params(this); - } -} - -export class SwapFeePercentageChanged__Params { - _event: SwapFeePercentageChanged; - - constructor(event: SwapFeePercentageChanged) { - this._event = event; - } - - get swapFeePercentage(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BalancerPoolToken__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerPoolToken__onExitPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onJoinPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onSwapInputRequestStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get tokenIn(): Address { - return this[1].toAddress(); - } - - get tokenOut(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get poolId(): Bytes { - return this[4].toBytes(); - } - - get lastChangeBlock(): BigInt { - return this[5].toBigInt(); - } - - get from(): Address { - return this[6].toAddress(); - } - - get to(): Address { - return this[7].toAddress(); - } - - get userData(): Bytes { - return this[8].toBytes(); - } -} - -export class BalancerPoolToken__queryExitResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptIn(): BigInt { - return this.value0; - } - - getAmountsOut(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__queryJoinResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptOut(): BigInt { - return this.value0; - } - - getAmountsIn(): Array { - return this.value1; - } -} - -export class BalancerPoolToken extends ethereum.SmartContract { - static bind(address: Address): BalancerPoolToken { - return new BalancerPoolToken("BalancerPoolToken", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getInvariant(): BigInt { - const result = super.call("getInvariant", "getInvariant():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getInvariant(): ethereum.CallResult { - const result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getLastInvariant(): BigInt { - const result = super.call( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getLastInvariant(): ethereum.CallResult { - const result = super.tryCall( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getNormalizedWeights(): Array { - const result = super.call( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - - return result[0].toBigIntArray(); - } - - try_getNormalizedWeights(): ethereum.CallResult> { - const result = super.tryCall( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getOwner(): Address { - const result = super.call("getOwner", "getOwner():(address)", []); - - return result[0].toAddress(); - } - - try_getOwner(): ethereum.CallResult
{ - const result = super.tryCall("getOwner", "getOwner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getPausedState(): BalancerPoolToken__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerPoolToken__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerPoolToken__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPoolId(): Bytes { - const result = super.call("getPoolId", "getPoolId():(bytes32)", []); - - return result[0].toBytes(); - } - - try_getPoolId(): ethereum.CallResult { - const result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getRate(): BigInt { - const result = super.call("getRate", "getRate():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getRate(): ethereum.CallResult { - const result = super.tryCall("getRate", "getRate():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getSwapFeePercentage(): BigInt { - const result = super.call( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getSwapFeePercentage(): ethereum.CallResult { - const result = super.tryCall( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getVault(): Address { - const result = super.call("getVault", "getVault():(address)", []); - - return result[0].toAddress(); - } - - try_getVault(): ethereum.CallResult
{ - const result = super.tryCall("getVault", "getVault():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - increaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onExitPoolResult { - const result = super.call( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onExitPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onExitPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onJoinPoolResult { - const result = super.call( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onJoinPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onJoinPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): BigInt { - const result = super.call( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - - return result[0].toBigInt(); - } - - try_onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryExitResult { - const result = super.call( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryExitResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryExitResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryJoinResult { - const result = super.call( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryJoinResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryJoinResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get vault(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get name(): string { - return this._call.inputValues[1].value.toString(); - } - - get symbol(): string { - return this._call.inputValues[2].value.toString(); - } - - get tokens(): Array
{ - return this._call.inputValues[3].value.toAddressArray(); - } - - get normalizedWeights(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[7].value.toBigInt(); - } - - get owner(): Address { - return this._call.inputValues[8].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DecreaseApprovalCall extends ethereum.Call { - get inputs(): DecreaseApprovalCall__Inputs { - return new DecreaseApprovalCall__Inputs(this); - } - - get outputs(): DecreaseApprovalCall__Outputs { - return new DecreaseApprovalCall__Outputs(this); - } -} - -export class DecreaseApprovalCall__Inputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseApprovalCall__Outputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseApprovalCall extends ethereum.Call { - get inputs(): IncreaseApprovalCall__Inputs { - return new IncreaseApprovalCall__Inputs(this); - } - - get outputs(): IncreaseApprovalCall__Outputs { - return new IncreaseApprovalCall__Outputs(this); - } -} - -export class IncreaseApprovalCall__Inputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseApprovalCall__Outputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class OnExitPoolCall extends ethereum.Call { - get inputs(): OnExitPoolCall__Inputs { - return new OnExitPoolCall__Inputs(this); - } - - get outputs(): OnExitPoolCall__Outputs { - return new OnExitPoolCall__Outputs(this); - } -} - -export class OnExitPoolCall__Inputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnExitPoolCall__Outputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class OnJoinPoolCall extends ethereum.Call { - get inputs(): OnJoinPoolCall__Inputs { - return new OnJoinPoolCall__Inputs(this); - } - - get outputs(): OnJoinPoolCall__Outputs { - return new OnJoinPoolCall__Outputs(this); - } -} - -export class OnJoinPoolCall__Inputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnJoinPoolCall__Outputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class QueryExitCall extends ethereum.Call { - get inputs(): QueryExitCall__Inputs { - return new QueryExitCall__Inputs(this); - } - - get outputs(): QueryExitCall__Outputs { - return new QueryExitCall__Outputs(this); - } -} - -export class QueryExitCall__Inputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryExitCall__Outputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get bptIn(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsOut(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class QueryJoinCall extends ethereum.Call { - get inputs(): QueryJoinCall__Inputs { - return new QueryJoinCall__Inputs(this); - } - - get outputs(): QueryJoinCall__Outputs { - return new QueryJoinCall__Outputs(this); - } -} - -export class QueryJoinCall__Inputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryJoinCall__Outputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get bptOut(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsIn(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetSwapFeePercentageCall extends ethereum.Call { - get inputs(): SetSwapFeePercentageCall__Inputs { - return new SetSwapFeePercentageCall__Inputs(this); - } - - get outputs(): SetSwapFeePercentageCall__Outputs { - return new SetSwapFeePercentageCall__Outputs(this); - } -} - -export class SetSwapFeePercentageCall__Inputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetSwapFeePercentageCall__Outputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/PriceSnapshot/BalancerVault.ts b/subgraphs/ethereum/generated/PriceSnapshot/BalancerVault.ts deleted file mode 100644 index 41f94648..00000000 --- a/subgraphs/ethereum/generated/PriceSnapshot/BalancerVault.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class AuthorizerChanged extends ethereum.Event { - get params(): AuthorizerChanged__Params { - return new AuthorizerChanged__Params(this); - } -} - -export class AuthorizerChanged__Params { - _event: AuthorizerChanged; - - constructor(event: AuthorizerChanged) { - this._event = event; - } - - get newAuthorizer(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class ExternalBalanceTransfer extends ethereum.Event { - get params(): ExternalBalanceTransfer__Params { - return new ExternalBalanceTransfer__Params(this); - } -} - -export class ExternalBalanceTransfer__Params { - _event: ExternalBalanceTransfer; - - constructor(event: ExternalBalanceTransfer) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get recipient(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class FlashLoan extends ethereum.Event { - get params(): FlashLoan__Params { - return new FlashLoan__Params(this); - } -} - -export class FlashLoan__Params { - _event: FlashLoan; - - constructor(event: FlashLoan) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get feeAmount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class InternalBalanceChanged extends ethereum.Event { - get params(): InternalBalanceChanged__Params { - return new InternalBalanceChanged__Params(this); - } -} - -export class InternalBalanceChanged__Params { - _event: InternalBalanceChanged; - - constructor(event: InternalBalanceChanged) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get delta(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class PoolBalanceChanged extends ethereum.Event { - get params(): PoolBalanceChanged__Params { - return new PoolBalanceChanged__Params(this); - } -} - -export class PoolBalanceChanged__Params { - _event: PoolBalanceChanged; - - constructor(event: PoolBalanceChanged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get liquidityProvider(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokens(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } - - get deltas(): Array { - return this._event.parameters[3].value.toBigIntArray(); - } - - get protocolFeeAmounts(): Array { - return this._event.parameters[4].value.toBigIntArray(); - } -} - -export class PoolBalanceManaged extends ethereum.Event { - get params(): PoolBalanceManaged__Params { - return new PoolBalanceManaged__Params(this); - } -} - -export class PoolBalanceManaged__Params { - _event: PoolBalanceManaged; - - constructor(event: PoolBalanceManaged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get assetManager(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get cashDelta(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get managedDelta(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class PoolRegistered extends ethereum.Event { - get params(): PoolRegistered__Params { - return new PoolRegistered__Params(this); - } -} - -export class PoolRegistered__Params { - _event: PoolRegistered; - - constructor(event: PoolRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get poolAddress(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get specialization(): i32 { - return this._event.parameters[2].value.toI32(); - } -} - -export class RelayerApprovalChanged extends ethereum.Event { - get params(): RelayerApprovalChanged__Params { - return new RelayerApprovalChanged__Params(this); - } -} - -export class RelayerApprovalChanged__Params { - _event: RelayerApprovalChanged; - - constructor(event: RelayerApprovalChanged) { - this._event = event; - } - - get relayer(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get approved(): boolean { - return this._event.parameters[2].value.toBoolean(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokenIn(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokenOut(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amountIn(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amountOut(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class TokensDeregistered extends ethereum.Event { - get params(): TokensDeregistered__Params { - return new TokensDeregistered__Params(this); - } -} - -export class TokensDeregistered__Params { - _event: TokensDeregistered; - - constructor(event: TokensDeregistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } -} - -export class TokensRegistered extends ethereum.Event { - get params(): TokensRegistered__Params { - return new TokensRegistered__Params(this); - } -} - -export class TokensRegistered__Params { - _event: TokensRegistered; - - constructor(event: TokensRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } -} - -export class BalancerVault__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerVault__getPoolResult { - value0: Address; - value1: i32; - - constructor(value0: Address, value1: i32) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddress(this.value0)); - map.set( - "value1", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) - ); - return map; - } - - getValue0(): Address { - return this.value0; - } - - getValue1(): i32 { - return this.value1; - } -} - -export class BalancerVault__getPoolTokenInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: Address; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: Address) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromAddress(this.value3)); - return map; - } - - getCash(): BigInt { - return this.value0; - } - - getManaged(): BigInt { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } - - getAssetManager(): Address { - return this.value3; - } -} - -export class BalancerVault__getPoolTokensResult { - value0: Array
; - value1: Array; - value2: BigInt; - - constructor(value0: Array
, value1: Array, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddressArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getTokens(): Array
{ - return this.value0; - } - - getBalances(): Array { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } -} - -export class BalancerVault__queryBatchSwapInputSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BalancerVault__queryBatchSwapInputFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class BalancerVault extends ethereum.SmartContract { - static bind(address: Address): BalancerVault { - return new BalancerVault("BalancerVault", address); - } - - WETH(): Address { - const result = super.call("WETH", "WETH():(address)", []); - - return result[0].toAddress(); - } - - try_WETH(): ethereum.CallResult
{ - const result = super.tryCall("WETH", "WETH():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getDomainSeparator(): Bytes { - const result = super.call( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_getDomainSeparator(): ethereum.CallResult { - const result = super.tryCall( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getInternalBalance(user: Address, tokens: Array
): Array { - const result = super.call( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - - return result[0].toBigIntArray(); - } - - try_getInternalBalance( - user: Address, - tokens: Array
- ): ethereum.CallResult> { - const result = super.tryCall( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getNextNonce(user: Address): BigInt { - const result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ - ethereum.Value.fromAddress(user) - ]); - - return result[0].toBigInt(); - } - - try_getNextNonce(user: Address): ethereum.CallResult { - const result = super.tryCall( - "getNextNonce", - "getNextNonce(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getPausedState(): BalancerVault__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerVault__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerVault__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPool(poolId: Bytes): BalancerVault__getPoolResult { - const result = super.call("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - - return new BalancerVault__getPoolResult( - result[0].toAddress(), - result[1].toI32() - ); - } - - try_getPool( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolResult(value[0].toAddress(), value[1].toI32()) - ); - } - - getPoolTokenInfo( - poolId: Bytes, - token: Address - ): BalancerVault__getPoolTokenInfoResult { - const result = super.call( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - - return new BalancerVault__getPoolTokenInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toAddress() - ); - } - - try_getPoolTokenInfo( - poolId: Bytes, - token: Address - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokenInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toAddress() - ) - ); - } - - getPoolTokens(poolId: Bytes): BalancerVault__getPoolTokensResult { - const result = super.call( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - - return new BalancerVault__getPoolTokensResult( - result[0].toAddressArray(), - result[1].toBigIntArray(), - result[2].toBigInt() - ); - } - - try_getPoolTokens( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokensResult( - value[0].toAddressArray(), - value[1].toBigIntArray(), - value[2].toBigInt() - ) - ); - } - - getProtocolFeesCollector(): Address { - const result = super.call( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_getProtocolFeesCollector(): ethereum.CallResult
{ - const result = super.tryCall( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - hasApprovedRelayer(user: Address, relayer: Address): boolean { - const result = super.call( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - - return result[0].toBoolean(); - } - - try_hasApprovedRelayer( - user: Address, - relayer: Address - ): ethereum.CallResult { - const result = super.tryCall( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): Array { - const result = super.call( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - - return result[0].toBigIntArray(); - } - - try_queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): ethereum.CallResult> { - const result = super.tryCall( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - registerPool(specialization: i32): Bytes { - const result = super.call("registerPool", "registerPool(uint8):(bytes32)", [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization)) - ]); - - return result[0].toBytes(); - } - - try_registerPool(specialization: i32): ethereum.CallResult { - const result = super.tryCall( - "registerPool", - "registerPool(uint8):(bytes32)", - [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization))] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get authorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get weth(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class BatchSwapCall extends ethereum.Call { - get inputs(): BatchSwapCall__Inputs { - return new BatchSwapCall__Inputs(this); - } - - get outputs(): BatchSwapCall__Outputs { - return new BatchSwapCall__Outputs(this); - } -} - -export class BatchSwapCall__Inputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - BatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): BatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } - - get limits(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get deadline(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } -} - -export class BatchSwapCall__Outputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get assetDeltas(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class BatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class DeregisterTokensCall extends ethereum.Call { - get inputs(): DeregisterTokensCall__Inputs { - return new DeregisterTokensCall__Inputs(this); - } - - get outputs(): DeregisterTokensCall__Outputs { - return new DeregisterTokensCall__Outputs(this); - } -} - -export class DeregisterTokensCall__Inputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } -} - -export class DeregisterTokensCall__Outputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } -} - -export class ExitPoolCall extends ethereum.Call { - get inputs(): ExitPoolCall__Inputs { - return new ExitPoolCall__Inputs(this); - } - - get outputs(): ExitPoolCall__Outputs { - return new ExitPoolCall__Outputs(this); - } -} - -export class ExitPoolCall__Inputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): ExitPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class ExitPoolCall__Outputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } -} - -export class ExitPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get minAmountsOut(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class FlashLoanCall extends ethereum.Call { - get inputs(): FlashLoanCall__Inputs { - return new FlashLoanCall__Inputs(this); - } - - get outputs(): FlashLoanCall__Outputs { - return new FlashLoanCall__Outputs(this); - } -} - -export class FlashLoanCall__Inputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get amounts(): Array { - return this._call.inputValues[2].value.toBigIntArray(); - } - - get userData(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class FlashLoanCall__Outputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } -} - -export class JoinPoolCall extends ethereum.Call { - get inputs(): JoinPoolCall__Inputs { - return new JoinPoolCall__Inputs(this); - } - - get outputs(): JoinPoolCall__Outputs { - return new JoinPoolCall__Outputs(this); - } -} - -export class JoinPoolCall__Inputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): JoinPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class JoinPoolCall__Outputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } -} - -export class JoinPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get maxAmountsIn(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get fromInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class ManagePoolBalanceCall extends ethereum.Call { - get inputs(): ManagePoolBalanceCall__Inputs { - return new ManagePoolBalanceCall__Inputs(this); - } - - get outputs(): ManagePoolBalanceCall__Outputs { - return new ManagePoolBalanceCall__Outputs(this); - } -} - -export class ManagePoolBalanceCall__Inputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManagePoolBalanceCallOpsStruct - >(); - } -} - -export class ManagePoolBalanceCall__Outputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } -} - -export class ManagePoolBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get poolId(): Bytes { - return this[1].toBytes(); - } - - get token(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } -} - -export class ManageUserBalanceCall extends ethereum.Call { - get inputs(): ManageUserBalanceCall__Inputs { - return new ManageUserBalanceCall__Inputs(this); - } - - get outputs(): ManageUserBalanceCall__Outputs { - return new ManageUserBalanceCall__Outputs(this); - } -} - -export class ManageUserBalanceCall__Inputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManageUserBalanceCallOpsStruct - >(); - } -} - -export class ManageUserBalanceCall__Outputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } -} - -export class ManageUserBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get asset(): Address { - return this[1].toAddress(); - } - - get amount(): BigInt { - return this[2].toBigInt(); - } - - get sender(): Address { - return this[3].toAddress(); - } - - get recipient(): Address { - return this[4].toAddress(); - } -} - -export class QueryBatchSwapCall extends ethereum.Call { - get inputs(): QueryBatchSwapCall__Inputs { - return new QueryBatchSwapCall__Inputs(this); - } - - get outputs(): QueryBatchSwapCall__Outputs { - return new QueryBatchSwapCall__Outputs(this); - } -} - -export class QueryBatchSwapCall__Inputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - QueryBatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): QueryBatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class QueryBatchSwapCall__Outputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class QueryBatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class QueryBatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class RegisterPoolCall extends ethereum.Call { - get inputs(): RegisterPoolCall__Inputs { - return new RegisterPoolCall__Inputs(this); - } - - get outputs(): RegisterPoolCall__Outputs { - return new RegisterPoolCall__Outputs(this); - } -} - -export class RegisterPoolCall__Inputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get specialization(): i32 { - return this._call.inputValues[0].value.toI32(); - } -} - -export class RegisterPoolCall__Outputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get value0(): Bytes { - return this._call.outputValues[0].value.toBytes(); - } -} - -export class RegisterTokensCall extends ethereum.Call { - get inputs(): RegisterTokensCall__Inputs { - return new RegisterTokensCall__Inputs(this); - } - - get outputs(): RegisterTokensCall__Outputs { - return new RegisterTokensCall__Outputs(this); - } -} - -export class RegisterTokensCall__Inputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } -} - -export class RegisterTokensCall__Outputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } -} - -export class SetAuthorizerCall extends ethereum.Call { - get inputs(): SetAuthorizerCall__Inputs { - return new SetAuthorizerCall__Inputs(this); - } - - get outputs(): SetAuthorizerCall__Outputs { - return new SetAuthorizerCall__Outputs(this); - } -} - -export class SetAuthorizerCall__Inputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } - - get newAuthorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetAuthorizerCall__Outputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetRelayerApprovalCall extends ethereum.Call { - get inputs(): SetRelayerApprovalCall__Inputs { - return new SetRelayerApprovalCall__Inputs(this); - } - - get outputs(): SetRelayerApprovalCall__Outputs { - return new SetRelayerApprovalCall__Outputs(this); - } -} - -export class SetRelayerApprovalCall__Inputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get relayer(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get approved(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } -} - -export class SetRelayerApprovalCall__Outputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get singleSwap(): SwapCallSingleSwapStruct { - return changetype( - this._call.inputValues[0].value.toTuple() - ); - } - - get funds(): SwapCallFundsStruct { - return changetype( - this._call.inputValues[1].value.toTuple() - ); - } - - get limit(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amountCalculated(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class SwapCallSingleSwapStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get kind(): i32 { - return this[1].toI32(); - } - - get assetIn(): Address { - return this[2].toAddress(); - } - - get assetOut(): Address { - return this[3].toAddress(); - } - - get amount(): BigInt { - return this[4].toBigInt(); - } - - get userData(): Bytes { - return this[5].toBytes(); - } -} - -export class SwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/PriceSnapshot/ERC20.ts b/subgraphs/ethereum/generated/PriceSnapshot/ERC20.ts deleted file mode 100644 index bbe93783..00000000 --- a/subgraphs/ethereum/generated/PriceSnapshot/ERC20.ts +++ /dev/null @@ -1,394 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ERC20 extends ethereum.SmartContract { - static bind(address: Address): ERC20 { - return new ERC20("ERC20", address); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - approve(_spender: Address, _value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_approve(_spender: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transferFrom(_from: Address, _to: Address, _value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - _from: Address, - _to: Address, - _value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - balanceOf(_owner: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(_owner: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - transfer(_to: Address, _value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(_to: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - allowance(_owner: Address, _spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - _owner: Address, - _spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get _spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get _from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DefaultCall extends ethereum.Call { - get inputs(): DefaultCall__Inputs { - return new DefaultCall__Inputs(this); - } - - get outputs(): DefaultCall__Outputs { - return new DefaultCall__Outputs(this); - } -} - -export class DefaultCall__Inputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} - -export class DefaultCall__Outputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/PriceSnapshot/UniswapV2Pair.ts b/subgraphs/ethereum/generated/PriceSnapshot/UniswapV2Pair.ts deleted file mode 100644 index b36eea33..00000000 --- a/subgraphs/ethereum/generated/PriceSnapshot/UniswapV2Pair.ts +++ /dev/null @@ -1,1092 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Burn extends ethereum.Event { - get params(): Burn__Params { - return new Burn__Params(this); - } -} - -export class Burn__Params { - _event: Burn; - - constructor(event: Burn) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[3].value.toAddress(); - } -} - -export class Mint extends ethereum.Event { - get params(): Mint__Params { - return new Mint__Params(this); - } -} - -export class Mint__Params { - _event: Mint; - - constructor(event: Mint) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0In(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1In(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get amount0Out(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[5].value.toAddress(); - } -} - -export class Sync extends ethereum.Event { - get params(): Sync__Params { - return new Sync__Params(this); - } -} - -export class Sync__Params { - _event: Sync; - - constructor(event: Sync) { - this._event = event; - } - - get reserve0(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get reserve1(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class UniswapV2Pair__burnResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } - - getAmount0(): BigInt { - return this.value0; - } - - getAmount1(): BigInt { - return this.value1; - } -} - -export class UniswapV2Pair__getReservesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - get_reserve0(): BigInt { - return this.value0; - } - - get_reserve1(): BigInt { - return this.value1; - } - - get_blockTimestampLast(): BigInt { - return this.value2; - } -} - -export class UniswapV2Pair extends ethereum.SmartContract { - static bind(address: Address): UniswapV2Pair { - return new UniswapV2Pair("UniswapV2Pair", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - MINIMUM_LIQUIDITY(): BigInt { - const result = super.call( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_MINIMUM_LIQUIDITY(): ethereum.CallResult { - const result = super.tryCall( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(param0: Address, param1: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - - return result[0].toBigInt(); - } - - try_allowance(param0: Address, param1: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(param0: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(param0: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - burn(to: Address): UniswapV2Pair__burnResult { - const result = super.call("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return new UniswapV2Pair__burnResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_burn(to: Address): ethereum.CallResult { - const result = super.tryCall("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__burnResult(value[0].toBigInt(), value[1].toBigInt()) - ); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - factory(): Address { - const result = super.call("factory", "factory():(address)", []); - - return result[0].toAddress(); - } - - try_factory(): ethereum.CallResult
{ - const result = super.tryCall("factory", "factory():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getReserves(): UniswapV2Pair__getReservesResult { - const result = super.call( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - - return new UniswapV2Pair__getReservesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getReserves(): ethereum.CallResult { - const result = super.tryCall( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__getReservesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - kLast(): BigInt { - const result = super.call("kLast", "kLast():(uint256)", []); - - return result[0].toBigInt(); - } - - try_kLast(): ethereum.CallResult { - const result = super.tryCall("kLast", "kLast():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - mint(to: Address): BigInt { - const result = super.call("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return result[0].toBigInt(); - } - - try_mint(to: Address): ethereum.CallResult { - const result = super.tryCall("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(param0: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_nonces(param0: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price0CumulativeLast(): BigInt { - const result = super.call( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price0CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price1CumulativeLast(): BigInt { - const result = super.call( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price1CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - token0(): Address { - const result = super.call("token0", "token0():(address)", []); - - return result[0].toAddress(); - } - - try_token0(): ethereum.CallResult
{ - const result = super.tryCall("token0", "token0():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - token1(): Address { - const result = super.call("token1", "token1():(address)", []); - - return result[0].toAddress(); - } - - try_token1(): ethereum.CallResult
{ - const result = super.tryCall("token1", "token1():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class BurnCall extends ethereum.Call { - get inputs(): BurnCall__Inputs { - return new BurnCall__Inputs(this); - } - - get outputs(): BurnCall__Outputs { - return new BurnCall__Outputs(this); - } -} - -export class BurnCall__Inputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class BurnCall__Outputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get amount0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amount1(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _token0(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _token1(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class MintCall extends ethereum.Call { - get inputs(): MintCall__Inputs { - return new MintCall__Inputs(this); - } - - get outputs(): MintCall__Outputs { - return new MintCall__Outputs(this); - } -} - -export class MintCall__Inputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class MintCall__Outputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get liquidity(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class SkimCall extends ethereum.Call { - get inputs(): SkimCall__Inputs { - return new SkimCall__Inputs(this); - } - - get outputs(): SkimCall__Outputs { - return new SkimCall__Outputs(this); - } -} - -export class SkimCall__Inputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SkimCall__Outputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amount0Out(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get to(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get data(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } -} - -export class SyncCall extends ethereum.Call { - get inputs(): SyncCall__Inputs { - return new SyncCall__Inputs(this); - } - - get outputs(): SyncCall__Outputs { - return new SyncCall__Outputs(this); - } -} - -export class SyncCall__Inputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class SyncCall__Outputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/PriceSnapshot/sOlympusERC20V2.ts b/subgraphs/ethereum/generated/PriceSnapshot/sOlympusERC20V2.ts deleted file mode 100644 index a4184728..00000000 --- a/subgraphs/ethereum/generated/PriceSnapshot/sOlympusERC20V2.ts +++ /dev/null @@ -1,1277 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class LogRebase extends ethereum.Event { - get params(): LogRebase__Params { - return new LogRebase__Params(this); - } -} - -export class LogRebase__Params { - _event: LogRebase; - - constructor(event: LogRebase) { - this._event = event; - } - - get epoch(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get rebase(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get index(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class LogStakingContractUpdated extends ethereum.Event { - get params(): LogStakingContractUpdated__Params { - return new LogStakingContractUpdated__Params(this); - } -} - -export class LogStakingContractUpdated__Params { - _event: LogStakingContractUpdated; - - constructor(event: LogStakingContractUpdated) { - this._event = event; - } - - get stakingContract(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class LogSupply extends ethereum.Event { - get params(): LogSupply__Params { - return new LogSupply__Params(this); - } -} - -export class LogSupply__Params { - _event: LogSupply; - - constructor(event: LogSupply) { - this._event = event; - } - - get epoch(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get timestamp(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get totalSupply(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class sOlympusERC20V2__rebasesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - value6: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt, - value6: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - this.value6 = value6; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - map.set("value6", ethereum.Value.fromUnsignedBigInt(this.value6)); - return map; - } - - getEpoch(): BigInt { - return this.value0; - } - - getRebase(): BigInt { - return this.value1; - } - - getTotalStakedBefore(): BigInt { - return this.value2; - } - - getTotalStakedAfter(): BigInt { - return this.value3; - } - - getAmountRebased(): BigInt { - return this.value4; - } - - getIndex(): BigInt { - return this.value5; - } - - getBlockNumberOccured(): BigInt { - return this.value6; - } -} - -export class sOlympusERC20V2 extends ethereum.SmartContract { - static bind(address: Address): sOlympusERC20V2 { - return new sOlympusERC20V2("sOlympusERC20V2", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - INDEX(): BigInt { - const result = super.call("INDEX", "INDEX():(uint256)", []); - - return result[0].toBigInt(); - } - - try_INDEX(): ethereum.CallResult { - const result = super.tryCall("INDEX", "INDEX():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner_: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner_), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - owner_: Address, - spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner_), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceForGons(gons: BigInt): BigInt { - const result = super.call( - "balanceForGons", - "balanceForGons(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(gons)] - ); - - return result[0].toBigInt(); - } - - try_balanceForGons(gons: BigInt): ethereum.CallResult { - const result = super.tryCall( - "balanceForGons", - "balanceForGons(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(gons)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - balanceOf(who: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(who) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(who: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(who) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - circulatingSupply(): BigInt { - const result = super.call( - "circulatingSupply", - "circulatingSupply():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_circulatingSupply(): ethereum.CallResult { - const result = super.tryCall( - "circulatingSupply", - "circulatingSupply():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { - const result = super.call( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseAllowance( - spender: Address, - subtractedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - gonsForBalance(amount: BigInt): BigInt { - const result = super.call( - "gonsForBalance", - "gonsForBalance(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amount)] - ); - - return result[0].toBigInt(); - } - - try_gonsForBalance(amount: BigInt): ethereum.CallResult { - const result = super.tryCall( - "gonsForBalance", - "gonsForBalance(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amount)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - increaseAllowance(spender: Address, addedValue: BigInt): boolean { - const result = super.call( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseAllowance( - spender: Address, - addedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - index(): BigInt { - const result = super.call("index", "index():(uint256)", []); - - return result[0].toBigInt(); - } - - try_index(): ethereum.CallResult { - const result = super.tryCall("index", "index():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - initialize(stakingContract_: Address): boolean { - const result = super.call("initialize", "initialize(address):(bool)", [ - ethereum.Value.fromAddress(stakingContract_) - ]); - - return result[0].toBoolean(); - } - - try_initialize(stakingContract_: Address): ethereum.CallResult { - const result = super.tryCall("initialize", "initialize(address):(bool)", [ - ethereum.Value.fromAddress(stakingContract_) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - initializer(): Address { - const result = super.call("initializer", "initializer():(address)", []); - - return result[0].toAddress(); - } - - try_initializer(): ethereum.CallResult
{ - const result = super.tryCall("initializer", "initializer():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - manager(): Address { - const result = super.call("manager", "manager():(address)", []); - - return result[0].toAddress(); - } - - try_manager(): ethereum.CallResult
{ - const result = super.tryCall("manager", "manager():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - rebase(profit_: BigInt, epoch_: BigInt): BigInt { - const result = super.call("rebase", "rebase(uint256,uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(profit_), - ethereum.Value.fromUnsignedBigInt(epoch_) - ]); - - return result[0].toBigInt(); - } - - try_rebase(profit_: BigInt, epoch_: BigInt): ethereum.CallResult { - const result = super.tryCall("rebase", "rebase(uint256,uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(profit_), - ethereum.Value.fromUnsignedBigInt(epoch_) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - rebases(param0: BigInt): sOlympusERC20V2__rebasesResult { - const result = super.call( - "rebases", - "rebases(uint256):(uint256,uint256,uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromUnsignedBigInt(param0)] - ); - - return new sOlympusERC20V2__rebasesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt(), - result[6].toBigInt() - ); - } - - try_rebases( - param0: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "rebases", - "rebases(uint256):(uint256,uint256,uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromUnsignedBigInt(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new sOlympusERC20V2__rebasesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt(), - value[6].toBigInt() - ) - ); - } - - setIndex(_INDEX: BigInt): boolean { - const result = super.call("setIndex", "setIndex(uint256):(bool)", [ - ethereum.Value.fromUnsignedBigInt(_INDEX) - ]); - - return result[0].toBoolean(); - } - - try_setIndex(_INDEX: BigInt): ethereum.CallResult { - const result = super.tryCall("setIndex", "setIndex(uint256):(bool)", [ - ethereum.Value.fromUnsignedBigInt(_INDEX) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - stakingContract(): Address { - const result = super.call( - "stakingContract", - "stakingContract():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_stakingContract(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingContract", - "stakingContract():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DecreaseAllowanceCall extends ethereum.Call { - get inputs(): DecreaseAllowanceCall__Inputs { - return new DecreaseAllowanceCall__Inputs(this); - } - - get outputs(): DecreaseAllowanceCall__Outputs { - return new DecreaseAllowanceCall__Outputs(this); - } -} - -export class DecreaseAllowanceCall__Inputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get subtractedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseAllowanceCall__Outputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseAllowanceCall extends ethereum.Call { - get inputs(): IncreaseAllowanceCall__Inputs { - return new IncreaseAllowanceCall__Inputs(this); - } - - get outputs(): IncreaseAllowanceCall__Outputs { - return new IncreaseAllowanceCall__Outputs(this); - } -} - -export class IncreaseAllowanceCall__Inputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get addedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseAllowanceCall__Outputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get stakingContract_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RebaseCall extends ethereum.Call { - get inputs(): RebaseCall__Inputs { - return new RebaseCall__Inputs(this); - } - - get outputs(): RebaseCall__Outputs { - return new RebaseCall__Outputs(this); - } -} - -export class RebaseCall__Inputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } - - get profit_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get epoch_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class RebaseCall__Outputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetIndexCall extends ethereum.Call { - get inputs(): SetIndexCall__Inputs { - return new SetIndexCall__Inputs(this); - } - - get outputs(): SetIndexCall__Outputs { - return new SetIndexCall__Outputs(this); - } -} - -export class SetIndexCall__Inputs { - _call: SetIndexCall; - - constructor(call: SetIndexCall) { - this._call = call; - } - - get _INDEX(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetIndexCall__Outputs { - _call: SetIndexCall; - - constructor(call: SetIndexCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/PriceSnapshot/sOlympusERC20V3.ts b/subgraphs/ethereum/generated/PriceSnapshot/sOlympusERC20V3.ts deleted file mode 100644 index 49fac1e0..00000000 --- a/subgraphs/ethereum/generated/PriceSnapshot/sOlympusERC20V3.ts +++ /dev/null @@ -1,1194 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class LogRebase extends ethereum.Event { - get params(): LogRebase__Params { - return new LogRebase__Params(this); - } -} - -export class LogRebase__Params { - _event: LogRebase; - - constructor(event: LogRebase) { - this._event = event; - } - - get epoch(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get rebase(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get index(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class LogStakingContractUpdated extends ethereum.Event { - get params(): LogStakingContractUpdated__Params { - return new LogStakingContractUpdated__Params(this); - } -} - -export class LogStakingContractUpdated__Params { - _event: LogStakingContractUpdated; - - constructor(event: LogStakingContractUpdated) { - this._event = event; - } - - get stakingContract(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class LogSupply extends ethereum.Event { - get params(): LogSupply__Params { - return new LogSupply__Params(this); - } -} - -export class LogSupply__Params { - _event: LogSupply; - - constructor(event: LogSupply) { - this._event = event; - } - - get epoch(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get totalSupply(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class sOlympusERC20V3__rebasesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - value6: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt, - value6: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - this.value6 = value6; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - map.set("value6", ethereum.Value.fromUnsignedBigInt(this.value6)); - return map; - } - - getEpoch(): BigInt { - return this.value0; - } - - getRebase(): BigInt { - return this.value1; - } - - getTotalStakedBefore(): BigInt { - return this.value2; - } - - getTotalStakedAfter(): BigInt { - return this.value3; - } - - getAmountRebased(): BigInt { - return this.value4; - } - - getIndex(): BigInt { - return this.value5; - } - - getBlockNumberOccured(): BigInt { - return this.value6; - } -} - -export class sOlympusERC20V3 extends ethereum.SmartContract { - static bind(address: Address): sOlympusERC20V3 { - return new sOlympusERC20V3("sOlympusERC20V3", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner_: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner_), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - owner_: Address, - spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner_), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceForGons(gons: BigInt): BigInt { - const result = super.call( - "balanceForGons", - "balanceForGons(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(gons)] - ); - - return result[0].toBigInt(); - } - - try_balanceForGons(gons: BigInt): ethereum.CallResult { - const result = super.tryCall( - "balanceForGons", - "balanceForGons(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(gons)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - balanceOf(who: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(who) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(who: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(who) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - circulatingSupply(): BigInt { - const result = super.call( - "circulatingSupply", - "circulatingSupply():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_circulatingSupply(): ethereum.CallResult { - const result = super.tryCall( - "circulatingSupply", - "circulatingSupply():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtBalances(param0: Address): BigInt { - const result = super.call("debtBalances", "debtBalances(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_debtBalances(param0: Address): ethereum.CallResult { - const result = super.tryCall( - "debtBalances", - "debtBalances(address):(uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { - const result = super.call( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseAllowance( - spender: Address, - subtractedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - fromG(amount: BigInt): BigInt { - const result = super.call("fromG", "fromG(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBigInt(); - } - - try_fromG(amount: BigInt): ethereum.CallResult { - const result = super.tryCall("fromG", "fromG(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - gOHM(): Address { - const result = super.call("gOHM", "gOHM():(address)", []); - - return result[0].toAddress(); - } - - try_gOHM(): ethereum.CallResult
{ - const result = super.tryCall("gOHM", "gOHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - gonsForBalance(amount: BigInt): BigInt { - const result = super.call( - "gonsForBalance", - "gonsForBalance(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amount)] - ); - - return result[0].toBigInt(); - } - - try_gonsForBalance(amount: BigInt): ethereum.CallResult { - const result = super.tryCall( - "gonsForBalance", - "gonsForBalance(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amount)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - increaseAllowance(spender: Address, addedValue: BigInt): boolean { - const result = super.call( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseAllowance( - spender: Address, - addedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - index(): BigInt { - const result = super.call("index", "index():(uint256)", []); - - return result[0].toBigInt(); - } - - try_index(): ethereum.CallResult { - const result = super.tryCall("index", "index():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - rebase(profit_: BigInt, epoch_: BigInt): BigInt { - const result = super.call("rebase", "rebase(uint256,uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(profit_), - ethereum.Value.fromUnsignedBigInt(epoch_) - ]); - - return result[0].toBigInt(); - } - - try_rebase(profit_: BigInt, epoch_: BigInt): ethereum.CallResult { - const result = super.tryCall("rebase", "rebase(uint256,uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(profit_), - ethereum.Value.fromUnsignedBigInt(epoch_) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - rebases(param0: BigInt): sOlympusERC20V3__rebasesResult { - const result = super.call( - "rebases", - "rebases(uint256):(uint256,uint256,uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromUnsignedBigInt(param0)] - ); - - return new sOlympusERC20V3__rebasesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt(), - result[6].toBigInt() - ); - } - - try_rebases( - param0: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "rebases", - "rebases(uint256):(uint256,uint256,uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromUnsignedBigInt(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new sOlympusERC20V3__rebasesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt(), - value[6].toBigInt() - ) - ); - } - - stakingContract(): Address { - const result = super.call( - "stakingContract", - "stakingContract():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_stakingContract(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingContract", - "stakingContract():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - toG(amount: BigInt): BigInt { - const result = super.call("toG", "toG(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBigInt(); - } - - try_toG(amount: BigInt): ethereum.CallResult { - const result = super.tryCall("toG", "toG(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class ChangeDebtCall extends ethereum.Call { - get inputs(): ChangeDebtCall__Inputs { - return new ChangeDebtCall__Inputs(this); - } - - get outputs(): ChangeDebtCall__Outputs { - return new ChangeDebtCall__Outputs(this); - } -} - -export class ChangeDebtCall__Inputs { - _call: ChangeDebtCall; - - constructor(call: ChangeDebtCall) { - this._call = call; - } - - get amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get debtor(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get add(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } -} - -export class ChangeDebtCall__Outputs { - _call: ChangeDebtCall; - - constructor(call: ChangeDebtCall) { - this._call = call; - } -} - -export class DecreaseAllowanceCall extends ethereum.Call { - get inputs(): DecreaseAllowanceCall__Inputs { - return new DecreaseAllowanceCall__Inputs(this); - } - - get outputs(): DecreaseAllowanceCall__Outputs { - return new DecreaseAllowanceCall__Outputs(this); - } -} - -export class DecreaseAllowanceCall__Inputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get subtractedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseAllowanceCall__Outputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseAllowanceCall extends ethereum.Call { - get inputs(): IncreaseAllowanceCall__Inputs { - return new IncreaseAllowanceCall__Inputs(this); - } - - get outputs(): IncreaseAllowanceCall__Outputs { - return new IncreaseAllowanceCall__Outputs(this); - } -} - -export class IncreaseAllowanceCall__Inputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get addedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseAllowanceCall__Outputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _stakingContract(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class RebaseCall extends ethereum.Call { - get inputs(): RebaseCall__Inputs { - return new RebaseCall__Inputs(this); - } - - get outputs(): RebaseCall__Outputs { - return new RebaseCall__Outputs(this); - } -} - -export class RebaseCall__Inputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } - - get profit_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get epoch_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class RebaseCall__Outputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class SetIndexCall extends ethereum.Call { - get inputs(): SetIndexCall__Inputs { - return new SetIndexCall__Inputs(this); - } - - get outputs(): SetIndexCall__Outputs { - return new SetIndexCall__Outputs(this); - } -} - -export class SetIndexCall__Inputs { - _call: SetIndexCall; - - constructor(call: SetIndexCall) { - this._call = call; - } - - get _index(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetIndexCall__Outputs { - _call: SetIndexCall; - - constructor(call: SetIndexCall) { - this._call = call; - } -} - -export class SetgOHMCall extends ethereum.Call { - get inputs(): SetgOHMCall__Inputs { - return new SetgOHMCall__Inputs(this); - } - - get outputs(): SetgOHMCall__Outputs { - return new SetgOHMCall__Outputs(this); - } -} - -export class SetgOHMCall__Inputs { - _call: SetgOHMCall; - - constructor(call: SetgOHMCall) { - this._call = call; - } - - get _gOHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetgOHMCall__Outputs { - _call: SetgOHMCall; - - constructor(call: SetgOHMCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V1/BalancerPoolToken.ts b/subgraphs/ethereum/generated/sOlympusERC20V1/BalancerPoolToken.ts deleted file mode 100644 index e1efa45b..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V1/BalancerPoolToken.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class SwapFeePercentageChanged extends ethereum.Event { - get params(): SwapFeePercentageChanged__Params { - return new SwapFeePercentageChanged__Params(this); - } -} - -export class SwapFeePercentageChanged__Params { - _event: SwapFeePercentageChanged; - - constructor(event: SwapFeePercentageChanged) { - this._event = event; - } - - get swapFeePercentage(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BalancerPoolToken__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerPoolToken__onExitPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onJoinPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onSwapInputRequestStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get tokenIn(): Address { - return this[1].toAddress(); - } - - get tokenOut(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get poolId(): Bytes { - return this[4].toBytes(); - } - - get lastChangeBlock(): BigInt { - return this[5].toBigInt(); - } - - get from(): Address { - return this[6].toAddress(); - } - - get to(): Address { - return this[7].toAddress(); - } - - get userData(): Bytes { - return this[8].toBytes(); - } -} - -export class BalancerPoolToken__queryExitResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptIn(): BigInt { - return this.value0; - } - - getAmountsOut(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__queryJoinResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptOut(): BigInt { - return this.value0; - } - - getAmountsIn(): Array { - return this.value1; - } -} - -export class BalancerPoolToken extends ethereum.SmartContract { - static bind(address: Address): BalancerPoolToken { - return new BalancerPoolToken("BalancerPoolToken", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getInvariant(): BigInt { - const result = super.call("getInvariant", "getInvariant():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getInvariant(): ethereum.CallResult { - const result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getLastInvariant(): BigInt { - const result = super.call( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getLastInvariant(): ethereum.CallResult { - const result = super.tryCall( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getNormalizedWeights(): Array { - const result = super.call( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - - return result[0].toBigIntArray(); - } - - try_getNormalizedWeights(): ethereum.CallResult> { - const result = super.tryCall( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getOwner(): Address { - const result = super.call("getOwner", "getOwner():(address)", []); - - return result[0].toAddress(); - } - - try_getOwner(): ethereum.CallResult
{ - const result = super.tryCall("getOwner", "getOwner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getPausedState(): BalancerPoolToken__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerPoolToken__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerPoolToken__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPoolId(): Bytes { - const result = super.call("getPoolId", "getPoolId():(bytes32)", []); - - return result[0].toBytes(); - } - - try_getPoolId(): ethereum.CallResult { - const result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getRate(): BigInt { - const result = super.call("getRate", "getRate():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getRate(): ethereum.CallResult { - const result = super.tryCall("getRate", "getRate():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getSwapFeePercentage(): BigInt { - const result = super.call( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getSwapFeePercentage(): ethereum.CallResult { - const result = super.tryCall( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getVault(): Address { - const result = super.call("getVault", "getVault():(address)", []); - - return result[0].toAddress(); - } - - try_getVault(): ethereum.CallResult
{ - const result = super.tryCall("getVault", "getVault():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - increaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onExitPoolResult { - const result = super.call( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onExitPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onExitPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onJoinPoolResult { - const result = super.call( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onJoinPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onJoinPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): BigInt { - const result = super.call( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - - return result[0].toBigInt(); - } - - try_onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryExitResult { - const result = super.call( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryExitResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryExitResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryJoinResult { - const result = super.call( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryJoinResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryJoinResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get vault(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get name(): string { - return this._call.inputValues[1].value.toString(); - } - - get symbol(): string { - return this._call.inputValues[2].value.toString(); - } - - get tokens(): Array
{ - return this._call.inputValues[3].value.toAddressArray(); - } - - get normalizedWeights(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[7].value.toBigInt(); - } - - get owner(): Address { - return this._call.inputValues[8].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DecreaseApprovalCall extends ethereum.Call { - get inputs(): DecreaseApprovalCall__Inputs { - return new DecreaseApprovalCall__Inputs(this); - } - - get outputs(): DecreaseApprovalCall__Outputs { - return new DecreaseApprovalCall__Outputs(this); - } -} - -export class DecreaseApprovalCall__Inputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseApprovalCall__Outputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseApprovalCall extends ethereum.Call { - get inputs(): IncreaseApprovalCall__Inputs { - return new IncreaseApprovalCall__Inputs(this); - } - - get outputs(): IncreaseApprovalCall__Outputs { - return new IncreaseApprovalCall__Outputs(this); - } -} - -export class IncreaseApprovalCall__Inputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseApprovalCall__Outputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class OnExitPoolCall extends ethereum.Call { - get inputs(): OnExitPoolCall__Inputs { - return new OnExitPoolCall__Inputs(this); - } - - get outputs(): OnExitPoolCall__Outputs { - return new OnExitPoolCall__Outputs(this); - } -} - -export class OnExitPoolCall__Inputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnExitPoolCall__Outputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class OnJoinPoolCall extends ethereum.Call { - get inputs(): OnJoinPoolCall__Inputs { - return new OnJoinPoolCall__Inputs(this); - } - - get outputs(): OnJoinPoolCall__Outputs { - return new OnJoinPoolCall__Outputs(this); - } -} - -export class OnJoinPoolCall__Inputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnJoinPoolCall__Outputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class QueryExitCall extends ethereum.Call { - get inputs(): QueryExitCall__Inputs { - return new QueryExitCall__Inputs(this); - } - - get outputs(): QueryExitCall__Outputs { - return new QueryExitCall__Outputs(this); - } -} - -export class QueryExitCall__Inputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryExitCall__Outputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get bptIn(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsOut(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class QueryJoinCall extends ethereum.Call { - get inputs(): QueryJoinCall__Inputs { - return new QueryJoinCall__Inputs(this); - } - - get outputs(): QueryJoinCall__Outputs { - return new QueryJoinCall__Outputs(this); - } -} - -export class QueryJoinCall__Inputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryJoinCall__Outputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get bptOut(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsIn(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetSwapFeePercentageCall extends ethereum.Call { - get inputs(): SetSwapFeePercentageCall__Inputs { - return new SetSwapFeePercentageCall__Inputs(this); - } - - get outputs(): SetSwapFeePercentageCall__Outputs { - return new SetSwapFeePercentageCall__Outputs(this); - } -} - -export class SetSwapFeePercentageCall__Inputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetSwapFeePercentageCall__Outputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V1/BalancerVault.ts b/subgraphs/ethereum/generated/sOlympusERC20V1/BalancerVault.ts deleted file mode 100644 index 41f94648..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V1/BalancerVault.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class AuthorizerChanged extends ethereum.Event { - get params(): AuthorizerChanged__Params { - return new AuthorizerChanged__Params(this); - } -} - -export class AuthorizerChanged__Params { - _event: AuthorizerChanged; - - constructor(event: AuthorizerChanged) { - this._event = event; - } - - get newAuthorizer(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class ExternalBalanceTransfer extends ethereum.Event { - get params(): ExternalBalanceTransfer__Params { - return new ExternalBalanceTransfer__Params(this); - } -} - -export class ExternalBalanceTransfer__Params { - _event: ExternalBalanceTransfer; - - constructor(event: ExternalBalanceTransfer) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get recipient(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class FlashLoan extends ethereum.Event { - get params(): FlashLoan__Params { - return new FlashLoan__Params(this); - } -} - -export class FlashLoan__Params { - _event: FlashLoan; - - constructor(event: FlashLoan) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get feeAmount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class InternalBalanceChanged extends ethereum.Event { - get params(): InternalBalanceChanged__Params { - return new InternalBalanceChanged__Params(this); - } -} - -export class InternalBalanceChanged__Params { - _event: InternalBalanceChanged; - - constructor(event: InternalBalanceChanged) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get delta(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class PoolBalanceChanged extends ethereum.Event { - get params(): PoolBalanceChanged__Params { - return new PoolBalanceChanged__Params(this); - } -} - -export class PoolBalanceChanged__Params { - _event: PoolBalanceChanged; - - constructor(event: PoolBalanceChanged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get liquidityProvider(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokens(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } - - get deltas(): Array { - return this._event.parameters[3].value.toBigIntArray(); - } - - get protocolFeeAmounts(): Array { - return this._event.parameters[4].value.toBigIntArray(); - } -} - -export class PoolBalanceManaged extends ethereum.Event { - get params(): PoolBalanceManaged__Params { - return new PoolBalanceManaged__Params(this); - } -} - -export class PoolBalanceManaged__Params { - _event: PoolBalanceManaged; - - constructor(event: PoolBalanceManaged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get assetManager(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get cashDelta(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get managedDelta(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class PoolRegistered extends ethereum.Event { - get params(): PoolRegistered__Params { - return new PoolRegistered__Params(this); - } -} - -export class PoolRegistered__Params { - _event: PoolRegistered; - - constructor(event: PoolRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get poolAddress(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get specialization(): i32 { - return this._event.parameters[2].value.toI32(); - } -} - -export class RelayerApprovalChanged extends ethereum.Event { - get params(): RelayerApprovalChanged__Params { - return new RelayerApprovalChanged__Params(this); - } -} - -export class RelayerApprovalChanged__Params { - _event: RelayerApprovalChanged; - - constructor(event: RelayerApprovalChanged) { - this._event = event; - } - - get relayer(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get approved(): boolean { - return this._event.parameters[2].value.toBoolean(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokenIn(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokenOut(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amountIn(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amountOut(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class TokensDeregistered extends ethereum.Event { - get params(): TokensDeregistered__Params { - return new TokensDeregistered__Params(this); - } -} - -export class TokensDeregistered__Params { - _event: TokensDeregistered; - - constructor(event: TokensDeregistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } -} - -export class TokensRegistered extends ethereum.Event { - get params(): TokensRegistered__Params { - return new TokensRegistered__Params(this); - } -} - -export class TokensRegistered__Params { - _event: TokensRegistered; - - constructor(event: TokensRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } -} - -export class BalancerVault__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerVault__getPoolResult { - value0: Address; - value1: i32; - - constructor(value0: Address, value1: i32) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddress(this.value0)); - map.set( - "value1", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) - ); - return map; - } - - getValue0(): Address { - return this.value0; - } - - getValue1(): i32 { - return this.value1; - } -} - -export class BalancerVault__getPoolTokenInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: Address; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: Address) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromAddress(this.value3)); - return map; - } - - getCash(): BigInt { - return this.value0; - } - - getManaged(): BigInt { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } - - getAssetManager(): Address { - return this.value3; - } -} - -export class BalancerVault__getPoolTokensResult { - value0: Array
; - value1: Array; - value2: BigInt; - - constructor(value0: Array
, value1: Array, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddressArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getTokens(): Array
{ - return this.value0; - } - - getBalances(): Array { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } -} - -export class BalancerVault__queryBatchSwapInputSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BalancerVault__queryBatchSwapInputFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class BalancerVault extends ethereum.SmartContract { - static bind(address: Address): BalancerVault { - return new BalancerVault("BalancerVault", address); - } - - WETH(): Address { - const result = super.call("WETH", "WETH():(address)", []); - - return result[0].toAddress(); - } - - try_WETH(): ethereum.CallResult
{ - const result = super.tryCall("WETH", "WETH():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getDomainSeparator(): Bytes { - const result = super.call( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_getDomainSeparator(): ethereum.CallResult { - const result = super.tryCall( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getInternalBalance(user: Address, tokens: Array
): Array { - const result = super.call( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - - return result[0].toBigIntArray(); - } - - try_getInternalBalance( - user: Address, - tokens: Array
- ): ethereum.CallResult> { - const result = super.tryCall( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getNextNonce(user: Address): BigInt { - const result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ - ethereum.Value.fromAddress(user) - ]); - - return result[0].toBigInt(); - } - - try_getNextNonce(user: Address): ethereum.CallResult { - const result = super.tryCall( - "getNextNonce", - "getNextNonce(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getPausedState(): BalancerVault__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerVault__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerVault__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPool(poolId: Bytes): BalancerVault__getPoolResult { - const result = super.call("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - - return new BalancerVault__getPoolResult( - result[0].toAddress(), - result[1].toI32() - ); - } - - try_getPool( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolResult(value[0].toAddress(), value[1].toI32()) - ); - } - - getPoolTokenInfo( - poolId: Bytes, - token: Address - ): BalancerVault__getPoolTokenInfoResult { - const result = super.call( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - - return new BalancerVault__getPoolTokenInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toAddress() - ); - } - - try_getPoolTokenInfo( - poolId: Bytes, - token: Address - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokenInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toAddress() - ) - ); - } - - getPoolTokens(poolId: Bytes): BalancerVault__getPoolTokensResult { - const result = super.call( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - - return new BalancerVault__getPoolTokensResult( - result[0].toAddressArray(), - result[1].toBigIntArray(), - result[2].toBigInt() - ); - } - - try_getPoolTokens( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokensResult( - value[0].toAddressArray(), - value[1].toBigIntArray(), - value[2].toBigInt() - ) - ); - } - - getProtocolFeesCollector(): Address { - const result = super.call( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_getProtocolFeesCollector(): ethereum.CallResult
{ - const result = super.tryCall( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - hasApprovedRelayer(user: Address, relayer: Address): boolean { - const result = super.call( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - - return result[0].toBoolean(); - } - - try_hasApprovedRelayer( - user: Address, - relayer: Address - ): ethereum.CallResult { - const result = super.tryCall( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): Array { - const result = super.call( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - - return result[0].toBigIntArray(); - } - - try_queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): ethereum.CallResult> { - const result = super.tryCall( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - registerPool(specialization: i32): Bytes { - const result = super.call("registerPool", "registerPool(uint8):(bytes32)", [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization)) - ]); - - return result[0].toBytes(); - } - - try_registerPool(specialization: i32): ethereum.CallResult { - const result = super.tryCall( - "registerPool", - "registerPool(uint8):(bytes32)", - [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization))] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get authorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get weth(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class BatchSwapCall extends ethereum.Call { - get inputs(): BatchSwapCall__Inputs { - return new BatchSwapCall__Inputs(this); - } - - get outputs(): BatchSwapCall__Outputs { - return new BatchSwapCall__Outputs(this); - } -} - -export class BatchSwapCall__Inputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - BatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): BatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } - - get limits(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get deadline(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } -} - -export class BatchSwapCall__Outputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get assetDeltas(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class BatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class DeregisterTokensCall extends ethereum.Call { - get inputs(): DeregisterTokensCall__Inputs { - return new DeregisterTokensCall__Inputs(this); - } - - get outputs(): DeregisterTokensCall__Outputs { - return new DeregisterTokensCall__Outputs(this); - } -} - -export class DeregisterTokensCall__Inputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } -} - -export class DeregisterTokensCall__Outputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } -} - -export class ExitPoolCall extends ethereum.Call { - get inputs(): ExitPoolCall__Inputs { - return new ExitPoolCall__Inputs(this); - } - - get outputs(): ExitPoolCall__Outputs { - return new ExitPoolCall__Outputs(this); - } -} - -export class ExitPoolCall__Inputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): ExitPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class ExitPoolCall__Outputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } -} - -export class ExitPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get minAmountsOut(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class FlashLoanCall extends ethereum.Call { - get inputs(): FlashLoanCall__Inputs { - return new FlashLoanCall__Inputs(this); - } - - get outputs(): FlashLoanCall__Outputs { - return new FlashLoanCall__Outputs(this); - } -} - -export class FlashLoanCall__Inputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get amounts(): Array { - return this._call.inputValues[2].value.toBigIntArray(); - } - - get userData(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class FlashLoanCall__Outputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } -} - -export class JoinPoolCall extends ethereum.Call { - get inputs(): JoinPoolCall__Inputs { - return new JoinPoolCall__Inputs(this); - } - - get outputs(): JoinPoolCall__Outputs { - return new JoinPoolCall__Outputs(this); - } -} - -export class JoinPoolCall__Inputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): JoinPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class JoinPoolCall__Outputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } -} - -export class JoinPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get maxAmountsIn(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get fromInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class ManagePoolBalanceCall extends ethereum.Call { - get inputs(): ManagePoolBalanceCall__Inputs { - return new ManagePoolBalanceCall__Inputs(this); - } - - get outputs(): ManagePoolBalanceCall__Outputs { - return new ManagePoolBalanceCall__Outputs(this); - } -} - -export class ManagePoolBalanceCall__Inputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManagePoolBalanceCallOpsStruct - >(); - } -} - -export class ManagePoolBalanceCall__Outputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } -} - -export class ManagePoolBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get poolId(): Bytes { - return this[1].toBytes(); - } - - get token(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } -} - -export class ManageUserBalanceCall extends ethereum.Call { - get inputs(): ManageUserBalanceCall__Inputs { - return new ManageUserBalanceCall__Inputs(this); - } - - get outputs(): ManageUserBalanceCall__Outputs { - return new ManageUserBalanceCall__Outputs(this); - } -} - -export class ManageUserBalanceCall__Inputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManageUserBalanceCallOpsStruct - >(); - } -} - -export class ManageUserBalanceCall__Outputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } -} - -export class ManageUserBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get asset(): Address { - return this[1].toAddress(); - } - - get amount(): BigInt { - return this[2].toBigInt(); - } - - get sender(): Address { - return this[3].toAddress(); - } - - get recipient(): Address { - return this[4].toAddress(); - } -} - -export class QueryBatchSwapCall extends ethereum.Call { - get inputs(): QueryBatchSwapCall__Inputs { - return new QueryBatchSwapCall__Inputs(this); - } - - get outputs(): QueryBatchSwapCall__Outputs { - return new QueryBatchSwapCall__Outputs(this); - } -} - -export class QueryBatchSwapCall__Inputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - QueryBatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): QueryBatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class QueryBatchSwapCall__Outputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class QueryBatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class QueryBatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class RegisterPoolCall extends ethereum.Call { - get inputs(): RegisterPoolCall__Inputs { - return new RegisterPoolCall__Inputs(this); - } - - get outputs(): RegisterPoolCall__Outputs { - return new RegisterPoolCall__Outputs(this); - } -} - -export class RegisterPoolCall__Inputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get specialization(): i32 { - return this._call.inputValues[0].value.toI32(); - } -} - -export class RegisterPoolCall__Outputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get value0(): Bytes { - return this._call.outputValues[0].value.toBytes(); - } -} - -export class RegisterTokensCall extends ethereum.Call { - get inputs(): RegisterTokensCall__Inputs { - return new RegisterTokensCall__Inputs(this); - } - - get outputs(): RegisterTokensCall__Outputs { - return new RegisterTokensCall__Outputs(this); - } -} - -export class RegisterTokensCall__Inputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } -} - -export class RegisterTokensCall__Outputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } -} - -export class SetAuthorizerCall extends ethereum.Call { - get inputs(): SetAuthorizerCall__Inputs { - return new SetAuthorizerCall__Inputs(this); - } - - get outputs(): SetAuthorizerCall__Outputs { - return new SetAuthorizerCall__Outputs(this); - } -} - -export class SetAuthorizerCall__Inputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } - - get newAuthorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetAuthorizerCall__Outputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetRelayerApprovalCall extends ethereum.Call { - get inputs(): SetRelayerApprovalCall__Inputs { - return new SetRelayerApprovalCall__Inputs(this); - } - - get outputs(): SetRelayerApprovalCall__Outputs { - return new SetRelayerApprovalCall__Outputs(this); - } -} - -export class SetRelayerApprovalCall__Inputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get relayer(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get approved(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } -} - -export class SetRelayerApprovalCall__Outputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get singleSwap(): SwapCallSingleSwapStruct { - return changetype( - this._call.inputValues[0].value.toTuple() - ); - } - - get funds(): SwapCallFundsStruct { - return changetype( - this._call.inputValues[1].value.toTuple() - ); - } - - get limit(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amountCalculated(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class SwapCallSingleSwapStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get kind(): i32 { - return this[1].toI32(); - } - - get assetIn(): Address { - return this[2].toAddress(); - } - - get assetOut(): Address { - return this[3].toAddress(); - } - - get amount(): BigInt { - return this[4].toBigInt(); - } - - get userData(): Bytes { - return this[5].toBytes(); - } -} - -export class SwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V1/ERC20.ts b/subgraphs/ethereum/generated/sOlympusERC20V1/ERC20.ts deleted file mode 100644 index bbe93783..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V1/ERC20.ts +++ /dev/null @@ -1,394 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ERC20 extends ethereum.SmartContract { - static bind(address: Address): ERC20 { - return new ERC20("ERC20", address); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - approve(_spender: Address, _value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_approve(_spender: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transferFrom(_from: Address, _to: Address, _value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - _from: Address, - _to: Address, - _value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - balanceOf(_owner: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(_owner: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - transfer(_to: Address, _value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(_to: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - allowance(_owner: Address, _spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - _owner: Address, - _spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get _spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get _from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DefaultCall extends ethereum.Call { - get inputs(): DefaultCall__Inputs { - return new DefaultCall__Inputs(this); - } - - get outputs(): DefaultCall__Outputs { - return new DefaultCall__Outputs(this); - } -} - -export class DefaultCall__Inputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} - -export class DefaultCall__Outputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V1/OlympusERC20.ts b/subgraphs/ethereum/generated/sOlympusERC20V1/OlympusERC20.ts deleted file mode 100644 index d544f05c..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V1/OlympusERC20.ts +++ /dev/null @@ -1,1184 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class TWAPEpochChanged extends ethereum.Event { - get params(): TWAPEpochChanged__Params { - return new TWAPEpochChanged__Params(this); - } -} - -export class TWAPEpochChanged__Params { - _event: TWAPEpochChanged; - - constructor(event: TWAPEpochChanged) { - this._event = event; - } - - get previousTWAPEpochPeriod(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get newTWAPEpochPeriod(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class TWAPOracleChanged extends ethereum.Event { - get params(): TWAPOracleChanged__Params { - return new TWAPOracleChanged__Params(this); - } -} - -export class TWAPOracleChanged__Params { - _event: TWAPOracleChanged; - - constructor(event: TWAPOracleChanged) { - this._event = event; - } - - get previousTWAPOracle(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newTWAPOracle(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class TWAPSourceAdded extends ethereum.Event { - get params(): TWAPSourceAdded__Params { - return new TWAPSourceAdded__Params(this); - } -} - -export class TWAPSourceAdded__Params { - _event: TWAPSourceAdded; - - constructor(event: TWAPSourceAdded) { - this._event = event; - } - - get newTWAPSource(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class TWAPSourceRemoved extends ethereum.Event { - get params(): TWAPSourceRemoved__Params { - return new TWAPSourceRemoved__Params(this); - } -} - -export class TWAPSourceRemoved__Params { - _event: TWAPSourceRemoved; - - constructor(event: TWAPSourceRemoved) { - this._event = event; - } - - get removedTWAPSource(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class OlympusERC20 extends ethereum.SmartContract { - static bind(address: Address): OlympusERC20 { - return new OlympusERC20("OlympusERC20", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { - const result = super.call( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseAllowance( - spender: Address, - subtractedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - increaseAllowance(spender: Address, addedValue: BigInt): boolean { - const result = super.call( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseAllowance( - spender: Address, - addedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - owner(): Address { - const result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - const result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - setVault(vault_: Address): boolean { - const result = super.call("setVault", "setVault(address):(bool)", [ - ethereum.Value.fromAddress(vault_) - ]); - - return result[0].toBoolean(); - } - - try_setVault(vault_: Address): ethereum.CallResult { - const result = super.tryCall("setVault", "setVault(address):(bool)", [ - ethereum.Value.fromAddress(vault_) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - twapEpochPeriod(): BigInt { - const result = super.call( - "twapEpochPeriod", - "twapEpochPeriod():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_twapEpochPeriod(): ethereum.CallResult { - const result = super.tryCall( - "twapEpochPeriod", - "twapEpochPeriod():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - twapOracle(): Address { - const result = super.call("twapOracle", "twapOracle():(address)", []); - - return result[0].toAddress(); - } - - try_twapOracle(): ethereum.CallResult
{ - const result = super.tryCall("twapOracle", "twapOracle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - vault(): Address { - const result = super.call("vault", "vault():(address)", []); - - return result[0].toAddress(); - } - - try_vault(): ethereum.CallResult
{ - const result = super.tryCall("vault", "vault():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class _burnFromCall extends ethereum.Call { - get inputs(): _burnFromCall__Inputs { - return new _burnFromCall__Inputs(this); - } - - get outputs(): _burnFromCall__Outputs { - return new _burnFromCall__Outputs(this); - } -} - -export class _burnFromCall__Inputs { - _call: _burnFromCall; - - constructor(call: _burnFromCall) { - this._call = call; - } - - get account_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class _burnFromCall__Outputs { - _call: _burnFromCall; - - constructor(call: _burnFromCall) { - this._call = call; - } -} - -export class AddTWAPSourceCall extends ethereum.Call { - get inputs(): AddTWAPSourceCall__Inputs { - return new AddTWAPSourceCall__Inputs(this); - } - - get outputs(): AddTWAPSourceCall__Outputs { - return new AddTWAPSourceCall__Outputs(this); - } -} - -export class AddTWAPSourceCall__Inputs { - _call: AddTWAPSourceCall; - - constructor(call: AddTWAPSourceCall) { - this._call = call; - } - - get newTWAPSourceDexPool_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class AddTWAPSourceCall__Outputs { - _call: AddTWAPSourceCall; - - constructor(call: AddTWAPSourceCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class BurnCall extends ethereum.Call { - get inputs(): BurnCall__Inputs { - return new BurnCall__Inputs(this); - } - - get outputs(): BurnCall__Outputs { - return new BurnCall__Outputs(this); - } -} - -export class BurnCall__Inputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class BurnCall__Outputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } -} - -export class BurnFromCall extends ethereum.Call { - get inputs(): BurnFromCall__Inputs { - return new BurnFromCall__Inputs(this); - } - - get outputs(): BurnFromCall__Outputs { - return new BurnFromCall__Outputs(this); - } -} - -export class BurnFromCall__Inputs { - _call: BurnFromCall; - - constructor(call: BurnFromCall) { - this._call = call; - } - - get account_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class BurnFromCall__Outputs { - _call: BurnFromCall; - - constructor(call: BurnFromCall) { - this._call = call; - } -} - -export class ChangeTWAPEpochPeriodCall extends ethereum.Call { - get inputs(): ChangeTWAPEpochPeriodCall__Inputs { - return new ChangeTWAPEpochPeriodCall__Inputs(this); - } - - get outputs(): ChangeTWAPEpochPeriodCall__Outputs { - return new ChangeTWAPEpochPeriodCall__Outputs(this); - } -} - -export class ChangeTWAPEpochPeriodCall__Inputs { - _call: ChangeTWAPEpochPeriodCall; - - constructor(call: ChangeTWAPEpochPeriodCall) { - this._call = call; - } - - get newTWAPEpochPeriod_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class ChangeTWAPEpochPeriodCall__Outputs { - _call: ChangeTWAPEpochPeriodCall; - - constructor(call: ChangeTWAPEpochPeriodCall) { - this._call = call; - } -} - -export class ChangeTWAPOracleCall extends ethereum.Call { - get inputs(): ChangeTWAPOracleCall__Inputs { - return new ChangeTWAPOracleCall__Inputs(this); - } - - get outputs(): ChangeTWAPOracleCall__Outputs { - return new ChangeTWAPOracleCall__Outputs(this); - } -} - -export class ChangeTWAPOracleCall__Inputs { - _call: ChangeTWAPOracleCall; - - constructor(call: ChangeTWAPOracleCall) { - this._call = call; - } - - get newTWAPOracle_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class ChangeTWAPOracleCall__Outputs { - _call: ChangeTWAPOracleCall; - - constructor(call: ChangeTWAPOracleCall) { - this._call = call; - } -} - -export class DecreaseAllowanceCall extends ethereum.Call { - get inputs(): DecreaseAllowanceCall__Inputs { - return new DecreaseAllowanceCall__Inputs(this); - } - - get outputs(): DecreaseAllowanceCall__Outputs { - return new DecreaseAllowanceCall__Outputs(this); - } -} - -export class DecreaseAllowanceCall__Inputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get subtractedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseAllowanceCall__Outputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseAllowanceCall extends ethereum.Call { - get inputs(): IncreaseAllowanceCall__Inputs { - return new IncreaseAllowanceCall__Inputs(this); - } - - get outputs(): IncreaseAllowanceCall__Outputs { - return new IncreaseAllowanceCall__Outputs(this); - } -} - -export class IncreaseAllowanceCall__Inputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get addedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseAllowanceCall__Outputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class MintCall extends ethereum.Call { - get inputs(): MintCall__Inputs { - return new MintCall__Inputs(this); - } - - get outputs(): MintCall__Outputs { - return new MintCall__Outputs(this); - } -} - -export class MintCall__Inputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get account_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class MintCall__Outputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class RemoveTWAPSourceCall extends ethereum.Call { - get inputs(): RemoveTWAPSourceCall__Inputs { - return new RemoveTWAPSourceCall__Inputs(this); - } - - get outputs(): RemoveTWAPSourceCall__Outputs { - return new RemoveTWAPSourceCall__Outputs(this); - } -} - -export class RemoveTWAPSourceCall__Inputs { - _call: RemoveTWAPSourceCall; - - constructor(call: RemoveTWAPSourceCall) { - this._call = call; - } - - get twapSourceToRemove_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RemoveTWAPSourceCall__Outputs { - _call: RemoveTWAPSourceCall; - - constructor(call: RemoveTWAPSourceCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall extends ethereum.Call { - get inputs(): RenounceOwnershipCall__Inputs { - return new RenounceOwnershipCall__Inputs(this); - } - - get outputs(): RenounceOwnershipCall__Outputs { - return new RenounceOwnershipCall__Outputs(this); - } -} - -export class RenounceOwnershipCall__Inputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall__Outputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class SetVaultCall extends ethereum.Call { - get inputs(): SetVaultCall__Inputs { - return new SetVaultCall__Inputs(this); - } - - get outputs(): SetVaultCall__Outputs { - return new SetVaultCall__Outputs(this); - } -} - -export class SetVaultCall__Inputs { - _call: SetVaultCall; - - constructor(call: SetVaultCall) { - this._call = call; - } - - get vault_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetVaultCall__Outputs { - _call: SetVaultCall; - - constructor(call: SetVaultCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V1/OlympusStakingV1.ts b/subgraphs/ethereum/generated/sOlympusERC20V1/OlympusStakingV1.ts deleted file mode 100644 index f1cf85d7..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V1/OlympusStakingV1.ts +++ /dev/null @@ -1,451 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OlympusStakingV1 extends ethereum.SmartContract { - static bind(address: Address): OlympusStakingV1 { - return new OlympusStakingV1("OlympusStakingV1", address); - } - - epochLengthInBlocks(): BigInt { - const result = super.call( - "epochLengthInBlocks", - "epochLengthInBlocks():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_epochLengthInBlocks(): ethereum.CallResult { - const result = super.tryCall( - "epochLengthInBlocks", - "epochLengthInBlocks():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - ohm(): Address { - const result = super.call("ohm", "ohm():(address)", []); - - return result[0].toAddress(); - } - - try_ohm(): ethereum.CallResult
{ - const result = super.tryCall("ohm", "ohm():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - ohmToDistributeNextEpoch(): BigInt { - const result = super.call( - "ohmToDistributeNextEpoch", - "ohmToDistributeNextEpoch():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_ohmToDistributeNextEpoch(): ethereum.CallResult { - const result = super.tryCall( - "ohmToDistributeNextEpoch", - "ohmToDistributeNextEpoch():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - owner(): Address { - const result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - const result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - sOHM(): Address { - const result = super.call("sOHM", "sOHM():(address)", []); - - return result[0].toAddress(); - } - - try_sOHM(): ethereum.CallResult
{ - const result = super.tryCall("sOHM", "sOHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - stakeOHM(amountToStake_: BigInt): boolean { - const result = super.call("stakeOHM", "stakeOHM(uint256):(bool)", [ - ethereum.Value.fromUnsignedBigInt(amountToStake_) - ]); - - return result[0].toBoolean(); - } - - try_stakeOHM(amountToStake_: BigInt): ethereum.CallResult { - const result = super.tryCall("stakeOHM", "stakeOHM(uint256):(bool)", [ - ethereum.Value.fromUnsignedBigInt(amountToStake_) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - unstakeOHM(amountToWithdraw_: BigInt): boolean { - const result = super.call("unstakeOHM", "unstakeOHM(uint256):(bool)", [ - ethereum.Value.fromUnsignedBigInt(amountToWithdraw_) - ]); - - return result[0].toBoolean(); - } - - try_unstakeOHM(amountToWithdraw_: BigInt): ethereum.CallResult { - const result = super.tryCall("unstakeOHM", "unstakeOHM(uint256):(bool)", [ - ethereum.Value.fromUnsignedBigInt(amountToWithdraw_) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get ohmTokenAddress_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get sOHM_(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get epochLengthInBlocks_(): i32 { - return this._call.inputValues[2].value.toI32(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall extends ethereum.Call { - get inputs(): RenounceOwnershipCall__Inputs { - return new RenounceOwnershipCall__Inputs(this); - } - - get outputs(): RenounceOwnershipCall__Outputs { - return new RenounceOwnershipCall__Outputs(this); - } -} - -export class RenounceOwnershipCall__Inputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall__Outputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class SetEpochLengthintBlockCall extends ethereum.Call { - get inputs(): SetEpochLengthintBlockCall__Inputs { - return new SetEpochLengthintBlockCall__Inputs(this); - } - - get outputs(): SetEpochLengthintBlockCall__Outputs { - return new SetEpochLengthintBlockCall__Outputs(this); - } -} - -export class SetEpochLengthintBlockCall__Inputs { - _call: SetEpochLengthintBlockCall; - - constructor(call: SetEpochLengthintBlockCall) { - this._call = call; - } - - get newEpochLengthInBlocks_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetEpochLengthintBlockCall__Outputs { - _call: SetEpochLengthintBlockCall; - - constructor(call: SetEpochLengthintBlockCall) { - this._call = call; - } -} - -export class StakeOHMCall extends ethereum.Call { - get inputs(): StakeOHMCall__Inputs { - return new StakeOHMCall__Inputs(this); - } - - get outputs(): StakeOHMCall__Outputs { - return new StakeOHMCall__Outputs(this); - } -} - -export class StakeOHMCall__Inputs { - _call: StakeOHMCall; - - constructor(call: StakeOHMCall) { - this._call = call; - } - - get amountToStake_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class StakeOHMCall__Outputs { - _call: StakeOHMCall; - - constructor(call: StakeOHMCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class StakeOHMWithPermitCall extends ethereum.Call { - get inputs(): StakeOHMWithPermitCall__Inputs { - return new StakeOHMWithPermitCall__Inputs(this); - } - - get outputs(): StakeOHMWithPermitCall__Outputs { - return new StakeOHMWithPermitCall__Outputs(this); - } -} - -export class StakeOHMWithPermitCall__Inputs { - _call: StakeOHMWithPermitCall; - - constructor(call: StakeOHMWithPermitCall) { - this._call = call; - } - - get amountToStake_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get deadline_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get v_(): i32 { - return this._call.inputValues[2].value.toI32(); - } - - get r_(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } - - get s_(): Bytes { - return this._call.inputValues[4].value.toBytes(); - } -} - -export class StakeOHMWithPermitCall__Outputs { - _call: StakeOHMWithPermitCall; - - constructor(call: StakeOHMWithPermitCall) { - this._call = call; - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} - -export class UnstakeOHMCall extends ethereum.Call { - get inputs(): UnstakeOHMCall__Inputs { - return new UnstakeOHMCall__Inputs(this); - } - - get outputs(): UnstakeOHMCall__Outputs { - return new UnstakeOHMCall__Outputs(this); - } -} - -export class UnstakeOHMCall__Inputs { - _call: UnstakeOHMCall; - - constructor(call: UnstakeOHMCall) { - this._call = call; - } - - get amountToWithdraw_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class UnstakeOHMCall__Outputs { - _call: UnstakeOHMCall; - - constructor(call: UnstakeOHMCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class UnstakeOHMWithPermitCall extends ethereum.Call { - get inputs(): UnstakeOHMWithPermitCall__Inputs { - return new UnstakeOHMWithPermitCall__Inputs(this); - } - - get outputs(): UnstakeOHMWithPermitCall__Outputs { - return new UnstakeOHMWithPermitCall__Outputs(this); - } -} - -export class UnstakeOHMWithPermitCall__Inputs { - _call: UnstakeOHMWithPermitCall; - - constructor(call: UnstakeOHMWithPermitCall) { - this._call = call; - } - - get amountToWithdraw_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get deadline_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get v_(): i32 { - return this._call.inputValues[2].value.toI32(); - } - - get r_(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } - - get s_(): Bytes { - return this._call.inputValues[4].value.toBytes(); - } -} - -export class UnstakeOHMWithPermitCall__Outputs { - _call: UnstakeOHMWithPermitCall; - - constructor(call: UnstakeOHMWithPermitCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V1/UniswapV2Pair.ts b/subgraphs/ethereum/generated/sOlympusERC20V1/UniswapV2Pair.ts deleted file mode 100644 index b36eea33..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V1/UniswapV2Pair.ts +++ /dev/null @@ -1,1092 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Burn extends ethereum.Event { - get params(): Burn__Params { - return new Burn__Params(this); - } -} - -export class Burn__Params { - _event: Burn; - - constructor(event: Burn) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[3].value.toAddress(); - } -} - -export class Mint extends ethereum.Event { - get params(): Mint__Params { - return new Mint__Params(this); - } -} - -export class Mint__Params { - _event: Mint; - - constructor(event: Mint) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0In(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1In(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get amount0Out(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[5].value.toAddress(); - } -} - -export class Sync extends ethereum.Event { - get params(): Sync__Params { - return new Sync__Params(this); - } -} - -export class Sync__Params { - _event: Sync; - - constructor(event: Sync) { - this._event = event; - } - - get reserve0(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get reserve1(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class UniswapV2Pair__burnResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } - - getAmount0(): BigInt { - return this.value0; - } - - getAmount1(): BigInt { - return this.value1; - } -} - -export class UniswapV2Pair__getReservesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - get_reserve0(): BigInt { - return this.value0; - } - - get_reserve1(): BigInt { - return this.value1; - } - - get_blockTimestampLast(): BigInt { - return this.value2; - } -} - -export class UniswapV2Pair extends ethereum.SmartContract { - static bind(address: Address): UniswapV2Pair { - return new UniswapV2Pair("UniswapV2Pair", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - MINIMUM_LIQUIDITY(): BigInt { - const result = super.call( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_MINIMUM_LIQUIDITY(): ethereum.CallResult { - const result = super.tryCall( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(param0: Address, param1: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - - return result[0].toBigInt(); - } - - try_allowance(param0: Address, param1: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(param0: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(param0: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - burn(to: Address): UniswapV2Pair__burnResult { - const result = super.call("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return new UniswapV2Pair__burnResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_burn(to: Address): ethereum.CallResult { - const result = super.tryCall("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__burnResult(value[0].toBigInt(), value[1].toBigInt()) - ); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - factory(): Address { - const result = super.call("factory", "factory():(address)", []); - - return result[0].toAddress(); - } - - try_factory(): ethereum.CallResult
{ - const result = super.tryCall("factory", "factory():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getReserves(): UniswapV2Pair__getReservesResult { - const result = super.call( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - - return new UniswapV2Pair__getReservesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getReserves(): ethereum.CallResult { - const result = super.tryCall( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__getReservesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - kLast(): BigInt { - const result = super.call("kLast", "kLast():(uint256)", []); - - return result[0].toBigInt(); - } - - try_kLast(): ethereum.CallResult { - const result = super.tryCall("kLast", "kLast():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - mint(to: Address): BigInt { - const result = super.call("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return result[0].toBigInt(); - } - - try_mint(to: Address): ethereum.CallResult { - const result = super.tryCall("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(param0: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_nonces(param0: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price0CumulativeLast(): BigInt { - const result = super.call( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price0CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price1CumulativeLast(): BigInt { - const result = super.call( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price1CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - token0(): Address { - const result = super.call("token0", "token0():(address)", []); - - return result[0].toAddress(); - } - - try_token0(): ethereum.CallResult
{ - const result = super.tryCall("token0", "token0():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - token1(): Address { - const result = super.call("token1", "token1():(address)", []); - - return result[0].toAddress(); - } - - try_token1(): ethereum.CallResult
{ - const result = super.tryCall("token1", "token1():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class BurnCall extends ethereum.Call { - get inputs(): BurnCall__Inputs { - return new BurnCall__Inputs(this); - } - - get outputs(): BurnCall__Outputs { - return new BurnCall__Outputs(this); - } -} - -export class BurnCall__Inputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class BurnCall__Outputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get amount0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amount1(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _token0(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _token1(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class MintCall extends ethereum.Call { - get inputs(): MintCall__Inputs { - return new MintCall__Inputs(this); - } - - get outputs(): MintCall__Outputs { - return new MintCall__Outputs(this); - } -} - -export class MintCall__Inputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class MintCall__Outputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get liquidity(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class SkimCall extends ethereum.Call { - get inputs(): SkimCall__Inputs { - return new SkimCall__Inputs(this); - } - - get outputs(): SkimCall__Outputs { - return new SkimCall__Outputs(this); - } -} - -export class SkimCall__Inputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SkimCall__Outputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amount0Out(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get to(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get data(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } -} - -export class SyncCall extends ethereum.Call { - get inputs(): SyncCall__Inputs { - return new SyncCall__Inputs(this); - } - - get outputs(): SyncCall__Outputs { - return new SyncCall__Outputs(this); - } -} - -export class SyncCall__Inputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class SyncCall__Outputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V1/sOlympusERC20.ts b/subgraphs/ethereum/generated/sOlympusERC20V1/sOlympusERC20.ts deleted file mode 100644 index de3202f6..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V1/sOlympusERC20.ts +++ /dev/null @@ -1,964 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class LogMonetaryPolicyUpdated extends ethereum.Event { - get params(): LogMonetaryPolicyUpdated__Params { - return new LogMonetaryPolicyUpdated__Params(this); - } -} - -export class LogMonetaryPolicyUpdated__Params { - _event: LogMonetaryPolicyUpdated; - - constructor(event: LogMonetaryPolicyUpdated) { - this._event = event; - } - - get monetaryPolicy(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class LogRebase extends ethereum.Event { - get params(): LogRebase__Params { - return new LogRebase__Params(this); - } -} - -export class LogRebase__Params { - _event: LogRebase; - - constructor(event: LogRebase) { - this._event = event; - } - - get epoch(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get totalSupply(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class sOlympusERC20 extends ethereum.SmartContract { - static bind(address: Address): sOlympusERC20 { - return new sOlympusERC20("sOlympusERC20", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner_: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner_), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - owner_: Address, - spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner_), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(who: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(who) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(who: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(who) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - circulatingSupply(): BigInt { - const result = super.call( - "circulatingSupply", - "circulatingSupply():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_circulatingSupply(): ethereum.CallResult { - const result = super.tryCall( - "circulatingSupply", - "circulatingSupply():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { - const result = super.call( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseAllowance( - spender: Address, - subtractedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - increaseAllowance(spender: Address, addedValue: BigInt): boolean { - const result = super.call( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseAllowance( - spender: Address, - addedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - monetaryPolicy(): Address { - const result = super.call("monetaryPolicy", "monetaryPolicy():(address)", []); - - return result[0].toAddress(); - } - - try_monetaryPolicy(): ethereum.CallResult
{ - const result = super.tryCall( - "monetaryPolicy", - "monetaryPolicy():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - owner(): Address { - const result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - const result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - rebase(olyProfit: BigInt): BigInt { - const result = super.call("rebase", "rebase(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(olyProfit) - ]); - - return result[0].toBigInt(); - } - - try_rebase(olyProfit: BigInt): ethereum.CallResult { - const result = super.tryCall("rebase", "rebase(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(olyProfit) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - stakingContract(): Address { - const result = super.call( - "stakingContract", - "stakingContract():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_stakingContract(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingContract", - "stakingContract():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DecreaseAllowanceCall extends ethereum.Call { - get inputs(): DecreaseAllowanceCall__Inputs { - return new DecreaseAllowanceCall__Inputs(this); - } - - get outputs(): DecreaseAllowanceCall__Outputs { - return new DecreaseAllowanceCall__Outputs(this); - } -} - -export class DecreaseAllowanceCall__Inputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get subtractedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseAllowanceCall__Outputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseAllowanceCall extends ethereum.Call { - get inputs(): IncreaseAllowanceCall__Inputs { - return new IncreaseAllowanceCall__Inputs(this); - } - - get outputs(): IncreaseAllowanceCall__Outputs { - return new IncreaseAllowanceCall__Outputs(this); - } -} - -export class IncreaseAllowanceCall__Inputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get addedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseAllowanceCall__Outputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class RebaseCall extends ethereum.Call { - get inputs(): RebaseCall__Inputs { - return new RebaseCall__Inputs(this); - } - - get outputs(): RebaseCall__Outputs { - return new RebaseCall__Outputs(this); - } -} - -export class RebaseCall__Inputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } - - get olyProfit(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class RebaseCall__Outputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceOwnershipCall extends ethereum.Call { - get inputs(): RenounceOwnershipCall__Inputs { - return new RenounceOwnershipCall__Inputs(this); - } - - get outputs(): RenounceOwnershipCall__Outputs { - return new RenounceOwnershipCall__Outputs(this); - } -} - -export class RenounceOwnershipCall__Inputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall__Outputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class SetMonetaryPolicyCall extends ethereum.Call { - get inputs(): SetMonetaryPolicyCall__Inputs { - return new SetMonetaryPolicyCall__Inputs(this); - } - - get outputs(): SetMonetaryPolicyCall__Outputs { - return new SetMonetaryPolicyCall__Outputs(this); - } -} - -export class SetMonetaryPolicyCall__Inputs { - _call: SetMonetaryPolicyCall; - - constructor(call: SetMonetaryPolicyCall) { - this._call = call; - } - - get monetaryPolicy_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetMonetaryPolicyCall__Outputs { - _call: SetMonetaryPolicyCall; - - constructor(call: SetMonetaryPolicyCall) { - this._call = call; - } -} - -export class SetStakingContractCall extends ethereum.Call { - get inputs(): SetStakingContractCall__Inputs { - return new SetStakingContractCall__Inputs(this); - } - - get outputs(): SetStakingContractCall__Outputs { - return new SetStakingContractCall__Outputs(this); - } -} - -export class SetStakingContractCall__Inputs { - _call: SetStakingContractCall; - - constructor(call: SetStakingContractCall) { - this._call = call; - } - - get newStakingContract_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetStakingContractCall__Outputs { - _call: SetStakingContractCall; - - constructor(call: SetStakingContractCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V2/BalancerPoolToken.ts b/subgraphs/ethereum/generated/sOlympusERC20V2/BalancerPoolToken.ts deleted file mode 100644 index e1efa45b..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V2/BalancerPoolToken.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class SwapFeePercentageChanged extends ethereum.Event { - get params(): SwapFeePercentageChanged__Params { - return new SwapFeePercentageChanged__Params(this); - } -} - -export class SwapFeePercentageChanged__Params { - _event: SwapFeePercentageChanged; - - constructor(event: SwapFeePercentageChanged) { - this._event = event; - } - - get swapFeePercentage(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BalancerPoolToken__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerPoolToken__onExitPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onJoinPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onSwapInputRequestStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get tokenIn(): Address { - return this[1].toAddress(); - } - - get tokenOut(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get poolId(): Bytes { - return this[4].toBytes(); - } - - get lastChangeBlock(): BigInt { - return this[5].toBigInt(); - } - - get from(): Address { - return this[6].toAddress(); - } - - get to(): Address { - return this[7].toAddress(); - } - - get userData(): Bytes { - return this[8].toBytes(); - } -} - -export class BalancerPoolToken__queryExitResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptIn(): BigInt { - return this.value0; - } - - getAmountsOut(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__queryJoinResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptOut(): BigInt { - return this.value0; - } - - getAmountsIn(): Array { - return this.value1; - } -} - -export class BalancerPoolToken extends ethereum.SmartContract { - static bind(address: Address): BalancerPoolToken { - return new BalancerPoolToken("BalancerPoolToken", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getInvariant(): BigInt { - const result = super.call("getInvariant", "getInvariant():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getInvariant(): ethereum.CallResult { - const result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getLastInvariant(): BigInt { - const result = super.call( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getLastInvariant(): ethereum.CallResult { - const result = super.tryCall( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getNormalizedWeights(): Array { - const result = super.call( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - - return result[0].toBigIntArray(); - } - - try_getNormalizedWeights(): ethereum.CallResult> { - const result = super.tryCall( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getOwner(): Address { - const result = super.call("getOwner", "getOwner():(address)", []); - - return result[0].toAddress(); - } - - try_getOwner(): ethereum.CallResult
{ - const result = super.tryCall("getOwner", "getOwner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getPausedState(): BalancerPoolToken__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerPoolToken__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerPoolToken__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPoolId(): Bytes { - const result = super.call("getPoolId", "getPoolId():(bytes32)", []); - - return result[0].toBytes(); - } - - try_getPoolId(): ethereum.CallResult { - const result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getRate(): BigInt { - const result = super.call("getRate", "getRate():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getRate(): ethereum.CallResult { - const result = super.tryCall("getRate", "getRate():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getSwapFeePercentage(): BigInt { - const result = super.call( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getSwapFeePercentage(): ethereum.CallResult { - const result = super.tryCall( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getVault(): Address { - const result = super.call("getVault", "getVault():(address)", []); - - return result[0].toAddress(); - } - - try_getVault(): ethereum.CallResult
{ - const result = super.tryCall("getVault", "getVault():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - increaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onExitPoolResult { - const result = super.call( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onExitPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onExitPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onJoinPoolResult { - const result = super.call( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onJoinPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onJoinPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): BigInt { - const result = super.call( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - - return result[0].toBigInt(); - } - - try_onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryExitResult { - const result = super.call( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryExitResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryExitResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryJoinResult { - const result = super.call( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryJoinResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryJoinResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get vault(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get name(): string { - return this._call.inputValues[1].value.toString(); - } - - get symbol(): string { - return this._call.inputValues[2].value.toString(); - } - - get tokens(): Array
{ - return this._call.inputValues[3].value.toAddressArray(); - } - - get normalizedWeights(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[7].value.toBigInt(); - } - - get owner(): Address { - return this._call.inputValues[8].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DecreaseApprovalCall extends ethereum.Call { - get inputs(): DecreaseApprovalCall__Inputs { - return new DecreaseApprovalCall__Inputs(this); - } - - get outputs(): DecreaseApprovalCall__Outputs { - return new DecreaseApprovalCall__Outputs(this); - } -} - -export class DecreaseApprovalCall__Inputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseApprovalCall__Outputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseApprovalCall extends ethereum.Call { - get inputs(): IncreaseApprovalCall__Inputs { - return new IncreaseApprovalCall__Inputs(this); - } - - get outputs(): IncreaseApprovalCall__Outputs { - return new IncreaseApprovalCall__Outputs(this); - } -} - -export class IncreaseApprovalCall__Inputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseApprovalCall__Outputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class OnExitPoolCall extends ethereum.Call { - get inputs(): OnExitPoolCall__Inputs { - return new OnExitPoolCall__Inputs(this); - } - - get outputs(): OnExitPoolCall__Outputs { - return new OnExitPoolCall__Outputs(this); - } -} - -export class OnExitPoolCall__Inputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnExitPoolCall__Outputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class OnJoinPoolCall extends ethereum.Call { - get inputs(): OnJoinPoolCall__Inputs { - return new OnJoinPoolCall__Inputs(this); - } - - get outputs(): OnJoinPoolCall__Outputs { - return new OnJoinPoolCall__Outputs(this); - } -} - -export class OnJoinPoolCall__Inputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnJoinPoolCall__Outputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class QueryExitCall extends ethereum.Call { - get inputs(): QueryExitCall__Inputs { - return new QueryExitCall__Inputs(this); - } - - get outputs(): QueryExitCall__Outputs { - return new QueryExitCall__Outputs(this); - } -} - -export class QueryExitCall__Inputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryExitCall__Outputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get bptIn(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsOut(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class QueryJoinCall extends ethereum.Call { - get inputs(): QueryJoinCall__Inputs { - return new QueryJoinCall__Inputs(this); - } - - get outputs(): QueryJoinCall__Outputs { - return new QueryJoinCall__Outputs(this); - } -} - -export class QueryJoinCall__Inputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryJoinCall__Outputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get bptOut(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsIn(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetSwapFeePercentageCall extends ethereum.Call { - get inputs(): SetSwapFeePercentageCall__Inputs { - return new SetSwapFeePercentageCall__Inputs(this); - } - - get outputs(): SetSwapFeePercentageCall__Outputs { - return new SetSwapFeePercentageCall__Outputs(this); - } -} - -export class SetSwapFeePercentageCall__Inputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetSwapFeePercentageCall__Outputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V2/BalancerVault.ts b/subgraphs/ethereum/generated/sOlympusERC20V2/BalancerVault.ts deleted file mode 100644 index 41f94648..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V2/BalancerVault.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class AuthorizerChanged extends ethereum.Event { - get params(): AuthorizerChanged__Params { - return new AuthorizerChanged__Params(this); - } -} - -export class AuthorizerChanged__Params { - _event: AuthorizerChanged; - - constructor(event: AuthorizerChanged) { - this._event = event; - } - - get newAuthorizer(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class ExternalBalanceTransfer extends ethereum.Event { - get params(): ExternalBalanceTransfer__Params { - return new ExternalBalanceTransfer__Params(this); - } -} - -export class ExternalBalanceTransfer__Params { - _event: ExternalBalanceTransfer; - - constructor(event: ExternalBalanceTransfer) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get recipient(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class FlashLoan extends ethereum.Event { - get params(): FlashLoan__Params { - return new FlashLoan__Params(this); - } -} - -export class FlashLoan__Params { - _event: FlashLoan; - - constructor(event: FlashLoan) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get feeAmount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class InternalBalanceChanged extends ethereum.Event { - get params(): InternalBalanceChanged__Params { - return new InternalBalanceChanged__Params(this); - } -} - -export class InternalBalanceChanged__Params { - _event: InternalBalanceChanged; - - constructor(event: InternalBalanceChanged) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get delta(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class PoolBalanceChanged extends ethereum.Event { - get params(): PoolBalanceChanged__Params { - return new PoolBalanceChanged__Params(this); - } -} - -export class PoolBalanceChanged__Params { - _event: PoolBalanceChanged; - - constructor(event: PoolBalanceChanged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get liquidityProvider(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokens(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } - - get deltas(): Array { - return this._event.parameters[3].value.toBigIntArray(); - } - - get protocolFeeAmounts(): Array { - return this._event.parameters[4].value.toBigIntArray(); - } -} - -export class PoolBalanceManaged extends ethereum.Event { - get params(): PoolBalanceManaged__Params { - return new PoolBalanceManaged__Params(this); - } -} - -export class PoolBalanceManaged__Params { - _event: PoolBalanceManaged; - - constructor(event: PoolBalanceManaged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get assetManager(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get cashDelta(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get managedDelta(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class PoolRegistered extends ethereum.Event { - get params(): PoolRegistered__Params { - return new PoolRegistered__Params(this); - } -} - -export class PoolRegistered__Params { - _event: PoolRegistered; - - constructor(event: PoolRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get poolAddress(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get specialization(): i32 { - return this._event.parameters[2].value.toI32(); - } -} - -export class RelayerApprovalChanged extends ethereum.Event { - get params(): RelayerApprovalChanged__Params { - return new RelayerApprovalChanged__Params(this); - } -} - -export class RelayerApprovalChanged__Params { - _event: RelayerApprovalChanged; - - constructor(event: RelayerApprovalChanged) { - this._event = event; - } - - get relayer(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get approved(): boolean { - return this._event.parameters[2].value.toBoolean(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokenIn(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokenOut(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amountIn(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amountOut(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class TokensDeregistered extends ethereum.Event { - get params(): TokensDeregistered__Params { - return new TokensDeregistered__Params(this); - } -} - -export class TokensDeregistered__Params { - _event: TokensDeregistered; - - constructor(event: TokensDeregistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } -} - -export class TokensRegistered extends ethereum.Event { - get params(): TokensRegistered__Params { - return new TokensRegistered__Params(this); - } -} - -export class TokensRegistered__Params { - _event: TokensRegistered; - - constructor(event: TokensRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } -} - -export class BalancerVault__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerVault__getPoolResult { - value0: Address; - value1: i32; - - constructor(value0: Address, value1: i32) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddress(this.value0)); - map.set( - "value1", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) - ); - return map; - } - - getValue0(): Address { - return this.value0; - } - - getValue1(): i32 { - return this.value1; - } -} - -export class BalancerVault__getPoolTokenInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: Address; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: Address) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromAddress(this.value3)); - return map; - } - - getCash(): BigInt { - return this.value0; - } - - getManaged(): BigInt { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } - - getAssetManager(): Address { - return this.value3; - } -} - -export class BalancerVault__getPoolTokensResult { - value0: Array
; - value1: Array; - value2: BigInt; - - constructor(value0: Array
, value1: Array, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddressArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getTokens(): Array
{ - return this.value0; - } - - getBalances(): Array { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } -} - -export class BalancerVault__queryBatchSwapInputSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BalancerVault__queryBatchSwapInputFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class BalancerVault extends ethereum.SmartContract { - static bind(address: Address): BalancerVault { - return new BalancerVault("BalancerVault", address); - } - - WETH(): Address { - const result = super.call("WETH", "WETH():(address)", []); - - return result[0].toAddress(); - } - - try_WETH(): ethereum.CallResult
{ - const result = super.tryCall("WETH", "WETH():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getDomainSeparator(): Bytes { - const result = super.call( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_getDomainSeparator(): ethereum.CallResult { - const result = super.tryCall( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getInternalBalance(user: Address, tokens: Array
): Array { - const result = super.call( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - - return result[0].toBigIntArray(); - } - - try_getInternalBalance( - user: Address, - tokens: Array
- ): ethereum.CallResult> { - const result = super.tryCall( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getNextNonce(user: Address): BigInt { - const result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ - ethereum.Value.fromAddress(user) - ]); - - return result[0].toBigInt(); - } - - try_getNextNonce(user: Address): ethereum.CallResult { - const result = super.tryCall( - "getNextNonce", - "getNextNonce(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getPausedState(): BalancerVault__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerVault__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerVault__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPool(poolId: Bytes): BalancerVault__getPoolResult { - const result = super.call("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - - return new BalancerVault__getPoolResult( - result[0].toAddress(), - result[1].toI32() - ); - } - - try_getPool( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolResult(value[0].toAddress(), value[1].toI32()) - ); - } - - getPoolTokenInfo( - poolId: Bytes, - token: Address - ): BalancerVault__getPoolTokenInfoResult { - const result = super.call( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - - return new BalancerVault__getPoolTokenInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toAddress() - ); - } - - try_getPoolTokenInfo( - poolId: Bytes, - token: Address - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokenInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toAddress() - ) - ); - } - - getPoolTokens(poolId: Bytes): BalancerVault__getPoolTokensResult { - const result = super.call( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - - return new BalancerVault__getPoolTokensResult( - result[0].toAddressArray(), - result[1].toBigIntArray(), - result[2].toBigInt() - ); - } - - try_getPoolTokens( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokensResult( - value[0].toAddressArray(), - value[1].toBigIntArray(), - value[2].toBigInt() - ) - ); - } - - getProtocolFeesCollector(): Address { - const result = super.call( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_getProtocolFeesCollector(): ethereum.CallResult
{ - const result = super.tryCall( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - hasApprovedRelayer(user: Address, relayer: Address): boolean { - const result = super.call( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - - return result[0].toBoolean(); - } - - try_hasApprovedRelayer( - user: Address, - relayer: Address - ): ethereum.CallResult { - const result = super.tryCall( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): Array { - const result = super.call( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - - return result[0].toBigIntArray(); - } - - try_queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): ethereum.CallResult> { - const result = super.tryCall( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - registerPool(specialization: i32): Bytes { - const result = super.call("registerPool", "registerPool(uint8):(bytes32)", [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization)) - ]); - - return result[0].toBytes(); - } - - try_registerPool(specialization: i32): ethereum.CallResult { - const result = super.tryCall( - "registerPool", - "registerPool(uint8):(bytes32)", - [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization))] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get authorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get weth(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class BatchSwapCall extends ethereum.Call { - get inputs(): BatchSwapCall__Inputs { - return new BatchSwapCall__Inputs(this); - } - - get outputs(): BatchSwapCall__Outputs { - return new BatchSwapCall__Outputs(this); - } -} - -export class BatchSwapCall__Inputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - BatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): BatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } - - get limits(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get deadline(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } -} - -export class BatchSwapCall__Outputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get assetDeltas(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class BatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class DeregisterTokensCall extends ethereum.Call { - get inputs(): DeregisterTokensCall__Inputs { - return new DeregisterTokensCall__Inputs(this); - } - - get outputs(): DeregisterTokensCall__Outputs { - return new DeregisterTokensCall__Outputs(this); - } -} - -export class DeregisterTokensCall__Inputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } -} - -export class DeregisterTokensCall__Outputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } -} - -export class ExitPoolCall extends ethereum.Call { - get inputs(): ExitPoolCall__Inputs { - return new ExitPoolCall__Inputs(this); - } - - get outputs(): ExitPoolCall__Outputs { - return new ExitPoolCall__Outputs(this); - } -} - -export class ExitPoolCall__Inputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): ExitPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class ExitPoolCall__Outputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } -} - -export class ExitPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get minAmountsOut(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class FlashLoanCall extends ethereum.Call { - get inputs(): FlashLoanCall__Inputs { - return new FlashLoanCall__Inputs(this); - } - - get outputs(): FlashLoanCall__Outputs { - return new FlashLoanCall__Outputs(this); - } -} - -export class FlashLoanCall__Inputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get amounts(): Array { - return this._call.inputValues[2].value.toBigIntArray(); - } - - get userData(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class FlashLoanCall__Outputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } -} - -export class JoinPoolCall extends ethereum.Call { - get inputs(): JoinPoolCall__Inputs { - return new JoinPoolCall__Inputs(this); - } - - get outputs(): JoinPoolCall__Outputs { - return new JoinPoolCall__Outputs(this); - } -} - -export class JoinPoolCall__Inputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): JoinPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class JoinPoolCall__Outputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } -} - -export class JoinPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get maxAmountsIn(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get fromInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class ManagePoolBalanceCall extends ethereum.Call { - get inputs(): ManagePoolBalanceCall__Inputs { - return new ManagePoolBalanceCall__Inputs(this); - } - - get outputs(): ManagePoolBalanceCall__Outputs { - return new ManagePoolBalanceCall__Outputs(this); - } -} - -export class ManagePoolBalanceCall__Inputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManagePoolBalanceCallOpsStruct - >(); - } -} - -export class ManagePoolBalanceCall__Outputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } -} - -export class ManagePoolBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get poolId(): Bytes { - return this[1].toBytes(); - } - - get token(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } -} - -export class ManageUserBalanceCall extends ethereum.Call { - get inputs(): ManageUserBalanceCall__Inputs { - return new ManageUserBalanceCall__Inputs(this); - } - - get outputs(): ManageUserBalanceCall__Outputs { - return new ManageUserBalanceCall__Outputs(this); - } -} - -export class ManageUserBalanceCall__Inputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManageUserBalanceCallOpsStruct - >(); - } -} - -export class ManageUserBalanceCall__Outputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } -} - -export class ManageUserBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get asset(): Address { - return this[1].toAddress(); - } - - get amount(): BigInt { - return this[2].toBigInt(); - } - - get sender(): Address { - return this[3].toAddress(); - } - - get recipient(): Address { - return this[4].toAddress(); - } -} - -export class QueryBatchSwapCall extends ethereum.Call { - get inputs(): QueryBatchSwapCall__Inputs { - return new QueryBatchSwapCall__Inputs(this); - } - - get outputs(): QueryBatchSwapCall__Outputs { - return new QueryBatchSwapCall__Outputs(this); - } -} - -export class QueryBatchSwapCall__Inputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - QueryBatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): QueryBatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class QueryBatchSwapCall__Outputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class QueryBatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class QueryBatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class RegisterPoolCall extends ethereum.Call { - get inputs(): RegisterPoolCall__Inputs { - return new RegisterPoolCall__Inputs(this); - } - - get outputs(): RegisterPoolCall__Outputs { - return new RegisterPoolCall__Outputs(this); - } -} - -export class RegisterPoolCall__Inputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get specialization(): i32 { - return this._call.inputValues[0].value.toI32(); - } -} - -export class RegisterPoolCall__Outputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get value0(): Bytes { - return this._call.outputValues[0].value.toBytes(); - } -} - -export class RegisterTokensCall extends ethereum.Call { - get inputs(): RegisterTokensCall__Inputs { - return new RegisterTokensCall__Inputs(this); - } - - get outputs(): RegisterTokensCall__Outputs { - return new RegisterTokensCall__Outputs(this); - } -} - -export class RegisterTokensCall__Inputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } -} - -export class RegisterTokensCall__Outputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } -} - -export class SetAuthorizerCall extends ethereum.Call { - get inputs(): SetAuthorizerCall__Inputs { - return new SetAuthorizerCall__Inputs(this); - } - - get outputs(): SetAuthorizerCall__Outputs { - return new SetAuthorizerCall__Outputs(this); - } -} - -export class SetAuthorizerCall__Inputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } - - get newAuthorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetAuthorizerCall__Outputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetRelayerApprovalCall extends ethereum.Call { - get inputs(): SetRelayerApprovalCall__Inputs { - return new SetRelayerApprovalCall__Inputs(this); - } - - get outputs(): SetRelayerApprovalCall__Outputs { - return new SetRelayerApprovalCall__Outputs(this); - } -} - -export class SetRelayerApprovalCall__Inputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get relayer(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get approved(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } -} - -export class SetRelayerApprovalCall__Outputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get singleSwap(): SwapCallSingleSwapStruct { - return changetype( - this._call.inputValues[0].value.toTuple() - ); - } - - get funds(): SwapCallFundsStruct { - return changetype( - this._call.inputValues[1].value.toTuple() - ); - } - - get limit(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amountCalculated(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class SwapCallSingleSwapStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get kind(): i32 { - return this[1].toI32(); - } - - get assetIn(): Address { - return this[2].toAddress(); - } - - get assetOut(): Address { - return this[3].toAddress(); - } - - get amount(): BigInt { - return this[4].toBigInt(); - } - - get userData(): Bytes { - return this[5].toBytes(); - } -} - -export class SwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V2/ERC20.ts b/subgraphs/ethereum/generated/sOlympusERC20V2/ERC20.ts deleted file mode 100644 index bbe93783..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V2/ERC20.ts +++ /dev/null @@ -1,394 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ERC20 extends ethereum.SmartContract { - static bind(address: Address): ERC20 { - return new ERC20("ERC20", address); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - approve(_spender: Address, _value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_approve(_spender: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transferFrom(_from: Address, _to: Address, _value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - _from: Address, - _to: Address, - _value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - balanceOf(_owner: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(_owner: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - transfer(_to: Address, _value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(_to: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - allowance(_owner: Address, _spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - _owner: Address, - _spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get _spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get _from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DefaultCall extends ethereum.Call { - get inputs(): DefaultCall__Inputs { - return new DefaultCall__Inputs(this); - } - - get outputs(): DefaultCall__Outputs { - return new DefaultCall__Outputs(this); - } -} - -export class DefaultCall__Inputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} - -export class DefaultCall__Outputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V2/OlympusERC20.ts b/subgraphs/ethereum/generated/sOlympusERC20V2/OlympusERC20.ts deleted file mode 100644 index d544f05c..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V2/OlympusERC20.ts +++ /dev/null @@ -1,1184 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class TWAPEpochChanged extends ethereum.Event { - get params(): TWAPEpochChanged__Params { - return new TWAPEpochChanged__Params(this); - } -} - -export class TWAPEpochChanged__Params { - _event: TWAPEpochChanged; - - constructor(event: TWAPEpochChanged) { - this._event = event; - } - - get previousTWAPEpochPeriod(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get newTWAPEpochPeriod(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class TWAPOracleChanged extends ethereum.Event { - get params(): TWAPOracleChanged__Params { - return new TWAPOracleChanged__Params(this); - } -} - -export class TWAPOracleChanged__Params { - _event: TWAPOracleChanged; - - constructor(event: TWAPOracleChanged) { - this._event = event; - } - - get previousTWAPOracle(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newTWAPOracle(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class TWAPSourceAdded extends ethereum.Event { - get params(): TWAPSourceAdded__Params { - return new TWAPSourceAdded__Params(this); - } -} - -export class TWAPSourceAdded__Params { - _event: TWAPSourceAdded; - - constructor(event: TWAPSourceAdded) { - this._event = event; - } - - get newTWAPSource(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class TWAPSourceRemoved extends ethereum.Event { - get params(): TWAPSourceRemoved__Params { - return new TWAPSourceRemoved__Params(this); - } -} - -export class TWAPSourceRemoved__Params { - _event: TWAPSourceRemoved; - - constructor(event: TWAPSourceRemoved) { - this._event = event; - } - - get removedTWAPSource(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class OlympusERC20 extends ethereum.SmartContract { - static bind(address: Address): OlympusERC20 { - return new OlympusERC20("OlympusERC20", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { - const result = super.call( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseAllowance( - spender: Address, - subtractedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - increaseAllowance(spender: Address, addedValue: BigInt): boolean { - const result = super.call( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseAllowance( - spender: Address, - addedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - owner(): Address { - const result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - const result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - setVault(vault_: Address): boolean { - const result = super.call("setVault", "setVault(address):(bool)", [ - ethereum.Value.fromAddress(vault_) - ]); - - return result[0].toBoolean(); - } - - try_setVault(vault_: Address): ethereum.CallResult { - const result = super.tryCall("setVault", "setVault(address):(bool)", [ - ethereum.Value.fromAddress(vault_) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - twapEpochPeriod(): BigInt { - const result = super.call( - "twapEpochPeriod", - "twapEpochPeriod():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_twapEpochPeriod(): ethereum.CallResult { - const result = super.tryCall( - "twapEpochPeriod", - "twapEpochPeriod():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - twapOracle(): Address { - const result = super.call("twapOracle", "twapOracle():(address)", []); - - return result[0].toAddress(); - } - - try_twapOracle(): ethereum.CallResult
{ - const result = super.tryCall("twapOracle", "twapOracle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - vault(): Address { - const result = super.call("vault", "vault():(address)", []); - - return result[0].toAddress(); - } - - try_vault(): ethereum.CallResult
{ - const result = super.tryCall("vault", "vault():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class _burnFromCall extends ethereum.Call { - get inputs(): _burnFromCall__Inputs { - return new _burnFromCall__Inputs(this); - } - - get outputs(): _burnFromCall__Outputs { - return new _burnFromCall__Outputs(this); - } -} - -export class _burnFromCall__Inputs { - _call: _burnFromCall; - - constructor(call: _burnFromCall) { - this._call = call; - } - - get account_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class _burnFromCall__Outputs { - _call: _burnFromCall; - - constructor(call: _burnFromCall) { - this._call = call; - } -} - -export class AddTWAPSourceCall extends ethereum.Call { - get inputs(): AddTWAPSourceCall__Inputs { - return new AddTWAPSourceCall__Inputs(this); - } - - get outputs(): AddTWAPSourceCall__Outputs { - return new AddTWAPSourceCall__Outputs(this); - } -} - -export class AddTWAPSourceCall__Inputs { - _call: AddTWAPSourceCall; - - constructor(call: AddTWAPSourceCall) { - this._call = call; - } - - get newTWAPSourceDexPool_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class AddTWAPSourceCall__Outputs { - _call: AddTWAPSourceCall; - - constructor(call: AddTWAPSourceCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class BurnCall extends ethereum.Call { - get inputs(): BurnCall__Inputs { - return new BurnCall__Inputs(this); - } - - get outputs(): BurnCall__Outputs { - return new BurnCall__Outputs(this); - } -} - -export class BurnCall__Inputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class BurnCall__Outputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } -} - -export class BurnFromCall extends ethereum.Call { - get inputs(): BurnFromCall__Inputs { - return new BurnFromCall__Inputs(this); - } - - get outputs(): BurnFromCall__Outputs { - return new BurnFromCall__Outputs(this); - } -} - -export class BurnFromCall__Inputs { - _call: BurnFromCall; - - constructor(call: BurnFromCall) { - this._call = call; - } - - get account_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class BurnFromCall__Outputs { - _call: BurnFromCall; - - constructor(call: BurnFromCall) { - this._call = call; - } -} - -export class ChangeTWAPEpochPeriodCall extends ethereum.Call { - get inputs(): ChangeTWAPEpochPeriodCall__Inputs { - return new ChangeTWAPEpochPeriodCall__Inputs(this); - } - - get outputs(): ChangeTWAPEpochPeriodCall__Outputs { - return new ChangeTWAPEpochPeriodCall__Outputs(this); - } -} - -export class ChangeTWAPEpochPeriodCall__Inputs { - _call: ChangeTWAPEpochPeriodCall; - - constructor(call: ChangeTWAPEpochPeriodCall) { - this._call = call; - } - - get newTWAPEpochPeriod_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class ChangeTWAPEpochPeriodCall__Outputs { - _call: ChangeTWAPEpochPeriodCall; - - constructor(call: ChangeTWAPEpochPeriodCall) { - this._call = call; - } -} - -export class ChangeTWAPOracleCall extends ethereum.Call { - get inputs(): ChangeTWAPOracleCall__Inputs { - return new ChangeTWAPOracleCall__Inputs(this); - } - - get outputs(): ChangeTWAPOracleCall__Outputs { - return new ChangeTWAPOracleCall__Outputs(this); - } -} - -export class ChangeTWAPOracleCall__Inputs { - _call: ChangeTWAPOracleCall; - - constructor(call: ChangeTWAPOracleCall) { - this._call = call; - } - - get newTWAPOracle_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class ChangeTWAPOracleCall__Outputs { - _call: ChangeTWAPOracleCall; - - constructor(call: ChangeTWAPOracleCall) { - this._call = call; - } -} - -export class DecreaseAllowanceCall extends ethereum.Call { - get inputs(): DecreaseAllowanceCall__Inputs { - return new DecreaseAllowanceCall__Inputs(this); - } - - get outputs(): DecreaseAllowanceCall__Outputs { - return new DecreaseAllowanceCall__Outputs(this); - } -} - -export class DecreaseAllowanceCall__Inputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get subtractedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseAllowanceCall__Outputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseAllowanceCall extends ethereum.Call { - get inputs(): IncreaseAllowanceCall__Inputs { - return new IncreaseAllowanceCall__Inputs(this); - } - - get outputs(): IncreaseAllowanceCall__Outputs { - return new IncreaseAllowanceCall__Outputs(this); - } -} - -export class IncreaseAllowanceCall__Inputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get addedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseAllowanceCall__Outputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class MintCall extends ethereum.Call { - get inputs(): MintCall__Inputs { - return new MintCall__Inputs(this); - } - - get outputs(): MintCall__Outputs { - return new MintCall__Outputs(this); - } -} - -export class MintCall__Inputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get account_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class MintCall__Outputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class RemoveTWAPSourceCall extends ethereum.Call { - get inputs(): RemoveTWAPSourceCall__Inputs { - return new RemoveTWAPSourceCall__Inputs(this); - } - - get outputs(): RemoveTWAPSourceCall__Outputs { - return new RemoveTWAPSourceCall__Outputs(this); - } -} - -export class RemoveTWAPSourceCall__Inputs { - _call: RemoveTWAPSourceCall; - - constructor(call: RemoveTWAPSourceCall) { - this._call = call; - } - - get twapSourceToRemove_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RemoveTWAPSourceCall__Outputs { - _call: RemoveTWAPSourceCall; - - constructor(call: RemoveTWAPSourceCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall extends ethereum.Call { - get inputs(): RenounceOwnershipCall__Inputs { - return new RenounceOwnershipCall__Inputs(this); - } - - get outputs(): RenounceOwnershipCall__Outputs { - return new RenounceOwnershipCall__Outputs(this); - } -} - -export class RenounceOwnershipCall__Inputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall__Outputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class SetVaultCall extends ethereum.Call { - get inputs(): SetVaultCall__Inputs { - return new SetVaultCall__Inputs(this); - } - - get outputs(): SetVaultCall__Outputs { - return new SetVaultCall__Outputs(this); - } -} - -export class SetVaultCall__Inputs { - _call: SetVaultCall; - - constructor(call: SetVaultCall) { - this._call = call; - } - - get vault_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetVaultCall__Outputs { - _call: SetVaultCall; - - constructor(call: SetVaultCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V2/OlympusStakingV2.ts b/subgraphs/ethereum/generated/sOlympusERC20V2/OlympusStakingV2.ts deleted file mode 100644 index d294fa3b..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V2/OlympusStakingV2.ts +++ /dev/null @@ -1,828 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OlympusStakingV2__epochResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getLength(): BigInt { - return this.value0; - } - - getNumber(): BigInt { - return this.value1; - } - - getEndBlock(): BigInt { - return this.value2; - } - - getDistribute(): BigInt { - return this.value3; - } -} - -export class OlympusStakingV2__warmupInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: boolean; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: boolean) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromBoolean(this.value3)); - return map; - } - - getDeposit(): BigInt { - return this.value0; - } - - getGons(): BigInt { - return this.value1; - } - - getExpiry(): BigInt { - return this.value2; - } - - getLock(): boolean { - return this.value3; - } -} - -export class OlympusStakingV2 extends ethereum.SmartContract { - static bind(address: Address): OlympusStakingV2 { - return new OlympusStakingV2("OlympusStakingV2", address); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - contractBalance(): BigInt { - const result = super.call( - "contractBalance", - "contractBalance():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_contractBalance(): ethereum.CallResult { - const result = super.tryCall( - "contractBalance", - "contractBalance():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - distributor(): Address { - const result = super.call("distributor", "distributor():(address)", []); - - return result[0].toAddress(); - } - - try_distributor(): ethereum.CallResult
{ - const result = super.tryCall("distributor", "distributor():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - epoch(): OlympusStakingV2__epochResult { - const result = super.call( - "epoch", - "epoch():(uint256,uint256,uint256,uint256)", - [] - ); - - return new OlympusStakingV2__epochResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_epoch(): ethereum.CallResult { - const result = super.tryCall( - "epoch", - "epoch():(uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OlympusStakingV2__epochResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - index(): BigInt { - const result = super.call("index", "index():(uint256)", []); - - return result[0].toBigInt(); - } - - try_index(): ethereum.CallResult { - const result = super.tryCall("index", "index():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - locker(): Address { - const result = super.call("locker", "locker():(address)", []); - - return result[0].toAddress(); - } - - try_locker(): ethereum.CallResult
{ - const result = super.tryCall("locker", "locker():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - manager(): Address { - const result = super.call("manager", "manager():(address)", []); - - return result[0].toAddress(); - } - - try_manager(): ethereum.CallResult
{ - const result = super.tryCall("manager", "manager():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - sOHM(): Address { - const result = super.call("sOHM", "sOHM():(address)", []); - - return result[0].toAddress(); - } - - try_sOHM(): ethereum.CallResult
{ - const result = super.tryCall("sOHM", "sOHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - stake(_amount: BigInt, _recipient: Address): boolean { - const result = super.call("stake", "stake(uint256,address):(bool)", [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromAddress(_recipient) - ]); - - return result[0].toBoolean(); - } - - try_stake( - _amount: BigInt, - _recipient: Address - ): ethereum.CallResult { - const result = super.tryCall("stake", "stake(uint256,address):(bool)", [ - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromAddress(_recipient) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalBonus(): BigInt { - const result = super.call("totalBonus", "totalBonus():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalBonus(): ethereum.CallResult { - const result = super.tryCall("totalBonus", "totalBonus():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - warmupContract(): Address { - const result = super.call("warmupContract", "warmupContract():(address)", []); - - return result[0].toAddress(); - } - - try_warmupContract(): ethereum.CallResult
{ - const result = super.tryCall( - "warmupContract", - "warmupContract():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - warmupInfo(param0: Address): OlympusStakingV2__warmupInfoResult { - const result = super.call( - "warmupInfo", - "warmupInfo(address):(uint256,uint256,uint256,bool)", - [ethereum.Value.fromAddress(param0)] - ); - - return new OlympusStakingV2__warmupInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBoolean() - ); - } - - try_warmupInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "warmupInfo", - "warmupInfo(address):(uint256,uint256,uint256,bool)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OlympusStakingV2__warmupInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBoolean() - ) - ); - } - - warmupPeriod(): BigInt { - const result = super.call("warmupPeriod", "warmupPeriod():(uint256)", []); - - return result[0].toBigInt(); - } - - try_warmupPeriod(): ethereum.CallResult { - const result = super.tryCall("warmupPeriod", "warmupPeriod():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _OHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _sOHM(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _epochLength(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _firstEpochNumber(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _firstEpochBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ClaimCall extends ethereum.Call { - get inputs(): ClaimCall__Inputs { - return new ClaimCall__Inputs(this); - } - - get outputs(): ClaimCall__Outputs { - return new ClaimCall__Outputs(this); - } -} - -export class ClaimCall__Inputs { - _call: ClaimCall; - - constructor(call: ClaimCall) { - this._call = call; - } - - get _recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class ClaimCall__Outputs { - _call: ClaimCall; - - constructor(call: ClaimCall) { - this._call = call; - } -} - -export class ForfeitCall extends ethereum.Call { - get inputs(): ForfeitCall__Inputs { - return new ForfeitCall__Inputs(this); - } - - get outputs(): ForfeitCall__Outputs { - return new ForfeitCall__Outputs(this); - } -} - -export class ForfeitCall__Inputs { - _call: ForfeitCall; - - constructor(call: ForfeitCall) { - this._call = call; - } -} - -export class ForfeitCall__Outputs { - _call: ForfeitCall; - - constructor(call: ForfeitCall) { - this._call = call; - } -} - -export class GiveLockBonusCall extends ethereum.Call { - get inputs(): GiveLockBonusCall__Inputs { - return new GiveLockBonusCall__Inputs(this); - } - - get outputs(): GiveLockBonusCall__Outputs { - return new GiveLockBonusCall__Outputs(this); - } -} - -export class GiveLockBonusCall__Inputs { - _call: GiveLockBonusCall; - - constructor(call: GiveLockBonusCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class GiveLockBonusCall__Outputs { - _call: GiveLockBonusCall; - - constructor(call: GiveLockBonusCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RebaseCall extends ethereum.Call { - get inputs(): RebaseCall__Inputs { - return new RebaseCall__Inputs(this); - } - - get outputs(): RebaseCall__Outputs { - return new RebaseCall__Outputs(this); - } -} - -export class RebaseCall__Inputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } -} - -export class RebaseCall__Outputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class ReturnLockBonusCall extends ethereum.Call { - get inputs(): ReturnLockBonusCall__Inputs { - return new ReturnLockBonusCall__Inputs(this); - } - - get outputs(): ReturnLockBonusCall__Outputs { - return new ReturnLockBonusCall__Outputs(this); - } -} - -export class ReturnLockBonusCall__Inputs { - _call: ReturnLockBonusCall; - - constructor(call: ReturnLockBonusCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class ReturnLockBonusCall__Outputs { - _call: ReturnLockBonusCall; - - constructor(call: ReturnLockBonusCall) { - this._call = call; - } -} - -export class SetContractCall extends ethereum.Call { - get inputs(): SetContractCall__Inputs { - return new SetContractCall__Inputs(this); - } - - get outputs(): SetContractCall__Outputs { - return new SetContractCall__Outputs(this); - } -} - -export class SetContractCall__Inputs { - _call: SetContractCall; - - constructor(call: SetContractCall) { - this._call = call; - } - - get _contract(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _address(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class SetContractCall__Outputs { - _call: SetContractCall; - - constructor(call: SetContractCall) { - this._call = call; - } -} - -export class SetWarmupCall extends ethereum.Call { - get inputs(): SetWarmupCall__Inputs { - return new SetWarmupCall__Inputs(this); - } - - get outputs(): SetWarmupCall__Outputs { - return new SetWarmupCall__Outputs(this); - } -} - -export class SetWarmupCall__Inputs { - _call: SetWarmupCall; - - constructor(call: SetWarmupCall) { - this._call = call; - } - - get _warmupPeriod(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetWarmupCall__Outputs { - _call: SetWarmupCall; - - constructor(call: SetWarmupCall) { - this._call = call; - } -} - -export class StakeCall extends ethereum.Call { - get inputs(): StakeCall__Inputs { - return new StakeCall__Inputs(this); - } - - get outputs(): StakeCall__Outputs { - return new StakeCall__Outputs(this); - } -} - -export class StakeCall__Inputs { - _call: StakeCall; - - constructor(call: StakeCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class StakeCall__Outputs { - _call: StakeCall; - - constructor(call: StakeCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class ToggleDepositLockCall extends ethereum.Call { - get inputs(): ToggleDepositLockCall__Inputs { - return new ToggleDepositLockCall__Inputs(this); - } - - get outputs(): ToggleDepositLockCall__Outputs { - return new ToggleDepositLockCall__Outputs(this); - } -} - -export class ToggleDepositLockCall__Inputs { - _call: ToggleDepositLockCall; - - constructor(call: ToggleDepositLockCall) { - this._call = call; - } -} - -export class ToggleDepositLockCall__Outputs { - _call: ToggleDepositLockCall; - - constructor(call: ToggleDepositLockCall) { - this._call = call; - } -} - -export class UnstakeCall extends ethereum.Call { - get inputs(): UnstakeCall__Inputs { - return new UnstakeCall__Inputs(this); - } - - get outputs(): UnstakeCall__Outputs { - return new UnstakeCall__Outputs(this); - } -} - -export class UnstakeCall__Inputs { - _call: UnstakeCall; - - constructor(call: UnstakeCall) { - this._call = call; - } - - get _amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _trigger(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class UnstakeCall__Outputs { - _call: UnstakeCall; - - constructor(call: UnstakeCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V2/UniswapV2Pair.ts b/subgraphs/ethereum/generated/sOlympusERC20V2/UniswapV2Pair.ts deleted file mode 100644 index b36eea33..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V2/UniswapV2Pair.ts +++ /dev/null @@ -1,1092 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Burn extends ethereum.Event { - get params(): Burn__Params { - return new Burn__Params(this); - } -} - -export class Burn__Params { - _event: Burn; - - constructor(event: Burn) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[3].value.toAddress(); - } -} - -export class Mint extends ethereum.Event { - get params(): Mint__Params { - return new Mint__Params(this); - } -} - -export class Mint__Params { - _event: Mint; - - constructor(event: Mint) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0In(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1In(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get amount0Out(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[5].value.toAddress(); - } -} - -export class Sync extends ethereum.Event { - get params(): Sync__Params { - return new Sync__Params(this); - } -} - -export class Sync__Params { - _event: Sync; - - constructor(event: Sync) { - this._event = event; - } - - get reserve0(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get reserve1(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class UniswapV2Pair__burnResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } - - getAmount0(): BigInt { - return this.value0; - } - - getAmount1(): BigInt { - return this.value1; - } -} - -export class UniswapV2Pair__getReservesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - get_reserve0(): BigInt { - return this.value0; - } - - get_reserve1(): BigInt { - return this.value1; - } - - get_blockTimestampLast(): BigInt { - return this.value2; - } -} - -export class UniswapV2Pair extends ethereum.SmartContract { - static bind(address: Address): UniswapV2Pair { - return new UniswapV2Pair("UniswapV2Pair", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - MINIMUM_LIQUIDITY(): BigInt { - const result = super.call( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_MINIMUM_LIQUIDITY(): ethereum.CallResult { - const result = super.tryCall( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(param0: Address, param1: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - - return result[0].toBigInt(); - } - - try_allowance(param0: Address, param1: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(param0: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(param0: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - burn(to: Address): UniswapV2Pair__burnResult { - const result = super.call("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return new UniswapV2Pair__burnResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_burn(to: Address): ethereum.CallResult { - const result = super.tryCall("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__burnResult(value[0].toBigInt(), value[1].toBigInt()) - ); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - factory(): Address { - const result = super.call("factory", "factory():(address)", []); - - return result[0].toAddress(); - } - - try_factory(): ethereum.CallResult
{ - const result = super.tryCall("factory", "factory():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getReserves(): UniswapV2Pair__getReservesResult { - const result = super.call( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - - return new UniswapV2Pair__getReservesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getReserves(): ethereum.CallResult { - const result = super.tryCall( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__getReservesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - kLast(): BigInt { - const result = super.call("kLast", "kLast():(uint256)", []); - - return result[0].toBigInt(); - } - - try_kLast(): ethereum.CallResult { - const result = super.tryCall("kLast", "kLast():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - mint(to: Address): BigInt { - const result = super.call("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return result[0].toBigInt(); - } - - try_mint(to: Address): ethereum.CallResult { - const result = super.tryCall("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(param0: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_nonces(param0: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price0CumulativeLast(): BigInt { - const result = super.call( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price0CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price1CumulativeLast(): BigInt { - const result = super.call( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price1CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - token0(): Address { - const result = super.call("token0", "token0():(address)", []); - - return result[0].toAddress(); - } - - try_token0(): ethereum.CallResult
{ - const result = super.tryCall("token0", "token0():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - token1(): Address { - const result = super.call("token1", "token1():(address)", []); - - return result[0].toAddress(); - } - - try_token1(): ethereum.CallResult
{ - const result = super.tryCall("token1", "token1():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class BurnCall extends ethereum.Call { - get inputs(): BurnCall__Inputs { - return new BurnCall__Inputs(this); - } - - get outputs(): BurnCall__Outputs { - return new BurnCall__Outputs(this); - } -} - -export class BurnCall__Inputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class BurnCall__Outputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get amount0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amount1(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _token0(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _token1(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class MintCall extends ethereum.Call { - get inputs(): MintCall__Inputs { - return new MintCall__Inputs(this); - } - - get outputs(): MintCall__Outputs { - return new MintCall__Outputs(this); - } -} - -export class MintCall__Inputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class MintCall__Outputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get liquidity(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class SkimCall extends ethereum.Call { - get inputs(): SkimCall__Inputs { - return new SkimCall__Inputs(this); - } - - get outputs(): SkimCall__Outputs { - return new SkimCall__Outputs(this); - } -} - -export class SkimCall__Inputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SkimCall__Outputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amount0Out(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get to(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get data(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } -} - -export class SyncCall extends ethereum.Call { - get inputs(): SyncCall__Inputs { - return new SyncCall__Inputs(this); - } - - get outputs(): SyncCall__Outputs { - return new SyncCall__Outputs(this); - } -} - -export class SyncCall__Inputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class SyncCall__Outputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V2/sOlympusERC20V2.ts b/subgraphs/ethereum/generated/sOlympusERC20V2/sOlympusERC20V2.ts deleted file mode 100644 index a4184728..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V2/sOlympusERC20V2.ts +++ /dev/null @@ -1,1277 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class LogRebase extends ethereum.Event { - get params(): LogRebase__Params { - return new LogRebase__Params(this); - } -} - -export class LogRebase__Params { - _event: LogRebase; - - constructor(event: LogRebase) { - this._event = event; - } - - get epoch(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get rebase(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get index(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class LogStakingContractUpdated extends ethereum.Event { - get params(): LogStakingContractUpdated__Params { - return new LogStakingContractUpdated__Params(this); - } -} - -export class LogStakingContractUpdated__Params { - _event: LogStakingContractUpdated; - - constructor(event: LogStakingContractUpdated) { - this._event = event; - } - - get stakingContract(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class LogSupply extends ethereum.Event { - get params(): LogSupply__Params { - return new LogSupply__Params(this); - } -} - -export class LogSupply__Params { - _event: LogSupply; - - constructor(event: LogSupply) { - this._event = event; - } - - get epoch(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get timestamp(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get totalSupply(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class OwnershipPulled extends ethereum.Event { - get params(): OwnershipPulled__Params { - return new OwnershipPulled__Params(this); - } -} - -export class OwnershipPulled__Params { - _event: OwnershipPulled; - - constructor(event: OwnershipPulled) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipPushed extends ethereum.Event { - get params(): OwnershipPushed__Params { - return new OwnershipPushed__Params(this); - } -} - -export class OwnershipPushed__Params { - _event: OwnershipPushed; - - constructor(event: OwnershipPushed) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class sOlympusERC20V2__rebasesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - value6: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt, - value6: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - this.value6 = value6; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - map.set("value6", ethereum.Value.fromUnsignedBigInt(this.value6)); - return map; - } - - getEpoch(): BigInt { - return this.value0; - } - - getRebase(): BigInt { - return this.value1; - } - - getTotalStakedBefore(): BigInt { - return this.value2; - } - - getTotalStakedAfter(): BigInt { - return this.value3; - } - - getAmountRebased(): BigInt { - return this.value4; - } - - getIndex(): BigInt { - return this.value5; - } - - getBlockNumberOccured(): BigInt { - return this.value6; - } -} - -export class sOlympusERC20V2 extends ethereum.SmartContract { - static bind(address: Address): sOlympusERC20V2 { - return new sOlympusERC20V2("sOlympusERC20V2", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - INDEX(): BigInt { - const result = super.call("INDEX", "INDEX():(uint256)", []); - - return result[0].toBigInt(); - } - - try_INDEX(): ethereum.CallResult { - const result = super.tryCall("INDEX", "INDEX():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner_: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner_), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - owner_: Address, - spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner_), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceForGons(gons: BigInt): BigInt { - const result = super.call( - "balanceForGons", - "balanceForGons(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(gons)] - ); - - return result[0].toBigInt(); - } - - try_balanceForGons(gons: BigInt): ethereum.CallResult { - const result = super.tryCall( - "balanceForGons", - "balanceForGons(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(gons)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - balanceOf(who: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(who) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(who: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(who) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - circulatingSupply(): BigInt { - const result = super.call( - "circulatingSupply", - "circulatingSupply():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_circulatingSupply(): ethereum.CallResult { - const result = super.tryCall( - "circulatingSupply", - "circulatingSupply():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { - const result = super.call( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseAllowance( - spender: Address, - subtractedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - gonsForBalance(amount: BigInt): BigInt { - const result = super.call( - "gonsForBalance", - "gonsForBalance(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amount)] - ); - - return result[0].toBigInt(); - } - - try_gonsForBalance(amount: BigInt): ethereum.CallResult { - const result = super.tryCall( - "gonsForBalance", - "gonsForBalance(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amount)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - increaseAllowance(spender: Address, addedValue: BigInt): boolean { - const result = super.call( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseAllowance( - spender: Address, - addedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - index(): BigInt { - const result = super.call("index", "index():(uint256)", []); - - return result[0].toBigInt(); - } - - try_index(): ethereum.CallResult { - const result = super.tryCall("index", "index():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - initialize(stakingContract_: Address): boolean { - const result = super.call("initialize", "initialize(address):(bool)", [ - ethereum.Value.fromAddress(stakingContract_) - ]); - - return result[0].toBoolean(); - } - - try_initialize(stakingContract_: Address): ethereum.CallResult { - const result = super.tryCall("initialize", "initialize(address):(bool)", [ - ethereum.Value.fromAddress(stakingContract_) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - initializer(): Address { - const result = super.call("initializer", "initializer():(address)", []); - - return result[0].toAddress(); - } - - try_initializer(): ethereum.CallResult
{ - const result = super.tryCall("initializer", "initializer():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - manager(): Address { - const result = super.call("manager", "manager():(address)", []); - - return result[0].toAddress(); - } - - try_manager(): ethereum.CallResult
{ - const result = super.tryCall("manager", "manager():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - rebase(profit_: BigInt, epoch_: BigInt): BigInt { - const result = super.call("rebase", "rebase(uint256,uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(profit_), - ethereum.Value.fromUnsignedBigInt(epoch_) - ]); - - return result[0].toBigInt(); - } - - try_rebase(profit_: BigInt, epoch_: BigInt): ethereum.CallResult { - const result = super.tryCall("rebase", "rebase(uint256,uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(profit_), - ethereum.Value.fromUnsignedBigInt(epoch_) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - rebases(param0: BigInt): sOlympusERC20V2__rebasesResult { - const result = super.call( - "rebases", - "rebases(uint256):(uint256,uint256,uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromUnsignedBigInt(param0)] - ); - - return new sOlympusERC20V2__rebasesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt(), - result[6].toBigInt() - ); - } - - try_rebases( - param0: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "rebases", - "rebases(uint256):(uint256,uint256,uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromUnsignedBigInt(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new sOlympusERC20V2__rebasesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt(), - value[6].toBigInt() - ) - ); - } - - setIndex(_INDEX: BigInt): boolean { - const result = super.call("setIndex", "setIndex(uint256):(bool)", [ - ethereum.Value.fromUnsignedBigInt(_INDEX) - ]); - - return result[0].toBoolean(); - } - - try_setIndex(_INDEX: BigInt): ethereum.CallResult { - const result = super.tryCall("setIndex", "setIndex(uint256):(bool)", [ - ethereum.Value.fromUnsignedBigInt(_INDEX) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - stakingContract(): Address { - const result = super.call( - "stakingContract", - "stakingContract():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_stakingContract(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingContract", - "stakingContract():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DecreaseAllowanceCall extends ethereum.Call { - get inputs(): DecreaseAllowanceCall__Inputs { - return new DecreaseAllowanceCall__Inputs(this); - } - - get outputs(): DecreaseAllowanceCall__Outputs { - return new DecreaseAllowanceCall__Outputs(this); - } -} - -export class DecreaseAllowanceCall__Inputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get subtractedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseAllowanceCall__Outputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseAllowanceCall extends ethereum.Call { - get inputs(): IncreaseAllowanceCall__Inputs { - return new IncreaseAllowanceCall__Inputs(this); - } - - get outputs(): IncreaseAllowanceCall__Outputs { - return new IncreaseAllowanceCall__Outputs(this); - } -} - -export class IncreaseAllowanceCall__Inputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get addedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseAllowanceCall__Outputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get stakingContract_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class PullManagementCall extends ethereum.Call { - get inputs(): PullManagementCall__Inputs { - return new PullManagementCall__Inputs(this); - } - - get outputs(): PullManagementCall__Outputs { - return new PullManagementCall__Outputs(this); - } -} - -export class PullManagementCall__Inputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PullManagementCall__Outputs { - _call: PullManagementCall; - - constructor(call: PullManagementCall) { - this._call = call; - } -} - -export class PushManagementCall extends ethereum.Call { - get inputs(): PushManagementCall__Inputs { - return new PushManagementCall__Inputs(this); - } - - get outputs(): PushManagementCall__Outputs { - return new PushManagementCall__Outputs(this); - } -} - -export class PushManagementCall__Inputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class PushManagementCall__Outputs { - _call: PushManagementCall; - - constructor(call: PushManagementCall) { - this._call = call; - } -} - -export class RebaseCall extends ethereum.Call { - get inputs(): RebaseCall__Inputs { - return new RebaseCall__Inputs(this); - } - - get outputs(): RebaseCall__Outputs { - return new RebaseCall__Outputs(this); - } -} - -export class RebaseCall__Inputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } - - get profit_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get epoch_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class RebaseCall__Outputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RenounceManagementCall extends ethereum.Call { - get inputs(): RenounceManagementCall__Inputs { - return new RenounceManagementCall__Inputs(this); - } - - get outputs(): RenounceManagementCall__Outputs { - return new RenounceManagementCall__Outputs(this); - } -} - -export class RenounceManagementCall__Inputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class RenounceManagementCall__Outputs { - _call: RenounceManagementCall; - - constructor(call: RenounceManagementCall) { - this._call = call; - } -} - -export class SetIndexCall extends ethereum.Call { - get inputs(): SetIndexCall__Inputs { - return new SetIndexCall__Inputs(this); - } - - get outputs(): SetIndexCall__Outputs { - return new SetIndexCall__Outputs(this); - } -} - -export class SetIndexCall__Inputs { - _call: SetIndexCall; - - constructor(call: SetIndexCall) { - this._call = call; - } - - get _INDEX(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetIndexCall__Outputs { - _call: SetIndexCall; - - constructor(call: SetIndexCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V3/BalancerPoolToken.ts b/subgraphs/ethereum/generated/sOlympusERC20V3/BalancerPoolToken.ts deleted file mode 100644 index e1efa45b..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V3/BalancerPoolToken.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class SwapFeePercentageChanged extends ethereum.Event { - get params(): SwapFeePercentageChanged__Params { - return new SwapFeePercentageChanged__Params(this); - } -} - -export class SwapFeePercentageChanged__Params { - _event: SwapFeePercentageChanged; - - constructor(event: SwapFeePercentageChanged) { - this._event = event; - } - - get swapFeePercentage(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BalancerPoolToken__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerPoolToken__onExitPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onJoinPoolResult { - value0: Array; - value1: Array; - - constructor(value0: Array, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getValue0(): Array { - return this.value0; - } - - getValue1(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__onSwapInputRequestStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get tokenIn(): Address { - return this[1].toAddress(); - } - - get tokenOut(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get poolId(): Bytes { - return this[4].toBytes(); - } - - get lastChangeBlock(): BigInt { - return this[5].toBigInt(); - } - - get from(): Address { - return this[6].toAddress(); - } - - get to(): Address { - return this[7].toAddress(); - } - - get userData(): Bytes { - return this[8].toBytes(); - } -} - -export class BalancerPoolToken__queryExitResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptIn(): BigInt { - return this.value0; - } - - getAmountsOut(): Array { - return this.value1; - } -} - -export class BalancerPoolToken__queryJoinResult { - value0: BigInt; - value1: Array; - - constructor(value0: BigInt, value1: Array) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - return map; - } - - getBptOut(): BigInt { - return this.value0; - } - - getAmountsIn(): Array { - return this.value1; - } -} - -export class BalancerPoolToken extends ethereum.SmartContract { - static bind(address: Address): BalancerPoolToken { - return new BalancerPoolToken("BalancerPoolToken", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseApproval", - "decreaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getInvariant(): BigInt { - const result = super.call("getInvariant", "getInvariant():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getInvariant(): ethereum.CallResult { - const result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getLastInvariant(): BigInt { - const result = super.call( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getLastInvariant(): ethereum.CallResult { - const result = super.tryCall( - "getLastInvariant", - "getLastInvariant():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getNormalizedWeights(): Array { - const result = super.call( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - - return result[0].toBigIntArray(); - } - - try_getNormalizedWeights(): ethereum.CallResult> { - const result = super.tryCall( - "getNormalizedWeights", - "getNormalizedWeights():(uint256[])", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getOwner(): Address { - const result = super.call("getOwner", "getOwner():(address)", []); - - return result[0].toAddress(); - } - - try_getOwner(): ethereum.CallResult
{ - const result = super.tryCall("getOwner", "getOwner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getPausedState(): BalancerPoolToken__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerPoolToken__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerPoolToken__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPoolId(): Bytes { - const result = super.call("getPoolId", "getPoolId():(bytes32)", []); - - return result[0].toBytes(); - } - - try_getPoolId(): ethereum.CallResult { - const result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getRate(): BigInt { - const result = super.call("getRate", "getRate():(uint256)", []); - - return result[0].toBigInt(); - } - - try_getRate(): ethereum.CallResult { - const result = super.tryCall("getRate", "getRate():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getSwapFeePercentage(): BigInt { - const result = super.call( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_getSwapFeePercentage(): ethereum.CallResult { - const result = super.tryCall( - "getSwapFeePercentage", - "getSwapFeePercentage():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getVault(): Address { - const result = super.call("getVault", "getVault():(address)", []); - - return result[0].toAddress(); - } - - try_getVault(): ethereum.CallResult
{ - const result = super.tryCall("getVault", "getVault():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - increaseApproval(spender: Address, amount: BigInt): boolean { - const result = super.call( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseApproval( - spender: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseApproval", - "increaseApproval(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onExitPoolResult { - const result = super.call( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onExitPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onExitPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onExitPool", - "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onExitPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__onJoinPoolResult { - const result = super.call( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__onJoinPoolResult( - result[0].toBigIntArray(), - result[1].toBigIntArray() - ); - } - - try_onJoinPool( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "onJoinPool", - "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__onJoinPoolResult( - value[0].toBigIntArray(), - value[1].toBigIntArray() - ) - ); - } - - onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): BigInt { - const result = super.call( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - - return result[0].toBigInt(); - } - - try_onSwap( - request: BalancerPoolToken__onSwapInputRequestStruct, - balanceTokenIn: BigInt, - balanceTokenOut: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "onSwap", - "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", - [ - ethereum.Value.fromTuple(request), - ethereum.Value.fromUnsignedBigInt(balanceTokenIn), - ethereum.Value.fromUnsignedBigInt(balanceTokenOut) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryExitResult { - const result = super.call( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryExitResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryExit( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryExit", - "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryExitResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): BalancerPoolToken__queryJoinResult { - const result = super.call( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - - return new BalancerPoolToken__queryJoinResult( - result[0].toBigInt(), - result[1].toBigIntArray() - ); - } - - try_queryJoin( - poolId: Bytes, - sender: Address, - recipient: Address, - balances: Array, - lastChangeBlock: BigInt, - protocolSwapFeePercentage: BigInt, - userData: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "queryJoin", - "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", - [ - ethereum.Value.fromFixedBytes(poolId), - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigIntArray(balances), - ethereum.Value.fromUnsignedBigInt(lastChangeBlock), - ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), - ethereum.Value.fromBytes(userData) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerPoolToken__queryJoinResult( - value[0].toBigInt(), - value[1].toBigIntArray() - ) - ); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get vault(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get name(): string { - return this._call.inputValues[1].value.toString(); - } - - get symbol(): string { - return this._call.inputValues[2].value.toString(); - } - - get tokens(): Array
{ - return this._call.inputValues[3].value.toAddressArray(); - } - - get normalizedWeights(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[7].value.toBigInt(); - } - - get owner(): Address { - return this._call.inputValues[8].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DecreaseApprovalCall extends ethereum.Call { - get inputs(): DecreaseApprovalCall__Inputs { - return new DecreaseApprovalCall__Inputs(this); - } - - get outputs(): DecreaseApprovalCall__Outputs { - return new DecreaseApprovalCall__Outputs(this); - } -} - -export class DecreaseApprovalCall__Inputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseApprovalCall__Outputs { - _call: DecreaseApprovalCall; - - constructor(call: DecreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseApprovalCall extends ethereum.Call { - get inputs(): IncreaseApprovalCall__Inputs { - return new IncreaseApprovalCall__Inputs(this); - } - - get outputs(): IncreaseApprovalCall__Outputs { - return new IncreaseApprovalCall__Outputs(this); - } -} - -export class IncreaseApprovalCall__Inputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseApprovalCall__Outputs { - _call: IncreaseApprovalCall; - - constructor(call: IncreaseApprovalCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class OnExitPoolCall extends ethereum.Call { - get inputs(): OnExitPoolCall__Inputs { - return new OnExitPoolCall__Inputs(this); - } - - get outputs(): OnExitPoolCall__Outputs { - return new OnExitPoolCall__Outputs(this); - } -} - -export class OnExitPoolCall__Inputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnExitPoolCall__Outputs { - _call: OnExitPoolCall; - - constructor(call: OnExitPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class OnJoinPoolCall extends ethereum.Call { - get inputs(): OnJoinPoolCall__Inputs { - return new OnJoinPoolCall__Inputs(this); - } - - get outputs(): OnJoinPoolCall__Outputs { - return new OnJoinPoolCall__Outputs(this); - } -} - -export class OnJoinPoolCall__Inputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class OnJoinPoolCall__Outputs { - _call: OnJoinPoolCall; - - constructor(call: OnJoinPoolCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } - - get value1(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class QueryExitCall extends ethereum.Call { - get inputs(): QueryExitCall__Inputs { - return new QueryExitCall__Inputs(this); - } - - get outputs(): QueryExitCall__Outputs { - return new QueryExitCall__Outputs(this); - } -} - -export class QueryExitCall__Inputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryExitCall__Outputs { - _call: QueryExitCall; - - constructor(call: QueryExitCall) { - this._call = call; - } - - get bptIn(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsOut(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class QueryJoinCall extends ethereum.Call { - get inputs(): QueryJoinCall__Inputs { - return new QueryJoinCall__Inputs(this); - } - - get outputs(): QueryJoinCall__Outputs { - return new QueryJoinCall__Outputs(this); - } -} - -export class QueryJoinCall__Inputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get balances(): Array { - return this._call.inputValues[3].value.toBigIntArray(); - } - - get lastChangeBlock(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get protocolSwapFeePercentage(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get userData(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class QueryJoinCall__Outputs { - _call: QueryJoinCall; - - constructor(call: QueryJoinCall) { - this._call = call; - } - - get bptOut(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amountsIn(): Array { - return this._call.outputValues[1].value.toBigIntArray(); - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetSwapFeePercentageCall extends ethereum.Call { - get inputs(): SetSwapFeePercentageCall__Inputs { - return new SetSwapFeePercentageCall__Inputs(this); - } - - get outputs(): SetSwapFeePercentageCall__Outputs { - return new SetSwapFeePercentageCall__Outputs(this); - } -} - -export class SetSwapFeePercentageCall__Inputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } - - get swapFeePercentage(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetSwapFeePercentageCall__Outputs { - _call: SetSwapFeePercentageCall; - - constructor(call: SetSwapFeePercentageCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V3/BalancerVault.ts b/subgraphs/ethereum/generated/sOlympusERC20V3/BalancerVault.ts deleted file mode 100644 index 41f94648..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V3/BalancerVault.ts +++ /dev/null @@ -1,1688 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class AuthorizerChanged extends ethereum.Event { - get params(): AuthorizerChanged__Params { - return new AuthorizerChanged__Params(this); - } -} - -export class AuthorizerChanged__Params { - _event: AuthorizerChanged; - - constructor(event: AuthorizerChanged) { - this._event = event; - } - - get newAuthorizer(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class ExternalBalanceTransfer extends ethereum.Event { - get params(): ExternalBalanceTransfer__Params { - return new ExternalBalanceTransfer__Params(this); - } -} - -export class ExternalBalanceTransfer__Params { - _event: ExternalBalanceTransfer; - - constructor(event: ExternalBalanceTransfer) { - this._event = event; - } - - get token(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get recipient(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class FlashLoan extends ethereum.Event { - get params(): FlashLoan__Params { - return new FlashLoan__Params(this); - } -} - -export class FlashLoan__Params { - _event: FlashLoan; - - constructor(event: FlashLoan) { - this._event = event; - } - - get recipient(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get feeAmount(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class InternalBalanceChanged extends ethereum.Event { - get params(): InternalBalanceChanged__Params { - return new InternalBalanceChanged__Params(this); - } -} - -export class InternalBalanceChanged__Params { - _event: InternalBalanceChanged; - - constructor(event: InternalBalanceChanged) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get delta(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class PausedStateChanged extends ethereum.Event { - get params(): PausedStateChanged__Params { - return new PausedStateChanged__Params(this); - } -} - -export class PausedStateChanged__Params { - _event: PausedStateChanged; - - constructor(event: PausedStateChanged) { - this._event = event; - } - - get paused(): boolean { - return this._event.parameters[0].value.toBoolean(); - } -} - -export class PoolBalanceChanged extends ethereum.Event { - get params(): PoolBalanceChanged__Params { - return new PoolBalanceChanged__Params(this); - } -} - -export class PoolBalanceChanged__Params { - _event: PoolBalanceChanged; - - constructor(event: PoolBalanceChanged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get liquidityProvider(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokens(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } - - get deltas(): Array { - return this._event.parameters[3].value.toBigIntArray(); - } - - get protocolFeeAmounts(): Array { - return this._event.parameters[4].value.toBigIntArray(); - } -} - -export class PoolBalanceManaged extends ethereum.Event { - get params(): PoolBalanceManaged__Params { - return new PoolBalanceManaged__Params(this); - } -} - -export class PoolBalanceManaged__Params { - _event: PoolBalanceManaged; - - constructor(event: PoolBalanceManaged) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get assetManager(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get token(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get cashDelta(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get managedDelta(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class PoolRegistered extends ethereum.Event { - get params(): PoolRegistered__Params { - return new PoolRegistered__Params(this); - } -} - -export class PoolRegistered__Params { - _event: PoolRegistered; - - constructor(event: PoolRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get poolAddress(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get specialization(): i32 { - return this._event.parameters[2].value.toI32(); - } -} - -export class RelayerApprovalChanged extends ethereum.Event { - get params(): RelayerApprovalChanged__Params { - return new RelayerApprovalChanged__Params(this); - } -} - -export class RelayerApprovalChanged__Params { - _event: RelayerApprovalChanged; - - constructor(event: RelayerApprovalChanged) { - this._event = event; - } - - get relayer(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get sender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get approved(): boolean { - return this._event.parameters[2].value.toBoolean(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokenIn(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get tokenOut(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get amountIn(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amountOut(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class TokensDeregistered extends ethereum.Event { - get params(): TokensDeregistered__Params { - return new TokensDeregistered__Params(this); - } -} - -export class TokensDeregistered__Params { - _event: TokensDeregistered; - - constructor(event: TokensDeregistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } -} - -export class TokensRegistered extends ethereum.Event { - get params(): TokensRegistered__Params { - return new TokensRegistered__Params(this); - } -} - -export class TokensRegistered__Params { - _event: TokensRegistered; - - constructor(event: TokensRegistered) { - this._event = event; - } - - get poolId(): Bytes { - return this._event.parameters[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._event.parameters[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } -} - -export class BalancerVault__getPausedStateResult { - value0: boolean; - value1: BigInt; - value2: BigInt; - - constructor(value0: boolean, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromBoolean(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getPaused(): boolean { - return this.value0; - } - - getPauseWindowEndTime(): BigInt { - return this.value1; - } - - getBufferPeriodEndTime(): BigInt { - return this.value2; - } -} - -export class BalancerVault__getPoolResult { - value0: Address; - value1: i32; - - constructor(value0: Address, value1: i32) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddress(this.value0)); - map.set( - "value1", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) - ); - return map; - } - - getValue0(): Address { - return this.value0; - } - - getValue1(): i32 { - return this.value1; - } -} - -export class BalancerVault__getPoolTokenInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: Address; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: Address) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromAddress(this.value3)); - return map; - } - - getCash(): BigInt { - return this.value0; - } - - getManaged(): BigInt { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } - - getAssetManager(): Address { - return this.value3; - } -} - -export class BalancerVault__getPoolTokensResult { - value0: Array
; - value1: Array; - value2: BigInt; - - constructor(value0: Array
, value1: Array, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddressArray(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getTokens(): Array
{ - return this.value0; - } - - getBalances(): Array { - return this.value1; - } - - getLastChangeBlock(): BigInt { - return this.value2; - } -} - -export class BalancerVault__queryBatchSwapInputSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BalancerVault__queryBatchSwapInputFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class BalancerVault extends ethereum.SmartContract { - static bind(address: Address): BalancerVault { - return new BalancerVault("BalancerVault", address); - } - - WETH(): Address { - const result = super.call("WETH", "WETH():(address)", []); - - return result[0].toAddress(); - } - - try_WETH(): ethereum.CallResult
{ - const result = super.tryCall("WETH", "WETH():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getActionId(selector: Bytes): Bytes { - const result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - - return result[0].toBytes(); - } - - try_getActionId(selector: Bytes): ethereum.CallResult { - const result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ - ethereum.Value.fromFixedBytes(selector) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getAuthorizer(): Address { - const result = super.call("getAuthorizer", "getAuthorizer():(address)", []); - - return result[0].toAddress(); - } - - try_getAuthorizer(): ethereum.CallResult
{ - const result = super.tryCall( - "getAuthorizer", - "getAuthorizer():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getDomainSeparator(): Bytes { - const result = super.call( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_getDomainSeparator(): ethereum.CallResult { - const result = super.tryCall( - "getDomainSeparator", - "getDomainSeparator():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - getInternalBalance(user: Address, tokens: Array
): Array { - const result = super.call( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - - return result[0].toBigIntArray(); - } - - try_getInternalBalance( - user: Address, - tokens: Array
- ): ethereum.CallResult> { - const result = super.tryCall( - "getInternalBalance", - "getInternalBalance(address,address[]):(uint256[])", - [ - ethereum.Value.fromAddress(user), - ethereum.Value.fromAddressArray(tokens) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - getNextNonce(user: Address): BigInt { - const result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ - ethereum.Value.fromAddress(user) - ]); - - return result[0].toBigInt(); - } - - try_getNextNonce(user: Address): ethereum.CallResult { - const result = super.tryCall( - "getNextNonce", - "getNextNonce(address):(uint256)", - [ethereum.Value.fromAddress(user)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getPausedState(): BalancerVault__getPausedStateResult { - const result = super.call( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - - return new BalancerVault__getPausedStateResult( - result[0].toBoolean(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getPausedState(): ethereum.CallResult< - BalancerVault__getPausedStateResult - > { - const result = super.tryCall( - "getPausedState", - "getPausedState():(bool,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPausedStateResult( - value[0].toBoolean(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - getPool(poolId: Bytes): BalancerVault__getPoolResult { - const result = super.call("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - - return new BalancerVault__getPoolResult( - result[0].toAddress(), - result[1].toI32() - ); - } - - try_getPool( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall("getPool", "getPool(bytes32):(address,uint8)", [ - ethereum.Value.fromFixedBytes(poolId) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolResult(value[0].toAddress(), value[1].toI32()) - ); - } - - getPoolTokenInfo( - poolId: Bytes, - token: Address - ): BalancerVault__getPoolTokenInfoResult { - const result = super.call( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - - return new BalancerVault__getPoolTokenInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toAddress() - ); - } - - try_getPoolTokenInfo( - poolId: Bytes, - token: Address - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokenInfo", - "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", - [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokenInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toAddress() - ) - ); - } - - getPoolTokens(poolId: Bytes): BalancerVault__getPoolTokensResult { - const result = super.call( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - - return new BalancerVault__getPoolTokensResult( - result[0].toAddressArray(), - result[1].toBigIntArray(), - result[2].toBigInt() - ); - } - - try_getPoolTokens( - poolId: Bytes - ): ethereum.CallResult { - const result = super.tryCall( - "getPoolTokens", - "getPoolTokens(bytes32):(address[],uint256[],uint256)", - [ethereum.Value.fromFixedBytes(poolId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new BalancerVault__getPoolTokensResult( - value[0].toAddressArray(), - value[1].toBigIntArray(), - value[2].toBigInt() - ) - ); - } - - getProtocolFeesCollector(): Address { - const result = super.call( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_getProtocolFeesCollector(): ethereum.CallResult
{ - const result = super.tryCall( - "getProtocolFeesCollector", - "getProtocolFeesCollector():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - hasApprovedRelayer(user: Address, relayer: Address): boolean { - const result = super.call( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - - return result[0].toBoolean(); - } - - try_hasApprovedRelayer( - user: Address, - relayer: Address - ): ethereum.CallResult { - const result = super.tryCall( - "hasApprovedRelayer", - "hasApprovedRelayer(address,address):(bool)", - [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): Array { - const result = super.call( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - - return result[0].toBigIntArray(); - } - - try_queryBatchSwap( - kind: i32, - swaps: Array, - assets: Array
, - funds: BalancerVault__queryBatchSwapInputFundsStruct - ): ethereum.CallResult> { - const result = super.tryCall( - "queryBatchSwap", - "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), - ethereum.Value.fromTupleArray(swaps), - ethereum.Value.fromAddressArray(assets), - ethereum.Value.fromTuple(funds) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); - } - - registerPool(specialization: i32): Bytes { - const result = super.call("registerPool", "registerPool(uint8):(bytes32)", [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization)) - ]); - - return result[0].toBytes(); - } - - try_registerPool(specialization: i32): ethereum.CallResult { - const result = super.tryCall( - "registerPool", - "registerPool(uint8):(bytes32)", - [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization))] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get authorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get weth(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get pauseWindowDuration(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get bufferPeriodDuration(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class BatchSwapCall extends ethereum.Call { - get inputs(): BatchSwapCall__Inputs { - return new BatchSwapCall__Inputs(this); - } - - get outputs(): BatchSwapCall__Outputs { - return new BatchSwapCall__Outputs(this); - } -} - -export class BatchSwapCall__Inputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - BatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): BatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } - - get limits(): Array { - return this._call.inputValues[4].value.toBigIntArray(); - } - - get deadline(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } -} - -export class BatchSwapCall__Outputs { - _call: BatchSwapCall; - - constructor(call: BatchSwapCall) { - this._call = call; - } - - get assetDeltas(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class BatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class BatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class DeregisterTokensCall extends ethereum.Call { - get inputs(): DeregisterTokensCall__Inputs { - return new DeregisterTokensCall__Inputs(this); - } - - get outputs(): DeregisterTokensCall__Outputs { - return new DeregisterTokensCall__Outputs(this); - } -} - -export class DeregisterTokensCall__Inputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } -} - -export class DeregisterTokensCall__Outputs { - _call: DeregisterTokensCall; - - constructor(call: DeregisterTokensCall) { - this._call = call; - } -} - -export class ExitPoolCall extends ethereum.Call { - get inputs(): ExitPoolCall__Inputs { - return new ExitPoolCall__Inputs(this); - } - - get outputs(): ExitPoolCall__Outputs { - return new ExitPoolCall__Outputs(this); - } -} - -export class ExitPoolCall__Inputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): ExitPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class ExitPoolCall__Outputs { - _call: ExitPoolCall; - - constructor(call: ExitPoolCall) { - this._call = call; - } -} - -export class ExitPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get minAmountsOut(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class FlashLoanCall extends ethereum.Call { - get inputs(): FlashLoanCall__Inputs { - return new FlashLoanCall__Inputs(this); - } - - get outputs(): FlashLoanCall__Outputs { - return new FlashLoanCall__Outputs(this); - } -} - -export class FlashLoanCall__Inputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get amounts(): Array { - return this._call.inputValues[2].value.toBigIntArray(); - } - - get userData(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class FlashLoanCall__Outputs { - _call: FlashLoanCall; - - constructor(call: FlashLoanCall) { - this._call = call; - } -} - -export class JoinPoolCall extends ethereum.Call { - get inputs(): JoinPoolCall__Inputs { - return new JoinPoolCall__Inputs(this); - } - - get outputs(): JoinPoolCall__Outputs { - return new JoinPoolCall__Outputs(this); - } -} - -export class JoinPoolCall__Inputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get sender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get request(): JoinPoolCallRequestStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class JoinPoolCall__Outputs { - _call: JoinPoolCall; - - constructor(call: JoinPoolCall) { - this._call = call; - } -} - -export class JoinPoolCallRequestStruct extends ethereum.Tuple { - get assets(): Array
{ - return this[0].toAddressArray(); - } - - get maxAmountsIn(): Array { - return this[1].toBigIntArray(); - } - - get userData(): Bytes { - return this[2].toBytes(); - } - - get fromInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class ManagePoolBalanceCall extends ethereum.Call { - get inputs(): ManagePoolBalanceCall__Inputs { - return new ManagePoolBalanceCall__Inputs(this); - } - - get outputs(): ManagePoolBalanceCall__Outputs { - return new ManagePoolBalanceCall__Outputs(this); - } -} - -export class ManagePoolBalanceCall__Inputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManagePoolBalanceCallOpsStruct - >(); - } -} - -export class ManagePoolBalanceCall__Outputs { - _call: ManagePoolBalanceCall; - - constructor(call: ManagePoolBalanceCall) { - this._call = call; - } -} - -export class ManagePoolBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get poolId(): Bytes { - return this[1].toBytes(); - } - - get token(): Address { - return this[2].toAddress(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } -} - -export class ManageUserBalanceCall extends ethereum.Call { - get inputs(): ManageUserBalanceCall__Inputs { - return new ManageUserBalanceCall__Inputs(this); - } - - get outputs(): ManageUserBalanceCall__Outputs { - return new ManageUserBalanceCall__Outputs(this); - } -} - -export class ManageUserBalanceCall__Inputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } - - get ops(): Array { - return this._call.inputValues[0].value.toTupleArray< - ManageUserBalanceCallOpsStruct - >(); - } -} - -export class ManageUserBalanceCall__Outputs { - _call: ManageUserBalanceCall; - - constructor(call: ManageUserBalanceCall) { - this._call = call; - } -} - -export class ManageUserBalanceCallOpsStruct extends ethereum.Tuple { - get kind(): i32 { - return this[0].toI32(); - } - - get asset(): Address { - return this[1].toAddress(); - } - - get amount(): BigInt { - return this[2].toBigInt(); - } - - get sender(): Address { - return this[3].toAddress(); - } - - get recipient(): Address { - return this[4].toAddress(); - } -} - -export class QueryBatchSwapCall extends ethereum.Call { - get inputs(): QueryBatchSwapCall__Inputs { - return new QueryBatchSwapCall__Inputs(this); - } - - get outputs(): QueryBatchSwapCall__Outputs { - return new QueryBatchSwapCall__Outputs(this); - } -} - -export class QueryBatchSwapCall__Inputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get kind(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get swaps(): Array { - return this._call.inputValues[1].value.toTupleArray< - QueryBatchSwapCallSwapsStruct - >(); - } - - get assets(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } - - get funds(): QueryBatchSwapCallFundsStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class QueryBatchSwapCall__Outputs { - _call: QueryBatchSwapCall; - - constructor(call: QueryBatchSwapCall) { - this._call = call; - } - - get value0(): Array { - return this._call.outputValues[0].value.toBigIntArray(); - } -} - -export class QueryBatchSwapCallSwapsStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get assetInIndex(): BigInt { - return this[1].toBigInt(); - } - - get assetOutIndex(): BigInt { - return this[2].toBigInt(); - } - - get amount(): BigInt { - return this[3].toBigInt(); - } - - get userData(): Bytes { - return this[4].toBytes(); - } -} - -export class QueryBatchSwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} - -export class RegisterPoolCall extends ethereum.Call { - get inputs(): RegisterPoolCall__Inputs { - return new RegisterPoolCall__Inputs(this); - } - - get outputs(): RegisterPoolCall__Outputs { - return new RegisterPoolCall__Outputs(this); - } -} - -export class RegisterPoolCall__Inputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get specialization(): i32 { - return this._call.inputValues[0].value.toI32(); - } -} - -export class RegisterPoolCall__Outputs { - _call: RegisterPoolCall; - - constructor(call: RegisterPoolCall) { - this._call = call; - } - - get value0(): Bytes { - return this._call.outputValues[0].value.toBytes(); - } -} - -export class RegisterTokensCall extends ethereum.Call { - get inputs(): RegisterTokensCall__Inputs { - return new RegisterTokensCall__Inputs(this); - } - - get outputs(): RegisterTokensCall__Outputs { - return new RegisterTokensCall__Outputs(this); - } -} - -export class RegisterTokensCall__Inputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } - - get poolId(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get tokens(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get assetManagers(): Array
{ - return this._call.inputValues[2].value.toAddressArray(); - } -} - -export class RegisterTokensCall__Outputs { - _call: RegisterTokensCall; - - constructor(call: RegisterTokensCall) { - this._call = call; - } -} - -export class SetAuthorizerCall extends ethereum.Call { - get inputs(): SetAuthorizerCall__Inputs { - return new SetAuthorizerCall__Inputs(this); - } - - get outputs(): SetAuthorizerCall__Outputs { - return new SetAuthorizerCall__Outputs(this); - } -} - -export class SetAuthorizerCall__Inputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } - - get newAuthorizer(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetAuthorizerCall__Outputs { - _call: SetAuthorizerCall; - - constructor(call: SetAuthorizerCall) { - this._call = call; - } -} - -export class SetPausedCall extends ethereum.Call { - get inputs(): SetPausedCall__Inputs { - return new SetPausedCall__Inputs(this); - } - - get outputs(): SetPausedCall__Outputs { - return new SetPausedCall__Outputs(this); - } -} - -export class SetPausedCall__Inputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } - - get paused(): boolean { - return this._call.inputValues[0].value.toBoolean(); - } -} - -export class SetPausedCall__Outputs { - _call: SetPausedCall; - - constructor(call: SetPausedCall) { - this._call = call; - } -} - -export class SetRelayerApprovalCall extends ethereum.Call { - get inputs(): SetRelayerApprovalCall__Inputs { - return new SetRelayerApprovalCall__Inputs(this); - } - - get outputs(): SetRelayerApprovalCall__Outputs { - return new SetRelayerApprovalCall__Outputs(this); - } -} - -export class SetRelayerApprovalCall__Inputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get relayer(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get approved(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } -} - -export class SetRelayerApprovalCall__Outputs { - _call: SetRelayerApprovalCall; - - constructor(call: SetRelayerApprovalCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get singleSwap(): SwapCallSingleSwapStruct { - return changetype( - this._call.inputValues[0].value.toTuple() - ); - } - - get funds(): SwapCallFundsStruct { - return changetype( - this._call.inputValues[1].value.toTuple() - ); - } - - get limit(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amountCalculated(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class SwapCallSingleSwapStruct extends ethereum.Tuple { - get poolId(): Bytes { - return this[0].toBytes(); - } - - get kind(): i32 { - return this[1].toI32(); - } - - get assetIn(): Address { - return this[2].toAddress(); - } - - get assetOut(): Address { - return this[3].toAddress(); - } - - get amount(): BigInt { - return this[4].toBigInt(); - } - - get userData(): Bytes { - return this[5].toBytes(); - } -} - -export class SwapCallFundsStruct extends ethereum.Tuple { - get sender(): Address { - return this[0].toAddress(); - } - - get fromInternalBalance(): boolean { - return this[1].toBoolean(); - } - - get recipient(): Address { - return this[2].toAddress(); - } - - get toInternalBalance(): boolean { - return this[3].toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V3/ERC20.ts b/subgraphs/ethereum/generated/sOlympusERC20V3/ERC20.ts deleted file mode 100644 index bbe93783..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V3/ERC20.ts +++ /dev/null @@ -1,394 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class ERC20 extends ethereum.SmartContract { - static bind(address: Address): ERC20 { - return new ERC20("ERC20", address); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - approve(_spender: Address, _value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_approve(_spender: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_spender), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transferFrom(_from: Address, _to: Address, _value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - _from: Address, - _to: Address, - _value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(_from), - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - balanceOf(_owner: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(_owner: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(_owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - transfer(_to: Address, _value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(_to: Address, _value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - allowance(_owner: Address, _spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - _owner: Address, - _spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(_owner), ethereum.Value.fromAddress(_spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get _spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get _from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class DefaultCall extends ethereum.Call { - get inputs(): DefaultCall__Inputs { - return new DefaultCall__Inputs(this); - } - - get outputs(): DefaultCall__Outputs { - return new DefaultCall__Outputs(this); - } -} - -export class DefaultCall__Inputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} - -export class DefaultCall__Outputs { - _call: DefaultCall; - - constructor(call: DefaultCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V3/OlympusERC20.ts b/subgraphs/ethereum/generated/sOlympusERC20V3/OlympusERC20.ts deleted file mode 100644 index d544f05c..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V3/OlympusERC20.ts +++ /dev/null @@ -1,1184 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class TWAPEpochChanged extends ethereum.Event { - get params(): TWAPEpochChanged__Params { - return new TWAPEpochChanged__Params(this); - } -} - -export class TWAPEpochChanged__Params { - _event: TWAPEpochChanged; - - constructor(event: TWAPEpochChanged) { - this._event = event; - } - - get previousTWAPEpochPeriod(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get newTWAPEpochPeriod(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class TWAPOracleChanged extends ethereum.Event { - get params(): TWAPOracleChanged__Params { - return new TWAPOracleChanged__Params(this); - } -} - -export class TWAPOracleChanged__Params { - _event: TWAPOracleChanged; - - constructor(event: TWAPOracleChanged) { - this._event = event; - } - - get previousTWAPOracle(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newTWAPOracle(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class TWAPSourceAdded extends ethereum.Event { - get params(): TWAPSourceAdded__Params { - return new TWAPSourceAdded__Params(this); - } -} - -export class TWAPSourceAdded__Params { - _event: TWAPSourceAdded; - - constructor(event: TWAPSourceAdded) { - this._event = event; - } - - get newTWAPSource(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class TWAPSourceRemoved extends ethereum.Event { - get params(): TWAPSourceRemoved__Params { - return new TWAPSourceRemoved__Params(this); - } -} - -export class TWAPSourceRemoved__Params { - _event: TWAPSourceRemoved; - - constructor(event: TWAPSourceRemoved) { - this._event = event; - } - - get removedTWAPSource(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class OlympusERC20 extends ethereum.SmartContract { - static bind(address: Address): OlympusERC20 { - return new OlympusERC20("OlympusERC20", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance(owner: Address, spender: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, amount: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, amount: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(account: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(account: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(account) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { - const result = super.call( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseAllowance( - spender: Address, - subtractedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - increaseAllowance(spender: Address, addedValue: BigInt): boolean { - const result = super.call( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseAllowance( - spender: Address, - addedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - owner(): Address { - const result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - const result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - setVault(vault_: Address): boolean { - const result = super.call("setVault", "setVault(address):(bool)", [ - ethereum.Value.fromAddress(vault_) - ]); - - return result[0].toBoolean(); - } - - try_setVault(vault_: Address): ethereum.CallResult { - const result = super.tryCall("setVault", "setVault(address):(bool)", [ - ethereum.Value.fromAddress(vault_) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(recipient: Address, amount: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBoolean(); - } - - try_transfer( - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - sender: Address, - recipient: Address, - amount: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(sender), - ethereum.Value.fromAddress(recipient), - ethereum.Value.fromUnsignedBigInt(amount) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - twapEpochPeriod(): BigInt { - const result = super.call( - "twapEpochPeriod", - "twapEpochPeriod():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_twapEpochPeriod(): ethereum.CallResult { - const result = super.tryCall( - "twapEpochPeriod", - "twapEpochPeriod():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - twapOracle(): Address { - const result = super.call("twapOracle", "twapOracle():(address)", []); - - return result[0].toAddress(); - } - - try_twapOracle(): ethereum.CallResult
{ - const result = super.tryCall("twapOracle", "twapOracle():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - vault(): Address { - const result = super.call("vault", "vault():(address)", []); - - return result[0].toAddress(); - } - - try_vault(): ethereum.CallResult
{ - const result = super.tryCall("vault", "vault():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class _burnFromCall extends ethereum.Call { - get inputs(): _burnFromCall__Inputs { - return new _burnFromCall__Inputs(this); - } - - get outputs(): _burnFromCall__Outputs { - return new _burnFromCall__Outputs(this); - } -} - -export class _burnFromCall__Inputs { - _call: _burnFromCall; - - constructor(call: _burnFromCall) { - this._call = call; - } - - get account_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class _burnFromCall__Outputs { - _call: _burnFromCall; - - constructor(call: _burnFromCall) { - this._call = call; - } -} - -export class AddTWAPSourceCall extends ethereum.Call { - get inputs(): AddTWAPSourceCall__Inputs { - return new AddTWAPSourceCall__Inputs(this); - } - - get outputs(): AddTWAPSourceCall__Outputs { - return new AddTWAPSourceCall__Outputs(this); - } -} - -export class AddTWAPSourceCall__Inputs { - _call: AddTWAPSourceCall; - - constructor(call: AddTWAPSourceCall) { - this._call = call; - } - - get newTWAPSourceDexPool_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class AddTWAPSourceCall__Outputs { - _call: AddTWAPSourceCall; - - constructor(call: AddTWAPSourceCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class BurnCall extends ethereum.Call { - get inputs(): BurnCall__Inputs { - return new BurnCall__Inputs(this); - } - - get outputs(): BurnCall__Outputs { - return new BurnCall__Outputs(this); - } -} - -export class BurnCall__Inputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class BurnCall__Outputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } -} - -export class BurnFromCall extends ethereum.Call { - get inputs(): BurnFromCall__Inputs { - return new BurnFromCall__Inputs(this); - } - - get outputs(): BurnFromCall__Outputs { - return new BurnFromCall__Outputs(this); - } -} - -export class BurnFromCall__Inputs { - _call: BurnFromCall; - - constructor(call: BurnFromCall) { - this._call = call; - } - - get account_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class BurnFromCall__Outputs { - _call: BurnFromCall; - - constructor(call: BurnFromCall) { - this._call = call; - } -} - -export class ChangeTWAPEpochPeriodCall extends ethereum.Call { - get inputs(): ChangeTWAPEpochPeriodCall__Inputs { - return new ChangeTWAPEpochPeriodCall__Inputs(this); - } - - get outputs(): ChangeTWAPEpochPeriodCall__Outputs { - return new ChangeTWAPEpochPeriodCall__Outputs(this); - } -} - -export class ChangeTWAPEpochPeriodCall__Inputs { - _call: ChangeTWAPEpochPeriodCall; - - constructor(call: ChangeTWAPEpochPeriodCall) { - this._call = call; - } - - get newTWAPEpochPeriod_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class ChangeTWAPEpochPeriodCall__Outputs { - _call: ChangeTWAPEpochPeriodCall; - - constructor(call: ChangeTWAPEpochPeriodCall) { - this._call = call; - } -} - -export class ChangeTWAPOracleCall extends ethereum.Call { - get inputs(): ChangeTWAPOracleCall__Inputs { - return new ChangeTWAPOracleCall__Inputs(this); - } - - get outputs(): ChangeTWAPOracleCall__Outputs { - return new ChangeTWAPOracleCall__Outputs(this); - } -} - -export class ChangeTWAPOracleCall__Inputs { - _call: ChangeTWAPOracleCall; - - constructor(call: ChangeTWAPOracleCall) { - this._call = call; - } - - get newTWAPOracle_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class ChangeTWAPOracleCall__Outputs { - _call: ChangeTWAPOracleCall; - - constructor(call: ChangeTWAPOracleCall) { - this._call = call; - } -} - -export class DecreaseAllowanceCall extends ethereum.Call { - get inputs(): DecreaseAllowanceCall__Inputs { - return new DecreaseAllowanceCall__Inputs(this); - } - - get outputs(): DecreaseAllowanceCall__Outputs { - return new DecreaseAllowanceCall__Outputs(this); - } -} - -export class DecreaseAllowanceCall__Inputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get subtractedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseAllowanceCall__Outputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseAllowanceCall extends ethereum.Call { - get inputs(): IncreaseAllowanceCall__Inputs { - return new IncreaseAllowanceCall__Inputs(this); - } - - get outputs(): IncreaseAllowanceCall__Outputs { - return new IncreaseAllowanceCall__Outputs(this); - } -} - -export class IncreaseAllowanceCall__Inputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get addedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseAllowanceCall__Outputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class MintCall extends ethereum.Call { - get inputs(): MintCall__Inputs { - return new MintCall__Inputs(this); - } - - get outputs(): MintCall__Outputs { - return new MintCall__Outputs(this); - } -} - -export class MintCall__Inputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get account_(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class MintCall__Outputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class RemoveTWAPSourceCall extends ethereum.Call { - get inputs(): RemoveTWAPSourceCall__Inputs { - return new RemoveTWAPSourceCall__Inputs(this); - } - - get outputs(): RemoveTWAPSourceCall__Outputs { - return new RemoveTWAPSourceCall__Outputs(this); - } -} - -export class RemoveTWAPSourceCall__Inputs { - _call: RemoveTWAPSourceCall; - - constructor(call: RemoveTWAPSourceCall) { - this._call = call; - } - - get twapSourceToRemove_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RemoveTWAPSourceCall__Outputs { - _call: RemoveTWAPSourceCall; - - constructor(call: RemoveTWAPSourceCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall extends ethereum.Call { - get inputs(): RenounceOwnershipCall__Inputs { - return new RenounceOwnershipCall__Inputs(this); - } - - get outputs(): RenounceOwnershipCall__Outputs { - return new RenounceOwnershipCall__Outputs(this); - } -} - -export class RenounceOwnershipCall__Inputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall__Outputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class SetVaultCall extends ethereum.Call { - get inputs(): SetVaultCall__Inputs { - return new SetVaultCall__Inputs(this); - } - - get outputs(): SetVaultCall__Outputs { - return new SetVaultCall__Outputs(this); - } -} - -export class SetVaultCall__Inputs { - _call: SetVaultCall; - - constructor(call: SetVaultCall) { - this._call = call; - } - - get vault_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetVaultCall__Outputs { - _call: SetVaultCall; - - constructor(call: SetVaultCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get sender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get amount(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get newOwner_(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V3/OlympusStakingV3.ts b/subgraphs/ethereum/generated/sOlympusERC20V3/OlympusStakingV3.ts deleted file mode 100644 index 2144e453..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V3/OlympusStakingV3.ts +++ /dev/null @@ -1,982 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class AuthorityUpdated extends ethereum.Event { - get params(): AuthorityUpdated__Params { - return new AuthorityUpdated__Params(this); - } -} - -export class AuthorityUpdated__Params { - _event: AuthorityUpdated; - - constructor(event: AuthorityUpdated) { - this._event = event; - } - - get authority(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class DistributorSet extends ethereum.Event { - get params(): DistributorSet__Params { - return new DistributorSet__Params(this); - } -} - -export class DistributorSet__Params { - _event: DistributorSet; - - constructor(event: DistributorSet) { - this._event = event; - } - - get distributor(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class WarmupSet extends ethereum.Event { - get params(): WarmupSet__Params { - return new WarmupSet__Params(this); - } -} - -export class WarmupSet__Params { - _event: WarmupSet; - - constructor(event: WarmupSet) { - this._event = event; - } - - get warmup(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } -} - -export class OlympusStakingV3__epochResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - return map; - } - - getLength(): BigInt { - return this.value0; - } - - getNumber(): BigInt { - return this.value1; - } - - getEnd(): BigInt { - return this.value2; - } - - getDistribute(): BigInt { - return this.value3; - } -} - -export class OlympusStakingV3__warmupInfoResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: boolean; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: boolean) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromBoolean(this.value3)); - return map; - } - - getDeposit(): BigInt { - return this.value0; - } - - getGons(): BigInt { - return this.value1; - } - - getExpiry(): BigInt { - return this.value2; - } - - getLock(): boolean { - return this.value3; - } -} - -export class OlympusStakingV3 extends ethereum.SmartContract { - static bind(address: Address): OlympusStakingV3 { - return new OlympusStakingV3("OlympusStakingV3", address); - } - - OHM(): Address { - const result = super.call("OHM", "OHM():(address)", []); - - return result[0].toAddress(); - } - - try_OHM(): ethereum.CallResult
{ - const result = super.tryCall("OHM", "OHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - authority(): Address { - const result = super.call("authority", "authority():(address)", []); - - return result[0].toAddress(); - } - - try_authority(): ethereum.CallResult
{ - const result = super.tryCall("authority", "authority():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - claim(_to: Address, _rebasing: boolean): BigInt { - const result = super.call("claim", "claim(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromBoolean(_rebasing) - ]); - - return result[0].toBigInt(); - } - - try_claim(_to: Address, _rebasing: boolean): ethereum.CallResult { - const result = super.tryCall("claim", "claim(address,bool):(uint256)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromBoolean(_rebasing) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - distributor(): Address { - const result = super.call("distributor", "distributor():(address)", []); - - return result[0].toAddress(); - } - - try_distributor(): ethereum.CallResult
{ - const result = super.tryCall("distributor", "distributor():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - epoch(): OlympusStakingV3__epochResult { - const result = super.call( - "epoch", - "epoch():(uint256,uint256,uint256,uint256)", - [] - ); - - return new OlympusStakingV3__epochResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt() - ); - } - - try_epoch(): ethereum.CallResult { - const result = super.tryCall( - "epoch", - "epoch():(uint256,uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OlympusStakingV3__epochResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt() - ) - ); - } - - forfeit(): BigInt { - const result = super.call("forfeit", "forfeit():(uint256)", []); - - return result[0].toBigInt(); - } - - try_forfeit(): ethereum.CallResult { - const result = super.tryCall("forfeit", "forfeit():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - gOHM(): Address { - const result = super.call("gOHM", "gOHM():(address)", []); - - return result[0].toAddress(); - } - - try_gOHM(): ethereum.CallResult
{ - const result = super.tryCall("gOHM", "gOHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - index(): BigInt { - const result = super.call("index", "index():(uint256)", []); - - return result[0].toBigInt(); - } - - try_index(): ethereum.CallResult { - const result = super.tryCall("index", "index():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - rebase(): BigInt { - const result = super.call("rebase", "rebase():(uint256)", []); - - return result[0].toBigInt(); - } - - try_rebase(): ethereum.CallResult { - const result = super.tryCall("rebase", "rebase():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - sOHM(): Address { - const result = super.call("sOHM", "sOHM():(address)", []); - - return result[0].toAddress(); - } - - try_sOHM(): ethereum.CallResult
{ - const result = super.tryCall("sOHM", "sOHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - secondsToNextEpoch(): BigInt { - const result = super.call( - "secondsToNextEpoch", - "secondsToNextEpoch():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_secondsToNextEpoch(): ethereum.CallResult { - const result = super.tryCall( - "secondsToNextEpoch", - "secondsToNextEpoch():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - stake( - _to: Address, - _amount: BigInt, - _rebasing: boolean, - _claim: boolean - ): BigInt { - const result = super.call( - "stake", - "stake(address,uint256,bool,bool):(uint256)", - [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromBoolean(_rebasing), - ethereum.Value.fromBoolean(_claim) - ] - ); - - return result[0].toBigInt(); - } - - try_stake( - _to: Address, - _amount: BigInt, - _rebasing: boolean, - _claim: boolean - ): ethereum.CallResult { - const result = super.tryCall( - "stake", - "stake(address,uint256,bool,bool):(uint256)", - [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromBoolean(_rebasing), - ethereum.Value.fromBoolean(_claim) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - supplyInWarmup(): BigInt { - const result = super.call("supplyInWarmup", "supplyInWarmup():(uint256)", []); - - return result[0].toBigInt(); - } - - try_supplyInWarmup(): ethereum.CallResult { - const result = super.tryCall( - "supplyInWarmup", - "supplyInWarmup():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - unstake( - _to: Address, - _amount: BigInt, - _trigger: boolean, - _rebasing: boolean - ): BigInt { - const result = super.call( - "unstake", - "unstake(address,uint256,bool,bool):(uint256)", - [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromBoolean(_trigger), - ethereum.Value.fromBoolean(_rebasing) - ] - ); - - return result[0].toBigInt(); - } - - try_unstake( - _to: Address, - _amount: BigInt, - _trigger: boolean, - _rebasing: boolean - ): ethereum.CallResult { - const result = super.tryCall( - "unstake", - "unstake(address,uint256,bool,bool):(uint256)", - [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_amount), - ethereum.Value.fromBoolean(_trigger), - ethereum.Value.fromBoolean(_rebasing) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - unwrap(_to: Address, _amount: BigInt): BigInt { - const result = super.call("unwrap", "unwrap(address,uint256):(uint256)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_amount) - ]); - - return result[0].toBigInt(); - } - - try_unwrap(_to: Address, _amount: BigInt): ethereum.CallResult { - const result = super.tryCall("unwrap", "unwrap(address,uint256):(uint256)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - warmupInfo(param0: Address): OlympusStakingV3__warmupInfoResult { - const result = super.call( - "warmupInfo", - "warmupInfo(address):(uint256,uint256,uint256,bool)", - [ethereum.Value.fromAddress(param0)] - ); - - return new OlympusStakingV3__warmupInfoResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBoolean() - ); - } - - try_warmupInfo( - param0: Address - ): ethereum.CallResult { - const result = super.tryCall( - "warmupInfo", - "warmupInfo(address):(uint256,uint256,uint256,bool)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new OlympusStakingV3__warmupInfoResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBoolean() - ) - ); - } - - warmupPeriod(): BigInt { - const result = super.call("warmupPeriod", "warmupPeriod():(uint256)", []); - - return result[0].toBigInt(); - } - - try_warmupPeriod(): ethereum.CallResult { - const result = super.tryCall("warmupPeriod", "warmupPeriod():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - wrap(_to: Address, _amount: BigInt): BigInt { - const result = super.call("wrap", "wrap(address,uint256):(uint256)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_amount) - ]); - - return result[0].toBigInt(); - } - - try_wrap(_to: Address, _amount: BigInt): ethereum.CallResult { - const result = super.tryCall("wrap", "wrap(address,uint256):(uint256)", [ - ethereum.Value.fromAddress(_to), - ethereum.Value.fromUnsignedBigInt(_amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _ohm(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _sOHM(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _gOHM(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _epochLength(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _firstEpochNumber(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _firstEpochTime(): BigInt { - return this._call.inputValues[5].value.toBigInt(); - } - - get _authority(): Address { - return this._call.inputValues[6].value.toAddress(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ClaimCall extends ethereum.Call { - get inputs(): ClaimCall__Inputs { - return new ClaimCall__Inputs(this); - } - - get outputs(): ClaimCall__Outputs { - return new ClaimCall__Outputs(this); - } -} - -export class ClaimCall__Inputs { - _call: ClaimCall; - - constructor(call: ClaimCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _rebasing(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class ClaimCall__Outputs { - _call: ClaimCall; - - constructor(call: ClaimCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class ForfeitCall extends ethereum.Call { - get inputs(): ForfeitCall__Inputs { - return new ForfeitCall__Inputs(this); - } - - get outputs(): ForfeitCall__Outputs { - return new ForfeitCall__Outputs(this); - } -} - -export class ForfeitCall__Inputs { - _call: ForfeitCall; - - constructor(call: ForfeitCall) { - this._call = call; - } -} - -export class ForfeitCall__Outputs { - _call: ForfeitCall; - - constructor(call: ForfeitCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class RebaseCall extends ethereum.Call { - get inputs(): RebaseCall__Inputs { - return new RebaseCall__Inputs(this); - } - - get outputs(): RebaseCall__Outputs { - return new RebaseCall__Outputs(this); - } -} - -export class RebaseCall__Inputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } -} - -export class RebaseCall__Outputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class SetAuthorityCall extends ethereum.Call { - get inputs(): SetAuthorityCall__Inputs { - return new SetAuthorityCall__Inputs(this); - } - - get outputs(): SetAuthorityCall__Outputs { - return new SetAuthorityCall__Outputs(this); - } -} - -export class SetAuthorityCall__Inputs { - _call: SetAuthorityCall; - - constructor(call: SetAuthorityCall) { - this._call = call; - } - - get _newAuthority(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetAuthorityCall__Outputs { - _call: SetAuthorityCall; - - constructor(call: SetAuthorityCall) { - this._call = call; - } -} - -export class SetDistributorCall extends ethereum.Call { - get inputs(): SetDistributorCall__Inputs { - return new SetDistributorCall__Inputs(this); - } - - get outputs(): SetDistributorCall__Outputs { - return new SetDistributorCall__Outputs(this); - } -} - -export class SetDistributorCall__Inputs { - _call: SetDistributorCall; - - constructor(call: SetDistributorCall) { - this._call = call; - } - - get _distributor(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetDistributorCall__Outputs { - _call: SetDistributorCall; - - constructor(call: SetDistributorCall) { - this._call = call; - } -} - -export class SetWarmupLengthCall extends ethereum.Call { - get inputs(): SetWarmupLengthCall__Inputs { - return new SetWarmupLengthCall__Inputs(this); - } - - get outputs(): SetWarmupLengthCall__Outputs { - return new SetWarmupLengthCall__Outputs(this); - } -} - -export class SetWarmupLengthCall__Inputs { - _call: SetWarmupLengthCall; - - constructor(call: SetWarmupLengthCall) { - this._call = call; - } - - get _warmupPeriod(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetWarmupLengthCall__Outputs { - _call: SetWarmupLengthCall; - - constructor(call: SetWarmupLengthCall) { - this._call = call; - } -} - -export class StakeCall extends ethereum.Call { - get inputs(): StakeCall__Inputs { - return new StakeCall__Inputs(this); - } - - get outputs(): StakeCall__Outputs { - return new StakeCall__Outputs(this); - } -} - -export class StakeCall__Inputs { - _call: StakeCall; - - constructor(call: StakeCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _rebasing(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } - - get _claim(): boolean { - return this._call.inputValues[3].value.toBoolean(); - } -} - -export class StakeCall__Outputs { - _call: StakeCall; - - constructor(call: StakeCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class ToggleLockCall extends ethereum.Call { - get inputs(): ToggleLockCall__Inputs { - return new ToggleLockCall__Inputs(this); - } - - get outputs(): ToggleLockCall__Outputs { - return new ToggleLockCall__Outputs(this); - } -} - -export class ToggleLockCall__Inputs { - _call: ToggleLockCall; - - constructor(call: ToggleLockCall) { - this._call = call; - } -} - -export class ToggleLockCall__Outputs { - _call: ToggleLockCall; - - constructor(call: ToggleLockCall) { - this._call = call; - } -} - -export class UnstakeCall extends ethereum.Call { - get inputs(): UnstakeCall__Inputs { - return new UnstakeCall__Inputs(this); - } - - get outputs(): UnstakeCall__Outputs { - return new UnstakeCall__Outputs(this); - } -} - -export class UnstakeCall__Inputs { - _call: UnstakeCall; - - constructor(call: UnstakeCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _trigger(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } - - get _rebasing(): boolean { - return this._call.inputValues[3].value.toBoolean(); - } -} - -export class UnstakeCall__Outputs { - _call: UnstakeCall; - - constructor(call: UnstakeCall) { - this._call = call; - } - - get amount_(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class UnwrapCall extends ethereum.Call { - get inputs(): UnwrapCall__Inputs { - return new UnwrapCall__Inputs(this); - } - - get outputs(): UnwrapCall__Outputs { - return new UnwrapCall__Outputs(this); - } -} - -export class UnwrapCall__Inputs { - _call: UnwrapCall; - - constructor(call: UnwrapCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class UnwrapCall__Outputs { - _call: UnwrapCall; - - constructor(call: UnwrapCall) { - this._call = call; - } - - get sBalance_(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class WrapCall extends ethereum.Call { - get inputs(): WrapCall__Inputs { - return new WrapCall__Inputs(this); - } - - get outputs(): WrapCall__Outputs { - return new WrapCall__Outputs(this); - } -} - -export class WrapCall__Inputs { - _call: WrapCall; - - constructor(call: WrapCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class WrapCall__Outputs { - _call: WrapCall; - - constructor(call: WrapCall) { - this._call = call; - } - - get gBalance_(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V3/UniswapV2Pair.ts b/subgraphs/ethereum/generated/sOlympusERC20V3/UniswapV2Pair.ts deleted file mode 100644 index b36eea33..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V3/UniswapV2Pair.ts +++ /dev/null @@ -1,1092 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Burn extends ethereum.Event { - get params(): Burn__Params { - return new Burn__Params(this); - } -} - -export class Burn__Params { - _event: Burn; - - constructor(event: Burn) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[3].value.toAddress(); - } -} - -export class Mint extends ethereum.Event { - get params(): Mint__Params { - return new Mint__Params(this); - } -} - -export class Mint__Params { - _event: Mint; - - constructor(event: Mint) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class Swap extends ethereum.Event { - get params(): Swap__Params { - return new Swap__Params(this); - } -} - -export class Swap__Params { - _event: Swap; - - constructor(event: Swap) { - this._event = event; - } - - get sender(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get amount0In(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get amount1In(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get amount0Out(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } - - get to(): Address { - return this._event.parameters[5].value.toAddress(); - } -} - -export class Sync extends ethereum.Event { - get params(): Sync__Params { - return new Sync__Params(this); - } -} - -export class Sync__Params { - _event: Sync; - - constructor(event: Sync) { - this._event = event; - } - - get reserve0(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get reserve1(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class UniswapV2Pair__burnResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } - - getAmount0(): BigInt { - return this.value0; - } - - getAmount1(): BigInt { - return this.value1; - } -} - -export class UniswapV2Pair__getReservesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - get_reserve0(): BigInt { - return this.value0; - } - - get_reserve1(): BigInt { - return this.value1; - } - - get_blockTimestampLast(): BigInt { - return this.value2; - } -} - -export class UniswapV2Pair extends ethereum.SmartContract { - static bind(address: Address): UniswapV2Pair { - return new UniswapV2Pair("UniswapV2Pair", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - MINIMUM_LIQUIDITY(): BigInt { - const result = super.call( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_MINIMUM_LIQUIDITY(): ethereum.CallResult { - const result = super.tryCall( - "MINIMUM_LIQUIDITY", - "MINIMUM_LIQUIDITY():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - PERMIT_TYPEHASH(): Bytes { - const result = super.call( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_PERMIT_TYPEHASH(): ethereum.CallResult { - const result = super.tryCall( - "PERMIT_TYPEHASH", - "PERMIT_TYPEHASH():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(param0: Address, param1: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - - return result[0].toBigInt(); - } - - try_allowance(param0: Address, param1: Address): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(param0), ethereum.Value.fromAddress(param1)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceOf(param0: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(param0: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - burn(to: Address): UniswapV2Pair__burnResult { - const result = super.call("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return new UniswapV2Pair__burnResult( - result[0].toBigInt(), - result[1].toBigInt() - ); - } - - try_burn(to: Address): ethereum.CallResult { - const result = super.tryCall("burn", "burn(address):(uint256,uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__burnResult(value[0].toBigInt(), value[1].toBigInt()) - ); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - factory(): Address { - const result = super.call("factory", "factory():(address)", []); - - return result[0].toAddress(); - } - - try_factory(): ethereum.CallResult
{ - const result = super.tryCall("factory", "factory():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getReserves(): UniswapV2Pair__getReservesResult { - const result = super.call( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - - return new UniswapV2Pair__getReservesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_getReserves(): ethereum.CallResult { - const result = super.tryCall( - "getReserves", - "getReserves():(uint112,uint112,uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new UniswapV2Pair__getReservesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - kLast(): BigInt { - const result = super.call("kLast", "kLast():(uint256)", []); - - return result[0].toBigInt(); - } - - try_kLast(): ethereum.CallResult { - const result = super.tryCall("kLast", "kLast():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - mint(to: Address): BigInt { - const result = super.call("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - - return result[0].toBigInt(); - } - - try_mint(to: Address): ethereum.CallResult { - const result = super.tryCall("mint", "mint(address):(uint256)", [ - ethereum.Value.fromAddress(to) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(param0: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_nonces(param0: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price0CumulativeLast(): BigInt { - const result = super.call( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price0CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price0CumulativeLast", - "price0CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - price1CumulativeLast(): BigInt { - const result = super.call( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_price1CumulativeLast(): ethereum.CallResult { - const result = super.tryCall( - "price1CumulativeLast", - "price1CumulativeLast():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - token0(): Address { - const result = super.call("token0", "token0():(address)", []); - - return result[0].toAddress(); - } - - try_token0(): ethereum.CallResult
{ - const result = super.tryCall("token0", "token0():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - token1(): Address { - const result = super.call("token1", "token1():(address)", []); - - return result[0].toAddress(); - } - - try_token1(): ethereum.CallResult
{ - const result = super.tryCall("token1", "token1():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class BurnCall extends ethereum.Call { - get inputs(): BurnCall__Inputs { - return new BurnCall__Inputs(this); - } - - get outputs(): BurnCall__Outputs { - return new BurnCall__Outputs(this); - } -} - -export class BurnCall__Inputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class BurnCall__Outputs { - _call: BurnCall; - - constructor(call: BurnCall) { - this._call = call; - } - - get amount0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } - - get amount1(): BigInt { - return this._call.outputValues[1].value.toBigInt(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _token0(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _token1(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class MintCall extends ethereum.Call { - get inputs(): MintCall__Inputs { - return new MintCall__Inputs(this); - } - - get outputs(): MintCall__Outputs { - return new MintCall__Outputs(this); - } -} - -export class MintCall__Inputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class MintCall__Outputs { - _call: MintCall; - - constructor(call: MintCall) { - this._call = call; - } - - get liquidity(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class SkimCall extends ethereum.Call { - get inputs(): SkimCall__Inputs { - return new SkimCall__Inputs(this); - } - - get outputs(): SkimCall__Outputs { - return new SkimCall__Outputs(this); - } -} - -export class SkimCall__Inputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SkimCall__Outputs { - _call: SkimCall; - - constructor(call: SkimCall) { - this._call = call; - } -} - -export class SwapCall extends ethereum.Call { - get inputs(): SwapCall__Inputs { - return new SwapCall__Inputs(this); - } - - get outputs(): SwapCall__Outputs { - return new SwapCall__Outputs(this); - } -} - -export class SwapCall__Inputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } - - get amount0Out(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get amount1Out(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get to(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get data(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class SwapCall__Outputs { - _call: SwapCall; - - constructor(call: SwapCall) { - this._call = call; - } -} - -export class SyncCall extends ethereum.Call { - get inputs(): SyncCall__Inputs { - return new SyncCall__Inputs(this); - } - - get outputs(): SyncCall__Outputs { - return new SyncCall__Outputs(this); - } -} - -export class SyncCall__Inputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class SyncCall__Outputs { - _call: SyncCall; - - constructor(call: SyncCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/sOlympusERC20V3/sOlympusERC20V3.ts b/subgraphs/ethereum/generated/sOlympusERC20V3/sOlympusERC20V3.ts deleted file mode 100644 index 49fac1e0..00000000 --- a/subgraphs/ethereum/generated/sOlympusERC20V3/sOlympusERC20V3.ts +++ /dev/null @@ -1,1194 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class Approval extends ethereum.Event { - get params(): Approval__Params { - return new Approval__Params(this); - } -} - -export class Approval__Params { - _event: Approval; - - constructor(event: Approval) { - this._event = event; - } - - get owner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get spender(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class LogRebase extends ethereum.Event { - get params(): LogRebase__Params { - return new LogRebase__Params(this); - } -} - -export class LogRebase__Params { - _event: LogRebase; - - constructor(event: LogRebase) { - this._event = event; - } - - get epoch(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get rebase(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get index(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class LogStakingContractUpdated extends ethereum.Event { - get params(): LogStakingContractUpdated__Params { - return new LogStakingContractUpdated__Params(this); - } -} - -export class LogStakingContractUpdated__Params { - _event: LogStakingContractUpdated; - - constructor(event: LogStakingContractUpdated) { - this._event = event; - } - - get stakingContract(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class LogSupply extends ethereum.Event { - get params(): LogSupply__Params { - return new LogSupply__Params(this); - } -} - -export class LogSupply__Params { - _event: LogSupply; - - constructor(event: LogSupply) { - this._event = event; - } - - get epoch(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get totalSupply(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } -} - -export class Transfer extends ethereum.Event { - get params(): Transfer__Params { - return new Transfer__Params(this); - } -} - -export class Transfer__Params { - _event: Transfer; - - constructor(event: Transfer) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get value(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class sOlympusERC20V3__rebasesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - value5: BigInt; - value6: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt, - value5: BigInt, - value6: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - this.value5 = value5; - this.value6 = value6; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); - map.set("value6", ethereum.Value.fromUnsignedBigInt(this.value6)); - return map; - } - - getEpoch(): BigInt { - return this.value0; - } - - getRebase(): BigInt { - return this.value1; - } - - getTotalStakedBefore(): BigInt { - return this.value2; - } - - getTotalStakedAfter(): BigInt { - return this.value3; - } - - getAmountRebased(): BigInt { - return this.value4; - } - - getIndex(): BigInt { - return this.value5; - } - - getBlockNumberOccured(): BigInt { - return this.value6; - } -} - -export class sOlympusERC20V3 extends ethereum.SmartContract { - static bind(address: Address): sOlympusERC20V3 { - return new sOlympusERC20V3("sOlympusERC20V3", address); - } - - DOMAIN_SEPARATOR(): Bytes { - const result = super.call( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - - return result[0].toBytes(); - } - - try_DOMAIN_SEPARATOR(): ethereum.CallResult { - const result = super.tryCall( - "DOMAIN_SEPARATOR", - "DOMAIN_SEPARATOR():(bytes32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytes()); - } - - allowance(owner_: Address, spender: Address): BigInt { - const result = super.call( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner_), ethereum.Value.fromAddress(spender)] - ); - - return result[0].toBigInt(); - } - - try_allowance( - owner_: Address, - spender: Address - ): ethereum.CallResult { - const result = super.tryCall( - "allowance", - "allowance(address,address):(uint256)", - [ethereum.Value.fromAddress(owner_), ethereum.Value.fromAddress(spender)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - approve(spender: Address, value: BigInt): boolean { - const result = super.call("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_approve(spender: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("approve", "approve(address,uint256):(bool)", [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - balanceForGons(gons: BigInt): BigInt { - const result = super.call( - "balanceForGons", - "balanceForGons(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(gons)] - ); - - return result[0].toBigInt(); - } - - try_balanceForGons(gons: BigInt): ethereum.CallResult { - const result = super.tryCall( - "balanceForGons", - "balanceForGons(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(gons)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - balanceOf(who: Address): BigInt { - const result = super.call("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(who) - ]); - - return result[0].toBigInt(); - } - - try_balanceOf(who: Address): ethereum.CallResult { - const result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ - ethereum.Value.fromAddress(who) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - circulatingSupply(): BigInt { - const result = super.call( - "circulatingSupply", - "circulatingSupply():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_circulatingSupply(): ethereum.CallResult { - const result = super.tryCall( - "circulatingSupply", - "circulatingSupply():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - debtBalances(param0: Address): BigInt { - const result = super.call("debtBalances", "debtBalances(address):(uint256)", [ - ethereum.Value.fromAddress(param0) - ]); - - return result[0].toBigInt(); - } - - try_debtBalances(param0: Address): ethereum.CallResult { - const result = super.tryCall( - "debtBalances", - "debtBalances(address):(uint256)", - [ethereum.Value.fromAddress(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { - const result = super.call( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_decreaseAllowance( - spender: Address, - subtractedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "decreaseAllowance", - "decreaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(subtractedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - fromG(amount: BigInt): BigInt { - const result = super.call("fromG", "fromG(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBigInt(); - } - - try_fromG(amount: BigInt): ethereum.CallResult { - const result = super.tryCall("fromG", "fromG(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - gOHM(): Address { - const result = super.call("gOHM", "gOHM():(address)", []); - - return result[0].toAddress(); - } - - try_gOHM(): ethereum.CallResult
{ - const result = super.tryCall("gOHM", "gOHM():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - gonsForBalance(amount: BigInt): BigInt { - const result = super.call( - "gonsForBalance", - "gonsForBalance(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amount)] - ); - - return result[0].toBigInt(); - } - - try_gonsForBalance(amount: BigInt): ethereum.CallResult { - const result = super.tryCall( - "gonsForBalance", - "gonsForBalance(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(amount)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - increaseAllowance(spender: Address, addedValue: BigInt): boolean { - const result = super.call( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - - return result[0].toBoolean(); - } - - try_increaseAllowance( - spender: Address, - addedValue: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "increaseAllowance", - "increaseAllowance(address,uint256):(bool)", - [ - ethereum.Value.fromAddress(spender), - ethereum.Value.fromUnsignedBigInt(addedValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - index(): BigInt { - const result = super.call("index", "index():(uint256)", []); - - return result[0].toBigInt(); - } - - try_index(): ethereum.CallResult { - const result = super.tryCall("index", "index():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - name(): string { - const result = super.call("name", "name():(string)", []); - - return result[0].toString(); - } - - try_name(): ethereum.CallResult { - const result = super.tryCall("name", "name():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - nonces(owner: Address): BigInt { - const result = super.call("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - - return result[0].toBigInt(); - } - - try_nonces(owner: Address): ethereum.CallResult { - const result = super.tryCall("nonces", "nonces(address):(uint256)", [ - ethereum.Value.fromAddress(owner) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - rebase(profit_: BigInt, epoch_: BigInt): BigInt { - const result = super.call("rebase", "rebase(uint256,uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(profit_), - ethereum.Value.fromUnsignedBigInt(epoch_) - ]); - - return result[0].toBigInt(); - } - - try_rebase(profit_: BigInt, epoch_: BigInt): ethereum.CallResult { - const result = super.tryCall("rebase", "rebase(uint256,uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(profit_), - ethereum.Value.fromUnsignedBigInt(epoch_) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - rebases(param0: BigInt): sOlympusERC20V3__rebasesResult { - const result = super.call( - "rebases", - "rebases(uint256):(uint256,uint256,uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromUnsignedBigInt(param0)] - ); - - return new sOlympusERC20V3__rebasesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt(), - result[5].toBigInt(), - result[6].toBigInt() - ); - } - - try_rebases( - param0: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "rebases", - "rebases(uint256):(uint256,uint256,uint256,uint256,uint256,uint256,uint256)", - [ethereum.Value.fromUnsignedBigInt(param0)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new sOlympusERC20V3__rebasesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt(), - value[5].toBigInt(), - value[6].toBigInt() - ) - ); - } - - stakingContract(): Address { - const result = super.call( - "stakingContract", - "stakingContract():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_stakingContract(): ethereum.CallResult
{ - const result = super.tryCall( - "stakingContract", - "stakingContract():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - symbol(): string { - const result = super.call("symbol", "symbol():(string)", []); - - return result[0].toString(); - } - - try_symbol(): ethereum.CallResult { - const result = super.tryCall("symbol", "symbol():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - toG(amount: BigInt): BigInt { - const result = super.call("toG", "toG(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(amount) - ]); - - return result[0].toBigInt(); - } - - try_toG(amount: BigInt): ethereum.CallResult { - const result = super.tryCall("toG", "toG(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(amount) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - totalSupply(): BigInt { - const result = super.call("totalSupply", "totalSupply():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalSupply(): ethereum.CallResult { - const result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - transfer(to: Address, value: BigInt): boolean { - const result = super.call("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - - return result[0].toBoolean(); - } - - try_transfer(to: Address, value: BigInt): ethereum.CallResult { - const result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - transferFrom(from: Address, to: Address, value: BigInt): boolean { - const result = super.call( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - - return result[0].toBoolean(); - } - - try_transferFrom( - from: Address, - to: Address, - value: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "transferFrom", - "transferFrom(address,address,uint256):(bool)", - [ - ethereum.Value.fromAddress(from), - ethereum.Value.fromAddress(to), - ethereum.Value.fromUnsignedBigInt(value) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - treasury(): Address { - const result = super.call("treasury", "treasury():(address)", []); - - return result[0].toAddress(); - } - - try_treasury(): ethereum.CallResult
{ - const result = super.tryCall("treasury", "treasury():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class ApproveCall extends ethereum.Call { - get inputs(): ApproveCall__Inputs { - return new ApproveCall__Inputs(this); - } - - get outputs(): ApproveCall__Outputs { - return new ApproveCall__Outputs(this); - } -} - -export class ApproveCall__Inputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class ApproveCall__Outputs { - _call: ApproveCall; - - constructor(call: ApproveCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class ChangeDebtCall extends ethereum.Call { - get inputs(): ChangeDebtCall__Inputs { - return new ChangeDebtCall__Inputs(this); - } - - get outputs(): ChangeDebtCall__Outputs { - return new ChangeDebtCall__Outputs(this); - } -} - -export class ChangeDebtCall__Inputs { - _call: ChangeDebtCall; - - constructor(call: ChangeDebtCall) { - this._call = call; - } - - get amount(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get debtor(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get add(): boolean { - return this._call.inputValues[2].value.toBoolean(); - } -} - -export class ChangeDebtCall__Outputs { - _call: ChangeDebtCall; - - constructor(call: ChangeDebtCall) { - this._call = call; - } -} - -export class DecreaseAllowanceCall extends ethereum.Call { - get inputs(): DecreaseAllowanceCall__Inputs { - return new DecreaseAllowanceCall__Inputs(this); - } - - get outputs(): DecreaseAllowanceCall__Outputs { - return new DecreaseAllowanceCall__Outputs(this); - } -} - -export class DecreaseAllowanceCall__Inputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get subtractedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class DecreaseAllowanceCall__Outputs { - _call: DecreaseAllowanceCall; - - constructor(call: DecreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class IncreaseAllowanceCall extends ethereum.Call { - get inputs(): IncreaseAllowanceCall__Inputs { - return new IncreaseAllowanceCall__Inputs(this); - } - - get outputs(): IncreaseAllowanceCall__Outputs { - return new IncreaseAllowanceCall__Outputs(this); - } -} - -export class IncreaseAllowanceCall__Inputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get spender(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get addedValue(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class IncreaseAllowanceCall__Outputs { - _call: IncreaseAllowanceCall; - - constructor(call: IncreaseAllowanceCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class InitializeCall extends ethereum.Call { - get inputs(): InitializeCall__Inputs { - return new InitializeCall__Inputs(this); - } - - get outputs(): InitializeCall__Outputs { - return new InitializeCall__Outputs(this); - } -} - -export class InitializeCall__Inputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } - - get _stakingContract(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _treasury(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class InitializeCall__Outputs { - _call: InitializeCall; - - constructor(call: InitializeCall) { - this._call = call; - } -} - -export class PermitCall extends ethereum.Call { - get inputs(): PermitCall__Inputs { - return new PermitCall__Inputs(this); - } - - get outputs(): PermitCall__Outputs { - return new PermitCall__Outputs(this); - } -} - -export class PermitCall__Inputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } - - get owner(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get spender(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get deadline(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get v(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get r(): Bytes { - return this._call.inputValues[5].value.toBytes(); - } - - get s(): Bytes { - return this._call.inputValues[6].value.toBytes(); - } -} - -export class PermitCall__Outputs { - _call: PermitCall; - - constructor(call: PermitCall) { - this._call = call; - } -} - -export class RebaseCall extends ethereum.Call { - get inputs(): RebaseCall__Inputs { - return new RebaseCall__Inputs(this); - } - - get outputs(): RebaseCall__Outputs { - return new RebaseCall__Outputs(this); - } -} - -export class RebaseCall__Inputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } - - get profit_(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get epoch_(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class RebaseCall__Outputs { - _call: RebaseCall; - - constructor(call: RebaseCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class SetIndexCall extends ethereum.Call { - get inputs(): SetIndexCall__Inputs { - return new SetIndexCall__Inputs(this); - } - - get outputs(): SetIndexCall__Outputs { - return new SetIndexCall__Outputs(this); - } -} - -export class SetIndexCall__Inputs { - _call: SetIndexCall; - - constructor(call: SetIndexCall) { - this._call = call; - } - - get _index(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } -} - -export class SetIndexCall__Outputs { - _call: SetIndexCall; - - constructor(call: SetIndexCall) { - this._call = call; - } -} - -export class SetgOHMCall extends ethereum.Call { - get inputs(): SetgOHMCall__Inputs { - return new SetgOHMCall__Inputs(this); - } - - get outputs(): SetgOHMCall__Outputs { - return new SetgOHMCall__Outputs(this); - } -} - -export class SetgOHMCall__Inputs { - _call: SetgOHMCall; - - constructor(call: SetgOHMCall) { - this._call = call; - } - - get _gOHM(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetgOHMCall__Outputs { - _call: SetgOHMCall; - - constructor(call: SetgOHMCall) { - this._call = call; - } -} - -export class TransferCall extends ethereum.Call { - get inputs(): TransferCall__Inputs { - return new TransferCall__Inputs(this); - } - - get outputs(): TransferCall__Outputs { - return new TransferCall__Outputs(this); - } -} - -export class TransferCall__Inputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get to(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class TransferCall__Outputs { - _call: TransferCall; - - constructor(call: TransferCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} - -export class TransferFromCall extends ethereum.Call { - get inputs(): TransferFromCall__Inputs { - return new TransferFromCall__Inputs(this); - } - - get outputs(): TransferFromCall__Outputs { - return new TransferFromCall__Outputs(this); - } -} - -export class TransferFromCall__Inputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get from(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get to(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get value(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } -} - -export class TransferFromCall__Outputs { - _call: TransferFromCall; - - constructor(call: TransferFromCall) { - this._call = call; - } - - get value0(): boolean { - return this._call.outputValues[0].value.toBoolean(); - } -} diff --git a/subgraphs/ethereum/generated/schema.ts b/subgraphs/ethereum/generated/schema.ts index 7219e30f..4c582fc7 100644 --- a/subgraphs/ethereum/generated/schema.ts +++ b/subgraphs/ethereum/generated/schema.ts @@ -10,339 +10,6 @@ import { Value, ValueKind} from "@graphprotocol/graph-ts"; -export class DailyBond extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - const id = this.get("id"); - assert(id != null, "Cannot save DailyBond entity without an ID"); - if (id) { - assert( - id.kind == ValueKind.STRING, - `Entities of type DailyBond must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` - ); - store.set("DailyBond", id.toString(), this); - } - } - - static loadInBlock(id: string): DailyBond | null { - return changetype(store.get_in_block("DailyBond", id)); - } - - static load(id: string): DailyBond | null { - return changetype(store.get("DailyBond", id)); - } - - get id(): string { - const value = this.get("id"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get timestamp(): BigInt { - const value = this.get("timestamp"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigInt(); - } - } - - set timestamp(value: BigInt) { - this.set("timestamp", Value.fromBigInt(value)); - } - - get token(): string { - const value = this.get("token"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set token(value: string) { - this.set("token", Value.fromString(value)); - } - - get amount(): BigDecimal { - const value = this.get("amount"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set amount(value: BigDecimal) { - this.set("amount", Value.fromBigDecimal(value)); - } - - get value(): BigDecimal { - const value = this.get("value"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set value(value: BigDecimal) { - this.set("value", Value.fromBigDecimal(value)); - } -} - -export class Rebase extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - const id = this.get("id"); - assert(id != null, "Cannot save Rebase entity without an ID"); - if (id) { - assert( - id.kind == ValueKind.STRING, - `Entities of type Rebase must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` - ); - store.set("Rebase", id.toString(), this); - } - } - - static loadInBlock(id: string): Rebase | null { - return changetype(store.get_in_block("Rebase", id)); - } - - static load(id: string): Rebase | null { - return changetype(store.get("Rebase", id)); - } - - get id(): string { - const value = this.get("id"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get amount(): BigDecimal { - const value = this.get("amount"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set amount(value: BigDecimal) { - this.set("amount", Value.fromBigDecimal(value)); - } - - get stakedOhms(): BigDecimal { - const value = this.get("stakedOhms"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set stakedOhms(value: BigDecimal) { - this.set("stakedOhms", Value.fromBigDecimal(value)); - } - - get percentage(): BigDecimal { - const value = this.get("percentage"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set percentage(value: BigDecimal) { - this.set("percentage", Value.fromBigDecimal(value)); - } - - get contract(): string { - const value = this.get("contract"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set contract(value: string) { - this.set("contract", Value.fromString(value)); - } - - get timestamp(): BigInt { - const value = this.get("timestamp"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigInt(); - } - } - - set timestamp(value: BigInt) { - this.set("timestamp", Value.fromBigInt(value)); - } - - get value(): BigDecimal { - const value = this.get("value"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set value(value: BigDecimal) { - this.set("value", Value.fromBigDecimal(value)); - } -} - -export class DailyStakingReward extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - const id = this.get("id"); - assert(id != null, "Cannot save DailyStakingReward entity without an ID"); - if (id) { - assert( - id.kind == ValueKind.STRING, - `Entities of type DailyStakingReward must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` - ); - store.set("DailyStakingReward", id.toString(), this); - } - } - - static loadInBlock(id: string): DailyStakingReward | null { - return changetype( - store.get_in_block("DailyStakingReward", id) - ); - } - - static load(id: string): DailyStakingReward | null { - return changetype( - store.get("DailyStakingReward", id) - ); - } - - get id(): string { - const value = this.get("id"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get timestamp(): BigInt { - const value = this.get("timestamp"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigInt(); - } - } - - set timestamp(value: BigInt) { - this.set("timestamp", Value.fromBigInt(value)); - } - - get amount(): BigDecimal { - const value = this.get("amount"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set amount(value: BigDecimal) { - this.set("amount", Value.fromBigDecimal(value)); - } - - get value(): BigDecimal { - const value = this.get("value"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set value(value: BigDecimal) { - this.set("value", Value.fromBigDecimal(value)); - } -} - -export class Token extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - const id = this.get("id"); - assert(id != null, "Cannot save Token entity without an ID"); - if (id) { - assert( - id.kind == ValueKind.STRING, - `Entities of type Token must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` - ); - store.set("Token", id.toString(), this); - } - } - - static loadInBlock(id: string): Token | null { - return changetype(store.get_in_block("Token", id)); - } - - static load(id: string): Token | null { - return changetype(store.get("Token", id)); - } - - get id(): string { - const value = this.get("id"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } -} - export class ProtocolMetric extends Entity { constructor(id: Bytes) { super(); @@ -701,152 +368,6 @@ export class ProtocolMetric extends Entity { } } -export class BondDiscount extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - const id = this.get("id"); - assert(id != null, "Cannot save BondDiscount entity without an ID"); - if (id) { - assert( - id.kind == ValueKind.STRING, - `Entities of type BondDiscount must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` - ); - store.set("BondDiscount", id.toString(), this); - } - } - - static loadInBlock(id: string): BondDiscount | null { - return changetype( - store.get_in_block("BondDiscount", id) - ); - } - - static load(id: string): BondDiscount | null { - return changetype(store.get("BondDiscount", id)); - } - - get id(): string { - const value = this.get("id"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get timestamp(): BigInt { - const value = this.get("timestamp"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigInt(); - } - } - - set timestamp(value: BigInt) { - this.set("timestamp", Value.fromBigInt(value)); - } - - get dai_discount(): BigDecimal { - const value = this.get("dai_discount"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set dai_discount(value: BigDecimal) { - this.set("dai_discount", Value.fromBigDecimal(value)); - } - - get ohmdai_discount(): BigDecimal { - const value = this.get("ohmdai_discount"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set ohmdai_discount(value: BigDecimal) { - this.set("ohmdai_discount", Value.fromBigDecimal(value)); - } - - get frax_discount(): BigDecimal { - const value = this.get("frax_discount"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set frax_discount(value: BigDecimal) { - this.set("frax_discount", Value.fromBigDecimal(value)); - } - - get ohmfrax_discount(): BigDecimal { - const value = this.get("ohmfrax_discount"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set ohmfrax_discount(value: BigDecimal) { - this.set("ohmfrax_discount", Value.fromBigDecimal(value)); - } - - get eth_discount(): BigDecimal { - const value = this.get("eth_discount"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set eth_discount(value: BigDecimal) { - this.set("eth_discount", Value.fromBigDecimal(value)); - } - - get lusd_discount(): BigDecimal { - const value = this.get("lusd_discount"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set lusd_discount(value: BigDecimal) { - this.set("lusd_discount", Value.fromBigDecimal(value)); - } - - get ohmlusd_discount(): BigDecimal { - const value = this.get("ohmlusd_discount"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set ohmlusd_discount(value: BigDecimal) { - this.set("ohmlusd_discount", Value.fromBigDecimal(value)); - } -} - export class TokenRecord extends Entity { constructor(id: Bytes) { super(); diff --git a/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts b/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts index 60d34fea..c2075cf0 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts @@ -6,7 +6,6 @@ import { pushTokenRecordArray } from "../../../shared/src/utils/ArrayHelper"; import { toDecimal } from "../../../shared/src/utils/Decimals"; import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; import { createTokenSupply, TYPE_LIQUIDITY } from "../../../shared/src/utils/TokenSupplyHelper"; -import { ERC20 } from "../../generated/PriceSnapshot/ERC20"; import { BalancerPoolToken } from "../../generated/ProtocolMetrics/BalancerPoolToken"; import { BalancerVault } from "../../generated/ProtocolMetrics/BalancerVault"; import { BalancerPoolSnapshot } from "../../generated/schema"; @@ -24,6 +23,7 @@ import { } from "../utils/ContractHelper"; import { getUSDRate } from "../utils/Price"; import { getWalletAddressesForContract } from "../utils/ProtocolAddresses"; +import { ERC20 } from "../../generated/ProtocolMetrics/ERC20"; function getBalancerVault(vaultAddress: string, _blockNumber: BigInt): BalancerVault { return BalancerVault.bind(Address.fromString(vaultAddress)); diff --git a/subgraphs/ethereum/src/sOlympus/sOlympusERC20V1.ts b/subgraphs/ethereum/src/sOlympus/sOlympusERC20V1.ts index ddb20b02..dd6c1dd6 100644 --- a/subgraphs/ethereum/src/sOlympus/sOlympusERC20V1.ts +++ b/subgraphs/ethereum/src/sOlympus/sOlympusERC20V1.ts @@ -5,7 +5,6 @@ import { Rebase } from "../../generated/schema"; import { OlympusERC20 } from "../../generated/sOlympusERC20V1/OlympusERC20"; import { RebaseCall } from "../../generated/sOlympusERC20V1/sOlympusERC20"; import { ERC20_OHM_V1, ERC20_OHM_V2, STAKING_CONTRACT_V1 } from "../utils/Constants"; -import { createDailyStakingReward } from "../utils/DailyStakingReward"; import { getUSDRate } from "../utils/Price"; export function rebaseFunction(call: RebaseCall): void { @@ -25,7 +24,5 @@ export function rebaseFunction(call: RebaseCall): void { rebase.timestamp = call.block.timestamp; rebase.value = rebase.amount.times(getUSDRate(ERC20_OHM_V2, call.block.number)); rebase.save(); - - createDailyStakingReward(rebase.timestamp, rebase.amount, call.block.number); } } diff --git a/subgraphs/ethereum/src/sOlympus/sOlympusERC20V2.ts b/subgraphs/ethereum/src/sOlympus/sOlympusERC20V2.ts index 9abc8956..188b5f33 100644 --- a/subgraphs/ethereum/src/sOlympus/sOlympusERC20V2.ts +++ b/subgraphs/ethereum/src/sOlympus/sOlympusERC20V2.ts @@ -5,7 +5,6 @@ import { Rebase } from "../../generated/schema"; import { OlympusERC20 } from "../../generated/sOlympusERC20V2/OlympusERC20"; import { RebaseCall } from "../../generated/sOlympusERC20V2/sOlympusERC20V2"; import { ERC20_OHM_V1, ERC20_OHM_V2, STAKING_CONTRACT_V2 } from "../utils/Constants"; -import { createDailyStakingReward } from "../utils/DailyStakingReward"; import { getUSDRate } from "../utils/Price"; export function rebaseFunction(call: RebaseCall): void { @@ -25,7 +24,5 @@ export function rebaseFunction(call: RebaseCall): void { rebase.timestamp = call.block.timestamp; rebase.value = rebase.amount.times(getUSDRate(ERC20_OHM_V2, call.block.number)); rebase.save(); - - createDailyStakingReward(rebase.timestamp, rebase.amount, call.block.number); } } diff --git a/subgraphs/ethereum/src/sOlympus/sOlympusERC20V3.ts b/subgraphs/ethereum/src/sOlympus/sOlympusERC20V3.ts index ca3a8dfe..a0fb9ba8 100644 --- a/subgraphs/ethereum/src/sOlympus/sOlympusERC20V3.ts +++ b/subgraphs/ethereum/src/sOlympus/sOlympusERC20V3.ts @@ -5,7 +5,6 @@ import { Rebase } from "../../generated/schema"; import { OlympusERC20 } from "../../generated/sOlympusERC20V3/OlympusERC20"; import { RebaseCall } from "../../generated/sOlympusERC20V3/sOlympusERC20V3"; import { ERC20_OHM_V2, STAKING_CONTRACT_V3 } from "../utils/Constants"; -import { createDailyStakingReward } from "../utils/DailyStakingReward"; import { getUSDRate } from "../utils/Price"; export function rebaseFunction(call: RebaseCall): void { @@ -25,7 +24,5 @@ export function rebaseFunction(call: RebaseCall): void { rebase.timestamp = call.block.timestamp; rebase.value = rebase.amount.times(getUSDRate(ERC20_OHM_V2, call.block.number)); rebase.save(); - - createDailyStakingReward(rebase.timestamp, rebase.amount, call.block.number); } } diff --git a/subgraphs/ethereum/src/utils/DailyStakingReward.ts b/subgraphs/ethereum/src/utils/DailyStakingReward.ts deleted file mode 100644 index 8b29fbf0..00000000 --- a/subgraphs/ethereum/src/utils/DailyStakingReward.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { BigDecimal, BigInt } from "@graphprotocol/graph-ts"; - -import { DailyStakingReward } from "../../generated/schema"; -import { ERC20_OHM_V2 } from "./Constants"; -import { dayFromTimestamp } from "./Dates"; -import { getUSDRate } from "./Price"; - -export function loadOrCreateDailyStakingReward(timestamp: BigInt): DailyStakingReward { - const day_timestamp = dayFromTimestamp(timestamp); - const id = day_timestamp; - let dailySR = DailyStakingReward.load(id); - if (dailySR == null) { - dailySR = new DailyStakingReward(id); - dailySR.amount = new BigDecimal(new BigInt(0)); - dailySR.value = new BigDecimal(new BigInt(0)); - dailySR.timestamp = BigInt.fromString(day_timestamp); - dailySR.save(); - } - return dailySR as DailyStakingReward; -} - -export function createDailyStakingReward( - timestamp: BigInt, - amount: BigDecimal, - block: BigInt, -): void { - const dailySR = loadOrCreateDailyStakingReward(timestamp); - dailySR.amount = dailySR.amount.plus(amount); - dailySR.value = dailySR.amount.times(getUSDRate(ERC20_OHM_V2, block)); - dailySR.save(); -} diff --git a/subgraphs/ethereum/src/utils/Tokens.ts b/subgraphs/ethereum/src/utils/Tokens.ts deleted file mode 100644 index e35dd770..00000000 --- a/subgraphs/ethereum/src/utils/Tokens.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Token } from '../../generated/schema' - -export function loadOrCreateToken(name: string): Token{ - let token = Token.load(name) - if (token == null) { - token = new Token(name) - token.save() - } - return token as Token -} - From 3acf9b995c5108562ff52e7aa3284d47b15b3996 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 26 Sep 2023 13:09:10 +0400 Subject: [PATCH 13/81] Compile fixes --- subgraphs/ethereum/tests/tokenRecordHelper.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subgraphs/ethereum/tests/tokenRecordHelper.test.ts b/subgraphs/ethereum/tests/tokenRecordHelper.test.ts index 753aa9c1..7d4e7cab 100644 --- a/subgraphs/ethereum/tests/tokenRecordHelper.test.ts +++ b/subgraphs/ethereum/tests/tokenRecordHelper.test.ts @@ -23,7 +23,7 @@ import { const TIMESTAMP = BigInt.fromString("1"); -const createTokenRecord = (): TokenRecord => { +const createSampleTokenRecord = (): TokenRecord => { return createTokenRecord( TIMESTAMP, "name", @@ -46,7 +46,7 @@ beforeEach(() => { describe("constructor", () => { test("basic values", () => { - const record = createTokenRecord(); + const record = createSampleTokenRecord(); assert.stringEquals("name", record.token); assert.stringEquals("tokenAddress", record.tokenAddress); @@ -77,7 +77,7 @@ describe("constructor", () => { }); test("sets value", () => { - const record = createTokenRecord(); + const record = createSampleTokenRecord(); // Creating the record will set the value // 2 * 3 * 1 From c75c925786f506e6939f9623f4e9f2886f3cfec7 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 26 Sep 2023 13:10:14 +0400 Subject: [PATCH 14/81] New deployment --- subgraphs/ethereum/config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index ec2e5682..c9750642 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmQAKcsjQ1TDpWg5jVe79rci76p3ZmFWb5AG73N1NJ5WSF", + "id": "QmeFty3XtF5NLmA1Uj7tm3wfebY4BRqfcgrcwb1HvLoT82", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "4.99.0" + "version": "4.99.1" } \ No newline at end of file From 859b95446795438afdc3ab2a25cd839282c41745 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 26 Sep 2023 13:35:24 +0400 Subject: [PATCH 15/81] Use cached value first when checking ERC20 balances --- subgraphs/ethereum/config.json | 4 ++-- subgraphs/ethereum/src/utils/ContractHelper.ts | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index c9750642..f42884e5 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmeFty3XtF5NLmA1Uj7tm3wfebY4BRqfcgrcwb1HvLoT82", + "id": "QmVtVCf3VtNpgWa1ig4jJyQfQ9AwohLjCt7uE3u7izs2AT", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "4.99.1" + "version": "4.99.2" } \ No newline at end of file diff --git a/subgraphs/ethereum/src/utils/ContractHelper.ts b/subgraphs/ethereum/src/utils/ContractHelper.ts index 71da1571..f24707b5 100644 --- a/subgraphs/ethereum/src/utils/ContractHelper.ts +++ b/subgraphs/ethereum/src/utils/ContractHelper.ts @@ -476,6 +476,16 @@ export function getERC20TokenRecordFromWallet( rate: BigDecimal, blockNumber: BigInt, ): TokenRecord | null { + // Check decimals first, as this is cached + const decimals = getERC20Decimals(contractAddress, blockNumber); + if (decimals <= 0) { + log.warning( + "getERC20TokenRecordFromWallet: Unable to determine decimals for token {} ({}) at block {}. Skipping.", + [getContractName(contractAddress), contractAddress, blockNumber.toString()], + ); + return null; + } + const callResult = contract.try_balanceOf(Address.fromString(walletAddress)); if (callResult.reverted) { log.warning( @@ -485,8 +495,6 @@ export function getERC20TokenRecordFromWallet( return null; } - const decimals = getERC20Decimals(contractAddress, blockNumber); - const balance = toDecimal(callResult.value, decimals); if (!balance || balance.equals(BigDecimal.zero())) return null; From bc292cf2dc963bc6d9a6f79415c0399d2ea798ce Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 26 Sep 2023 13:39:01 +0400 Subject: [PATCH 16/81] Avoid an error being thrown --- subgraphs/ethereum/CHANGELOG.md | 1 + subgraphs/ethereum/config.json | 4 ++-- subgraphs/ethereum/src/utils/ContractHelper.ts | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/subgraphs/ethereum/CHANGELOG.md b/subgraphs/ethereum/CHANGELOG.md index f88013c7..e48a37da 100644 --- a/subgraphs/ethereum/CHANGELOG.md +++ b/subgraphs/ethereum/CHANGELOG.md @@ -3,6 +3,7 @@ ## 5.0.0 (???) - Improve indexing performance by using Bytes instead of String for entity ids +- Improve indexing performance by shifting TokenRecord, TokenSupply and ProtocolMetric entities to be immutable - Re-index using a block handler, as the previous event will be deprecated soon ## 4.13.3 (2023-09-22) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index f42884e5..50962e5f 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmVtVCf3VtNpgWa1ig4jJyQfQ9AwohLjCt7uE3u7izs2AT", + "id": "QmZvLKtLHpCZP2wLtE7wTX7k4KExroApWWfW9gm4Zr4ubn", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "4.99.2" + "version": "4.99.3" } \ No newline at end of file diff --git a/subgraphs/ethereum/src/utils/ContractHelper.ts b/subgraphs/ethereum/src/utils/ContractHelper.ts index f24707b5..86ccd8ea 100644 --- a/subgraphs/ethereum/src/utils/ContractHelper.ts +++ b/subgraphs/ethereum/src/utils/ContractHelper.ts @@ -477,7 +477,9 @@ export function getERC20TokenRecordFromWallet( blockNumber: BigInt, ): TokenRecord | null { // Check decimals first, as this is cached - const decimals = getERC20Decimals(contractAddress, blockNumber); + // But don't use getERC20Decimals, as that will throw an error + const erc20Snapshot = getOrCreateERC20TokenSnapshot(contractAddress, blockNumber); + const decimals = erc20Snapshot.decimals; if (decimals <= 0) { log.warning( "getERC20TokenRecordFromWallet: Unable to determine decimals for token {} ({}) at block {}. Skipping.", From b3ee99c3e550607640c23d1b657751d9244d0d7d Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Wed, 27 Sep 2023 10:32:35 +0400 Subject: [PATCH 17/81] Use Chainlink as a trigger, instead of a block handler --- subgraphs/ethereum/config.json | 4 ++-- .../src/protocolMetrics/ProtocolMetrics.ts | 19 +++---------------- subgraphs/ethereum/subgraph.yaml | 19 ++++++++----------- 3 files changed, 13 insertions(+), 29 deletions(-) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index 50962e5f..a692af43 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmZvLKtLHpCZP2wLtE7wTX7k4KExroApWWfW9gm4Zr4ubn", + "id": "QmVKqdXvg7vGvshe5j5oabUKJpk8ze8oo7hbjQoEJcaTdC", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "4.99.3" + "version": "4.99.4" } \ No newline at end of file diff --git a/subgraphs/ethereum/src/protocolMetrics/ProtocolMetrics.ts b/subgraphs/ethereum/src/protocolMetrics/ProtocolMetrics.ts index a5d79632..5f9f318f 100644 --- a/subgraphs/ethereum/src/protocolMetrics/ProtocolMetrics.ts +++ b/subgraphs/ethereum/src/protocolMetrics/ProtocolMetrics.ts @@ -19,6 +19,7 @@ import { getUSDRate } from "../utils/Price"; import { generateTokenRecords, generateTokenSupply } from "../utils/TreasuryCalculations"; import { getAPY_Rebase, getNextOHMRebase } from "./Rebase"; import { getMarketCap, getTreasuryLiquidBacking, getTreasuryLiquidBackingPerGOhmSynthetic, getTreasuryLiquidBackingPerOhmFloating, getTreasuryMarketValue } from "./TreasuryMetrics"; +import { NewRound } from "../../generated/ProtocolMetrics/ChainlinkPriceFeed"; export function createProtocolMetric(timestamp: BigInt, blockNumber: BigInt): ProtocolMetric { const dateString = getISO8601DateStringFromTimestamp(timestamp); @@ -80,8 +81,8 @@ export function updateProtocolMetrics(block: ethereum.Block, tokenRecords: Token pm.save(); } -export function handleMetrics(event: LogRebase): void { - log.debug("handleMetrics: *** Indexing block {}", [event.block.number.toString()]); +export function handleNewRound(event: NewRound): void { + log.debug("handleNewRound: *** Indexing block {}", [event.block.number.toString()]); // TokenRecord const tokenRecords = generateTokenRecords(event.block.timestamp, event.block.number); @@ -93,17 +94,3 @@ export function handleMetrics(event: LogRebase): void { // Otherwise we would be re-generating the records updateProtocolMetrics(event.block, tokenRecords, tokenSupplies); } - -export function handleMetricsBlock(block: ethereum.Block): void { - log.debug("handleMetrics: *** Indexing block {}", [block.number.toString()]); - - // TokenRecord - const tokenRecords = generateTokenRecords(block.timestamp, block.number); - - // TokenSupply - const tokenSupplies = generateTokenSupply(block.timestamp, block.number); - - // Use the generated records to calculate protocol/treasury metrics - // Otherwise we would be re-generating the records - updateProtocolMetrics(block, tokenRecords, tokenSupplies); -} diff --git a/subgraphs/ethereum/subgraph.yaml b/subgraphs/ethereum/subgraph.yaml index 2d1a2402..e82055d2 100644 --- a/subgraphs/ethereum/subgraph.yaml +++ b/subgraphs/ethereum/subgraph.yaml @@ -113,10 +113,9 @@ dataSources: name: ProtocolMetrics network: mainnet source: - # Created in December 2021. If indexing prior to then, we need to use a different contract - # https://etherscan.io/tx/0xd81bf37e970f5f3593d028b8503a6432d3cc6eb5b6589d98d041f28018f060b4 - address: "0x04906695D6D12CF5459975d7C3C03356E4Ccd460" - abi: sOlympusERC20V3 + # DAI-USD price feed + address: "0xAed0c38402a5d19df6E4c03F4E2DceD6e29c1ee9" + abi: ChainlinkPriceFeed startBlock: 14690000 mapping: kind: ethereum/events @@ -221,13 +220,11 @@ dataSources: # Cooler Loans - name: CoolerLoansClearinghouse file: ./abis/CoolerLoansClearinghouse.json - blockHandlers: - - handler: handleMetricsBlock - filter: - kind: polling - # Every 8 hours - # 5 blocks per minute * 60 minutes * 8 hours - every: 2400 + # This will trigger every hour + # Some Chainlink price feeds will trigger every 24 hours, but that is too infrequent + eventHandlers: + - event: NewRound(indexed uint256,indexed address,uint256) + handler: handleNewRound file: ./src/protocolMetrics/ProtocolMetrics.ts ### # BondManager and GnosisEasyAuction index Gnosis auction events, used for bond calculations From 64f97e03963c0ae902f31ac40c7661d2bdfd87cf Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 28 Sep 2023 11:55:58 +0400 Subject: [PATCH 18/81] Update for Vendor Finance --- subgraphs/ethereum/CHANGELOG.md | 3 ++- subgraphs/ethereum/src/utils/Constants.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/subgraphs/ethereum/CHANGELOG.md b/subgraphs/ethereum/CHANGELOG.md index e48a37da..83b82d70 100644 --- a/subgraphs/ethereum/CHANGELOG.md +++ b/subgraphs/ethereum/CHANGELOG.md @@ -4,7 +4,8 @@ - Improve indexing performance by using Bytes instead of String for entity ids - Improve indexing performance by shifting TokenRecord, TokenSupply and ProtocolMetric entities to be immutable -- Re-index using a block handler, as the previous event will be deprecated soon +- Change the indexing trigger to Chainlink, as the previous event will be deprecated soon +- Add removal of funds from Vendor Finance ## 4.13.3 (2023-09-22) diff --git a/subgraphs/ethereum/src/utils/Constants.ts b/subgraphs/ethereum/src/utils/Constants.ts index 9ced6888..d5e0f824 100644 --- a/subgraphs/ethereum/src/utils/Constants.ts +++ b/subgraphs/ethereum/src/utils/Constants.ts @@ -768,6 +768,7 @@ export const getRariAllocatorId = (contractAddress: string): i32 => { const VENDOR_DEPLOYMENTS = new Map(); VENDOR_DEPLOYMENTS.set(ERC20_DAI, [ new LendingMarketDeployment(ERC20_DAI, BigInt.fromString("16897393"), BigDecimal.fromString("500000"), VENDOR_LENDING), // https://etherscan.io/tx/0x0d4a3d19f4c35d8635793760050c3be4f54e1e2b43fb857282c4db992bce1469 + new LendingMarketDeployment(ERC20_DAI, BigInt.fromString("18227657"), BigDecimal.fromString("-500000"), VENDOR_LENDING), // https://etherscan.io/tx/0x627259b9fef9a188184bbdcb5f7ccf18ee55a91f8c437d6ebc637ec62e202b44 ]); /** From 6b0c0c222d23b9a56d2fa09632cf2c94c364730d Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 28 Sep 2023 11:57:33 +0400 Subject: [PATCH 19/81] Ignore zero balances --- subgraphs/ethereum/src/utils/ContractHelper.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/subgraphs/ethereum/src/utils/ContractHelper.ts b/subgraphs/ethereum/src/utils/ContractHelper.ts index 86ccd8ea..f1513742 100644 --- a/subgraphs/ethereum/src/utils/ContractHelper.ts +++ b/subgraphs/ethereum/src/utils/ContractHelper.ts @@ -555,6 +555,10 @@ export function getVendorFinanceRecords( balance = balance.plus(currentDeployment.getAmount()); } + if (balance.equals(BigDecimal.zero())) { + return records; + } + records.push(createTokenRecord( timestamp, getContractName(contractAddress), @@ -606,6 +610,10 @@ export function getMysoFinanceRecords( balance = balance.plus(currentDeployment.getAmount()); } + if (balance.equals(BigDecimal.zero())) { + return records; + } + records.push(createTokenRecord( timestamp, getContractName(contractAddress), From 16efaf0cf1c483a5570b51daa800b2ab758ae9c1 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 28 Sep 2023 11:59:09 +0400 Subject: [PATCH 20/81] Deployment bump --- subgraphs/ethereum/config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index a692af43..63a89a5d 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmVKqdXvg7vGvshe5j5oabUKJpk8ze8oo7hbjQoEJcaTdC", + "id": "QmVWmKpTj1j48jYq5e6Svx46raLXzAY1dBKkh3Hqvx6kuc", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "4.99.4" + "version": "4.99.5" } \ No newline at end of file From 04cbb9ac68a21d46be2b7c1138f7a399f5601bcb Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 28 Sep 2023 12:09:48 +0400 Subject: [PATCH 21/81] Correct Chainlink address --- subgraphs/ethereum/config.json | 4 ++-- subgraphs/ethereum/subgraph.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index 63a89a5d..f2050dde 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmVWmKpTj1j48jYq5e6Svx46raLXzAY1dBKkh3Hqvx6kuc", + "id": "QmUkJz3SLzMCWTPVCEcYcnVKihXkZGTTuSzEhD2WNxgqpd", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "4.99.5" + "version": "4.99.6" } \ No newline at end of file diff --git a/subgraphs/ethereum/subgraph.yaml b/subgraphs/ethereum/subgraph.yaml index e82055d2..a2719212 100644 --- a/subgraphs/ethereum/subgraph.yaml +++ b/subgraphs/ethereum/subgraph.yaml @@ -114,7 +114,7 @@ dataSources: network: mainnet source: # DAI-USD price feed - address: "0xAed0c38402a5d19df6E4c03F4E2DceD6e29c1ee9" + address: "0x478238a1c8B862498c74D0647329Aef9ea6819Ed" abi: ChainlinkPriceFeed startBlock: 14690000 mapping: From a02ef164927d000fa0a3a9cbd666e1d92fa1be47 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 28 Sep 2023 16:18:39 +0400 Subject: [PATCH 22/81] Use older DAI-ETH price feed --- subgraphs/ethereum/config.json | 4 ++-- subgraphs/ethereum/subgraph.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index f2050dde..809d1b9a 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmUkJz3SLzMCWTPVCEcYcnVKihXkZGTTuSzEhD2WNxgqpd", + "id": "QmVUK6usoki2p8E2gWFdvCLnYnZ3PeBNwTda3KbenDXGgi", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "4.99.6" + "version": "4.99.7" } \ No newline at end of file diff --git a/subgraphs/ethereum/subgraph.yaml b/subgraphs/ethereum/subgraph.yaml index a2719212..bccd1a8f 100644 --- a/subgraphs/ethereum/subgraph.yaml +++ b/subgraphs/ethereum/subgraph.yaml @@ -113,8 +113,8 @@ dataSources: name: ProtocolMetrics network: mainnet source: - # DAI-USD price feed - address: "0x478238a1c8B862498c74D0647329Aef9ea6819Ed" + # DAI-ETH price feed + address: "0x158228e08C52F3e2211Ccbc8ec275FA93f6033FC" abi: ChainlinkPriceFeed startBlock: 14690000 mapping: From 2ff63286fe1ff1fa68ba0078e9a11a3a89941eec Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Wed, 4 Oct 2023 13:59:42 +0400 Subject: [PATCH 23/81] Don't put price lookup in a loop --- subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts b/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts index e87040c6..aefa53f6 100644 --- a/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts +++ b/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts @@ -10,6 +10,8 @@ import { toDecimal } from "../../../shared/src/utils/Decimals"; export function getClearinghouseBalances(timestamp: BigInt, blockNumber: BigInt): TokenRecord[] { const records: TokenRecord[] = []; + const daiRate = getUSDRate(ERC20_DAI, blockNumber); + for (let i = 0; i < COOLER_LOANS_CLEARINGHOUSES.length; i++) { const clearinghouseAddress = COOLER_LOANS_CLEARINGHOUSES[i]; @@ -21,7 +23,6 @@ export function getClearinghouseBalances(timestamp: BigInt, blockNumber: BigInt) continue; } - const daiRate = getUSDRate(ERC20_DAI, blockNumber); const receivablesBalance = toDecimal(receivablesResult.value, 18); log.info(`Cooler Loans Clearinghouse receivables balance: {}`, [receivablesBalance.toString()]); From be8c27440d7ca1f0359e20ff2571c678e7605ffb Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 5 Oct 2023 13:01:34 +0400 Subject: [PATCH 24/81] Fix grafting base and bump version --- subgraphs/ethereum/CHANGELOG.md | 4 ++++ subgraphs/ethereum/config.json | 4 ++-- subgraphs/ethereum/subgraph.yaml | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/subgraphs/ethereum/CHANGELOG.md b/subgraphs/ethereum/CHANGELOG.md index e2f1a8aa..38272513 100644 --- a/subgraphs/ethereum/CHANGELOG.md +++ b/subgraphs/ethereum/CHANGELOG.md @@ -1,5 +1,9 @@ # Subgraph Changelog +## 4.14.2 (2023-10-05) + +- Fixes incorrect grafting + ## 4.14.1 (2023-10-04) - Deduct bricked/burned sOHMv2 from circulation diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index c70caa95..0f456657 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmbLjxvvAU4WQirhbp5mPiaXgbtCCBK52bHgXRBe8bHdq6", + "id": "QmPa7EVtHhVoCGGsfyC1RwxkbyUnWcqvvDQNRKK7gMzUno", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "4.14.1" + "version": "4.14.2" } \ No newline at end of file diff --git a/subgraphs/ethereum/subgraph.yaml b/subgraphs/ethereum/subgraph.yaml index a730fe81..f49151b0 100644 --- a/subgraphs/ethereum/subgraph.yaml +++ b/subgraphs/ethereum/subgraph.yaml @@ -5,7 +5,7 @@ features: - grafting graft: base: QmSwwBfAoWJLHQeSTagFnkibnkrjeprxcQpXAHk6AVrysA - block: 18200000 + block: 18185779 # Clearinghouse deployment schema: file: ../../schema.graphql dataSources: From 778e221a43ade95909c670827276e1787d58ede2 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 9 Oct 2023 10:23:40 +0400 Subject: [PATCH 25/81] Post-merge compile fixes --- subgraphs/ethereum/src/utils/OhmCalculations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subgraphs/ethereum/src/utils/OhmCalculations.ts b/subgraphs/ethereum/src/utils/OhmCalculations.ts index 6ab2baff..120cd508 100644 --- a/subgraphs/ethereum/src/utils/OhmCalculations.ts +++ b/subgraphs/ethereum/src/utils/OhmCalculations.ts @@ -567,7 +567,7 @@ export function getTreasuryOHMRecords(timestamp: BigInt, blockNumber: BigInt): T const ohmBalance = toDecimal(gOhmBalanceResult.value, wsOHMDecimals).times(ohmIndex); records.push( - createOrUpdateTokenSupply( + createTokenSupply( timestamp, `${getContractName(ERC20_OHM_V2)} in sOHM v2`, ERC20_OHM_V2, From 37d1b0dc2080ea3daaab6741c72f378d26c1f887 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 9 Oct 2023 10:38:17 +0400 Subject: [PATCH 26/81] Deploy polling block handler on Polygon --- subgraphs/polygon/CHANGELOG.md | 6 ++++++ subgraphs/polygon/config.json | 4 ++-- subgraphs/polygon/src/treasury/Assets.ts | 5 ----- subgraphs/polygon/subgraph.yaml | 16 ++++++++++------ 4 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 subgraphs/polygon/CHANGELOG.md diff --git a/subgraphs/polygon/CHANGELOG.md b/subgraphs/polygon/CHANGELOG.md new file mode 100644 index 00000000..fab576ba --- /dev/null +++ b/subgraphs/polygon/CHANGELOG.md @@ -0,0 +1,6 @@ +# protocol-metrics-polygon + +## v1.1.0 (2023-10-09) + +- Implemented polling block handler for faster (hopefully) indexing +- Deployment on Graph Protocol Decentralized Network diff --git a/subgraphs/polygon/config.json b/subgraphs/polygon/config.json index 5c40b2b5..7b7fb05c 100644 --- a/subgraphs/polygon/config.json +++ b/subgraphs/polygon/config.json @@ -1,6 +1,6 @@ { - "id": "QmcGw4WahErwDMqiZxjD4nPec6TCEpqhD3wvKNwGt9fqqf", + "id": "QmdDUpqEzfKug1ER6HWM8c7U6wf3wtEtRBvXV7LkVoBi9f", "org": "olympusdao", "name": "protocol-metrics-polygon", - "version": "1.0.2" + "version": "1.1.0" } \ No newline at end of file diff --git a/subgraphs/polygon/src/treasury/Assets.ts b/subgraphs/polygon/src/treasury/Assets.ts index f2965ccb..b3342950 100644 --- a/subgraphs/polygon/src/treasury/Assets.ts +++ b/subgraphs/polygon/src/treasury/Assets.ts @@ -16,11 +16,6 @@ export function generateTokenRecords(timestamp: BigInt, blockNumber: BigInt): vo } export function handleAssets(block: ethereum.Block): void { - // Only index every 14,400th block, approximately 8 hours - if (!block.number.mod(BigInt.fromString("14400")).equals(BigInt.zero())) { - return; - } - log.debug("handleAssets: *** Indexing block {}", [block.number.toString()]); generateTokenRecords(block.timestamp, block.number); } diff --git a/subgraphs/polygon/subgraph.yaml b/subgraphs/polygon/subgraph.yaml index 62558e45..9f964090 100644 --- a/subgraphs/polygon/subgraph.yaml +++ b/subgraphs/polygon/subgraph.yaml @@ -1,11 +1,11 @@ -specVersion: 0.0.4 +specVersion: 0.0.8 description: Olympus Protocol Metrics Subgraph - Polygon repository: https://github.com/OlympusDAO/olympus-protocol-metrics-subgraph -features: - - grafting -graft: - base: Qmayo4ydvieNxGzLcHdpNZZZCgeqBqcxtL4sTiEjdbDwKo - block: 40300000 # 2023-03-13 +# features: +# - grafting +# graft: +# base: Qmayo4ydvieNxGzLcHdpNZZZCgeqBqcxtL4sTiEjdbDwKo +# block: 40300000 # 2023-03-13 schema: file: ../../schema.graphql dataSources: @@ -40,4 +40,8 @@ dataSources: file: ../shared/abis/UniswapV3Pair.json blockHandlers: - handler: handleAssets + filter: + kind: polling + # Only index every 14,400th block, approximately 8 hours + every: 14400 file: ./src/treasury/Assets.ts From cbcd20d4e7e16a1be71c0499db6ea0ee78cc8297 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 9 Oct 2023 10:38:31 +0400 Subject: [PATCH 27/81] Deploy on Fantom Decentralized Network --- subgraphs/fantom/CHANGELOG.md | 5 +++++ subgraphs/fantom/config.json | 4 ++-- subgraphs/fantom/subgraph.yaml | 11 ++++++----- 3 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 subgraphs/fantom/CHANGELOG.md diff --git a/subgraphs/fantom/CHANGELOG.md b/subgraphs/fantom/CHANGELOG.md new file mode 100644 index 00000000..bd3ed6b8 --- /dev/null +++ b/subgraphs/fantom/CHANGELOG.md @@ -0,0 +1,5 @@ +# protocol-metrics-fantom + +## v1.0.0 (2023-10-09) + +- Deploy on Graph Protocol Decentralized Network diff --git a/subgraphs/fantom/config.json b/subgraphs/fantom/config.json index 645099d5..298ded72 100644 --- a/subgraphs/fantom/config.json +++ b/subgraphs/fantom/config.json @@ -1,6 +1,6 @@ { - "id": "QmSBMNhnzbe4c4cwznLUsFkE4H5XZfiVqLHnNZYA48EPwy", - "version": "0.1.0", + "id": "QmRNuATPqxcEuViJ7bNRruDPrp1YKq6PVrEuYSaLFYMpMa", + "version": "1.0.0", "org": "olympusdao", "name": "protocol-metrics-fantom" } \ No newline at end of file diff --git a/subgraphs/fantom/subgraph.yaml b/subgraphs/fantom/subgraph.yaml index 1135e173..2c1cc87f 100644 --- a/subgraphs/fantom/subgraph.yaml +++ b/subgraphs/fantom/subgraph.yaml @@ -1,11 +1,11 @@ specVersion: 0.0.4 description: Olympus Protocol Metrics Subgraph - Fantom repository: https://github.com/OlympusDAO/olympus-protocol-metrics-subgraph -features: - - grafting -graft: - base: QmWTwjzoLhNUugdJmszcMeA38eEuTkpTeDdhHnjMjdLwrD # 0.0.7 - block: 58674875 # 2023-03-30 +# features: +# - grafting +# graft: +# base: QmWTwjzoLhNUugdJmszcMeA38eEuTkpTeDdhHnjMjdLwrD # 0.0.7 +# block: 58674875 # 2023-03-30 schema: file: ../../schema.graphql dataSources: @@ -42,6 +42,7 @@ dataSources: - name: UniswapV3Pair file: ../shared/abis/UniswapV3Pair.json eventHandlers: + # Event every few hours - event: NewRound(indexed uint256,indexed address,uint256) handler: handleAssets file: ./src/treasury/Assets.ts From 6e6fbb8c211b47c46aef358f83893151a01f14e7 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 9 Oct 2023 11:24:33 +0400 Subject: [PATCH 28/81] Shift to polling block handler on Fantom --- subgraphs/fantom/CHANGELOG.md | 3 +- subgraphs/fantom/config.json | 4 +- .../ChainlinkAggregator.ts | 2097 ----------------- subgraphs/fantom/generated/schema.ts | 943 ++------ subgraphs/fantom/src/treasury/Assets.ts | 9 +- subgraphs/fantom/subgraph.yaml | 19 +- 6 files changed, 258 insertions(+), 2817 deletions(-) delete mode 100644 subgraphs/fantom/generated/TokenRecords-fantom/ChainlinkAggregator.ts diff --git a/subgraphs/fantom/CHANGELOG.md b/subgraphs/fantom/CHANGELOG.md index bd3ed6b8..7bbe5ce2 100644 --- a/subgraphs/fantom/CHANGELOG.md +++ b/subgraphs/fantom/CHANGELOG.md @@ -1,5 +1,6 @@ # protocol-metrics-fantom -## v1.0.0 (2023-10-09) +## v1.0.1 (2023-10-09) +- Shift to polling block handler - Deploy on Graph Protocol Decentralized Network diff --git a/subgraphs/fantom/config.json b/subgraphs/fantom/config.json index 298ded72..96f9b6e3 100644 --- a/subgraphs/fantom/config.json +++ b/subgraphs/fantom/config.json @@ -1,6 +1,6 @@ { - "id": "QmRNuATPqxcEuViJ7bNRruDPrp1YKq6PVrEuYSaLFYMpMa", - "version": "1.0.0", + "id": "QmQDXkuub2eEMR5PLNHvw7y2Qh72HRwN3S95aMMAiw4Lod", + "version": "1.0.1", "org": "olympusdao", "name": "protocol-metrics-fantom" } \ No newline at end of file diff --git a/subgraphs/fantom/generated/TokenRecords-fantom/ChainlinkAggregator.ts b/subgraphs/fantom/generated/TokenRecords-fantom/ChainlinkAggregator.ts deleted file mode 100644 index e9fdee3f..00000000 --- a/subgraphs/fantom/generated/TokenRecords-fantom/ChainlinkAggregator.ts +++ /dev/null @@ -1,2097 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - Address, - BigInt, - Bytes, - Entity, - ethereum, - JSONValue, - TypedMap} from "@graphprotocol/graph-ts"; - -export class AddedAccess extends ethereum.Event { - get params(): AddedAccess__Params { - return new AddedAccess__Params(this); - } -} - -export class AddedAccess__Params { - _event: AddedAccess; - - constructor(event: AddedAccess) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class AnswerUpdated extends ethereum.Event { - get params(): AnswerUpdated__Params { - return new AnswerUpdated__Params(this); - } -} - -export class AnswerUpdated__Params { - _event: AnswerUpdated; - - constructor(event: AnswerUpdated) { - this._event = event; - } - - get current(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get roundId(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get updatedAt(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class BillingAccessControllerSet extends ethereum.Event { - get params(): BillingAccessControllerSet__Params { - return new BillingAccessControllerSet__Params(this); - } -} - -export class BillingAccessControllerSet__Params { - _event: BillingAccessControllerSet; - - constructor(event: BillingAccessControllerSet) { - this._event = event; - } - - get old(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get current(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class BillingSet extends ethereum.Event { - get params(): BillingSet__Params { - return new BillingSet__Params(this); - } -} - -export class BillingSet__Params { - _event: BillingSet; - - constructor(event: BillingSet) { - this._event = event; - } - - get maximumGasPrice(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get reasonableGasPrice(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get microLinkPerEth(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get linkGweiPerObservation(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } - - get linkGweiPerTransmission(): BigInt { - return this._event.parameters[4].value.toBigInt(); - } -} - -export class CheckAccessDisabled extends ethereum.Event { - get params(): CheckAccessDisabled__Params { - return new CheckAccessDisabled__Params(this); - } -} - -export class CheckAccessDisabled__Params { - _event: CheckAccessDisabled; - - constructor(event: CheckAccessDisabled) { - this._event = event; - } -} - -export class CheckAccessEnabled extends ethereum.Event { - get params(): CheckAccessEnabled__Params { - return new CheckAccessEnabled__Params(this); - } -} - -export class CheckAccessEnabled__Params { - _event: CheckAccessEnabled; - - constructor(event: CheckAccessEnabled) { - this._event = event; - } -} - -export class ConfigSet extends ethereum.Event { - get params(): ConfigSet__Params { - return new ConfigSet__Params(this); - } -} - -export class ConfigSet__Params { - _event: ConfigSet; - - constructor(event: ConfigSet) { - this._event = event; - } - - get previousConfigBlockNumber(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get configCount(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get signers(): Array
{ - return this._event.parameters[2].value.toAddressArray(); - } - - get transmitters(): Array
{ - return this._event.parameters[3].value.toAddressArray(); - } - - get threshold(): i32 { - return this._event.parameters[4].value.toI32(); - } - - get encodedConfigVersion(): BigInt { - return this._event.parameters[5].value.toBigInt(); - } - - get encoded(): Bytes { - return this._event.parameters[6].value.toBytes(); - } -} - -export class LinkTokenSet extends ethereum.Event { - get params(): LinkTokenSet__Params { - return new LinkTokenSet__Params(this); - } -} - -export class LinkTokenSet__Params { - _event: LinkTokenSet; - - constructor(event: LinkTokenSet) { - this._event = event; - } - - get _oldLinkToken(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get _newLinkToken(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class NewRound extends ethereum.Event { - get params(): NewRound__Params { - return new NewRound__Params(this); - } -} - -export class NewRound__Params { - _event: NewRound; - - constructor(event: NewRound) { - this._event = event; - } - - get roundId(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get startedBy(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get startedAt(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } -} - -export class NewTransmission extends ethereum.Event { - get params(): NewTransmission__Params { - return new NewTransmission__Params(this); - } -} - -export class NewTransmission__Params { - _event: NewTransmission; - - constructor(event: NewTransmission) { - this._event = event; - } - - get aggregatorRoundId(): BigInt { - return this._event.parameters[0].value.toBigInt(); - } - - get answer(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get transmitter(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get observations(): Array { - return this._event.parameters[3].value.toBigIntArray(); - } - - get observers(): Bytes { - return this._event.parameters[4].value.toBytes(); - } - - get rawReportContext(): Bytes { - return this._event.parameters[5].value.toBytes(); - } -} - -export class OraclePaid extends ethereum.Event { - get params(): OraclePaid__Params { - return new OraclePaid__Params(this); - } -} - -export class OraclePaid__Params { - _event: OraclePaid; - - constructor(event: OraclePaid) { - this._event = event; - } - - get transmitter(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get payee(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get amount(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get linkToken(): Address { - return this._event.parameters[3].value.toAddress(); - } -} - -export class OwnershipTransferRequested extends ethereum.Event { - get params(): OwnershipTransferRequested__Params { - return new OwnershipTransferRequested__Params(this); - } -} - -export class OwnershipTransferRequested__Params { - _event: OwnershipTransferRequested; - - constructor(event: OwnershipTransferRequested) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get from(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get to(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class PayeeshipTransferRequested extends ethereum.Event { - get params(): PayeeshipTransferRequested__Params { - return new PayeeshipTransferRequested__Params(this); - } -} - -export class PayeeshipTransferRequested__Params { - _event: PayeeshipTransferRequested; - - constructor(event: PayeeshipTransferRequested) { - this._event = event; - } - - get transmitter(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get current(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get proposed(): Address { - return this._event.parameters[2].value.toAddress(); - } -} - -export class PayeeshipTransferred extends ethereum.Event { - get params(): PayeeshipTransferred__Params { - return new PayeeshipTransferred__Params(this); - } -} - -export class PayeeshipTransferred__Params { - _event: PayeeshipTransferred; - - constructor(event: PayeeshipTransferred) { - this._event = event; - } - - get transmitter(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get previous(): Address { - return this._event.parameters[1].value.toAddress(); - } - - get current(): Address { - return this._event.parameters[2].value.toAddress(); - } -} - -export class RemovedAccess extends ethereum.Event { - get params(): RemovedAccess__Params { - return new RemovedAccess__Params(this); - } -} - -export class RemovedAccess__Params { - _event: RemovedAccess; - - constructor(event: RemovedAccess) { - this._event = event; - } - - get user(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class RequesterAccessControllerSet extends ethereum.Event { - get params(): RequesterAccessControllerSet__Params { - return new RequesterAccessControllerSet__Params(this); - } -} - -export class RequesterAccessControllerSet__Params { - _event: RequesterAccessControllerSet; - - constructor(event: RequesterAccessControllerSet) { - this._event = event; - } - - get old(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get current(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class RoundRequested extends ethereum.Event { - get params(): RoundRequested__Params { - return new RoundRequested__Params(this); - } -} - -export class RoundRequested__Params { - _event: RoundRequested; - - constructor(event: RoundRequested) { - this._event = event; - } - - get requester(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get configDigest(): Bytes { - return this._event.parameters[1].value.toBytes(); - } - - get epoch(): BigInt { - return this._event.parameters[2].value.toBigInt(); - } - - get round(): i32 { - return this._event.parameters[3].value.toI32(); - } -} - -export class ValidatorConfigSet extends ethereum.Event { - get params(): ValidatorConfigSet__Params { - return new ValidatorConfigSet__Params(this); - } -} - -export class ValidatorConfigSet__Params { - _event: ValidatorConfigSet; - - constructor(event: ValidatorConfigSet) { - this._event = event; - } - - get previousValidator(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get previousGasLimit(): BigInt { - return this._event.parameters[1].value.toBigInt(); - } - - get currentValidator(): Address { - return this._event.parameters[2].value.toAddress(); - } - - get currentGasLimit(): BigInt { - return this._event.parameters[3].value.toBigInt(); - } -} - -export class ChainlinkAggregator__getBillingResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getMaximumGasPrice(): BigInt { - return this.value0; - } - - getReasonableGasPrice(): BigInt { - return this.value1; - } - - getMicroLinkPerEth(): BigInt { - return this.value2; - } - - getLinkGweiPerObservation(): BigInt { - return this.value3; - } - - getLinkGweiPerTransmission(): BigInt { - return this.value4; - } -} - -export class ChainlinkAggregator__getRoundDataResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromSignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getRoundId(): BigInt { - return this.value0; - } - - getAnswer(): BigInt { - return this.value1; - } - - getStartedAt(): BigInt { - return this.value2; - } - - getUpdatedAt(): BigInt { - return this.value3; - } - - getAnsweredInRound(): BigInt { - return this.value4; - } -} - -export class ChainlinkAggregator__latestConfigDetailsResult { - value0: BigInt; - value1: BigInt; - value2: Bytes; - - constructor(value0: BigInt, value1: BigInt, value2: Bytes) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromFixedBytes(this.value2)); - return map; - } - - getConfigCount(): BigInt { - return this.value0; - } - - getBlockNumber(): BigInt { - return this.value1; - } - - getConfigDigest(): Bytes { - return this.value2; - } -} - -export class ChainlinkAggregator__latestRoundDataResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - value3: BigInt; - value4: BigInt; - - constructor( - value0: BigInt, - value1: BigInt, - value2: BigInt, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromSignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getRoundId(): BigInt { - return this.value0; - } - - getAnswer(): BigInt { - return this.value1; - } - - getStartedAt(): BigInt { - return this.value2; - } - - getUpdatedAt(): BigInt { - return this.value3; - } - - getAnsweredInRound(): BigInt { - return this.value4; - } -} - -export class ChainlinkAggregator__latestTransmissionDetailsResult { - value0: Bytes; - value1: BigInt; - value2: i32; - value3: BigInt; - value4: BigInt; - - constructor( - value0: Bytes, - value1: BigInt, - value2: i32, - value3: BigInt, - value4: BigInt - ) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - this.value4 = value4; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromFixedBytes(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set( - "value2", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value2)) - ); - map.set("value3", ethereum.Value.fromSignedBigInt(this.value3)); - map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); - return map; - } - - getConfigDigest(): Bytes { - return this.value0; - } - - getEpoch(): BigInt { - return this.value1; - } - - getRound(): i32 { - return this.value2; - } - - getLatestAnswer(): BigInt { - return this.value3; - } - - getLatestTimestamp(): BigInt { - return this.value4; - } -} - -export class ChainlinkAggregator__validatorConfigResult { - value0: Address; - value1: BigInt; - - constructor(value0: Address, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - const map = new TypedMap(); - map.set("value0", ethereum.Value.fromAddress(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } - - getValidator(): Address { - return this.value0; - } - - getGasLimit(): BigInt { - return this.value1; - } -} - -export class ChainlinkAggregator extends ethereum.SmartContract { - static bind(address: Address): ChainlinkAggregator { - return new ChainlinkAggregator("ChainlinkAggregator", address); - } - - billingAccessController(): Address { - const result = super.call( - "billingAccessController", - "billingAccessController():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_billingAccessController(): ethereum.CallResult
{ - const result = super.tryCall( - "billingAccessController", - "billingAccessController():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - checkEnabled(): boolean { - const result = super.call("checkEnabled", "checkEnabled():(bool)", []); - - return result[0].toBoolean(); - } - - try_checkEnabled(): ethereum.CallResult { - const result = super.tryCall("checkEnabled", "checkEnabled():(bool)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - decimals(): i32 { - const result = super.call("decimals", "decimals():(uint8)", []); - - return result[0].toI32(); - } - - try_decimals(): ethereum.CallResult { - const result = super.tryCall("decimals", "decimals():(uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - description(): string { - const result = super.call("description", "description():(string)", []); - - return result[0].toString(); - } - - try_description(): ethereum.CallResult { - const result = super.tryCall("description", "description():(string)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - getAnswer(_roundId: BigInt): BigInt { - const result = super.call("getAnswer", "getAnswer(uint256):(int256)", [ - ethereum.Value.fromUnsignedBigInt(_roundId) - ]); - - return result[0].toBigInt(); - } - - try_getAnswer(_roundId: BigInt): ethereum.CallResult { - const result = super.tryCall("getAnswer", "getAnswer(uint256):(int256)", [ - ethereum.Value.fromUnsignedBigInt(_roundId) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - getBilling(): ChainlinkAggregator__getBillingResult { - const result = super.call( - "getBilling", - "getBilling():(uint32,uint32,uint32,uint32,uint32)", - [] - ); - - return new ChainlinkAggregator__getBillingResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_getBilling(): ethereum.CallResult { - const result = super.tryCall( - "getBilling", - "getBilling():(uint32,uint32,uint32,uint32,uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new ChainlinkAggregator__getBillingResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - getLinkToken(): Address { - const result = super.call("getLinkToken", "getLinkToken():(address)", []); - - return result[0].toAddress(); - } - - try_getLinkToken(): ethereum.CallResult
{ - const result = super.tryCall("getLinkToken", "getLinkToken():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - getRoundData(_roundId: BigInt): ChainlinkAggregator__getRoundDataResult { - const result = super.call( - "getRoundData", - "getRoundData(uint80):(uint80,int256,uint256,uint256,uint80)", - [ethereum.Value.fromUnsignedBigInt(_roundId)] - ); - - return new ChainlinkAggregator__getRoundDataResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_getRoundData( - _roundId: BigInt - ): ethereum.CallResult { - const result = super.tryCall( - "getRoundData", - "getRoundData(uint80):(uint80,int256,uint256,uint256,uint80)", - [ethereum.Value.fromUnsignedBigInt(_roundId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new ChainlinkAggregator__getRoundDataResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - getTimestamp(_roundId: BigInt): BigInt { - const result = super.call("getTimestamp", "getTimestamp(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(_roundId) - ]); - - return result[0].toBigInt(); - } - - try_getTimestamp(_roundId: BigInt): ethereum.CallResult { - const result = super.tryCall( - "getTimestamp", - "getTimestamp(uint256):(uint256)", - [ethereum.Value.fromUnsignedBigInt(_roundId)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - hasAccess(_user: Address, _calldata: Bytes): boolean { - const result = super.call("hasAccess", "hasAccess(address,bytes):(bool)", [ - ethereum.Value.fromAddress(_user), - ethereum.Value.fromBytes(_calldata) - ]); - - return result[0].toBoolean(); - } - - try_hasAccess( - _user: Address, - _calldata: Bytes - ): ethereum.CallResult { - const result = super.tryCall("hasAccess", "hasAccess(address,bytes):(bool)", [ - ethereum.Value.fromAddress(_user), - ethereum.Value.fromBytes(_calldata) - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - latestAnswer(): BigInt { - const result = super.call("latestAnswer", "latestAnswer():(int256)", []); - - return result[0].toBigInt(); - } - - try_latestAnswer(): ethereum.CallResult { - const result = super.tryCall("latestAnswer", "latestAnswer():(int256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - latestConfigDetails(): ChainlinkAggregator__latestConfigDetailsResult { - const result = super.call( - "latestConfigDetails", - "latestConfigDetails():(uint32,uint32,bytes16)", - [] - ); - - return new ChainlinkAggregator__latestConfigDetailsResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBytes() - ); - } - - try_latestConfigDetails(): ethereum.CallResult< - ChainlinkAggregator__latestConfigDetailsResult - > { - const result = super.tryCall( - "latestConfigDetails", - "latestConfigDetails():(uint32,uint32,bytes16)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new ChainlinkAggregator__latestConfigDetailsResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBytes() - ) - ); - } - - latestRound(): BigInt { - const result = super.call("latestRound", "latestRound():(uint256)", []); - - return result[0].toBigInt(); - } - - try_latestRound(): ethereum.CallResult { - const result = super.tryCall("latestRound", "latestRound():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - latestRoundData(): ChainlinkAggregator__latestRoundDataResult { - const result = super.call( - "latestRoundData", - "latestRoundData():(uint80,int256,uint256,uint256,uint80)", - [] - ); - - return new ChainlinkAggregator__latestRoundDataResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_latestRoundData(): ethereum.CallResult< - ChainlinkAggregator__latestRoundDataResult - > { - const result = super.tryCall( - "latestRoundData", - "latestRoundData():(uint80,int256,uint256,uint256,uint80)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new ChainlinkAggregator__latestRoundDataResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - latestTimestamp(): BigInt { - const result = super.call( - "latestTimestamp", - "latestTimestamp():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_latestTimestamp(): ethereum.CallResult { - const result = super.tryCall( - "latestTimestamp", - "latestTimestamp():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - latestTransmissionDetails(): ChainlinkAggregator__latestTransmissionDetailsResult { - const result = super.call( - "latestTransmissionDetails", - "latestTransmissionDetails():(bytes16,uint32,uint8,int192,uint64)", - [] - ); - - return new ChainlinkAggregator__latestTransmissionDetailsResult( - result[0].toBytes(), - result[1].toBigInt(), - result[2].toI32(), - result[3].toBigInt(), - result[4].toBigInt() - ); - } - - try_latestTransmissionDetails(): ethereum.CallResult< - ChainlinkAggregator__latestTransmissionDetailsResult - > { - const result = super.tryCall( - "latestTransmissionDetails", - "latestTransmissionDetails():(bytes16,uint32,uint8,int192,uint64)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new ChainlinkAggregator__latestTransmissionDetailsResult( - value[0].toBytes(), - value[1].toBigInt(), - value[2].toI32(), - value[3].toBigInt(), - value[4].toBigInt() - ) - ); - } - - linkAvailableForPayment(): BigInt { - const result = super.call( - "linkAvailableForPayment", - "linkAvailableForPayment():(int256)", - [] - ); - - return result[0].toBigInt(); - } - - try_linkAvailableForPayment(): ethereum.CallResult { - const result = super.tryCall( - "linkAvailableForPayment", - "linkAvailableForPayment():(int256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxAnswer(): BigInt { - const result = super.call("maxAnswer", "maxAnswer():(int192)", []); - - return result[0].toBigInt(); - } - - try_maxAnswer(): ethereum.CallResult { - const result = super.tryCall("maxAnswer", "maxAnswer():(int192)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - minAnswer(): BigInt { - const result = super.call("minAnswer", "minAnswer():(int192)", []); - - return result[0].toBigInt(); - } - - try_minAnswer(): ethereum.CallResult { - const result = super.tryCall("minAnswer", "minAnswer():(int192)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - oracleObservationCount(_signerOrTransmitter: Address): i32 { - const result = super.call( - "oracleObservationCount", - "oracleObservationCount(address):(uint16)", - [ethereum.Value.fromAddress(_signerOrTransmitter)] - ); - - return result[0].toI32(); - } - - try_oracleObservationCount( - _signerOrTransmitter: Address - ): ethereum.CallResult { - const result = super.tryCall( - "oracleObservationCount", - "oracleObservationCount(address):(uint16)", - [ethereum.Value.fromAddress(_signerOrTransmitter)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - owedPayment(_transmitter: Address): BigInt { - const result = super.call("owedPayment", "owedPayment(address):(uint256)", [ - ethereum.Value.fromAddress(_transmitter) - ]); - - return result[0].toBigInt(); - } - - try_owedPayment(_transmitter: Address): ethereum.CallResult { - const result = super.tryCall( - "owedPayment", - "owedPayment(address):(uint256)", - [ethereum.Value.fromAddress(_transmitter)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - owner(): Address { - const result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - const result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - requestNewRound(): BigInt { - const result = super.call( - "requestNewRound", - "requestNewRound():(uint80)", - [] - ); - - return result[0].toBigInt(); - } - - try_requestNewRound(): ethereum.CallResult { - const result = super.tryCall( - "requestNewRound", - "requestNewRound():(uint80)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - requesterAccessController(): Address { - const result = super.call( - "requesterAccessController", - "requesterAccessController():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_requesterAccessController(): ethereum.CallResult
{ - const result = super.tryCall( - "requesterAccessController", - "requesterAccessController():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - transmitters(): Array
{ - const result = super.call("transmitters", "transmitters():(address[])", []); - - return result[0].toAddressArray(); - } - - try_transmitters(): ethereum.CallResult> { - const result = super.tryCall( - "transmitters", - "transmitters():(address[])", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddressArray()); - } - - typeAndVersion(): string { - const result = super.call("typeAndVersion", "typeAndVersion():(string)", []); - - return result[0].toString(); - } - - try_typeAndVersion(): ethereum.CallResult { - const result = super.tryCall( - "typeAndVersion", - "typeAndVersion():(string)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toString()); - } - - validatorConfig(): ChainlinkAggregator__validatorConfigResult { - const result = super.call( - "validatorConfig", - "validatorConfig():(address,uint32)", - [] - ); - - return new ChainlinkAggregator__validatorConfigResult( - result[0].toAddress(), - result[1].toBigInt() - ); - } - - try_validatorConfig(): ethereum.CallResult< - ChainlinkAggregator__validatorConfigResult - > { - const result = super.tryCall( - "validatorConfig", - "validatorConfig():(address,uint32)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue( - new ChainlinkAggregator__validatorConfigResult( - value[0].toAddress(), - value[1].toBigInt() - ) - ); - } - - version(): BigInt { - const result = super.call("version", "version():(uint256)", []); - - return result[0].toBigInt(); - } - - try_version(): ethereum.CallResult { - const result = super.tryCall("version", "version():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - const value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _maximumGasPrice(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _reasonableGasPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _microLinkPerEth(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _linkGweiPerObservation(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _linkGweiPerTransmission(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _link(): Address { - return this._call.inputValues[5].value.toAddress(); - } - - get _minAnswer(): BigInt { - return this._call.inputValues[6].value.toBigInt(); - } - - get _maxAnswer(): BigInt { - return this._call.inputValues[7].value.toBigInt(); - } - - get _billingAccessController(): Address { - return this._call.inputValues[8].value.toAddress(); - } - - get _requesterAccessController(): Address { - return this._call.inputValues[9].value.toAddress(); - } - - get _decimals(): i32 { - return this._call.inputValues[10].value.toI32(); - } - - get description(): string { - return this._call.inputValues[11].value.toString(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class AcceptOwnershipCall extends ethereum.Call { - get inputs(): AcceptOwnershipCall__Inputs { - return new AcceptOwnershipCall__Inputs(this); - } - - get outputs(): AcceptOwnershipCall__Outputs { - return new AcceptOwnershipCall__Outputs(this); - } -} - -export class AcceptOwnershipCall__Inputs { - _call: AcceptOwnershipCall; - - constructor(call: AcceptOwnershipCall) { - this._call = call; - } -} - -export class AcceptOwnershipCall__Outputs { - _call: AcceptOwnershipCall; - - constructor(call: AcceptOwnershipCall) { - this._call = call; - } -} - -export class AcceptPayeeshipCall extends ethereum.Call { - get inputs(): AcceptPayeeshipCall__Inputs { - return new AcceptPayeeshipCall__Inputs(this); - } - - get outputs(): AcceptPayeeshipCall__Outputs { - return new AcceptPayeeshipCall__Outputs(this); - } -} - -export class AcceptPayeeshipCall__Inputs { - _call: AcceptPayeeshipCall; - - constructor(call: AcceptPayeeshipCall) { - this._call = call; - } - - get _transmitter(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class AcceptPayeeshipCall__Outputs { - _call: AcceptPayeeshipCall; - - constructor(call: AcceptPayeeshipCall) { - this._call = call; - } -} - -export class AddAccessCall extends ethereum.Call { - get inputs(): AddAccessCall__Inputs { - return new AddAccessCall__Inputs(this); - } - - get outputs(): AddAccessCall__Outputs { - return new AddAccessCall__Outputs(this); - } -} - -export class AddAccessCall__Inputs { - _call: AddAccessCall; - - constructor(call: AddAccessCall) { - this._call = call; - } - - get _user(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class AddAccessCall__Outputs { - _call: AddAccessCall; - - constructor(call: AddAccessCall) { - this._call = call; - } -} - -export class DisableAccessCheckCall extends ethereum.Call { - get inputs(): DisableAccessCheckCall__Inputs { - return new DisableAccessCheckCall__Inputs(this); - } - - get outputs(): DisableAccessCheckCall__Outputs { - return new DisableAccessCheckCall__Outputs(this); - } -} - -export class DisableAccessCheckCall__Inputs { - _call: DisableAccessCheckCall; - - constructor(call: DisableAccessCheckCall) { - this._call = call; - } -} - -export class DisableAccessCheckCall__Outputs { - _call: DisableAccessCheckCall; - - constructor(call: DisableAccessCheckCall) { - this._call = call; - } -} - -export class EnableAccessCheckCall extends ethereum.Call { - get inputs(): EnableAccessCheckCall__Inputs { - return new EnableAccessCheckCall__Inputs(this); - } - - get outputs(): EnableAccessCheckCall__Outputs { - return new EnableAccessCheckCall__Outputs(this); - } -} - -export class EnableAccessCheckCall__Inputs { - _call: EnableAccessCheckCall; - - constructor(call: EnableAccessCheckCall) { - this._call = call; - } -} - -export class EnableAccessCheckCall__Outputs { - _call: EnableAccessCheckCall; - - constructor(call: EnableAccessCheckCall) { - this._call = call; - } -} - -export class RemoveAccessCall extends ethereum.Call { - get inputs(): RemoveAccessCall__Inputs { - return new RemoveAccessCall__Inputs(this); - } - - get outputs(): RemoveAccessCall__Outputs { - return new RemoveAccessCall__Outputs(this); - } -} - -export class RemoveAccessCall__Inputs { - _call: RemoveAccessCall; - - constructor(call: RemoveAccessCall) { - this._call = call; - } - - get _user(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class RemoveAccessCall__Outputs { - _call: RemoveAccessCall; - - constructor(call: RemoveAccessCall) { - this._call = call; - } -} - -export class RequestNewRoundCall extends ethereum.Call { - get inputs(): RequestNewRoundCall__Inputs { - return new RequestNewRoundCall__Inputs(this); - } - - get outputs(): RequestNewRoundCall__Outputs { - return new RequestNewRoundCall__Outputs(this); - } -} - -export class RequestNewRoundCall__Inputs { - _call: RequestNewRoundCall; - - constructor(call: RequestNewRoundCall) { - this._call = call; - } -} - -export class RequestNewRoundCall__Outputs { - _call: RequestNewRoundCall; - - constructor(call: RequestNewRoundCall) { - this._call = call; - } - - get value0(): BigInt { - return this._call.outputValues[0].value.toBigInt(); - } -} - -export class SetBillingCall extends ethereum.Call { - get inputs(): SetBillingCall__Inputs { - return new SetBillingCall__Inputs(this); - } - - get outputs(): SetBillingCall__Outputs { - return new SetBillingCall__Outputs(this); - } -} - -export class SetBillingCall__Inputs { - _call: SetBillingCall; - - constructor(call: SetBillingCall) { - this._call = call; - } - - get _maximumGasPrice(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _reasonableGasPrice(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } - - get _microLinkPerEth(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _linkGweiPerObservation(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _linkGweiPerTransmission(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } -} - -export class SetBillingCall__Outputs { - _call: SetBillingCall; - - constructor(call: SetBillingCall) { - this._call = call; - } -} - -export class SetBillingAccessControllerCall extends ethereum.Call { - get inputs(): SetBillingAccessControllerCall__Inputs { - return new SetBillingAccessControllerCall__Inputs(this); - } - - get outputs(): SetBillingAccessControllerCall__Outputs { - return new SetBillingAccessControllerCall__Outputs(this); - } -} - -export class SetBillingAccessControllerCall__Inputs { - _call: SetBillingAccessControllerCall; - - constructor(call: SetBillingAccessControllerCall) { - this._call = call; - } - - get _billingAccessController(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetBillingAccessControllerCall__Outputs { - _call: SetBillingAccessControllerCall; - - constructor(call: SetBillingAccessControllerCall) { - this._call = call; - } -} - -export class SetConfigCall extends ethereum.Call { - get inputs(): SetConfigCall__Inputs { - return new SetConfigCall__Inputs(this); - } - - get outputs(): SetConfigCall__Outputs { - return new SetConfigCall__Outputs(this); - } -} - -export class SetConfigCall__Inputs { - _call: SetConfigCall; - - constructor(call: SetConfigCall) { - this._call = call; - } - - get _signers(): Array
{ - return this._call.inputValues[0].value.toAddressArray(); - } - - get _transmitters(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } - - get _threshold(): i32 { - return this._call.inputValues[2].value.toI32(); - } - - get _encodedConfigVersion(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _encoded(): Bytes { - return this._call.inputValues[4].value.toBytes(); - } -} - -export class SetConfigCall__Outputs { - _call: SetConfigCall; - - constructor(call: SetConfigCall) { - this._call = call; - } -} - -export class SetLinkTokenCall extends ethereum.Call { - get inputs(): SetLinkTokenCall__Inputs { - return new SetLinkTokenCall__Inputs(this); - } - - get outputs(): SetLinkTokenCall__Outputs { - return new SetLinkTokenCall__Outputs(this); - } -} - -export class SetLinkTokenCall__Inputs { - _call: SetLinkTokenCall; - - constructor(call: SetLinkTokenCall) { - this._call = call; - } - - get _linkToken(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _recipient(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class SetLinkTokenCall__Outputs { - _call: SetLinkTokenCall; - - constructor(call: SetLinkTokenCall) { - this._call = call; - } -} - -export class SetPayeesCall extends ethereum.Call { - get inputs(): SetPayeesCall__Inputs { - return new SetPayeesCall__Inputs(this); - } - - get outputs(): SetPayeesCall__Outputs { - return new SetPayeesCall__Outputs(this); - } -} - -export class SetPayeesCall__Inputs { - _call: SetPayeesCall; - - constructor(call: SetPayeesCall) { - this._call = call; - } - - get _transmitters(): Array
{ - return this._call.inputValues[0].value.toAddressArray(); - } - - get _payees(): Array
{ - return this._call.inputValues[1].value.toAddressArray(); - } -} - -export class SetPayeesCall__Outputs { - _call: SetPayeesCall; - - constructor(call: SetPayeesCall) { - this._call = call; - } -} - -export class SetRequesterAccessControllerCall extends ethereum.Call { - get inputs(): SetRequesterAccessControllerCall__Inputs { - return new SetRequesterAccessControllerCall__Inputs(this); - } - - get outputs(): SetRequesterAccessControllerCall__Outputs { - return new SetRequesterAccessControllerCall__Outputs(this); - } -} - -export class SetRequesterAccessControllerCall__Inputs { - _call: SetRequesterAccessControllerCall; - - constructor(call: SetRequesterAccessControllerCall) { - this._call = call; - } - - get _requesterAccessController(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class SetRequesterAccessControllerCall__Outputs { - _call: SetRequesterAccessControllerCall; - - constructor(call: SetRequesterAccessControllerCall) { - this._call = call; - } -} - -export class SetValidatorConfigCall extends ethereum.Call { - get inputs(): SetValidatorConfigCall__Inputs { - return new SetValidatorConfigCall__Inputs(this); - } - - get outputs(): SetValidatorConfigCall__Outputs { - return new SetValidatorConfigCall__Outputs(this); - } -} - -export class SetValidatorConfigCall__Inputs { - _call: SetValidatorConfigCall; - - constructor(call: SetValidatorConfigCall) { - this._call = call; - } - - get _newValidator(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _newGasLimit(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class SetValidatorConfigCall__Outputs { - _call: SetValidatorConfigCall; - - constructor(call: SetValidatorConfigCall) { - this._call = call; - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get _to(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} - -export class TransferPayeeshipCall extends ethereum.Call { - get inputs(): TransferPayeeshipCall__Inputs { - return new TransferPayeeshipCall__Inputs(this); - } - - get outputs(): TransferPayeeshipCall__Outputs { - return new TransferPayeeshipCall__Outputs(this); - } -} - -export class TransferPayeeshipCall__Inputs { - _call: TransferPayeeshipCall; - - constructor(call: TransferPayeeshipCall) { - this._call = call; - } - - get _transmitter(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _proposed(): Address { - return this._call.inputValues[1].value.toAddress(); - } -} - -export class TransferPayeeshipCall__Outputs { - _call: TransferPayeeshipCall; - - constructor(call: TransferPayeeshipCall) { - this._call = call; - } -} - -export class TransmitCall extends ethereum.Call { - get inputs(): TransmitCall__Inputs { - return new TransmitCall__Inputs(this); - } - - get outputs(): TransmitCall__Outputs { - return new TransmitCall__Outputs(this); - } -} - -export class TransmitCall__Inputs { - _call: TransmitCall; - - constructor(call: TransmitCall) { - this._call = call; - } - - get _report(): Bytes { - return this._call.inputValues[0].value.toBytes(); - } - - get _rs(): Array { - return this._call.inputValues[1].value.toBytesArray(); - } - - get _ss(): Array { - return this._call.inputValues[2].value.toBytesArray(); - } - - get _rawVs(): Bytes { - return this._call.inputValues[3].value.toBytes(); - } -} - -export class TransmitCall__Outputs { - _call: TransmitCall; - - constructor(call: TransmitCall) { - this._call = call; - } -} - -export class WithdrawFundsCall extends ethereum.Call { - get inputs(): WithdrawFundsCall__Inputs { - return new WithdrawFundsCall__Inputs(this); - } - - get outputs(): WithdrawFundsCall__Outputs { - return new WithdrawFundsCall__Outputs(this); - } -} - -export class WithdrawFundsCall__Inputs { - _call: WithdrawFundsCall; - - constructor(call: WithdrawFundsCall) { - this._call = call; - } - - get _recipient(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _amount(): BigInt { - return this._call.inputValues[1].value.toBigInt(); - } -} - -export class WithdrawFundsCall__Outputs { - _call: WithdrawFundsCall; - - constructor(call: WithdrawFundsCall) { - this._call = call; - } -} - -export class WithdrawPaymentCall extends ethereum.Call { - get inputs(): WithdrawPaymentCall__Inputs { - return new WithdrawPaymentCall__Inputs(this); - } - - get outputs(): WithdrawPaymentCall__Outputs { - return new WithdrawPaymentCall__Outputs(this); - } -} - -export class WithdrawPaymentCall__Inputs { - _call: WithdrawPaymentCall; - - constructor(call: WithdrawPaymentCall) { - this._call = call; - } - - get _transmitter(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class WithdrawPaymentCall__Outputs { - _call: WithdrawPaymentCall; - - constructor(call: WithdrawPaymentCall) { - this._call = call; - } -} diff --git a/subgraphs/fantom/generated/schema.ts b/subgraphs/fantom/generated/schema.ts index 687b0317..4c582fc7 100644 --- a/subgraphs/fantom/generated/schema.ts +++ b/subgraphs/fantom/generated/schema.ts @@ -10,354 +10,47 @@ import { Value, ValueKind} from "@graphprotocol/graph-ts"; -export class DailyBond extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - const id = this.get("id"); - assert(id != null, "Cannot save DailyBond entity without an ID"); - if (id) { - assert( - id.kind == ValueKind.STRING, - `Entities of type DailyBond must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` - ); - store.set("DailyBond", id.toString(), this); - } - } - - static load(id: string): DailyBond | null { - return changetype(store.get("DailyBond", id)); - } - - get id(): string { - const value = this.get("id"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get timestamp(): BigInt { - const value = this.get("timestamp"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigInt(); - } - } - - set timestamp(value: BigInt) { - this.set("timestamp", Value.fromBigInt(value)); - } - - get token(): string { - const value = this.get("token"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set token(value: string) { - this.set("token", Value.fromString(value)); - } - - get amount(): BigDecimal { - const value = this.get("amount"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set amount(value: BigDecimal) { - this.set("amount", Value.fromBigDecimal(value)); - } - - get value(): BigDecimal { - const value = this.get("value"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set value(value: BigDecimal) { - this.set("value", Value.fromBigDecimal(value)); - } -} - -export class Rebase extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - const id = this.get("id"); - assert(id != null, "Cannot save Rebase entity without an ID"); - if (id) { - assert( - id.kind == ValueKind.STRING, - `Entities of type Rebase must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` - ); - store.set("Rebase", id.toString(), this); - } - } - - static load(id: string): Rebase | null { - return changetype(store.get("Rebase", id)); - } - - get id(): string { - const value = this.get("id"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get amount(): BigDecimal { - const value = this.get("amount"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set amount(value: BigDecimal) { - this.set("amount", Value.fromBigDecimal(value)); - } - - get stakedOhms(): BigDecimal { - const value = this.get("stakedOhms"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set stakedOhms(value: BigDecimal) { - this.set("stakedOhms", Value.fromBigDecimal(value)); - } - - get percentage(): BigDecimal { - const value = this.get("percentage"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set percentage(value: BigDecimal) { - this.set("percentage", Value.fromBigDecimal(value)); - } - - get contract(): string { - const value = this.get("contract"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set contract(value: string) { - this.set("contract", Value.fromString(value)); - } - - get timestamp(): BigInt { - const value = this.get("timestamp"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigInt(); - } - } - - set timestamp(value: BigInt) { - this.set("timestamp", Value.fromBigInt(value)); - } - - get value(): BigDecimal { - const value = this.get("value"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set value(value: BigDecimal) { - this.set("value", Value.fromBigDecimal(value)); - } -} - -export class DailyStakingReward extends Entity { - constructor(id: string) { +export class ProtocolMetric extends Entity { + constructor(id: Bytes) { super(); - this.set("id", Value.fromString(id)); + this.set("id", Value.fromBytes(id)); } save(): void { const id = this.get("id"); - assert(id != null, "Cannot save DailyStakingReward entity without an ID"); + assert(id != null, "Cannot save ProtocolMetric entity without an ID"); if (id) { assert( - id.kind == ValueKind.STRING, - `Entities of type DailyStakingReward must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + id.kind == ValueKind.BYTES, + `Entities of type ProtocolMetric must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("DailyStakingReward", id.toString(), this); + store.set("ProtocolMetric", id.toBytes().toHexString(), this); } } - static load(id: string): DailyStakingReward | null { - return changetype( - store.get("DailyStakingReward", id) + static loadInBlock(id: Bytes): ProtocolMetric | null { + return changetype( + store.get_in_block("ProtocolMetric", id.toHexString()) ); } - get id(): string { - const value = this.get("id"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get timestamp(): BigInt { - const value = this.get("timestamp"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigInt(); - } - } - - set timestamp(value: BigInt) { - this.set("timestamp", Value.fromBigInt(value)); - } - - get amount(): BigDecimal { - const value = this.get("amount"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set amount(value: BigDecimal) { - this.set("amount", Value.fromBigDecimal(value)); - } - - get value(): BigDecimal { - const value = this.get("value"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set value(value: BigDecimal) { - this.set("value", Value.fromBigDecimal(value)); - } -} - -export class Token extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - const id = this.get("id"); - assert(id != null, "Cannot save Token entity without an ID"); - if (id) { - assert( - id.kind == ValueKind.STRING, - `Entities of type Token must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` - ); - store.set("Token", id.toString(), this); - } - } - - static load(id: string): Token | null { - return changetype(store.get("Token", id)); - } - - get id(): string { - const value = this.get("id"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } -} - -export class ProtocolMetric extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - const id = this.get("id"); - assert(id != null, "Cannot save ProtocolMetric entity without an ID"); - if (id) { - assert( - id.kind == ValueKind.STRING, - `Entities of type ProtocolMetric must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` - ); - store.set("ProtocolMetric", id.toString(), this); - } - } - - static load(id: string): ProtocolMetric | null { - return changetype(store.get("ProtocolMetric", id)); + static load(id: Bytes): ProtocolMetric | null { + return changetype( + store.get("ProtocolMetric", id.toHexString()) + ); } - get id(): string { + get id(): Bytes { const value = this.get("id"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBytes(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); } get block(): BigInt { @@ -514,217 +207,52 @@ export class ProtocolMetric extends Entity { this.set("ohmCirculatingSupply", Value.fromBigDecimal(value)); } } - - get ohmFloatingSupply(): BigDecimal | null { - const value = this.get("ohmFloatingSupply"); - if (!value || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigDecimal(); - } - } - - set ohmFloatingSupply(value: BigDecimal | null) { - if (!value) { - this.unset("ohmFloatingSupply"); - } else { - this.set("ohmFloatingSupply", Value.fromBigDecimal(value)); - } - } - - get ohmPrice(): BigDecimal { - const value = this.get("ohmPrice"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set ohmPrice(value: BigDecimal) { - this.set("ohmPrice", Value.fromBigDecimal(value)); - } - - get ohmTotalSupply(): BigDecimal { - const value = this.get("ohmTotalSupply"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set ohmTotalSupply(value: BigDecimal) { - this.set("ohmTotalSupply", Value.fromBigDecimal(value)); - } - - get sOhmCirculatingSupply(): BigDecimal { - const value = this.get("sOhmCirculatingSupply"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set sOhmCirculatingSupply(value: BigDecimal) { - this.set("sOhmCirculatingSupply", Value.fromBigDecimal(value)); - } - - get timestamp(): BigInt { - const value = this.get("timestamp"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigInt(); - } - } - - set timestamp(value: BigInt) { - this.set("timestamp", Value.fromBigInt(value)); - } - - get totalValueLocked(): BigDecimal { - const value = this.get("totalValueLocked"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigDecimal(); - } - } - - set totalValueLocked(value: BigDecimal) { - this.set("totalValueLocked", Value.fromBigDecimal(value)); - } - - get treasuryLiquidBacking(): BigDecimal | null { - const value = this.get("treasuryLiquidBacking"); - if (!value || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigDecimal(); - } - } - - set treasuryLiquidBacking(value: BigDecimal | null) { - if (!value) { - this.unset("treasuryLiquidBacking"); - } else { - this.set( - "treasuryLiquidBacking", - Value.fromBigDecimal(value) - ); - } - } - - get treasuryLiquidBackingPerGOhmSynthetic(): BigDecimal | null { - const value = this.get("treasuryLiquidBackingPerGOhmSynthetic"); - if (!value || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigDecimal(); - } - } - - set treasuryLiquidBackingPerGOhmSynthetic(value: BigDecimal | null) { - if (!value) { - this.unset("treasuryLiquidBackingPerGOhmSynthetic"); - } else { - this.set( - "treasuryLiquidBackingPerGOhmSynthetic", - Value.fromBigDecimal(value) - ); - } - } - - get treasuryLiquidBackingPerOhmFloating(): BigDecimal | null { - const value = this.get("treasuryLiquidBackingPerOhmFloating"); - if (!value || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigDecimal(); - } - } - - set treasuryLiquidBackingPerOhmFloating(value: BigDecimal | null) { - if (!value) { - this.unset("treasuryLiquidBackingPerOhmFloating"); - } else { - this.set( - "treasuryLiquidBackingPerOhmFloating", - Value.fromBigDecimal(value) - ); - } - } - - get treasuryMarketValue(): BigDecimal | null { - const value = this.get("treasuryMarketValue"); - if (!value || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigDecimal(); - } - } - - set treasuryMarketValue(value: BigDecimal | null) { - if (!value) { - this.unset("treasuryMarketValue"); - } else { - this.set("treasuryMarketValue", Value.fromBigDecimal(value)); - } - } -} - -export class BondDiscount extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - const id = this.get("id"); - assert(id != null, "Cannot save BondDiscount entity without an ID"); - if (id) { - assert( - id.kind == ValueKind.STRING, - `Entities of type BondDiscount must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` - ); - store.set("BondDiscount", id.toString(), this); + + get ohmFloatingSupply(): BigDecimal | null { + const value = this.get("ohmFloatingSupply"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); } } - static load(id: string): BondDiscount | null { - return changetype(store.get("BondDiscount", id)); + set ohmFloatingSupply(value: BigDecimal | null) { + if (!value) { + this.unset("ohmFloatingSupply"); + } else { + this.set("ohmFloatingSupply", Value.fromBigDecimal(value)); + } } - get id(): string { - const value = this.get("id"); + get ohmPrice(): BigDecimal { + const value = this.get("ohmPrice"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBigDecimal(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set ohmPrice(value: BigDecimal) { + this.set("ohmPrice", Value.fromBigDecimal(value)); } - get timestamp(): BigInt { - const value = this.get("timestamp"); + get ohmTotalSupply(): BigDecimal { + const value = this.get("ohmTotalSupply"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toBigInt(); + return value.toBigDecimal(); } } - set timestamp(value: BigInt) { - this.set("timestamp", Value.fromBigInt(value)); + set ohmTotalSupply(value: BigDecimal) { + this.set("ohmTotalSupply", Value.fromBigDecimal(value)); } - get dai_discount(): BigDecimal { - const value = this.get("dai_discount"); + get sOhmCirculatingSupply(): BigDecimal { + const value = this.get("sOhmCirculatingSupply"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { @@ -732,25 +260,25 @@ export class BondDiscount extends Entity { } } - set dai_discount(value: BigDecimal) { - this.set("dai_discount", Value.fromBigDecimal(value)); + set sOhmCirculatingSupply(value: BigDecimal) { + this.set("sOhmCirculatingSupply", Value.fromBigDecimal(value)); } - get ohmdai_discount(): BigDecimal { - const value = this.get("ohmdai_discount"); + get timestamp(): BigInt { + const value = this.get("timestamp"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toBigDecimal(); + return value.toBigInt(); } } - set ohmdai_discount(value: BigDecimal) { - this.set("ohmdai_discount", Value.fromBigDecimal(value)); + set timestamp(value: BigInt) { + this.set("timestamp", Value.fromBigInt(value)); } - get frax_discount(): BigDecimal { - const value = this.get("frax_discount"); + get totalValueLocked(): BigDecimal { + const value = this.get("totalValueLocked"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { @@ -758,67 +286,92 @@ export class BondDiscount extends Entity { } } - set frax_discount(value: BigDecimal) { - this.set("frax_discount", Value.fromBigDecimal(value)); + set totalValueLocked(value: BigDecimal) { + this.set("totalValueLocked", Value.fromBigDecimal(value)); } - get ohmfrax_discount(): BigDecimal { - const value = this.get("ohmfrax_discount"); + get treasuryLiquidBacking(): BigDecimal | null { + const value = this.get("treasuryLiquidBacking"); if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); + return null; } else { return value.toBigDecimal(); } } - set ohmfrax_discount(value: BigDecimal) { - this.set("ohmfrax_discount", Value.fromBigDecimal(value)); + set treasuryLiquidBacking(value: BigDecimal | null) { + if (!value) { + this.unset("treasuryLiquidBacking"); + } else { + this.set( + "treasuryLiquidBacking", + Value.fromBigDecimal(value) + ); + } } - get eth_discount(): BigDecimal { - const value = this.get("eth_discount"); + get treasuryLiquidBackingPerGOhmSynthetic(): BigDecimal | null { + const value = this.get("treasuryLiquidBackingPerGOhmSynthetic"); if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); + return null; } else { return value.toBigDecimal(); } } - set eth_discount(value: BigDecimal) { - this.set("eth_discount", Value.fromBigDecimal(value)); + set treasuryLiquidBackingPerGOhmSynthetic(value: BigDecimal | null) { + if (!value) { + this.unset("treasuryLiquidBackingPerGOhmSynthetic"); + } else { + this.set( + "treasuryLiquidBackingPerGOhmSynthetic", + Value.fromBigDecimal(value) + ); + } } - get lusd_discount(): BigDecimal { - const value = this.get("lusd_discount"); + get treasuryLiquidBackingPerOhmFloating(): BigDecimal | null { + const value = this.get("treasuryLiquidBackingPerOhmFloating"); if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); + return null; } else { return value.toBigDecimal(); } } - set lusd_discount(value: BigDecimal) { - this.set("lusd_discount", Value.fromBigDecimal(value)); + set treasuryLiquidBackingPerOhmFloating(value: BigDecimal | null) { + if (!value) { + this.unset("treasuryLiquidBackingPerOhmFloating"); + } else { + this.set( + "treasuryLiquidBackingPerOhmFloating", + Value.fromBigDecimal(value) + ); + } } - get ohmlusd_discount(): BigDecimal { - const value = this.get("ohmlusd_discount"); + get treasuryMarketValue(): BigDecimal | null { + const value = this.get("treasuryMarketValue"); if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); + return null; } else { return value.toBigDecimal(); } } - set ohmlusd_discount(value: BigDecimal) { - this.set("ohmlusd_discount", Value.fromBigDecimal(value)); + set treasuryMarketValue(value: BigDecimal | null) { + if (!value) { + this.unset("treasuryMarketValue"); + } else { + this.set("treasuryMarketValue", Value.fromBigDecimal(value)); + } } } export class TokenRecord extends Entity { - constructor(id: string) { + constructor(id: Bytes) { super(); - this.set("id", Value.fromString(id)); + this.set("id", Value.fromBytes(id)); } save(): void { @@ -826,28 +379,36 @@ export class TokenRecord extends Entity { assert(id != null, "Cannot save TokenRecord entity without an ID"); if (id) { assert( - id.kind == ValueKind.STRING, - `Entities of type TokenRecord must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + id.kind == ValueKind.BYTES, + `Entities of type TokenRecord must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("TokenRecord", id.toString(), this); + store.set("TokenRecord", id.toBytes().toHexString(), this); } } - static load(id: string): TokenRecord | null { - return changetype(store.get("TokenRecord", id)); + static loadInBlock(id: Bytes): TokenRecord | null { + return changetype( + store.get_in_block("TokenRecord", id.toHexString()) + ); + } + + static load(id: Bytes): TokenRecord | null { + return changetype( + store.get("TokenRecord", id.toHexString()) + ); } - get id(): string { + get id(): Bytes { const value = this.get("id"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBytes(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); } get block(): BigInt { @@ -1060,9 +621,9 @@ export class TokenRecord extends Entity { } export class TokenSupply extends Entity { - constructor(id: string) { + constructor(id: Bytes) { super(); - this.set("id", Value.fromString(id)); + this.set("id", Value.fromBytes(id)); } save(): void { @@ -1070,28 +631,36 @@ export class TokenSupply extends Entity { assert(id != null, "Cannot save TokenSupply entity without an ID"); if (id) { assert( - id.kind == ValueKind.STRING, - `Entities of type TokenSupply must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + id.kind == ValueKind.BYTES, + `Entities of type TokenSupply must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("TokenSupply", id.toString(), this); + store.set("TokenSupply", id.toBytes().toHexString(), this); } } - static load(id: string): TokenSupply | null { - return changetype(store.get("TokenSupply", id)); + static loadInBlock(id: Bytes): TokenSupply | null { + return changetype( + store.get_in_block("TokenSupply", id.toHexString()) + ); + } + + static load(id: Bytes): TokenSupply | null { + return changetype( + store.get("TokenSupply", id.toHexString()) + ); } - get id(): string { + get id(): Bytes { const value = this.get("id"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBytes(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); } get block(): BigInt { @@ -1285,6 +854,12 @@ export class PriceSnapshot extends Entity { } } + static loadInBlock(id: string): PriceSnapshot | null { + return changetype( + store.get_in_block("PriceSnapshot", id) + ); + } + static load(id: string): PriceSnapshot | null { return changetype(store.get("PriceSnapshot", id)); } @@ -1386,6 +961,12 @@ export class GnosisAuctionRoot extends Entity { } } + static loadInBlock(id: string): GnosisAuctionRoot | null { + return changetype( + store.get_in_block("GnosisAuctionRoot", id) + ); + } + static load(id: string): GnosisAuctionRoot | null { return changetype( store.get("GnosisAuctionRoot", id) @@ -1437,6 +1018,12 @@ export class GnosisAuction extends Entity { } } + static loadInBlock(id: string): GnosisAuction | null { + return changetype( + store.get_in_block("GnosisAuction", id) + ); + } + static load(id: string): GnosisAuction | null { return changetype(store.get("GnosisAuction", id)); } @@ -1529,9 +1116,9 @@ export class GnosisAuction extends Entity { } export class ERC20TokenSnapshot extends Entity { - constructor(id: string) { + constructor(id: Bytes) { super(); - this.set("id", Value.fromString(id)); + this.set("id", Value.fromBytes(id)); } save(): void { @@ -1539,30 +1126,36 @@ export class ERC20TokenSnapshot extends Entity { assert(id != null, "Cannot save ERC20TokenSnapshot entity without an ID"); if (id) { assert( - id.kind == ValueKind.STRING, - `Entities of type ERC20TokenSnapshot must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + id.kind == ValueKind.BYTES, + `Entities of type ERC20TokenSnapshot must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("ERC20TokenSnapshot", id.toString(), this); + store.set("ERC20TokenSnapshot", id.toBytes().toHexString(), this); } } - static load(id: string): ERC20TokenSnapshot | null { + static loadInBlock(id: Bytes): ERC20TokenSnapshot | null { return changetype( - store.get("ERC20TokenSnapshot", id) + store.get_in_block("ERC20TokenSnapshot", id.toHexString()) ); } - get id(): string { + static load(id: Bytes): ERC20TokenSnapshot | null { + return changetype( + store.get("ERC20TokenSnapshot", id.toHexString()) + ); + } + + get id(): Bytes { const value = this.get("id"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBytes(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); } get address(): Bytes { @@ -1609,121 +1202,47 @@ export class ERC20TokenSnapshot extends Entity { } } -export class ConvexRewardPoolSnapshot extends Entity { - constructor(id: string) { +export class BalancerPoolSnapshot extends Entity { + constructor(id: Bytes) { super(); - this.set("id", Value.fromString(id)); + this.set("id", Value.fromBytes(id)); } save(): void { const id = this.get("id"); - assert( - id != null, - "Cannot save ConvexRewardPoolSnapshot entity without an ID" - ); + assert(id != null, "Cannot save BalancerPoolSnapshot entity without an ID"); if (id) { assert( - id.kind == ValueKind.STRING, - `Entities of type ConvexRewardPoolSnapshot must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + id.kind == ValueKind.BYTES, + `Entities of type BalancerPoolSnapshot must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("ConvexRewardPoolSnapshot", id.toString(), this); + store.set("BalancerPoolSnapshot", id.toBytes().toHexString(), this); } } - static load(id: string): ConvexRewardPoolSnapshot | null { - return changetype( - store.get("ConvexRewardPoolSnapshot", id) + static loadInBlock(id: Bytes): BalancerPoolSnapshot | null { + return changetype( + store.get_in_block("BalancerPoolSnapshot", id.toHexString()) ); } - get id(): string { - const value = this.get("id"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get block(): BigInt { - const value = this.get("block"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigInt(); - } - } - - set block(value: BigInt) { - this.set("block", Value.fromBigInt(value)); - } - - get address(): Bytes { - const value = this.get("address"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBytes(); - } - } - - set address(value: Bytes) { - this.set("address", Value.fromBytes(value)); - } - - get stakingToken(): Bytes { - const value = this.get("stakingToken"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBytes(); - } - } - - set stakingToken(value: Bytes) { - this.set("stakingToken", Value.fromBytes(value)); - } -} - -export class BalancerPoolSnapshot extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - const id = this.get("id"); - assert(id != null, "Cannot save BalancerPoolSnapshot entity without an ID"); - if (id) { - assert( - id.kind == ValueKind.STRING, - `Entities of type BalancerPoolSnapshot must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` - ); - store.set("BalancerPoolSnapshot", id.toString(), this); - } - } - - static load(id: string): BalancerPoolSnapshot | null { + static load(id: Bytes): BalancerPoolSnapshot | null { return changetype( - store.get("BalancerPoolSnapshot", id) + store.get("BalancerPoolSnapshot", id.toHexString()) ); } - get id(): string { + get id(): Bytes { const value = this.get("id"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBytes(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); } get block(): BigInt { @@ -1832,9 +1351,9 @@ export class BalancerPoolSnapshot extends Entity { } export class PoolSnapshot extends Entity { - constructor(id: string) { + constructor(id: Bytes) { super(); - this.set("id", Value.fromString(id)); + this.set("id", Value.fromBytes(id)); } save(): void { @@ -1842,28 +1361,36 @@ export class PoolSnapshot extends Entity { assert(id != null, "Cannot save PoolSnapshot entity without an ID"); if (id) { assert( - id.kind == ValueKind.STRING, - `Entities of type PoolSnapshot must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + id.kind == ValueKind.BYTES, + `Entities of type PoolSnapshot must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("PoolSnapshot", id.toString(), this); + store.set("PoolSnapshot", id.toBytes().toHexString(), this); } } - static load(id: string): PoolSnapshot | null { - return changetype(store.get("PoolSnapshot", id)); + static loadInBlock(id: Bytes): PoolSnapshot | null { + return changetype( + store.get_in_block("PoolSnapshot", id.toHexString()) + ); + } + + static load(id: Bytes): PoolSnapshot | null { + return changetype( + store.get("PoolSnapshot", id.toHexString()) + ); } - get id(): string { + get id(): Bytes { const value = this.get("id"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBytes(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); } get block(): BigInt { @@ -1980,9 +1507,9 @@ export class PoolSnapshot extends Entity { } export class TokenPriceSnapshot extends Entity { - constructor(id: string) { + constructor(id: Bytes) { super(); - this.set("id", Value.fromString(id)); + this.set("id", Value.fromBytes(id)); } save(): void { @@ -1990,30 +1517,36 @@ export class TokenPriceSnapshot extends Entity { assert(id != null, "Cannot save TokenPriceSnapshot entity without an ID"); if (id) { assert( - id.kind == ValueKind.STRING, - `Entities of type TokenPriceSnapshot must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + id.kind == ValueKind.BYTES, + `Entities of type TokenPriceSnapshot must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("TokenPriceSnapshot", id.toString(), this); + store.set("TokenPriceSnapshot", id.toBytes().toHexString(), this); } } - static load(id: string): TokenPriceSnapshot | null { + static loadInBlock(id: Bytes): TokenPriceSnapshot | null { return changetype( - store.get("TokenPriceSnapshot", id) + store.get_in_block("TokenPriceSnapshot", id.toHexString()) ); } - get id(): string { + static load(id: Bytes): TokenPriceSnapshot | null { + return changetype( + store.get("TokenPriceSnapshot", id.toHexString()) + ); + } + + get id(): Bytes { const value = this.get("id"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBytes(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); } get block(): BigInt { @@ -2057,9 +1590,9 @@ export class TokenPriceSnapshot extends Entity { } export class StakingPoolSnapshot extends Entity { - constructor(id: string) { + constructor(id: Bytes) { super(); - this.set("id", Value.fromString(id)); + this.set("id", Value.fromBytes(id)); } save(): void { @@ -2067,30 +1600,36 @@ export class StakingPoolSnapshot extends Entity { assert(id != null, "Cannot save StakingPoolSnapshot entity without an ID"); if (id) { assert( - id.kind == ValueKind.STRING, - `Entities of type StakingPoolSnapshot must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + id.kind == ValueKind.BYTES, + `Entities of type StakingPoolSnapshot must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("StakingPoolSnapshot", id.toString(), this); + store.set("StakingPoolSnapshot", id.toBytes().toHexString(), this); } } - static load(id: string): StakingPoolSnapshot | null { + static loadInBlock(id: Bytes): StakingPoolSnapshot | null { return changetype( - store.get("StakingPoolSnapshot", id) + store.get_in_block("StakingPoolSnapshot", id.toHexString()) ); } - get id(): string { + static load(id: Bytes): StakingPoolSnapshot | null { + return changetype( + store.get("StakingPoolSnapshot", id.toHexString()) + ); + } + + get id(): Bytes { const value = this.get("id"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { - return value.toString(); + return value.toBytes(); } } - set id(value: string) { - this.set("id", Value.fromString(value)); + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); } get block(): BigInt { diff --git a/subgraphs/fantom/src/treasury/Assets.ts b/subgraphs/fantom/src/treasury/Assets.ts index 89f8e806..b3342950 100644 --- a/subgraphs/fantom/src/treasury/Assets.ts +++ b/subgraphs/fantom/src/treasury/Assets.ts @@ -1,10 +1,9 @@ -import { BigInt, log } from "@graphprotocol/graph-ts"; +import { BigInt, ethereum, log } from "@graphprotocol/graph-ts"; import { TokenCategoryStable, TokenCategoryVolatile, } from "../../../shared/src/contracts/TokenDefinition"; -import { NewRound } from "../../generated/TokenRecords-fantom/ChainlinkAggregator"; import { getOwnedLiquidityBalances } from "./OwnedLiquidity"; import { getTokenBalances } from "./TokenBalances"; @@ -16,7 +15,7 @@ export function generateTokenRecords(timestamp: BigInt, blockNumber: BigInt): vo getOwnedLiquidityBalances(timestamp, blockNumber); } -export function handleAssets(event: NewRound): void { - log.debug("handleAssets: *** Indexing block {}", [event.block.number.toString()]); - generateTokenRecords(event.block.timestamp, event.block.number); +export function handleAssets(block: ethereum.Block): void { + log.debug("handleAssets: *** Indexing block {}", [block.number.toString()]); + generateTokenRecords(block.timestamp, block.number); } diff --git a/subgraphs/fantom/subgraph.yaml b/subgraphs/fantom/subgraph.yaml index 2c1cc87f..60e68515 100644 --- a/subgraphs/fantom/subgraph.yaml +++ b/subgraphs/fantom/subgraph.yaml @@ -1,4 +1,4 @@ -specVersion: 0.0.4 +specVersion: 0.0.8 description: Olympus Protocol Metrics Subgraph - Fantom repository: https://github.com/OlympusDAO/olympus-protocol-metrics-subgraph # features: @@ -13,8 +13,8 @@ dataSources: name: TokenRecords-fantom network: fantom source: - address: "0xc7439cd23025a798913a027fb46bc347021483db" - abi: ChainlinkAggregator + address: "0x91fa20244Fb509e8289CA630E5db3E9166233FDc" + abi: gOHM startBlock: 37320000 # 2022-05-01 mapping: kind: ethereum/events @@ -24,9 +24,6 @@ dataSources: - TokenRecord - TokenSupply abis: - # For the event handler - - name: ChainlinkAggregator - file: abis/ChainlinkAggregator.json # Basic - name: ERC20 file: ../shared/abis/ERC20.json @@ -41,8 +38,10 @@ dataSources: file: ../shared/abis/UniswapV2Pair.json - name: UniswapV3Pair file: ../shared/abis/UniswapV3Pair.json - eventHandlers: - # Event every few hours - - event: NewRound(indexed uint256,indexed address,uint256) - handler: handleAssets + blockHandlers: + - handler: handleAssets + filter: + kind: polling + # Only index every 7200nd block, approximately 8 hours + every: 7200 file: ./src/treasury/Assets.ts From 7ffb2e64c5b63e06d6bbaad6ed5fe0eb12c733e2 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 9 Oct 2023 20:49:50 +0400 Subject: [PATCH 29/81] Shift to more regular polling block handler --- subgraphs/ethereum/subgraph.yaml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/subgraphs/ethereum/subgraph.yaml b/subgraphs/ethereum/subgraph.yaml index 852a4177..76e2a565 100644 --- a/subgraphs/ethereum/subgraph.yaml +++ b/subgraphs/ethereum/subgraph.yaml @@ -13,9 +13,8 @@ dataSources: name: ProtocolMetrics network: mainnet source: - # DAI-ETH price feed - address: "0x158228e08C52F3e2211Ccbc8ec275FA93f6033FC" - abi: ChainlinkPriceFeed + address: "0x0ab87046fBb341D058F17CBC4c1133F25a20a52f" + abi: gOHM startBlock: 14690000 mapping: kind: ethereum/events @@ -122,11 +121,13 @@ dataSources: # Cooler Loans - name: CoolerLoansClearinghouse file: ./abis/CoolerLoansClearinghouse.json - # This will trigger every hour - # Some Chainlink price feeds will trigger every 24 hours, but that is too infrequent - eventHandlers: - - event: NewRound(indexed uint256,indexed address,uint256) - handler: handleNewRound + blockHandlers: + - handler: handleMetricsBlock + filter: + kind: polling + # Every 8 hours + # 5 blocks per minute * 60 minutes * 8 hours + every: 2400 file: ./src/protocolMetrics/ProtocolMetrics.ts ### # BondManager and GnosisEasyAuction index Gnosis auction events, used for bond calculations From 613678a080a214974d1a75312c1434e6a8015f74 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 9 Oct 2023 20:51:50 +0400 Subject: [PATCH 30/81] Revert to block handler. Shift start block forward for quicker testing. --- subgraphs/ethereum/config.json | 2 +- subgraphs/ethereum/subgraph.yaml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index 809d1b9a..8eb82f53 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -2,5 +2,5 @@ "id": "QmVUK6usoki2p8E2gWFdvCLnYnZ3PeBNwTda3KbenDXGgi", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "4.99.7" + "version": "4.99.8" } \ No newline at end of file diff --git a/subgraphs/ethereum/subgraph.yaml b/subgraphs/ethereum/subgraph.yaml index 76e2a565..b653988e 100644 --- a/subgraphs/ethereum/subgraph.yaml +++ b/subgraphs/ethereum/subgraph.yaml @@ -15,7 +15,8 @@ dataSources: source: address: "0x0ab87046fBb341D058F17CBC4c1133F25a20a52f" abi: gOHM - startBlock: 14690000 + # startBlock: 14690000 + startBlock: 18000000 # August 2023 mapping: kind: ethereum/events apiVersion: 0.0.6 From b9bf52a0e7481374f236d13bf6512ce88c5fe624 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 9 Oct 2023 20:54:05 +0400 Subject: [PATCH 31/81] Fix compile error --- subgraphs/ethereum/config.json | 2 +- .../ethereum/src/protocolMetrics/ProtocolMetrics.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index 8eb82f53..56afc71a 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,5 +1,5 @@ { - "id": "QmVUK6usoki2p8E2gWFdvCLnYnZ3PeBNwTda3KbenDXGgi", + "id": "QmeNHf7LABPxTULFK6DdGsEDkmsG7nsG7c7SsNuCFz8CJH", "org": "olympusdao", "name": "olympus-protocol-metrics", "version": "4.99.8" diff --git a/subgraphs/ethereum/src/protocolMetrics/ProtocolMetrics.ts b/subgraphs/ethereum/src/protocolMetrics/ProtocolMetrics.ts index 5f9f318f..a7923432 100644 --- a/subgraphs/ethereum/src/protocolMetrics/ProtocolMetrics.ts +++ b/subgraphs/ethereum/src/protocolMetrics/ProtocolMetrics.ts @@ -81,16 +81,16 @@ export function updateProtocolMetrics(block: ethereum.Block, tokenRecords: Token pm.save(); } -export function handleNewRound(event: NewRound): void { - log.debug("handleNewRound: *** Indexing block {}", [event.block.number.toString()]); +export function handleMetricsBlock(block: ethereum.Block): void { + log.debug("handleMetricsBlock: *** Indexing block {}", [block.number.toString()]); // TokenRecord - const tokenRecords = generateTokenRecords(event.block.timestamp, event.block.number); + const tokenRecords = generateTokenRecords(block.timestamp, block.number); // TokenSupply - const tokenSupplies = generateTokenSupply(event.block.timestamp, event.block.number); + const tokenSupplies = generateTokenSupply(block.timestamp, block.number); // Use the generated records to calculate protocol/treasury metrics // Otherwise we would be re-generating the records - updateProtocolMetrics(event.block, tokenRecords, tokenSupplies); + updateProtocolMetrics(block, tokenRecords, tokenSupplies); } From f14eca9fbb6c2f809880769b94c191645ccb9b6f Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 10 Oct 2023 10:46:33 +0400 Subject: [PATCH 32/81] Re-deployments --- subgraphs/ethereum/config.json | 4 ++-- subgraphs/ethereum/subgraph.yaml | 6 ++++-- subgraphs/fantom/config.json | 2 +- subgraphs/polygon/config.json | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index 56afc71a..4248fff3 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmeNHf7LABPxTULFK6DdGsEDkmsG7nsG7c7SsNuCFz8CJH", + "id": "QmbcfydjRnbyFaJKL75P4Hj747Tq4DctfckQp3Yx2WRZPZ", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "4.99.8" + "version": "4.99.9" } \ No newline at end of file diff --git a/subgraphs/ethereum/subgraph.yaml b/subgraphs/ethereum/subgraph.yaml index b653988e..244f70a7 100644 --- a/subgraphs/ethereum/subgraph.yaml +++ b/subgraphs/ethereum/subgraph.yaml @@ -139,7 +139,8 @@ dataSources: source: address: "0xf577c77ee3578c7f216327f41b5d7221ead2b2a3" abi: BondManager - startBlock: 16226955 + # startBlock: 16226955 + startBlock: 18000000 # August 2023 mapping: kind: ethereum/events apiVersion: 0.0.6 @@ -160,7 +161,8 @@ dataSources: source: address: "0x0b7ffc1f4ad541a4ed16b40d8c37f0929158d101" abi: GnosisEasyAuction - startBlock: 16226955 # Same as BondManager + # startBlock: 16226955 # Same as BondManager + startBlock: 18000000 # August 2023 mapping: kind: ethereum/events apiVersion: 0.0.6 diff --git a/subgraphs/fantom/config.json b/subgraphs/fantom/config.json index 96f9b6e3..da4f57f5 100644 --- a/subgraphs/fantom/config.json +++ b/subgraphs/fantom/config.json @@ -1,6 +1,6 @@ { "id": "QmQDXkuub2eEMR5PLNHvw7y2Qh72HRwN3S95aMMAiw4Lod", - "version": "1.0.1", + "version": "1.0.2", "org": "olympusdao", "name": "protocol-metrics-fantom" } \ No newline at end of file diff --git a/subgraphs/polygon/config.json b/subgraphs/polygon/config.json index 7b7fb05c..9f47e588 100644 --- a/subgraphs/polygon/config.json +++ b/subgraphs/polygon/config.json @@ -2,5 +2,5 @@ "id": "QmdDUpqEzfKug1ER6HWM8c7U6wf3wtEtRBvXV7LkVoBi9f", "org": "olympusdao", "name": "protocol-metrics-polygon", - "version": "1.1.0" + "version": "1.1.1" } \ No newline at end of file From 886d8e4c8fddd8ec34f7e60a7785ae08f9da6ecd Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 10 Oct 2023 21:40:55 +0400 Subject: [PATCH 33/81] Change block polling on Fantom --- subgraphs/fantom/config.json | 4 ++-- subgraphs/fantom/subgraph.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/subgraphs/fantom/config.json b/subgraphs/fantom/config.json index da4f57f5..fca0137e 100644 --- a/subgraphs/fantom/config.json +++ b/subgraphs/fantom/config.json @@ -1,6 +1,6 @@ { - "id": "QmQDXkuub2eEMR5PLNHvw7y2Qh72HRwN3S95aMMAiw4Lod", - "version": "1.0.2", + "id": "QmS4u2WbuaiFdKdFgzQ4J5NpLxWn7ecFXauLejTShscTfJ", + "version": "1.0.3", "org": "olympusdao", "name": "protocol-metrics-fantom" } \ No newline at end of file diff --git a/subgraphs/fantom/subgraph.yaml b/subgraphs/fantom/subgraph.yaml index 60e68515..8411527f 100644 --- a/subgraphs/fantom/subgraph.yaml +++ b/subgraphs/fantom/subgraph.yaml @@ -42,6 +42,6 @@ dataSources: - handler: handleAssets filter: kind: polling - # Only index every 7200nd block, approximately 8 hours - every: 7200 + # Only index every 24000 blocks, approximately 8 hours + every: 24000 file: ./src/treasury/Assets.ts From 77ae7351e3eef9edf0e65e104f975405954a8f82 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Wed, 11 Oct 2023 11:20:20 +0400 Subject: [PATCH 34/81] Restore starting blocks for Ethereum subgraph. New deployment. --- subgraphs/ethereum/CHANGELOG.md | 5 +++-- subgraphs/ethereum/config.json | 4 ++-- subgraphs/ethereum/subgraph.yaml | 9 +++------ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/subgraphs/ethereum/CHANGELOG.md b/subgraphs/ethereum/CHANGELOG.md index af2bd762..6fb933b1 100644 --- a/subgraphs/ethereum/CHANGELOG.md +++ b/subgraphs/ethereum/CHANGELOG.md @@ -1,10 +1,11 @@ # Subgraph Changelog -## 5.0.0 (???) +## 5.0.0 (2023-10-11) - Improve indexing performance by using Bytes instead of String for entity ids - Improve indexing performance by shifting TokenRecord, TokenSupply and ProtocolMetric entities to be immutable -- Change the indexing trigger to Chainlink, as the previous event will be deprecated soon +- Change the indexing trigger to a polling block handler (every 8 hours), as the previous event trigger will be deprecated soon +- Re-index from 2022-05-01 ## 4.14.2 (2023-10-05) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index 4248fff3..40449c0a 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmbcfydjRnbyFaJKL75P4Hj747Tq4DctfckQp3Yx2WRZPZ", + "id": "QmWe5DKxZ2g8V5tr6rLskxSkwBD6x6deZFT7XHoMoB4g5v", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "4.99.9" + "version": "5.0.0" } \ No newline at end of file diff --git a/subgraphs/ethereum/subgraph.yaml b/subgraphs/ethereum/subgraph.yaml index 244f70a7..76e2a565 100644 --- a/subgraphs/ethereum/subgraph.yaml +++ b/subgraphs/ethereum/subgraph.yaml @@ -15,8 +15,7 @@ dataSources: source: address: "0x0ab87046fBb341D058F17CBC4c1133F25a20a52f" abi: gOHM - # startBlock: 14690000 - startBlock: 18000000 # August 2023 + startBlock: 14690000 mapping: kind: ethereum/events apiVersion: 0.0.6 @@ -139,8 +138,7 @@ dataSources: source: address: "0xf577c77ee3578c7f216327f41b5d7221ead2b2a3" abi: BondManager - # startBlock: 16226955 - startBlock: 18000000 # August 2023 + startBlock: 16226955 mapping: kind: ethereum/events apiVersion: 0.0.6 @@ -161,8 +159,7 @@ dataSources: source: address: "0x0b7ffc1f4ad541a4ed16b40d8c37f0929158d101" abi: GnosisEasyAuction - # startBlock: 16226955 # Same as BondManager - startBlock: 18000000 # August 2023 + startBlock: 16226955 # Same as BondManager mapping: kind: ethereum/events apiVersion: 0.0.6 From 67d3f08818a3dae18371fffd41c10db4638b33e8 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Wed, 11 Oct 2023 12:33:29 +0400 Subject: [PATCH 35/81] Implement changes to the branch comparison check to support different blocks --- .github/workflows/query.yml | 4 +- bin/subgraph/src/index.ts | 6 +-- bin/subgraph/src/networkHandler.ts | 4 +- bin/subgraph/src/subgraph.ts | 43 +++++++++++-------- .../src/subgraphs/ethereum/compare.ts | 6 +-- bin/subgraph/src/subgraphs/ethereum/index.ts | 22 +++++----- .../src/subgraphs/ethereum/results.ts | 4 +- bin/subgraph/src/subgraphs/shared/compare.ts | 6 +-- bin/subgraph/src/subgraphs/shared/index.ts | 20 +++++---- bin/subgraph/src/subgraphs/shared/results.ts | 4 +- 10 files changed, 66 insertions(+), 53 deletions(-) diff --git a/.github/workflows/query.yml b/.github/workflows/query.yml index 184c407a..b3bddd47 100644 --- a/.github/workflows/query.yml +++ b/.github/workflows/query.yml @@ -27,9 +27,9 @@ jobs: DEPLOYMENT_ID=$(jq -r .id subgraphs/${{ matrix.subgraph }}/config.json) [[ ! -z "$DEPLOYMENT_ID" ]] && echo "deployment id is set" || (echo "::error::deployment id is not set in config.json" && exit 1) echo "DEPLOYMENT_ID=$DEPLOYMENT_ID" >> $GITHUB_ENV - - name: Get Latest Block + - name: Get Latest Date run: | - yarn subgraph latest-block ${{ matrix.subgraph }} --deployment ${{ env.DEPLOYMENT_ID }} + yarn subgraph latest-date ${{ matrix.subgraph }} --deployment ${{ env.DEPLOYMENT_ID }} - name: Get Token Records run: | yarn subgraph query ${{ matrix.subgraph }} --branch branch --deployment ${{ env.DEPLOYMENT_ID }} diff --git a/bin/subgraph/src/index.ts b/bin/subgraph/src/index.ts index 0fe7be72..91fdecb4 100644 --- a/bin/subgraph/src/index.ts +++ b/bin/subgraph/src/index.ts @@ -145,13 +145,13 @@ program .description("CLI for the deployment and testing of Olympus subgraphs"); program - .command("latest-block") - .description("Determines the latest block for a subgraph") + .command("latest-date") + .description("Determines the latest date for a subgraph") .argument("", `the subgraph to use, one of: ${subgraphNames.join(", ")}`, parseSubgraph) .requiredOption("--deployment ", "the deployment id (starts with 'Qm')", parseDeploymentId) .action(async (subgraph, options) => { const query = await getSubgraphHandler(subgraph, options.deployment, null); - query.doLatestBlock(); + query.doLatestDate(); }); program diff --git a/bin/subgraph/src/networkHandler.ts b/bin/subgraph/src/networkHandler.ts index 4b69b194..851f0d9d 100644 --- a/bin/subgraph/src/networkHandler.ts +++ b/bin/subgraph/src/networkHandler.ts @@ -7,7 +7,7 @@ export interface NetworkHandler { subgraphId: string; branch: string; - doLatestBlock(): void; + doLatestDate(): void; doQuery(): void; doComparison(): void; } @@ -27,7 +27,7 @@ export class BaseNetworkHandler implements NetworkHandler { this.outputPath = outputPath; } - public async doLatestBlock(): Promise { + public async doLatestDate(): Promise { throw new Error("Method not implemented."); } public async doQuery(): Promise { diff --git a/bin/subgraph/src/subgraph.ts b/bin/subgraph/src/subgraph.ts index af9b7749..732f4c52 100644 --- a/bin/subgraph/src/subgraph.ts +++ b/bin/subgraph/src/subgraph.ts @@ -13,8 +13,29 @@ const performQuery = async (subgraphId: string, query: string): Promise => return await gqlClient.query({ query: gql(query) }); }; +export const getLatestBlock = async (subgraphId: string, date: string): Promise => { + const query = ` + { + tokenRecords(first: 1, orderBy: block, orderDirection: desc, where: {date: "${date}"}) { + block + } + } + `; + console.info( + `Fetching latest block on date ${date} for subgraph id ${subgraphId} with query: ${query}`, + ); + const dayBeforeResults = await performQuery(subgraphId, query); + if (!dayBeforeResults.data) { + throw new Error("getTestBlock: day before latest block query returned no results"); + } + + const latestBlock = dayBeforeResults.data.tokenRecords[0].block; + console.info(`Received latest block ${latestBlock}`); + return latestBlock; +} + /** - * Determines a block that can be used for testing. + * Determines a date that can be used for testing. * * Currently, this looks for the latest block that is available, and determines * the latest block for the previous day. The absolute latest block @@ -24,7 +45,7 @@ const performQuery = async (subgraphId: string, query: string): Promise => * @returns * @throws Error if there are no results from the GraphQL query */ -export const getTestBlock = async (subgraphId: string): Promise => { +export const getTestDate = async (subgraphId: string): Promise => { // We first fetch the latest block for the query const latestBlockQuery = ` { @@ -50,24 +71,8 @@ export const getTestBlock = async (subgraphId: string): Promise => { const dayBeforeDate = new Date(latestBlockDate); dayBeforeDate.setTime(dayBeforeDate.getTime() - DAY_MS); const dayBeforeDateString = dayBeforeDate.toISOString().split("T")[0]; - const dayBeforeQuery = ` - { - tokenRecords(first: 1, orderBy: block, orderDirection: desc, where: {date: "${dayBeforeDateString}"}) { - block - } - } - `; - console.info( - `Fetching latest block on date ${dayBeforeDateString} for subgraph id ${subgraphId} with query: ${dayBeforeQuery}`, - ); - const dayBeforeResults = await performQuery(subgraphId, dayBeforeQuery); - if (!dayBeforeResults.data) { - throw new Error("getTestBlock: day before latest block query returned no results"); - } - const dayBeforeLatestBlock = dayBeforeResults.data.tokenRecords[0].block; - console.info(`Received latest block ${dayBeforeLatestBlock}`); - return dayBeforeLatestBlock; + return dayBeforeDateString; }; export type TokenRecord = { diff --git a/bin/subgraph/src/subgraphs/ethereum/compare.ts b/bin/subgraph/src/subgraphs/ethereum/compare.ts index ef5d6ce4..8efc3566 100644 --- a/bin/subgraph/src/subgraphs/ethereum/compare.ts +++ b/bin/subgraph/src/subgraphs/ethereum/compare.ts @@ -279,11 +279,11 @@ export const combineOutput = (network: string, comparisonFile: ComparisonResults */ comparisonFile.results.output = ` **Network:** ${network} -**Block Tested:** ${comparisonFile.latestBlock} +**Date:** ${comparisonFile.latestDate} **Subgraph Id:** -Base: ${comparisonFile.branches.base.subgraphId} -Branch: ${comparisonFile.branches.branch.subgraphId} +Base: ${comparisonFile.branches.base.subgraphId} (Block: ${comparisonFile.branches.base.blockNumber}) +Branch: ${comparisonFile.branches.branch.subgraphId} (Block: ${comparisonFile.branches.branch.blockNumber}) ## Asset Records ${comparisonFile.results.marketValue.output} diff --git a/bin/subgraph/src/subgraphs/ethereum/index.ts b/bin/subgraph/src/subgraphs/ethereum/index.ts index 56812756..5f5b4efe 100644 --- a/bin/subgraph/src/subgraphs/ethereum/index.ts +++ b/bin/subgraph/src/subgraphs/ethereum/index.ts @@ -1,5 +1,5 @@ import { BaseNetworkHandler } from "../../networkHandler"; -import { getOhmPrice, getTestBlock, getTokenRecords, getTokenSupplies } from "../../subgraph"; +import { getLatestBlock, getOhmPrice, getTestDate, getTokenRecords, getTokenSupplies } from "../../subgraph"; import { combineOutput, compareBackedSupplyRecords, @@ -13,25 +13,27 @@ import { import { readComparisonFile, writeComparisonFile } from "./results"; export default class EthereumHandler extends BaseNetworkHandler { - async doLatestBlock(): Promise { + async doLatestDate(): Promise { const comparisonFile = readComparisonFile(this.outputPath); - const latestBlock = await getTestBlock(this.subgraphId); + const latestDate = await getTestDate(this.subgraphId); + comparisonFile.latestDate = latestDate; - comparisonFile.latestBlock = latestBlock; writeComparisonFile(comparisonFile, this.outputPath); } async doQuery(): Promise { const comparisonFile = readComparisonFile(this.outputPath); - const tokenRecords = await getTokenRecords(this.subgraphId, comparisonFile.latestBlock); - const tokenSupplies = await getTokenSupplies(this.subgraphId, comparisonFile.latestBlock); + // Fetch the latest block for each branch + const latestBlock = await getLatestBlock(this.subgraphId, comparisonFile.latestDate); + comparisonFile.branches[this.branch].blockNumber = latestBlock; + + const tokenRecords = await getTokenRecords(this.subgraphId, latestBlock); + const tokenSupplies = await getTokenSupplies(this.subgraphId, latestBlock); // Update the comparison results and write - comparisonFile.branches[this.branch] = { - subgraphId: this.subgraphId, - }; + comparisonFile.branches[this.branch].subgraphId = this.subgraphId; comparisonFile.records.tokenRecords[this.branch] = tokenRecords; comparisonFile.records.tokenSupplies[this.branch] = tokenSupplies; @@ -54,7 +56,7 @@ export default class EthereumHandler extends BaseNetworkHandler { // Get OHM price const subgraphId = comparisonFile.branches.branch.subgraphId; - const block = comparisonFile.latestBlock; + const block = comparisonFile.branches.branch.blockNumber; const ohmPrice = await getOhmPrice(subgraphId, block); doLiquidBackingCheck(tokenRecordsBranch, tokenSuppliesBranch, ohmPrice, comparisonFile); diff --git a/bin/subgraph/src/subgraphs/ethereum/results.ts b/bin/subgraph/src/subgraphs/ethereum/results.ts index 92b9c02f..896a20a5 100644 --- a/bin/subgraph/src/subgraphs/ethereum/results.ts +++ b/bin/subgraph/src/subgraphs/ethereum/results.ts @@ -4,12 +4,14 @@ import { dirname } from "path"; import { TokenRecord, TokenSupply } from "../../subgraph"; export type ComparisonResults = { - latestBlock?: string; + latestDate?: string; branches: { base?: { + blockNumber?: string; subgraphId: string; }; branch?: { + blockNumber?: string; subgraphId: string; }; }; diff --git a/bin/subgraph/src/subgraphs/shared/compare.ts b/bin/subgraph/src/subgraphs/shared/compare.ts index f05d346b..fa3e865b 100644 --- a/bin/subgraph/src/subgraphs/shared/compare.ts +++ b/bin/subgraph/src/subgraphs/shared/compare.ts @@ -188,11 +188,11 @@ export const combineOutput = (network: string, comparisonFile: ComparisonResults */ comparisonFile.results.output = ` **Network:** ${network} -**Block Tested:** ${comparisonFile.latestBlock} +**Date:** ${comparisonFile.latestDate} **Subgraph Id:** -Base: ${comparisonFile.branches.base.subgraphId} -Branch: ${comparisonFile.branches.branch.subgraphId} +Base: ${comparisonFile.branches.base.subgraphId} (Block: ${comparisonFile.branches.base.blockNumber}) +Branch: ${comparisonFile.branches.branch.subgraphId} (Block: ${comparisonFile.branches.branch.blockNumber}) ## Asset Records ${comparisonFile.results.marketValue.output} diff --git a/bin/subgraph/src/subgraphs/shared/index.ts b/bin/subgraph/src/subgraphs/shared/index.ts index 9d8432e5..2df49ca6 100644 --- a/bin/subgraph/src/subgraphs/shared/index.ts +++ b/bin/subgraph/src/subgraphs/shared/index.ts @@ -1,5 +1,5 @@ import { BaseNetworkHandler } from "../../networkHandler"; -import { getTestBlock, getTokenRecords, getTokenSupplies } from "../../subgraph"; +import { getLatestBlock, getTestDate, getTokenRecords, getTokenSupplies } from "../../subgraph"; import { combineOutput, compareLiquidBackingRecords, @@ -10,25 +10,27 @@ import { import { readComparisonFile, writeComparisonFile } from "./results"; export default class EthereumHandler extends BaseNetworkHandler { - async doLatestBlock(): Promise { + async doLatestDate(): Promise { const comparisonFile = readComparisonFile(this.outputPath); - const latestBlock = await getTestBlock(this.subgraphId); + const latestDate = await getTestDate(this.subgraphId); + comparisonFile.latestDate = latestDate; - comparisonFile.latestBlock = latestBlock; writeComparisonFile(comparisonFile, this.outputPath); } async doQuery(): Promise { const comparisonFile = readComparisonFile(this.outputPath); - const tokenRecords = await getTokenRecords(this.subgraphId, comparisonFile.latestBlock); - const tokenSupplies = await getTokenSupplies(this.subgraphId, comparisonFile.latestBlock); + // Fetch the latest block for each branch + const latestBlock = await getLatestBlock(this.subgraphId, comparisonFile.latestDate); + comparisonFile.branches[this.branch].blockNumber = latestBlock; + + const tokenRecords = await getTokenRecords(this.subgraphId, latestBlock); + const tokenSupplies = await getTokenSupplies(this.subgraphId, latestBlock); // Update the comparison results and write - comparisonFile.branches[this.branch] = { - subgraphId: this.subgraphId, - }; + comparisonFile.branches[this.branch].subgraphId = this.subgraphId; comparisonFile.records.tokenRecords[this.branch] = tokenRecords; comparisonFile.records.tokenSupplies[this.branch] = tokenSupplies; diff --git a/bin/subgraph/src/subgraphs/shared/results.ts b/bin/subgraph/src/subgraphs/shared/results.ts index 00c81800..d31fde0a 100644 --- a/bin/subgraph/src/subgraphs/shared/results.ts +++ b/bin/subgraph/src/subgraphs/shared/results.ts @@ -4,12 +4,14 @@ import { dirname } from "path"; import { TokenRecord, TokenSupply } from "../../subgraph"; export type ComparisonResults = { - latestBlock?: string; + latestDate?: string; branches: { base?: { + blockNumber?: string; subgraphId: string; }; branch?: { + blockNumber?: string; subgraphId: string; }; }; From ab6f8669a020dbfc9b851c235be1f41b9857ff48 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Wed, 11 Oct 2023 12:41:31 +0400 Subject: [PATCH 36/81] Fix for uninitialised values --- bin/subgraph/src/subgraphs/ethereum/index.ts | 9 +++++++-- bin/subgraph/src/subgraphs/shared/index.ts | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/bin/subgraph/src/subgraphs/ethereum/index.ts b/bin/subgraph/src/subgraphs/ethereum/index.ts index 5f5b4efe..eeea7e74 100644 --- a/bin/subgraph/src/subgraphs/ethereum/index.ts +++ b/bin/subgraph/src/subgraphs/ethereum/index.ts @@ -24,19 +24,24 @@ export default class EthereumHandler extends BaseNetworkHandler { async doQuery(): Promise { const comparisonFile = readComparisonFile(this.outputPath); + const branchInfo = { + subgraphId: "", + blockNumber: "", + }; // Fetch the latest block for each branch const latestBlock = await getLatestBlock(this.subgraphId, comparisonFile.latestDate); - comparisonFile.branches[this.branch].blockNumber = latestBlock; + branchInfo.blockNumber = latestBlock; const tokenRecords = await getTokenRecords(this.subgraphId, latestBlock); const tokenSupplies = await getTokenSupplies(this.subgraphId, latestBlock); // Update the comparison results and write - comparisonFile.branches[this.branch].subgraphId = this.subgraphId; + branchInfo.subgraphId = this.subgraphId; comparisonFile.records.tokenRecords[this.branch] = tokenRecords; comparisonFile.records.tokenSupplies[this.branch] = tokenSupplies; + comparisonFile.branches[this.branch] = branchInfo; writeComparisonFile(comparisonFile, this.outputPath); } diff --git a/bin/subgraph/src/subgraphs/shared/index.ts b/bin/subgraph/src/subgraphs/shared/index.ts index 2df49ca6..7a19503c 100644 --- a/bin/subgraph/src/subgraphs/shared/index.ts +++ b/bin/subgraph/src/subgraphs/shared/index.ts @@ -21,19 +21,24 @@ export default class EthereumHandler extends BaseNetworkHandler { async doQuery(): Promise { const comparisonFile = readComparisonFile(this.outputPath); + const branchInfo = { + subgraphId: "", + blockNumber: "", + }; // Fetch the latest block for each branch const latestBlock = await getLatestBlock(this.subgraphId, comparisonFile.latestDate); - comparisonFile.branches[this.branch].blockNumber = latestBlock; + branchInfo.blockNumber = latestBlock; const tokenRecords = await getTokenRecords(this.subgraphId, latestBlock); const tokenSupplies = await getTokenSupplies(this.subgraphId, latestBlock); // Update the comparison results and write - comparisonFile.branches[this.branch].subgraphId = this.subgraphId; + branchInfo.subgraphId = this.subgraphId; comparisonFile.records.tokenRecords[this.branch] = tokenRecords; comparisonFile.records.tokenSupplies[this.branch] = tokenSupplies; + comparisonFile.branches[this.branch] = branchInfo; writeComparisonFile(comparisonFile, this.outputPath); } From a3653d298ccce8c9ae270f5e676135579abb5813 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Wed, 11 Oct 2023 14:42:52 +0400 Subject: [PATCH 37/81] Consistent ordering, add pool to TokenSupply query --- bin/subgraph/src/subgraph.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/subgraph/src/subgraph.ts b/bin/subgraph/src/subgraph.ts index 732f4c52..7f6087b5 100644 --- a/bin/subgraph/src/subgraph.ts +++ b/bin/subgraph/src/subgraph.ts @@ -105,7 +105,7 @@ export const getTokenRecords = async ( ): Promise => { const query = ` { - tokenRecords(where: {block: ${block}}) { + tokenRecords(orderBy: token, where: {block: ${block}}) { id block date @@ -158,11 +158,12 @@ export const getTokenSupplies = async ( ): Promise => { const query = ` { - tokenSupplies(where: {block: ${block}}) { + tokenSupplies(orderBy: token, where: {block: ${block}}) { id block date token + pool source balance supplyBalance From 7d33aba50fd0da9a7e9829ba764f910c3331a30a Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Wed, 11 Oct 2023 15:08:55 +0400 Subject: [PATCH 38/81] Revert deployment changes for Fantom and Polygon, so the diff is not messed up --- subgraphs/fantom/CHANGELOG.md | 6 ------ subgraphs/fantom/config.json | 4 ++-- subgraphs/polygon/CHANGELOG.md | 6 ------ subgraphs/polygon/config.json | 4 ++-- 4 files changed, 4 insertions(+), 16 deletions(-) delete mode 100644 subgraphs/fantom/CHANGELOG.md delete mode 100644 subgraphs/polygon/CHANGELOG.md diff --git a/subgraphs/fantom/CHANGELOG.md b/subgraphs/fantom/CHANGELOG.md deleted file mode 100644 index 7bbe5ce2..00000000 --- a/subgraphs/fantom/CHANGELOG.md +++ /dev/null @@ -1,6 +0,0 @@ -# protocol-metrics-fantom - -## v1.0.1 (2023-10-09) - -- Shift to polling block handler -- Deploy on Graph Protocol Decentralized Network diff --git a/subgraphs/fantom/config.json b/subgraphs/fantom/config.json index fca0137e..645099d5 100644 --- a/subgraphs/fantom/config.json +++ b/subgraphs/fantom/config.json @@ -1,6 +1,6 @@ { - "id": "QmS4u2WbuaiFdKdFgzQ4J5NpLxWn7ecFXauLejTShscTfJ", - "version": "1.0.3", + "id": "QmSBMNhnzbe4c4cwznLUsFkE4H5XZfiVqLHnNZYA48EPwy", + "version": "0.1.0", "org": "olympusdao", "name": "protocol-metrics-fantom" } \ No newline at end of file diff --git a/subgraphs/polygon/CHANGELOG.md b/subgraphs/polygon/CHANGELOG.md deleted file mode 100644 index fab576ba..00000000 --- a/subgraphs/polygon/CHANGELOG.md +++ /dev/null @@ -1,6 +0,0 @@ -# protocol-metrics-polygon - -## v1.1.0 (2023-10-09) - -- Implemented polling block handler for faster (hopefully) indexing -- Deployment on Graph Protocol Decentralized Network diff --git a/subgraphs/polygon/config.json b/subgraphs/polygon/config.json index 9f47e588..5c40b2b5 100644 --- a/subgraphs/polygon/config.json +++ b/subgraphs/polygon/config.json @@ -1,6 +1,6 @@ { - "id": "QmdDUpqEzfKug1ER6HWM8c7U6wf3wtEtRBvXV7LkVoBi9f", + "id": "QmcGw4WahErwDMqiZxjD4nPec6TCEpqhD3wvKNwGt9fqqf", "org": "olympusdao", "name": "protocol-metrics-polygon", - "version": "1.1.1" + "version": "1.0.2" } \ No newline at end of file From 900ebce42b6bdb5d86002cc77dbdaceff9652fea Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 12 Oct 2023 14:55:43 +0400 Subject: [PATCH 39/81] Add back Polygon deployment --- subgraphs/polygon/CHANGELOG.md | 6 ++++++ subgraphs/polygon/config.json | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 subgraphs/polygon/CHANGELOG.md diff --git a/subgraphs/polygon/CHANGELOG.md b/subgraphs/polygon/CHANGELOG.md new file mode 100644 index 00000000..fab576ba --- /dev/null +++ b/subgraphs/polygon/CHANGELOG.md @@ -0,0 +1,6 @@ +# protocol-metrics-polygon + +## v1.1.0 (2023-10-09) + +- Implemented polling block handler for faster (hopefully) indexing +- Deployment on Graph Protocol Decentralized Network diff --git a/subgraphs/polygon/config.json b/subgraphs/polygon/config.json index 5c40b2b5..9f47e588 100644 --- a/subgraphs/polygon/config.json +++ b/subgraphs/polygon/config.json @@ -1,6 +1,6 @@ { - "id": "QmcGw4WahErwDMqiZxjD4nPec6TCEpqhD3wvKNwGt9fqqf", + "id": "QmdDUpqEzfKug1ER6HWM8c7U6wf3wtEtRBvXV7LkVoBi9f", "org": "olympusdao", "name": "protocol-metrics-polygon", - "version": "1.0.2" + "version": "1.1.1" } \ No newline at end of file From 9353af88a2c73850d9fe11f3f6483b1a9648280c Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 13 Oct 2023 12:30:35 +0400 Subject: [PATCH 40/81] Fix for missing DAI/sDAI balances in Clearinghouses --- subgraphs/ethereum/CHANGELOG.md | 4 ++ subgraphs/ethereum/config.json | 4 +- .../src/contracts/CoolerLoansClearinghouse.ts | 65 ++++++++++++++++++- subgraphs/ethereum/src/utils/Constants.ts | 2 +- .../src/utils/TreasuryCalculations.ts | 10 ++- 5 files changed, 77 insertions(+), 8 deletions(-) diff --git a/subgraphs/ethereum/CHANGELOG.md b/subgraphs/ethereum/CHANGELOG.md index 38272513..383a94df 100644 --- a/subgraphs/ethereum/CHANGELOG.md +++ b/subgraphs/ethereum/CHANGELOG.md @@ -1,5 +1,9 @@ # Subgraph Changelog +## 4.14.3 (2023-10-13) + +- Fix recognition of DAI and sDAI balances in Clearinghouses + ## 4.14.2 (2023-10-05) - Fixes incorrect grafting diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index 0f456657..69e5abac 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmPa7EVtHhVoCGGsfyC1RwxkbyUnWcqvvDQNRKK7gMzUno", + "id": "QmYWiZ4W7isDz1Yyqoo5iGKLBwV3AA84TqAfJLArGHnsvM", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "4.14.2" + "version": "4.14.3" } \ No newline at end of file diff --git a/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts b/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts index 588b36a3..5c05cba3 100644 --- a/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts +++ b/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts @@ -3,11 +3,20 @@ import { TokenRecord } from "../../../shared/generated/schema"; import { CoolerLoansClearinghouse } from "../../generated/ProtocolMetrics/CoolerLoansClearinghouse"; import { COOLER_LOANS_CLEARINGHOUSES } from "../../../shared/src/Wallets"; import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; -import { BLOCKCHAIN, ERC20_DAI, ERC20_TOKENS, getContractName } from "../utils/Constants"; +import { BLOCKCHAIN, ERC20_DAI, ERC20_TOKENS, ERC4626_SDAI, getContractName } from "../utils/Constants"; import { getUSDRate } from "../utils/Price"; import { toDecimal } from "../../../shared/src/utils/Decimals"; +import { ERC20 } from "../../generated/ProtocolMetrics/ERC20"; -export function getClearinghouseBalances(timestamp: BigInt, blockNumber: BigInt): TokenRecord[] { +/** + * Generates records for the DAI receivables in the Clearinghouses. + * + * @param timestamp + * @param blockNumber + * @returns + */ +export function getClearinghouseReceivables(timestamp: BigInt, blockNumber: BigInt): TokenRecord[] { + const FUNC = "getClearinghouseReceivables"; const records: TokenRecord[] = []; const daiRate = getUSDRate(ERC20_DAI, blockNumber); @@ -24,7 +33,7 @@ export function getClearinghouseBalances(timestamp: BigInt, blockNumber: BigInt) } const receivablesBalance = toDecimal(receivablesResult.value, 18); - log.info(`Cooler Loans Clearinghouse receivables balance: {}`, [receivablesBalance.toString()]); + log.info(`{}: Cooler Loans Clearinghouse receivables balance: {}`, [FUNC, receivablesBalance.toString()]); records.push( createOrUpdateTokenRecord( @@ -43,5 +52,55 @@ export function getClearinghouseBalances(timestamp: BigInt, blockNumber: BigInt) ); } + return records; +} + +/** + * Generates records for the DAI and sDAI balances in the Clearinghouses. + * + * @param timestamp + * @param blockNumber + * @returns + */ +export function getClearinghouseTokenBalances(timestamp: BigInt, blockNumber: BigInt): TokenRecord[] { + const FUNC = "getClearinghouseTokenBalances"; + const records: TokenRecord[] = []; + + const tokenAddresses = [ERC20_DAI, ERC4626_SDAI]; + for (let i = 0; i < tokenAddresses.length; i++) { + const tokenAddress = tokenAddresses[i]; + const tokenRate = getUSDRate(tokenAddress, blockNumber); + const tokenContract = ERC20.bind(Address.fromString(tokenAddress)); + + for (let i = 0; i < COOLER_LOANS_CLEARINGHOUSES.length; i++) { + const clearinghouseAddress = COOLER_LOANS_CLEARINGHOUSES[i]; + + // Get the balance + const balanceResult = tokenContract.try_balanceOf(Address.fromString(clearinghouseAddress)); + if (balanceResult.reverted) { + continue; + } + + const balance = toDecimal(balanceResult.value, 18); + log.info(`{}: Balance of token {} at block {}: {}`, [FUNC, getContractName(tokenAddress), blockNumber.toString(), balance.toString()]); + + records.push( + createOrUpdateTokenRecord( + timestamp, + getContractName(tokenAddress), + tokenAddress, + getContractName(clearinghouseAddress), + clearinghouseAddress, + tokenRate, + balance, + blockNumber, + true, // Considers DAI receivables as liquid + ERC20_TOKENS, + BLOCKCHAIN, + ), + ); + } + } + return records; } \ No newline at end of file diff --git a/subgraphs/ethereum/src/utils/Constants.ts b/subgraphs/ethereum/src/utils/Constants.ts index f12f5ffc..7214689c 100644 --- a/subgraphs/ethereum/src/utils/Constants.ts +++ b/subgraphs/ethereum/src/utils/Constants.ts @@ -307,7 +307,7 @@ ERC20_TOKENS.set(NATIVE_ETH, new TokenDefinition(NATIVE_ETH, TokenCategoryVolati // === ERC4626 === -const ERC4626_SDAI = "0x83F20F44975D03b1b09e64809B757c47f942BEeA".toLowerCase(); +export const ERC4626_SDAI = "0x83F20F44975D03b1b09e64809B757c47f942BEeA".toLowerCase(); /** * Mapping between the contract address of an ERC4626 token and the TokenDefinition. diff --git a/subgraphs/ethereum/src/utils/TreasuryCalculations.ts b/subgraphs/ethereum/src/utils/TreasuryCalculations.ts index 16ede050..22037f63 100644 --- a/subgraphs/ethereum/src/utils/TreasuryCalculations.ts +++ b/subgraphs/ethereum/src/utils/TreasuryCalculations.ts @@ -16,7 +16,7 @@ import { import { getStablecoinBalances } from "./TokenStablecoins"; import { getVolatileTokenBalances } from "./TokenVolatile"; import { getAllERC4626Balances } from "./ERC4626"; -import { getClearinghouseBalances } from "../contracts/CoolerLoansClearinghouse"; +import { getClearinghouseReceivables, getClearinghouseTokenBalances } from "../contracts/CoolerLoansClearinghouse"; /** * Returns the market value, which is composed of: @@ -56,10 +56,16 @@ export function generateTokenRecords(timestamp: BigInt, blockNumber: BigInt): To getAllERC4626Balances(timestamp, blockNumber), ); + // Get Clearinghouse receivables + pushTokenRecordArray( + records, + getClearinghouseReceivables(timestamp, blockNumber), + ); + // Get Clearinghouse balances pushTokenRecordArray( records, - getClearinghouseBalances(timestamp, blockNumber), + getClearinghouseTokenBalances(timestamp, blockNumber), ); return records; From 6dc12cd3255a1cdeddcbb43e56fd90db41eab913 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 13 Oct 2023 12:30:35 +0400 Subject: [PATCH 41/81] Fix for missing DAI/sDAI balances in Clearinghouses # Conflicts: # subgraphs/ethereum/CHANGELOG.md # subgraphs/ethereum/config.json # subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts --- subgraphs/ethereum/CHANGELOG.md | 4 ++ .../src/contracts/CoolerLoansClearinghouse.ts | 65 ++++++++++++++++++- subgraphs/ethereum/src/utils/Constants.ts | 2 +- .../src/utils/TreasuryCalculations.ts | 10 ++- 4 files changed, 75 insertions(+), 6 deletions(-) diff --git a/subgraphs/ethereum/CHANGELOG.md b/subgraphs/ethereum/CHANGELOG.md index 6fb933b1..ce7c30e6 100644 --- a/subgraphs/ethereum/CHANGELOG.md +++ b/subgraphs/ethereum/CHANGELOG.md @@ -7,6 +7,10 @@ - Change the indexing trigger to a polling block handler (every 8 hours), as the previous event trigger will be deprecated soon - Re-index from 2022-05-01 +## 4.14.3 (2023-10-13) + +- Fix recognition of DAI and sDAI balances in Clearinghouses + ## 4.14.2 (2023-10-05) - Fixes incorrect grafting diff --git a/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts b/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts index aefa53f6..d0dca8dd 100644 --- a/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts +++ b/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts @@ -3,11 +3,20 @@ import { TokenRecord } from "../../../shared/generated/schema"; import { CoolerLoansClearinghouse } from "../../generated/ProtocolMetrics/CoolerLoansClearinghouse"; import { COOLER_LOANS_CLEARINGHOUSES } from "../../../shared/src/Wallets"; import { createTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; -import { BLOCKCHAIN, ERC20_DAI, ERC20_TOKENS, getContractName } from "../utils/Constants"; +import { BLOCKCHAIN, ERC20_DAI, ERC20_TOKENS, ERC4626_SDAI, getContractName } from "../utils/Constants"; import { getUSDRate } from "../utils/Price"; import { toDecimal } from "../../../shared/src/utils/Decimals"; +import { ERC20 } from "../../generated/ProtocolMetrics/ERC20"; -export function getClearinghouseBalances(timestamp: BigInt, blockNumber: BigInt): TokenRecord[] { +/** + * Generates records for the DAI receivables in the Clearinghouses. + * + * @param timestamp + * @param blockNumber + * @returns + */ +export function getClearinghouseReceivables(timestamp: BigInt, blockNumber: BigInt): TokenRecord[] { + const FUNC = "getClearinghouseReceivables"; const records: TokenRecord[] = []; const daiRate = getUSDRate(ERC20_DAI, blockNumber); @@ -24,7 +33,7 @@ export function getClearinghouseBalances(timestamp: BigInt, blockNumber: BigInt) } const receivablesBalance = toDecimal(receivablesResult.value, 18); - log.info(`Cooler Loans Clearinghouse receivables balance: {}`, [receivablesBalance.toString()]); + log.info(`{}: Cooler Loans Clearinghouse receivables balance: {}`, [FUNC, receivablesBalance.toString()]); records.push( createTokenRecord( @@ -43,5 +52,55 @@ export function getClearinghouseBalances(timestamp: BigInt, blockNumber: BigInt) ); } + return records; +} + +/** + * Generates records for the DAI and sDAI balances in the Clearinghouses. + * + * @param timestamp + * @param blockNumber + * @returns + */ +export function getClearinghouseTokenBalances(timestamp: BigInt, blockNumber: BigInt): TokenRecord[] { + const FUNC = "getClearinghouseTokenBalances"; + const records: TokenRecord[] = []; + + const tokenAddresses = [ERC20_DAI, ERC4626_SDAI]; + for (let i = 0; i < tokenAddresses.length; i++) { + const tokenAddress = tokenAddresses[i]; + const tokenRate = getUSDRate(tokenAddress, blockNumber); + const tokenContract = ERC20.bind(Address.fromString(tokenAddress)); + + for (let i = 0; i < COOLER_LOANS_CLEARINGHOUSES.length; i++) { + const clearinghouseAddress = COOLER_LOANS_CLEARINGHOUSES[i]; + + // Get the balance + const balanceResult = tokenContract.try_balanceOf(Address.fromString(clearinghouseAddress)); + if (balanceResult.reverted) { + continue; + } + + const balance = toDecimal(balanceResult.value, 18); + log.info(`{}: Balance of token {} at block {}: {}`, [FUNC, getContractName(tokenAddress), blockNumber.toString(), balance.toString()]); + + records.push( + createTokenRecord( + timestamp, + getContractName(tokenAddress), + tokenAddress, + getContractName(clearinghouseAddress), + clearinghouseAddress, + tokenRate, + balance, + blockNumber, + true, // Considers DAI receivables as liquid + ERC20_TOKENS, + BLOCKCHAIN, + ), + ); + } + } + return records; } \ No newline at end of file diff --git a/subgraphs/ethereum/src/utils/Constants.ts b/subgraphs/ethereum/src/utils/Constants.ts index 717f0b60..277e78a1 100644 --- a/subgraphs/ethereum/src/utils/Constants.ts +++ b/subgraphs/ethereum/src/utils/Constants.ts @@ -307,7 +307,7 @@ ERC20_TOKENS.set(NATIVE_ETH, new TokenDefinition(NATIVE_ETH, TokenCategoryVolati // === ERC4626 === -const ERC4626_SDAI = "0x83F20F44975D03b1b09e64809B757c47f942BEeA".toLowerCase(); +export const ERC4626_SDAI = "0x83F20F44975D03b1b09e64809B757c47f942BEeA".toLowerCase(); /** * Mapping between the contract address of an ERC4626 token and the TokenDefinition. diff --git a/subgraphs/ethereum/src/utils/TreasuryCalculations.ts b/subgraphs/ethereum/src/utils/TreasuryCalculations.ts index 16ede050..22037f63 100644 --- a/subgraphs/ethereum/src/utils/TreasuryCalculations.ts +++ b/subgraphs/ethereum/src/utils/TreasuryCalculations.ts @@ -16,7 +16,7 @@ import { import { getStablecoinBalances } from "./TokenStablecoins"; import { getVolatileTokenBalances } from "./TokenVolatile"; import { getAllERC4626Balances } from "./ERC4626"; -import { getClearinghouseBalances } from "../contracts/CoolerLoansClearinghouse"; +import { getClearinghouseReceivables, getClearinghouseTokenBalances } from "../contracts/CoolerLoansClearinghouse"; /** * Returns the market value, which is composed of: @@ -56,10 +56,16 @@ export function generateTokenRecords(timestamp: BigInt, blockNumber: BigInt): To getAllERC4626Balances(timestamp, blockNumber), ); + // Get Clearinghouse receivables + pushTokenRecordArray( + records, + getClearinghouseReceivables(timestamp, blockNumber), + ); + // Get Clearinghouse balances pushTokenRecordArray( records, - getClearinghouseBalances(timestamp, blockNumber), + getClearinghouseTokenBalances(timestamp, blockNumber), ); return records; From b6cf82f8479bdd1bec36ad3ab80264b81b019b93 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 13 Oct 2023 12:42:45 +0400 Subject: [PATCH 42/81] Shift to using the existing ERC20 and ERC4626 code paths --- subgraphs/arbitrum/src/contracts/Constants.ts | 7 ++- subgraphs/ethereum/CHANGELOG.md | 2 +- subgraphs/ethereum/config.json | 4 +- .../src/contracts/CoolerLoansClearinghouse.ts | 50 ------------------- .../src/utils/TreasuryCalculations.ts | 8 +-- 5 files changed, 10 insertions(+), 61 deletions(-) diff --git a/subgraphs/arbitrum/src/contracts/Constants.ts b/subgraphs/arbitrum/src/contracts/Constants.ts index c1a6a4f3..7abee650 100644 --- a/subgraphs/arbitrum/src/contracts/Constants.ts +++ b/subgraphs/arbitrum/src/contracts/Constants.ts @@ -2,7 +2,7 @@ import { BigDecimal, BigInt, log } from "@graphprotocol/graph-ts"; import { TokenCategoryPOL, TokenCategoryStable, TokenCategoryVolatile, TokenDefinition } from "../../../shared/src/contracts/TokenDefinition"; import { LendingMarketDeployment } from "../../../shared/src/utils/LendingMarketDeployment"; -import { AAVE_ALLOCATOR, AAVE_ALLOCATOR_V2, BALANCER_ALLOCATOR, BONDS_DEPOSIT, BONDS_INVERSE_DEPOSIT, CONVEX_ALLOCATOR1, CONVEX_ALLOCATOR2, CONVEX_ALLOCATOR3, CONVEX_CVX_ALLOCATOR, CONVEX_CVX_VL_ALLOCATOR, CROSS_CHAIN_ARBITRUM, CROSS_CHAIN_FANTOM, CROSS_CHAIN_POLYGON, DAO_WALLET, DAO_WORKING_CAPITAL, LUSD_ALLOCATOR, OTC_ESCROW, RARI_ALLOCATOR, TREASURY_ADDRESS_V1, TREASURY_ADDRESS_V2, TREASURY_ADDRESS_V3, VEFXS_ALLOCATOR, WALLET_ADDRESSES } from "../../../shared/src/Wallets"; +import { AAVE_ALLOCATOR, AAVE_ALLOCATOR_V2, BALANCER_ALLOCATOR, BONDS_DEPOSIT, BONDS_INVERSE_DEPOSIT, CONVEX_ALLOCATOR1, CONVEX_ALLOCATOR2, CONVEX_ALLOCATOR3, CONVEX_CVX_ALLOCATOR, CONVEX_CVX_VL_ALLOCATOR, COOLER_LOANS_CLEARINGHOUSES, CROSS_CHAIN_ARBITRUM, CROSS_CHAIN_FANTOM, CROSS_CHAIN_POLYGON, DAO_WALLET, DAO_WORKING_CAPITAL, LUSD_ALLOCATOR, OTC_ESCROW, RARI_ALLOCATOR, TREASURY_ADDRESS_V1, TREASURY_ADDRESS_V2, TREASURY_ADDRESS_V3, VEFXS_ALLOCATOR, WALLET_ADDRESSES } from "../../../shared/src/Wallets"; export const BLOCKCHAIN = "Arbitrum"; @@ -98,6 +98,11 @@ TREASURY_BLACKLIST.set(ERC20_OHM, WALLET_ADDRESSES); export const getWalletAddressesForContract = (contractAddress: string): string[] => { const walletAddresses = WALLET_ADDRESSES.slice(0); + // Add the clearinghouses to the list + for (let i = 0; i < COOLER_LOANS_CLEARINGHOUSES.length; i++) { + walletAddresses.push(COOLER_LOANS_CLEARINGHOUSES[i]); + } + // If the contract isn't on the blacklist, return as normal if (!TREASURY_BLACKLIST.has(contractAddress.toLowerCase())) { log.debug("getWalletAddressesForContract: token {} is not on treasury blacklist", [contractAddress]); diff --git a/subgraphs/ethereum/CHANGELOG.md b/subgraphs/ethereum/CHANGELOG.md index 383a94df..41813781 100644 --- a/subgraphs/ethereum/CHANGELOG.md +++ b/subgraphs/ethereum/CHANGELOG.md @@ -1,6 +1,6 @@ # Subgraph Changelog -## 4.14.3 (2023-10-13) +## 4.15.0 (2023-10-13) - Fix recognition of DAI and sDAI balances in Clearinghouses diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index 69e5abac..62a34047 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmYWiZ4W7isDz1Yyqoo5iGKLBwV3AA84TqAfJLArGHnsvM", + "id": "QmQwYEGXG75GT2b3kz6e4BM1fBK6TjR1ZAdEryesxayzcA", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "4.14.3" + "version": "4.15.0" } \ No newline at end of file diff --git a/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts b/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts index 5c05cba3..b0cb5dbc 100644 --- a/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts +++ b/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts @@ -54,53 +54,3 @@ export function getClearinghouseReceivables(timestamp: BigInt, blockNumber: BigI return records; } - -/** - * Generates records for the DAI and sDAI balances in the Clearinghouses. - * - * @param timestamp - * @param blockNumber - * @returns - */ -export function getClearinghouseTokenBalances(timestamp: BigInt, blockNumber: BigInt): TokenRecord[] { - const FUNC = "getClearinghouseTokenBalances"; - const records: TokenRecord[] = []; - - const tokenAddresses = [ERC20_DAI, ERC4626_SDAI]; - for (let i = 0; i < tokenAddresses.length; i++) { - const tokenAddress = tokenAddresses[i]; - const tokenRate = getUSDRate(tokenAddress, blockNumber); - const tokenContract = ERC20.bind(Address.fromString(tokenAddress)); - - for (let i = 0; i < COOLER_LOANS_CLEARINGHOUSES.length; i++) { - const clearinghouseAddress = COOLER_LOANS_CLEARINGHOUSES[i]; - - // Get the balance - const balanceResult = tokenContract.try_balanceOf(Address.fromString(clearinghouseAddress)); - if (balanceResult.reverted) { - continue; - } - - const balance = toDecimal(balanceResult.value, 18); - log.info(`{}: Balance of token {} at block {}: {}`, [FUNC, getContractName(tokenAddress), blockNumber.toString(), balance.toString()]); - - records.push( - createOrUpdateTokenRecord( - timestamp, - getContractName(tokenAddress), - tokenAddress, - getContractName(clearinghouseAddress), - clearinghouseAddress, - tokenRate, - balance, - blockNumber, - true, // Considers DAI receivables as liquid - ERC20_TOKENS, - BLOCKCHAIN, - ), - ); - } - } - - return records; -} \ No newline at end of file diff --git a/subgraphs/ethereum/src/utils/TreasuryCalculations.ts b/subgraphs/ethereum/src/utils/TreasuryCalculations.ts index 22037f63..2083eb5a 100644 --- a/subgraphs/ethereum/src/utils/TreasuryCalculations.ts +++ b/subgraphs/ethereum/src/utils/TreasuryCalculations.ts @@ -16,7 +16,7 @@ import { import { getStablecoinBalances } from "./TokenStablecoins"; import { getVolatileTokenBalances } from "./TokenVolatile"; import { getAllERC4626Balances } from "./ERC4626"; -import { getClearinghouseReceivables, getClearinghouseTokenBalances } from "../contracts/CoolerLoansClearinghouse"; +import { getClearinghouseReceivables } from "../contracts/CoolerLoansClearinghouse"; /** * Returns the market value, which is composed of: @@ -62,12 +62,6 @@ export function generateTokenRecords(timestamp: BigInt, blockNumber: BigInt): To getClearinghouseReceivables(timestamp, blockNumber), ); - // Get Clearinghouse balances - pushTokenRecordArray( - records, - getClearinghouseTokenBalances(timestamp, blockNumber), - ); - return records; } From aef3fdb7980b489f489c9fb71ff67cc313656bb5 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 13 Oct 2023 12:44:50 +0400 Subject: [PATCH 43/81] Remove unused imports --- subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts b/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts index b0cb5dbc..2dd2ed71 100644 --- a/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts +++ b/subgraphs/ethereum/src/contracts/CoolerLoansClearinghouse.ts @@ -3,10 +3,9 @@ import { TokenRecord } from "../../../shared/generated/schema"; import { CoolerLoansClearinghouse } from "../../generated/ProtocolMetrics/CoolerLoansClearinghouse"; import { COOLER_LOANS_CLEARINGHOUSES } from "../../../shared/src/Wallets"; import { createOrUpdateTokenRecord } from "../../../shared/src/utils/TokenRecordHelper"; -import { BLOCKCHAIN, ERC20_DAI, ERC20_TOKENS, ERC4626_SDAI, getContractName } from "../utils/Constants"; +import { BLOCKCHAIN, ERC20_DAI, ERC20_TOKENS, getContractName } from "../utils/Constants"; import { getUSDRate } from "../utils/Price"; import { toDecimal } from "../../../shared/src/utils/Decimals"; -import { ERC20 } from "../../generated/ProtocolMetrics/ERC20"; /** * Generates records for the DAI receivables in the Clearinghouses. From 7d889030211f66c11c79dc0e190e5c51fe1c39a7 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 13 Oct 2023 14:01:05 +0400 Subject: [PATCH 44/81] Add clearinghouses to the correct subgraph --- subgraphs/arbitrum/src/contracts/Constants.ts | 7 +------ subgraphs/ethereum/CHANGELOG.md | 2 +- subgraphs/ethereum/config.json | 4 ++-- subgraphs/ethereum/src/utils/Constants.ts | 7 ++++++- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/subgraphs/arbitrum/src/contracts/Constants.ts b/subgraphs/arbitrum/src/contracts/Constants.ts index 7abee650..c1a6a4f3 100644 --- a/subgraphs/arbitrum/src/contracts/Constants.ts +++ b/subgraphs/arbitrum/src/contracts/Constants.ts @@ -2,7 +2,7 @@ import { BigDecimal, BigInt, log } from "@graphprotocol/graph-ts"; import { TokenCategoryPOL, TokenCategoryStable, TokenCategoryVolatile, TokenDefinition } from "../../../shared/src/contracts/TokenDefinition"; import { LendingMarketDeployment } from "../../../shared/src/utils/LendingMarketDeployment"; -import { AAVE_ALLOCATOR, AAVE_ALLOCATOR_V2, BALANCER_ALLOCATOR, BONDS_DEPOSIT, BONDS_INVERSE_DEPOSIT, CONVEX_ALLOCATOR1, CONVEX_ALLOCATOR2, CONVEX_ALLOCATOR3, CONVEX_CVX_ALLOCATOR, CONVEX_CVX_VL_ALLOCATOR, COOLER_LOANS_CLEARINGHOUSES, CROSS_CHAIN_ARBITRUM, CROSS_CHAIN_FANTOM, CROSS_CHAIN_POLYGON, DAO_WALLET, DAO_WORKING_CAPITAL, LUSD_ALLOCATOR, OTC_ESCROW, RARI_ALLOCATOR, TREASURY_ADDRESS_V1, TREASURY_ADDRESS_V2, TREASURY_ADDRESS_V3, VEFXS_ALLOCATOR, WALLET_ADDRESSES } from "../../../shared/src/Wallets"; +import { AAVE_ALLOCATOR, AAVE_ALLOCATOR_V2, BALANCER_ALLOCATOR, BONDS_DEPOSIT, BONDS_INVERSE_DEPOSIT, CONVEX_ALLOCATOR1, CONVEX_ALLOCATOR2, CONVEX_ALLOCATOR3, CONVEX_CVX_ALLOCATOR, CONVEX_CVX_VL_ALLOCATOR, CROSS_CHAIN_ARBITRUM, CROSS_CHAIN_FANTOM, CROSS_CHAIN_POLYGON, DAO_WALLET, DAO_WORKING_CAPITAL, LUSD_ALLOCATOR, OTC_ESCROW, RARI_ALLOCATOR, TREASURY_ADDRESS_V1, TREASURY_ADDRESS_V2, TREASURY_ADDRESS_V3, VEFXS_ALLOCATOR, WALLET_ADDRESSES } from "../../../shared/src/Wallets"; export const BLOCKCHAIN = "Arbitrum"; @@ -98,11 +98,6 @@ TREASURY_BLACKLIST.set(ERC20_OHM, WALLET_ADDRESSES); export const getWalletAddressesForContract = (contractAddress: string): string[] => { const walletAddresses = WALLET_ADDRESSES.slice(0); - // Add the clearinghouses to the list - for (let i = 0; i < COOLER_LOANS_CLEARINGHOUSES.length; i++) { - walletAddresses.push(COOLER_LOANS_CLEARINGHOUSES[i]); - } - // If the contract isn't on the blacklist, return as normal if (!TREASURY_BLACKLIST.has(contractAddress.toLowerCase())) { log.debug("getWalletAddressesForContract: token {} is not on treasury blacklist", [contractAddress]); diff --git a/subgraphs/ethereum/CHANGELOG.md b/subgraphs/ethereum/CHANGELOG.md index 41813781..0d4e8542 100644 --- a/subgraphs/ethereum/CHANGELOG.md +++ b/subgraphs/ethereum/CHANGELOG.md @@ -1,6 +1,6 @@ # Subgraph Changelog -## 4.15.0 (2023-10-13) +## 4.15.1 (2023-10-13) - Fix recognition of DAI and sDAI balances in Clearinghouses diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index 62a34047..59bfc15e 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmQwYEGXG75GT2b3kz6e4BM1fBK6TjR1ZAdEryesxayzcA", + "id": "Qma1NHE9K2sXPUK6gXDWYUAaoLgWAShb234aEvMrDvVkr3", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "4.15.0" + "version": "4.15.1" } \ No newline at end of file diff --git a/subgraphs/ethereum/src/utils/Constants.ts b/subgraphs/ethereum/src/utils/Constants.ts index 7214689c..a0e3d72b 100644 --- a/subgraphs/ethereum/src/utils/Constants.ts +++ b/subgraphs/ethereum/src/utils/Constants.ts @@ -2,7 +2,7 @@ import { Address, BigDecimal, BigInt, log } from "@graphprotocol/graph-ts"; import { TokenCategoryPOL, TokenCategoryStable, TokenCategoryVolatile, TokenDefinition } from "../../../shared/src/contracts/TokenDefinition"; import { LendingMarketDeployment } from "../../../shared/src/utils/LendingMarketDeployment"; -import { AAVE_ALLOCATOR, AAVE_ALLOCATOR_V2, AURA_ALLOCATOR, AURA_ALLOCATOR_V2, BALANCER_ALLOCATOR, BONDS_DEPOSIT, BONDS_INVERSE_DEPOSIT, CONVEX_ALLOCATOR1, CONVEX_ALLOCATOR2, CONVEX_ALLOCATOR3, CONVEX_CVX_ALLOCATOR, CONVEX_CVX_VL_ALLOCATOR, CONVEX_STAKING_PROXY_FRAXBP, CONVEX_STAKING_PROXY_OHM_FRAXBP, COOLER_LOANS_CLEARINGHOUSE_V1, COOLER_LOANS_CLEARINGHOUSE_V1_1, CROSS_CHAIN_ARBITRUM, CROSS_CHAIN_FANTOM, CROSS_CHAIN_POLYGON, DAO_WALLET, DAO_WORKING_CAPITAL, LUSD_ALLOCATOR, MAKER_DSR_ALLOCATOR, MAKER_DSR_ALLOCATOR_PROXY, MYSO_LENDING, OLYMPUS_ASSOCIATION_WALLET, OTC_ESCROW, RARI_ALLOCATOR, TREASURY_ADDRESS_V1, TREASURY_ADDRESS_V2, TREASURY_ADDRESS_V3, TRSRY, VEFXS_ALLOCATOR, VENDOR_LENDING, WALLET_ADDRESSES } from "../../../shared/src/Wallets"; +import { AAVE_ALLOCATOR, AAVE_ALLOCATOR_V2, AURA_ALLOCATOR, AURA_ALLOCATOR_V2, BALANCER_ALLOCATOR, BONDS_DEPOSIT, BONDS_INVERSE_DEPOSIT, CONVEX_ALLOCATOR1, CONVEX_ALLOCATOR2, CONVEX_ALLOCATOR3, CONVEX_CVX_ALLOCATOR, CONVEX_CVX_VL_ALLOCATOR, CONVEX_STAKING_PROXY_FRAXBP, CONVEX_STAKING_PROXY_OHM_FRAXBP, COOLER_LOANS_CLEARINGHOUSE_V1, COOLER_LOANS_CLEARINGHOUSE_V1_1, COOLER_LOANS_CLEARINGHOUSES, CROSS_CHAIN_ARBITRUM, CROSS_CHAIN_FANTOM, CROSS_CHAIN_POLYGON, DAO_WALLET, DAO_WORKING_CAPITAL, LUSD_ALLOCATOR, MAKER_DSR_ALLOCATOR, MAKER_DSR_ALLOCATOR_PROXY, MYSO_LENDING, OLYMPUS_ASSOCIATION_WALLET, OTC_ESCROW, RARI_ALLOCATOR, TREASURY_ADDRESS_V1, TREASURY_ADDRESS_V2, TREASURY_ADDRESS_V3, TRSRY, VEFXS_ALLOCATOR, VENDOR_LENDING, WALLET_ADDRESSES } from "../../../shared/src/Wallets"; import { PairHandler, PairHandlerTypes } from "./PairHandler"; export const BLOCKCHAIN = "Ethereum"; @@ -746,6 +746,11 @@ TREASURY_BLACKLIST.set(ERC20_SOHM_V3, WALLET_ADDRESSES); export const getWalletAddressesForContract = (contractAddress: string): string[] => { const walletAddresses = WALLET_ADDRESSES.slice(0); + // Add the clearinghouses to the list + for (let i = 0; i < COOLER_LOANS_CLEARINGHOUSES.length; i++) { + walletAddresses.push(COOLER_LOANS_CLEARINGHOUSES[i]); + } + // If the contract isn't on the blacklist, return as normal if (!TREASURY_BLACKLIST.has(contractAddress.toLowerCase())) { log.debug("getWalletAddressesForContract: token {} is not on treasury blacklist", [contractAddress]); From 8e8c0f31b5d1af539f0e8910440e3978a6c450d7 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 13 Oct 2023 15:48:13 +0400 Subject: [PATCH 45/81] Version bump --- subgraphs/ethereum/config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index 40449c0a..ed6f773c 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmWe5DKxZ2g8V5tr6rLskxSkwBD6x6deZFT7XHoMoB4g5v", + "id": "Qmb1VyFRBuAGcigUToatPGXy7uuSU1V2Dg35Z692zUj22F", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "5.0.0" + "version": "5.0.1" } \ No newline at end of file From e4d56f6f4b24a06c73a96b9c04473fe3117e9b2a Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 13 Oct 2023 15:50:05 +0400 Subject: [PATCH 46/81] Duplicated CHANGELOG entry --- subgraphs/ethereum/CHANGELOG.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/subgraphs/ethereum/CHANGELOG.md b/subgraphs/ethereum/CHANGELOG.md index 9a22c65e..b102250b 100644 --- a/subgraphs/ethereum/CHANGELOG.md +++ b/subgraphs/ethereum/CHANGELOG.md @@ -11,10 +11,6 @@ - Fix recognition of DAI and sDAI balances in Clearinghouses -## 4.14.3 (2023-10-13) - -- Fix recognition of DAI and sDAI balances in Clearinghouses - ## 4.14.2 (2023-10-05) - Fixes incorrect grafting From e5c0fec2f219876d3da8b639e09e39f389dc441d Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 13 Oct 2023 16:16:01 +0400 Subject: [PATCH 47/81] Include clearinghouses in protocol addresses (so that xOHM balances are ignored) --- subgraphs/shared/src/Wallets.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subgraphs/shared/src/Wallets.ts b/subgraphs/shared/src/Wallets.ts index 324c175b..113d5619 100644 --- a/subgraphs/shared/src/Wallets.ts +++ b/subgraphs/shared/src/Wallets.ts @@ -92,4 +92,6 @@ export const WALLET_ADDRESSES = [ TREASURY_ADDRESS_V3, TRSRY, VEFXS_ALLOCATOR, + COOLER_LOANS_CLEARINGHOUSE_V1, + COOLER_LOANS_CLEARINGHOUSE_V1_1, ]; From 4abb10927eb449207bf2944c1dd3672cf8dd5419 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 13 Oct 2023 16:22:17 +0400 Subject: [PATCH 48/81] Bump deployment --- subgraphs/ethereum/config.json | 4 ++-- subgraphs/ethereum/subgraph.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index 59bfc15e..99d104d1 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "Qma1NHE9K2sXPUK6gXDWYUAaoLgWAShb234aEvMrDvVkr3", + "id": "QmQvmYzUJ8cLytTMduvokKwHx13f47zpBygtJqrnsvP199", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "4.15.1" + "version": "4.15.2" } \ No newline at end of file diff --git a/subgraphs/ethereum/subgraph.yaml b/subgraphs/ethereum/subgraph.yaml index f49151b0..0e0bb937 100644 --- a/subgraphs/ethereum/subgraph.yaml +++ b/subgraphs/ethereum/subgraph.yaml @@ -4,7 +4,7 @@ repository: https://github.com/OlympusDAO/olympus-protocol-metrics-subgraph features: - grafting graft: - base: QmSwwBfAoWJLHQeSTagFnkibnkrjeprxcQpXAHk6AVrysA + base: QmPa7EVtHhVoCGGsfyC1RwxkbyUnWcqvvDQNRKK7gMzUno block: 18185779 # Clearinghouse deployment schema: file: ../../schema.graphql From 675686b0edf62334f9e6c829a9a4e9add7dab5c4 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 13 Oct 2023 16:27:53 +0400 Subject: [PATCH 49/81] Update CHANGELOG --- subgraphs/ethereum/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subgraphs/ethereum/CHANGELOG.md b/subgraphs/ethereum/CHANGELOG.md index 0d4e8542..534d3808 100644 --- a/subgraphs/ethereum/CHANGELOG.md +++ b/subgraphs/ethereum/CHANGELOG.md @@ -1,6 +1,6 @@ # Subgraph Changelog -## 4.15.1 (2023-10-13) +## 4.15.2 (2023-10-13) - Fix recognition of DAI and sDAI balances in Clearinghouses From 6586ba15e41d679d35038a456f4d10e3f9d2fba0 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 13 Oct 2023 16:33:58 +0400 Subject: [PATCH 50/81] Version bump --- subgraphs/ethereum/config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index ed6f773c..3259e3c4 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "Qmb1VyFRBuAGcigUToatPGXy7uuSU1V2Dg35Z692zUj22F", + "id": "QmVEZ9CEndzEcUd13SAP85EXaZzsETzh4GNFft7VHBLrR7", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "5.0.1" + "version": "5.0.2" } \ No newline at end of file From 3820d6a2d9b730025a37af4088ee74d1633a57e4 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 13 Oct 2023 16:34:18 +0400 Subject: [PATCH 51/81] Update CHANGELOG with date --- subgraphs/ethereum/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subgraphs/ethereum/CHANGELOG.md b/subgraphs/ethereum/CHANGELOG.md index 6f6e48c2..df535490 100644 --- a/subgraphs/ethereum/CHANGELOG.md +++ b/subgraphs/ethereum/CHANGELOG.md @@ -1,6 +1,6 @@ # Subgraph Changelog -## 5.0.2 (2023-10-11) +## 5.0.2 (2023-10-13) - Improve indexing performance by using Bytes instead of String for entity ids - Improve indexing performance by shifting TokenRecord, TokenSupply and ProtocolMetric entities to be immutable From 619f7d0d1763977369ff45a997bae82da4187c09 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 13 Oct 2023 16:52:40 +0400 Subject: [PATCH 52/81] Remove duplication. Version bump. --- subgraphs/ethereum/CHANGELOG.md | 2 +- subgraphs/ethereum/config.json | 4 ++-- subgraphs/ethereum/src/utils/ProtocolAddresses.ts | 9 +++------ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/subgraphs/ethereum/CHANGELOG.md b/subgraphs/ethereum/CHANGELOG.md index df535490..de8e8d54 100644 --- a/subgraphs/ethereum/CHANGELOG.md +++ b/subgraphs/ethereum/CHANGELOG.md @@ -1,6 +1,6 @@ # Subgraph Changelog -## 5.0.2 (2023-10-13) +## 5.0.3 (2023-10-13) - Improve indexing performance by using Bytes instead of String for entity ids - Improve indexing performance by shifting TokenRecord, TokenSupply and ProtocolMetric entities to be immutable diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index 3259e3c4..74697a74 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmVEZ9CEndzEcUd13SAP85EXaZzsETzh4GNFft7VHBLrR7", + "id": "QmZQX8Jk3wMNJznU1vk8bBE16B6538MnL1zs6hKW2ypb1U", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "5.0.2" + "version": "5.0.3" } \ No newline at end of file diff --git a/subgraphs/ethereum/src/utils/ProtocolAddresses.ts b/subgraphs/ethereum/src/utils/ProtocolAddresses.ts index 1398b22a..3cc64f1f 100644 --- a/subgraphs/ethereum/src/utils/ProtocolAddresses.ts +++ b/subgraphs/ethereum/src/utils/ProtocolAddresses.ts @@ -4,7 +4,7 @@ import { log } from "@graphprotocol/graph-ts"; import { ERC20_GOHM, ERC20_OHM_V1, ERC20_OHM_V2, ERC20_SOHM_V1, ERC20_SOHM_V2, ERC20_SOHM_V3 } from "./Constants"; -import { COOLER_LOANS_CLEARINGHOUSES } from "../../../shared/src/Wallets"; +import { COOLER_LOANS_CLEARINGHOUSES, COOLER_LOANS_CLEARINGHOUSE_V1, COOLER_LOANS_CLEARINGHOUSE_V1_1 } from "../../../shared/src/Wallets"; export const TREASURY_ADDRESS_V1 = "0x886CE997aa9ee4F8c2282E182aB72A705762399D".toLowerCase(); export const TREASURY_ADDRESS_V2 = "0x31f8cc382c9898b273eff4e0b7626a6987c846e8".toLowerCase(); @@ -99,6 +99,8 @@ export const PROTOCOL_ADDRESSES = [ TREASURY_ADDRESS_V3, TRSRY, VEFXS_ALLOCATOR, + COOLER_LOANS_CLEARINGHOUSE_V1, + COOLER_LOANS_CLEARINGHOUSE_V1_1, ]; const TREASURY_BLACKLIST = new Map(); @@ -127,11 +129,6 @@ TREASURY_BLACKLIST.set(ERC20_SOHM_V3, PROTOCOL_ADDRESSES); export const getWalletAddressesForContract = (contractAddress: string): string[] => { const walletAddresses = PROTOCOL_ADDRESSES.slice(0); - // Add the clearinghouses to the list - for (let i = 0; i < COOLER_LOANS_CLEARINGHOUSES.length; i++) { - walletAddresses.push(COOLER_LOANS_CLEARINGHOUSES[i]); - } - // If the contract isn't on the blacklist, return as normal if (!TREASURY_BLACKLIST.has(contractAddress.toLowerCase())) { log.debug("getWalletAddressesForContract: token {} is not on treasury blacklist", [contractAddress]); From f8ce8125d10e247dedd5e3f57e0a35fe93a48853 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 13 Oct 2023 18:09:44 +0400 Subject: [PATCH 53/81] Temporary change in starting block to test clearinghouse changes --- subgraphs/ethereum/config.json | 4 ++-- subgraphs/ethereum/subgraph.yaml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index 74697a74..6b74b85b 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmZQX8Jk3wMNJznU1vk8bBE16B6538MnL1zs6hKW2ypb1U", + "id": "QmPzdhAQXE4QXW8AMFFm4dsj7FNGfpwfypHjBhdnTcoCbi", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "5.0.3" + "version": "4.99.10" } \ No newline at end of file diff --git a/subgraphs/ethereum/subgraph.yaml b/subgraphs/ethereum/subgraph.yaml index 85339824..12a7666a 100644 --- a/subgraphs/ethereum/subgraph.yaml +++ b/subgraphs/ethereum/subgraph.yaml @@ -15,7 +15,8 @@ dataSources: source: address: "0x0ab87046fBb341D058F17CBC4c1133F25a20a52f" abi: gOHM - startBlock: 14690000 + # startBlock: 14690000 + startBlock: 18185779 mapping: kind: ethereum/events apiVersion: 0.0.6 From d395818e52a63c0735a30241a556d704f04a47f6 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 16 Oct 2023 11:09:42 +0400 Subject: [PATCH 54/81] Protection against reverts with UniswapV3 --- .../ethereum/src/liquidity/LiquidityUniswapV3.ts | 8 +++++--- subgraphs/ethereum/src/utils/Price.ts | 12 ++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts index 99552d13..402bbbf7 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts @@ -51,14 +51,16 @@ function getPairBalances(pairAddress: string, positionId: BigInt, blockNumber: B const token0Result = pair.try_token0(); const token1Result = pair.try_token1(); - if (token0Result.reverted || token1Result.reverted) { + const slot0Result = pair.try_slot0(); + if (token0Result.reverted || token1Result.reverted || slot0Result.reverted) { log.debug("getPairBalances: Skipping UniswapV3 pair {} ({}) as token calls reverted", [pairAddress, getContractName(pairAddress)]); return null; } - const sqrtPriceX96 = pair.slot0().getSqrtPriceX96(); + const slot0 = slot0Result.value; + const sqrtPriceX96 = slot0.getSqrtPriceX96(); log.debug("getPairBalances: sqrtPriceX96: {}", [sqrtPriceX96.toString()]); - const currentTick = pair.slot0().getTick(); + const currentTick = slot0.getTick(); log.debug("getPairBalances: currentTick: {}", [currentTick.toString()]); // Position diff --git a/subgraphs/ethereum/src/utils/Price.ts b/subgraphs/ethereum/src/utils/Price.ts index 769b0b16..84dac09a 100644 --- a/subgraphs/ethereum/src/utils/Price.ts +++ b/subgraphs/ethereum/src/utils/Price.ts @@ -192,7 +192,10 @@ export function getUSDRateUniswapV3( } // TODO shift to snapshot - if (pair.try_token0().reverted) { + const token0Result = pair.try_token0(); + const token1Result = pair.try_token1(); + const slot0Result = pair.try_slot0(); + if (token0Result.reverted || token1Result.reverted || slot0Result.reverted) { log.warning( "getUSDRateUniswapV3: UniswapV3 pair {} ({}) does not exist at block {}. Returning 0", [pairAddress, getContractName(pairAddress), blockNumber.toString()], @@ -201,8 +204,8 @@ export function getUSDRateUniswapV3( } // Determine pair orientation - const token0 = pair.token0(); - const token1 = pair.token1(); + const token0 = token0Result.value; + const token1 = token1Result.value; const baseTokenOrientation = getBaseTokenOrientation(token0, token1); if (baseTokenOrientation === PairTokenBaseOrientation.UNKNOWN) { throw new Error( @@ -214,7 +217,8 @@ export function getUSDRateUniswapV3( // slot0 = "The current price of the pool as a sqrt(token1/token0) Q64.96 value" // Source: https://docs.uniswap.org/protocol/reference/core/interfaces/pool/IUniswapV3PoolState#slot0 // https://docs.uniswap.org/sdk/guides/fetching-prices - let priceETH = pair.slot0().value0.times(pair.slot0().value0).toBigDecimal(); + const slot0 = slot0Result.value; + let priceETH = slot0.value0.times(slot0.value0).toBigDecimal(); const priceDiv = BigInt.fromI32(2).pow(192).toBigDecimal(); priceETH = priceETH.div(priceDiv); From fef5b513d6d57ded7c0cd421ece4fcef432b914b Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 16 Oct 2023 11:15:22 +0400 Subject: [PATCH 55/81] Deployment bump --- subgraphs/ethereum/config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index 6b74b85b..bce20a51 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmPzdhAQXE4QXW8AMFFm4dsj7FNGfpwfypHjBhdnTcoCbi", + "id": "QmT4dk9imnBceGoywxvD64JmKYBv2veP2LJ47yzbxw9QQK", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "4.99.10" + "version": "4.99.11" } \ No newline at end of file From 60a6545d193bbbedfd16ba9a2d73d2259141865d Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 16 Oct 2023 11:18:35 +0400 Subject: [PATCH 56/81] Add back Fantom deployment --- subgraphs/fantom/CHANGELOG.md | 6 ++++++ subgraphs/fantom/config.json | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 subgraphs/fantom/CHANGELOG.md diff --git a/subgraphs/fantom/CHANGELOG.md b/subgraphs/fantom/CHANGELOG.md new file mode 100644 index 00000000..7bbe5ce2 --- /dev/null +++ b/subgraphs/fantom/CHANGELOG.md @@ -0,0 +1,6 @@ +# protocol-metrics-fantom + +## v1.0.1 (2023-10-09) + +- Shift to polling block handler +- Deploy on Graph Protocol Decentralized Network diff --git a/subgraphs/fantom/config.json b/subgraphs/fantom/config.json index 645099d5..fca0137e 100644 --- a/subgraphs/fantom/config.json +++ b/subgraphs/fantom/config.json @@ -1,6 +1,6 @@ { - "id": "QmSBMNhnzbe4c4cwznLUsFkE4H5XZfiVqLHnNZYA48EPwy", - "version": "0.1.0", + "id": "QmS4u2WbuaiFdKdFgzQ4J5NpLxWn7ecFXauLejTShscTfJ", + "version": "1.0.3", "org": "olympusdao", "name": "protocol-metrics-fantom" } \ No newline at end of file From fbfdce36a7f6216ade01f4bf1a295b7b53fa1f73 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 16 Oct 2023 11:26:02 +0400 Subject: [PATCH 57/81] Remove indexing of redundant addresses from ethereum mainnet --- subgraphs/fantom/src/contracts/Constants.ts | 20 +------------------ subgraphs/fantom/src/contracts/Contracts.ts | 4 ++-- .../fantom/src/contracts/ProtocolAddresses.ts | 9 +++++++++ .../fantom/src/treasury/OwnedLiquidity.ts | 6 +++--- 4 files changed, 15 insertions(+), 24 deletions(-) create mode 100644 subgraphs/fantom/src/contracts/ProtocolAddresses.ts diff --git a/subgraphs/fantom/src/contracts/Constants.ts b/subgraphs/fantom/src/contracts/Constants.ts index 805ae924..d65e5cf0 100644 --- a/subgraphs/fantom/src/contracts/Constants.ts +++ b/subgraphs/fantom/src/contracts/Constants.ts @@ -1,5 +1,5 @@ import { TokenCategoryPOL, TokenCategoryStable, TokenCategoryVolatile, TokenDefinition } from "../../../shared/src/contracts/TokenDefinition"; -import { AAVE_ALLOCATOR, AAVE_ALLOCATOR_V2, BALANCER_ALLOCATOR, BONDS_DEPOSIT, BONDS_INVERSE_DEPOSIT, CONVEX_ALLOCATOR1, CONVEX_ALLOCATOR2, CONVEX_ALLOCATOR3, CONVEX_CVX_ALLOCATOR, CONVEX_CVX_VL_ALLOCATOR, CROSS_CHAIN_ARBITRUM, CROSS_CHAIN_FANTOM, CROSS_CHAIN_POLYGON, DAO_WALLET, LUSD_ALLOCATOR, RARI_ALLOCATOR, TREASURY_ADDRESS_V1, TREASURY_ADDRESS_V2, TREASURY_ADDRESS_V3, VEFXS_ALLOCATOR } from "../../../shared/src/Wallets"; +import { CROSS_CHAIN_FANTOM, DAO_WALLET } from "../../../shared/src/Wallets"; export const BLOCKCHAIN = "Fantom"; @@ -40,19 +40,7 @@ ERC20_TOKENS_FANTOM.set(LP_UNISWAP_V2_WFTM_GOHM, new TokenDefinition(LP_UNISWAP_ export const OHM_TOKENS = [ERC20_GOHM]; export const CONTRACT_NAME_MAP = new Map(); -CONTRACT_NAME_MAP.set(AAVE_ALLOCATOR_V2, "Aave Allocator V2"); -CONTRACT_NAME_MAP.set(AAVE_ALLOCATOR, "Aave Allocator V1"); -CONTRACT_NAME_MAP.set(BALANCER_ALLOCATOR, "Balancer Allocator"); -CONTRACT_NAME_MAP.set(BONDS_DEPOSIT, "Bond Depository"); -CONTRACT_NAME_MAP.set(BONDS_INVERSE_DEPOSIT, "Bond (Inverse) Depository"); -CONTRACT_NAME_MAP.set(CONVEX_ALLOCATOR1, "Convex Allocator 1"); -CONTRACT_NAME_MAP.set(CONVEX_ALLOCATOR2, "Convex Allocator 2"); -CONTRACT_NAME_MAP.set(CONVEX_ALLOCATOR3, "Convex Allocator 3"); -CONTRACT_NAME_MAP.set(CONVEX_CVX_ALLOCATOR, "Convex Allocator"); -CONTRACT_NAME_MAP.set(CONVEX_CVX_VL_ALLOCATOR, "Convex vlCVX Allocator"); -CONTRACT_NAME_MAP.set(CROSS_CHAIN_ARBITRUM, "Cross-Chain Arbitrum"); CONTRACT_NAME_MAP.set(CROSS_CHAIN_FANTOM, "Cross-Chain Fantom"); -CONTRACT_NAME_MAP.set(CROSS_CHAIN_POLYGON, "Cross-Chain Polygon"); CONTRACT_NAME_MAP.set(DAO_WALLET, "Treasury MS (Formerly DAO Wallet)"); CONTRACT_NAME_MAP.set(ERC20_BEETS, "Beethoven"); CONTRACT_NAME_MAP.set(ERC20_BOO, "SpookySwap"); @@ -71,12 +59,6 @@ CONTRACT_NAME_MAP.set(LP_UNISWAP_V2_WFTM_BEETS, "UniswapV2 wFTM-BEETS Liquidity CONTRACT_NAME_MAP.set(LP_UNISWAP_V2_WFTM_ETH, "UniswapV2 wFTM-ETH Liquidity Pool"); CONTRACT_NAME_MAP.set(LP_UNISWAP_V2_WFTM_OXD, "UniswapV2 wFTM-OXD Liquidity Pool"); CONTRACT_NAME_MAP.set(LP_UNISWAP_V2_WFTM_USDC, "UniswapV2 wFTM-USDC Liquidity Pool"); -CONTRACT_NAME_MAP.set(LUSD_ALLOCATOR, "LUSD Allocator"); -CONTRACT_NAME_MAP.set(RARI_ALLOCATOR, "Rari Allocator"); -CONTRACT_NAME_MAP.set(TREASURY_ADDRESS_V1, "Treasury Wallet V1"); -CONTRACT_NAME_MAP.set(TREASURY_ADDRESS_V2, "Treasury Wallet V2"); -CONTRACT_NAME_MAP.set(TREASURY_ADDRESS_V3, "Treasury Wallet V3"); -CONTRACT_NAME_MAP.set(VEFXS_ALLOCATOR, "VeFXS Allocator"); export const CONTRACT_ABBREVIATION_MAP = new Map(); CONTRACT_NAME_MAP.set(ERC20_BEETS, "BEETS"); diff --git a/subgraphs/fantom/src/contracts/Contracts.ts b/subgraphs/fantom/src/contracts/Contracts.ts index 5ac6250f..9dc6177b 100644 --- a/subgraphs/fantom/src/contracts/Contracts.ts +++ b/subgraphs/fantom/src/contracts/Contracts.ts @@ -3,13 +3,13 @@ import { BigDecimal, BigInt } from "@graphprotocol/graph-ts"; import { ERC20 } from "../../../shared/generated/Price/ERC20"; import { TokenRecord } from "../../../shared/generated/schema"; import { getERC20TokenRecordFromWallet } from "../../../shared/src/contracts/ERC20"; -import { WALLET_ADDRESSES } from "../../../shared/src/Wallets"; import { BLOCKCHAIN, CONTRACT_ABBREVIATION_MAP, CONTRACT_NAME_MAP, ERC20_TOKENS_FANTOM, } from "./Constants"; +import { FANTOM_PROTOCOL_ADDRESSES } from "./ProtocolAddresses"; export function getContractName( contractAddress: string, @@ -51,7 +51,7 @@ export const getWalletAddressesForContract = (contractAddress: string): string[] const nonTreasuryAddresses = NON_TREASURY_ASSET_WHITELIST.has(contractAddress.toLowerCase()) ? NON_TREASURY_ASSET_WHITELIST.get(contractAddress.toLowerCase()) : []; - const newAddresses = WALLET_ADDRESSES.slice(0); + const newAddresses = FANTOM_PROTOCOL_ADDRESSES.slice(0); // Add the values of nonTreasuryAddresses, but filter duplicates for (let i = 0; i < nonTreasuryAddresses.length; i++) { diff --git a/subgraphs/fantom/src/contracts/ProtocolAddresses.ts b/subgraphs/fantom/src/contracts/ProtocolAddresses.ts new file mode 100644 index 00000000..ba6d59f5 --- /dev/null +++ b/subgraphs/fantom/src/contracts/ProtocolAddresses.ts @@ -0,0 +1,9 @@ +import { CROSS_CHAIN_FANTOM, DAO_WALLET } from "../../../shared/src/Wallets"; + +/** + * The addresses relevant on Fantom. + */ +export const FANTOM_PROTOCOL_ADDRESSES: string[] = [ + CROSS_CHAIN_FANTOM, // Everything is contained in one wallet - no need to iterate over other addresses. + DAO_WALLET, // Just in case there is a snapshot during a bridging action +]; diff --git a/subgraphs/fantom/src/treasury/OwnedLiquidity.ts b/subgraphs/fantom/src/treasury/OwnedLiquidity.ts index 5c1435ab..aa687b22 100644 --- a/subgraphs/fantom/src/treasury/OwnedLiquidity.ts +++ b/subgraphs/fantom/src/treasury/OwnedLiquidity.ts @@ -7,10 +7,10 @@ import { createTokenRecord, getIsTokenLiquid, } from "../../../shared/src/utils/TokenRecordHelper"; -import { WALLET_ADDRESSES } from "../../../shared/src/Wallets"; import { BLOCKCHAIN, ERC20_TOKENS_FANTOM, OHM_TOKENS } from "../contracts/Constants"; import { getContractName } from "../contracts/Contracts"; import { getPriceRecursive, HANDLERS } from "../price/PriceLookup"; +import { FANTOM_PROTOCOL_ADDRESSES } from "../contracts/ProtocolAddresses"; /** * Returns the token records for a given token. This includes: @@ -52,8 +52,8 @@ function getOwnedLiquidityBalance( return records; } - for (let i = 0; i < WALLET_ADDRESSES.length; i++) { - const currentWalletAddress = WALLET_ADDRESSES[i]; + for (let i = 0; i < FANTOM_PROTOCOL_ADDRESSES.length; i++) { + const currentWalletAddress = FANTOM_PROTOCOL_ADDRESSES[i]; // Get the balance const balance = liquidityHandler.getBalance(currentWalletAddress, block); From 796c285913f5b2b2d57cc93aee9de4a7cbb61004 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 16 Oct 2023 11:28:17 +0400 Subject: [PATCH 58/81] Deployment bump --- subgraphs/fantom/config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subgraphs/fantom/config.json b/subgraphs/fantom/config.json index fca0137e..08da7d67 100644 --- a/subgraphs/fantom/config.json +++ b/subgraphs/fantom/config.json @@ -1,6 +1,6 @@ { - "id": "QmS4u2WbuaiFdKdFgzQ4J5NpLxWn7ecFXauLejTShscTfJ", - "version": "1.0.3", + "id": "QmNUJtrE5Hiwj5eBeF5gSubY2vhuMdjaZnZsaq6vVY2aba", + "version": "1.0.4", "org": "olympusdao", "name": "protocol-metrics-fantom" } \ No newline at end of file From 6d4e6643d822ed6129c7d780b6144ca8e863c4c2 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 16 Oct 2023 17:34:36 +0400 Subject: [PATCH 59/81] Disable bond markets while testing --- subgraphs/ethereum/config.json | 4 +- subgraphs/ethereum/subgraph.yaml | 88 ++++++++++++++++---------------- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index bce20a51..af56aa9d 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmT4dk9imnBceGoywxvD64JmKYBv2veP2LJ47yzbxw9QQK", + "id": "QmWPyHRaTNeBitCts1kA9EneQxu1T9yyqq1VPTxev7uAM2", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "4.99.11" + "version": "4.99.12" } \ No newline at end of file diff --git a/subgraphs/ethereum/subgraph.yaml b/subgraphs/ethereum/subgraph.yaml index 12a7666a..c497ec68 100644 --- a/subgraphs/ethereum/subgraph.yaml +++ b/subgraphs/ethereum/subgraph.yaml @@ -130,47 +130,47 @@ dataSources: # 5 blocks per minute * 60 minutes * 8 hours every: 2400 file: ./src/protocolMetrics/ProtocolMetrics.ts - ### - # BondManager and GnosisEasyAuction index Gnosis auction events, used for bond calculations - ### - - kind: ethereum/contract - name: BondManager - network: mainnet - source: - address: "0xf577c77ee3578c7f216327f41b5d7221ead2b2a3" - abi: BondManager - startBlock: 16226955 - mapping: - kind: ethereum/events - apiVersion: 0.0.6 - language: wasm/assemblyscript - entities: - - GnosisAuctionRoot - - GnosisAuction - abis: - - name: BondManager - file: ./abis/BondManager.json - eventHandlers: - - event: GnosisAuctionLaunched(uint256,address,uint96,uint48) - handler: handleGnosisAuctionLaunched - file: ./src/GnosisAuction.ts - - kind: ethereum/contract - name: GnosisEasyAuction - network: mainnet - source: - address: "0x0b7ffc1f4ad541a4ed16b40d8c37f0929158d101" - abi: GnosisEasyAuction - startBlock: 16226955 # Same as BondManager - mapping: - kind: ethereum/events - apiVersion: 0.0.6 - language: wasm/assemblyscript - entities: - - GnosisAuction - abis: - - name: GnosisEasyAuction - file: ./abis/GnosisEasyAuction.json - eventHandlers: - - event: AuctionCleared(indexed uint256,uint96,uint96,bytes32) - handler: handleGnosisAuctionCleared - file: ./src/GnosisAuction.ts \ No newline at end of file + # ### + # # BondManager and GnosisEasyAuction index Gnosis auction events, used for bond calculations + # ### + # - kind: ethereum/contract + # name: BondManager + # network: mainnet + # source: + # address: "0xf577c77ee3578c7f216327f41b5d7221ead2b2a3" + # abi: BondManager + # startBlock: 16226955 + # mapping: + # kind: ethereum/events + # apiVersion: 0.0.6 + # language: wasm/assemblyscript + # entities: + # - GnosisAuctionRoot + # - GnosisAuction + # abis: + # - name: BondManager + # file: ./abis/BondManager.json + # eventHandlers: + # - event: GnosisAuctionLaunched(uint256,address,uint96,uint48) + # handler: handleGnosisAuctionLaunched + # file: ./src/GnosisAuction.ts + # - kind: ethereum/contract + # name: GnosisEasyAuction + # network: mainnet + # source: + # address: "0x0b7ffc1f4ad541a4ed16b40d8c37f0929158d101" + # abi: GnosisEasyAuction + # startBlock: 16226955 # Same as BondManager + # mapping: + # kind: ethereum/events + # apiVersion: 0.0.6 + # language: wasm/assemblyscript + # entities: + # - GnosisAuction + # abis: + # - name: GnosisEasyAuction + # file: ./abis/GnosisEasyAuction.json + # eventHandlers: + # - event: AuctionCleared(indexed uint256,uint96,uint96,bytes32) + # handler: handleGnosisAuctionCleared + # file: ./src/GnosisAuction.ts \ No newline at end of file From af11ba588d307ac297e65ea7efd4ed02cdaa2b6d Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 17 Oct 2023 10:54:32 +0400 Subject: [PATCH 60/81] Revert testing changes. Deployment bump. --- subgraphs/ethereum/CHANGELOG.md | 2 +- subgraphs/ethereum/config.json | 4 +- subgraphs/ethereum/subgraph.yaml | 91 ++++++++++++++++---------------- 3 files changed, 48 insertions(+), 49 deletions(-) diff --git a/subgraphs/ethereum/CHANGELOG.md b/subgraphs/ethereum/CHANGELOG.md index de8e8d54..a1875e5b 100644 --- a/subgraphs/ethereum/CHANGELOG.md +++ b/subgraphs/ethereum/CHANGELOG.md @@ -1,6 +1,6 @@ # Subgraph Changelog -## 5.0.3 (2023-10-13) +## 5.0.4 (2023-10-17) - Improve indexing performance by using Bytes instead of String for entity ids - Improve indexing performance by shifting TokenRecord, TokenSupply and ProtocolMetric entities to be immutable diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index af56aa9d..8390386a 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmWPyHRaTNeBitCts1kA9EneQxu1T9yyqq1VPTxev7uAM2", + "id": "QmUX8d1VHoBTPKf6z4anNt2y8ZSgFbeTqXN52LJ1q8FF5N", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "4.99.12" + "version": "5.0.4" } \ No newline at end of file diff --git a/subgraphs/ethereum/subgraph.yaml b/subgraphs/ethereum/subgraph.yaml index c497ec68..c1d0099c 100644 --- a/subgraphs/ethereum/subgraph.yaml +++ b/subgraphs/ethereum/subgraph.yaml @@ -15,8 +15,7 @@ dataSources: source: address: "0x0ab87046fBb341D058F17CBC4c1133F25a20a52f" abi: gOHM - # startBlock: 14690000 - startBlock: 18185779 + startBlock: 14690000 mapping: kind: ethereum/events apiVersion: 0.0.6 @@ -130,47 +129,47 @@ dataSources: # 5 blocks per minute * 60 minutes * 8 hours every: 2400 file: ./src/protocolMetrics/ProtocolMetrics.ts - # ### - # # BondManager and GnosisEasyAuction index Gnosis auction events, used for bond calculations - # ### - # - kind: ethereum/contract - # name: BondManager - # network: mainnet - # source: - # address: "0xf577c77ee3578c7f216327f41b5d7221ead2b2a3" - # abi: BondManager - # startBlock: 16226955 - # mapping: - # kind: ethereum/events - # apiVersion: 0.0.6 - # language: wasm/assemblyscript - # entities: - # - GnosisAuctionRoot - # - GnosisAuction - # abis: - # - name: BondManager - # file: ./abis/BondManager.json - # eventHandlers: - # - event: GnosisAuctionLaunched(uint256,address,uint96,uint48) - # handler: handleGnosisAuctionLaunched - # file: ./src/GnosisAuction.ts - # - kind: ethereum/contract - # name: GnosisEasyAuction - # network: mainnet - # source: - # address: "0x0b7ffc1f4ad541a4ed16b40d8c37f0929158d101" - # abi: GnosisEasyAuction - # startBlock: 16226955 # Same as BondManager - # mapping: - # kind: ethereum/events - # apiVersion: 0.0.6 - # language: wasm/assemblyscript - # entities: - # - GnosisAuction - # abis: - # - name: GnosisEasyAuction - # file: ./abis/GnosisEasyAuction.json - # eventHandlers: - # - event: AuctionCleared(indexed uint256,uint96,uint96,bytes32) - # handler: handleGnosisAuctionCleared - # file: ./src/GnosisAuction.ts \ No newline at end of file + ### + # BondManager and GnosisEasyAuction index Gnosis auction events, used for bond calculations + ### + - kind: ethereum/contract + name: BondManager + network: mainnet + source: + address: "0xf577c77ee3578c7f216327f41b5d7221ead2b2a3" + abi: BondManager + startBlock: 16226955 + mapping: + kind: ethereum/events + apiVersion: 0.0.6 + language: wasm/assemblyscript + entities: + - GnosisAuctionRoot + - GnosisAuction + abis: + - name: BondManager + file: ./abis/BondManager.json + eventHandlers: + - event: GnosisAuctionLaunched(uint256,address,uint96,uint48) + handler: handleGnosisAuctionLaunched + file: ./src/GnosisAuction.ts + - kind: ethereum/contract + name: GnosisEasyAuction + network: mainnet + source: + address: "0x0b7ffc1f4ad541a4ed16b40d8c37f0929158d101" + abi: GnosisEasyAuction + startBlock: 16226955 # Same as BondManager + mapping: + kind: ethereum/events + apiVersion: 0.0.6 + language: wasm/assemblyscript + entities: + - GnosisAuction + abis: + - name: GnosisEasyAuction + file: ./abis/GnosisEasyAuction.json + eventHandlers: + - event: AuctionCleared(indexed uint256,uint96,uint96,bytes32) + handler: handleGnosisAuctionCleared + file: ./src/GnosisAuction.ts From a6d2cc9d22d35c83caef058e0e288cf6777ba5e6 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 17 Oct 2023 22:50:23 +0400 Subject: [PATCH 61/81] Protect against reverts with balanceOf() --- subgraphs/arbitrum/src/contracts/Sentiment.ts | 8 +++- subgraphs/arbitrum/src/contracts/Silo.ts | 8 +++- .../src/liquidity/LiquidityBalancer.ts | 8 +++- .../ethereum/src/liquidity/LiquidityCurve.ts | 6 +-- .../src/liquidity/LiquidityFraxSwap.ts | 7 ++- .../src/liquidity/LiquidityUniswapV2.ts | 6 +-- .../src/liquidity/LiquidityUniswapV3.ts | 14 +++++- .../ethereum/src/utils/ContractHelper.ts | 48 +++++++++++++++---- subgraphs/ethereum/src/utils/Silo.ts | 8 +++- subgraphs/shared/src/contracts/ERC20.ts | 14 ++++-- .../shared/src/price/PriceHandlerBalancer.ts | 7 ++- .../shared/src/price/PriceHandlerUniswapV2.ts | 7 ++- .../shared/src/price/PriceHandlerUniswapV3.ts | 10 +++- 13 files changed, 117 insertions(+), 34 deletions(-) diff --git a/subgraphs/arbitrum/src/contracts/Sentiment.ts b/subgraphs/arbitrum/src/contracts/Sentiment.ts index 34c1dc07..7ad1e91f 100644 --- a/subgraphs/arbitrum/src/contracts/Sentiment.ts +++ b/subgraphs/arbitrum/src/contracts/Sentiment.ts @@ -22,8 +22,12 @@ export function getSentimentSupply(timestamp: BigInt, blockNumber: BigInt): Toke for (let i = 0; i < wallets.length; i++) { const currentWallet = wallets[i]; - const balance = toDecimal( - collateralTokenContract.balanceOf(Address.fromString(currentWallet)), collateralTokenDecimals); + const balanceResult = collateralTokenContract.try_balanceOf(Address.fromString(currentWallet)); + if (balanceResult.reverted) { + continue; + } + + const balance = toDecimal(balanceResult.value, collateralTokenDecimals); if (balance.equals(BigDecimal.zero())) { continue; } diff --git a/subgraphs/arbitrum/src/contracts/Silo.ts b/subgraphs/arbitrum/src/contracts/Silo.ts index 08006d31..e9e055e6 100644 --- a/subgraphs/arbitrum/src/contracts/Silo.ts +++ b/subgraphs/arbitrum/src/contracts/Silo.ts @@ -25,8 +25,12 @@ export function getSiloSupply(timestamp: BigInt, blockNumber: BigInt): TokenSupp for (let i = 0; i < wallets.length; i++) { const currentWallet = wallets[i]; - const balance = toDecimal( - collateralTokenContract.balanceOf(Address.fromString(currentWallet)), collateralTokenDecimals); + const balanceResult = collateralTokenContract.try_balanceOf(Address.fromString(currentWallet)); + if (balanceResult.reverted) { + continue; + } + + const balance = toDecimal(balanceResult.value, collateralTokenDecimals); if (balance.equals(BigDecimal.zero())) { continue; } diff --git a/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts b/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts index c2075cf0..fe4e8025 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityBalancer.ts @@ -215,8 +215,12 @@ function getBalancerPoolTokenBalance( } const contract = ERC20.bind(Address.fromString(contractAddress)); - const balance = contract.balanceOf(Address.fromString(walletAddress)); - const balanceDecimals = toDecimal(balance, contractSnapshot.decimals); + const balanceResult = contract.try_balanceOf(Address.fromString(walletAddress)); + if (balanceResult.reverted) { + return BigDecimal.zero(); + } + + const balanceDecimals = toDecimal(balanceResult.value, contractSnapshot.decimals); // Don't spam if (!balanceDecimals.equals(BigDecimal.zero())) { diff --git a/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts b/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts index 25c83b54..62f64f9b 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityCurve.ts @@ -340,12 +340,12 @@ function getCurvePairRecord( } // Get the balance of the pair's token in walletAddress - const pairTokenBalance = pairToken.balanceOf(Address.fromString(walletAddress)); - if (pairTokenBalance.equals(BigInt.zero())) { + const pairTokenBalanceResult = pairToken.try_balanceOf(Address.fromString(walletAddress)); + if (pairTokenBalanceResult.reverted || pairTokenBalanceResult.value.equals(BigInt.zero())) { return null; } - const pairTokenBalanceDecimal = toDecimal(pairTokenBalance, pairTokenSnapshot.decimals); + const pairTokenBalanceDecimal = toDecimal(pairTokenBalanceResult.value, pairTokenSnapshot.decimals); log.debug("getCurvePairRecord: Curve pair balance for token {} ({}) in wallet {} ({}) was {}", [ getContractName(pairTokenAddress), pairTokenAddress, diff --git a/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts b/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts index 24a532c1..709ff614 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityFraxSwap.ts @@ -183,7 +183,12 @@ function getFraxSwapPairTokenBalance( } const pairContract = FraxSwapPool.bind(Address.fromString(pairAddress)); - return toDecimal(pairContract.balanceOf(Address.fromString(address)), poolSnapshot.decimals); + const pairTokenBalanceResult = pairContract.try_balanceOf(Address.fromString(address)); + if (pairTokenBalanceResult.reverted) { + return BigDecimal.zero(); + } + + return toDecimal(pairTokenBalanceResult.value, poolSnapshot.decimals); } function getFraxSwapPairTokenRecord( diff --git a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts index f58f6c21..2f5eff19 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV2.ts @@ -256,12 +256,12 @@ function getUniswapV2PairRecord( const pairToken = getUniswapV2Pair(pairAddress); // Get the balance of the pair's token in walletAddress - const pairTokenBalance = pairToken.balanceOf(Address.fromString(walletAddress)); - if (pairTokenBalance.equals(BigInt.zero())) { + const pairTokenBalanceResult = pairToken.try_balanceOf(Address.fromString(walletAddress)); + if (pairTokenBalanceResult.reverted || pairTokenBalanceResult.value.equals(BigInt.zero())) { return null; } - const pairTokenBalanceDecimal = toDecimal(pairTokenBalance, pairToken.decimals()); + const pairTokenBalanceDecimal = toDecimal(pairTokenBalanceResult.value, pairToken.decimals()); return createTokenRecord( timestamp, diff --git a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts index 402bbbf7..0ca71a8a 100644 --- a/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts +++ b/subgraphs/ethereum/src/liquidity/LiquidityUniswapV3.ts @@ -155,7 +155,12 @@ export function getUniswapV3POLRecords( for (let i = 0; i < wallets.length; i++) { const walletAddress = wallets[i]; - const positionCount = positionManager.balanceOf(Address.fromString(walletAddress)); + const positionCountResult = positionManager.try_balanceOf(Address.fromString(walletAddress)); + if (positionCountResult.reverted) { + continue; + } + + const positionCount = positionCountResult.value; log.debug("getUniswapV3POLRecords: wallet {} ({}) position count: {}", [walletAddress, getContractName(walletAddress), positionCount.toString()]); for (let j: u32 = 0; j < positionCount.toU32(); j++) { const positionId = positionManager.tokenOfOwnerByIndex(Address.fromString(walletAddress), BigInt.fromU32(j)); @@ -315,7 +320,12 @@ export function getUniswapV3OhmSupply( for (let i = 0; i < wallets.length; i++) { const walletAddress = wallets[i]; - const positionCount = positionManager.balanceOf(Address.fromString(walletAddress)); + const positionCountResult = positionManager.try_balanceOf(Address.fromString(walletAddress)); + if (positionCountResult.reverted) { + continue; + } + + const positionCount = positionCountResult.value; for (let j: u32 = 0; j < positionCount.toU32(); j++) { const positionId = positionManager.tokenOfOwnerByIndex(Address.fromString(walletAddress), BigInt.fromU32(j)); log.debug("getUniswapV3PairRecords: positionId: {}", [positionId.toString()]); diff --git a/subgraphs/ethereum/src/utils/ContractHelper.ts b/subgraphs/ethereum/src/utils/ContractHelper.ts index f1513742..68985411 100644 --- a/subgraphs/ethereum/src/utils/ContractHelper.ts +++ b/subgraphs/ethereum/src/utils/ContractHelper.ts @@ -377,11 +377,11 @@ export function getUniswapV2PairBalance( address, currentBlockNumber.toString(), ]); - return BigInt.fromString("0"); + return BigInt.zero(); } if (tokenAddress && !liquidityPairHasToken(contract._address.toHexString(), tokenAddress)) { - return BigInt.fromString("0"); + return BigInt.zero(); } log.debug( @@ -389,7 +389,12 @@ export function getUniswapV2PairBalance( [contract._address.toHexString(), address, currentBlockNumber.toString()], ); - return contract.balanceOf(Address.fromString(address)); + const balanceResult = contract.try_balanceOf(Address.fromString(address)); + if (balanceResult.reverted) { + return BigInt.zero(); + } + + return balanceResult.value; } /** @@ -685,8 +690,13 @@ function getTokeStakedBalance( walletAddress: string, _blockNumber: BigInt, ): BigDecimal { + const balanceResult = stakingContract.try_balanceOf(Address.fromString(walletAddress)); + if (balanceResult.reverted) { + return BigDecimal.zero(); + } + return toDecimal( - stakingContract.balanceOf(Address.fromString(walletAddress)), + balanceResult.value, tokenSnapshot.decimals, ); } @@ -796,8 +806,12 @@ export function getBtrflyUnlockedBalancesFromWallets( // rlBTRFLY.balanceOf() returns the balance in active locks, so we only need to return unlocked balances // Source: https://github.com/redacted-cartel/contracts-v2/blob/7ef760ae4f4287caa0abf698060096c5cfebd0cf/contracts/core/RLBTRFLY.sol#L109 - const lockedBalances = contract.lockedBalances(Address.fromString(currentWallet)); - const balance: BigDecimal = toDecimal(lockedBalances.getUnlockable(), tokenSnapshot.decimals); + const lockedBalancesResult = contract.try_lockedBalances(Address.fromString(currentWallet)); + if (lockedBalancesResult.reverted) { + continue; + } + + const balance: BigDecimal = toDecimal(lockedBalancesResult.value.getUnlockable(), tokenSnapshot.decimals); if (balance.equals(BigDecimal.zero())) { continue; } @@ -1018,8 +1032,13 @@ function getBalancerGaugeBalance( walletAddress: string, _blockNumber: BigInt, ): BigDecimal { + const balanceResult = gaugeContract.try_balanceOf(Address.fromString(walletAddress)); + if (balanceResult.reverted) { + return BigDecimal.zero(); + } + return toDecimal( - gaugeContract.balanceOf(Address.fromString(walletAddress)), + balanceResult.value, tokenSnapshot.decimals, ); } @@ -1040,8 +1059,13 @@ function getAuraStakedBalance( walletAddress: string, _blockNumber: BigInt, ): BigDecimal { + const balanceResult = stakingContract.try_balanceOf(Address.fromString(walletAddress)); + if (balanceResult.reverted) { + return BigDecimal.zero(); + } + return toDecimal( - stakingContract.balanceOf(Address.fromString(walletAddress)), + balanceResult.value, tokenSnapshot.decimals, ); } @@ -1644,8 +1668,12 @@ export function getConvexStakedBalance( // Get balance const stakingContract = ConvexBaseRewardPool.bind(Address.fromString(stakingAddress)); - const balance = stakingContract.balanceOf(Address.fromString(allocatorAddress)); - const decimalBalance = toDecimal(balance, tokenSnapshot.decimals); + const balanceResult = stakingContract.try_balanceOf(Address.fromString(allocatorAddress)); + if (balanceResult.reverted) { + return null; + } + + const decimalBalance = toDecimal(balanceResult.value, tokenSnapshot.decimals); log.debug( "getConvexStakedBalance: Balance of {} for staking token {} ({}) and allocator {} ({})", [ diff --git a/subgraphs/ethereum/src/utils/Silo.ts b/subgraphs/ethereum/src/utils/Silo.ts index 08a32261..425c28d0 100644 --- a/subgraphs/ethereum/src/utils/Silo.ts +++ b/subgraphs/ethereum/src/utils/Silo.ts @@ -24,8 +24,12 @@ export function getSiloSupply(timestamp: BigInt, blockNumber: BigInt): TokenSupp for (let i = 0; i < wallets.length; i++) { const currentWallet = wallets[i]; - const balance = toDecimal( - collateralTokenContract.balanceOf(Address.fromString(currentWallet)), collateralTokenDecimals); + const balanceResult = collateralTokenContract.try_balanceOf(Address.fromString(currentWallet)); + if (balanceResult.reverted) { + continue; + } + + const balance = toDecimal(balanceResult.value, collateralTokenDecimals); if (balance.equals(BigDecimal.zero())) { continue; } diff --git a/subgraphs/shared/src/contracts/ERC20.ts b/subgraphs/shared/src/contracts/ERC20.ts index c181b97a..709f5567 100644 --- a/subgraphs/shared/src/contracts/ERC20.ts +++ b/subgraphs/shared/src/contracts/ERC20.ts @@ -41,7 +41,12 @@ export function getBalance( return BigInt.fromString("0"); } - const balance = contract.balanceOf(Address.fromString(address)); + const balanceResult = contract.try_balanceOf(Address.fromString(address)); + if (balanceResult.reverted) { + return BigInt.zero(); + } + + const balance = balanceResult.value; log.debug( "getERC20Balance: Found balance {} in ERC20 contract {} ({}) for wallet {} ({}) at block number {}", [ @@ -58,9 +63,12 @@ export function getBalance( export function getERC20DecimalBalance(tokenAddress: string, sourceAddress: string, blockNumber: BigInt, contractLookup: ContractNameLookup): BigDecimal { const contract = ERC20.bind(Address.fromString(tokenAddress)); - const balance: BigInt = contract.balanceOf(Address.fromString(sourceAddress)); + const balanceResult = contract.try_balanceOf(Address.fromString(sourceAddress)); + if (balanceResult.reverted) { + return BigDecimal.zero(); + } - return toDecimal(balance, contract.decimals()); + return toDecimal(balanceResult.value, contract.decimals()); } /** diff --git a/subgraphs/shared/src/price/PriceHandlerBalancer.ts b/subgraphs/shared/src/price/PriceHandlerBalancer.ts index eb6ff780..beb790a4 100644 --- a/subgraphs/shared/src/price/PriceHandlerBalancer.ts +++ b/subgraphs/shared/src/price/PriceHandlerBalancer.ts @@ -310,7 +310,12 @@ export class PriceHandlerBalancer implements PriceHandler { return BigDecimal.zero(); } - return toDecimal(poolToken.balanceOf(Address.fromString(walletAddress)), poolToken.decimals()); + const poolBalanceResult = poolToken.try_balanceOf(Address.fromString(walletAddress)); + if (poolBalanceResult.reverted) { + return BigDecimal.zero(); + } + + return toDecimal(poolBalanceResult.value, poolToken.decimals()); } private getTokenReserves(tokenAddress: string, block: BigInt): BigDecimal { diff --git a/subgraphs/shared/src/price/PriceHandlerUniswapV2.ts b/subgraphs/shared/src/price/PriceHandlerUniswapV2.ts index 5c1fe164..dc38ba1a 100644 --- a/subgraphs/shared/src/price/PriceHandlerUniswapV2.ts +++ b/subgraphs/shared/src/price/PriceHandlerUniswapV2.ts @@ -179,7 +179,12 @@ export class PriceHandlerUniswapV2 implements PriceHandler { return BigDecimal.zero(); } - return toDecimal(contract.balanceOf(Address.fromString(walletAddress)), contract.decimals()); + const balanceResult = contract.try_balanceOf(Address.fromString(walletAddress)); + if (balanceResult.reverted) { + return BigDecimal.zero(); + } + + return toDecimal(balanceResult.value, contract.decimals()); } private getTokenIndex(tokenAddress: string, block: BigInt): number { diff --git a/subgraphs/shared/src/price/PriceHandlerUniswapV3.ts b/subgraphs/shared/src/price/PriceHandlerUniswapV3.ts index b11b9d31..4997755c 100644 --- a/subgraphs/shared/src/price/PriceHandlerUniswapV3.ts +++ b/subgraphs/shared/src/price/PriceHandlerUniswapV3.ts @@ -145,12 +145,18 @@ export class PriceHandlerUniswapV3 implements PriceHandler { const token0Contract = getERC20(token0, block); const token1Contract = getERC20(token1, block); + const token0ReservesResult = token0Contract.try_balanceOf(Address.fromString(this.poolAddress)); + const token1ReservesResult = token1Contract.try_balanceOf(Address.fromString(this.poolAddress)); + if (token0ReservesResult.reverted || token1ReservesResult.reverted) { + return null; + } + const token0Reserves = toDecimal( - token0Contract.balanceOf(Address.fromString(this.poolAddress)), + token0ReservesResult.value, token0Contract.decimals(), ); const token1Reserves = toDecimal( - token1Contract.balanceOf(Address.fromString(this.poolAddress)), + token1ReservesResult.value, token1Contract.decimals(), ); From 0f0883a28dce212d6a33d49594aa168bb001c183 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 17 Oct 2023 22:59:12 +0400 Subject: [PATCH 62/81] Version bump --- subgraphs/ethereum/CHANGELOG.md | 3 ++- subgraphs/ethereum/config.json | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/subgraphs/ethereum/CHANGELOG.md b/subgraphs/ethereum/CHANGELOG.md index a1875e5b..a93770f1 100644 --- a/subgraphs/ethereum/CHANGELOG.md +++ b/subgraphs/ethereum/CHANGELOG.md @@ -1,10 +1,11 @@ # Subgraph Changelog -## 5.0.4 (2023-10-17) +## 5.0.5 (2023-10-17) - Improve indexing performance by using Bytes instead of String for entity ids - Improve indexing performance by shifting TokenRecord, TokenSupply and ProtocolMetric entities to be immutable - Change the indexing trigger to a polling block handler (every 8 hours), as the previous event trigger will be deprecated soon +- Protect against reverts with balanceOf() - Re-index from 2022-05-01 ## 4.15.2 (2023-10-13) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index 8390386a..bcf948ba 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmUX8d1VHoBTPKf6z4anNt2y8ZSgFbeTqXN52LJ1q8FF5N", + "id": "QmbucBqomBG2qDfizVV1cMGDudCLvW2h9KWHeD6YS6Bk7L", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "5.0.4" + "version": "5.0.5" } \ No newline at end of file From 82bac8e835dfa759d78611985b9cce24f077fe7d Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Wed, 29 Nov 2023 12:45:09 +0400 Subject: [PATCH 63/81] Bump price-snapshot with recent changes --- subgraphs/price-snapshot/CHANGELOG.md | 4 + subgraphs/price-snapshot/config.json | 4 +- .../generated/PriceSnapshot/UniswapV3Pair.ts | 1876 +++++++++++++++++ subgraphs/price-snapshot/generated/schema.ts | 596 +++++- subgraphs/price-snapshot/schema.graphql | 10 +- subgraphs/price-snapshot/subgraph.yaml | 3 + 6 files changed, 2479 insertions(+), 14 deletions(-) create mode 100644 subgraphs/price-snapshot/generated/PriceSnapshot/UniswapV3Pair.ts diff --git a/subgraphs/price-snapshot/CHANGELOG.md b/subgraphs/price-snapshot/CHANGELOG.md index d3031802..2815a859 100644 --- a/subgraphs/price-snapshot/CHANGELOG.md +++ b/subgraphs/price-snapshot/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.3.2 (2023-11-29) + +- Re-deployment to benefit from changes to OHM protocol-owned liquidity + ## 1.2.0 (2023-07-18) - Improve the indexing speed by shifting to using an event handler for every hour, instead of a block handler. diff --git a/subgraphs/price-snapshot/config.json b/subgraphs/price-snapshot/config.json index ef6fd3e9..f2379758 100644 --- a/subgraphs/price-snapshot/config.json +++ b/subgraphs/price-snapshot/config.json @@ -1,6 +1,6 @@ { - "id": "QmWaf6SopYpQcCRfmGe25HSvgWo3JjdJDtRuKb7HvpgBvt", + "id": "QmbjnsGDqVH3UgUAYjvCKEeoShHMEWFi3czmXyh2gqDPFP", "org": "olympusdao", "name": "price-snapshot", - "version": "1.2.0" + "version": "1.3.2" } \ No newline at end of file diff --git a/subgraphs/price-snapshot/generated/PriceSnapshot/UniswapV3Pair.ts b/subgraphs/price-snapshot/generated/PriceSnapshot/UniswapV3Pair.ts new file mode 100644 index 00000000..240cab2f --- /dev/null +++ b/subgraphs/price-snapshot/generated/PriceSnapshot/UniswapV3Pair.ts @@ -0,0 +1,1876 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + Address, + BigInt, + Bytes, + Entity, + ethereum, + JSONValue, + TypedMap} from "@graphprotocol/graph-ts"; + +export class Burn extends ethereum.Event { + get params(): Burn__Params { + return new Burn__Params(this); + } +} + +export class Burn__Params { + _event: Burn; + + constructor(event: Burn) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get tickLower(): i32 { + return this._event.parameters[1].value.toI32(); + } + + get tickUpper(): i32 { + return this._event.parameters[2].value.toI32(); + } + + get amount(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get amount0(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get amount1(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } +} + +export class Collect extends ethereum.Event { + get params(): Collect__Params { + return new Collect__Params(this); + } +} + +export class Collect__Params { + _event: Collect; + + constructor(event: Collect) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get recipient(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get tickLower(): i32 { + return this._event.parameters[2].value.toI32(); + } + + get tickUpper(): i32 { + return this._event.parameters[3].value.toI32(); + } + + get amount0(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get amount1(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } +} + +export class CollectProtocol extends ethereum.Event { + get params(): CollectProtocol__Params { + return new CollectProtocol__Params(this); + } +} + +export class CollectProtocol__Params { + _event: CollectProtocol; + + constructor(event: CollectProtocol) { + this._event = event; + } + + get sender(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get recipient(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get amount0(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get amount1(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class Flash extends ethereum.Event { + get params(): Flash__Params { + return new Flash__Params(this); + } +} + +export class Flash__Params { + _event: Flash; + + constructor(event: Flash) { + this._event = event; + } + + get sender(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get recipient(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get amount0(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get amount1(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get paid0(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get paid1(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } +} + +export class IncreaseObservationCardinalityNext extends ethereum.Event { + get params(): IncreaseObservationCardinalityNext__Params { + return new IncreaseObservationCardinalityNext__Params(this); + } +} + +export class IncreaseObservationCardinalityNext__Params { + _event: IncreaseObservationCardinalityNext; + + constructor(event: IncreaseObservationCardinalityNext) { + this._event = event; + } + + get observationCardinalityNextOld(): i32 { + return this._event.parameters[0].value.toI32(); + } + + get observationCardinalityNextNew(): i32 { + return this._event.parameters[1].value.toI32(); + } +} + +export class Initialize extends ethereum.Event { + get params(): Initialize__Params { + return new Initialize__Params(this); + } +} + +export class Initialize__Params { + _event: Initialize; + + constructor(event: Initialize) { + this._event = event; + } + + get sqrtPriceX96(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get tick(): i32 { + return this._event.parameters[1].value.toI32(); + } +} + +export class Mint extends ethereum.Event { + get params(): Mint__Params { + return new Mint__Params(this); + } +} + +export class Mint__Params { + _event: Mint; + + constructor(event: Mint) { + this._event = event; + } + + get sender(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get owner(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get tickLower(): i32 { + return this._event.parameters[2].value.toI32(); + } + + get tickUpper(): i32 { + return this._event.parameters[3].value.toI32(); + } + + get amount(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get amount0(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get amount1(): BigInt { + return this._event.parameters[6].value.toBigInt(); + } +} + +export class SetFeeProtocol extends ethereum.Event { + get params(): SetFeeProtocol__Params { + return new SetFeeProtocol__Params(this); + } +} + +export class SetFeeProtocol__Params { + _event: SetFeeProtocol; + + constructor(event: SetFeeProtocol) { + this._event = event; + } + + get feeProtocol0Old(): i32 { + return this._event.parameters[0].value.toI32(); + } + + get feeProtocol1Old(): i32 { + return this._event.parameters[1].value.toI32(); + } + + get feeProtocol0New(): i32 { + return this._event.parameters[2].value.toI32(); + } + + get feeProtocol1New(): i32 { + return this._event.parameters[3].value.toI32(); + } +} + +export class Swap extends ethereum.Event { + get params(): Swap__Params { + return new Swap__Params(this); + } +} + +export class Swap__Params { + _event: Swap; + + constructor(event: Swap) { + this._event = event; + } + + get sender(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get recipient(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get amount0(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get amount1(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get sqrtPriceX96(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get liquidity(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get tick(): i32 { + return this._event.parameters[6].value.toI32(); + } +} + +export class UniswapV3Pair__burnResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + const map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } + + getAmount0(): BigInt { + return this.value0; + } + + getAmount1(): BigInt { + return this.value1; + } +} + +export class UniswapV3Pair__collectResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + const map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } + + getAmount0(): BigInt { + return this.value0; + } + + getAmount1(): BigInt { + return this.value1; + } +} + +export class UniswapV3Pair__collectProtocolResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + const map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } + + getAmount0(): BigInt { + return this.value0; + } + + getAmount1(): BigInt { + return this.value1; + } +} + +export class UniswapV3Pair__mintResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + const map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } + + getAmount0(): BigInt { + return this.value0; + } + + getAmount1(): BigInt { + return this.value1; + } +} + +export class UniswapV3Pair__observationsResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: boolean; + + constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: boolean) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + } + + toMap(): TypedMap { + const map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromSignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromBoolean(this.value3)); + return map; + } + + getBlockTimestamp(): BigInt { + return this.value0; + } + + getTickCumulative(): BigInt { + return this.value1; + } + + getSecondsPerLiquidityCumulativeX128(): BigInt { + return this.value2; + } + + getInitialized(): boolean { + return this.value3; + } +} + +export class UniswapV3Pair__observeResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + const map = new TypedMap(); + map.set("value0", ethereum.Value.fromSignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } + + getTickCumulatives(): Array { + return this.value0; + } + + getSecondsPerLiquidityCumulativeX128s(): Array { + return this.value1; + } +} + +export class UniswapV3Pair__positionsResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: BigInt; + value4: BigInt; + + constructor( + value0: BigInt, + value1: BigInt, + value2: BigInt, + value3: BigInt, + value4: BigInt + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + this.value4 = value4; + } + + toMap(): TypedMap { + const map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); + map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); + return map; + } + + getLiquidity(): BigInt { + return this.value0; + } + + getFeeGrowthInside0LastX128(): BigInt { + return this.value1; + } + + getFeeGrowthInside1LastX128(): BigInt { + return this.value2; + } + + getTokensOwed0(): BigInt { + return this.value3; + } + + getTokensOwed1(): BigInt { + return this.value4; + } +} + +export class UniswapV3Pair__protocolFeesResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + const map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } + + getToken0(): BigInt { + return this.value0; + } + + getToken1(): BigInt { + return this.value1; + } +} + +export class UniswapV3Pair__slot0Result { + value0: BigInt; + value1: i32; + value2: i32; + value3: i32; + value4: i32; + value5: i32; + value6: boolean; + + constructor( + value0: BigInt, + value1: i32, + value2: i32, + value3: i32, + value4: i32, + value5: i32, + value6: boolean + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + this.value4 = value4; + this.value5 = value5; + this.value6 = value6; + } + + toMap(): TypedMap { + const map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromI32(this.value1)); + map.set( + "value2", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value2)) + ); + map.set( + "value3", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value3)) + ); + map.set( + "value4", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value4)) + ); + map.set( + "value5", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value5)) + ); + map.set("value6", ethereum.Value.fromBoolean(this.value6)); + return map; + } + + getSqrtPriceX96(): BigInt { + return this.value0; + } + + getTick(): i32 { + return this.value1; + } + + getObservationIndex(): i32 { + return this.value2; + } + + getObservationCardinality(): i32 { + return this.value3; + } + + getObservationCardinalityNext(): i32 { + return this.value4; + } + + getFeeProtocol(): i32 { + return this.value5; + } + + getUnlocked(): boolean { + return this.value6; + } +} + +export class UniswapV3Pair__snapshotCumulativesInsideResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + + constructor(value0: BigInt, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + const map = new TypedMap(); + map.set("value0", ethereum.Value.fromSignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } + + getTickCumulativeInside(): BigInt { + return this.value0; + } + + getSecondsPerLiquidityInsideX128(): BigInt { + return this.value1; + } + + getSecondsInside(): BigInt { + return this.value2; + } +} + +export class UniswapV3Pair__swapResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + const map = new TypedMap(); + map.set("value0", ethereum.Value.fromSignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromSignedBigInt(this.value1)); + return map; + } + + getAmount0(): BigInt { + return this.value0; + } + + getAmount1(): BigInt { + return this.value1; + } +} + +export class UniswapV3Pair__ticksResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: BigInt; + value4: BigInt; + value5: BigInt; + value6: BigInt; + value7: boolean; + + constructor( + value0: BigInt, + value1: BigInt, + value2: BigInt, + value3: BigInt, + value4: BigInt, + value5: BigInt, + value6: BigInt, + value7: boolean + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + this.value4 = value4; + this.value5 = value5; + this.value6 = value6; + this.value7 = value7; + } + + toMap(): TypedMap { + const map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromSignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); + map.set("value4", ethereum.Value.fromSignedBigInt(this.value4)); + map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); + map.set("value6", ethereum.Value.fromUnsignedBigInt(this.value6)); + map.set("value7", ethereum.Value.fromBoolean(this.value7)); + return map; + } + + getLiquidityGross(): BigInt { + return this.value0; + } + + getLiquidityNet(): BigInt { + return this.value1; + } + + getFeeGrowthOutside0X128(): BigInt { + return this.value2; + } + + getFeeGrowthOutside1X128(): BigInt { + return this.value3; + } + + getTickCumulativeOutside(): BigInt { + return this.value4; + } + + getSecondsPerLiquidityOutsideX128(): BigInt { + return this.value5; + } + + getSecondsOutside(): BigInt { + return this.value6; + } + + getInitialized(): boolean { + return this.value7; + } +} + +export class UniswapV3Pair extends ethereum.SmartContract { + static bind(address: Address): UniswapV3Pair { + return new UniswapV3Pair("UniswapV3Pair", address); + } + + burn( + tickLower: i32, + tickUpper: i32, + amount: BigInt + ): UniswapV3Pair__burnResult { + const result = super.call( + "burn", + "burn(int24,int24,uint128):(uint256,uint256)", + [ + ethereum.Value.fromI32(tickLower), + ethereum.Value.fromI32(tickUpper), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return new UniswapV3Pair__burnResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_burn( + tickLower: i32, + tickUpper: i32, + amount: BigInt + ): ethereum.CallResult { + const result = super.tryCall( + "burn", + "burn(int24,int24,uint128):(uint256,uint256)", + [ + ethereum.Value.fromI32(tickLower), + ethereum.Value.fromI32(tickUpper), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue( + new UniswapV3Pair__burnResult(value[0].toBigInt(), value[1].toBigInt()) + ); + } + + collect( + recipient: Address, + tickLower: i32, + tickUpper: i32, + amount0Requested: BigInt, + amount1Requested: BigInt + ): UniswapV3Pair__collectResult { + const result = super.call( + "collect", + "collect(address,int24,int24,uint128,uint128):(uint128,uint128)", + [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromI32(tickLower), + ethereum.Value.fromI32(tickUpper), + ethereum.Value.fromUnsignedBigInt(amount0Requested), + ethereum.Value.fromUnsignedBigInt(amount1Requested) + ] + ); + + return new UniswapV3Pair__collectResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_collect( + recipient: Address, + tickLower: i32, + tickUpper: i32, + amount0Requested: BigInt, + amount1Requested: BigInt + ): ethereum.CallResult { + const result = super.tryCall( + "collect", + "collect(address,int24,int24,uint128,uint128):(uint128,uint128)", + [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromI32(tickLower), + ethereum.Value.fromI32(tickUpper), + ethereum.Value.fromUnsignedBigInt(amount0Requested), + ethereum.Value.fromUnsignedBigInt(amount1Requested) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue( + new UniswapV3Pair__collectResult(value[0].toBigInt(), value[1].toBigInt()) + ); + } + + collectProtocol( + recipient: Address, + amount0Requested: BigInt, + amount1Requested: BigInt + ): UniswapV3Pair__collectProtocolResult { + const result = super.call( + "collectProtocol", + "collectProtocol(address,uint128,uint128):(uint128,uint128)", + [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount0Requested), + ethereum.Value.fromUnsignedBigInt(amount1Requested) + ] + ); + + return new UniswapV3Pair__collectProtocolResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_collectProtocol( + recipient: Address, + amount0Requested: BigInt, + amount1Requested: BigInt + ): ethereum.CallResult { + const result = super.tryCall( + "collectProtocol", + "collectProtocol(address,uint128,uint128):(uint128,uint128)", + [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount0Requested), + ethereum.Value.fromUnsignedBigInt(amount1Requested) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue( + new UniswapV3Pair__collectProtocolResult( + value[0].toBigInt(), + value[1].toBigInt() + ) + ); + } + + factory(): Address { + const result = super.call("factory", "factory():(address)", []); + + return result[0].toAddress(); + } + + try_factory(): ethereum.CallResult
{ + const result = super.tryCall("factory", "factory():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + fee(): i32 { + const result = super.call("fee", "fee():(uint24)", []); + + return result[0].toI32(); + } + + try_fee(): ethereum.CallResult { + const result = super.tryCall("fee", "fee():(uint24)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + feeGrowthGlobal0X128(): BigInt { + const result = super.call( + "feeGrowthGlobal0X128", + "feeGrowthGlobal0X128():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_feeGrowthGlobal0X128(): ethereum.CallResult { + const result = super.tryCall( + "feeGrowthGlobal0X128", + "feeGrowthGlobal0X128():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + feeGrowthGlobal1X128(): BigInt { + const result = super.call( + "feeGrowthGlobal1X128", + "feeGrowthGlobal1X128():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_feeGrowthGlobal1X128(): ethereum.CallResult { + const result = super.tryCall( + "feeGrowthGlobal1X128", + "feeGrowthGlobal1X128():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + liquidity(): BigInt { + const result = super.call("liquidity", "liquidity():(uint128)", []); + + return result[0].toBigInt(); + } + + try_liquidity(): ethereum.CallResult { + const result = super.tryCall("liquidity", "liquidity():(uint128)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + maxLiquidityPerTick(): BigInt { + const result = super.call( + "maxLiquidityPerTick", + "maxLiquidityPerTick():(uint128)", + [] + ); + + return result[0].toBigInt(); + } + + try_maxLiquidityPerTick(): ethereum.CallResult { + const result = super.tryCall( + "maxLiquidityPerTick", + "maxLiquidityPerTick():(uint128)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + mint( + recipient: Address, + tickLower: i32, + tickUpper: i32, + amount: BigInt, + data: Bytes + ): UniswapV3Pair__mintResult { + const result = super.call( + "mint", + "mint(address,int24,int24,uint128,bytes):(uint256,uint256)", + [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromI32(tickLower), + ethereum.Value.fromI32(tickUpper), + ethereum.Value.fromUnsignedBigInt(amount), + ethereum.Value.fromBytes(data) + ] + ); + + return new UniswapV3Pair__mintResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_mint( + recipient: Address, + tickLower: i32, + tickUpper: i32, + amount: BigInt, + data: Bytes + ): ethereum.CallResult { + const result = super.tryCall( + "mint", + "mint(address,int24,int24,uint128,bytes):(uint256,uint256)", + [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromI32(tickLower), + ethereum.Value.fromI32(tickUpper), + ethereum.Value.fromUnsignedBigInt(amount), + ethereum.Value.fromBytes(data) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue( + new UniswapV3Pair__mintResult(value[0].toBigInt(), value[1].toBigInt()) + ); + } + + observations(param0: BigInt): UniswapV3Pair__observationsResult { + const result = super.call( + "observations", + "observations(uint256):(uint32,int56,uint160,bool)", + [ethereum.Value.fromUnsignedBigInt(param0)] + ); + + return new UniswapV3Pair__observationsResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toBoolean() + ); + } + + try_observations( + param0: BigInt + ): ethereum.CallResult { + const result = super.tryCall( + "observations", + "observations(uint256):(uint32,int56,uint160,bool)", + [ethereum.Value.fromUnsignedBigInt(param0)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue( + new UniswapV3Pair__observationsResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toBoolean() + ) + ); + } + + observe(secondsAgos: Array): UniswapV3Pair__observeResult { + const result = super.call( + "observe", + "observe(uint32[]):(int56[],uint160[])", + [ethereum.Value.fromUnsignedBigIntArray(secondsAgos)] + ); + + return new UniswapV3Pair__observeResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_observe( + secondsAgos: Array + ): ethereum.CallResult { + const result = super.tryCall( + "observe", + "observe(uint32[]):(int56[],uint160[])", + [ethereum.Value.fromUnsignedBigIntArray(secondsAgos)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue( + new UniswapV3Pair__observeResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + positions(param0: Bytes): UniswapV3Pair__positionsResult { + const result = super.call( + "positions", + "positions(bytes32):(uint128,uint256,uint256,uint128,uint128)", + [ethereum.Value.fromFixedBytes(param0)] + ); + + return new UniswapV3Pair__positionsResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toBigInt(), + result[4].toBigInt() + ); + } + + try_positions( + param0: Bytes + ): ethereum.CallResult { + const result = super.tryCall( + "positions", + "positions(bytes32):(uint128,uint256,uint256,uint128,uint128)", + [ethereum.Value.fromFixedBytes(param0)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue( + new UniswapV3Pair__positionsResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toBigInt(), + value[4].toBigInt() + ) + ); + } + + protocolFees(): UniswapV3Pair__protocolFeesResult { + const result = super.call( + "protocolFees", + "protocolFees():(uint128,uint128)", + [] + ); + + return new UniswapV3Pair__protocolFeesResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_protocolFees(): ethereum.CallResult { + const result = super.tryCall( + "protocolFees", + "protocolFees():(uint128,uint128)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue( + new UniswapV3Pair__protocolFeesResult( + value[0].toBigInt(), + value[1].toBigInt() + ) + ); + } + + slot0(): UniswapV3Pair__slot0Result { + const result = super.call( + "slot0", + "slot0():(uint160,int24,uint16,uint16,uint16,uint8,bool)", + [] + ); + + return new UniswapV3Pair__slot0Result( + result[0].toBigInt(), + result[1].toI32(), + result[2].toI32(), + result[3].toI32(), + result[4].toI32(), + result[5].toI32(), + result[6].toBoolean() + ); + } + + try_slot0(): ethereum.CallResult { + const result = super.tryCall( + "slot0", + "slot0():(uint160,int24,uint16,uint16,uint16,uint8,bool)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue( + new UniswapV3Pair__slot0Result( + value[0].toBigInt(), + value[1].toI32(), + value[2].toI32(), + value[3].toI32(), + value[4].toI32(), + value[5].toI32(), + value[6].toBoolean() + ) + ); + } + + snapshotCumulativesInside( + tickLower: i32, + tickUpper: i32 + ): UniswapV3Pair__snapshotCumulativesInsideResult { + const result = super.call( + "snapshotCumulativesInside", + "snapshotCumulativesInside(int24,int24):(int56,uint160,uint32)", + [ethereum.Value.fromI32(tickLower), ethereum.Value.fromI32(tickUpper)] + ); + + return new UniswapV3Pair__snapshotCumulativesInsideResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_snapshotCumulativesInside( + tickLower: i32, + tickUpper: i32 + ): ethereum.CallResult { + const result = super.tryCall( + "snapshotCumulativesInside", + "snapshotCumulativesInside(int24,int24):(int56,uint160,uint32)", + [ethereum.Value.fromI32(tickLower), ethereum.Value.fromI32(tickUpper)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue( + new UniswapV3Pair__snapshotCumulativesInsideResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + swap( + recipient: Address, + zeroForOne: boolean, + amountSpecified: BigInt, + sqrtPriceLimitX96: BigInt, + data: Bytes + ): UniswapV3Pair__swapResult { + const result = super.call( + "swap", + "swap(address,bool,int256,uint160,bytes):(int256,int256)", + [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromBoolean(zeroForOne), + ethereum.Value.fromSignedBigInt(amountSpecified), + ethereum.Value.fromUnsignedBigInt(sqrtPriceLimitX96), + ethereum.Value.fromBytes(data) + ] + ); + + return new UniswapV3Pair__swapResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_swap( + recipient: Address, + zeroForOne: boolean, + amountSpecified: BigInt, + sqrtPriceLimitX96: BigInt, + data: Bytes + ): ethereum.CallResult { + const result = super.tryCall( + "swap", + "swap(address,bool,int256,uint160,bytes):(int256,int256)", + [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromBoolean(zeroForOne), + ethereum.Value.fromSignedBigInt(amountSpecified), + ethereum.Value.fromUnsignedBigInt(sqrtPriceLimitX96), + ethereum.Value.fromBytes(data) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue( + new UniswapV3Pair__swapResult(value[0].toBigInt(), value[1].toBigInt()) + ); + } + + tickBitmap(param0: i32): BigInt { + const result = super.call("tickBitmap", "tickBitmap(int16):(uint256)", [ + ethereum.Value.fromI32(param0) + ]); + + return result[0].toBigInt(); + } + + try_tickBitmap(param0: i32): ethereum.CallResult { + const result = super.tryCall("tickBitmap", "tickBitmap(int16):(uint256)", [ + ethereum.Value.fromI32(param0) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + tickSpacing(): i32 { + const result = super.call("tickSpacing", "tickSpacing():(int24)", []); + + return result[0].toI32(); + } + + try_tickSpacing(): ethereum.CallResult { + const result = super.tryCall("tickSpacing", "tickSpacing():(int24)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + ticks(param0: i32): UniswapV3Pair__ticksResult { + const result = super.call( + "ticks", + "ticks(int24):(uint128,int128,uint256,uint256,int56,uint160,uint32,bool)", + [ethereum.Value.fromI32(param0)] + ); + + return new UniswapV3Pair__ticksResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toBigInt(), + result[4].toBigInt(), + result[5].toBigInt(), + result[6].toBigInt(), + result[7].toBoolean() + ); + } + + try_ticks(param0: i32): ethereum.CallResult { + const result = super.tryCall( + "ticks", + "ticks(int24):(uint128,int128,uint256,uint256,int56,uint160,uint32,bool)", + [ethereum.Value.fromI32(param0)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue( + new UniswapV3Pair__ticksResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toBigInt(), + value[4].toBigInt(), + value[5].toBigInt(), + value[6].toBigInt(), + value[7].toBoolean() + ) + ); + } + + token0(): Address { + const result = super.call("token0", "token0():(address)", []); + + return result[0].toAddress(); + } + + try_token0(): ethereum.CallResult
{ + const result = super.tryCall("token0", "token0():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + token1(): Address { + const result = super.call("token1", "token1():(address)", []); + + return result[0].toAddress(); + } + + try_token1(): ethereum.CallResult
{ + const result = super.tryCall("token1", "token1():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + const value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class BurnCall extends ethereum.Call { + get inputs(): BurnCall__Inputs { + return new BurnCall__Inputs(this); + } + + get outputs(): BurnCall__Outputs { + return new BurnCall__Outputs(this); + } +} + +export class BurnCall__Inputs { + _call: BurnCall; + + constructor(call: BurnCall) { + this._call = call; + } + + get tickLower(): i32 { + return this._call.inputValues[0].value.toI32(); + } + + get tickUpper(): i32 { + return this._call.inputValues[1].value.toI32(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class BurnCall__Outputs { + _call: BurnCall; + + constructor(call: BurnCall) { + this._call = call; + } + + get amount0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amount1(): BigInt { + return this._call.outputValues[1].value.toBigInt(); + } +} + +export class CollectCall extends ethereum.Call { + get inputs(): CollectCall__Inputs { + return new CollectCall__Inputs(this); + } + + get outputs(): CollectCall__Outputs { + return new CollectCall__Outputs(this); + } +} + +export class CollectCall__Inputs { + _call: CollectCall; + + constructor(call: CollectCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get tickLower(): i32 { + return this._call.inputValues[1].value.toI32(); + } + + get tickUpper(): i32 { + return this._call.inputValues[2].value.toI32(); + } + + get amount0Requested(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get amount1Requested(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } +} + +export class CollectCall__Outputs { + _call: CollectCall; + + constructor(call: CollectCall) { + this._call = call; + } + + get amount0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amount1(): BigInt { + return this._call.outputValues[1].value.toBigInt(); + } +} + +export class CollectProtocolCall extends ethereum.Call { + get inputs(): CollectProtocolCall__Inputs { + return new CollectProtocolCall__Inputs(this); + } + + get outputs(): CollectProtocolCall__Outputs { + return new CollectProtocolCall__Outputs(this); + } +} + +export class CollectProtocolCall__Inputs { + _call: CollectProtocolCall; + + constructor(call: CollectProtocolCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount0Requested(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get amount1Requested(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class CollectProtocolCall__Outputs { + _call: CollectProtocolCall; + + constructor(call: CollectProtocolCall) { + this._call = call; + } + + get amount0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amount1(): BigInt { + return this._call.outputValues[1].value.toBigInt(); + } +} + +export class FlashCall extends ethereum.Call { + get inputs(): FlashCall__Inputs { + return new FlashCall__Inputs(this); + } + + get outputs(): FlashCall__Outputs { + return new FlashCall__Outputs(this); + } +} + +export class FlashCall__Inputs { + _call: FlashCall; + + constructor(call: FlashCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount0(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get amount1(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get data(): Bytes { + return this._call.inputValues[3].value.toBytes(); + } +} + +export class FlashCall__Outputs { + _call: FlashCall; + + constructor(call: FlashCall) { + this._call = call; + } +} + +export class IncreaseObservationCardinalityNextCall extends ethereum.Call { + get inputs(): IncreaseObservationCardinalityNextCall__Inputs { + return new IncreaseObservationCardinalityNextCall__Inputs(this); + } + + get outputs(): IncreaseObservationCardinalityNextCall__Outputs { + return new IncreaseObservationCardinalityNextCall__Outputs(this); + } +} + +export class IncreaseObservationCardinalityNextCall__Inputs { + _call: IncreaseObservationCardinalityNextCall; + + constructor(call: IncreaseObservationCardinalityNextCall) { + this._call = call; + } + + get observationCardinalityNext(): i32 { + return this._call.inputValues[0].value.toI32(); + } +} + +export class IncreaseObservationCardinalityNextCall__Outputs { + _call: IncreaseObservationCardinalityNextCall; + + constructor(call: IncreaseObservationCardinalityNextCall) { + this._call = call; + } +} + +export class InitializeCall extends ethereum.Call { + get inputs(): InitializeCall__Inputs { + return new InitializeCall__Inputs(this); + } + + get outputs(): InitializeCall__Outputs { + return new InitializeCall__Outputs(this); + } +} + +export class InitializeCall__Inputs { + _call: InitializeCall; + + constructor(call: InitializeCall) { + this._call = call; + } + + get sqrtPriceX96(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class InitializeCall__Outputs { + _call: InitializeCall; + + constructor(call: InitializeCall) { + this._call = call; + } +} + +export class MintCall extends ethereum.Call { + get inputs(): MintCall__Inputs { + return new MintCall__Inputs(this); + } + + get outputs(): MintCall__Outputs { + return new MintCall__Outputs(this); + } +} + +export class MintCall__Inputs { + _call: MintCall; + + constructor(call: MintCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get tickLower(): i32 { + return this._call.inputValues[1].value.toI32(); + } + + get tickUpper(): i32 { + return this._call.inputValues[2].value.toI32(); + } + + get amount(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get data(): Bytes { + return this._call.inputValues[4].value.toBytes(); + } +} + +export class MintCall__Outputs { + _call: MintCall; + + constructor(call: MintCall) { + this._call = call; + } + + get amount0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amount1(): BigInt { + return this._call.outputValues[1].value.toBigInt(); + } +} + +export class SetFeeProtocolCall extends ethereum.Call { + get inputs(): SetFeeProtocolCall__Inputs { + return new SetFeeProtocolCall__Inputs(this); + } + + get outputs(): SetFeeProtocolCall__Outputs { + return new SetFeeProtocolCall__Outputs(this); + } +} + +export class SetFeeProtocolCall__Inputs { + _call: SetFeeProtocolCall; + + constructor(call: SetFeeProtocolCall) { + this._call = call; + } + + get feeProtocol0(): i32 { + return this._call.inputValues[0].value.toI32(); + } + + get feeProtocol1(): i32 { + return this._call.inputValues[1].value.toI32(); + } +} + +export class SetFeeProtocolCall__Outputs { + _call: SetFeeProtocolCall; + + constructor(call: SetFeeProtocolCall) { + this._call = call; + } +} + +export class SwapCall extends ethereum.Call { + get inputs(): SwapCall__Inputs { + return new SwapCall__Inputs(this); + } + + get outputs(): SwapCall__Outputs { + return new SwapCall__Outputs(this); + } +} + +export class SwapCall__Inputs { + _call: SwapCall; + + constructor(call: SwapCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get zeroForOne(): boolean { + return this._call.inputValues[1].value.toBoolean(); + } + + get amountSpecified(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get sqrtPriceLimitX96(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get data(): Bytes { + return this._call.inputValues[4].value.toBytes(); + } +} + +export class SwapCall__Outputs { + _call: SwapCall; + + constructor(call: SwapCall) { + this._call = call; + } + + get amount0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amount1(): BigInt { + return this._call.outputValues[1].value.toBigInt(); + } +} diff --git a/subgraphs/price-snapshot/generated/schema.ts b/subgraphs/price-snapshot/generated/schema.ts index 31fa4997..b572d40d 100644 --- a/subgraphs/price-snapshot/generated/schema.ts +++ b/subgraphs/price-snapshot/generated/schema.ts @@ -28,6 +28,12 @@ export class PriceSnapshot extends Entity { } } + static loadInBlock(id: string): PriceSnapshot | null { + return changetype( + store.get_in_block("PriceSnapshot", id) + ); + } + static load(id: string): PriceSnapshot | null { return changetype(store.get("PriceSnapshot", id)); } @@ -166,6 +172,12 @@ export class PriceSnapshotDaily extends Entity { } } + static loadInBlock(id: string): PriceSnapshotDaily | null { + return changetype( + store.get_in_block("PriceSnapshotDaily", id) + ); + } + static load(id: string): PriceSnapshotDaily | null { return changetype( store.get("PriceSnapshotDaily", id) @@ -199,7 +211,94 @@ export class PriceSnapshotDaily extends Entity { } } -export class TokenPriceSnapshot extends Entity { +export class ERC20TokenSnapshot extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + const id = this.get("id"); + assert(id != null, "Cannot save ERC20TokenSnapshot entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type ERC20TokenSnapshot must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` + ); + store.set("ERC20TokenSnapshot", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): ERC20TokenSnapshot | null { + return changetype( + store.get_in_block("ERC20TokenSnapshot", id.toHexString()) + ); + } + + static load(id: Bytes): ERC20TokenSnapshot | null { + return changetype( + store.get("ERC20TokenSnapshot", id.toHexString()) + ); + } + + get id(): Bytes { + const value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get address(): Bytes { + const value = this.get("address"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set address(value: Bytes) { + this.set("address", Value.fromBytes(value)); + } + + get decimals(): i32 { + const value = this.get("decimals"); + if (!value || value.kind == ValueKind.NULL) { + return 0; + } else { + return value.toI32(); + } + } + + set decimals(value: i32) { + this.set("decimals", Value.fromI32(value)); + } + + get totalSupply(): BigDecimal | null { + const value = this.get("totalSupply"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set totalSupply(value: BigDecimal | null) { + if (!value) { + this.unset("totalSupply"); + } else { + this.set("totalSupply", Value.fromBigDecimal(value)); + } + } +} + +export class ConvexRewardPoolSnapshot extends Entity { constructor(id: string) { super(); this.set("id", Value.fromString(id)); @@ -207,19 +306,28 @@ export class TokenPriceSnapshot extends Entity { save(): void { const id = this.get("id"); - assert(id != null, "Cannot save TokenPriceSnapshot entity without an ID"); + assert( + id != null, + "Cannot save ConvexRewardPoolSnapshot entity without an ID" + ); if (id) { assert( id.kind == ValueKind.STRING, - `Entities of type TokenPriceSnapshot must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + `Entities of type ConvexRewardPoolSnapshot must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("TokenPriceSnapshot", id.toString(), this); + store.set("ConvexRewardPoolSnapshot", id.toString(), this); } } - static load(id: string): TokenPriceSnapshot | null { - return changetype( - store.get("TokenPriceSnapshot", id) + static loadInBlock(id: string): ConvexRewardPoolSnapshot | null { + return changetype( + store.get_in_block("ConvexRewardPoolSnapshot", id) + ); + } + + static load(id: string): ConvexRewardPoolSnapshot | null { + return changetype( + store.get("ConvexRewardPoolSnapshot", id) ); } @@ -249,6 +357,393 @@ export class TokenPriceSnapshot extends Entity { this.set("block", Value.fromBigInt(value)); } + get address(): Bytes { + const value = this.get("address"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set address(value: Bytes) { + this.set("address", Value.fromBytes(value)); + } + + get stakingToken(): Bytes { + const value = this.get("stakingToken"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set stakingToken(value: Bytes) { + this.set("stakingToken", Value.fromBytes(value)); + } +} + +export class BalancerPoolSnapshot extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + const id = this.get("id"); + assert(id != null, "Cannot save BalancerPoolSnapshot entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type BalancerPoolSnapshot must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` + ); + store.set("BalancerPoolSnapshot", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): BalancerPoolSnapshot | null { + return changetype( + store.get_in_block("BalancerPoolSnapshot", id.toHexString()) + ); + } + + static load(id: Bytes): BalancerPoolSnapshot | null { + return changetype( + store.get("BalancerPoolSnapshot", id.toHexString()) + ); + } + + get id(): Bytes { + const value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get block(): BigInt { + const value = this.get("block"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set block(value: BigInt) { + this.set("block", Value.fromBigInt(value)); + } + + get pool(): Bytes { + const value = this.get("pool"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set pool(value: Bytes) { + this.set("pool", Value.fromBytes(value)); + } + + get poolToken(): Bytes { + const value = this.get("poolToken"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set poolToken(value: Bytes) { + this.set("poolToken", Value.fromBytes(value)); + } + + get decimals(): i32 { + const value = this.get("decimals"); + if (!value || value.kind == ValueKind.NULL) { + return 0; + } else { + return value.toI32(); + } + } + + set decimals(value: i32) { + this.set("decimals", Value.fromI32(value)); + } + + get totalSupply(): BigDecimal { + const value = this.get("totalSupply"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigDecimal(); + } + } + + set totalSupply(value: BigDecimal) { + this.set("totalSupply", Value.fromBigDecimal(value)); + } + + get tokens(): Array { + const value = this.get("tokens"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytesArray(); + } + } + + set tokens(value: Array) { + this.set("tokens", Value.fromBytesArray(value)); + } + + get balances(): Array { + const value = this.get("balances"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigDecimalArray(); + } + } + + set balances(value: Array) { + this.set("balances", Value.fromBigDecimalArray(value)); + } + + get weights(): Array { + const value = this.get("weights"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigDecimalArray(); + } + } + + set weights(value: Array) { + this.set("weights", Value.fromBigDecimalArray(value)); + } +} + +export class PoolSnapshot extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + const id = this.get("id"); + assert(id != null, "Cannot save PoolSnapshot entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type PoolSnapshot must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` + ); + store.set("PoolSnapshot", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): PoolSnapshot | null { + return changetype( + store.get_in_block("PoolSnapshot", id.toHexString()) + ); + } + + static load(id: Bytes): PoolSnapshot | null { + return changetype( + store.get("PoolSnapshot", id.toHexString()) + ); + } + + get id(): Bytes { + const value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get block(): BigInt { + const value = this.get("block"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set block(value: BigInt) { + this.set("block", Value.fromBigInt(value)); + } + + get pool(): Bytes { + const value = this.get("pool"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set pool(value: Bytes) { + this.set("pool", Value.fromBytes(value)); + } + + get poolToken(): Bytes | null { + const value = this.get("poolToken"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set poolToken(value: Bytes | null) { + if (!value) { + this.unset("poolToken"); + } else { + this.set("poolToken", Value.fromBytes(value)); + } + } + + get decimals(): i32 { + const value = this.get("decimals"); + if (!value || value.kind == ValueKind.NULL) { + return 0; + } else { + return value.toI32(); + } + } + + set decimals(value: i32) { + this.set("decimals", Value.fromI32(value)); + } + + get totalSupply(): BigDecimal { + const value = this.get("totalSupply"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigDecimal(); + } + } + + set totalSupply(value: BigDecimal) { + this.set("totalSupply", Value.fromBigDecimal(value)); + } + + get tokens(): Array { + const value = this.get("tokens"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytesArray(); + } + } + + set tokens(value: Array) { + this.set("tokens", Value.fromBytesArray(value)); + } + + get balances(): Array { + const value = this.get("balances"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigDecimalArray(); + } + } + + set balances(value: Array) { + this.set("balances", Value.fromBigDecimalArray(value)); + } + + get weights(): Array | null { + const value = this.get("weights"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimalArray(); + } + } + + set weights(value: Array | null) { + if (!value) { + this.unset("weights"); + } else { + this.set("weights", Value.fromBigDecimalArray(>value)); + } + } +} + +export class TokenPriceSnapshot extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + const id = this.get("id"); + assert(id != null, "Cannot save TokenPriceSnapshot entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type TokenPriceSnapshot must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` + ); + store.set("TokenPriceSnapshot", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): TokenPriceSnapshot | null { + return changetype( + store.get_in_block("TokenPriceSnapshot", id.toHexString()) + ); + } + + static load(id: Bytes): TokenPriceSnapshot | null { + return changetype( + store.get("TokenPriceSnapshot", id.toHexString()) + ); + } + + get id(): Bytes { + const value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get block(): BigInt { + const value = this.get("block"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set block(value: BigInt) { + this.set("block", Value.fromBigInt(value)); + } + get token(): Bytes { const value = this.get("token"); if (!value || value.kind == ValueKind.NULL) { @@ -275,3 +770,90 @@ export class TokenPriceSnapshot extends Entity { this.set("price", Value.fromBigDecimal(value)); } } + +export class StakingPoolSnapshot extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + const id = this.get("id"); + assert(id != null, "Cannot save StakingPoolSnapshot entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type StakingPoolSnapshot must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}` + ); + store.set("StakingPoolSnapshot", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): StakingPoolSnapshot | null { + return changetype( + store.get_in_block("StakingPoolSnapshot", id.toHexString()) + ); + } + + static load(id: Bytes): StakingPoolSnapshot | null { + return changetype( + store.get("StakingPoolSnapshot", id.toHexString()) + ); + } + + get id(): Bytes { + const value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get block(): BigInt { + const value = this.get("block"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set block(value: BigInt) { + this.set("block", Value.fromBigInt(value)); + } + + get contractAddress(): Bytes { + const value = this.get("contractAddress"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set contractAddress(value: Bytes) { + this.set("contractAddress", Value.fromBytes(value)); + } + + get stakingToken(): Bytes | null { + const value = this.get("stakingToken"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set stakingToken(value: Bytes | null) { + if (!value) { + this.unset("stakingToken"); + } else { + this.set("stakingToken", Value.fromBytes(value)); + } + } +} diff --git a/subgraphs/price-snapshot/schema.graphql b/subgraphs/price-snapshot/schema.graphql index 719880e5..6a1cdda6 100644 --- a/subgraphs/price-snapshot/schema.graphql +++ b/subgraphs/price-snapshot/schema.graphql @@ -18,7 +18,7 @@ type PriceSnapshotDaily @entity { ### Added from protocol-metrics subgraph. Used for pricing. type ERC20TokenSnapshot @entity(immutable: true) { - id: ID! # address/block + id: Bytes! # address/block address: Bytes! decimals: Int! totalSupply: BigDecimal @@ -33,7 +33,7 @@ type ConvexRewardPoolSnapshot @entity(immutable: true) { # TODO migrate to PoolSnapshot type BalancerPoolSnapshot @entity(immutable: true) { - id: ID! # pool id/block + id: Bytes! # pool id/block block: BigInt! pool: Bytes! poolToken: Bytes! @@ -45,7 +45,7 @@ type BalancerPoolSnapshot @entity(immutable: true) { } type PoolSnapshot @entity(immutable: true) { - id: ID! # pool/block + id: Bytes! # pool/block block: BigInt! pool: Bytes! poolToken: Bytes @@ -57,14 +57,14 @@ type PoolSnapshot @entity(immutable: true) { } type TokenPriceSnapshot @entity(immutable: true) { - id: ID! # address/block + id: Bytes! # address/block block: BigInt! token: Bytes! price: BigDecimal! } type StakingPoolSnapshot @entity(immutable: true) { - id: ID! # address/block + id: Bytes! # address/block block: BigInt! contractAddress: Bytes! stakingToken: Bytes # Will not be set if the call reverts diff --git a/subgraphs/price-snapshot/subgraph.yaml b/subgraphs/price-snapshot/subgraph.yaml index 06eab0fd..6240d668 100644 --- a/subgraphs/price-snapshot/subgraph.yaml +++ b/subgraphs/price-snapshot/subgraph.yaml @@ -20,8 +20,11 @@ dataSources: abis: - name: ERC20 file: ../shared/abis/ERC20.json + # Used for price resolution - name: UniswapV2Pair file: ../shared/abis/UniswapV2Pair.json + - name: UniswapV3Pair + file: ../shared/abis/UniswapV3Pair.json - name: BalancerVault file: ../shared/abis/BalancerVault.json - name: BalancerPoolToken From d962865edb41c5a68cb15bb70f12114824a86283 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 25 Jan 2024 10:37:24 +0400 Subject: [PATCH 64/81] Bump graph-cli to fix incompatibility --- .vscode/settings.json | 2 +- package.json | 4 +- yarn.lock | 277 ++++-------------------------------------- 3 files changed, 25 insertions(+), 258 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index eb70fd38..c6e64f55 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,7 +3,7 @@ "eslint.packageManager": "yarn", "eslint.format.enable": true, "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": "explicit" }, "cSpell.words": [ "arbitrum", diff --git a/package.json b/package.json index b66118aa..76905256 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ }, "dependencies": { "@apollo/client": "^3.8.4", - "@graphprotocol/graph-cli": "^0.57.0", + "@graphprotocol/graph-cli": "^0.67.0", "@graphprotocol/graph-ts": "^0.31.0", "assemblyscript-json": "^1.1.0", "commander": "^9.4.0", @@ -49,4 +49,4 @@ "ramda": "^0.27.2", "yargs-parser": "^18.1.1" } -} +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 9e11e987..f42070de 100644 --- a/yarn.lock +++ b/yarn.lock @@ -274,10 +274,10 @@ graphql-import-node "^0.0.5" js-yaml "^4.1.0" -"@graphprotocol/graph-cli@^0.57.0": - version "0.57.0" - resolved "https://registry.yarnpkg.com/@graphprotocol/graph-cli/-/graph-cli-0.57.0.tgz#dca0327f83b6fc081416cca1cc9f9d005dc10d03" - integrity sha512-UQ+4a4qTeGYdIWHNINtwTiL7izuRe4smgSeGmTxQQMSeebehTgrpa6NV3brGWcYsmN1Bo5egM4D9stkQtRnxeA== +"@graphprotocol/graph-cli@^0.67.0": + version "0.67.2" + resolved "https://registry.yarnpkg.com/@graphprotocol/graph-cli/-/graph-cli-0.67.2.tgz#4c8fcc52a0817454b50860cb7925b8d28fd94b91" + integrity sha512-seQyK8Fkqw0+TxWOtqVGkicLqEbCR5DQPRooo+8iqRtmZu12wDJ85n63t2abaUF//iFT7cRT4oA2OQdFXK8Vog== dependencies: "@float-capital/float-subgraph-uncrashable" "^0.0.0-alpha.4" "@oclif/core" "2.8.6" @@ -293,14 +293,13 @@ dockerode "2.5.8" fs-extra "9.1.0" glob "9.3.5" - gluegun "5.1.2" + gluegun "5.1.6" graphql "15.5.0" immutable "4.2.1" ipfs-http-client "55.0.0" jayson "4.0.0" js-yaml "3.14.1" - prettier "1.19.1" - request "2.88.2" + prettier "3.0.3" semver "7.4.0" sync-request "6.1.0" tmp-promise "3.0.3" @@ -894,7 +893,7 @@ acorn@^8.9.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== -ajv@^6.12.3, ajv@^6.12.4: +ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -1005,13 +1004,6 @@ asap@~2.0.6: resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" integrity sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA== -asn1@~0.2.3: - version "0.2.6" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" - integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== - dependencies: - safer-buffer "~2.1.0" - asn1js@^3.0.1, asn1js@^3.0.5: version "3.0.5" resolved "https://registry.yarnpkg.com/asn1js/-/asn1js-3.0.5.tgz#5ea36820443dbefb51cc7f88a2ebb5b462114f38" @@ -1043,11 +1035,6 @@ assemblyscript@0.19.23: long "^5.2.0" source-map-support "^0.5.20" -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== - astral-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" @@ -1068,16 +1055,6 @@ at-least-node@^1.0.0: resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA== - -aws4@^1.8.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" - integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== - axios@^0.21.1, axios@^0.21.4: version "0.21.4" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" @@ -1102,13 +1079,6 @@ base64-js@^1.3.1: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== - dependencies: - tweetnacl "^0.14.3" - binary-extensions@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" @@ -1451,7 +1421,7 @@ colors@1.4.0, colors@^1.1.2: resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== -combined-stream@^1.0.6, combined-stream@~1.0.6: +combined-stream@^1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -1488,11 +1458,6 @@ concat-stream@^1.6.0, concat-stream@^1.6.2, concat-stream@~1.6.2: readable-stream "^2.2.2" typedarray "^0.0.6" -core-util-is@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== - core-util-is@~1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" @@ -1561,13 +1526,6 @@ d@1, d@^1.0.1: es5-ext "^0.10.50" type "^1.0.1" -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g== - dependencies: - assert-plus "^1.0.0" - debug@4.3.4, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" @@ -1682,15 +1640,7 @@ dreamopt@~0.8.0: dependencies: wordwrap ">=0.0.2" -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw== - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - -ejs@3.1.6, ejs@^3.1.7, ejs@^3.1.8: +ejs@3.1.8, ejs@^3.1.7, ejs@^3.1.8: version "3.1.8" resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.8.tgz#758d32910c78047585c7ef1f92f9ee041c1c190b" integrity sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ== @@ -2015,21 +1965,6 @@ ext@^1.1.2: dependencies: type "^2.7.2" -extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g== - -extsprintf@^1.2.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" - integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== - eyes@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" @@ -2163,11 +2098,6 @@ follow-redirects@^1.14.0: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== - form-data@^2.2.0: version "2.5.1" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.1.tgz#f2cbec57b5e59e23716e128fe44d4e5dd23895f4" @@ -2177,15 +2107,6 @@ form-data@^2.2.0: combined-stream "^1.0.6" mime-types "^2.1.12" -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - fs-constants@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" @@ -2261,13 +2182,6 @@ get-stream@^6.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng== - dependencies: - assert-plus "^1.0.0" - glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" @@ -2323,10 +2237,10 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" -gluegun@5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/gluegun/-/gluegun-5.1.2.tgz#ffa0beda0fb6bbc089a867157b08602beae2c8cf" - integrity sha512-Cwx/8S8Z4YQg07a6AFsaGnnnmd8mN17414NcPS3OoDtZRwxgsvwRNJNg69niD6fDa8oNwslCG0xH7rEpRNNE/g== +gluegun@5.1.6: + version "5.1.6" + resolved "https://registry.yarnpkg.com/gluegun/-/gluegun-5.1.6.tgz#74ec13193913dc610f5c1a4039972c70c96a7bad" + integrity sha512-9zbi4EQWIVvSOftJWquWzr9gLX2kaDgPkNR5dYWbM53eVvCI3iKuxLlnKoHC0v4uPoq+Kr/+F569tjoFbA4DSA== dependencies: apisauce "^2.1.5" app-module-path "^2.2.0" @@ -2334,7 +2248,7 @@ gluegun@5.1.2: colors "1.4.0" cosmiconfig "7.0.1" cross-spawn "7.0.3" - ejs "3.1.6" + ejs "3.1.8" enquirer "2.3.6" execa "5.1.1" fs-jetpack "4.3.1" @@ -2396,19 +2310,6 @@ graphql@^16.8.1: resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.1.tgz#1930a965bef1170603702acdb68aedd3f3cf6f07" integrity sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw== -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q== - -har-validator@~5.1.3: - version "5.1.5" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" - integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== - dependencies: - ajv "^6.12.3" - har-schema "^2.0.0" - has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -2491,15 +2392,6 @@ http-response-object@^3.0.1: dependencies: "@types/node" "^10.0.3" -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ== - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - human-signals@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" @@ -2753,11 +2645,6 @@ is-stream@^2.0.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== -is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== - is-wsl@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" @@ -2790,11 +2677,6 @@ isomorphic-ws@^4.0.1: resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc" integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== - it-all@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/it-all/-/it-all-1.0.6.tgz#852557355367606295c4c3b7eff0136f07749335" @@ -2893,11 +2775,6 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== - json-buffer@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" @@ -2922,17 +2799,12 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== -json-schema@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" - integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== - json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== -json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: +json-stringify-safe@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== @@ -2956,16 +2828,6 @@ jsonparse@^1.2.0: resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== -jsprim@^1.2.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" - integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.4.0" - verror "1.10.0" - keccak@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.3.tgz#4bc35ad917be1ef54ff246f904c2bbbf9ac61276" @@ -3195,7 +3057,7 @@ mime-db@1.52.0: resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.12, mime-types@~2.1.19: +mime-types@^2.1.12: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== @@ -3401,11 +3263,6 @@ number-to-bn@1.7.0: bn.js "4.11.6" strip-hex-prefix "1.0.0" -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -3575,11 +3432,6 @@ pbkdf2@^3.0.17: safe-buffer "^5.0.1" sha.js "^2.4.8" -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow== - picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" @@ -3595,10 +3447,10 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier@1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== +prettier@3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643" + integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg== prettier@^2.6.2: version "2.8.8" @@ -3645,11 +3497,6 @@ protobufjs@^6.10.2: "@types/node" ">=13.7.0" long "^4.0.0" -psl@^1.1.28: - version "1.9.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" - integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== - pump@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/pump/-/pump-1.0.3.tgz#5dfe8311c33bbf6fc18261f9f34702c47c08a954" @@ -3663,7 +3510,7 @@ punycode@^1.3.2: resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" integrity sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ== -punycode@^2.1.0, punycode@^2.1.1: +punycode@^2.1.0: version "2.3.0" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== @@ -3687,11 +3534,6 @@ qs@^6.4.0: dependencies: side-channel "^1.0.4" -qs@~6.5.2: - version "6.5.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" - integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== - queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" @@ -3774,32 +3616,6 @@ redeyed@~2.1.0: dependencies: esprima "~4.0.0" -request@2.88.2: - version "2.88.2" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" - integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" @@ -3874,7 +3690,7 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -"safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: +"safer-buffer@>= 2.1.2 < 3.0.0": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== @@ -3990,21 +3806,6 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== -sshpk@^1.7.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" - integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - stream-to-it@^0.2.2: version "0.2.4" resolved "https://registry.yarnpkg.com/stream-to-it/-/stream-to-it-0.2.4.tgz#d2fd7bfbd4a899b4c0d6a7e6a533723af5749bd0" @@ -4231,14 +4032,6 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" @@ -4312,18 +4105,6 @@ tsutils@^3.21.0: dependencies: tslib "^1.8.1" -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== - dependencies: - safe-buffer "^5.0.1" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== - type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -4395,11 +4176,6 @@ util-deprecate@^1.0.1, util-deprecate@~1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== -uuid@^3.3.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" @@ -4415,15 +4191,6 @@ varint@^6.0.0: resolved "https://registry.yarnpkg.com/varint/-/varint-6.0.0.tgz#9881eb0ce8feaea6512439d19ddf84bf551661d0" integrity sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg== -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw== - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - wabt@1.0.24: version "1.0.24" resolved "https://registry.yarnpkg.com/wabt/-/wabt-1.0.24.tgz#c02e0b5b4503b94feaf4a30a426ef01c1bea7c6c" From 3f2da65b8e2087082a8808d776186b87647c06c7 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 25 Jan 2024 10:49:55 +0400 Subject: [PATCH 65/81] Bump matchstick version --- bin/subgraph/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/subgraph/src/index.ts b/bin/subgraph/src/index.ts index 91fdecb4..5dba8f3d 100644 --- a/bin/subgraph/src/index.ts +++ b/bin/subgraph/src/index.ts @@ -243,7 +243,7 @@ program console.info("*** Running graph test"); spawnProcess( - `yarn graph test --version 0.5.3 ${options.recompile == true ? "--recompile" : ""}`, + `yarn graph test --version 0.6.0 ${options.recompile == true ? "--recompile" : ""}`, (testExitCode: number) => { if (testExitCode > 0) { process.exit(testExitCode); From bea228c830478218ca0c291ca941fb5a9d250111 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 25 Jan 2024 10:50:08 +0400 Subject: [PATCH 66/81] Add test for burnt OHM --- .../ethereum/tests/OhmCalculations.test.ts | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/subgraphs/ethereum/tests/OhmCalculations.test.ts b/subgraphs/ethereum/tests/OhmCalculations.test.ts index 44df29d6..d40486b6 100644 --- a/subgraphs/ethereum/tests/OhmCalculations.test.ts +++ b/subgraphs/ethereum/tests/OhmCalculations.test.ts @@ -78,8 +78,8 @@ const TIMESTAMP = BigInt.fromString("1000"); const AUCTION_CLOSE_TIMESTAMP_PRE_EXPIRY = BigInt.fromString("999"); const AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY = BigInt.fromString("980"); -function setUpGnosisAuction(payoutCapacity: BigDecimal = PAYOUT_CAPACITY, termSeconds: BigInt = BOND_TERM, bidQuantity: BigDecimal | null = null, auctionCloseTimestamp: BigInt | null = null, auctionOpenTimestamp: BigInt = AUCTION_OPEN_TIMESTAMP): void { - const record = new GnosisAuction(AUCTION_ID); +function setUpGnosisAuction(auctionId: string = AUCTION_ID, payoutCapacity: BigDecimal = PAYOUT_CAPACITY, termSeconds: BigInt = BOND_TERM, bidQuantity: BigDecimal | null = null, auctionCloseTimestamp: BigInt | null = null, auctionOpenTimestamp: BigInt = AUCTION_OPEN_TIMESTAMP): void { + const record = new GnosisAuction(auctionId); record.payoutCapacity = payoutCapacity; record.termSeconds = termSeconds; record.auctionOpenTimestamp = auctionOpenTimestamp; @@ -179,7 +179,7 @@ describe("Vesting Bonds", () => { test("closed auction/before bond expiry/with balance in GnosisEasyAuction", () => { // Mock auction payoutCapacity and bidQuantity (GnosisAuction) - setUpGnosisAuction(PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_PRE_EXPIRY); + setUpGnosisAuction(AUCTION_ID, PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_PRE_EXPIRY); // Mock contract values for the BondManager mockContracts(); @@ -203,7 +203,7 @@ describe("Vesting Bonds", () => { test("closed auction/before bond expiry/with balance in BondManager", () => { // Mock auction payoutCapacity and bidQuantity (GnosisAuction) - setUpGnosisAuction(PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_PRE_EXPIRY); + setUpGnosisAuction(AUCTION_ID, PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_PRE_EXPIRY); // Mock contract values for the BondManager mockContracts(); @@ -227,7 +227,7 @@ describe("Vesting Bonds", () => { test("closed auction/after bond expiry", () => { // Mock auction payoutCapacity and bidQuantity (GnosisAuction) - setUpGnosisAuction(PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY); + setUpGnosisAuction(AUCTION_ID, PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY); // Mock contract values for the BondManager mockContracts(); @@ -239,13 +239,31 @@ describe("Vesting Bonds", () => { // No effect on supply from the teller, as bond tokens are no longer vesting assert.assertTrue(recordsMap.has(CONTRACT_TELLER) == false); - // supply decreased by bid quantity in bond manager due to vesting user deposits + // supply decreased by bid quantity in bond manager due to burnable deposits const bondManagerRecord = recordsMap.get(BOND_MANAGER); assert.stringEquals(bondManagerRecord.supplyBalance.toString(), BID_QUANTITY.times(BigDecimal.fromString("-1")).toString()); assert.stringEquals(bondManagerRecord.type, TYPE_BONDS_DEPOSITS); assert.i32Equals(records.length, 1); }); + + test("closed auction/after bond expiry/all burned", () => { + // Mock auction payoutCapacity and bidQuantity (GnosisAuction) + setUpGnosisAuction(AUCTION_ID, PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY); + + // Mock contract values for the BondManager + mockContracts(); + mockContractBalances(BigDecimal.zero(), BID_QUANTITY, BigDecimal.zero()); + + const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); + const recordsMap = tokenSupplyRecordsToMap(records); + + // No effect on supply from the teller, as bond tokens are no longer vesting + assert.assertTrue(recordsMap.has(CONTRACT_TELLER) == false); + + // Burnable deposits are burned, which offsets the "burnable" entries + assert.i32Equals(records.length, 0); + }); }); describe("Treasury OHM", () => { From dcb4d6bb8dff057b43d87ad7cd9f4be54f5f029a Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 25 Jan 2024 07:40:37 +0000 Subject: [PATCH 67/81] Add tests for burnt OHM in Bond Manager --- .../ethereum/tests/OhmCalculations.test.ts | 200 ++++++++++++++++-- 1 file changed, 182 insertions(+), 18 deletions(-) diff --git a/subgraphs/ethereum/tests/OhmCalculations.test.ts b/subgraphs/ethereum/tests/OhmCalculations.test.ts index d40486b6..f2ac6f93 100644 --- a/subgraphs/ethereum/tests/OhmCalculations.test.ts +++ b/subgraphs/ethereum/tests/OhmCalculations.test.ts @@ -31,6 +31,14 @@ function tokenSupplyRecordsToMap(records: TokenSupply[]): Map { mockContractBalances(BigDecimal.zero(), BigDecimal.zero(), PAYOUT_CAPACITY); const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); - const recordsMap = tokenSupplyRecordsToMap(records); // supply decreased by payoutCapacity in teller - const tellerRecord = recordsMap.get(CONTRACT_TELLER); + const tellerRecord: TokenSupply = records[0]; + assert.stringEquals(getNonNullableString(tellerRecord.sourceAddress), CONTRACT_TELLER.toLowerCase()); + assert.stringEquals(getNonNullableString(tellerRecord.pool) || "", AUCTION_ID); assert.stringEquals(tellerRecord.supplyBalance.toString(), PAYOUT_CAPACITY.times(BigDecimal.fromString("-1")).toString()); assert.stringEquals(tellerRecord.type, TYPE_BONDS_PREMINTED); // No supply impact from Gnosis contract - assert.assertTrue(recordsMap.has(BOND_MANAGER) == false); assert.i32Equals(records.length, 1); }); @@ -164,15 +172,15 @@ describe("Vesting Bonds", () => { mockContractBalances(gnosisBalance, BigDecimal.zero(), PAYOUT_CAPACITY); const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); - const recordsMap = tokenSupplyRecordsToMap(records); // supply decreased by payoutCapacity in teller - const tellerRecord = recordsMap.get(CONTRACT_TELLER); + const tellerRecord: TokenSupply = records[0]; + assert.stringEquals(getNonNullableString(tellerRecord.sourceAddress), CONTRACT_TELLER.toLowerCase()); + assert.stringEquals(getNonNullableString(tellerRecord.pool) || "", AUCTION_ID); assert.stringEquals(tellerRecord.supplyBalance.toString(), PAYOUT_CAPACITY.times(BigDecimal.fromString("-1")).toString()); assert.stringEquals(tellerRecord.type, TYPE_BONDS_PREMINTED); // No supply impact from Gnosis contract - assert.assertTrue(recordsMap.has(BOND_MANAGER) == false); assert.i32Equals(records.length, 1); }); @@ -186,15 +194,18 @@ describe("Vesting Bonds", () => { mockContractBalances(BID_QUANTITY, BigDecimal.zero(), PAYOUT_CAPACITY); const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); - const recordsMap = tokenSupplyRecordsToMap(records); // supply decreased by payout capacity in bond teller due to vesting tokens - const tellerRecord = recordsMap.get(CONTRACT_TELLER); + const tellerRecord: TokenSupply = records[1]; + assert.stringEquals(getNonNullableString(tellerRecord.sourceAddress), CONTRACT_TELLER.toLowerCase()); + assert.stringEquals(getNonNullableString(tellerRecord.pool) || "", AUCTION_ID); assert.stringEquals(tellerRecord.supplyBalance.toString(), PAYOUT_CAPACITY.times(BigDecimal.fromString("-1")).toString()); assert.stringEquals(tellerRecord.type, TYPE_BONDS_VESTING_TOKENS); // supply decreased by bid quantity in bond manager due to vesting user deposits - const bondManagerRecord = recordsMap.get(BOND_MANAGER); + const bondManagerRecord: TokenSupply = records[0]; + assert.stringEquals(getNonNullableString(bondManagerRecord.sourceAddress), BOND_MANAGER.toLowerCase()); + assert.stringEquals(getNonNullableString(bondManagerRecord.pool), AUCTION_ID); assert.stringEquals(bondManagerRecord.supplyBalance.toString(), BID_QUANTITY.times(BigDecimal.fromString("-1")).toString()); assert.stringEquals(bondManagerRecord.type, TYPE_BONDS_VESTING_DEPOSITS); @@ -210,15 +221,18 @@ describe("Vesting Bonds", () => { mockContractBalances(BigDecimal.zero(), BID_QUANTITY, PAYOUT_CAPACITY); const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); - const recordsMap = tokenSupplyRecordsToMap(records); // supply decreased by payout capacity in bond teller due to vesting tokens - const tellerRecord = recordsMap.get(CONTRACT_TELLER); + const tellerRecord: TokenSupply = records[1]; + assert.stringEquals(getNonNullableString(tellerRecord.sourceAddress), CONTRACT_TELLER.toLowerCase()); + assert.stringEquals(getNonNullableString(tellerRecord.pool) || "", AUCTION_ID); assert.stringEquals(tellerRecord.supplyBalance.toString(), PAYOUT_CAPACITY.times(BigDecimal.fromString("-1")).toString()); assert.stringEquals(tellerRecord.type, TYPE_BONDS_VESTING_TOKENS); // supply decreased by bid quantity in bond manager due to vesting user deposits - const bondManagerRecord = recordsMap.get(BOND_MANAGER); + const bondManagerRecord: TokenSupply = records[0]; + assert.stringEquals(getNonNullableString(bondManagerRecord.sourceAddress), BOND_MANAGER.toLowerCase()); + assert.stringEquals(getNonNullableString(bondManagerRecord.pool), AUCTION_ID); assert.stringEquals(bondManagerRecord.supplyBalance.toString(), BID_QUANTITY.times(BigDecimal.fromString("-1")).toString()); assert.stringEquals(bondManagerRecord.type, TYPE_BONDS_VESTING_DEPOSITS); @@ -234,13 +248,13 @@ describe("Vesting Bonds", () => { mockContractBalances(BigDecimal.zero(), BID_QUANTITY, PAYOUT_CAPACITY); const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); - const recordsMap = tokenSupplyRecordsToMap(records); // No effect on supply from the teller, as bond tokens are no longer vesting - assert.assertTrue(recordsMap.has(CONTRACT_TELLER) == false); // supply decreased by bid quantity in bond manager due to burnable deposits - const bondManagerRecord = recordsMap.get(BOND_MANAGER); + const bondManagerRecord = records[0]; + assert.stringEquals(getNonNullableString(bondManagerRecord.sourceAddress), BOND_MANAGER.toLowerCase()); + assert.stringEquals(getNonNullableString(bondManagerRecord.pool), AUCTION_ID); assert.stringEquals(bondManagerRecord.supplyBalance.toString(), BID_QUANTITY.times(BigDecimal.fromString("-1")).toString()); assert.stringEquals(bondManagerRecord.type, TYPE_BONDS_DEPOSITS); @@ -253,17 +267,167 @@ describe("Vesting Bonds", () => { // Mock contract values for the BondManager mockContracts(); - mockContractBalances(BigDecimal.zero(), BID_QUANTITY, BigDecimal.zero()); + mockContractBalances(BigDecimal.zero(), BigDecimal.zero(), PAYOUT_CAPACITY); // Bid capacity is burned const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); - const recordsMap = tokenSupplyRecordsToMap(records); // No effect on supply from the teller, as bond tokens are no longer vesting - assert.assertTrue(recordsMap.has(CONTRACT_TELLER) == false); + + // No entries for the Bond Manager + + // Burnable deposits are burned, which offsets the "burnable" entries + assert.i32Equals(records.length, 0); + }); + + test("closed auction/after bond expiry/all burned/multiple auctions", () => { + // Mock auction payoutCapacity and bidQuantity (GnosisAuction) + setUpGnosisAuction(AUCTION_ID, PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY); + setUpGnosisAuction("2", PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY); + + // Mock contract values for the BondManager + mockContracts(); + mockContractBalances(BigDecimal.zero(), BigDecimal.zero(), PAYOUT_CAPACITY); // All of the bid capacity is burned + + const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); + + // No effect on supply from the teller, as bond tokens are no longer vesting + + // No entries for the Bond Manager // Burnable deposits are burned, which offsets the "burnable" entries assert.i32Equals(records.length, 0); }); + + test("closed auction/after bond expiry/partial burned", () => { + // Mock auction payoutCapacity and bidQuantity (GnosisAuction) + setUpGnosisAuction(AUCTION_ID, PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY); // Will be burnable + setUpGnosisAuction("2", PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY); // Will be burnable + + // Mock contract values for the BondManager + mockContracts(); + mockContractBalances(BigDecimal.zero(), BID_QUANTITY, PAYOUT_CAPACITY); // Half of the bid capacity is burned + + const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); + + // Remaining payout capacity is split between the two + const bondManagerRecord = records[0]; + assert.stringEquals(getNonNullableString(bondManagerRecord.sourceAddress), BOND_MANAGER.toLowerCase()); + assert.stringEquals(getNonNullableString(bondManagerRecord.pool), AUCTION_ID); + assert.stringEquals(bondManagerRecord.supplyBalance.toString(), BID_QUANTITY.times(BigDecimal.fromString("-1")).times(BigDecimal.fromString("0.5")).toString()); + assert.stringEquals(bondManagerRecord.type, TYPE_BONDS_DEPOSITS); + + const bondManagerRecordTwo = records[1]; + assert.stringEquals(getNonNullableString(bondManagerRecordTwo.sourceAddress), BOND_MANAGER.toLowerCase()); + assert.stringEquals(getNonNullableString(bondManagerRecordTwo.pool), "2"); + assert.stringEquals(bondManagerRecordTwo.supplyBalance.toString(), BID_QUANTITY.times(BigDecimal.fromString("-1")).times(BigDecimal.fromString("0.5")).toString()); + assert.stringEquals(bondManagerRecordTwo.type, TYPE_BONDS_DEPOSITS); + + assert.i32Equals(records.length, 2); + }); + + test("closed auction/multiple auctions/mixed bond expiry", () => { + const auctionTwoBidQuantity = BigDecimal.fromString("500"); + + // Mock auction payoutCapacity and bidQuantity (GnosisAuction) + setUpGnosisAuction(AUCTION_ID, PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_PRE_EXPIRY); // Will be vesting + setUpGnosisAuction("2", PAYOUT_CAPACITY, BOND_TERM, auctionTwoBidQuantity, AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY); // Will be burnable + + // Mock contract values for the BondManager + mockContracts(); + mockContractBalances(BigDecimal.zero(), BID_QUANTITY.plus(auctionTwoBidQuantity), PAYOUT_CAPACITY); + + const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); + + const tellerRecordOne: TokenSupply = records[1]; + assert.stringEquals(getNonNullableString(tellerRecordOne.sourceAddress), CONTRACT_TELLER.toLowerCase()); + assert.stringEquals(getNonNullableString(tellerRecordOne.pool) || "", AUCTION_ID); + assert.stringEquals(tellerRecordOne.supplyBalance.toString(), PAYOUT_CAPACITY.times(BigDecimal.fromString("-1")).toString()); + assert.stringEquals(tellerRecordOne.type, TYPE_BONDS_VESTING_TOKENS); + + // supply decreased by bid quantity in bond manager due to vesting user deposits + const bondManagerRecordOne: TokenSupply = records[0]; + assert.stringEquals(getNonNullableString(bondManagerRecordOne.sourceAddress), BOND_MANAGER.toLowerCase()); + assert.stringEquals(getNonNullableString(bondManagerRecordOne.pool), AUCTION_ID); + assert.stringEquals(bondManagerRecordOne.supplyBalance.toString(), BID_QUANTITY.times(BigDecimal.fromString("-1")).toString()); + assert.stringEquals(bondManagerRecordOne.type, TYPE_BONDS_VESTING_DEPOSITS); + + // Remaining payout capacity is burnable + const bondManagerRecordTwo = records[2]; + assert.stringEquals(getNonNullableString(bondManagerRecordTwo.sourceAddress), BOND_MANAGER.toLowerCase()); + assert.stringEquals(getNonNullableString(bondManagerRecordTwo.pool), AUCTION_ID); + assert.stringEquals(bondManagerRecordTwo.supplyBalance.toString(), auctionTwoBidQuantity.times(BigDecimal.fromString("-1")).toString()); + assert.stringEquals(bondManagerRecordTwo.type, TYPE_BONDS_DEPOSITS); + + assert.i32Equals(records.length, 3); + }); + + test("closed auction/multiple auctions/mixed bond expiry/partial burned", () => { + const auctionTwoBidQuantity = BigDecimal.fromString("500"); + const remainingBidCapacity = auctionTwoBidQuantity.div(BigDecimal.fromString("2")); + + // Mock auction payoutCapacity and bidQuantity (GnosisAuction) + setUpGnosisAuction(AUCTION_ID, PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_PRE_EXPIRY); // Will be vesting + setUpGnosisAuction("2", PAYOUT_CAPACITY, BOND_TERM, auctionTwoBidQuantity, AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY); // Will be burnable + + // Mock contract values for the BondManager + mockContracts(); + mockContractBalances(BigDecimal.zero(), BID_QUANTITY.plus(remainingBidCapacity), PAYOUT_CAPACITY); + + const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); + + const tellerRecordOne: TokenSupply = records[1]; + assert.stringEquals(getNonNullableString(tellerRecordOne.sourceAddress), CONTRACT_TELLER.toLowerCase()); + assert.stringEquals(getNonNullableString(tellerRecordOne.pool) || "", AUCTION_ID); + assert.stringEquals(tellerRecordOne.supplyBalance.toString(), PAYOUT_CAPACITY.times(BigDecimal.fromString("-1")).toString()); + assert.stringEquals(tellerRecordOne.type, TYPE_BONDS_VESTING_TOKENS); + + // supply decreased by bid quantity in bond manager due to vesting user deposits + const bondManagerRecordOne: TokenSupply = records[0]; + assert.stringEquals(getNonNullableString(bondManagerRecordOne.sourceAddress), BOND_MANAGER.toLowerCase()); + assert.stringEquals(getNonNullableString(bondManagerRecordOne.pool), AUCTION_ID); + assert.stringEquals(bondManagerRecordOne.supplyBalance.toString(), BID_QUANTITY.times(BigDecimal.fromString("-1")).toString()); + assert.stringEquals(bondManagerRecordOne.type, TYPE_BONDS_VESTING_DEPOSITS); + + // Remaining payout capacity is partially burned + const bondManagerRecordTwo = records[2]; + assert.stringEquals(getNonNullableString(bondManagerRecordTwo.sourceAddress), BOND_MANAGER.toLowerCase()); + assert.stringEquals(getNonNullableString(bondManagerRecordTwo.pool), AUCTION_ID); + assert.stringEquals(bondManagerRecordTwo.supplyBalance.toString(), remainingBidCapacity.times(BigDecimal.fromString("-1")).toString()); + assert.stringEquals(bondManagerRecordTwo.type, TYPE_BONDS_DEPOSITS); + + assert.i32Equals(records.length, 3); + }); + + test("closed auction/multiple auctions/mixed bond expiry/all burned", () => { + const auctionTwoBidQuantity = BigDecimal.fromString("500"); + + // Mock auction payoutCapacity and bidQuantity (GnosisAuction) + setUpGnosisAuction(AUCTION_ID, PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_PRE_EXPIRY); // Will be vesting + setUpGnosisAuction("2", PAYOUT_CAPACITY, BOND_TERM, auctionTwoBidQuantity, AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY); // Will be burnable + + // Mock contract values for the BondManager + mockContracts(); + mockContractBalances(BigDecimal.zero(), BID_QUANTITY, PAYOUT_CAPACITY); // Burnable OHM is burned + + const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); + + const tellerRecordOne: TokenSupply = records[1]; + assert.stringEquals(getNonNullableString(tellerRecordOne.sourceAddress), CONTRACT_TELLER.toLowerCase()); + assert.stringEquals(getNonNullableString(tellerRecordOne.pool) || "", AUCTION_ID); + assert.stringEquals(tellerRecordOne.supplyBalance.toString(), PAYOUT_CAPACITY.times(BigDecimal.fromString("-1")).toString()); + assert.stringEquals(tellerRecordOne.type, TYPE_BONDS_VESTING_TOKENS); + + // supply decreased by bid quantity in bond manager due to vesting user deposits + const bondManagerRecordOne: TokenSupply = records[0]; + assert.stringEquals(getNonNullableString(bondManagerRecordOne.sourceAddress), BOND_MANAGER.toLowerCase()); + assert.stringEquals(getNonNullableString(bondManagerRecordOne.pool), AUCTION_ID); + assert.stringEquals(bondManagerRecordOne.supplyBalance.toString(), BID_QUANTITY.times(BigDecimal.fromString("-1")).toString()); + assert.stringEquals(bondManagerRecordOne.type, TYPE_BONDS_VESTING_DEPOSITS); + + // Remaining payout capacity is burned, no entry + + assert.i32Equals(records.length, 2); + }); }); describe("Treasury OHM", () => { From f33ba55de4776f4ad2c39f4533a28a8f22b79fde Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 26 Jan 2024 07:56:15 +0000 Subject: [PATCH 68/81] Fix burnable/burned OHM bonds --- .../ethereum/src/utils/OhmCalculations.ts | 112 ++++++++++++++---- .../ethereum/tests/OhmCalculations.test.ts | 54 ++++++--- 2 files changed, 124 insertions(+), 42 deletions(-) diff --git a/subgraphs/ethereum/src/utils/OhmCalculations.ts b/subgraphs/ethereum/src/utils/OhmCalculations.ts index 120cd508..e9c19ff4 100644 --- a/subgraphs/ethereum/src/utils/OhmCalculations.ts +++ b/subgraphs/ethereum/src/utils/OhmCalculations.ts @@ -43,6 +43,7 @@ import { SILO_DEPLOYMENTS, } from "./Constants"; import { + getERC20, getERC20DecimalBalance, getSOlympusERC20, getSOlympusERC20V2, @@ -164,7 +165,7 @@ export function getTotalSupplyRecord(timestamp: BigInt, blockNumber: BigInt): To * - Binds with the sOHM V3 contract * - Multiplies index() from sOHM V3 by {MIGRATION_OFFSET} * - Returns a token record with the offset - * + * * NOTE: the balance of gOHM in the migration contract is likely to be higher than this manual offset, * as it is gOHM pre-minted for migration of OHM (v1). As a result, the difference in the gOHM balance is not considered protocol-owned. * @@ -222,8 +223,57 @@ export function getVestingBondSupplyRecords(timestamp: BigInt, blockNumber: BigI const bondFixedExpiryTellerAddress = bondManager.fixedExpiryTeller(); + // Get the balance of OHM + const bondManagerOhmBalanceTmp = getERC20DecimalBalance(ERC20_OHM_V2, BOND_MANAGER, blockNumber); + let bondManagerOhmBalanceUnallocated = bondManagerOhmBalanceTmp; + // Loop through Gnosis Auctions const gnosisAuctionIds: BigInt[] = gnosisAuctionRoot.markets; + + // Determine the amount of OHM to deduct from the burnable amount + let totalBurnableOhm = BigDecimal.zero(); + for (let i = 0; i < gnosisAuctionIds.length; i++) { + const auctionId = gnosisAuctionIds[i].toString(); + log.debug("{}: Processing Gnosis auction with id {}", [FUNC, auctionId]); + + const auctionRecord = GnosisAuction.load(auctionId); + if (!auctionRecord) { + throw new Error(`Expected to find GnosisAuction record with id ${auctionId}, but it was not found`); + } + + const bidQuantity: BigDecimal | null = auctionRecord.bidQuantity; + + // Open auction + if (!bidQuantity) { + continue; + } + + const bondTermSeconds = auctionRecord.termSeconds; + const auctionCloseTimestamp = auctionRecord.auctionCloseTimestamp; + if (!auctionCloseTimestamp) { + throw new Error(`Expected the auctionCloseTimestamp on closed auction '${auctionId}' to be set`); + } + + const expiryTimestamp = auctionCloseTimestamp.plus(bondTermSeconds); + + // Close auction but not fully-vested + if (timestamp.lt(expiryTimestamp)) { + // Deduct the bid quantity from the unallocated balance + bondManagerOhmBalanceUnallocated = bondManagerOhmBalanceUnallocated.minus(bidQuantity); + continue; + } + + // Closed auction and the bond expiry time has been reached + // Add the OHM to the total burnable amount + totalBurnableOhm = totalBurnableOhm.plus(bidQuantity); + } + + // If the Bond Manager OHM balance is greater than the burnable amount, cap it + log.debug("{}: Bond Manager OHM balance is {}", [FUNC, bondManagerOhmBalanceTmp.toString()]); + log.debug("{}: Total burnable OHM is {}", [FUNC, totalBurnableOhm.toString()]); + const bondManagerOhmBalance = bondManagerOhmBalanceUnallocated.gt(totalBurnableOhm) ? totalBurnableOhm : bondManagerOhmBalanceUnallocated; + + // Record bond details for (let i = 0; i < gnosisAuctionIds.length; i++) { const auctionId = gnosisAuctionIds[i].toString(); log.debug("{}: Processing Gnosis auction with id {}", [FUNC, auctionId]); @@ -269,6 +319,8 @@ export function getVestingBondSupplyRecords(timestamp: BigInt, blockNumber: BigI // Closed auction and the bond expiry time has not been reached if (timestamp.lt(expiryTimestamp)) { + log.debug("{}: bonds are still vesting", [FUNC]); + // Vesting user deposits equal to the sold quantity are stored in the bond manager, so we adjust that records.push( createTokenSupply( @@ -305,6 +357,18 @@ export function getVestingBondSupplyRecords(timestamp: BigInt, blockNumber: BigI } // Bond expiry time has been reached else { + log.debug("{}: bonds are vested", [FUNC]); + + // If OHM in the Bond Manager has been fully or partially burned, this will adjust for it + const adjustedBidQuantity = bidQuantity.times(bondManagerOhmBalance).div(totalBurnableOhm); + log.debug("{}: bidQuantity is {}", [FUNC, bidQuantity.toString()]); + log.debug("{}: adjustedBidQuantity is {}", [FUNC, adjustedBidQuantity.toString()]); + + if (adjustedBidQuantity.equals(BigDecimal.zero())) { + log.debug("{}: adjustedBidQuantity is zero, skipping", [FUNC]); + continue; + } + // User deposits equal to the sold quantity are stored in the bond manager, so we adjust that // These deposits will eventually be burned records.push( @@ -317,14 +381,12 @@ export function getVestingBondSupplyRecords(timestamp: BigInt, blockNumber: BigI getContractName(BOND_MANAGER), BOND_MANAGER, TYPE_BONDS_DEPOSITS, - bidQuantity, + adjustedBidQuantity, blockNumber, -1, // Subtract ), ); } - - // TODO add support for recognising OHM burned from bond deposits } } @@ -379,13 +441,13 @@ function getLendingMarketDeploymentOHMRecords(timestamp: BigInt, deploymentAddre /** * Generates TokenSupply records for OHM that has been minted * and deposited into the Euler and Silo lending markets. - * + * * The values and block(s) are hard-coded, as this was performed manually using * the multi-sig. Future deployments will be automated through a smart contract. - * - * @param timestamp - * @param blockNumber - * @returns + * + * @param timestamp + * @param blockNumber + * @returns */ export function getMintedBorrowableOHMRecords(timestamp: BigInt, blockNumber: BigInt): TokenSupply[] { const records: TokenSupply[] = []; @@ -417,7 +479,7 @@ export function getMintedBorrowableOHMRecords(timestamp: BigInt, blockNumber: Bi * * sOHM and gOHM are converted to the equivalent quantity of OHM (using the index) * and included in the calculation. - * + * * Notes: * - All versions of OHM/sOHM/wsOHM in the migration contract are not considered, as the tokens * are transferred into the contract upon migration into OHMv3/gOHM and hence reflected in @@ -436,8 +498,8 @@ export function getTreasuryOHMRecords(timestamp: BigInt, blockNumber: BigInt): T /** * Make a copy of the circulating wallets array - * - * NOTE: this deliberately does not use the `getWalletAddressesForContract` function, + * + * NOTE: this deliberately does not use the `getWalletAddressesForContract` function, * as that blacklists all OHM variants in treasury wallets, so that they are not added * to the market value */ @@ -663,14 +725,14 @@ export function getProtocolOwnedLiquiditySupplyRecords( /** * Returns TokenSupply records representing the OHM minted into the IncurDebt contract. - * + * * The value reported for each vault is based on the value of `totalOutstandingGlobalDebt()`. - * + * * Only applicable after `OLYMPUS_INCUR_DEBT_BLOCK` - * - * @param timestamp - * @param blockNumber - * @returns + * + * @param timestamp + * @param blockNumber + * @returns */ export function getIncurDebtSupplyRecords(timestamp: BigInt, blockNumber: BigInt): TokenSupply[] { const records: TokenSupply[] = []; @@ -718,12 +780,12 @@ export function getIncurDebtSupplyRecords(timestamp: BigInt, blockNumber: BigInt /** * Returns TokenSupply records representing the OHM minted into boosted liquidity vaults. - * + * * The value reported for each vault is the result of calling `getPoolOhmShare()`. - * - * @param timestamp - * @param blockNumber - * @returns + * + * @param timestamp + * @param blockNumber + * @returns */ export function getBoostedLiquiditySupplyRecords(timestamp: BigInt, blockNumber: BigInt): TokenSupply[] { const records: TokenSupply[] = []; @@ -819,7 +881,7 @@ export function getTotalValueLocked(blockNumber: BigInt): BigDecimal { * this function returns the OHM backed supply. * * Backed supply is the quantity of OHM backed by treasury assets. - * + * * Backed supply is calculated as: * - OHM total supply * - minus: OHM in circulating supply wallets @@ -902,7 +964,7 @@ export function getFloatingSupply(tokenSupplies: TokenSupply[], block: BigInt): * - minus: pre-minted OHM for bonds * - minus: OHM user deposits for bonds * - minus: OHM in boosted liquidity vaults (before `BLV_INCLUSION_BLOCK`) - * + * * OHM represented by vesting bond tokens (type `TYPE_BONDS_VESTING_TOKENS`) is not included in the circulating supply, as it is * owned by users and not the protocol. */ diff --git a/subgraphs/ethereum/tests/OhmCalculations.test.ts b/subgraphs/ethereum/tests/OhmCalculations.test.ts index f2ac6f93..691041ea 100644 --- a/subgraphs/ethereum/tests/OhmCalculations.test.ts +++ b/subgraphs/ethereum/tests/OhmCalculations.test.ts @@ -86,6 +86,8 @@ const TIMESTAMP = BigInt.fromString("1000"); const AUCTION_CLOSE_TIMESTAMP_PRE_EXPIRY = BigInt.fromString("999"); const AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY = BigInt.fromString("980"); +const BLOCK_NUMBER = BigInt.fromString("18000000"); + function setUpGnosisAuction(auctionId: string = AUCTION_ID, payoutCapacity: BigDecimal = PAYOUT_CAPACITY, termSeconds: BigInt = BOND_TERM, bidQuantity: BigDecimal | null = null, auctionCloseTimestamp: BigInt | null = null, auctionOpenTimestamp: BigInt = AUCTION_OPEN_TIMESTAMP): void { const record = new GnosisAuction(auctionId); record.payoutCapacity = payoutCapacity; @@ -101,10 +103,17 @@ function setUpGnosisAuction(auctionId: string = AUCTION_ID, payoutCapacity: BigD } record.save(); +} + +function setGnosisAuctionMarkets(markets: string[]): void { + const marketIds: BigInt[] = []; + for (let i = 0; i < markets.length; i++) { + marketIds.push(BigInt.fromString(markets[i])); + } - const rootRecord = new GnosisAuctionRoot(GNOSIS_RECORD_ID); - rootRecord.markets = [BigInt.fromString(AUCTION_ID)]; - rootRecord.save(); + const record = new GnosisAuctionRoot(GNOSIS_RECORD_ID); + record.markets = marketIds; + record.save(); } function mockContracts(): void { @@ -134,7 +143,7 @@ describe("Vesting Bonds", () => { mockContracts(); mockContractBalances(); - const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); + const records = getVestingBondSupplyRecords(TIMESTAMP, BLOCK_NUMBER); // No supply impact assert.i32Equals(records.length, 0); @@ -143,12 +152,13 @@ describe("Vesting Bonds", () => { test("open auction", () => { // Mock auction payoutCapacity (GnosisAuction) setUpGnosisAuction(); + setGnosisAuctionMarkets([AUCTION_ID]); // Mock contract values for the BondManager mockContracts(); mockContractBalances(BigDecimal.zero(), BigDecimal.zero(), PAYOUT_CAPACITY); - const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); + const records = getVestingBondSupplyRecords(TIMESTAMP, BLOCK_NUMBER); // supply decreased by payoutCapacity in teller const tellerRecord: TokenSupply = records[0]; @@ -165,13 +175,14 @@ describe("Vesting Bonds", () => { test("open auction with deposits", () => { // Mock auction payoutCapacity (GnosisAuction) setUpGnosisAuction(); + setGnosisAuctionMarkets([AUCTION_ID]); // Mock contract values for the BondManager and Gnosis deposit mockContracts(); const gnosisBalance = BigDecimal.fromString("1000"); mockContractBalances(gnosisBalance, BigDecimal.zero(), PAYOUT_CAPACITY); - const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); + const records = getVestingBondSupplyRecords(TIMESTAMP, BLOCK_NUMBER); // supply decreased by payoutCapacity in teller const tellerRecord: TokenSupply = records[0]; @@ -188,12 +199,13 @@ describe("Vesting Bonds", () => { test("closed auction/before bond expiry/with balance in GnosisEasyAuction", () => { // Mock auction payoutCapacity and bidQuantity (GnosisAuction) setUpGnosisAuction(AUCTION_ID, PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_PRE_EXPIRY); + setGnosisAuctionMarkets([AUCTION_ID]); // Mock contract values for the BondManager mockContracts(); mockContractBalances(BID_QUANTITY, BigDecimal.zero(), PAYOUT_CAPACITY); - const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); + const records = getVestingBondSupplyRecords(TIMESTAMP, BLOCK_NUMBER); // supply decreased by payout capacity in bond teller due to vesting tokens const tellerRecord: TokenSupply = records[1]; @@ -215,12 +227,13 @@ describe("Vesting Bonds", () => { test("closed auction/before bond expiry/with balance in BondManager", () => { // Mock auction payoutCapacity and bidQuantity (GnosisAuction) setUpGnosisAuction(AUCTION_ID, PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_PRE_EXPIRY); + setGnosisAuctionMarkets([AUCTION_ID]); // Mock contract values for the BondManager mockContracts(); mockContractBalances(BigDecimal.zero(), BID_QUANTITY, PAYOUT_CAPACITY); - const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); + const records = getVestingBondSupplyRecords(TIMESTAMP, BLOCK_NUMBER); // supply decreased by payout capacity in bond teller due to vesting tokens const tellerRecord: TokenSupply = records[1]; @@ -242,12 +255,13 @@ describe("Vesting Bonds", () => { test("closed auction/after bond expiry", () => { // Mock auction payoutCapacity and bidQuantity (GnosisAuction) setUpGnosisAuction(AUCTION_ID, PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY); + setGnosisAuctionMarkets([AUCTION_ID]); // Mock contract values for the BondManager mockContracts(); mockContractBalances(BigDecimal.zero(), BID_QUANTITY, PAYOUT_CAPACITY); - const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); + const records = getVestingBondSupplyRecords(TIMESTAMP, BLOCK_NUMBER); // No effect on supply from the teller, as bond tokens are no longer vesting @@ -264,12 +278,13 @@ describe("Vesting Bonds", () => { test("closed auction/after bond expiry/all burned", () => { // Mock auction payoutCapacity and bidQuantity (GnosisAuction) setUpGnosisAuction(AUCTION_ID, PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY); + setGnosisAuctionMarkets([AUCTION_ID]); // Mock contract values for the BondManager mockContracts(); mockContractBalances(BigDecimal.zero(), BigDecimal.zero(), PAYOUT_CAPACITY); // Bid capacity is burned - const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); + const records = getVestingBondSupplyRecords(TIMESTAMP, BLOCK_NUMBER); // No effect on supply from the teller, as bond tokens are no longer vesting @@ -283,12 +298,13 @@ describe("Vesting Bonds", () => { // Mock auction payoutCapacity and bidQuantity (GnosisAuction) setUpGnosisAuction(AUCTION_ID, PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY); setUpGnosisAuction("2", PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY); + setGnosisAuctionMarkets([AUCTION_ID, "2"]); // Mock contract values for the BondManager mockContracts(); mockContractBalances(BigDecimal.zero(), BigDecimal.zero(), PAYOUT_CAPACITY); // All of the bid capacity is burned - const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); + const records = getVestingBondSupplyRecords(TIMESTAMP, BLOCK_NUMBER); // No effect on supply from the teller, as bond tokens are no longer vesting @@ -302,12 +318,13 @@ describe("Vesting Bonds", () => { // Mock auction payoutCapacity and bidQuantity (GnosisAuction) setUpGnosisAuction(AUCTION_ID, PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY); // Will be burnable setUpGnosisAuction("2", PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY); // Will be burnable + setGnosisAuctionMarkets([AUCTION_ID, "2"]); // Mock contract values for the BondManager mockContracts(); mockContractBalances(BigDecimal.zero(), BID_QUANTITY, PAYOUT_CAPACITY); // Half of the bid capacity is burned - const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); + const records = getVestingBondSupplyRecords(TIMESTAMP, BLOCK_NUMBER); // Remaining payout capacity is split between the two const bondManagerRecord = records[0]; @@ -331,12 +348,13 @@ describe("Vesting Bonds", () => { // Mock auction payoutCapacity and bidQuantity (GnosisAuction) setUpGnosisAuction(AUCTION_ID, PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_PRE_EXPIRY); // Will be vesting setUpGnosisAuction("2", PAYOUT_CAPACITY, BOND_TERM, auctionTwoBidQuantity, AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY); // Will be burnable + setGnosisAuctionMarkets([AUCTION_ID, "2"]); // Mock contract values for the BondManager mockContracts(); mockContractBalances(BigDecimal.zero(), BID_QUANTITY.plus(auctionTwoBidQuantity), PAYOUT_CAPACITY); - const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); + const records = getVestingBondSupplyRecords(TIMESTAMP, BLOCK_NUMBER); const tellerRecordOne: TokenSupply = records[1]; assert.stringEquals(getNonNullableString(tellerRecordOne.sourceAddress), CONTRACT_TELLER.toLowerCase()); @@ -354,7 +372,7 @@ describe("Vesting Bonds", () => { // Remaining payout capacity is burnable const bondManagerRecordTwo = records[2]; assert.stringEquals(getNonNullableString(bondManagerRecordTwo.sourceAddress), BOND_MANAGER.toLowerCase()); - assert.stringEquals(getNonNullableString(bondManagerRecordTwo.pool), AUCTION_ID); + assert.stringEquals(getNonNullableString(bondManagerRecordTwo.pool), "2"); assert.stringEquals(bondManagerRecordTwo.supplyBalance.toString(), auctionTwoBidQuantity.times(BigDecimal.fromString("-1")).toString()); assert.stringEquals(bondManagerRecordTwo.type, TYPE_BONDS_DEPOSITS); @@ -368,12 +386,13 @@ describe("Vesting Bonds", () => { // Mock auction payoutCapacity and bidQuantity (GnosisAuction) setUpGnosisAuction(AUCTION_ID, PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_PRE_EXPIRY); // Will be vesting setUpGnosisAuction("2", PAYOUT_CAPACITY, BOND_TERM, auctionTwoBidQuantity, AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY); // Will be burnable + setGnosisAuctionMarkets([AUCTION_ID, "2"]); // Mock contract values for the BondManager mockContracts(); mockContractBalances(BigDecimal.zero(), BID_QUANTITY.plus(remainingBidCapacity), PAYOUT_CAPACITY); - const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); + const records = getVestingBondSupplyRecords(TIMESTAMP, BLOCK_NUMBER); const tellerRecordOne: TokenSupply = records[1]; assert.stringEquals(getNonNullableString(tellerRecordOne.sourceAddress), CONTRACT_TELLER.toLowerCase()); @@ -391,7 +410,7 @@ describe("Vesting Bonds", () => { // Remaining payout capacity is partially burned const bondManagerRecordTwo = records[2]; assert.stringEquals(getNonNullableString(bondManagerRecordTwo.sourceAddress), BOND_MANAGER.toLowerCase()); - assert.stringEquals(getNonNullableString(bondManagerRecordTwo.pool), AUCTION_ID); + assert.stringEquals(getNonNullableString(bondManagerRecordTwo.pool), "2"); assert.stringEquals(bondManagerRecordTwo.supplyBalance.toString(), remainingBidCapacity.times(BigDecimal.fromString("-1")).toString()); assert.stringEquals(bondManagerRecordTwo.type, TYPE_BONDS_DEPOSITS); @@ -404,12 +423,13 @@ describe("Vesting Bonds", () => { // Mock auction payoutCapacity and bidQuantity (GnosisAuction) setUpGnosisAuction(AUCTION_ID, PAYOUT_CAPACITY, BOND_TERM, BID_QUANTITY, AUCTION_CLOSE_TIMESTAMP_PRE_EXPIRY); // Will be vesting setUpGnosisAuction("2", PAYOUT_CAPACITY, BOND_TERM, auctionTwoBidQuantity, AUCTION_CLOSE_TIMESTAMP_POST_EXPIRY); // Will be burnable + setGnosisAuctionMarkets([AUCTION_ID, "2"]); // Mock contract values for the BondManager mockContracts(); mockContractBalances(BigDecimal.zero(), BID_QUANTITY, PAYOUT_CAPACITY); // Burnable OHM is burned - const records = getVestingBondSupplyRecords(TIMESTAMP, BigInt.fromString("2")); + const records = getVestingBondSupplyRecords(TIMESTAMP, BLOCK_NUMBER); const tellerRecordOne: TokenSupply = records[1]; assert.stringEquals(getNonNullableString(tellerRecordOne.sourceAddress), CONTRACT_TELLER.toLowerCase()); From 505691c1fa3f2d235286ffe3a79d4443e53ccf69 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 26 Jan 2024 08:12:20 +0000 Subject: [PATCH 69/81] Add TRSRY v1.1, adjust definition of bond depository --- subgraphs/ethereum/CHANGELOG.md | 6 ++++ subgraphs/ethereum/src/utils/Constants.ts | 35 ++++++++++--------- .../ethereum/src/utils/OhmCalculations.ts | 14 +++++++- .../ethereum/src/utils/ProtocolAddresses.ts | 3 +- subgraphs/shared/src/Wallets.ts | 3 +- 5 files changed, 41 insertions(+), 20 deletions(-) diff --git a/subgraphs/ethereum/CHANGELOG.md b/subgraphs/ethereum/CHANGELOG.md index 6fb933b1..a8b7926a 100644 --- a/subgraphs/ethereum/CHANGELOG.md +++ b/subgraphs/ethereum/CHANGELOG.md @@ -1,5 +1,11 @@ # Subgraph Changelog +## 5.1.0 (2024-01-26) + +- Adds TRSRY v1.1 +- Adds support for recognising OHM burnt in the Bond Manager +- Removes the Bond Depository from protocol- and DAO-owned wallets going forward, as gOHM in the contract is considered user funds + ## 5.0.0 (2023-10-11) - Improve indexing performance by using Bytes instead of String for entity ids diff --git a/subgraphs/ethereum/src/utils/Constants.ts b/subgraphs/ethereum/src/utils/Constants.ts index 717f0b60..6effc23f 100644 --- a/subgraphs/ethereum/src/utils/Constants.ts +++ b/subgraphs/ethereum/src/utils/Constants.ts @@ -2,7 +2,7 @@ import { Address, BigDecimal, BigInt, log } from "@graphprotocol/graph-ts"; import { TokenCategoryPOL, TokenCategoryStable, TokenCategoryVolatile, TokenDefinition } from "../../../shared/src/contracts/TokenDefinition"; import { LendingMarketDeployment } from "../../../shared/src/utils/LendingMarketDeployment"; -import { AAVE_ALLOCATOR, AAVE_ALLOCATOR_V2, AURA_ALLOCATOR, AURA_ALLOCATOR_V2, BALANCER_ALLOCATOR, BONDS_DEPOSIT, BONDS_INVERSE_DEPOSIT, CONVEX_ALLOCATOR1, CONVEX_ALLOCATOR2, CONVEX_ALLOCATOR3, CONVEX_CVX_ALLOCATOR, CONVEX_CVX_VL_ALLOCATOR, CONVEX_STAKING_PROXY_FRAXBP, CONVEX_STAKING_PROXY_OHM_FRAXBP, COOLER_LOANS_CLEARINGHOUSE_V1, COOLER_LOANS_CLEARINGHOUSE_V1_1, CROSS_CHAIN_ARBITRUM, CROSS_CHAIN_FANTOM, CROSS_CHAIN_POLYGON, DAO_WALLET, DAO_WORKING_CAPITAL, LUSD_ALLOCATOR, MAKER_DSR_ALLOCATOR, MAKER_DSR_ALLOCATOR_PROXY, MYSO_LENDING, OLYMPUS_ASSOCIATION_WALLET, OTC_ESCROW, RARI_ALLOCATOR, TREASURY_ADDRESS_V1, TREASURY_ADDRESS_V2, TREASURY_ADDRESS_V3, TRSRY, VEFXS_ALLOCATOR, VENDOR_LENDING } from "../../../shared/src/Wallets"; +import { AAVE_ALLOCATOR, AAVE_ALLOCATOR_V2, AURA_ALLOCATOR, AURA_ALLOCATOR_V2, BALANCER_ALLOCATOR, BONDS_DEPOSIT, BONDS_INVERSE_DEPOSIT, CONVEX_ALLOCATOR1, CONVEX_ALLOCATOR2, CONVEX_ALLOCATOR3, CONVEX_CVX_ALLOCATOR, CONVEX_CVX_VL_ALLOCATOR, CONVEX_STAKING_PROXY_FRAXBP, CONVEX_STAKING_PROXY_OHM_FRAXBP, COOLER_LOANS_CLEARINGHOUSE_V1, COOLER_LOANS_CLEARINGHOUSE_V1_1, CROSS_CHAIN_ARBITRUM, CROSS_CHAIN_FANTOM, CROSS_CHAIN_POLYGON, DAO_WALLET, DAO_WORKING_CAPITAL, LUSD_ALLOCATOR, MAKER_DSR_ALLOCATOR, MAKER_DSR_ALLOCATOR_PROXY, MYSO_LENDING, OLYMPUS_ASSOCIATION_WALLET, OTC_ESCROW, RARI_ALLOCATOR, TREASURY_ADDRESS_V1, TREASURY_ADDRESS_V2, TREASURY_ADDRESS_V3, TRSRY, TRSRY_V1_1, VEFXS_ALLOCATOR, VENDOR_LENDING } from "../../../shared/src/Wallets"; import { PairHandler, PairHandlerTypes } from "./PairHandler"; export const BLOCKCHAIN = "Ethereum"; @@ -19,10 +19,10 @@ export const OHMETHLPBOND_TOKEN = "OHM-WETH"; /** * Holds OHM V1, wsOHM (V1) and gOHM - * + * * Any V1 assets in this contract were previously external to the protocol, * and should NOT be counted as protocol assets. - * + * * Any gOHM in this contract has been pre-minted * for migration from V1 assets, and should NOT be counted as protocol assets. */ @@ -126,12 +126,12 @@ export const SILO_ADDRESS = "0xb2374f84b3cEeFF6492943Df613C9BcF45322a0c".toLower /** * Defines the contract addresses that belong to the protocol & DAO treasuries. - * + * * This is normally deducted from total supply to determine circulating supply. - * + * * The following are not included: * - Myso and Vendor Finance: the deployed amounts are hard-coded. - * - Migration Contract: the migration offset is used to indicate the protocol-owned OHM. + * - Migration Contract: the migration offset is used to indicate the protocol-owned OHM. * Additionally, the OHM and gOHM in the migration contract is pre-minted for v1 -> v2 migrations, * and is not owned by the protocol or DAO. * - Olympus Association: not considered part of the protocol or DAO treasuries. @@ -311,7 +311,7 @@ const ERC4626_SDAI = "0x83F20F44975D03b1b09e64809B757c47f942BEeA".toLowerCase(); /** * Mapping between the contract address of an ERC4626 token and the TokenDefinition. - * + * * A price lookup path must be defined for the underlying token within `LIQUIDITY_POOL_TOKEN_LOOKUP`. */ export const ERC4626_TOKENS = new Map(); @@ -319,7 +319,7 @@ ERC4626_TOKENS.set(ERC4626_SDAI, new TokenDefinition(ERC4626_SDAI, TokenCategory /** * Mapping between the non-staked token and the token staked in Convex. - * + * * The staked token should NOT be listed in {ERC20_TOKENS}. */ const CONVEX_STAKED_TOKENS = new Map(); @@ -364,7 +364,7 @@ export const FRAX_LOCKING_CONTRACTS = [ /** * Mapping between the non-staked token and the token staked in Frax. - * + * * The staked token should NOT be listed in {ERC20_TOKENS}. */ const FRAX_STAKED_TOKENS = new Map(); @@ -436,8 +436,8 @@ UNSTAKED_TOKEN_MAPPING.set(ERC20_FXS_VE, ERC20_FXS); /** * Often, staked/locked tokens have the same price as the original token. This * provides the address of the unstaked token. - * - * @param contractAddress + * + * @param contractAddress * @returns address of the unstaked token, or the original token address if not found */ export const getUnstakedToken = (contractAddress: string): string => { @@ -774,10 +774,10 @@ VENDOR_DEPLOYMENTS.set(ERC20_DAI, [ /** * Returns Vendor Finance deployments for the given contract address. - * + * * The details of the deployment are manually recorded, as the deposited principal (e.g. DAI) - * is what is recognised until a default takes place - irrespective of the actual balance of - * DAI and gOHM in the contract. + * is what is recognised until a default takes place - irrespective of the actual balance of + * DAI and gOHM in the contract. */ export function getVendorDeployments(contractAddress: string): LendingMarketDeployment[] { const contractAddressLower = contractAddress.toLowerCase(); @@ -795,10 +795,10 @@ MYSO_DEPLOYMENTS.set(ERC20_DAI.toLowerCase(), [ /** * Returns Myso Finance deployments for the given contract address. - * + * * The details of the deployment are manually recorded, as the deposited principal (e.g. DAI) - * is what is recognised until a default takes place - irrespective of the actual balance of - * DAI and gOHM in the contract. + * is what is recognised until a default takes place - irrespective of the actual balance of + * DAI and gOHM in the contract. */ export function getMysoDeployments(contractAddress: string): LendingMarketDeployment[] { const contractAddressLower = contractAddress.toLowerCase(); @@ -1108,6 +1108,7 @@ CONTRACT_NAME_MAP.set(TREASURY_ADDRESS_V1, "Treasury Wallet V1"); CONTRACT_NAME_MAP.set(TREASURY_ADDRESS_V2, "Treasury Wallet V2"); CONTRACT_NAME_MAP.set(TREASURY_ADDRESS_V3, "Treasury Wallet V3"); CONTRACT_NAME_MAP.set(TRSRY, "Bophades Treasury"); +CONTRACT_NAME_MAP.set(TRSRY_V1_1, "Bophades Treasury v1.1"); CONTRACT_NAME_MAP.set(VEFXS_ALLOCATOR, "VeFXS Allocator"); CONTRACT_NAME_MAP.set(VENDOR_LENDING, "Vendor Finance"); diff --git a/subgraphs/ethereum/src/utils/OhmCalculations.ts b/subgraphs/ethereum/src/utils/OhmCalculations.ts index e9c19ff4..6243a767 100644 --- a/subgraphs/ethereum/src/utils/OhmCalculations.ts +++ b/subgraphs/ethereum/src/utils/OhmCalculations.ts @@ -43,7 +43,6 @@ import { SILO_DEPLOYMENTS, } from "./Constants"; import { - getERC20, getERC20DecimalBalance, getSOlympusERC20, getSOlympusERC20V2, @@ -59,6 +58,14 @@ import { ERC20 } from "../../generated/ProtocolMetrics/ERC20"; const MIGRATION_OFFSET_STARTING_BLOCK = "14381564"; const MIGRATION_OFFSET = "2013"; +/** + * The block from which the bond depository was removed + * from the definition of protocol- and DAO-owned wallets. + * This results in any balances being considered part of circulating supply. + * This is accurate, as gOHM in the depository is considered user funds. + */ +const BOND_DEPOSITORY_BLOCK = "19070000"; + /** * The block from which the wallet of the Olympus Association * was removed from the definition of protocol- and DAO-owned wallets. @@ -505,6 +512,11 @@ export function getTreasuryOHMRecords(timestamp: BigInt, blockNumber: BigInt): T */ const wallets = new Array(); for (let i = 0; i < CIRCULATING_SUPPLY_WALLETS.length; i++) { + // Skip the Bond Depository wallet if after the milestone + if (blockNumber.gt(BigInt.fromString(BOND_DEPOSITORY_BLOCK))) { + continue; + } + wallets.push(CIRCULATING_SUPPLY_WALLETS[i]); } diff --git a/subgraphs/ethereum/src/utils/ProtocolAddresses.ts b/subgraphs/ethereum/src/utils/ProtocolAddresses.ts index 32dd8b49..97ed9f16 100644 --- a/subgraphs/ethereum/src/utils/ProtocolAddresses.ts +++ b/subgraphs/ethereum/src/utils/ProtocolAddresses.ts @@ -28,6 +28,7 @@ export const OLYMPUS_ASSOCIATION_WALLET = "0x4c71db02aeeb336cbd8f3d2cc866911f6e2 export const COOLER_LOANS_CLEARINGHOUSE = "0xD6A6E8d9e82534bD65821142fcCd91ec9cF31880".toLowerCase(); export const TRSRY = "0xa8687A15D4BE32CC8F0a8a7B9704a4C3993D9613".toLowerCase(); +export const TRSRY_V1_1 = "0xea1560F36F71a2F54deFA75ed9EaA15E8655bE22".toLowerCase(); export const OTC_ESCROW = "0xe3312c3f1ab30878d9686452f7205ebe11e965eb".toLowerCase(); export const MYSO_LENDING = "0xb339953fc028b9998775c00594a74dd1488ee2c6".toLowerCase(); @@ -67,7 +68,7 @@ export const CONVEX_ALLOCATORS = [ /** * This set of wallet addresses is common across many tokens, * and can be used for balance lookups. - * + * * Myso and Vendor Finance contracts are NOT included in here, as the deployed amounts are hard-coded. */ export const PROTOCOL_ADDRESSES = [ diff --git a/subgraphs/shared/src/Wallets.ts b/subgraphs/shared/src/Wallets.ts index 324c175b..44e09437 100644 --- a/subgraphs/shared/src/Wallets.ts +++ b/subgraphs/shared/src/Wallets.ts @@ -50,6 +50,7 @@ export const COOLER_LOANS_CLEARINGHOUSES = [ ]; export const TRSRY = "0xa8687A15D4BE32CC8F0a8a7B9704a4C3993D9613".toLowerCase(); +export const TRSRY_V1_1 = "0xea1560F36F71a2F54deFA75ed9EaA15E8655bE22".toLowerCase(); export const OTC_ESCROW = "0xe3312c3f1ab30878d9686452f7205ebe11e965eb".toLowerCase(); export const MYSO_LENDING = "0xb339953fc028b9998775c00594a74dd1488ee2c6".toLowerCase(); @@ -58,7 +59,7 @@ export const VENDOR_LENDING = "0x83234a159dbd60a32457df158fafcbdf3d1ccc08".toLow /** * This set of wallet addresses is common across many tokens, * and can be used for balance lookups. - * + * * Myso and Vendor Finance contracts are NOT included in here, as the deployed amounts are hard-coded. */ export const WALLET_ADDRESSES = [ From 70525b78af53e256297e6aaf212aa480fe2b6493 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 26 Jan 2024 08:19:41 +0000 Subject: [PATCH 70/81] Add deployment links --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 912139d6..f08ac525 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,11 @@ Gathers data from bonds, liquidity and Olympus treasury. Used in the [Olympus Treasury Dashboard](https://app.olympusdao.finance/). -Deployed at +Deployed at: + +- [https://thegraph.com/explorer/subgraphs/7jeChfyUTWRyp2JxPGuuzxvGt3fDKMkC9rLjm7sfLcNp?view=Overview&chain=arbitrum-one](Ethereum mainnet) +- [https://thegraph.com/explorer/subgraphs/aF7zBXagiSjwwM1yAUiyrWFJDhh5RLpVn2nuvVbKwDw?view=Overview&chain=arbitrum-one](Polygon) +- [https://thegraph.com/explorer/subgraphs/8Zxb1kVv9ZBChHXEPSgtC5u5gjCijMn5k8ErpzRYWNgH?view=Overview&chain=arbitrum-one](Arbitrum) ## Initial Setup From f59281324d9a5415652851814564fc8186fe3c05 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 26 Jan 2024 08:21:19 +0000 Subject: [PATCH 71/81] Version bump --- subgraphs/ethereum/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index 40449c0a..d30a7b0b 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -2,5 +2,5 @@ "id": "QmWe5DKxZ2g8V5tr6rLskxSkwBD6x6deZFT7XHoMoB4g5v", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "5.0.0" + "version": "5.1.0" } \ No newline at end of file From 09c8d5b40cf7127c7023fe4aad79436200e69c21 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 26 Jan 2024 08:21:23 +0000 Subject: [PATCH 72/81] Grafting --- subgraphs/ethereum/CHANGELOG.md | 1 + subgraphs/ethereum/subgraph.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/subgraphs/ethereum/CHANGELOG.md b/subgraphs/ethereum/CHANGELOG.md index a8b7926a..253e1cdb 100644 --- a/subgraphs/ethereum/CHANGELOG.md +++ b/subgraphs/ethereum/CHANGELOG.md @@ -5,6 +5,7 @@ - Adds TRSRY v1.1 - Adds support for recognising OHM burnt in the Bond Manager - Removes the Bond Depository from protocol- and DAO-owned wallets going forward, as gOHM in the contract is considered user funds +- Grafted from 2024-01-20 ## 5.0.0 (2023-10-11) diff --git a/subgraphs/ethereum/subgraph.yaml b/subgraphs/ethereum/subgraph.yaml index 76e2a565..7be5fcac 100644 --- a/subgraphs/ethereum/subgraph.yaml +++ b/subgraphs/ethereum/subgraph.yaml @@ -1,11 +1,11 @@ specVersion: 0.0.8 description: Olympus Protocol Metrics Subgraph repository: https://github.com/OlympusDAO/olympus-protocol-metrics-subgraph -# features: -# - grafting -# graft: -# base: QmSwwBfAoWJLHQeSTagFnkibnkrjeprxcQpXAHk6AVrysA -# block: 18185779 # Clearinghouse deployment +features: + - grafting +graft: + base: QmUX8d1VHoBTPKf6z4anNt2y8ZSgFbeTqXN52LJ1q8FF5N + block: 19050000 # 2024-01-20 schema: file: ../../schema.graphql dataSources: From b217bbfe8a1dc2fdcb3891ddb3ebd52e3882cdad Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 26 Jan 2024 08:41:51 +0000 Subject: [PATCH 73/81] Adjust grafting. Bump deployment. --- subgraphs/ethereum/config.json | 2 +- subgraphs/ethereum/subgraph.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index d30a7b0b..e5e50435 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,5 +1,5 @@ { - "id": "QmWe5DKxZ2g8V5tr6rLskxSkwBD6x6deZFT7XHoMoB4g5v", + "id": "QmXTbGWF6McFFWYezbCWYn9frV8Ex9AFactQvMFdLWF8mA", "org": "olympusdao", "name": "olympus-protocol-metrics", "version": "5.1.0" diff --git a/subgraphs/ethereum/subgraph.yaml b/subgraphs/ethereum/subgraph.yaml index 7be5fcac..5f061d00 100644 --- a/subgraphs/ethereum/subgraph.yaml +++ b/subgraphs/ethereum/subgraph.yaml @@ -4,7 +4,7 @@ repository: https://github.com/OlympusDAO/olympus-protocol-metrics-subgraph features: - grafting graft: - base: QmUX8d1VHoBTPKf6z4anNt2y8ZSgFbeTqXN52LJ1q8FF5N + base: QmbucBqomBG2qDfizVV1cMGDudCLvW2h9KWHeD6YS6Bk7L block: 19050000 # 2024-01-20 schema: file: ../../schema.graphql From a892374131ac0d396eccec8f99e0a33e4c346049 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 26 Jan 2024 08:45:16 +0000 Subject: [PATCH 74/81] New deployment with changes from master. --- subgraphs/ethereum/CHANGELOG.md | 2 +- subgraphs/ethereum/config.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/subgraphs/ethereum/CHANGELOG.md b/subgraphs/ethereum/CHANGELOG.md index 9f096b0a..d2706f23 100644 --- a/subgraphs/ethereum/CHANGELOG.md +++ b/subgraphs/ethereum/CHANGELOG.md @@ -1,6 +1,6 @@ # Subgraph Changelog -## 5.1.0 (2024-01-26) +## 5.1.1 (2024-01-26) - Adds TRSRY v1.1 - Adds support for recognising OHM burnt in the Bond Manager diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index e5e50435..2267018d 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmXTbGWF6McFFWYezbCWYn9frV8Ex9AFactQvMFdLWF8mA", + "id": "QmZe2TQrKnQKBuYqzs5hgobz8k1GKN39wcHG57BdeSDC4F", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "5.1.0" + "version": "5.1.1" } \ No newline at end of file From 10659e9f78436084d9ef7de19e112b83e83a85af Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 26 Jan 2024 08:47:07 +0000 Subject: [PATCH 75/81] Bump node version in GitHub CI --- .github/workflows/query.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/query.yml b/.github/workflows/query.yml index b3bddd47..a101212a 100644 --- a/.github/workflows/query.yml +++ b/.github/workflows/query.yml @@ -17,7 +17,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: "16" + node-version: "18" cache: "yarn" - name: Install run: | From 3aa3b693e343dbb13698ac094bc0770de24fee3d Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 26 Jan 2024 10:06:19 +0000 Subject: [PATCH 76/81] Fix bug with bond depository exclusion --- subgraphs/ethereum/config.json | 2 +- subgraphs/ethereum/src/utils/OhmCalculations.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index 2267018d..f7c11585 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -2,5 +2,5 @@ "id": "QmZe2TQrKnQKBuYqzs5hgobz8k1GKN39wcHG57BdeSDC4F", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "5.1.1" + "version": "5.1.2" } \ No newline at end of file diff --git a/subgraphs/ethereum/src/utils/OhmCalculations.ts b/subgraphs/ethereum/src/utils/OhmCalculations.ts index 6243a767..e2381965 100644 --- a/subgraphs/ethereum/src/utils/OhmCalculations.ts +++ b/subgraphs/ethereum/src/utils/OhmCalculations.ts @@ -54,6 +54,7 @@ import { getUniswapV3OhmSupply } from "../liquidity/LiquidityUniswapV3"; import { getSiloSupply } from "./Silo"; import { wsOHM } from "../../generated/ProtocolMetrics/wsOHM"; import { ERC20 } from "../../generated/ProtocolMetrics/ERC20"; +import { BONDS_DEPOSIT } from "./ProtocolAddresses"; const MIGRATION_OFFSET_STARTING_BLOCK = "14381564"; const MIGRATION_OFFSET = "2013"; @@ -513,7 +514,10 @@ export function getTreasuryOHMRecords(timestamp: BigInt, blockNumber: BigInt): T const wallets = new Array(); for (let i = 0; i < CIRCULATING_SUPPLY_WALLETS.length; i++) { // Skip the Bond Depository wallet if after the milestone - if (blockNumber.gt(BigInt.fromString(BOND_DEPOSITORY_BLOCK))) { + if (blockNumber.gt(BigInt.fromString(BOND_DEPOSITORY_BLOCK)) + && + CIRCULATING_SUPPLY_WALLETS[i] == BONDS_DEPOSIT + ) { continue; } From d3ecfe7948e437ed2027bd6a7317b2c0c4f75067 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 26 Jan 2024 10:07:08 +0000 Subject: [PATCH 77/81] Fix node version again --- .github/workflows/query.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/query.yml b/.github/workflows/query.yml index a101212a..f40d3629 100644 --- a/.github/workflows/query.yml +++ b/.github/workflows/query.yml @@ -52,7 +52,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: "16" + node-version: "18" cache: "yarn" - name: Install run: | @@ -89,7 +89,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: "16" + node-version: "18" cache: "yarn" # Looks for an existing comment, so it can be updated - name: Find Existing Comment From add64fed34160482c9f26a8aa76df0f623cbb27e Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 26 Jan 2024 10:07:31 +0000 Subject: [PATCH 78/81] Deployment id --- subgraphs/ethereum/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index f7c11585..40c2afad 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,5 +1,5 @@ { - "id": "QmZe2TQrKnQKBuYqzs5hgobz8k1GKN39wcHG57BdeSDC4F", + "id": "QmPfxmh6EvwtFRJDo7isnFdZuwXmrS7HMrebNTt6pfkJz1", "org": "olympusdao", "name": "olympus-protocol-metrics", "version": "5.1.2" From 21928cf93a9e7d5270af109e752059263a4168dc Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 26 Jan 2024 10:32:03 +0000 Subject: [PATCH 79/81] Deployment bump with new grafting base. --- subgraphs/ethereum/CHANGELOG.md | 4 ++-- subgraphs/ethereum/config.json | 4 ++-- subgraphs/ethereum/subgraph.yaml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/subgraphs/ethereum/CHANGELOG.md b/subgraphs/ethereum/CHANGELOG.md index d2706f23..6fb246c4 100644 --- a/subgraphs/ethereum/CHANGELOG.md +++ b/subgraphs/ethereum/CHANGELOG.md @@ -1,11 +1,11 @@ # Subgraph Changelog -## 5.1.1 (2024-01-26) +## 5.1.3 (2024-01-26) - Adds TRSRY v1.1 - Adds support for recognising OHM burnt in the Bond Manager - Removes the Bond Depository from protocol- and DAO-owned wallets going forward, as gOHM in the contract is considered user funds -- Grafted from 2024-01-20 +- Grafted on top of 5.0.4 ## 5.0.5 (2023-10-17) diff --git a/subgraphs/ethereum/config.json b/subgraphs/ethereum/config.json index 40c2afad..17860fa3 100644 --- a/subgraphs/ethereum/config.json +++ b/subgraphs/ethereum/config.json @@ -1,6 +1,6 @@ { - "id": "QmPfxmh6EvwtFRJDo7isnFdZuwXmrS7HMrebNTt6pfkJz1", + "id": "Qmd7wgnNTijSpV1JDM3yUE8Exy4EGG1jw3yyQKdTKvYiig", "org": "olympusdao", "name": "olympus-protocol-metrics", - "version": "5.1.2" + "version": "5.1.3" } \ No newline at end of file diff --git a/subgraphs/ethereum/subgraph.yaml b/subgraphs/ethereum/subgraph.yaml index 2bc7dbe0..39079c03 100644 --- a/subgraphs/ethereum/subgraph.yaml +++ b/subgraphs/ethereum/subgraph.yaml @@ -4,8 +4,8 @@ repository: https://github.com/OlympusDAO/olympus-protocol-metrics-subgraph features: - grafting graft: - base: QmbucBqomBG2qDfizVV1cMGDudCLvW2h9KWHeD6YS6Bk7L - block: 19050000 # 2024-01-20 + base: QmUX8d1VHoBTPKf6z4anNt2y8ZSgFbeTqXN52LJ1q8FF5N # 5.0.4 + block: 15275000 # Previous failure schema: file: ../../schema.graphql dataSources: From 43e7e21e06a4caeac5a57704f6c1616190090282 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 29 Jan 2024 10:28:08 +0400 Subject: [PATCH 80/81] Correct deployment URLs --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f08ac525..5cde29c7 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,10 @@ Used in the [Olympus Treasury Dashboard](https://app.olympusdao.finance/). Deployed at: -- [https://thegraph.com/explorer/subgraphs/7jeChfyUTWRyp2JxPGuuzxvGt3fDKMkC9rLjm7sfLcNp?view=Overview&chain=arbitrum-one](Ethereum mainnet) -- [https://thegraph.com/explorer/subgraphs/aF7zBXagiSjwwM1yAUiyrWFJDhh5RLpVn2nuvVbKwDw?view=Overview&chain=arbitrum-one](Polygon) -- [https://thegraph.com/explorer/subgraphs/8Zxb1kVv9ZBChHXEPSgtC5u5gjCijMn5k8ErpzRYWNgH?view=Overview&chain=arbitrum-one](Arbitrum) +- [Ethereum mainnet](https://thegraph.com/explorer/subgraphs/7jeChfyUTWRyp2JxPGuuzxvGt3fDKMkC9rLjm7sfLcNp?view=Overview&chain=arbitrum-one) +- [Polygon](https://thegraph.com/explorer/subgraphs/aF7zBXagiSjwwM1yAUiyrWFJDhh5RLpVn2nuvVbKwDw?view=Overview&chain=arbitrum-one) +- [Arbitrum](https://thegraph.com/explorer/subgraphs/8Zxb1kVv9ZBChHXEPSgtC5u5gjCijMn5k8ErpzRYWNgH?view=Overview&chain=arbitrum-one) +- [Fantom](https://thegraph.com/hosted-service/subgraph/olympusdao/protocol-metrics-polygon) ## Initial Setup From 85b31964632604c97464ae00ed7823e30a8c55a6 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 6 Jun 2024 20:13:36 +0400 Subject: [PATCH 81/81] Bump version in changelog --- subgraphs/fantom/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subgraphs/fantom/CHANGELOG.md b/subgraphs/fantom/CHANGELOG.md index 7bbe5ce2..12726ac8 100644 --- a/subgraphs/fantom/CHANGELOG.md +++ b/subgraphs/fantom/CHANGELOG.md @@ -1,6 +1,6 @@ # protocol-metrics-fantom -## v1.0.1 (2023-10-09) +## v1.0.4 (2023-10-09) - Shift to polling block handler - Deploy on Graph Protocol Decentralized Network