Skip to content

Commit

Permalink
Merge pull request #232 from VenusProtocol/testnet
Browse files Browse the repository at this point in the history
Testnet
  • Loading branch information
coreyar authored Jan 4, 2025
2 parents 0eabf1c + 05941bd commit f23459c
Show file tree
Hide file tree
Showing 14 changed files with 59 additions and 13 deletions.
13 changes: 13 additions & 0 deletions packages/isolated-pools-abis/Bep20.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,5 +218,18 @@
],
"name": "Transfer",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "implementation",
"type": "address"
}
],
"name": "Upgraded",
"type": "event"
}
]
2 changes: 1 addition & 1 deletion packages/utils/src/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const assertEqual = (
subgraphValue,
`
${key} incorrect on ${
entity.id
entity.address
} Contract: ${contractValue?.toString()}; Subgraph: ${subgraphValue};`,
);
} catch (e) {
Expand Down
6 changes: 3 additions & 3 deletions subgraphs/cross-chain-governance/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@venusprotocol/cross-chain-governance-subgraph",
"version": "1.2.0-testnet.1",
"version": "1.1.1-testnet.1",
"license": "MIT",
"repository": {
"url": "https://github.com/VenusProtocol/subgraphs",
Expand All @@ -11,7 +11,7 @@
],
"scripts": {
"codegen": "graph codegen",
"create:docker": "yarn graph create venusprotocol/venus-subgraph --node http://graph-node:8020/",
"create:docker": "yarn graph create venusprotocol/crosschain-governance --node http://graph-node:8020/",
"build:docker": "yarn graph build --ipfs http://ipfs:5001",
"build:ethereum": "yarn graph build --ipfs https://api.thegraph.com/ipfs/ ",
"deploy:docker": "yarn prepare:docker && yarn graph deploy venusprotocol/crosschain-governance --ipfs http://ipfs:5001 --node http://graph-node:8020/",
Expand All @@ -24,7 +24,7 @@
"deploy:zkSyncSepolia": "yarn prepare:zkSyncSepolia && yarn graph deploy --studio venus-governance-zksyncsepolia",
"deploy:zkSync": "yarn prepare:zkSync && yarn graph deploy --studio venus-governance-zksync",
"deploy:baseSepolia": "yarn prepare:baseSepolia && yarn graph deploy --studio venus-governance-base-sepolia",
"deploy:base": "yarn prepare:baseSepolia && yarn graph deploy --studio venus-governance-base",
"deploy:base": "yarn prepare:base && yarn graph deploy --studio venus-governance-base-mainnet",
"prepare:docker": "NETWORK=docker yarn ts-node config/index.ts",
"prepare:ethereum": "NETWORK=ethereum yarn ts-node config/index.ts",
"prepare:sepolia": "NETWORK=sepolia yarn ts-node config/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion subgraphs/etherfi-promo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@venusprotocol/etherfi-promo-subgraph",
"version": "1.0.2",
"version": "1.0.3-testnet.1",
"license": "MIT",
"repository": {
"url": "https://github.com/VenusProtocol/subgraphs",
Expand Down
2 changes: 1 addition & 1 deletion subgraphs/isolated-pools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@venusprotocol/isolated-pools-subgraph",
"version": "1.4.0-testnet.7",
"version": "1.3.1-testnet.1",
"license": "MIT",
"repository": {
"url": "https://github.com/VenusProtocol/subgraphs",
Expand Down
2 changes: 1 addition & 1 deletion subgraphs/isolated-pools/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type Pool @entity {
"""
ERC20 Token
"""
type Token @entity(immutable: true) {
type Token @entity {
"Address of the asset"
id: Bytes!
"Address of the asset"
Expand Down
11 changes: 11 additions & 0 deletions subgraphs/isolated-pools/src/mappings/underlying.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Upgraded } from '../../generated/templates/Underlying/BEP20';
import { BEP20 } from '../../generated/PoolRegistry/BEP20';
import { getOrCreateToken } from '../operations/getOrCreate';

export function handleUpgraded(event: Upgraded): void {
const token = getOrCreateToken(event.address);
const erc20 = BEP20.bind(event.address);
token.name = erc20.name();
token.symbol = erc20.symbol();
token.save();
}
6 changes: 5 additions & 1 deletion subgraphs/isolated-pools/src/operations/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { Address, BigInt } from '@graphprotocol/graph-ts';

import { Comptroller as ComptrollerContract } from '../../generated/PoolRegistry/Comptroller';
import { PoolRegistry as PoolRegistryContract } from '../../generated/PoolRegistry/PoolRegistry';
import { VToken as VTokenDataSource } from '../../generated/templates';
import {
Underlying as UnderlyingDataSource,
VToken as VTokenDataSource,
} from '../../generated/templates';
import {
BadDebtIncreased,
Borrow,
Expand Down Expand Up @@ -111,6 +114,7 @@ export function createMarket(
const vTokenContract = VTokenContract.bind(vTokenAddress);
const poolComptroller = Comptroller.bind(comptroller);
const underlyingAddress = vTokenContract.underlying();
UnderlyingDataSource.create(underlyingAddress);

const market = new Market(vTokenAddress);

Expand Down
2 changes: 1 addition & 1 deletion subgraphs/isolated-pools/src/operations/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
export const getPool = (comptroller: Address): Pool | null => {
const pool = Pool.load(getPoolId(comptroller));
if (!pool) {
log.error('Pool {} not found', [comptroller.toString()]);
log.error('Pool {} not found', [comptroller.toHexString()]);
}
return pool as Pool;
};
Expand Down
18 changes: 18 additions & 0 deletions subgraphs/isolated-pools/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,24 @@ templates:
handler: handleBadDebtRecovered
- event: HealBorrow(indexed address,indexed address,uint256)
handler: handleHealBorrow
- name: Underlying
kind: ethereum/contract
network: {{ network }}
source:
abi: BEP20
mapping:
abis:
- name: BEP20
file: ../../packages/isolated-pools-abis/Bep20.json
kind: ethereum/events
apiVersion: 0.0.9
language: wasm/assemblyscript
file: ./src/mappings/underlying.ts
entities:
- Token
eventHandlers:
- event: Upgraded(indexed address)
handler: handleUpgraded
- name: RewardsDistributor
kind: ethereum/contract
network: {{ network }}
Expand Down
2 changes: 1 addition & 1 deletion subgraphs/protocol-reserve/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@venusprotocol/protocol-reserve-subgraph",
"version": "1.2.0-testnet.6",
"version": "1.1.1-testnet.2",
"license": "MIT",
"repository": {
"url": "https://github.com/VenusProtocol/subgraphs",
Expand Down
2 changes: 1 addition & 1 deletion subgraphs/venus-governance/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@venusprotocol/governance-subgraph",
"version": "1.0.3",
"version": "1.0.3-testnet.1",
"license": "MIT",
"repository": {
"url": "https://github.com/VenusProtocol/subgraphs",
Expand Down
2 changes: 1 addition & 1 deletion subgraphs/venus-governance/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ cd ../..

git pull

YARN_ENABLE_IMMUTABLE_INSTALLS=true yarn
YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn
2 changes: 1 addition & 1 deletion subgraphs/venus/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@venusprotocol/core-pool-subgraph",
"version": "1.2.0-testnet.5",
"version": "1.1.3-testnet.2",
"license": "MIT",
"repository": {
"url": "https://github.com/VenusProtocol/subgraphs",
Expand Down

0 comments on commit f23459c

Please sign in to comment.