Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
toyv0 committed Jan 22, 2024
1 parent 606f4bc commit 2942279
Show file tree
Hide file tree
Showing 10 changed files with 1,281 additions and 1,274 deletions.
12 changes: 6 additions & 6 deletions manifests/manifest.eth.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import 'dotenv/config';

import { createThreePoolAssetManager } from '../sources/ThreePoolAssetManager';
// import { createThreePoolAssetManager } from '../sources/ThreePoolAssetManager';
// import { createEthAssetManager } from '../sources/EthAssetManager';
import { createAlchemist } from '../sources/Alchemist';
import { createTransmuter } from '../sources/Transmuter';
import { createTransmuterBuffer } from '../sources/TransmuterBuffer';
import { createMetaPool } from '../sources/MetaPool';
import { createFactoryPool } from '../sources/FactoryPool';
// import { createMetaPool } from '../sources/MetaPool';
// import { createFactoryPool } from '../sources/FactoryPool';

export default {
specVersion: '0.0.4',
Expand All @@ -24,9 +24,9 @@ export default {
createTransmuter('TransmuterV2_ETH'),
createTransmuterBuffer('TransmuterBuffer_alUSD'),
createTransmuterBuffer('TransmuterBuffer_alETH'),
createThreePoolAssetManager('ThreePoolAssetManager_alUSD', 17265505, '0x9735F7d3Ea56b454b24fFD74C58E9bD85cfaD31B'),
// createThreePoolAssetManager('ThreePoolAssetManager_alUSD', 17265505, '0x9735F7d3Ea56b454b24fFD74C58E9bD85cfaD31B'),
// createEthAssetManager('EthAssetManager', 14573961, '0xe761bf731A06fE8259FeE05897B2687D56933110'),
createMetaPool('alUSDMetaPool', '0x43b4fdfd4ff969587185cdb6f0bd875c5fc83f8c', 11955332),
createFactoryPool('alETHFactoryPool', '0xc4c319e2d4d66cca4464c0c2b32c9bd23ebe784e', 13227440),
// createMetaPool('alUSDMetaPool', '0x43b4fdfd4ff969587185cdb6f0bd875c5fc83f8c', 11955332),
// createFactoryPool('alETHFactoryPool', '0xc4c319e2d4d66cca4464c0c2b32c9bd23ebe784e', 13227440),
],
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"deploy-dev": "export NETWORK_NAME=mainnet; graph deploy alchemix-finance/alchemix_v2_dev subgraph.js --product hosted-service --skip-migrations",
"deploy-ftm": "export NETWORK_NAME=fantom; graph deploy alchemix-finance/alchemix_v2_ftm subgraph.ftm.js --product hosted-service --skip-migrations",
"deploy-peg": "graph deploy alchemix-finance/alcx-curve-dev subgraph.js --product hosted-service --skip-migrations",
"deploy-alchemy": "graph deploy alchemix-dev subgraph.js --version-label v0.0.1 --node https://subgraphs.alchemy.com/api/subgraphs/deploy --deploy-key js5R3UE6N675Z --ipfs https://ipfs.satsuma.xyz",
"lint": "prettier --ignore-path .gitignore --list-different \"**/*.{ts,js,json,yaml}\""
},
"devDependencies": {
Expand Down
72 changes: 36 additions & 36 deletions sources/FactoryPool.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
import { utils } from 'ethers';
import { eventDeclarations } from './utils/abis';
import { networkName, startBlockNumber } from './utils/constants';
import { DataSource } from './utils/types';
// import { utils } from 'ethers';
// import { eventDeclarations } from './utils/abis';
// import { networkName, startBlockNumber } from './utils/constants';
// import { DataSource } from './utils/types';

const FactoryPoolInterface = new utils.Interface(require('../abis/FactoryPool.json'));
const FactoryPoolEvents = Object.values(FactoryPoolInterface.events);
// const FactoryPoolInterface = new utils.Interface(require('../abis/FactoryPool.json'));
// const FactoryPoolEvents = Object.values(FactoryPoolInterface.events);

export function createFactoryPool(name: string, address: string, block: number): DataSource {
return {
name,
network: networkName,
kind: 'ethereum/contract',
mapping: {
apiVersion: '0.0.6',
kind: 'ethereum/events',
language: 'wasm/assemblyscript',
file: 'subgraph/handlers/FactoryPool.ts',
entities: [],
eventHandlers: eventDeclarations(FactoryPoolEvents),
abis: [
{
name: 'FactoryPool',
file: 'abis/FactoryPool.json',
},
{
name: 'ERC20',
file: 'abis/ERC20.json',
},
],
},
source: {
abi: 'FactoryPool',
address,
startBlock: block,
},
};
}
// export function createFactoryPool(name: string, address: string, block: number): DataSource {
// return {
// name,
// network: networkName,
// kind: 'ethereum/contract',
// mapping: {
// apiVersion: '0.0.6',
// kind: 'ethereum/events',
// language: 'wasm/assemblyscript',
// file: 'subgraph/handlers/FactoryPool.ts',
// entities: [],
// eventHandlers: eventDeclarations(FactoryPoolEvents),
// abis: [
// {
// name: 'FactoryPool',
// file: 'abis/FactoryPool.json',
// },
// {
// name: 'ERC20',
// file: 'abis/ERC20.json',
// },
// ],
// },
// source: {
// abi: 'FactoryPool',
// address,
// startBlock: block,
// },
// };
// }
72 changes: 36 additions & 36 deletions sources/MetaPool.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
import { utils } from 'ethers';
import { eventDeclarations } from './utils/abis';
import { networkName, startBlockNumber } from './utils/constants';
import { DataSource } from './utils/types';
// import { utils } from 'ethers';
// import { eventDeclarations } from './utils/abis';
// import { networkName, startBlockNumber } from './utils/constants';
// import { DataSource } from './utils/types';

const MetaPoolInterface = new utils.Interface(require('../abis/MetaPool.json'));
const MetaPoolEvents = Object.values(MetaPoolInterface.events);
// const MetaPoolInterface = new utils.Interface(require('../abis/MetaPool.json'));
// const MetaPoolEvents = Object.values(MetaPoolInterface.events);

export function createMetaPool(name: string, address: string, block: number): DataSource {
return {
name,
network: networkName,
kind: 'ethereum/contract',
mapping: {
apiVersion: '0.0.6',
kind: 'ethereum/events',
language: 'wasm/assemblyscript',
file: 'subgraph/handlers/MetaPool.ts',
entities: [],
eventHandlers: eventDeclarations(MetaPoolEvents),
abis: [
{
name: 'MetaPool',
file: 'abis/MetaPool.json',
},
{
name: 'ERC20',
file: 'abis/ERC20.json',
},
],
},
source: {
abi: 'MetaPool',
address,
startBlock: block,
},
};
}
// export function createMetaPool(name: string, address: string, block: number): DataSource {
// return {
// name,
// network: networkName,
// kind: 'ethereum/contract',
// mapping: {
// apiVersion: '0.0.6',
// kind: 'ethereum/events',
// language: 'wasm/assemblyscript',
// file: 'subgraph/handlers/MetaPool.ts',
// entities: [],
// eventHandlers: eventDeclarations(MetaPoolEvents),
// abis: [
// {
// name: 'MetaPool',
// file: 'abis/MetaPool.json',
// },
// {
// name: 'ERC20',
// file: 'abis/ERC20.json',
// },
// ],
// },
// source: {
// abi: 'MetaPool',
// address,
// startBlock: block,
// },
// };
// }
80 changes: 40 additions & 40 deletions sources/ThreePoolAssetManager.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
import { utils } from 'ethers';
import { eventDeclarations, deploymentAddress } from './utils/abis';
import { networkName, startBlockNumber } from './utils/constants';
import { DataSource } from './utils/types';
// import { utils } from 'ethers';
// import { eventDeclarations, deploymentAddress } from './utils/abis';
// import { networkName, startBlockNumber } from './utils/constants';
// import { DataSource } from './utils/types';

const ThreePoolAssetManagerInterface = new utils.Interface(require('../abis/ThreePoolAssetManager.json'));
const ThreePoolAssetManagerEvents = Object.values(ThreePoolAssetManagerInterface.events);
// const ThreePoolAssetManagerInterface = new utils.Interface(require('../abis/ThreePoolAssetManager.json'));
// const ThreePoolAssetManagerEvents = Object.values(ThreePoolAssetManagerInterface.events);

export function createThreePoolAssetManager(
name: string,
block: number,
address: string = deploymentAddress(name),
): DataSource {
return {
name,
network: networkName,
kind: 'ethereum/contract',
mapping: {
apiVersion: '0.0.6',
kind: 'ethereum/events',
language: 'wasm/assemblyscript',
file: 'subgraph/handlers/ThreePoolAssetManager.ts',
entities: [],
eventHandlers: eventDeclarations(ThreePoolAssetManagerEvents),
abis: [
{
name: 'ThreePoolAssetManager',
file: 'abis/ThreePoolAssetManager.json',
},
{
name: 'ERC20',
file: 'abis/ERC20.json',
},
],
},
source: {
abi: 'ThreePoolAssetManager',
address,
startBlock: block,
},
};
}
// export function createThreePoolAssetManager(
// name: string,
// block: number,
// address: string = deploymentAddress(name),
// ): DataSource {
// return {
// name,
// network: networkName,
// kind: 'ethereum/contract',
// mapping: {
// apiVersion: '0.0.6',
// kind: 'ethereum/events',
// language: 'wasm/assemblyscript',
// file: 'subgraph/handlers/ThreePoolAssetManager.ts',
// entities: [],
// eventHandlers: eventDeclarations(ThreePoolAssetManagerEvents),
// abis: [
// {
// name: 'ThreePoolAssetManager',
// file: 'abis/ThreePoolAssetManager.json',
// },
// {
// name: 'ERC20',
// file: 'abis/ERC20.json',
// },
// ],
// },
// source: {
// abi: 'ThreePoolAssetManager',
// address,
// startBlock: block,
// },
// };
// }
3 changes: 3 additions & 0 deletions subgraph/handlers/Alchemist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ function getOrCreateAlchemist(event: ethereum.Event): Alchemist {
const alchemistContract = AlchemistContract.bind(event.address);
let debtToken = getOrCreateDebtToken(alchemistContract.debtToken());
entity.debtToken = debtToken.id;
entity.accounts = [];
entity.globalDebt = '0';

entity.save();
}

Expand Down
Loading

0 comments on commit 2942279

Please sign in to comment.