From a5abbbaf87030f4324c94267117584f8f597e980 Mon Sep 17 00:00:00 2001 From: alphak3y Date: Fri, 28 Jan 2022 19:49:39 -0600 Subject: [PATCH 1/6] update api versioning; 0.0.5 fixes --- .gitmodules | 2 ++ ethereum.subgraph.template.yaml | 38 ++++++++++---------- externals/protocol-v2 | 2 +- matic.subgraph.template.yaml | 26 +++++++------- package.json | 4 +-- src/mapping/oracle-anchor.ts | 15 ++++++-- src/mapping/proxy-price-provider/ethereum.ts | 32 +++++++++++++---- 7 files changed, 75 insertions(+), 44 deletions(-) diff --git a/.gitmodules b/.gitmodules index 42a4bd6..d1364c1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,8 @@ [submodule "externals/aToken"] path = externals/aToken url = https://github.com/aave/protocol-v2 + branch = fat-deployment [submodule "externals/protocol-v2"] path = externals/protocol-v2 url = https://github.com/aave/protocol-v2.git + branch = fat-deployment diff --git a/ethereum.subgraph.template.yaml b/ethereum.subgraph.template.yaml index fba9319..2cd0519 100644 --- a/ethereum.subgraph.template.yaml +++ b/ethereum.subgraph.template.yaml @@ -1,4 +1,4 @@ -specVersion: 0.0.2 +specVersion: 0.0.4 description: Protocol v2 subgraph repository: https://github.com/aave/protocol-v2-subgraph schema: @@ -16,7 +16,7 @@ dataSources: abi: AaveOracle mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - ChainlinkAggregator @@ -51,7 +51,7 @@ dataSources: abi: OracleAnchor mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - OracleSystemMigrated @@ -82,7 +82,7 @@ dataSources: abi: ChainlinkSourcesRegistry mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - PriceOracle @@ -109,7 +109,7 @@ dataSources: abi: ChainlinkENSResolver mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - ENS @@ -136,7 +136,7 @@ dataSources: startBlock: {{LendingPoolAddressesProviderRegistryStartBlock}} mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - LendingPoolAddressesProvider @@ -161,7 +161,7 @@ dataSources: startBlock: {{UniswapLiquiditySwapAdapterStartBlock}} mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - UniswapLiquiditySwapAdapter @@ -181,7 +181,7 @@ dataSources: startBlock: {{UniswapRepayAdapterStartBlock}} mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - UniswapRepayAdapter @@ -206,7 +206,7 @@ templates: abi: AaveIncentivesController mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - IncentivesController @@ -241,7 +241,7 @@ templates: abi: GenericOracleI mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - PriceOracle @@ -267,7 +267,7 @@ templates: abi: IExtendedPriceAggregator mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - PriceOracleReserve @@ -291,7 +291,7 @@ templates: abi: AToken mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - AToken @@ -322,7 +322,7 @@ templates: abi: StableDebtToken mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - StableDebtToken @@ -353,7 +353,7 @@ templates: abi: VariableDebtToken mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - StableDebtToken @@ -388,7 +388,7 @@ templates: abi: LendingPoolAddressesProvider mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - LendingPoolAddressesProvider @@ -427,7 +427,7 @@ templates: abi: LendingPoolConfigurator mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - Reserve @@ -481,7 +481,7 @@ templates: abi: LendingPool mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - ReserveOperation @@ -531,7 +531,7 @@ templates: # abi: IUniswapExchange # mapping: # kind: ethereum/events - # apiVersion: 0.0.4 + # apiVersion: 0.0.5 # language: wasm/assemblyscript # entities: # - PriceOracleAsset @@ -553,7 +553,7 @@ templates: # abi: IBalancerPool # mapping: # kind: ethereum/events - # apiVersion: 0.0.4 + # apiVersion: 0.0.5 # language: wasm/assemblyscript # entities: # - PriceOracleAsset diff --git a/externals/protocol-v2 b/externals/protocol-v2 index 2708551..554a2ed 160000 --- a/externals/protocol-v2 +++ b/externals/protocol-v2 @@ -1 +1 @@ -Subproject commit 2708551bcf3afb28ee9798ccf7f3027ea0ecec10 +Subproject commit 554a2ed7ca4b3565e2ceaea0c454e5a70b3a2b41 diff --git a/matic.subgraph.template.yaml b/matic.subgraph.template.yaml index 624ddd2..6599612 100644 --- a/matic.subgraph.template.yaml +++ b/matic.subgraph.template.yaml @@ -1,4 +1,4 @@ -specVersion: 0.0.2 +specVersion: 0.0.4 description: Protocol v2 subgraph repository: https://github.com/aave/protocol-v2-subgraph schema: @@ -16,7 +16,7 @@ dataSources: abi: AaveOracle mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - ChainlinkAggregator @@ -51,7 +51,7 @@ dataSources: startBlock: {{LendingPoolAddressesProviderRegistryStartBlock}} mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - LendingPoolAddressesProvider @@ -76,7 +76,7 @@ dataSources: abi: ChainlinkSourcesRegistry mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - PriceOracle @@ -109,7 +109,7 @@ templates: abi: AaveIncentivesController mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - IncentivesController @@ -146,7 +146,7 @@ templates: abi: GenericOracleI mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - PriceOracle @@ -170,7 +170,7 @@ templates: abi: IExtendedPriceAggregator mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - PriceOracleReserve @@ -194,7 +194,7 @@ templates: abi: AToken mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - AToken @@ -225,7 +225,7 @@ templates: abi: StableDebtToken mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - StableDebtToken @@ -256,7 +256,7 @@ templates: abi: VariableDebtToken mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - StableDebtToken @@ -291,7 +291,7 @@ templates: abi: LendingPoolAddressesProvider mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - LendingPoolAddressesProvider @@ -330,7 +330,7 @@ templates: abi: LendingPoolConfigurator mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - Reserve @@ -384,7 +384,7 @@ templates: abi: LendingPool mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript entities: - ReserveOperation diff --git a/package.json b/package.json index d6f4ec4..69384c8 100644 --- a/package.json +++ b/package.json @@ -57,8 +57,8 @@ ], "license": "MIT", "dependencies": { - "@graphprotocol/graph-cli": "^0.18.0", - "@graphprotocol/graph-ts": "^0.18.1", + "@graphprotocol/graph-cli": "^0.23.1", + "@graphprotocol/graph-ts": "^0.23.1", "env-cmd": "^10.1.0", "mustache": "^3.1.0", "typescript": "3.5.3", diff --git a/src/mapping/oracle-anchor.ts b/src/mapping/oracle-anchor.ts index c91b0f2..60759e7 100644 --- a/src/mapping/oracle-anchor.ts +++ b/src/mapping/oracle-anchor.ts @@ -109,9 +109,18 @@ export function priceFeedUpdated( priceOracle.tokensWithFallback.includes(sAssetAddress) && !priceOracleAsset.isFallbackRequired ) { - priceOracle.tokensWithFallback = priceOracle.tokensWithFallback.filter( - token => token != assetAddress.toHexString() - ); + // priceOracle.tokensWithFallback = priceOracle.tokensWithFallback.filter( + // token => token != assetAddress.toHexString() + // ); + let tokensWithFallback = new Array(); + + for(let i = 0; i < priceOracle.tokensWithFallback.length; i++){ + if(priceOracle.tokensWithFallback[i] != assetAddress.toHexString()){ + tokensWithFallback.push(priceOracle.tokensWithFallback[i]) + } + } + + priceOracle.tokensWithFallback = tokensWithFallback } if ( diff --git a/src/mapping/proxy-price-provider/ethereum.ts b/src/mapping/proxy-price-provider/ethereum.ts index 3d93caa..721e3ef 100644 --- a/src/mapping/proxy-price-provider/ethereum.ts +++ b/src/mapping/proxy-price-provider/ethereum.ts @@ -196,9 +196,19 @@ export function priceFeedUpdated( priceOracle.tokensWithFallback.includes(sAssetAddress) && !priceOracleAsset.isFallbackRequired ) { - priceOracle.tokensWithFallback = priceOracle.tokensWithFallback.filter( - token => token != assetAddress.toHexString() - ); + // priceOracle.tokensWithFallback = priceOracle.tokensWithFallback.filter( + // token => token != assetAddress.toHexString() + // ); + + let tokensWithFallback = new Array(); + + for(let i = 0; i < priceOracle.tokensWithFallback.length; i++){ + if(priceOracle.tokensWithFallback[i] != assetAddress.toHexString()){ + tokensWithFallback.push(priceOracle.tokensWithFallback[i]) + } + } + + priceOracle.tokensWithFallback = tokensWithFallback } if ( @@ -378,9 +388,19 @@ function chainLinkAggregatorUpdated( priceOracle.tokensWithFallback.includes(sAssetAddress) && !priceOracleAsset.isFallbackRequired ) { - priceOracle.tokensWithFallback = priceOracle.tokensWithFallback.filter( - token => token != assetAddress.toHexString() - ); + // priceOracle.tokensWithFallback = priceOracle.tokensWithFallback.filter( + // token => token != assetAddress.toHexString() + // ); + + let tokensWithFallback = new Array(); + + for(let i = 0; i < priceOracle.tokensWithFallback.length; i++){ + if(priceOracle.tokensWithFallback[i] != assetAddress.toHexString()){ + tokensWithFallback.push(priceOracle.tokensWithFallback[i]) + } + } + + priceOracle.tokensWithFallback = tokensWithFallback } if ( From 2936ae7599a4c85fc811dc3ede8bb658b3f72ff2 Mon Sep 17 00:00:00 2001 From: alphak3y Date: Fri, 28 Jan 2022 21:03:42 -0600 Subject: [PATCH 2/6] remove nasty export --- src/mapping/proxy-price-provider/ethereum.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mapping/proxy-price-provider/ethereum.ts b/src/mapping/proxy-price-provider/ethereum.ts index 721e3ef..5cd5fc4 100644 --- a/src/mapping/proxy-price-provider/ethereum.ts +++ b/src/mapping/proxy-price-provider/ethereum.ts @@ -1,4 +1,4 @@ -import { Address, log, ethereum } from '@graphprotocol/graph-ts'; + import { Address, log, ethereum } from '@graphprotocol/graph-ts'; import { AssetSourceUpdated, AaveOracle } from '../../../generated/AaveOracle/AaveOracle'; import { IExtendedPriceAggregator } from '../../../generated/AaveOracle/IExtendedPriceAggregator'; @@ -34,7 +34,6 @@ import { MOCK_USD_ADDRESS } from '../../utils/constants'; import { genericPriceUpdate, usdEthPriceUpdate } from '../../helpers/price-updates'; import { PriceOracle, PriceOracleAsset } from '../../../generated/schema'; import { EACAggregatorProxy } from '../../../generated/AaveOracle/EACAggregatorProxy'; -export { handleFallbackOracleUpdated, handleWethSet } from './proxy-price-provider'; export function priceFeedUpdated( event: ethereum.Event, @@ -416,3 +415,5 @@ function chainLinkAggregatorUpdated( genericPriceUpdate(priceOracleAsset, priceFromProxy, event); } } + + From aa26f8768035267450776b652a5bf325bd6b2637 Mon Sep 17 00:00:00 2001 From: alphak3y Date: Fri, 28 Jan 2022 21:19:02 -0600 Subject: [PATCH 3/6] fix null checks --- src/mapping/address-provider-registry.ts | 6 ++-- .../incentives-controller.ts | 28 ++++++++++--------- src/mapping/lending-pool/lending-pool.ts | 13 +++++---- src/mapping/tokenization/initialization.ts | 8 ++++-- 4 files changed, 32 insertions(+), 23 deletions(-) diff --git a/src/mapping/address-provider-registry.ts b/src/mapping/address-provider-registry.ts index 1321b76..0303614 100644 --- a/src/mapping/address-provider-registry.ts +++ b/src/mapping/address-provider-registry.ts @@ -24,6 +24,8 @@ export function handleAddressesProviderRegistered(event: AddressesProviderRegist export function handleAddressesProviderUnregistered(event: AddressesProviderUnregistered): void { let pool = Pool.load(event.params.newAddress.toHexString()); - pool.active = false; - pool.save(); + if(pool){ + pool.active = false; + pool.save(); + } } diff --git a/src/mapping/incentives-controller/incentives-controller.ts b/src/mapping/incentives-controller/incentives-controller.ts index 8efb99e..23d3e8c 100644 --- a/src/mapping/incentives-controller/incentives-controller.ts +++ b/src/mapping/incentives-controller/incentives-controller.ts @@ -155,17 +155,18 @@ export function handleUserIndexUpdated(event: UserIndexUpdated): void { let reserve = Reserve.load(reserveId); if (userReserve != null) { - if (asset.toHexString() == reserve.aToken) { - userReserve.aTokenincentivesUserIndex = index; - userReserve.aIncentivesLastUpdateTimestamp = blockTimestamp; - } else if (asset.toHexString() == reserve.vToken) { - userReserve.vTokenincentivesUserIndex = index; - userReserve.vIncentivesLastUpdateTimestamp = blockTimestamp; - } else if (asset.toHexString() == reserve.sToken) { - userReserve.sTokenincentivesUserIndex = index; - userReserve.sIncentivesLastUpdateTimestamp = blockTimestamp; + if(reserve){ + if (asset.toHexString() == reserve.aToken) { + userReserve.aTokenincentivesUserIndex = index; + userReserve.aIncentivesLastUpdateTimestamp = blockTimestamp; + } else if (asset.toHexString() == reserve.vToken) { + userReserve.vTokenincentivesUserIndex = index; + userReserve.vIncentivesLastUpdateTimestamp = blockTimestamp; + } else if (asset.toHexString() == reserve.sToken) { + userReserve.sTokenincentivesUserIndex = index; + userReserve.sIncentivesLastUpdateTimestamp = blockTimestamp; + } } - userReserve.save(); } else { log.warning( @@ -177,7 +178,8 @@ export function handleUserIndexUpdated(event: UserIndexUpdated): void { export function handleDistributionEndUpdated(event: DistributionEndUpdated): void { let iController = IncentivesController.load(event.address.toHexString()); - - iController.emissionEndTimestamp = event.params.ditributionEnd.toI32(); - iController.save(); + if(iController){ + iController.emissionEndTimestamp = event.params.ditributionEnd.toI32(); + iController.save(); + } } diff --git a/src/mapping/lending-pool/lending-pool.ts b/src/mapping/lending-pool/lending-pool.ts index 4b9fbcd..4a9bb5d 100644 --- a/src/mapping/lending-pool/lending-pool.ts +++ b/src/mapping/lending-pool/lending-pool.ts @@ -110,16 +110,19 @@ export function handlePaused(event: Paused): void { let poolId = getPoolByContract(event); let lendingPool = Pool.load(poolId); - lendingPool.paused = true; - lendingPool.save(); + if(lendingPool){ + lendingPool.paused = true; + lendingPool.save(); + } } export function handleUnpaused(event: Unpaused): void { let poolId = getPoolByContract(event); let lendingPool = Pool.load(poolId); - - lendingPool.paused = false; - lendingPool.save(); + if(lendingPool){ + lendingPool.paused = false; + lendingPool.save(); + } } export function handleSwap(event: Swap): void { diff --git a/src/mapping/tokenization/initialization.ts b/src/mapping/tokenization/initialization.ts index 5c7a56c..99d6934 100644 --- a/src/mapping/tokenization/initialization.ts +++ b/src/mapping/tokenization/initialization.ts @@ -59,9 +59,11 @@ function createIncentivesController( let poolAddressProvider = ContractToPoolMapping.load(pool.toHexString()); // save asset pool mapping let mapAssetPool = new MapAssetPool(asset.toHexString()); - mapAssetPool.pool = poolAddressProvider.pool; - mapAssetPool.underlyingAsset = underlyingAsset; - mapAssetPool.save(); + if(poolAddressProvider){ + mapAssetPool.pool = poolAddressProvider.pool; + mapAssetPool.underlyingAsset = underlyingAsset; + mapAssetPool.save(); + } } export function handleATokenInitialized(event: ATokenInitialized): void { From 926ed1c0aa06e32b3bdf89ca9be94ed05b6e3345 Mon Sep 17 00:00:00 2001 From: alphak3y Date: Tue, 12 Apr 2022 14:26:21 -0500 Subject: [PATCH 4/6] resolve conflict --- package.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/package.json b/package.json index caebaa2..41c2758 100644 --- a/package.json +++ b/package.json @@ -54,13 +54,8 @@ ], "license": "MIT", "dependencies": { -<<<<<<< HEAD - "@graphprotocol/graph-cli": "^0.23.1", - "@graphprotocol/graph-ts": "^0.23.1", -======= "@graphprotocol/graph-cli": "0.25.1", "@graphprotocol/graph-ts": "0.24.1", ->>>>>>> upstream/main "env-cmd": "^10.1.0", "mustache": "^3.1.0", "typescript": "3.5.3", From 5cd0ae46350a07b40174c6225036483d0ace30ad Mon Sep 17 00:00:00 2001 From: alphak3y Date: Tue, 12 Apr 2022 14:32:25 -0500 Subject: [PATCH 5/6] resolve conflicts --- src/mapping/lending-pool/lending-pool.ts | 9 --- src/mapping/proxy-price-provider/ethereum.ts | 32 -------- src/mapping/tokenization/initialization.ts | 8 -- templates/ethereum.subgraph.template.yaml | 77 -------------------- templates/matic.subgraph.template.yaml | 53 -------------- 5 files changed, 179 deletions(-) diff --git a/src/mapping/lending-pool/lending-pool.ts b/src/mapping/lending-pool/lending-pool.ts index cd21e2b..7e365b3 100644 --- a/src/mapping/lending-pool/lending-pool.ts +++ b/src/mapping/lending-pool/lending-pool.ts @@ -108,12 +108,7 @@ export function handleBorrow(event: Borrow): void { export function handlePaused(event: Paused): void { let poolId = getPoolByContract(event); let lendingPool = Pool.load(poolId); -<<<<<<< HEAD - - if(lendingPool){ -======= if (lendingPool) { ->>>>>>> upstream/main lendingPool.paused = true; lendingPool.save(); } @@ -122,12 +117,8 @@ export function handlePaused(event: Paused): void { export function handleUnpaused(event: Unpaused): void { let poolId = getPoolByContract(event); let lendingPool = Pool.load(poolId); -<<<<<<< HEAD - if(lendingPool){ -======= if (lendingPool) { ->>>>>>> upstream/main lendingPool.paused = false; lendingPool.save(); } diff --git a/src/mapping/proxy-price-provider/ethereum.ts b/src/mapping/proxy-price-provider/ethereum.ts index dc8ab59..74f07fa 100644 --- a/src/mapping/proxy-price-provider/ethereum.ts +++ b/src/mapping/proxy-price-provider/ethereum.ts @@ -195,21 +195,6 @@ export function priceFeedUpdated( priceOracle.tokensWithFallback.includes(sAssetAddress) && !priceOracleAsset.isFallbackRequired ) { -<<<<<<< HEAD - // priceOracle.tokensWithFallback = priceOracle.tokensWithFallback.filter( - // token => token != assetAddress.toHexString() - // ); - - let tokensWithFallback = new Array(); - - for(let i = 0; i < priceOracle.tokensWithFallback.length; i++){ - if(priceOracle.tokensWithFallback[i] != assetAddress.toHexString()){ - tokensWithFallback.push(priceOracle.tokensWithFallback[i]) - } - } - - priceOracle.tokensWithFallback = tokensWithFallback -======= let tokensWithFallback: string[] = []; for (let i = 0; i < priceOracle.tokensWithFallback.length; i++) { if (priceOracle.tokensWithFallback[i] != sAssetAddress) { @@ -217,7 +202,6 @@ export function priceFeedUpdated( } } priceOracle.tokensWithFallback = tokensWithFallback; ->>>>>>> upstream/main } if ( @@ -397,21 +381,6 @@ function chainLinkAggregatorUpdated( priceOracle.tokensWithFallback.includes(sAssetAddress) && !priceOracleAsset.isFallbackRequired ) { -<<<<<<< HEAD - // priceOracle.tokensWithFallback = priceOracle.tokensWithFallback.filter( - // token => token != assetAddress.toHexString() - // ); - - let tokensWithFallback = new Array(); - - for(let i = 0; i < priceOracle.tokensWithFallback.length; i++){ - if(priceOracle.tokensWithFallback[i] != assetAddress.toHexString()){ - tokensWithFallback.push(priceOracle.tokensWithFallback[i]) - } - } - - priceOracle.tokensWithFallback = tokensWithFallback -======= let tokensWithFallback: string[] = []; for (let i = 0; i < priceOracle.tokensWithFallback.length; i++) { if (priceOracle.tokensWithFallback[i] != sAssetAddress) { @@ -419,7 +388,6 @@ function chainLinkAggregatorUpdated( } } priceOracle.tokensWithFallback = tokensWithFallback; ->>>>>>> upstream/main } if ( diff --git a/src/mapping/tokenization/initialization.ts b/src/mapping/tokenization/initialization.ts index 50ab96c..c2a783e 100644 --- a/src/mapping/tokenization/initialization.ts +++ b/src/mapping/tokenization/initialization.ts @@ -59,19 +59,11 @@ function createIncentivesController( let poolAddressProvider = ContractToPoolMapping.load(pool.toHexString()); // save asset pool mapping let mapAssetPool = new MapAssetPool(asset.toHexString()); -<<<<<<< HEAD - if(poolAddressProvider){ - mapAssetPool.pool = poolAddressProvider.pool; - mapAssetPool.underlyingAsset = underlyingAsset; - mapAssetPool.save(); - } -======= if (poolAddressProvider) { mapAssetPool.pool = poolAddressProvider.pool; } mapAssetPool.underlyingAsset = underlyingAsset; mapAssetPool.save(); ->>>>>>> upstream/main } export function handleATokenInitialized(event: ATokenInitialized): void { diff --git a/templates/ethereum.subgraph.template.yaml b/templates/ethereum.subgraph.template.yaml index 164339d..bc31601 100644 --- a/templates/ethereum.subgraph.template.yaml +++ b/templates/ethereum.subgraph.template.yaml @@ -1,11 +1,6 @@ specVersion: 0.0.4 -<<<<<<< HEAD:ethereum.subgraph.template.yaml -description: Protocol v2 subgraph -repository: https://github.com/aave/protocol-v2-subgraph -======= description: Aave protocol subgraph repository: https://github.com/aave/protocol-subgraphs ->>>>>>> upstream/main:templates/ethereum.subgraph.template.yaml schema: file: ./schema.graphql dataSources: @@ -21,11 +16,7 @@ dataSources: abi: AaveOracle mapping: kind: ethereum/events -<<<<<<< HEAD:ethereum.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/ethereum.subgraph.template.yaml language: wasm/assemblyscript entities: - ChainlinkAggregator @@ -60,11 +51,7 @@ dataSources: abi: OracleAnchor mapping: kind: ethereum/events -<<<<<<< HEAD:ethereum.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/ethereum.subgraph.template.yaml language: wasm/assemblyscript entities: - OracleSystemMigrated @@ -95,11 +82,7 @@ dataSources: abi: ChainlinkSourcesRegistry mapping: kind: ethereum/events -<<<<<<< HEAD:ethereum.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/ethereum.subgraph.template.yaml language: wasm/assemblyscript entities: - PriceOracle @@ -126,11 +109,7 @@ dataSources: abi: ChainlinkENSResolver mapping: kind: ethereum/events -<<<<<<< HEAD:ethereum.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/ethereum.subgraph.template.yaml language: wasm/assemblyscript entities: - ENS @@ -157,11 +136,7 @@ dataSources: startBlock: {{LendingPoolAddressesProviderRegistryStartBlock}} mapping: kind: ethereum/events -<<<<<<< HEAD:ethereum.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/ethereum.subgraph.template.yaml language: wasm/assemblyscript entities: - LendingPoolAddressesProvider @@ -186,11 +161,7 @@ dataSources: startBlock: {{UniswapLiquiditySwapAdapterStartBlock}} mapping: kind: ethereum/events -<<<<<<< HEAD:ethereum.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/ethereum.subgraph.template.yaml language: wasm/assemblyscript entities: - UniswapLiquiditySwapAdapter @@ -210,11 +181,7 @@ dataSources: startBlock: {{UniswapRepayAdapterStartBlock}} mapping: kind: ethereum/events -<<<<<<< HEAD:ethereum.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/ethereum.subgraph.template.yaml language: wasm/assemblyscript entities: - UniswapRepayAdapter @@ -239,11 +206,7 @@ templates: abi: AaveIncentivesController mapping: kind: ethereum/events -<<<<<<< HEAD:ethereum.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/ethereum.subgraph.template.yaml language: wasm/assemblyscript entities: - IncentivesController @@ -278,11 +241,7 @@ templates: abi: GenericOracleI mapping: kind: ethereum/events -<<<<<<< HEAD:ethereum.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/ethereum.subgraph.template.yaml language: wasm/assemblyscript entities: - PriceOracle @@ -308,11 +267,7 @@ templates: abi: IExtendedPriceAggregator mapping: kind: ethereum/events -<<<<<<< HEAD:ethereum.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/ethereum.subgraph.template.yaml language: wasm/assemblyscript entities: - PriceOracleReserve @@ -336,11 +291,7 @@ templates: abi: AToken mapping: kind: ethereum/events -<<<<<<< HEAD:ethereum.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/ethereum.subgraph.template.yaml language: wasm/assemblyscript entities: - AToken @@ -369,11 +320,7 @@ templates: abi: StableDebtToken mapping: kind: ethereum/events -<<<<<<< HEAD:ethereum.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/ethereum.subgraph.template.yaml language: wasm/assemblyscript entities: - StableDebtToken @@ -402,11 +349,7 @@ templates: abi: VariableDebtToken mapping: kind: ethereum/events -<<<<<<< HEAD:ethereum.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/ethereum.subgraph.template.yaml language: wasm/assemblyscript entities: - StableDebtToken @@ -439,11 +382,7 @@ templates: abi: LendingPoolAddressesProvider mapping: kind: ethereum/events -<<<<<<< HEAD:ethereum.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/ethereum.subgraph.template.yaml language: wasm/assemblyscript entities: - LendingPoolAddressesProvider @@ -482,11 +421,7 @@ templates: abi: LendingPoolConfigurator mapping: kind: ethereum/events -<<<<<<< HEAD:ethereum.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/ethereum.subgraph.template.yaml language: wasm/assemblyscript entities: - Reserve @@ -540,11 +475,7 @@ templates: abi: LendingPool mapping: kind: ethereum/events -<<<<<<< HEAD:ethereum.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/ethereum.subgraph.template.yaml language: wasm/assemblyscript entities: - ReserveOperation @@ -594,11 +525,7 @@ templates: # abi: IUniswapExchange # mapping: # kind: ethereum/events -<<<<<<< HEAD:ethereum.subgraph.template.yaml - # apiVersion: 0.0.5 -======= # apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/ethereum.subgraph.template.yaml # language: wasm/assemblyscript # entities: # - PriceOracleAsset @@ -620,11 +547,7 @@ templates: # abi: IBalancerPool # mapping: # kind: ethereum/events -<<<<<<< HEAD:ethereum.subgraph.template.yaml - # apiVersion: 0.0.5 -======= # apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/ethereum.subgraph.template.yaml # language: wasm/assemblyscript # entities: # - PriceOracleAsset diff --git a/templates/matic.subgraph.template.yaml b/templates/matic.subgraph.template.yaml index 525fd47..9e5a7a2 100644 --- a/templates/matic.subgraph.template.yaml +++ b/templates/matic.subgraph.template.yaml @@ -1,11 +1,6 @@ specVersion: 0.0.4 -<<<<<<< HEAD:matic.subgraph.template.yaml -description: Protocol v2 subgraph -repository: https://github.com/aave/protocol-v2-subgraph -======= description: Aave protocol subgraph repository: https://github.com/aave/protocol-subgraphs ->>>>>>> upstream/main:templates/matic.subgraph.template.yaml schema: file: ./schema.graphql dataSources: @@ -21,11 +16,7 @@ dataSources: abi: AaveOracle mapping: kind: ethereum/events -<<<<<<< HEAD:matic.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/matic.subgraph.template.yaml language: wasm/assemblyscript entities: - ChainlinkAggregator @@ -60,11 +51,7 @@ dataSources: startBlock: {{LendingPoolAddressesProviderRegistryStartBlock}} mapping: kind: ethereum/events -<<<<<<< HEAD:matic.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/matic.subgraph.template.yaml language: wasm/assemblyscript entities: - LendingPoolAddressesProvider @@ -89,11 +76,7 @@ dataSources: abi: ChainlinkSourcesRegistry mapping: kind: ethereum/events -<<<<<<< HEAD:matic.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/matic.subgraph.template.yaml language: wasm/assemblyscript entities: - PriceOracle @@ -124,11 +107,7 @@ templates: abi: AaveIncentivesController mapping: kind: ethereum/events -<<<<<<< HEAD:matic.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/matic.subgraph.template.yaml language: wasm/assemblyscript entities: - IncentivesController @@ -165,11 +144,7 @@ templates: abi: GenericOracleI mapping: kind: ethereum/events -<<<<<<< HEAD:matic.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/matic.subgraph.template.yaml language: wasm/assemblyscript entities: - PriceOracle @@ -193,11 +168,7 @@ templates: abi: IExtendedPriceAggregator mapping: kind: ethereum/events -<<<<<<< HEAD:matic.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/matic.subgraph.template.yaml language: wasm/assemblyscript entities: - PriceOracleReserve @@ -221,11 +192,7 @@ templates: abi: AToken mapping: kind: ethereum/events -<<<<<<< HEAD:matic.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/matic.subgraph.template.yaml language: wasm/assemblyscript entities: - AToken @@ -254,11 +221,7 @@ templates: abi: StableDebtToken mapping: kind: ethereum/events -<<<<<<< HEAD:matic.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/matic.subgraph.template.yaml language: wasm/assemblyscript entities: - StableDebtToken @@ -287,11 +250,7 @@ templates: abi: VariableDebtToken mapping: kind: ethereum/events -<<<<<<< HEAD:matic.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/matic.subgraph.template.yaml language: wasm/assemblyscript entities: - StableDebtToken @@ -324,11 +283,7 @@ templates: abi: LendingPoolAddressesProvider mapping: kind: ethereum/events -<<<<<<< HEAD:matic.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/matic.subgraph.template.yaml language: wasm/assemblyscript entities: - LendingPoolAddressesProvider @@ -367,11 +322,7 @@ templates: abi: LendingPoolConfigurator mapping: kind: ethereum/events -<<<<<<< HEAD:matic.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/matic.subgraph.template.yaml language: wasm/assemblyscript entities: - Reserve @@ -425,11 +376,7 @@ templates: abi: LendingPool mapping: kind: ethereum/events -<<<<<<< HEAD:matic.subgraph.template.yaml - apiVersion: 0.0.5 -======= apiVersion: 0.0.6 ->>>>>>> upstream/main:templates/matic.subgraph.template.yaml language: wasm/assemblyscript entities: - ReserveOperation From 5c82afb6aa720105b1302e84bce4f435f7de2e52 Mon Sep 17 00:00:00 2001 From: alphak3y Date: Tue, 12 Apr 2022 14:45:51 -0500 Subject: [PATCH 6/6] cleanup --- src/mapping/proxy-price-provider/ethereum.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mapping/proxy-price-provider/ethereum.ts b/src/mapping/proxy-price-provider/ethereum.ts index 74f07fa..7810365 100644 --- a/src/mapping/proxy-price-provider/ethereum.ts +++ b/src/mapping/proxy-price-provider/ethereum.ts @@ -1,4 +1,4 @@ - import { Address, log, ethereum } from '@graphprotocol/graph-ts'; +import { Address, log, ethereum } from '@graphprotocol/graph-ts'; import { AssetSourceUpdated, AaveOracle } from '../../../generated/AaveOracle/AaveOracle'; import { IExtendedPriceAggregator } from '../../../generated/AaveOracle/IExtendedPriceAggregator'; @@ -402,6 +402,4 @@ function chainLinkAggregatorUpdated( genericPriceUpdate(priceOracleAsset, priceFromProxy, event); } -} - - +} \ No newline at end of file