diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index dec99038..dab48abf 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -145,12 +145,14 @@ jobs: docker compose down -v docker system prune -f -a --volumes - release: + release-cross-chain-governance: runs-on: ubuntu-20.04 - # needs: [unit-test, lint, integration-test-core-pool, integration-test-isolated-pools, integration-test-governance] + needs: [unit-test, lint] steps: - name: Checkout uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} - uses: actions/setup-node@v4 with: @@ -159,9 +161,16 @@ jobs: - name: Install deps run: yarn + + - name: Codegen + run: | + yarn prepare:docker + yarn codegen - - name: Version subgraphs + - name: Release subgraph env: + MAINNET_GRAPH_CLI_API_KEY: ${{ secrets.MAINNET_GRAPH_CLI_API_KEY }} + TESTNET_GRAPH_CLI_API_KEY: ${{ secrets.TESTNET_GRAPH_CLI_API_KEY }} GITHUB_TOKEN: ${{ secrets.VENUS_TOOLS_TOKEN }} GIT_AUTHOR_NAME: Venus Tools GIT_AUTHOR_EMAIL: tools@venus.io @@ -169,8 +178,173 @@ jobs: GIT_COMMITTER_EMAIL: tools@venus.io run: | yarn workspace @venusprotocol/cross-chain-governance-subgraph run semantic-release + + release-etherfi-promo: + runs-on: ubuntu-20.04 + needs: [unit-test, lint, release-cross-chain-governance] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "yarn" + + - name: Install deps + run: yarn + + - name: Codegen + run: | + yarn prepare:docker + yarn codegen + + - name: Release subgraph + env: + MAINNET_GRAPH_CLI_API_KEY: ${{ secrets.MAINNET_GRAPH_CLI_API_KEY }} + TESTNET_GRAPH_CLI_API_KEY: ${{ secrets.TESTNET_GRAPH_CLI_API_KEY }} + GITHUB_TOKEN: ${{ secrets.VENUS_TOOLS_TOKEN }} + GIT_AUTHOR_NAME: Venus Tools + GIT_AUTHOR_EMAIL: tools@venus.io + GIT_COMMITTER_NAME: Venus Tools + GIT_COMMITTER_EMAIL: tools@venus.io + run: | yarn workspace @venusprotocol/etherfi-promo-subgraph run semantic-release + + release-isolated-pools: + runs-on: ubuntu-20.04 + needs: [unit-test, lint, integration-test-isolated-pools, release-etherfi-promo] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "yarn" + + - name: Install deps + run: yarn + + - name: Codegen + run: | + yarn prepare:docker + yarn codegen + + - name: Release subgraph + env: + MAINNET_GRAPH_CLI_API_KEY: ${{ secrets.MAINNET_GRAPH_CLI_API_KEY }} + TESTNET_GRAPH_CLI_API_KEY: ${{ secrets.TESTNET_GRAPH_CLI_API_KEY }} + GITHUB_TOKEN: ${{ secrets.VENUS_TOOLS_TOKEN }} + GIT_AUTHOR_NAME: Venus Tools + GIT_AUTHOR_EMAIL: tools@venus.io + GIT_COMMITTER_NAME: Venus Tools + GIT_COMMITTER_EMAIL: tools@venus.io + run: | yarn workspace @venusprotocol/isolated-pools-subgraph run semantic-release + + release-protocol-reserve: + runs-on: ubuntu-20.04 + needs: [unit-test, lint, release-isolated-pools] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "yarn" + + - name: Install deps + run: yarn + + - name: Codegen + run: | + yarn prepare:docker + yarn codegen + + - name: Release subgraph + env: + MAINNET_GRAPH_CLI_API_KEY: ${{ secrets.MAINNET_GRAPH_CLI_API_KEY }} + TESTNET_GRAPH_CLI_API_KEY: ${{ secrets.TESTNET_GRAPH_CLI_API_KEY }} + GITHUB_TOKEN: ${{ secrets.VENUS_TOOLS_TOKEN }} + GIT_AUTHOR_NAME: Venus Tools + GIT_AUTHOR_EMAIL: tools@venus.io + GIT_COMMITTER_NAME: Venus Tools + GIT_COMMITTER_EMAIL: tools@venus.io + run: | yarn workspace @venusprotocol/protocol-reserve-subgraph run semantic-release + + release-core-pool: + runs-on: ubuntu-20.04 + needs: [unit-test, lint, integration-test-core-pool, release-protocol-reserve] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "yarn" + + - name: Install deps + run: yarn + + - name: Codegen + run: | + yarn prepare:docker + yarn codegen + + - name: Release subgraph + env: + MAINNET_GRAPH_CLI_API_KEY: ${{ secrets.MAINNET_GRAPH_CLI_API_KEY }} + TESTNET_GRAPH_CLI_API_KEY: ${{ secrets.TESTNET_GRAPH_CLI_API_KEY }} + GITHUB_TOKEN: ${{ secrets.VENUS_TOOLS_TOKEN }} + GIT_AUTHOR_NAME: Venus Tools + GIT_AUTHOR_EMAIL: tools@venus.io + GIT_COMMITTER_NAME: Venus Tools + GIT_COMMITTER_EMAIL: tools@venus.io + run: | yarn workspace @venusprotocol/core-pool-subgraph run semantic-release + + release-governance: + runs-on: ubuntu-20.04 + needs: [unit-test, lint, integration-test-governance, release-core-pool] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "yarn" + + - name: Install deps + run: yarn + + - name: Codegen + run: | + yarn prepare:docker + yarn codegen + + - name: Release subgraph + env: + MAINNET_GRAPH_CLI_API_KEY: ${{ secrets.MAINNET_GRAPH_CLI_API_KEY }} + TESTNET_GRAPH_CLI_API_KEY: ${{ secrets.TESTNET_GRAPH_CLI_API_KEY }} + GITHUB_TOKEN: ${{ secrets.VENUS_TOOLS_TOKEN }} + GIT_AUTHOR_NAME: Venus Tools + GIT_AUTHOR_EMAIL: tools@venus.io + GIT_COMMITTER_NAME: Venus Tools + GIT_COMMITTER_EMAIL: tools@venus.io + run: | yarn workspace @venusprotocol/governance-subgraph run semantic-release diff --git a/.yarnrc.yml b/.yarnrc.yml index ed441c3c..a7307ad1 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -6,4 +6,4 @@ plugins: yarnPath: .yarn/releases/yarn-3.8.2.cjs -enableTransparentWorkspaces: false +enableTransparentWorkspaces: true diff --git a/package.json b/package.json index 3005b878..1fb9f6f1 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "postinstall": "yarn patch-package && ./copy_contracts.sh" }, "devDependencies": { + "@0xsequence/multicall": "^1.10.15", "@chainlink/contracts": "^0.5.1", "@commitlint/cli": "^17.0.3", "@commitlint/config-conventional": "^17.0.3", @@ -44,9 +45,9 @@ "@nomicfoundation/hardhat-network-helpers": "^1.0.4", "@nomiclabs/hardhat-ethers": "^2.1.1", "@nomiclabs/hardhat-etherscan": "^3.1.0", - "@semantic-release/changelog": "^6.0.3", "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "^10.0.1", + "@semantic-release/npm": "^12.0.1", "@trivago/prettier-plugin-sort-imports": "^4.3.0", "@typechain/ethers-v5": "^10.1.0", "@typechain/hardhat": "^6.1.2", @@ -55,14 +56,15 @@ "@types/node": "^20.5.9", "@typescript-eslint/eslint-plugin": "^5.40.1", "@typescript-eslint/parser": "^5.40.1", - "@venusprotocol/governance-contracts": "2.5.0-dev.6", - "@venusprotocol/isolated-pools": "3.7.0-dev.6", - "@venusprotocol/oracle": "2.6.0", - "@venusprotocol/protocol-reserve": "2.3.0", + "@venusprotocol/governance-contracts": "2.7.0", + "@venusprotocol/isolated-pools": "3.7.1-dev.1", + "@venusprotocol/oracle": "2.7.0", + "@venusprotocol/protocol-reserve": "3.0.1", "@venusprotocol/solidity-utilities": "^2.0.3", - "@venusprotocol/venus-protocol": "9.3.0", + "@venusprotocol/venus-protocol": "9.4.0", "assemblyscript": "0.19.23", "chai": "^4.3.6", + "dotenv": "^16.4.5", "eslint": "^8.25.0", "eslint-config-prettier": "^6.1.0", "eslint-plugin-import": "^2.26.0", @@ -86,8 +88,9 @@ "typescript": "^4.8.4" }, "resolutions": { - "@venusprotocol/governance-contracts": "2.5.0-dev.6", - "@venusprotocol/venus-protocol": "9.3.0", + "@venusprotocol/governance-contracts": "2.7.0", + "@venusprotocol/venus-protocol": "9.4.0", + "@venusprotocol/protocol-reserve": "3.0.1", "prettier": "^3.0.3" }, "husky": { @@ -98,10 +101,5 @@ "packageManager": "yarn@3.2.2", "_moduleAliases": { "@nomiclabs/hardhat-ethers": "node_modules/hardhat-deploy-ethers" - }, - "dependencies": { - "@0xsequence/multicall": "^1.10.15", - "dotenv": "^16.4.5", - "semantic-release-yarn": "^3.0.2" } } diff --git a/subgraphs/cross-chain-governance/.releaserc b/subgraphs/cross-chain-governance/.releaserc index db7781f5..aa486939 100644 --- a/subgraphs/cross-chain-governance/.releaserc +++ b/subgraphs/cross-chain-governance/.releaserc @@ -58,7 +58,7 @@ } ], [ - "semantic-release-yarn", + "@semantic-release/npm", { "npmPublish": false } @@ -72,6 +72,13 @@ ], "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" } + ], + [ + "@semantic-release/exec", + { + "prepareCmd": "./prepare.sh", + "successCmd": "./deploy.sh" + } ] ], "branches": [ @@ -79,8 +86,8 @@ "name": "main" }, { - "name": "pre-*", - "prerelease": "pre" + "name": "testnet", + "prerelease": true } ] } \ No newline at end of file diff --git a/subgraphs/cross-chain-governance/config/index.ts b/subgraphs/cross-chain-governance/config/index.ts index 7fb32ab2..af043b44 100644 --- a/subgraphs/cross-chain-governance/config/index.ts +++ b/subgraphs/cross-chain-governance/config/index.ts @@ -9,6 +9,7 @@ import sepoliaDeployments from '@venusprotocol/governance-contracts/deployments/ import zkSyncDeployments from '@venusprotocol/governance-contracts/deployments/zksyncmainnet_addresses.json'; import zkSyncSepoliaDeployments from '@venusprotocol/governance-contracts/deployments/zksyncsepolia_addresses.json'; import baseSepoliaDeployments from '@venusprotocol/governance-contracts/deployments/basesepolia_addresses.json'; +import baseMainnetDeployments from '@venusprotocol/governance-contracts/deployments/basemainnet_addresses.json'; import fs from 'fs'; import Mustache from 'mustache'; @@ -25,6 +26,7 @@ export const getNetwork = () => { 'optimismSepolia', 'optimism', 'baseSepolia', + 'base', ] as const; const network = process.env.NETWORK; // @ts-expect-error network env var is unknown here @@ -42,7 +44,7 @@ const main = () => { layerZeroChainId: 10102, omnichainGovernanceOwnerAddress: '0xd9fEc8238711935D6c8d79Bef2B9546ef23FC046', startBlockOmnichainGovernanceOwner: '0', - omnichainExecutorOwnerAddress: '0xeAd789bd8Ce8b9E94F5D0FCa99F8787c7e758817', + omnichainGovernanceExecutorAddress: '0xeAd789bd8Ce8b9E94F5D0FCa99F8787c7e758817', startBlockOmnichainGovernanceExecutor: '0', accessControlManagerAddress: '0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9', accessControlManagerStartBlock: '0', @@ -52,7 +54,7 @@ const main = () => { layerZeroChainId: 10161, omnichainGovernanceOwnerAddress: sepoliaDeployments.addresses.OmnichainExecutorOwner, startBlockOmnichainGovernanceOwner: '6049722', - omnichainExecutorOwnerAddress: sepoliaDeployments.addresses.OmnichainGovernanceExecutor, + omnichainGovernanceExecutorAddress: sepoliaDeployments.addresses.OmnichainGovernanceExecutor, startBlockOmnichainGovernanceExecutor: '6049686', accessControlManagerAddress: sepoliaDeployments.addresses.AccessControlManager, accessControlManagerStartBlock: '4204345', @@ -62,7 +64,7 @@ const main = () => { layerZeroChainId: 101, omnichainGovernanceOwnerAddress: ethereumDeployments.addresses.OmnichainExecutorOwner, startBlockOmnichainGovernanceOwner: '20037893', - omnichainExecutorOwnerAddress: ethereumDeployments.addresses.OmnichainGovernanceExecutor, + omnichainGovernanceExecutorAddress: ethereumDeployments.addresses.OmnichainGovernanceExecutor, startBlockOmnichainGovernanceExecutor: '20032813', accessControlManagerAddress: ethereumDeployments.addresses.AccessControlManager, accessControlManagerStartBlock: '18641314', @@ -72,7 +74,8 @@ const main = () => { layerZeroChainId: 202, omnichainGovernanceOwnerAddress: opBnBMainnetDeployments.addresses.OmnichainExecutorOwner, startBlockOmnichainGovernanceOwner: '26957477', - omnichainExecutorOwnerAddress: opBnBMainnetDeployments.addresses.OmnichainGovernanceExecutor, + omnichainGovernanceExecutorAddress: + opBnBMainnetDeployments.addresses.OmnichainGovernanceExecutor, startBlockOmnichainGovernanceExecutor: '26952944', accessControlManagerAddress: opBnBMainnetDeployments.addresses.AccessControlManager, accessControlManagerStartBlock: '10895878', @@ -82,7 +85,7 @@ const main = () => { layerZeroChainId: 10231, omnichainGovernanceOwnerAddress: arbitrumSepoliaDeployments.addresses.OmnichainExecutorOwner, startBlockOmnichainGovernanceOwner: '54236728', - omnichainExecutorOwnerAddress: + omnichainGovernanceExecutorAddress: arbitrumSepoliaDeployments.addresses.OmnichainGovernanceExecutor, startBlockOmnichainGovernanceExecutor: '54235048', accessControlManagerAddress: arbitrumSepoliaDeployments.addresses.AccessControlManager, @@ -93,7 +96,7 @@ const main = () => { layerZeroChainId: 110, omnichainGovernanceOwnerAddress: arbitrumDeployments.addresses.OmnichainExecutorOwner, startBlockOmnichainGovernanceOwner: '221744426', - omnichainExecutorOwnerAddress: arbitrumDeployments.addresses.OmnichainGovernanceExecutor, + omnichainGovernanceExecutorAddress: arbitrumDeployments.addresses.OmnichainGovernanceExecutor, startBlockOmnichainGovernanceExecutor: '221743592', accessControlManagerAddress: arbitrumDeployments.addresses.AccessControlManager, accessControlManagerStartBlock: '201597544', @@ -103,7 +106,8 @@ const main = () => { layerZeroChainId: 10248, omnichainGovernanceOwnerAddress: zkSyncSepoliaDeployments.addresses.OmnichainExecutorOwner, startBlockOmnichainGovernanceOwner: '3771652', - omnichainExecutorOwnerAddress: zkSyncSepoliaDeployments.addresses.OmnichainGovernanceExecutor, + omnichainGovernanceExecutorAddress: + zkSyncSepoliaDeployments.addresses.OmnichainGovernanceExecutor, startBlockOmnichainGovernanceExecutor: '3771603', accessControlManagerAddress: zkSyncSepoliaDeployments.addresses.AccessControlManager, accessControlManagerStartBlock: '3445364', @@ -113,7 +117,7 @@ const main = () => { layerZeroChainId: 165, omnichainGovernanceOwnerAddress: zkSyncDeployments.addresses.OmnichainExecutorOwner, startBlockOmnichainGovernanceOwner: '48278537', - omnichainExecutorOwnerAddress: zkSyncDeployments.addresses.OmnichainGovernanceExecutor, + omnichainGovernanceExecutorAddress: zkSyncDeployments.addresses.OmnichainGovernanceExecutor, startBlockOmnichainGovernanceExecutor: '48277850', accessControlManagerAddress: zkSyncDeployments.addresses.AccessControlManager, accessControlManagerStartBlock: '42301361', @@ -123,7 +127,7 @@ const main = () => { layerZeroChainId: 10232, omnichainGovernanceOwnerAddress: optimismSepoliaDeployments.addresses.OmnichainExecutorOwner, startBlockOmnichainGovernanceOwner: '18679072', - omnichainExecutorOwnerAddress: + omnichainGovernanceExecutorAddress: optimismSepoliaDeployments.addresses.OmnichainGovernanceExecutor, startBlockOmnichainGovernanceExecutor: '18676643', accessControlManagerAddress: optimismSepoliaDeployments.addresses.AccessControlManager, @@ -134,7 +138,7 @@ const main = () => { layerZeroChainId: 111, omnichainGovernanceOwnerAddress: optimismDeployments.addresses.OmnichainExecutorOwner, startBlockOmnichainGovernanceOwner: '127723947', - omnichainExecutorOwnerAddress: optimismDeployments.addresses.OmnichainGovernanceExecutor, + omnichainGovernanceExecutorAddress: optimismDeployments.addresses.OmnichainGovernanceExecutor, startBlockOmnichainGovernanceExecutor: '127723676', accessControlManagerAddress: optimismDeployments.addresses.AccessControlManager, accessControlManagerStartBlock: '125490536', @@ -144,11 +148,22 @@ const main = () => { layerZeroChainId: 10245, omnichainGovernanceOwnerAddress: baseSepoliaDeployments.addresses.OmnichainExecutorOwner, startBlockOmnichainGovernanceOwner: '18475319', - omnichainExecutorOwnerAddress: baseSepoliaDeployments.addresses.OmnichainGovernanceExecutor, + omnichainGovernanceExecutorAddress: + baseSepoliaDeployments.addresses.OmnichainGovernanceExecutor, startBlockOmnichainGovernanceExecutor: '18470846', accessControlManagerAddress: baseSepoliaDeployments.addresses.AccessControlManager, accessControlManagerStartBlock: '16737038', }, + base: { + network: 'base', + layerZeroChainId: 184, + omnichainGovernanceOwnerAddress: baseMainnetDeployments.addresses.OmnichainExecutorOwner, + startBlockOmnichainGovernanceOwner: '23531514', + omnichainGovernanceExecutorAddress: baseMainnetDeployments.addresses.OmnichainGovernanceExecutor, + startBlockOmnichainGovernanceExecutor: '23531230', + accessControlManagerAddress: baseMainnetDeployments.addresses.AccessControlManager, + accessControlManagerStartBlock: '23212000', + }, }; const yamlTemplate = fs.readFileSync('template.yaml', 'utf8'); diff --git a/subgraphs/cross-chain-governance/deploy.sh b/subgraphs/cross-chain-governance/deploy.sh new file mode 100755 index 00000000..5d470b64 --- /dev/null +++ b/subgraphs/cross-chain-governance/deploy.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +version=($(jq -r '.version' package.json)) + +yarn + +if [[ $version == *"testnet"* ]]; then + yarn graph auth --studio $TESTNET_GRAPH_CLI_API_KEY + yarn deploy:chapel --version-label $version + yarn deploy:sepolia --version-label $version + yarn deploy:arbitrumSepolia --version-label $version + yarn deploy:optimismSepolia --version-label $version + yarn deploy:zkSyncSepolia --version-label $version + yarn deploy:baseSepolia --version-label $version +else + yarn graph auth --studio $MAINNET_GRAPH_CLI_API_KEY + yarn deploy:bsc --version-label $version + yarn deploy:ethereum --version-label $version + yarn deploy:arbitrum --version-label $version + yarn deploy:optimism --version-label $version + yarn deploy:zkSync --version-label $version +fi + diff --git a/subgraphs/cross-chain-governance/package.json b/subgraphs/cross-chain-governance/package.json index 67c8ffdd..2c409a1d 100644 --- a/subgraphs/cross-chain-governance/package.json +++ b/subgraphs/cross-chain-governance/package.json @@ -1,6 +1,6 @@ { "name": "@venusprotocol/cross-chain-governance-subgraph", - "version": "1.1.0", + "version": "1.2.0-testnet.1", "license": "MIT", "repository": { "url": "https://github.com/VenusProtocol/subgraphs", @@ -24,6 +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", "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", @@ -35,6 +36,7 @@ "prepare:zkSyncSepolia": "NETWORK=zkSyncSepolia yarn ts-node config/index.ts", "prepare:zkSync": "NETWORK=zkSync yarn ts-node config/index.ts", "prepare:baseSepolia": "NETWORK=baseSepolia yarn ts-node config/index.ts", + "prepare:base": "NETWORK=base yarn ts-node config/index.ts", "test": "yarn prepare:docker && graph test", "test:integration": "true" }, @@ -42,8 +44,8 @@ "@graphprotocol/client-cli": "3.0.0", "@graphprotocol/graph-cli": "^0.80.0", "@layerzerolabs/solidity-examples": "^1.0.0", - "@venusprotocol/governance-contracts": "2.5.0-dev.6", - "@venusprotocol/subgraph-utils": "workspace:^", + "@venusprotocol/governance-contracts": "2.7.0", + "@venusprotocol/subgraph-utils": "0.0.0", "apollo-fetch": "^0.7.0", "hardhat": "^2.10.2", "ts-node": "^10.9.2", @@ -52,5 +54,6 @@ "devDependencies": { "semantic-release": "^23.1.1", "semantic-release-monorepo": "^8.0.2" - } + }, + "stableVersion": "1.1.0" } diff --git a/subgraphs/cross-chain-governance/prepare.sh b/subgraphs/cross-chain-governance/prepare.sh index 131f8cc0..1f730dc9 100755 --- a/subgraphs/cross-chain-governance/prepare.sh +++ b/subgraphs/cross-chain-governance/prepare.sh @@ -1,4 +1,7 @@ #!/bin/bash # Install from root cd ../.. -yarn + +git pull + +YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn diff --git a/subgraphs/cross-chain-governance/src/constants/addresses.ts b/subgraphs/cross-chain-governance/src/constants/addresses.ts index 0fdf1a6d..7f0a42bf 100644 --- a/subgraphs/cross-chain-governance/src/constants/addresses.ts +++ b/subgraphs/cross-chain-governance/src/constants/addresses.ts @@ -1,14 +1,14 @@ import { Address } from '@graphprotocol/graph-ts'; import { - omnichainExecutorOwnerAddress as omnichainExecutorOwnerAddressString, + omnichainGovernanceExecutorAddress as omnichainGovernanceExecutorAddressString, omnichainGovernanceOwnerAddress as omnichainGovernanceOwnerAddressString, } from './config'; export const omnichainGovernanceOwnerAddress = Address.fromString( omnichainGovernanceOwnerAddressString, ); -export const omnichainExecutorOwnerAddress = Address.fromString( - omnichainExecutorOwnerAddressString, +export const omnichainGovernanceExecutorAddress = Address.fromString( + omnichainGovernanceExecutorAddressString, ); export const nullAddress = Address.fromString('0x0000000000000000000000000000000000000000'); diff --git a/subgraphs/cross-chain-governance/src/constants/config-template b/subgraphs/cross-chain-governance/src/constants/config-template index ed2760a0..555ec24d 100644 --- a/subgraphs/cross-chain-governance/src/constants/config-template +++ b/subgraphs/cross-chain-governance/src/constants/config-template @@ -1,5 +1,5 @@ // Use yarn prepare commands to generate config typescript file per env export const omnichainGovernanceOwnerAddress = '{{ omnichainGovernanceOwnerAddress }}'; -export const omnichainExecutorOwnerAddress = '{{ omnichainExecutorOwnerAddress }}'; +export const omnichainGovernanceExecutorAddress = '{{ omnichainGovernanceExecutorAddress }}'; export const layerZeroChainId = {{ layerZeroChainId }}; diff --git a/subgraphs/cross-chain-governance/src/operations/getOrCreate.ts b/subgraphs/cross-chain-governance/src/operations/getOrCreate.ts index 1cd4fc2c..84e2162e 100644 --- a/subgraphs/cross-chain-governance/src/operations/getOrCreate.ts +++ b/subgraphs/cross-chain-governance/src/operations/getOrCreate.ts @@ -11,7 +11,7 @@ import { } from '../../generated/schema'; import { BIGINT_ZERO, indexProposalTypeConstant } from '../constants'; import { - omnichainExecutorOwnerAddress, + omnichainGovernanceExecutorAddress, omnichainGovernanceOwnerAddress, } from '../constants/addresses'; import { layerZeroChainId } from '../constants/config'; @@ -29,11 +29,11 @@ export const getOrCreateFunctionRegistry = (signature: Bytes): FunctionRegistry export const getOrCreateGovernance = (): Governance => { let governance = Governance.load(getGovernanceId()); - const governanceContract = OmnichainGovernanceExecutor.bind(omnichainExecutorOwnerAddress); + const governanceContract = OmnichainGovernanceExecutor.bind(omnichainGovernanceExecutorAddress); if (!governance) { governance = new Governance(getGovernanceId()); governance.address = omnichainGovernanceOwnerAddress; - governance.executor = omnichainExecutorOwnerAddress; + governance.executor = omnichainGovernanceExecutorAddress; governance.guardian = governanceContract.guardian(); governance.srcChainId = governanceContract.srcChainId(); governance.layerZeroChainId = layerZeroChainId; diff --git a/subgraphs/cross-chain-governance/template.yaml b/subgraphs/cross-chain-governance/template.yaml index 2cd6c6e8..0b78b500 100644 --- a/subgraphs/cross-chain-governance/template.yaml +++ b/subgraphs/cross-chain-governance/template.yaml @@ -29,7 +29,7 @@ dataSources: name: OmnichainGovernanceExecutor network: {{ network }} source: - address: "{{ omnichainExecutorOwnerAddress }}" + address: "{{ omnichainGovernanceExecutorAddress }}" abi: OmnichainGovernanceExecutor startBlock: {{ startBlockOmnichainGovernanceExecutor }} mapping: diff --git a/subgraphs/cross-chain-governance/tests/Executor/mocks.ts b/subgraphs/cross-chain-governance/tests/Executor/mocks.ts index d3fa86e3..a96ea2d0 100644 --- a/subgraphs/cross-chain-governance/tests/Executor/mocks.ts +++ b/subgraphs/cross-chain-governance/tests/Executor/mocks.ts @@ -1,17 +1,19 @@ import { Address, ethereum } from '@graphprotocol/graph-ts'; import { createMockedFunction } from 'matchstick-as'; -import { omnichainExecutorOwnerAddress } from '../../src/constants/addresses'; +import { omnichainGovernanceExecutorAddress } from '../../src/constants/addresses'; export const MOCK_GUARDIAN = Address.fromString('0xc3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3'); export const createGovernanceMock = (): void => { - createMockedFunction(omnichainExecutorOwnerAddress, 'guardian', 'guardian():(address)').returns([ - ethereum.Value.fromAddress(MOCK_GUARDIAN), - ]); + createMockedFunction( + omnichainGovernanceExecutorAddress, + 'guardian', + 'guardian():(address)', + ).returns([ethereum.Value.fromAddress(MOCK_GUARDIAN)]); createMockedFunction( - omnichainExecutorOwnerAddress, + omnichainGovernanceExecutorAddress, 'srcChainId', 'srcChainId():(uint16)', ).returns([ethereum.Value.fromI32(2)]); diff --git a/subgraphs/etherfi-promo/.releaserc b/subgraphs/etherfi-promo/.releaserc index db7781f5..aa486939 100644 --- a/subgraphs/etherfi-promo/.releaserc +++ b/subgraphs/etherfi-promo/.releaserc @@ -58,7 +58,7 @@ } ], [ - "semantic-release-yarn", + "@semantic-release/npm", { "npmPublish": false } @@ -72,6 +72,13 @@ ], "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" } + ], + [ + "@semantic-release/exec", + { + "prepareCmd": "./prepare.sh", + "successCmd": "./deploy.sh" + } ] ], "branches": [ @@ -79,8 +86,8 @@ "name": "main" }, { - "name": "pre-*", - "prerelease": "pre" + "name": "testnet", + "prerelease": true } ] } \ No newline at end of file diff --git a/subgraphs/etherfi-promo/config/index.ts b/subgraphs/etherfi-promo/config/index.ts index 09197f3b..66e56a6f 100644 --- a/subgraphs/etherfi-promo/config/index.ts +++ b/subgraphs/etherfi-promo/config/index.ts @@ -33,6 +33,8 @@ const main = () => { vWeEthStartBlock: '5659827', vWeEthsAddress: sepoliaILDeployments.addresses.VToken_vweETHs_LiquidStakedETH, vWeEthsStartBlock: '6536644', + veBTCAddress: sepoliaILDeployments.addresses.VToken_veBTC, + veBTCStartBlock: '0', template: 'template.yaml', }, ethereum: { diff --git a/subgraphs/etherfi-promo/deploy.sh b/subgraphs/etherfi-promo/deploy.sh new file mode 100755 index 00000000..01f1982a --- /dev/null +++ b/subgraphs/etherfi-promo/deploy.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +version=($(jq -r '.version' package.json)) + +if [[ $version == *"testnet"* ]]; then + yarn graph auth --studio $TESTNET_GRAPH_CLI_API_KEY + yarn deploy:sepolia --version-label $version +else + yarn graph auth --studio $MAINNET_GRAPH_CLI_API_KEY + yarn deploy:bsc --version-label $version + yarn deploy:ethereum --version-label $version + yarn deploy:arbitrum --version-label $version +fi + + + diff --git a/subgraphs/etherfi-promo/package.json b/subgraphs/etherfi-promo/package.json index 8315fef5..b1dd48d0 100644 --- a/subgraphs/etherfi-promo/package.json +++ b/subgraphs/etherfi-promo/package.json @@ -1,6 +1,6 @@ { "name": "@venusprotocol/etherfi-promo-subgraph", - "version": "1.0.1", + "version": "1.1.0-testnet.6", "license": "MIT", "repository": { "url": "https://github.com/VenusProtocol/subgraphs", @@ -30,7 +30,7 @@ "test:integration": "true" }, "dependencies": { - "@venusprotocol/isolated-pools": "3.7.0-dev.5" + "@venusprotocol/isolated-pools": "3.7.1-dev.1" }, "devDependencies": { "@graphprotocol/graph-cli": "^0.80.0", @@ -38,5 +38,6 @@ "semantic-release-monorepo": "^8.0.2", "ts-node": "^10.9.2", "viem": "^2.9.26" - } + }, + "stableVersion": "1.0.1" } diff --git a/subgraphs/etherfi-promo/prepare.sh b/subgraphs/etherfi-promo/prepare.sh index 131f8cc0..199cdc9d 100755 --- a/subgraphs/etherfi-promo/prepare.sh +++ b/subgraphs/etherfi-promo/prepare.sh @@ -1,4 +1,5 @@ #!/bin/bash -# Install from root -cd ../.. -yarn + +git pull + +YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn diff --git a/subgraphs/etherfi-promo/schema.graphql b/subgraphs/etherfi-promo/schema.graphql index d0316bbf..c9814948 100644 --- a/subgraphs/etherfi-promo/schema.graphql +++ b/subgraphs/etherfi-promo/schema.graphql @@ -10,8 +10,12 @@ type TVL @entity { Entity to iterate over suppliers """ type Supply @entity { - "Token Address" + "VToken Address" id: Bytes! + "Address of the asset" + underlyingAddress: Bytes! + "Decimals of the asset" + underlyingDecimals: Int! suppliers: [SupplierAccount!]! @derivedFrom(field: "token") } @@ -21,6 +25,10 @@ Entity to iterate over borrowers type Borrow @entity { "Token Address" id: Bytes! + "Address of the asset" + underlyingAddress: Bytes! + "Decimals of the asset" + underlyingDecimals: Int! borrowers: [BorrowerAccount!]! @derivedFrom(field: "token") } diff --git a/subgraphs/etherfi-promo/src/mappings/vToken.ts b/subgraphs/etherfi-promo/src/mappings/vToken.ts index a7c55c42..992c4e0b 100644 --- a/subgraphs/etherfi-promo/src/mappings/vToken.ts +++ b/subgraphs/etherfi-promo/src/mappings/vToken.ts @@ -7,27 +7,28 @@ import { getBorrow, getSupply } from '../operations/get'; import { getOrCreateBorrowerAccount, getOrCreateSupplierAccount } from '../operations/getOrCreate'; import { updateBorrowerAccount, updateSupplierAccount, updateTvl } from '../operations/update'; import exponentToBigDecimal from '../utilities/exponentToBigDecimal'; -import exponentToBigInt from '../utilities/exponentToBigInt'; export function handleMint(event: Mint): void { const minter = event.params.minter; const supplierAccount = getOrCreateSupplierAccount(minter, event.address); + const vToken = getSupply(event.address); updateSupplierAccount( minter, event.address, supplierAccount.effective_balance.plus( - event.params.mintAmount.toBigDecimal().div(exponentToBigDecimal(18)), + event.params.mintAmount.toBigDecimal().div(exponentToBigDecimal(vToken.underlyingDecimals)), ), ); } export function handleBorrow(event: Borrow): void { const borrower = event.params.borrower; + const vToken = getBorrow(event.address); getOrCreateBorrowerAccount(borrower, event.address); updateBorrowerAccount( borrower, event.address, - event.params.accountBorrows.toBigDecimal().div(exponentToBigDecimal(18)), + event.params.accountBorrows.toBigDecimal().div(exponentToBigDecimal(vToken.underlyingDecimals)), ); } @@ -37,6 +38,7 @@ export function handleTransfer(event: Transfer): void { const fromAccountAddress = event.params.from; // If the to account is the vToken address we assume it was a redeem const toAccountAddress = event.params.to; + const vToken = getSupply(event.address); if ( fromAccountAddress.notEqual(event.address) && @@ -45,25 +47,23 @@ export function handleTransfer(event: Transfer): void { ) { const vTokenContract = VTokenContract.bind(event.address); const exchangeRateMantissa = vTokenContract.exchangeRateCurrent(); + const amountUnderlying = exchangeRateMantissa .times(event.params.amount) - .div(exponentToBigInt(18)); + .toBigDecimal() + .div(exponentToBigDecimal(18 + vToken.underlyingDecimals)); const fromAccount = getOrCreateSupplierAccount(fromAccountAddress, event.address); updateSupplierAccount( fromAccountAddress, event.address, - fromAccount.effective_balance.minus( - amountUnderlying.toBigDecimal().div(exponentToBigDecimal(18)), - ), + fromAccount.effective_balance.minus(amountUnderlying), ); // To const toAccount = getOrCreateSupplierAccount(toAccountAddress, event.address); updateSupplierAccount( toAccountAddress, event.address, - toAccount.effective_balance.plus( - amountUnderlying.toBigDecimal().div(exponentToBigDecimal(18)), - ), + toAccount.effective_balance.plus(amountUnderlying), ); } } @@ -72,23 +72,28 @@ export function handleAccrueInterest(event: AccrueInterest): void { const supply = getSupply(event.address); supply.suppliers.load().forEach(supplier => { const vTokenContract = VTokenContract.bind(Address.fromBytes(supplier.token)); + const vToken = getSupply(Address.fromBytes(supplier.token)); const exchangeRateMantissa = vTokenContract.exchangeRateCurrent(); const vTokenBalance = vTokenContract.balanceOf(Address.fromBytes(supplier.address)); - const amountUnderlying = exchangeRateMantissa.times(vTokenBalance).div(exponentToBigInt(18)); - supplier.effective_balance = amountUnderlying.toBigDecimal().div(exponentToBigDecimal(18)); + const amountUnderlying = exchangeRateMantissa + .times(vTokenBalance) + .toBigDecimal() + .div(exponentToBigDecimal(18 + vToken.underlyingDecimals)); + supplier.effective_balance = amountUnderlying; supplier.save(); }); const borrow = getBorrow(event.address); borrow.borrowers.load().forEach(borrower => { const vTokenContract = VTokenContract.bind(Address.fromBytes(borrower.token)); + const vToken = getBorrow(Address.fromBytes(borrower.token)); const underlyingBorrowBalance = vTokenContract.borrowBalanceCurrent( Address.fromBytes(borrower.address), ); borrower.effective_balance = underlyingBorrowBalance .toBigDecimal() - .div(exponentToBigDecimal(18)); + .div(exponentToBigDecimal(vToken.underlyingDecimals)); borrower.save(); }); diff --git a/subgraphs/etherfi-promo/src/operations/get.ts b/subgraphs/etherfi-promo/src/operations/get.ts index fb83dc35..56fa8fc8 100644 --- a/subgraphs/etherfi-promo/src/operations/get.ts +++ b/subgraphs/etherfi-promo/src/operations/get.ts @@ -1,5 +1,5 @@ import { Address } from '@graphprotocol/graph-ts'; - +import { VToken } from '../../generated/vWeETH/VToken'; import { Borrow, BorrowerAccount, SupplierAccount, Supply, TVL } from '../../generated/schema'; import { zeroBigDecimal } from '../constants'; import { getPositionId } from '../utilities/ids'; @@ -19,6 +19,13 @@ export const getSupply = (tokenAddress: Address): Supply => { let supply = Supply.load(tokenAddress); if (!supply) { supply = new Supply(tokenAddress); + + const vTokenContract = VToken.bind(tokenAddress); + const underlyingAddress = vTokenContract.underlying(); + const erc20 = VToken.bind(underlyingAddress); + + supply.underlyingAddress = underlyingAddress; + supply.underlyingDecimals = erc20.decimals(); } supply.save(); return supply; @@ -36,6 +43,12 @@ export const getBorrow = (tokenAddress: Address): Borrow => { let borrow = Borrow.load(tokenAddress); if (!borrow) { borrow = new Borrow(tokenAddress); + const vTokenContract = VToken.bind(tokenAddress); + const underlyingAddress = vTokenContract.underlying(); + const erc20 = VToken.bind(underlyingAddress); + + borrow.underlyingAddress = underlyingAddress; + borrow.underlyingDecimals = erc20.decimals(); } borrow.save(); return borrow; diff --git a/subgraphs/etherfi-promo/src/operations/update.ts b/subgraphs/etherfi-promo/src/operations/update.ts index 477587b6..5f7cb9e9 100644 --- a/subgraphs/etherfi-promo/src/operations/update.ts +++ b/subgraphs/etherfi-promo/src/operations/update.ts @@ -3,7 +3,7 @@ import { Address, BigDecimal, ethereum } from '@graphprotocol/graph-ts'; import { BorrowerAccount, SupplierAccount, TVL } from '../../generated/schema'; import { ERC20 as ERC20Contract } from '../../generated/vWeETH/ERC20'; import { VToken as VTokenContract } from '../../generated/vWeETH/VToken'; -import { getBorrowerAccount, getSupplierAccount, getTvl } from './get'; +import { getBorrowerAccount, getSupplierAccount, getTvl, getSupply } from './get'; import exponentToBigDecimal from '../utilities/exponentToBigDecimal'; export function updateSupplierAccount( @@ -31,6 +31,7 @@ export function updateBorrowerAccount( export function updateTvl(event: ethereum.Event): TVL { const vTokenContract = VTokenContract.bind(event.address); const underlyingAddress = vTokenContract.underlying(); + const vToken = getSupply(event.address); const underlyingContract = ERC20Contract.bind(underlyingAddress); const tvl = getTvl(event.address); const totalBorrows = vTokenContract.totalBorrowsCurrent(); @@ -40,7 +41,7 @@ export function updateTvl(event: ethereum.Event): TVL { .plus(totalBorrows) .minus(totalReserves) .toBigDecimal() - .div(exponentToBigDecimal(18)); + .div(exponentToBigDecimal(vToken.underlyingDecimals)); tvl.save(); return tvl; } diff --git a/subgraphs/etherfi-promo/tests/VToken/index.test.ts b/subgraphs/etherfi-promo/tests/VToken/index.test.ts index d5c2b918..92dcc3e2 100644 --- a/subgraphs/etherfi-promo/tests/VToken/index.test.ts +++ b/subgraphs/etherfi-promo/tests/VToken/index.test.ts @@ -24,7 +24,7 @@ import { createMintEvent, createTransferEvent, } from './events'; -import { createAccountVTokenBalanceOfMock, createBep20Mock, createVBep20Mock } from './mocks'; +import { createMarketPositionBalanceOfMock, createBep20Mock, createVBep20Mock } from './mocks'; const user1Address = Address.fromString('0x0000000000000000000000000000000000000101'); const user2Address = Address.fromString('0x0000000000000000000000000000000000000202'); @@ -37,7 +37,7 @@ const cleanup = (): void => { }; beforeAll(() => { - createVBep20Mock(vTokenAddress, exchangeRateCurrent); + createVBep20Mock(vTokenAddress, underlyingAddress, exchangeRateCurrent); }); afterEach(() => { @@ -143,7 +143,7 @@ describe('VToken', () => { totalBorrows, ); createBep20Mock(underlyingAddress, vTokenAddress, cashPrior); - createAccountVTokenBalanceOfMock( + createMarketPositionBalanceOfMock( vTokenAddress, underlyingAddress, user1Address, @@ -152,7 +152,7 @@ describe('VToken', () => { totalBorrows, reserves, ); - createAccountVTokenBalanceOfMock( + createMarketPositionBalanceOfMock( vTokenAddress, underlyingAddress, user2Address, diff --git a/subgraphs/etherfi-promo/tests/VToken/mocks.ts b/subgraphs/etherfi-promo/tests/VToken/mocks.ts index 5fe00d0a..3e3b673a 100644 --- a/subgraphs/etherfi-promo/tests/VToken/mocks.ts +++ b/subgraphs/etherfi-promo/tests/VToken/mocks.ts @@ -5,12 +5,24 @@ export const mockPriceOracleAddress = Address.fromString( '0xb0b0000000000000000000000000000000000000', ); -export const createVBep20Mock = (contractAddress: Address, exchangeRateCurrent: BigInt): void => { +export const createVBep20Mock = ( + contractAddress: Address, + underlyingAddress: Address, + exchangeRateCurrent: BigInt, +): void => { createMockedFunction( contractAddress, 'exchangeRateCurrent', 'exchangeRateCurrent():(uint256)', ).returns([ethereum.Value.fromUnsignedBigInt(exchangeRateCurrent)]); + + createMockedFunction(contractAddress, 'underlying', 'underlying():(address)').returns([ + ethereum.Value.fromAddress(underlyingAddress), + ]); + + createMockedFunction(underlyingAddress, 'decimals', 'decimals():(uint8)').returns([ + ethereum.Value.fromI32(18), + ]); }; export const createBep20Mock = ( @@ -21,9 +33,13 @@ export const createBep20Mock = ( createMockedFunction(contractAddress, 'balanceOf', 'balanceOf(address):(uint256)') .withArgs([ethereum.Value.fromAddress(accountAddress)]) .returns([ethereum.Value.fromUnsignedBigInt(balanceOf)]); + + createMockedFunction(contractAddress, 'decimals', 'decimals():(uint8)').returns([ + ethereum.Value.fromI32(18), + ]); }; -export const createAccountVTokenBalanceOfMock = ( +export const createMarketPositionBalanceOfMock = ( vTokenAddress: Address, underlyingAddress: Address, accountAddress: Address, diff --git a/subgraphs/isolated-pools/.releaserc b/subgraphs/isolated-pools/.releaserc index 31a2f26c..aa486939 100644 --- a/subgraphs/isolated-pools/.releaserc +++ b/subgraphs/isolated-pools/.releaserc @@ -58,7 +58,7 @@ } ], [ - "semantic-release-yarn", + "@semantic-release/npm", { "npmPublish": false } @@ -76,7 +76,8 @@ [ "@semantic-release/exec", { - "prepareCmd": "./prepare.sh" + "prepareCmd": "./prepare.sh", + "successCmd": "./deploy.sh" } ] ], @@ -85,8 +86,8 @@ "name": "main" }, { - "name": "pre-*", - "prerelease": "pre" + "name": "testnet", + "prerelease": true } ] } \ No newline at end of file diff --git a/subgraphs/isolated-pools/config/index.ts b/subgraphs/isolated-pools/config/index.ts index 76b8c5cd..879100f8 100644 --- a/subgraphs/isolated-pools/config/index.ts +++ b/subgraphs/isolated-pools/config/index.ts @@ -10,6 +10,7 @@ import sepoliaDeployments from '@venusprotocol/isolated-pools/deployments/sepoli import zksyncDeployments from '@venusprotocol/isolated-pools/deployments/zksyncmainnet_addresses.json'; import zksyncSepoliaDeployments from '@venusprotocol/isolated-pools/deployments/zksyncsepolia_addresses.json'; import baseSepoliaDeployments from '@venusprotocol/isolated-pools/deployments/basesepolia_addresses.json'; +import baseMainnetDeployments from '@venusprotocol/isolated-pools/deployments/basemainnet_addresses.json'; import fs from 'fs'; import Mustache from 'mustache'; @@ -28,6 +29,7 @@ export const getNetwork = () => { 'optimismSepolia', 'optimism', 'baseSepolia', + 'base', ] as const; const network = process.env.NETWORK; // @ts-expect-error network env var is unknown here @@ -117,6 +119,11 @@ const main = () => { poolRegistryAddress: baseSepoliaDeployments.addresses.PoolRegistry, startBlock: '18242654', }, + base: { + network: 'base', + poolRegistryAddress: baseMainnetDeployments.addresses.PoolRegistry, + startBlock: '23344365', + }, }; Mustache.escape = function (text) { diff --git a/subgraphs/isolated-pools/deploy.sh b/subgraphs/isolated-pools/deploy.sh new file mode 100755 index 00000000..acfca2da --- /dev/null +++ b/subgraphs/isolated-pools/deploy.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +version=($(jq -r '.version' package.json)) + +if [[ $version == *"testnet"* ]]; then + yarn graph auth --studio $TESTNET_GRAPH_CLI_API_KEY + yarn deploy:chapel --version-label $version + yarn deploy:sepolia --version-label $version + yarn deploy:arbitrumSepolia --version-label $version + yarn deploy:zksyncSepolia --version-label $version + yarn deploy:optimismSepolia --version-label $version + yarn deploy:baseSepolia --version-label $version +else + yarn graph auth --studio $MAINNET_GRAPH_CLI_API_KEY + yarn deploy:bsc --version-label $version + yarn deploy:ethereum --version-label $version + yarn deploy:arbitrum --version-label $version + yarn deploy:zksync --version-label $version + yarn deploy:optimism --version-label $version +fi diff --git a/subgraphs/isolated-pools/package.json b/subgraphs/isolated-pools/package.json index a3359504..e198fe6b 100644 --- a/subgraphs/isolated-pools/package.json +++ b/subgraphs/isolated-pools/package.json @@ -1,6 +1,6 @@ { "name": "@venusprotocol/isolated-pools-subgraph", - "version": "1.3.0", + "version": "1.4.0-testnet.7", "license": "MIT", "repository": { "url": "https://github.com/VenusProtocol/subgraphs", @@ -27,6 +27,7 @@ "deploy:optimismSepolia": "yarn prepare:optimismSepolia && yarn codegen && yarn graph deploy --studio venus-il-optimism-sepolia", "deploy:optimism": "yarn prepare:optimism && yarn codegen && yarn graph deploy --studio venus-isolated-pools-optimism", "deploy:baseSepolia": "yarn prepare:baseSepolia && yarn codegen && yarn graph deploy --studio venus-isolated-pools-base-sepolia", + "deploy:base": "yarn prepare:base && yarn codegen && yarn graph deploy --studio venus-isolated-pools-base", "prepare:docker": "NETWORK=docker yarn ts-node config/index.ts", "prepare:chapel": "NETWORK=chapel yarn ts-node config/index.ts", "prepare:bsc": "NETWORK=bsc yarn ts-node config/index.ts", @@ -40,23 +41,25 @@ "prepare:optimismSepolia": "NETWORK=optimismSepolia yarn ts-node config/index.ts", "prepare:optimism": "NETWORK=optimism yarn ts-node config/index.ts", "prepare:baseSepolia": "NETWORK=baseSepolia yarn ts-node config/index.ts", + "prepare:base": "NETWORK=base yarn ts-node config/index.ts", "generate-subgraph-types": "rm -rf /subgraph-client/.graphclient && yarn graphclient build --dir ./subgraph-client", "pretty": "prettier —-write '**/*.ts'", "test": "yarn prepare:docker && graph test", "test:integration": "yarn hardhat test tests/integration/index.ts --network localhost" }, "dependencies": { - "@venusprotocol/isolated-pools": "3.7.0-dev.6" + "@venusprotocol/isolated-pools": "3.7.1-dev.1" }, "devDependencies": { "@graphprotocol/client-cli": "3.0.0", "@graphprotocol/graph-cli": "^0.80.0", - "@venusprotocol/subgraph-utils": "workspace:^", + "@venusprotocol/subgraph-utils": "0.0.0", "apollo-fetch": "^0.7.0", "hardhat": "^2.10.2", "semantic-release": "^23.1.1", "semantic-release-monorepo": "^8.0.2", "ts-node": "^10.9.2", "urql": "^3.0.3" - } + }, + "stableVersion": "1.3.0" } diff --git a/subgraphs/isolated-pools/prepare.sh b/subgraphs/isolated-pools/prepare.sh index 131f8cc0..1f730dc9 100755 --- a/subgraphs/isolated-pools/prepare.sh +++ b/subgraphs/isolated-pools/prepare.sh @@ -1,4 +1,7 @@ #!/bin/bash # Install from root cd ../.. -yarn + +git pull + +YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn diff --git a/subgraphs/isolated-pools/schema.graphql b/subgraphs/isolated-pools/schema.graphql index 3362dfb5..c41587a9 100644 --- a/subgraphs/isolated-pools/schema.graphql +++ b/subgraphs/isolated-pools/schema.graphql @@ -4,6 +4,8 @@ The Pool entity type Pool @entity { "Pool Address as id" id: Bytes! + "Pool Comptroller address" + address: Bytes! "Name of the pool" name: String! "Creator of the pool" @@ -34,6 +36,23 @@ type Pool @entity { } """ +ERC20 Token +""" +type Token @entity(immutable: true) { + "Address of the asset" + id: Bytes! + "Address of the asset" + address: Bytes! + "Name of the asset" + name: String! + "Symbol of the asset" + symbol: String! + "Decimals of the asset" + decimals: Int! +} + +""" +MarketAction is an action that can be taken on a market enum MarketPauseGuardianAction { Mint = "Mint", Borrow = "Borrow", @@ -42,8 +61,8 @@ enum MarketPauseGuardianAction { type MarketAction @entity { "Concatentation of address and action" id: Bytes! - "vToken Address affected" - vToken: Bytes! + "Market affected" + market: Market! "Action (Borrow, Mint)" action: String! "True if paused, otherwise False if active" @@ -81,12 +100,8 @@ type Market @entity { supplyRateMantissa: BigInt! "VToken symbol" symbol: String! - "Underlying token address" - underlyingAddress: Bytes! - "Underlying token name" - underlyingName: String! - "Underlying token symbol" - underlyingSymbol: String! + "Underlying Token" + underlyingToken: Token! "Max token borrow amount allowed" borrowCapMantissa: BigInt! "Total borrowed underlying token" @@ -104,8 +119,6 @@ type Market @entity { lastUnderlyingPriceCents: BigInt! "Block price was last updated" lastUnderlyingPriceBlockNumber: BigInt! - "Underlying token decimal length" - underlyingDecimals: Int! "vToken decimal length" vTokenDecimals: Int! @@ -125,7 +138,7 @@ type Market @entity { liquidationThresholdMantissa: BigInt! "Accounts who participate in this market" - accounts: [AccountVToken!]! @derivedFrom(field:"market") + accounts: [MarketPosition!]! @derivedFrom(field:"market") } """ @@ -135,6 +148,8 @@ participated in, along with liquidation information. type Account @entity { "User address" id: Bytes! + "User address" + address: Bytes! "Pools the user is participating on" pools: [AccountPool!]! @derivedFrom(field: "account") "Count user has been liquidated" @@ -153,14 +168,14 @@ type AccountPool @entity(immutable: true) { id: Bytes! pool: Pool! account: Account! - tokens: [AccountVToken!]! @derivedFrom(field:"accountPool") + tokens: [MarketPosition!]! @derivedFrom(field:"accountPool") } """ -AccountVToken is a single account within a single vToken market, with data such +MarketPosition is a single account within a single vToken market, with data such as interest earned or paid """ -type AccountVToken @entity { +type MarketPosition @entity { "Concatenation of VToken address and user address" id: Bytes! "Pool of the market" @@ -170,7 +185,7 @@ type AccountVToken @entity { "Relation to user" account: Account! "Bad debt data for the account in the market" - badDebt: [AccountVTokenBadDebt!]! @derivedFrom(field:"account") + badDebt: [MarketPositionBadDebt!]! @derivedFrom(field:"account") "Block number this asset was updated at in the contract" accrualBlockNumber: BigInt! "Borrow Index this position last accrued interest" @@ -188,13 +203,13 @@ type AccountVToken @entity { } """ -Auxiliary entity for AccountVToken indicating when a certain amount of bad debt was healed +Auxiliary entity for MarketPosition indicating when a certain amount of bad debt was healed """ -type AccountVTokenBadDebt @entity { +type MarketPositionBadDebt @entity { "Concatenation of borrower and vToken Address" id: Bytes! "Market that was healed" - account: AccountVToken! + account: MarketPosition! "Amount that was healed" amountMantissa: BigInt! "Timestamp" @@ -238,18 +253,22 @@ An interface for rewards distributor that distribute rewards to isolated pools type RewardsDistributor @entity { "Address of the rewards distributor" id: Bytes! + "Address of the rewards distributor" + address: Bytes! "Address of the pool" pool: Pool! "Address of the reward token" - reward: Bytes! + rewardToken: Token! "Distribution rate for suppliers" - rewardSpeeds: [RewardSpeed!]! @derivedFrom(field:"rewardsDistributor") + marketRewards: [MarketReward!]! @derivedFrom(field:"rewardsDistributor") + "Depending on the Chain, the rewards distributor is time based or block based" + isTimeBased: Boolean! } """ A interface for rewards distributor that distribute rewards to isolated pools """ -type RewardSpeed @entity { +type MarketReward @entity { "ID created from the reward distributor and market this speed applies to" id: Bytes! "Address of rewards distributor" @@ -257,7 +276,19 @@ type RewardSpeed @entity { "Address of the market this speed applies to" market: Market! "Distribution rate for borrowers" - borrowSpeedPerBlockMantissa: BigInt + borrowSpeedPerBlockMantissa: BigInt! "Distribution rate for suppliers" - supplySpeedPerBlockMantissa: BigInt + supplySpeedPerBlockMantissa: BigInt! + "Index of the last supply state update" + supplyStateIndex: BigInt! + "Timestamp or block number of the last supply state update" + supplyStateBlockNumberOrTimestamp: BigInt! + "Index of the last borrow state update" + borrowStateIndex: BigInt! + "Timestamp or block number of the last borrow state update" + borrowStateBlockNumberOrTimestamp: BigInt! + "Supply last rewarding block or timestamp" + supplyLastRewardingBlockTimestamp: BigInt! + "Borrow last rewarding block or timestamp" + borrowLastRewardingBlockTimestamp: BigInt! } diff --git a/subgraphs/isolated-pools/src/mappings/pool.ts b/subgraphs/isolated-pools/src/mappings/pool.ts index 77930400..4c4c908e 100644 --- a/subgraphs/isolated-pools/src/mappings/pool.ts +++ b/subgraphs/isolated-pools/src/mappings/pool.ts @@ -24,7 +24,7 @@ import { getOrCreateRewardDistributor, } from '../operations/getOrCreate'; import { - updateOrCreateAccountVToken, + updateOrCreateMarketPosition, updateOrCreateMarketAction, } from '../operations/updateOrCreate'; import Box from '../utilities/box'; @@ -41,9 +41,11 @@ export function handleMarketSupported(event: MarketSupported): void { } export function handleMarketUnlisted(event: MarketUnlisted): void { - const market = getMarket(event.params.vToken)!; - market.isListed = false; - market.save(); + const market = getMarket(event.params.vToken); + if (market) { + market.isListed = false; + market.save(); + } } export function handleMarketEntered(event: MarketEntered): void { @@ -53,7 +55,7 @@ export function handleMarketEntered(event: MarketEntered): void { getOrCreateAccount(accountAddress); - updateOrCreateAccountVToken( + updateOrCreateMarketPosition( accountAddress, vTokenAddress, poolAddress, @@ -69,7 +71,7 @@ export function handleMarketExited(event: MarketExited): void { getOrCreateAccount(accountAddress); - updateOrCreateAccountVToken( + updateOrCreateMarketPosition( accountAddress, vTokenAddress, poolAddress, diff --git a/subgraphs/isolated-pools/src/mappings/rewardsDistributor.ts b/subgraphs/isolated-pools/src/mappings/rewardsDistributor.ts index 6e1559a0..cc913925 100644 --- a/subgraphs/isolated-pools/src/mappings/rewardsDistributor.ts +++ b/subgraphs/isolated-pools/src/mappings/rewardsDistributor.ts @@ -1,17 +1,114 @@ import { + MarketInitialized, RewardTokenBorrowSpeedUpdated, RewardTokenSupplySpeedUpdated, + RewardTokenSupplyIndexUpdated, + SupplyLastRewardingBlockUpdated, + BorrowLastRewardingBlockUpdated, + SupplyLastRewardingBlockTimestampUpdated, + BorrowLastRewardingBlockTimestampUpdated, } from '../../generated/templates/RewardsDistributor/RewardsDistributor'; -import { getOrCreateRewardSpeed } from '../operations/getOrCreate'; +import { RewardsDistributor as RewardDistributorContract } from '../../generated/templates/RewardsDistributor/RewardsDistributor'; +import { zeroBigInt32 } from '../constants'; +import exponentToBigInt from '../utilities/exponentToBigInt'; +import { getRewardDistributor } from '../operations/get'; +import { getOrCreateMarketReward } from '../operations/getOrCreate'; + +export function handleMarketInitialized(event: MarketInitialized): void { + const marketReward = getOrCreateMarketReward(event.address, event.params.vToken); + const rewardsDistributor = getRewardDistributor(event.address)!; + if (marketReward.supplyStateIndex.equals(zeroBigInt32)) { + marketReward.supplyStateIndex = exponentToBigInt(36); + } + if (marketReward.borrowStateIndex.equals(zeroBigInt32)) { + marketReward.borrowStateIndex = exponentToBigInt(36); + } + if (rewardsDistributor.isTimeBased) { + marketReward.supplyStateBlockNumberOrTimestamp = event.block.timestamp; + marketReward.borrowStateBlockNumberOrTimestamp = event.block.timestamp; + } else { + marketReward.supplyStateBlockNumberOrTimestamp = event.block.number; + marketReward.borrowStateBlockNumberOrTimestamp = event.block.number; + } + marketReward.save(); +} export function handleRewardTokenBorrowSpeedUpdated(event: RewardTokenBorrowSpeedUpdated): void { - const rewardSpeed = getOrCreateRewardSpeed(event.address, event.params.vToken); - rewardSpeed.borrowSpeedPerBlockMantissa = event.params.newSpeed; - rewardSpeed.save(); + const marketReward = getOrCreateMarketReward(event.address, event.params.vToken); + marketReward.borrowSpeedPerBlockMantissa = event.params.newSpeed; + marketReward.save(); } export function handleRewardTokenSupplySpeedUpdated(event: RewardTokenSupplySpeedUpdated): void { - const rewardSpeed = getOrCreateRewardSpeed(event.address, event.params.vToken); - rewardSpeed.supplySpeedPerBlockMantissa = event.params.newSpeed; - rewardSpeed.save(); + const marketReward = getOrCreateMarketReward(event.address, event.params.vToken); + marketReward.supplySpeedPerBlockMantissa = event.params.newSpeed; + marketReward.save(); +} + +export function handleRewardTokenSupplyIndexUpdated(event: RewardTokenSupplyIndexUpdated): void { + const rewardDistributorContract = RewardDistributorContract.bind(event.address); + const rewardsDistributor = getRewardDistributor(event.address)!; + const marketReward = getOrCreateMarketReward(event.address, event.params.vToken); + if (rewardsDistributor.isTimeBased) { + const supplyState = rewardDistributorContract.rewardTokenSupplyStateTimeBased( + event.params.vToken, + ); + marketReward.supplyStateIndex = supplyState.getIndex(); + marketReward.supplyStateBlockNumberOrTimestamp = supplyState.getTimestamp(); + } else { + const supplyState = rewardDistributorContract.rewardTokenSupplyState(event.params.vToken); + marketReward.supplyStateIndex = supplyState.getIndex(); + marketReward.supplyStateBlockNumberOrTimestamp = supplyState.getBlock(); + } + marketReward.save(); +} + +export function handleRewardTokenBorrowIndexUpdated(event: RewardTokenSupplyIndexUpdated): void { + const rewardDistributorContract = RewardDistributorContract.bind(event.address); + const rewardsDistributor = getRewardDistributor(event.address)!; + const marketReward = getOrCreateMarketReward(event.address, event.params.vToken); + if (rewardsDistributor.isTimeBased) { + const borrowState = rewardDistributorContract.rewardTokenBorrowStateTimeBased( + event.params.vToken, + ); + marketReward.borrowStateIndex = borrowState.getIndex(); + marketReward.borrowStateBlockNumberOrTimestamp = borrowState.getTimestamp(); + } else { + const borrowState = rewardDistributorContract.rewardTokenBorrowState(event.params.vToken); + marketReward.borrowStateIndex = borrowState.getIndex(); + marketReward.borrowStateBlockNumberOrTimestamp = borrowState.getBlock(); + } + marketReward.save(); +} + +export function handleSupplyLastRewardingBlockUpdated( + event: SupplyLastRewardingBlockUpdated, +): void { + const marketReward = getOrCreateMarketReward(event.address, event.params.vToken); + marketReward.supplyLastRewardingBlockTimestamp = event.params.newBlock; + marketReward.save(); +} + +export function handleBorrowLastRewardingBlockUpdated( + event: BorrowLastRewardingBlockUpdated, +): void { + const marketReward = getOrCreateMarketReward(event.address, event.params.vToken); + marketReward.borrowLastRewardingBlockTimestamp = event.params.newBlock; + marketReward.save(); +} + +export function handleSupplyLastRewardingBlockTimestampUpdated( + event: SupplyLastRewardingBlockTimestampUpdated, +): void { + const marketReward = getOrCreateMarketReward(event.address, event.params.vToken); + marketReward.supplyLastRewardingBlockTimestamp = event.params.newTimestamp; + marketReward.save(); +} + +export function handleBorrowLastRewardingBlockTimestampUpdated( + event: BorrowLastRewardingBlockTimestampUpdated, +): void { + const marketReward = getOrCreateMarketReward(event.address, event.params.vToken); + marketReward.borrowLastRewardingBlockTimestamp = event.params.newTimestamp; + marketReward.save(); } diff --git a/subgraphs/isolated-pools/src/mappings/vToken.ts b/subgraphs/isolated-pools/src/mappings/vToken.ts index 41f41420..38911c95 100644 --- a/subgraphs/isolated-pools/src/mappings/vToken.ts +++ b/subgraphs/isolated-pools/src/mappings/vToken.ts @@ -22,7 +22,7 @@ import { VToken as VTokenContract } from '../../generated/PoolRegistry/VToken'; import { nullAddress } from '../constants/addresses'; import { zeroBigInt32 } from '../constants/index'; import { - createAccountVTokenBadDebt, + createMarketPositionBadDebt, createBorrowTransaction, createLiquidateBorrowTransaction, createMintTransaction, @@ -33,8 +33,8 @@ import { import { getMarket } from '../operations/get'; import { getOrCreateAccount } from '../operations/getOrCreate'; import { - updateAccountVTokenBorrow, - updateAccountVTokenSupply, + updateMarketPositionBorrow, + updateMarketPositionSupply, updateMarket, } from '../operations/update'; @@ -56,13 +56,15 @@ export function handleMint(event: Mint): void { // we read the current total amount of supplied tokens by this account in the market const suppliedTotal = event.params.accountBalance; - updateAccountVTokenSupply(event.params.minter, vTokenAddress, event.block.number, suppliedTotal); + updateMarketPositionSupply(event.params.minter, vTokenAddress, event.block.number, suppliedTotal); // and finally we update the market total supply const vTokenContract = VTokenContract.bind(vTokenAddress); - const market = getMarket(vTokenAddress)!; - market.totalSupplyVTokenMantissa = vTokenContract.totalSupply(); - market.save(); + const market = getMarket(vTokenAddress); + if (market) { + market.totalSupplyVTokenMantissa = vTokenContract.totalSupply(); + market.save(); + } } /* Account supplies vTokens into market and receives underlying asset in exchange @@ -80,19 +82,23 @@ export function handleRedeem(event: Redeem): void { createRedeemTransaction(event); // we read the account's balance and... const currentBalance = event.params.accountBalance; - const accountVToken = updateAccountVTokenSupply( + const marketPosition = updateMarketPositionSupply( event.params.redeemer, vTokenAddress, event.block.number, currentBalance, ); - accountVToken.totalUnderlyingRedeemedMantissa = - accountVToken.totalUnderlyingRedeemedMantissa.plus(event.params.redeemAmount); - // and finally we update the market total supply - const vTokenContract = VTokenContract.bind(vTokenAddress); - const market = getMarket(vTokenAddress)!; - market.totalSupplyVTokenMantissa = vTokenContract.totalSupply(); - market.save(); + if (marketPosition) { + marketPosition.totalUnderlyingRedeemedMantissa = + marketPosition.totalUnderlyingRedeemedMantissa.plus(event.params.redeemAmount); + // and finally we update the market total supply + const vTokenContract = VTokenContract.bind(vTokenAddress); + const market = getMarket(vTokenAddress); + if (market) { + market.totalSupplyVTokenMantissa = vTokenContract.totalSupply(); + market.save(); + } + } } /* Borrow assets from the protocol. All values either BNB or BEP20 @@ -107,7 +113,7 @@ export function handleRedeem(event: Redeem): void { export function handleBorrow(event: Borrow): void { const vTokenAddress = event.address; - updateAccountVTokenBorrow( + updateMarketPositionBorrow( event.params.borrower, vTokenAddress, event.block.number, @@ -116,10 +122,11 @@ export function handleBorrow(event: Borrow): void { createBorrowTransaction(event); - const market = getMarket(vTokenAddress)!; - - market.totalBorrowsMantissa = event.params.totalBorrows; - market.save(); + const market = getMarket(vTokenAddress); + if (market) { + market.totalBorrowsMantissa = event.params.totalBorrows; + market.save(); + } } /* Repay some amount borrowed. Anyone can repay anyones balance @@ -139,20 +146,21 @@ export function handleBorrow(event: Borrow): void { export function handleRepayBorrow(event: RepayBorrow): void { const vTokenAddress = event.address; // Its possible to call repayborrow was called without having previously borrowed - const accountVToken = updateAccountVTokenBorrow( + const marketPosition = updateMarketPositionBorrow( event.params.borrower, vTokenAddress, event.block.number, event.params.accountBorrows, ); - const market = getMarket(vTokenAddress)!; - market.totalBorrowsMantissa = event.params.totalBorrows; - market.save(); + const market = getMarket(vTokenAddress); + if (market && marketPosition) { + market.totalBorrowsMantissa = event.params.totalBorrows; + market.save(); - accountVToken.totalUnderlyingRepaidMantissa = accountVToken.totalUnderlyingRepaidMantissa.plus( - event.params.repayAmount, - ); - createRepayBorrowTransaction(event); + marketPosition.totalUnderlyingRepaidMantissa = + marketPosition.totalUnderlyingRepaidMantissa.plus(event.params.repayAmount); + createRepayBorrowTransaction(event); + } } /* @@ -173,42 +181,50 @@ export function handleRepayBorrow(event: RepayBorrow): void { */ export function handleLiquidateBorrow(event: LiquidateBorrow): void { const vTokenAddress = event.address; - const market = getMarket(vTokenAddress)!; - const vTokenContract = VTokenContract.bind(vTokenAddress); - const liquidator = getOrCreateAccount(event.params.liquidator); - liquidator.countLiquidator = liquidator.countLiquidator + 1; - liquidator.save(); + const market = getMarket(vTokenAddress); + if (market) { + const vTokenContract = VTokenContract.bind(vTokenAddress); + const liquidator = getOrCreateAccount(event.params.liquidator); + liquidator.countLiquidator = liquidator.countLiquidator + 1; + liquidator.save(); - const borrower = getOrCreateAccount(event.params.borrower); - borrower.countLiquidated = borrower.countLiquidated + 1; - borrower.save(); + const borrower = getOrCreateAccount(event.params.borrower); + borrower.countLiquidated = borrower.countLiquidated + 1; + borrower.save(); - market.totalSupplyVTokenMantissa = vTokenContract.totalSupply(); - market.save(); + market.totalSupplyVTokenMantissa = vTokenContract.totalSupply(); + market.save(); - createLiquidateBorrowTransaction(event); + createLiquidateBorrowTransaction(event); + } } export function handleProtocolSeize(event: ProtocolSeize): void { const vTokenAddress = event.address; - const market = getMarket(vTokenAddress)!; - const vTokenContract = VTokenContract.bind(vTokenAddress); - market.totalSupplyVTokenMantissa = vTokenContract.totalSupply(); - market.save(); + const market = getMarket(vTokenAddress); + if (market) { + const vTokenContract = VTokenContract.bind(vTokenAddress); + market.totalSupplyVTokenMantissa = vTokenContract.totalSupply(); + market.save(); + } } export function handleAccrueInterest(event: AccrueInterest): void { const market = updateMarket(event.address, event.block.number); - market.totalBorrowsMantissa = event.params.totalBorrows; - market.borrowIndex = event.params.borrowIndex; - market.save(); + if (market) { + market.totalBorrowsMantissa = event.params.totalBorrows; + market.borrowIndex = event.params.borrowIndex; + market.save(); + } } export function handleNewReserveFactor(event: NewReserveFactor): void { const vTokenAddress = event.address; - const market = getMarket(vTokenAddress)!; - market.reserveFactorMantissa = event.params.newReserveFactorMantissa; - market.save(); + const market = getMarket(vTokenAddress); + if (market) { + market.reserveFactorMantissa = event.params.newReserveFactorMantissa; + market.save(); + } } /* Transferring of vTokens @@ -243,7 +259,7 @@ export function handleTransfer(event: Transfer): void { accountToAddress.notEqual(event.address) ) { getOrCreateAccount(accountFromAddress); - updateAccountVTokenSupply( + updateMarketPositionSupply( accountFromAddress, event.address, event.block.number, @@ -259,7 +275,7 @@ export function handleTransfer(event: Transfer): void { accountToAddress.notEqual(event.address) ) { getOrCreateAccount(accountToAddress); - updateAccountVTokenSupply( + updateMarketPositionSupply( accountToAddress, event.address, event.block.number, @@ -272,58 +288,72 @@ export function handleTransfer(event: Transfer): void { export function handleNewMarketInterestRateModel(event: NewMarketInterestRateModel): void { const vTokenAddress = event.address; - const market = getMarket(vTokenAddress)!; - market.interestRateModelAddress = event.params.newInterestRateModel; - market.save(); + const market = getMarket(vTokenAddress); + if (market) { + market.interestRateModelAddress = event.params.newInterestRateModel; + market.save(); + } } export function handleBadDebtIncreased(event: BadDebtIncreased): void { const vTokenAddress = event.address; - const market = getMarket(vTokenAddress)!; - market.badDebtMantissa = event.params.badDebtNew; - market.save(); + const market = getMarket(vTokenAddress); + if (market) { + market.badDebtMantissa = event.params.badDebtNew; + market.save(); + } - createAccountVTokenBadDebt(vTokenAddress, event); + createMarketPositionBadDebt(vTokenAddress, event); } export function handleBadDebtRecovered(event: BadDebtRecovered): void { const vTokenAddress = event.address; - const market = getMarket(vTokenAddress)!; - market.badDebtMantissa = event.params.badDebtNew; - market.save(); + const market = getMarket(vTokenAddress); + if (market) { + market.badDebtMantissa = event.params.badDebtNew; + market.save(); + } } export function handleNewAccessControlManager(event: NewAccessControlManager): void { const vTokenAddress = event.address; - const market = getMarket(vTokenAddress)!; - market.accessControlManagerAddress = event.params.newAccessControlManager; - market.save(); + const market = getMarket(vTokenAddress); + if (market) { + market.accessControlManagerAddress = event.params.newAccessControlManager; + market.save(); + } } export function handleReservesAdded(event: ReservesAdded): void { const vTokenAddress = event.address; - const market = getMarket(vTokenAddress)!; - market.reservesMantissa = event.params.newTotalReserves; - market.save(); + const market = getMarket(vTokenAddress); + if (market) { + market.reservesMantissa = event.params.newTotalReserves; + market.save(); + } } export function handleSpreadReservesReduced(event: SpreadReservesReduced): void { const vTokenAddress = event.address; - const market = getMarket(vTokenAddress)!; - market.reservesMantissa = event.params.newTotalReserves; - market.save(); + const market = getMarket(vTokenAddress); + if (market) { + market.reservesMantissa = event.params.newTotalReserves; + market.save(); + } } export function handleHealBorrow(event: HealBorrow): void { const vTokenAddress = event.address; - updateAccountVTokenBorrow( + updateMarketPositionBorrow( event.params.borrower, Address.fromBytes(vTokenAddress), event.block.number, zeroBigInt32, ); const vTokenContract = VTokenContract.bind(vTokenAddress); - const market = getMarket(vTokenAddress)!; - market.totalBorrowsMantissa = vTokenContract.totalBorrows(); - market.save(); + const market = getMarket(vTokenAddress); + if (market) { + market.totalBorrowsMantissa = vTokenContract.totalBorrows(); + market.save(); + } } diff --git a/subgraphs/isolated-pools/src/operations/create.ts b/subgraphs/isolated-pools/src/operations/create.ts index ad77d507..3f48495a 100644 --- a/subgraphs/isolated-pools/src/operations/create.ts +++ b/subgraphs/isolated-pools/src/operations/create.ts @@ -15,7 +15,7 @@ import { import { Account, AccountPool, - AccountVTokenBadDebt, + MarketPositionBadDebt, Market, Pool, RewardsDistributor, @@ -23,7 +23,6 @@ import { } from '../../generated/schema'; import { Comptroller } from '../../generated/templates/Pool/Comptroller'; import { RewardsDistributor as RewardDistributorContract } from '../../generated/templates/RewardsDistributor/RewardsDistributor'; -import { BEP20 as BEP20Contract } from '../../generated/templates/VToken/BEP20'; import { VToken as VTokenContract } from '../../generated/templates/VToken/VToken'; import { BORROW, LIQUIDATE, MINT, REDEEM, REPAY, TRANSFER, zeroBigInt32 } from '../constants'; import { @@ -37,16 +36,23 @@ import { vWETHLiquidStakedETHAddress, vWETHCoreAddress, } from '../constants/addresses'; +import { + getOrCreateMarketReward, + getOrCreateToken, + getOrCreateWrappedEthToken, + getOrCreateAnkrStakedBNBToken, +} from './getOrCreate'; import { getTokenPriceInCents, valueOrNotAvailableIntIfReverted } from '../utilities'; import { getAccountId, getAccountPoolId, - getAccountVTokenId, + getMarketPositionId, getBadDebtEventId, getPoolId, getRewardsDistributorId, getTransactionEventId, } from '../utilities/ids'; +import valueOrFalseIfReverted from '../utilities/valueOrFalseIfReverted'; export function createPool(comptroller: Address): Pool { const pool = new Pool(getPoolId(comptroller)); @@ -56,6 +62,7 @@ export function createPool(comptroller: Address): Pool { const poolData = poolRegistryContract.getPoolByComptroller(comptroller); const poolMetaData = poolRegistryContract.getVenusPoolMetadata(comptroller); + pool.address = comptroller; pool.name = poolData.name; pool.creator = poolData.creator; pool.blockPosted = poolData.blockPosted; @@ -75,6 +82,7 @@ export function createPool(comptroller: Address): Pool { export function createAccount(accountAddress: Address): Account { const account = new Account(accountAddress); + account.address = accountAddress; account.countLiquidated = 0; account.countLiquidator = 0; account.hasBorrowed = false; @@ -103,7 +111,7 @@ export function createMarket( const vTokenContract = VTokenContract.bind(vTokenAddress); const poolComptroller = Comptroller.bind(comptroller); const underlyingAddress = vTokenContract.underlying(); - const underlyingContract = BEP20Contract.bind(Address.fromBytes(underlyingAddress)); + const market = new Market(vTokenAddress); market.address = vTokenAddress; @@ -114,14 +122,14 @@ export function createMarket( market.interestRateModelAddress = vTokenContract.interestRateModel(); market.symbol = vTokenContract.symbol(); market.vTokenDecimals = vTokenContract.decimals(); + const underlyingToken = getOrCreateToken(underlyingAddress); + market.underlyingToken = underlyingToken.id; - market.underlyingAddress = underlyingAddress; - market.underlyingName = underlyingContract.name(); - market.underlyingSymbol = underlyingContract.symbol(); - const underlyingDecimals = underlyingContract.decimals(); - market.underlyingDecimals = underlyingDecimals; - - const underlyingValue = getTokenPriceInCents(comptroller, vTokenAddress, underlyingDecimals); + const underlyingValue = getTokenPriceInCents( + comptroller, + vTokenAddress, + underlyingToken.decimals, + ); market.lastUnderlyingPriceCents = underlyingValue; market.lastUnderlyingPriceBlockNumber = blockNumber; market.accessControlManagerAddress = vTokenContract.accessControlManager(); @@ -174,15 +182,13 @@ export function createMarket( } if (vTokenAddress.equals(vankrBNBLiquidStakedBNBAddress)) { - market.underlyingAddress = Address.fromHexString('0x5269b7558D3d5E113010Ef1cFF0901c367849CC9'); + market.underlyingToken = getOrCreateAnkrStakedBNBToken().id; market.symbol = 'vankrBNB_LiquidStakedBNB'; - market.underlyingName = 'Ankr Staked BNB '; } if (vTokenAddress.equals(vankrBNBDeFiAddress)) { - market.underlyingAddress = Address.fromHexString('0x5269b7558D3d5E113010Ef1cFF0901c367849CC9'); + market.underlyingToken = getOrCreateAnkrStakedBNBToken().id; market.symbol = 'vankrBNB_DeFi'; - market.underlyingName = 'Ankr Staked BNB '; } if (vTokenAddress.equals(vSnBNBAddress)) { @@ -191,7 +197,7 @@ export function createMarket( } if (vTokenAddress.equals(vWETHLiquidStakedETHAddress) || vTokenAddress.equals(vWETHCoreAddress)) { - market.underlyingAddress = Address.fromHexString('0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9'); + market.underlyingToken = getOrCreateWrappedEthToken().id; } market.save(); @@ -282,30 +288,52 @@ export const createTransferTransaction = (event: Transfer): void => { transaction.save(); }; -export const createAccountVTokenBadDebt = ( +export const createMarketPositionBadDebt = ( marketAddress: Address, event: BadDebtIncreased, ): void => { const id = getBadDebtEventId(event.transaction.hash, event.transactionLogIndex); - const accountVTokenBadDebt = new AccountVTokenBadDebt(id); - const accountVTokenId = getAccountVTokenId(event.params.borrower, marketAddress); - accountVTokenBadDebt.account = accountVTokenId; - accountVTokenBadDebt.block = event.block.number; - accountVTokenBadDebt.amountMantissa = event.params.badDebtDelta; - accountVTokenBadDebt.timestamp = event.block.timestamp; - accountVTokenBadDebt.save(); + const marketPositionBadDebt = new MarketPositionBadDebt(id); + const marketPositionId = getMarketPositionId(event.params.borrower, marketAddress); + marketPositionBadDebt.account = marketPositionId; + marketPositionBadDebt.block = event.block.number; + marketPositionBadDebt.amountMantissa = event.params.badDebtDelta; + marketPositionBadDebt.timestamp = event.block.timestamp; + marketPositionBadDebt.save(); }; -export const createRewardDistributor = ( +export function createRewardDistributor( rewardsDistributorAddress: Address, comptrollerAddress: Address, -): void => { +): RewardsDistributor { const rewardDistributorContract = RewardDistributorContract.bind(rewardsDistributorAddress); const rewardToken = rewardDistributorContract.rewardToken(); const id = getRewardsDistributorId(rewardsDistributorAddress); const rewardsDistributor = new RewardsDistributor(id); + rewardsDistributor.address = rewardsDistributorAddress; rewardsDistributor.pool = comptrollerAddress; - rewardsDistributor.reward = rewardToken; + rewardsDistributor.rewardToken = getOrCreateToken(rewardToken).id; + rewardsDistributor.isTimeBased = valueOrFalseIfReverted( + rewardDistributorContract.try_isTimeBased(), + ); rewardsDistributor.save(); -}; + + // we get the current speeds for all known markets at this point in time + const comptroller = Comptroller.bind(comptrollerAddress); + const marketAddresses = comptroller.getAllMarkets(); + + if (marketAddresses !== null) { + for (let i = 0; i < marketAddresses.length; i++) { + const marketAddress = marketAddresses[i]; + + const rewardSpeed = getOrCreateMarketReward(rewardsDistributorAddress, marketAddress); + rewardSpeed.borrowSpeedPerBlockMantissa = + rewardDistributorContract.rewardTokenBorrowSpeeds(marketAddress); + rewardSpeed.supplySpeedPerBlockMantissa = + rewardDistributorContract.rewardTokenSupplySpeeds(marketAddress); + rewardSpeed.save(); + } + } + return rewardsDistributor; +} diff --git a/subgraphs/isolated-pools/src/operations/get.ts b/subgraphs/isolated-pools/src/operations/get.ts index f25f2c16..001386ca 100644 --- a/subgraphs/isolated-pools/src/operations/get.ts +++ b/subgraphs/isolated-pools/src/operations/get.ts @@ -1,7 +1,12 @@ import { Address, log } from '@graphprotocol/graph-ts'; -import { AccountVToken, Market, Pool } from '../../generated/schema'; -import { getAccountVTokenId, getMarketId, getPoolId } from '../utilities/ids'; +import { MarketPosition, Market, Pool, RewardsDistributor } from '../../generated/schema'; +import { + getMarketPositionId, + getRewardsDistributorId, + getMarketId, + getPoolId, +} from '../utilities/ids'; export const getPool = (comptroller: Address): Pool | null => { const pool = Pool.load(getPoolId(comptroller)); @@ -20,10 +25,17 @@ export const getMarket = (vTokenAddress: Address): Market | null => { return market; }; -export const getAccountVToken = ( +export const getMarketPosition = ( accountAddress: Address, marketAddress: Address, -): AccountVToken | null => { - const accountVTokenId = getAccountVTokenId(accountAddress, marketAddress); - return AccountVToken.load(accountVTokenId); +): MarketPosition | null => { + const marketPositionId = getMarketPositionId(accountAddress, marketAddress); + return MarketPosition.load(marketPositionId); +}; + +export const getRewardDistributor = ( + rewardsDistributorAddress: Address, +): RewardsDistributor | null => { + const id = getRewardsDistributorId(rewardsDistributorAddress); + return RewardsDistributor.load(id); }; diff --git a/subgraphs/isolated-pools/src/operations/getOrCreate.ts b/subgraphs/isolated-pools/src/operations/getOrCreate.ts index d6610c13..4e0c2c8f 100644 --- a/subgraphs/isolated-pools/src/operations/getOrCreate.ts +++ b/subgraphs/isolated-pools/src/operations/getOrCreate.ts @@ -1,38 +1,47 @@ -import { Address, BigInt } from '@graphprotocol/graph-ts'; +import { Address, BigInt, Bytes } from '@graphprotocol/graph-ts'; import { VToken as VTokenContract } from '../../generated/PoolRegistry/VToken'; +import { BEP20 } from '../../generated/PoolRegistry/BEP20'; import { Account, AccountPool, - AccountVToken, + MarketPosition, Market, Pool, - RewardSpeed, + MarketReward, RewardsDistributor, + Token, } from '../../generated/schema'; -import { Comptroller } from '../../generated/templates/Pool/Comptroller'; -import { RewardsDistributor as RewardDistributorContract } from '../../generated/templates/RewardsDistributor/RewardsDistributor'; import { zeroBigInt32 } from '../constants'; import { getAccountPoolId, - getAccountVTokenId, + getMarketPositionId, getPoolId, - getRewardSpeedId, + getMarketRewardId, getRewardsDistributorId, + getTokenId, } from '../utilities/ids'; -import { createAccount, createAccountPool, createMarket, createPool } from './create'; -import { getAccountVToken, getMarket } from './get'; - +import { + createAccount, + createAccountPool, + createMarket, + createPool, + createRewardDistributor, +} from './create'; +import { getMarketPosition, getMarket } from './get'; +import { vBifiAddress } from '../constants/addresses'; + +// BIFI was delisted before it was listed. Creation ignores this market. export const getOrCreateMarket = ( vTokenAddress: Address, comptrollerAddress: Address, blockNumber: BigInt, -): Market => { +): Market | null => { let market = getMarket(vTokenAddress); if (!market) { market = createMarket(vTokenAddress, comptrollerAddress, blockNumber); } - return market as Market; + return market; }; export const getOrCreatePool = (comptroller: Address): Pool => { @@ -63,59 +72,68 @@ export const getOrCreateAccountPool = ( return accountPool; }; -export class GetOrCreateAccountVTokenReturn { - entity: AccountVToken; +export class GetOrCreateMarketPositionReturn { + entity: MarketPosition; created: boolean; } -export const getOrCreateAccountVToken = ( +export const getOrCreateMarketPosition = ( accountAddress: Address, marketAddress: Address, poolAddress: Address, enteredMarket: boolean = false, // eslint-disable-line @typescript-eslint/no-inferrable-types -): GetOrCreateAccountVTokenReturn => { - let accountVToken = getAccountVToken(accountAddress, marketAddress); - let created = false; - if (!accountVToken) { - created = true; - const accountVTokenId = getAccountVTokenId(accountAddress, marketAddress); - accountVToken = new AccountVToken(accountVTokenId); - accountVToken.account = accountAddress; - accountVToken.accountPool = getOrCreateAccountPool(accountAddress, poolAddress).id; - accountVToken.market = marketAddress; - accountVToken.enteredMarket = enteredMarket; - accountVToken.accrualBlockNumber = zeroBigInt32; - - const vTokenContract = VTokenContract.bind(marketAddress); - - accountVToken.vTokenBalanceMantissa = zeroBigInt32; - accountVToken.storedBorrowBalanceMantissa = zeroBigInt32; - accountVToken.borrowIndex = vTokenContract.borrowIndex(); - - accountVToken.totalUnderlyingRedeemedMantissa = zeroBigInt32; - accountVToken.totalUnderlyingRepaidMantissa = zeroBigInt32; - accountVToken.enteredMarket = false; - accountVToken.save(); +): GetOrCreateMarketPositionReturn | null => { + if (marketAddress.notEqual(vBifiAddress)) { + let marketPosition = getMarketPosition(accountAddress, marketAddress); + let created = false; + if (!marketPosition) { + created = true; + const marketPositionId = getMarketPositionId(accountAddress, marketAddress); + marketPosition = new MarketPosition(marketPositionId); + marketPosition.account = accountAddress; + marketPosition.accountPool = getOrCreateAccountPool(accountAddress, poolAddress).id; + marketPosition.market = marketAddress; + marketPosition.enteredMarket = enteredMarket; + marketPosition.accrualBlockNumber = zeroBigInt32; + + const vTokenContract = VTokenContract.bind(marketAddress); + + marketPosition.vTokenBalanceMantissa = zeroBigInt32; + marketPosition.storedBorrowBalanceMantissa = zeroBigInt32; + marketPosition.borrowIndex = vTokenContract.borrowIndex(); + + marketPosition.totalUnderlyingRedeemedMantissa = zeroBigInt32; + marketPosition.totalUnderlyingRepaidMantissa = zeroBigInt32; + marketPosition.enteredMarket = false; + marketPosition.save(); + } + return { entity: marketPosition, created }; } - return { entity: accountVToken, created }; + return null; }; -export const getOrCreateRewardSpeed = ( +export function getOrCreateMarketReward( rewardsDistributorAddress: Address, marketAddress: Address, -): RewardSpeed => { - const id = getRewardSpeedId(rewardsDistributorAddress, marketAddress); - let rewardSpeed = RewardSpeed.load(id); +): MarketReward { + const id = getMarketRewardId(rewardsDistributorAddress, marketAddress); + let rewardSpeed = MarketReward.load(id); if (!rewardSpeed) { - rewardSpeed = new RewardSpeed(id); + rewardSpeed = new MarketReward(id); rewardSpeed.rewardsDistributor = rewardsDistributorAddress; rewardSpeed.market = marketAddress; rewardSpeed.borrowSpeedPerBlockMantissa = zeroBigInt32; rewardSpeed.supplySpeedPerBlockMantissa = zeroBigInt32; + rewardSpeed.supplyStateIndex = zeroBigInt32; + rewardSpeed.supplyStateBlockNumberOrTimestamp = zeroBigInt32; + rewardSpeed.borrowStateIndex = zeroBigInt32; + rewardSpeed.borrowStateBlockNumberOrTimestamp = zeroBigInt32; + rewardSpeed.supplyLastRewardingBlockTimestamp = zeroBigInt32; + rewardSpeed.borrowLastRewardingBlockTimestamp = zeroBigInt32; rewardSpeed.save(); } - return rewardSpeed; -}; + return rewardSpeed as MarketReward; +} export const getOrCreateRewardDistributor = ( rewardsDistributorAddress: Address, @@ -125,30 +143,60 @@ export const getOrCreateRewardDistributor = ( let rewardsDistributor = RewardsDistributor.load(id); if (!rewardsDistributor) { - const rewardDistributorContract = RewardDistributorContract.bind(rewardsDistributorAddress); - const rewardToken = rewardDistributorContract.rewardToken(); - rewardsDistributor = new RewardsDistributor(id); - rewardsDistributor.pool = comptrollerAddress; - rewardsDistributor.reward = rewardToken; - rewardsDistributor.save(); - - // we get the current speeds for all known markets at this point in time - const comptroller = Comptroller.bind(comptrollerAddress); - const marketAddresses = comptroller.getAllMarkets(); - - if (marketAddresses !== null) { - for (let i = 0; i < marketAddresses.length; i++) { - const marketAddress = marketAddresses[i]; - - const rewardSpeed = getOrCreateRewardSpeed(rewardsDistributorAddress, marketAddress); - rewardSpeed.borrowSpeedPerBlockMantissa = - rewardDistributorContract.rewardTokenBorrowSpeeds(marketAddress); - rewardSpeed.supplySpeedPerBlockMantissa = - rewardDistributorContract.rewardTokenSupplySpeeds(marketAddress); - rewardSpeed.save(); - } - } + rewardsDistributor = createRewardDistributor(rewardsDistributorAddress, comptrollerAddress); } - return rewardsDistributor; + return rewardsDistributor as RewardsDistributor; }; + +export function getOrCreateAnkrStakedBNBToken(): Token { + const underlyingTokenAddress = Address.fromBytes( + Bytes.fromHexString('0x5269b7558D3d5E113010Ef1cFF0901c367849CC9'), + ); + let tokenEntity = Token.load(getTokenId(underlyingTokenAddress)); + if (!tokenEntity) { + tokenEntity = new Token(getTokenId(underlyingTokenAddress)); + tokenEntity.address = underlyingTokenAddress; + tokenEntity.name = 'Ankr Staked BNB '; + tokenEntity.symbol = 'ankrBNB'; + tokenEntity.decimals = 18; + tokenEntity.save(); + } + return tokenEntity; +} + +export function getOrCreateWrappedEthToken(): Token { + const underlyingTokenAddress = Address.fromBytes( + Bytes.fromHexString('0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9'), + ); + let tokenEntity = Token.load(getTokenId(underlyingTokenAddress)); + if (!tokenEntity) { + tokenEntity = new Token(getTokenId(underlyingTokenAddress)); + tokenEntity.address = underlyingTokenAddress; + tokenEntity.name = 'Wrapped Ether'; + tokenEntity.symbol = 'WETH '; + tokenEntity.decimals = 18; + tokenEntity.save(); + } + return tokenEntity; +} +/** + * Creates and Token object with symbol and address + * + * @param asset Address of the token + * @returns Token + */ +export function getOrCreateToken(asset: Address): Token { + let tokenEntity = Token.load(getTokenId(asset)); + + if (!tokenEntity) { + const erc20 = BEP20.bind(asset); + tokenEntity = new Token(getTokenId(asset)); + tokenEntity.address = asset; + tokenEntity.name = erc20.name(); + tokenEntity.symbol = erc20.symbol(); + tokenEntity.decimals = erc20.decimals(); + tokenEntity.save(); + } + return tokenEntity; +} diff --git a/subgraphs/isolated-pools/src/operations/update.ts b/subgraphs/isolated-pools/src/operations/update.ts index c65d6f5b..0cc8ba76 100644 --- a/subgraphs/isolated-pools/src/operations/update.ts +++ b/subgraphs/isolated-pools/src/operations/update.ts @@ -1,103 +1,131 @@ import { Address, BigInt } from '@graphprotocol/graph-ts'; import { PoolMetadataUpdatedNewMetadataStruct } from '../../generated/PoolRegistry/PoolRegistry'; -import { AccountVToken, Market } from '../../generated/schema'; +import { MarketPosition, Market } from '../../generated/schema'; import { VToken } from '../../generated/templates/VToken/VToken'; import { valueOrNotAvailableIntIfReverted } from '../utilities'; import { getTokenPriceInCents } from '../utilities'; import { getMarket } from './get'; -import { getOrCreateAccount, getOrCreateAccountVToken, getOrCreatePool } from './getOrCreate'; +import { + getOrCreateAccount, + getOrCreateMarketPosition, + getOrCreatePool, + getOrCreateToken, +} from './getOrCreate'; import { oneBigInt, zeroBigInt32 } from '../constants'; -export const updateAccountVTokenAccrualBlockNumber = ( +export const updateMarketPositionAccrualBlockNumber = ( accountAddress: Address, marketAddress: Address, poolAddress: Address, blockNumber: BigInt, -): AccountVToken => { +): MarketPosition | null => { getOrCreateAccount(accountAddress); - const accountVToken = getOrCreateAccountVToken(accountAddress, marketAddress, poolAddress, false); - accountVToken.entity.accrualBlockNumber = blockNumber; - accountVToken.entity.save(); - return accountVToken.entity as AccountVToken; + const marketPosition = getOrCreateMarketPosition( + accountAddress, + marketAddress, + poolAddress, + false, + ); + if (marketPosition) { + marketPosition.entity.accrualBlockNumber = blockNumber; + marketPosition.entity.save(); + return marketPosition.entity; + } + return null; }; -export const updateAccountVTokenSupply = ( +export const updateMarketPositionSupply = ( accountAddress: Address, marketAddress: Address, blockNumber: BigInt, accountSupplyBalanceMantissa: BigInt, -): AccountVToken => { - const market = getMarket(marketAddress)!; - const accountVToken = updateAccountVTokenAccrualBlockNumber( - accountAddress, - marketAddress, - Address.fromBytes(market.pool), - blockNumber, - ); - const _vTokenBalanceMantissa = accountVToken.vTokenBalanceMantissa; - accountVToken.vTokenBalanceMantissa = accountSupplyBalanceMantissa; - accountVToken.save(); - - if ( - _vTokenBalanceMantissa.equals(zeroBigInt32) && - accountSupplyBalanceMantissa.notEqual(zeroBigInt32) - ) { - market.supplierCount = market.supplierCount.plus(oneBigInt); - } else if ( - accountSupplyBalanceMantissa.equals(zeroBigInt32) && - _vTokenBalanceMantissa.notEqual(zeroBigInt32) - ) { - market.supplierCount = market.supplierCount.minus(oneBigInt); +): MarketPosition | null => { + const market = getMarket(marketAddress); + if (market) { + const marketPosition = updateMarketPositionAccrualBlockNumber( + accountAddress, + marketAddress, + Address.fromBytes(market.pool), + blockNumber, + ); + if (marketPosition) { + const _vTokenBalanceMantissa = marketPosition.vTokenBalanceMantissa; + marketPosition.vTokenBalanceMantissa = accountSupplyBalanceMantissa; + marketPosition.save(); + + if ( + _vTokenBalanceMantissa.equals(zeroBigInt32) && + accountSupplyBalanceMantissa.notEqual(zeroBigInt32) + ) { + market.supplierCount = market.supplierCount.plus(oneBigInt); + } else if ( + accountSupplyBalanceMantissa.equals(zeroBigInt32) && + _vTokenBalanceMantissa.notEqual(zeroBigInt32) + ) { + market.supplierCount = market.supplierCount.minus(oneBigInt); + } + market.save(); + } + return marketPosition; } - market.save(); - return accountVToken as AccountVToken; + return null; }; -export const updateAccountVTokenBorrow = ( +export const updateMarketPositionBorrow = ( accountAddress: Address, marketAddress: Address, blockNumber: BigInt, accountBorrows: BigInt, -): AccountVToken => { - const market = getMarket(marketAddress)!; - const accountVToken = updateAccountVTokenAccrualBlockNumber( - accountAddress, - marketAddress, - Address.fromBytes(market.pool), - blockNumber, - ); - const _storedBorrowBalanceMantissa = accountVToken.storedBorrowBalanceMantissa; - accountVToken.storedBorrowBalanceMantissa = accountBorrows; - const vTokenContract = VToken.bind(marketAddress); - accountVToken.borrowIndex = vTokenContract.borrowIndex(); - accountVToken.save(); - - if (_storedBorrowBalanceMantissa.equals(zeroBigInt32) && accountBorrows.notEqual(zeroBigInt32)) { - market.borrowerCount = market.borrowerCount.plus(oneBigInt); - } else if ( - accountBorrows.equals(zeroBigInt32) && - _storedBorrowBalanceMantissa.notEqual(zeroBigInt32) - ) { - market.borrowerCount = market.borrowerCount.minus(oneBigInt); +): MarketPosition | null => { + const market = getMarket(marketAddress); + if (market) { + const marketPosition = updateMarketPositionAccrualBlockNumber( + accountAddress, + marketAddress, + Address.fromBytes(market.pool), + blockNumber, + ); + if (marketPosition) { + const _storedBorrowBalanceMantissa = marketPosition.storedBorrowBalanceMantissa; + marketPosition.storedBorrowBalanceMantissa = accountBorrows; + const vTokenContract = VToken.bind(marketAddress); + marketPosition.borrowIndex = vTokenContract.borrowIndex(); + marketPosition.save(); + + if ( + _storedBorrowBalanceMantissa.equals(zeroBigInt32) && + accountBorrows.notEqual(zeroBigInt32) + ) { + market.borrowerCount = market.borrowerCount.plus(oneBigInt); + } else if ( + accountBorrows.equals(zeroBigInt32) && + _storedBorrowBalanceMantissa.notEqual(zeroBigInt32) + ) { + market.borrowerCount = market.borrowerCount.minus(oneBigInt); + } + market.save(); + return marketPosition; + } } - market.save(); - return accountVToken as AccountVToken; + return null; }; -export const updateMarket = (vTokenAddress: Address, blockNumber: BigInt): Market => { - const market = getMarket(vTokenAddress)!; - +export const updateMarket = (vTokenAddress: Address, blockNumber: BigInt): Market | null => { + const market = getMarket(vTokenAddress); + if (!market) { + return null; + } // Only updateMarket if it has not been updated this block if (market.accrualBlockNumber.equals(blockNumber)) { return market as Market; } const marketContract = VToken.bind(vTokenAddress); - + const underlyingToken = getOrCreateToken(Address.fromBytes(market.underlyingToken)); const tokenPriceCents = getTokenPriceInCents( Address.fromBytes(market.pool), vTokenAddress, - market.underlyingDecimals, + underlyingToken.decimals, ); market.lastUnderlyingPriceCents = tokenPriceCents; market.lastUnderlyingPriceBlockNumber = blockNumber; @@ -125,7 +153,7 @@ export const updateMarket = (vTokenAddress: Address, blockNumber: BigInt): Marke ); market.save(); - return market as Market; + return market; }; export function updatePoolMetadata( diff --git a/subgraphs/isolated-pools/src/operations/updateOrCreate.ts b/subgraphs/isolated-pools/src/operations/updateOrCreate.ts index e4ec7018..bae8f864 100644 --- a/subgraphs/isolated-pools/src/operations/updateOrCreate.ts +++ b/subgraphs/isolated-pools/src/operations/updateOrCreate.ts @@ -1,47 +1,53 @@ import { Address, BigInt } from '@graphprotocol/graph-ts'; -import { AccountVToken, MarketAction } from '../../generated/schema'; +import { MarketPosition, MarketAction } from '../../generated/schema'; import { Actions } from '../constants'; import Box from '../utilities/box'; import { getMarketActionId } from '../utilities/ids'; -import { getOrCreateAccountVToken } from './getOrCreate'; +import { getOrCreateMarketPosition } from './getOrCreate'; +import { vBifiAddress } from '../constants/addresses'; -export const updateOrCreateAccountVToken = ( +export const updateOrCreateMarketPosition = ( accountAddress: Address, marketAddress: Address, poolAddress: Address, blockNumber: BigInt, enteredMarket: Box | null = null, -): AccountVToken => { +): MarketPosition | null => { let enteredMarketBool = false; if (enteredMarket !== null) { enteredMarketBool = enteredMarket.value; } - const result = getOrCreateAccountVToken( + const result = getOrCreateMarketPosition( accountAddress, marketAddress, poolAddress, enteredMarketBool, ); - const accountVToken = result.entity; - accountVToken.enteredMarket = enteredMarketBool; - accountVToken.accrualBlockNumber = blockNumber; - accountVToken.save(); - - return accountVToken; + if (result) { + const marketPosition = result.entity; + marketPosition.enteredMarket = enteredMarketBool; + marketPosition.accrualBlockNumber = blockNumber; + marketPosition.save(); + return marketPosition; + } + return null; }; export const updateOrCreateMarketAction = ( vTokenAddress: Address, action: i32, pauseState: boolean, -): MarketAction => { - const id = getMarketActionId(vTokenAddress, action); - const marketAction = new MarketAction(id); - marketAction.vToken = vTokenAddress; - marketAction.action = Actions[action]; - marketAction.pauseState = pauseState; - marketAction.save(); - return marketAction; +): MarketAction | null => { + if (vTokenAddress.notEqual(vBifiAddress)) { + const id = getMarketActionId(vTokenAddress, action); + const marketAction = new MarketAction(id); + marketAction.market = vTokenAddress; + marketAction.action = Actions[action]; + marketAction.pauseState = pauseState; + marketAction.save(); + return marketAction; + } + return null; }; diff --git a/subgraphs/isolated-pools/src/utilities/getExchangeRateBigDecimal.ts b/subgraphs/isolated-pools/src/utilities/getExchangeRateBigDecimal.ts index 3cb8f57d..3c9030ae 100644 --- a/subgraphs/isolated-pools/src/utilities/getExchangeRateBigDecimal.ts +++ b/subgraphs/isolated-pools/src/utilities/getExchangeRateBigDecimal.ts @@ -14,7 +14,7 @@ const getExchangeRateBigDecimal = ( - If you call the vUSDC contract on bscscan it comes back (2.0 * 10^14) - The real value is ~0.02. So vDAI is off by 10^28, and vUSDC 10^16 How to calculate for tokens with different decimals - - Must div by tokenDecimals, 10^market.underlyingDecimals + - Must div by tokenDecimals, 10^market.underlyingToken.decimals - Must multiply by vtokenDecimals, 10^8 - Must div by mantissa, 10^18 */ diff --git a/subgraphs/isolated-pools/src/utilities/getTokenPriceInCents.ts b/subgraphs/isolated-pools/src/utilities/getTokenPriceInCents.ts index 3da5d09a..d7fe4d91 100644 --- a/subgraphs/isolated-pools/src/utilities/getTokenPriceInCents.ts +++ b/subgraphs/isolated-pools/src/utilities/getTokenPriceInCents.ts @@ -7,11 +7,11 @@ import exponentToBigInt from './exponentToBigInt'; import valueOrNotAvailableIntIfReverted from './valueOrNotAvailableIntIfReverted'; // Used for all vBEP20 contracts -const getTokenPriceInCents = ( +function getTokenPriceInCents( poolAddress: Address, tokenAddress: Address, underlyingDecimals: i32, -): BigInt => { +): BigInt { const pool = getPool(poolAddress); // will return NOT_AVAILABLE if the price cannot be fetched let underlyingPrice = NOT_AVAILABLE_BIG_INT; @@ -31,6 +31,6 @@ const getTokenPriceInCents = ( underlyingPrice; } return underlyingPrice; -}; +} export default getTokenPriceInCents; diff --git a/subgraphs/isolated-pools/src/utilities/ids.ts b/subgraphs/isolated-pools/src/utilities/ids.ts index 7e94112d..6f30a464 100644 --- a/subgraphs/isolated-pools/src/utilities/ids.ts +++ b/subgraphs/isolated-pools/src/utilities/ids.ts @@ -4,7 +4,7 @@ export const getPoolId = (comptroller: Address): Bytes => comptroller; export const getMarketId = (vTokenAddress: Address): Bytes => vTokenAddress; -export const getAccountVTokenId = (accountAddress: Address, marketAddress: Address): Bytes => +export const getMarketPositionId = (accountAddress: Address, marketAddress: Address): Bytes => accountAddress.concat(marketAddress); export const getAccountId = (accountAddress: Address): Bytes => accountAddress; @@ -21,10 +21,12 @@ export const getBadDebtEventId = (transactionHash: Bytes, transactionLogIndex: B export const getRewardsDistributorId = (rewardsDistributor: Address): Bytes => rewardsDistributor; -export const getRewardSpeedId = ( +export const getMarketRewardId = ( rewardsDistributorAddress: Address, marketAddress: Address, ): Bytes => rewardsDistributorAddress.concat(marketAddress); export const getAccountPoolId = (accountAddress: Address, poolAddress: Address): Bytes => accountAddress.concat(poolAddress); + +export const getTokenId = (tokenAddress: Address): Bytes => tokenAddress; diff --git a/subgraphs/isolated-pools/src/utilities/valueOrFalseIfReverted.ts b/subgraphs/isolated-pools/src/utilities/valueOrFalseIfReverted.ts new file mode 100644 index 00000000..44f7212e --- /dev/null +++ b/subgraphs/isolated-pools/src/utilities/valueOrFalseIfReverted.ts @@ -0,0 +1,8 @@ +import { ethereum } from '@graphprotocol/graph-ts'; + +// checks if a call reverted, in case it is we return false to indicate the wanted value is not available +function valueOrFalseIfReverted(callResult: ethereum.CallResult): boolean { + return callResult.reverted ? false : callResult.value; +} + +export default valueOrFalseIfReverted; diff --git a/subgraphs/isolated-pools/subgraph-client/index.ts b/subgraphs/isolated-pools/subgraph-client/index.ts index 04c201fa..95bb6c02 100644 --- a/subgraphs/isolated-pools/subgraph-client/index.ts +++ b/subgraphs/isolated-pools/subgraph-client/index.ts @@ -5,15 +5,15 @@ import { AccountByIdDocument, AccountFromMarketDocument, AccountPositionsDocument, - AccountVTokenByAccountAndMarketDocument, - AccountVTokenByAccountAndMarketQuery, - AccountVTokenByAccountIdDocument, - AccountVTokensDocument, - AccountVTokensQuery, - AccountVTokensWithBorrowByMarketIdDocument, - AccountVTokensWithBorrowByMarketIdQuery, - AccountVTokensWithSupplyByMarketIdDocument, - AccountVTokensWithSupplyByMarketIdQuery, + MarketPositionByAccountAndMarketDocument, + MarketPositionByAccountAndMarketQuery, + MarketPositionByAccountIdDocument, + MarketPositionsDocument, + MarketPositionsQuery, + MarketPositionsWithBorrowByMarketIdDocument, + MarketPositionsWithBorrowByMarketIdQuery, + MarketPositionsWithSupplyByMarketIdDocument, + MarketPositionsWithSupplyByMarketIdQuery, MarketActionsDocument, MarketByIdDocument, MarketByIdQuery, @@ -21,6 +21,7 @@ import { PoolByIdDocument, PoolsDocument, PoolsQuery, + RewardsDistributorsDocument, } from './.graphclient'; class SubgraphClient { @@ -66,14 +67,14 @@ class SubgraphClient { return result; } - async getAccountVTokens({ + async getMarketPositions({ first = 100, skip = 0, }: { first: number; skip: number; - }): Promise { - const result = await this.query(AccountVTokensDocument, { first, skip } as unknown as { + }): Promise { + const result = await this.query(MarketPositionsDocument, { first, skip } as unknown as { first: string; skip: string; }); @@ -90,17 +91,17 @@ class SubgraphClient { return result; } - async getAccountVTokensByAccountId(accountId: string) { - const result = await this.query(AccountVTokenByAccountIdDocument, { accountId }); + async getMarketPositionsByAccountId(accountId: string) { + const result = await this.query(MarketPositionByAccountIdDocument, { accountId }); return result; } - async getAccountVTokensWithSupplyByMarketId( + async getMarketPositionsWithSupplyByMarketId( marketId: string, page: number, - ): Promise { + ): Promise { const first = 100; - const result = await this.query(AccountVTokensWithSupplyByMarketIdDocument, { + const result = await this.query(MarketPositionsWithSupplyByMarketIdDocument, { marketId, first, skip: first * page, @@ -112,12 +113,12 @@ class SubgraphClient { return result; } - async getAccountVTokensWithBorrowByMarketId( + async getMarketPositionsWithBorrowByMarketId( marketId: string, page: number, - ): Promise { + ): Promise { const first = 100; - const result = await this.query(AccountVTokensWithBorrowByMarketIdDocument, { + const result = await this.query(MarketPositionsWithBorrowByMarketIdDocument, { marketId, first, skip: first * page, @@ -129,23 +130,27 @@ class SubgraphClient { return result; } - async getAccountVTokenByAccountAndMarket({ + async getMarketPositionByAccountAndMarket({ accountId, marketId, }: { accountId: string; marketId: string; - }): Promise { - const result = await this.query(AccountVTokenByAccountAndMarketDocument, { + }): Promise { + const result = await this.query(MarketPositionByAccountAndMarketDocument, { id: `${accountId}${marketId.replace('0x', '')}`, }); - return result || { accountVToken: null }; + return result || { MarketPosition: null }; } async getAccountPositions(id: string) { const result = await this.query(AccountPositionsDocument, { id }); return result; } + async getRewardsDistributors() { + const result = await this.query(RewardsDistributorsDocument, {}); + return result; + } } const createSubgraphClient = (url: string) => new SubgraphClient(url); diff --git a/subgraphs/isolated-pools/subgraph-client/queries/accountPositions.graphql b/subgraphs/isolated-pools/subgraph-client/queries/accountPositions.graphql index d8269cdf..2f58c114 100644 --- a/subgraphs/isolated-pools/subgraph-client/queries/accountPositions.graphql +++ b/subgraphs/isolated-pools/subgraph-client/queries/accountPositions.graphql @@ -17,9 +17,11 @@ query AccountPositions($id: ID!) { id liquidationThresholdMantissa exchangeRateMantissa - underlyingAddress + underlyingToken { + address + decimals + } vTokenDecimals - underlyingDecimals } } borrows: tokens(where: { storedBorrowBalanceMantissa_gt: 0 }) { @@ -28,9 +30,11 @@ query AccountPositions($id: ID!) { borrowIndex market { id - underlyingAddress + underlyingToken { + address + decimals + } vTokenDecimals - underlyingDecimals } } } diff --git a/subgraphs/isolated-pools/subgraph-client/queries/accountVTokensWithBorrowByMarketId.graphql b/subgraphs/isolated-pools/subgraph-client/queries/accountVTokensWithBorrowByMarketId.graphql deleted file mode 100644 index 8aef4f09..00000000 --- a/subgraphs/isolated-pools/subgraph-client/queries/accountVTokensWithBorrowByMarketId.graphql +++ /dev/null @@ -1,10 +0,0 @@ -query AccountVTokensWithBorrowByMarketId($first: Int, $skip: Int, $marketId: String!) { - accountVTokens(first: $first, skip: $skip, where: { market: $marketId, storedBorrowBalanceMantissa_gt: 0 }) { - id - account { - id - } - storedBorrowBalanceMantissa - borrowIndex - } -} diff --git a/subgraphs/isolated-pools/subgraph-client/queries/accountVTokensWithSupplyByMarketId.graphql b/subgraphs/isolated-pools/subgraph-client/queries/accountVTokensWithSupplyByMarketId.graphql deleted file mode 100644 index 78dddfdc..00000000 --- a/subgraphs/isolated-pools/subgraph-client/queries/accountVTokensWithSupplyByMarketId.graphql +++ /dev/null @@ -1,9 +0,0 @@ -query AccountVTokensWithSupplyByMarketId($first: Int, $skip: Int, $marketId: String!) { - accountVTokens(first: $first, skip: $skip, where: { market: $marketId, vTokenBalanceMantissa_gt: 0 }) { - id - account { - id - } - vTokenBalanceMantissa - } -} diff --git a/subgraphs/isolated-pools/subgraph-client/queries/marketActionsQuery.graphql b/subgraphs/isolated-pools/subgraph-client/queries/marketActionsQuery.graphql index cfd901c7..fced784d 100644 --- a/subgraphs/isolated-pools/subgraph-client/queries/marketActionsQuery.graphql +++ b/subgraphs/isolated-pools/subgraph-client/queries/marketActionsQuery.graphql @@ -1,7 +1,9 @@ query MarketActions { marketActions { id - vToken + market { + address + } action pauseState } diff --git a/subgraphs/isolated-pools/subgraph-client/queries/marketByIdQuery.graphql b/subgraphs/isolated-pools/subgraph-client/queries/marketByIdQuery.graphql index 98139d1a..87f6f786 100644 --- a/subgraphs/isolated-pools/subgraph-client/queries/marketByIdQuery.graphql +++ b/subgraphs/isolated-pools/subgraph-client/queries/marketByIdQuery.graphql @@ -16,17 +16,19 @@ query MarketById($id: ID!) { reservesMantissa supplyRateMantissa symbol - underlyingAddress - underlyingName + underlyingToken { + address + name + symbol + decimals + } lastUnderlyingPriceCents lastUnderlyingPriceBlockNumber - underlyingSymbol borrowCapMantissa supplyCapMantissa accrualBlockNumber borrowIndex reserveFactorMantissa - underlyingDecimals supplierCount borrowerCount totalBorrowsMantissa diff --git a/subgraphs/isolated-pools/subgraph-client/queries/accountVTokenByAccount.graphql b/subgraphs/isolated-pools/subgraph-client/queries/marketPositionByAccount.graphql similarity index 74% rename from subgraphs/isolated-pools/subgraph-client/queries/accountVTokenByAccount.graphql rename to subgraphs/isolated-pools/subgraph-client/queries/marketPositionByAccount.graphql index 4cf3a6e9..f5dd064d 100644 --- a/subgraphs/isolated-pools/subgraph-client/queries/accountVTokenByAccount.graphql +++ b/subgraphs/isolated-pools/subgraph-client/queries/marketPositionByAccount.graphql @@ -1,5 +1,5 @@ -query AccountVTokenByAccountId($accountId: String!) { - accountVTokens(where: { account: $accountId }) { +query MarketPositionByAccountId($accountId: String!) { + marketPositions(where: { account: $accountId }) { id market { id diff --git a/subgraphs/isolated-pools/subgraph-client/queries/accountVTokenByAccountAndMarket.graphql b/subgraphs/isolated-pools/subgraph-client/queries/marketPositionByAccountAndMarket.graphql similarity index 85% rename from subgraphs/isolated-pools/subgraph-client/queries/accountVTokenByAccountAndMarket.graphql rename to subgraphs/isolated-pools/subgraph-client/queries/marketPositionByAccountAndMarket.graphql index 00842052..76fa1193 100644 --- a/subgraphs/isolated-pools/subgraph-client/queries/accountVTokenByAccountAndMarket.graphql +++ b/subgraphs/isolated-pools/subgraph-client/queries/marketPositionByAccountAndMarket.graphql @@ -1,5 +1,5 @@ -query AccountVTokenByAccountAndMarket($id: ID!) { - accountVToken(id: $id) { +query MarketPositionByAccountAndMarket($id: ID!) { + marketPosition(id: $id) { id accountPool { pool { diff --git a/subgraphs/isolated-pools/subgraph-client/queries/accountVTokens.graphql b/subgraphs/isolated-pools/subgraph-client/queries/marketPositions.graphql similarity index 77% rename from subgraphs/isolated-pools/subgraph-client/queries/accountVTokens.graphql rename to subgraphs/isolated-pools/subgraph-client/queries/marketPositions.graphql index aaad689a..a72fcb2d 100644 --- a/subgraphs/isolated-pools/subgraph-client/queries/accountVTokens.graphql +++ b/subgraphs/isolated-pools/subgraph-client/queries/marketPositions.graphql @@ -1,5 +1,5 @@ -query AccountVTokens($first: Int, $skip: Int) { - accountVTokens(first: $first, skip: $skip) { +query MarketPositions($first: Int, $skip: Int) { + marketPositions(first: $first, skip: $skip) { id market { id diff --git a/subgraphs/isolated-pools/subgraph-client/queries/marketPositionsWithBorrowByMarketId.graphql b/subgraphs/isolated-pools/subgraph-client/queries/marketPositionsWithBorrowByMarketId.graphql new file mode 100644 index 00000000..a26e6081 --- /dev/null +++ b/subgraphs/isolated-pools/subgraph-client/queries/marketPositionsWithBorrowByMarketId.graphql @@ -0,0 +1,10 @@ +query MarketPositionsWithBorrowByMarketId($first: Int, $skip: Int, $marketId: String!) { + marketPositions(first: $first, skip: $skip, where: { market: $marketId, storedBorrowBalanceMantissa_gt: 0 }) { + id + account { + id + } + storedBorrowBalanceMantissa + borrowIndex + } +} diff --git a/subgraphs/isolated-pools/subgraph-client/queries/marketPositionsWithSupplyByMarketId.graphql b/subgraphs/isolated-pools/subgraph-client/queries/marketPositionsWithSupplyByMarketId.graphql new file mode 100644 index 00000000..5bc6ce60 --- /dev/null +++ b/subgraphs/isolated-pools/subgraph-client/queries/marketPositionsWithSupplyByMarketId.graphql @@ -0,0 +1,9 @@ +query MarketPositionsWithSupplyByMarketId($first: Int, $skip: Int, $marketId: String!) { + marketPositions(first: $first, skip: $skip, where: { market: $marketId, vTokenBalanceMantissa_gt: 0 }) { + id + account { + id + } + vTokenBalanceMantissa + } +} diff --git a/subgraphs/isolated-pools/subgraph-client/queries/marketsQuery.graphql b/subgraphs/isolated-pools/subgraph-client/queries/marketsQuery.graphql index e6939a54..2ddcc486 100644 --- a/subgraphs/isolated-pools/subgraph-client/queries/marketsQuery.graphql +++ b/subgraphs/isolated-pools/subgraph-client/queries/marketsQuery.graphql @@ -15,9 +15,12 @@ query Markets { reservesMantissa supplyRateMantissa symbol - underlyingAddress - underlyingName - underlyingSymbol + underlyingToken { + address + name + symbol + decimals + } vTokenDecimals borrowCapMantissa accrualBlockNumber @@ -26,7 +29,6 @@ query Markets { reserveFactorMantissa lastUnderlyingPriceCents lastUnderlyingPriceBlockNumber - underlyingDecimals supplyCapMantissa accessControlManagerAddress supplierCount diff --git a/subgraphs/isolated-pools/subgraph-client/queries/rewardDistributors.graphql b/subgraphs/isolated-pools/subgraph-client/queries/rewardDistributors.graphql new file mode 100644 index 00000000..4ef13fcd --- /dev/null +++ b/subgraphs/isolated-pools/subgraph-client/queries/rewardDistributors.graphql @@ -0,0 +1,24 @@ +query RewardsDistributors { + rewardsDistributors { + id + address + rewardToken { + address + } + isTimeBased + marketRewards { + id + market { + address + } + borrowSpeedPerBlockMantissa + supplySpeedPerBlockMantissa + supplyStateIndex + supplyStateBlockNumberOrTimestamp + borrowStateIndex + borrowStateBlockNumberOrTimestamp + supplyLastRewardingBlockTimestamp + borrowLastRewardingBlockTimestamp + } + } +} diff --git a/subgraphs/isolated-pools/template.yaml b/subgraphs/isolated-pools/template.yaml index d96cea01..51e50dc0 100644 --- a/subgraphs/isolated-pools/template.yaml +++ b/subgraphs/isolated-pools/template.yaml @@ -172,7 +172,21 @@ templates: - name: RewardsDistributor file: ../../node_modules/@venusprotocol/isolated-pools/artifacts/contracts/Rewards/RewardsDistributor.sol/RewardsDistributor.json eventHandlers: + - event: MarketInitialized(indexed address) + handler: handleMarketInitialized - event: RewardTokenBorrowSpeedUpdated(indexed address,uint256) handler: handleRewardTokenBorrowSpeedUpdated - event: RewardTokenSupplySpeedUpdated(indexed address,uint256) handler: handleRewardTokenSupplySpeedUpdated + - event: RewardTokenSupplyIndexUpdated(indexed address) + handler: handleRewardTokenSupplyIndexUpdated + - event: RewardTokenBorrowIndexUpdated(indexed address,(uint256)) + handler: handleRewardTokenBorrowIndexUpdated + - event: SupplyLastRewardingBlockUpdated(indexed address,uint32) + handler: handleSupplyLastRewardingBlockUpdated + - event: BorrowLastRewardingBlockUpdated(indexed address,uint32) + handler: handleBorrowLastRewardingBlockUpdated + - event: SupplyLastRewardingBlockTimestampUpdated(indexed address,uint256) + handler: handleSupplyLastRewardingBlockTimestampUpdated + - event: BorrowLastRewardingBlockTimestampUpdated(indexed address,uint256) + handler: handleBorrowLastRewardingBlockTimestampUpdated diff --git a/subgraphs/isolated-pools/tests/Pool/index.test.ts b/subgraphs/isolated-pools/tests/Pool/index.test.ts index 0e543362..0d402171 100644 --- a/subgraphs/isolated-pools/tests/Pool/index.test.ts +++ b/subgraphs/isolated-pools/tests/Pool/index.test.ts @@ -29,7 +29,7 @@ import { handleNewSupplyCap, } from '../../src/mappings/pool'; import { handleMarketAdded, handlePoolRegistered } from '../../src/mappings/poolRegistry'; -import { getAccountVTokenId, getMarketActionId } from '../../src/utilities/ids'; +import { getMarketPositionId, getMarketActionId } from '../../src/utilities/ids'; import { createPoolRegisteredEvent } from '../PoolRegistry/events'; import { createRewardsDistributorMock } from '../RewardsDistributor/mocks'; import { PoolInfo, createPoolRegistryMock, createVBep20AndUnderlyingMock } from '../VToken/mocks'; @@ -180,19 +180,19 @@ describe('Pool Events', () => { assert.fieldEquals('Account', accountAddress.toHex(), key, value); }; - const accountVTokenId = getAccountVTokenId(accountAddress, vTokenAddress); + const marketPositionId = getMarketPositionId(accountAddress, vTokenAddress); assertAccountDocument('id', accountAddress.toHexString()); assert.fieldEquals( - 'AccountVToken', - accountVTokenId.toHexString(), + 'MarketPosition', + marketPositionId.toHexString(), 'id', - accountVTokenId.toHexString(), + marketPositionId.toHexString(), ); - assert.fieldEquals('AccountVToken', accountVTokenId.toHexString(), 'enteredMarket', 'true'); + assert.fieldEquals('MarketPosition', marketPositionId.toHexString(), 'enteredMarket', 'true'); assert.fieldEquals( - 'AccountVToken', - accountVTokenId.toHexString(), + 'MarketPosition', + marketPositionId.toHexString(), 'accrualBlockNumber', marketEnteredEvent.block.number.toString(), ); @@ -207,14 +207,14 @@ describe('Pool Events', () => { assert.fieldEquals('Account', accountAddress.toHex(), key, value); }; - const accountVTokenId = getAccountVTokenId(accountAddress, vTokenAddress).toHexString(); + const marketPositionId = getMarketPositionId(accountAddress, vTokenAddress).toHexString(); assertAccountDocument('id', accountAddress.toHexString()); - assert.fieldEquals('AccountVToken', accountVTokenId, 'id', accountVTokenId); - assert.fieldEquals('AccountVToken', accountVTokenId, 'enteredMarket', 'false'); + assert.fieldEquals('MarketPosition', marketPositionId, 'id', marketPositionId); + assert.fieldEquals('MarketPosition', marketPositionId, 'enteredMarket', 'false'); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'accrualBlockNumber', marketExitedEvent.block.number.toString(), ); @@ -321,7 +321,7 @@ describe('Pool Events', () => { const id = getMarketActionId(vTokenAddress, action).toHexString(); assert.fieldEquals('MarketAction', id, 'id', id); - assert.fieldEquals('MarketAction', id, 'vToken', vTokenAddress.toHexString()); + assert.fieldEquals('MarketAction', id, 'market', vTokenAddress.toHexString()); assert.fieldEquals('MarketAction', id, 'action', 'MINT'); assert.fieldEquals('MarketAction', id, 'pauseState', pauseState.toString()); }); diff --git a/subgraphs/isolated-pools/tests/RewardsDistributor/index.test.ts b/subgraphs/isolated-pools/tests/RewardsDistributor/index.test.ts index b3fa07d7..a8c52575 100644 --- a/subgraphs/isolated-pools/tests/RewardsDistributor/index.test.ts +++ b/subgraphs/isolated-pools/tests/RewardsDistributor/index.test.ts @@ -16,9 +16,9 @@ import { handleRewardTokenBorrowSpeedUpdated, handleRewardTokenSupplySpeedUpdated, } from '../../src/mappings/rewardsDistributor'; -import { getRewardSpeedId } from '../../src/utilities/ids'; +import { getMarketRewardId } from '../../src/utilities/ids'; import { createNewRewardsDistributor } from '../Pool/events'; -import { createVBep20AndUnderlyingMock } from '../VToken/mocks'; +import { createVBep20AndUnderlyingMock, createBep20Mock } from '../VToken/mocks'; import { createRewardTokenBorrowSpeedUpdatedEvent, createRewardTokenSupplySpeedUpdatedEvent, @@ -48,6 +48,7 @@ beforeAll(() => { beforeEach(() => { createRewardsDistributorMock(rewardsDistributorAddress, tokenAddress); + createBep20Mock(tokenAddress, 'B0B Coin', 'B0B', BigInt.fromI32(18)); const newRewardsDistributorEvent = createNewRewardsDistributor( comptrollerAddress, rewardsDistributorAddress, @@ -83,21 +84,21 @@ describe('Rewards Distributor', () => { handleRewardTokenBorrowSpeedUpdated(rewardTokenBorrowSpeedUpdatedEvent); - const rewardId = getRewardSpeedId(rewardsDistributorAddress, vTokenAddress).toHexString(); - assert.fieldEquals('RewardSpeed', rewardId, 'id', rewardId); - assert.fieldEquals('RewardSpeed', rewardId, 'market', vTokenAddress.toHexString()); + const rewardId = getMarketRewardId(rewardsDistributorAddress, vTokenAddress).toHexString(); + assert.fieldEquals('MarketReward', rewardId, 'id', rewardId); + assert.fieldEquals('MarketReward', rewardId, 'market', vTokenAddress.toHexString()); assert.fieldEquals( - 'RewardSpeed', + 'MarketReward', rewardId, 'rewardsDistributor', rewardsDistributorAddress.toHexString(), ); - assert.fieldEquals('RewardSpeed', rewardId, 'supplySpeedPerBlockMantissa', '0'); - assert.fieldEquals('RewardSpeed', rewardId, 'borrowSpeedPerBlockMantissa', newBorrowRate); + assert.fieldEquals('MarketReward', rewardId, 'supplySpeedPerBlockMantissa', '0'); + assert.fieldEquals('MarketReward', rewardId, 'borrowSpeedPerBlockMantissa', newBorrowRate); const rewardsDistributor = RewardsDistributor.load(rewardsDistributorAddress)!; - const rewardSpeeds = rewardsDistributor.rewardSpeeds.load(); - assert.stringEquals(rewardId, rewardSpeeds[0].id.toHexString()); + const marketRewards = rewardsDistributor.marketRewards.load(); + assert.stringEquals(rewardId, marketRewards[0].id.toHexString()); }); test('indexes new supply speed', () => { @@ -109,21 +110,21 @@ describe('Rewards Distributor', () => { ); handleRewardTokenSupplySpeedUpdated(rewardTokenSupplySpeedUpdatedEvent); - const rewardId = getRewardSpeedId(rewardsDistributorAddress, vTokenAddress).toHexString(); + const rewardId = getMarketRewardId(rewardsDistributorAddress, vTokenAddress).toHexString(); - assert.fieldEquals('RewardSpeed', rewardId, 'id', rewardId); - assert.fieldEquals('RewardSpeed', rewardId, 'market', vTokenAddress.toHexString()); + assert.fieldEquals('MarketReward', rewardId, 'id', rewardId); + assert.fieldEquals('MarketReward', rewardId, 'market', vTokenAddress.toHexString()); assert.fieldEquals( - 'RewardSpeed', + 'MarketReward', rewardId, 'rewardsDistributor', rewardsDistributorAddress.toHexString(), ); - assert.fieldEquals('RewardSpeed', rewardId, 'supplySpeedPerBlockMantissa', newSupplyRate); - assert.fieldEquals('RewardSpeed', rewardId, 'borrowSpeedPerBlockMantissa', '0'); + assert.fieldEquals('MarketReward', rewardId, 'supplySpeedPerBlockMantissa', newSupplyRate); + assert.fieldEquals('MarketReward', rewardId, 'borrowSpeedPerBlockMantissa', '0'); const rewardsDistributor = RewardsDistributor.load(rewardsDistributorAddress)!; - const rewardSpeeds = rewardsDistributor.rewardSpeeds.load(); - assert.stringEquals(rewardId, rewardSpeeds[0].id.toHexString()); + const marketRewards = rewardsDistributor.marketRewards.load(); + assert.stringEquals(rewardId, marketRewards[0].id.toHexString()); }); }); diff --git a/subgraphs/isolated-pools/tests/RewardsDistributor/mocks.ts b/subgraphs/isolated-pools/tests/RewardsDistributor/mocks.ts index 63d82ecf..243f765b 100644 --- a/subgraphs/isolated-pools/tests/RewardsDistributor/mocks.ts +++ b/subgraphs/isolated-pools/tests/RewardsDistributor/mocks.ts @@ -24,4 +24,8 @@ export const createRewardsDistributorMock = ( ) .withArgs([ethereum.Value.fromAddress(rewardTokenAddress)]) .returns([ethereum.Value.fromUnsignedBigInt(BigInt.fromString('30000000000'))]); + + createMockedFunction(rewardsDistributorAddress, 'isTimeBased', 'isTimeBased():(bool)').returns([ + ethereum.Value.fromBoolean(false), + ]); }; diff --git a/subgraphs/isolated-pools/tests/VToken/index.test.ts b/subgraphs/isolated-pools/tests/VToken/index.test.ts index b3d7e9de..1d7fb8e1 100644 --- a/subgraphs/isolated-pools/tests/VToken/index.test.ts +++ b/subgraphs/isolated-pools/tests/VToken/index.test.ts @@ -38,7 +38,7 @@ import { } from '../../src/mappings/vToken'; import { getMarket } from '../../src/operations/get'; import { getBadDebtEventId } from '../../src/utilities/ids'; -import { getAccountVTokenId, getTransactionEventId } from '../../src/utilities/ids'; +import { getMarketPositionId, getTransactionEventId } from '../../src/utilities/ids'; import { createMarketAddedEvent } from '../Pool/events'; import { createPoolRegisteredEvent } from '../PoolRegistry/events'; import { @@ -56,7 +56,7 @@ import { createSpreadReservesReducedEvent, createTransferEvent, } from './events'; -import { PoolInfo, createAccountVTokenBalanceOfMock, createPoolRegistryMock } from './mocks'; +import { PoolInfo, createMarketPositionBalanceOfMock, createPoolRegistryMock } from './mocks'; import { createPriceOracleMock, createVBep20AndUnderlyingMock } from './mocks'; const underlying1Address = Address.fromString('0x0000000000000000000000000000000000000111'); @@ -110,8 +110,8 @@ beforeAll(() => { createPoolRegistryMock([new PoolInfo('Gamer Pool', rootAddress, comptrollerAddress)]); - createAccountVTokenBalanceOfMock(aTokenAddress, user1Address, zeroBigInt32); - createAccountVTokenBalanceOfMock(bTokenAddress, user1Address, zeroBigInt32); + createMarketPositionBalanceOfMock(aTokenAddress, user1Address, zeroBigInt32); + createMarketPositionBalanceOfMock(bTokenAddress, user1Address, zeroBigInt32); const balanceOfAccount = BigInt.fromI32(100); createMockedFunction( bTokenAddress, @@ -205,35 +205,35 @@ describe('VToken', () => { assert.fieldEquals('Transaction', id, 'blockNumber', mintEvent.block.number.toString()); assert.fieldEquals('Transaction', id, 'blockTime', mintEvent.block.timestamp.toString()); - // AccountVToken - const accountVTokenId = getAccountVTokenId(minter, aTokenAddress).toHexString(); - assert.fieldEquals('AccountVToken', accountVTokenId, 'account', minter.toHexString()); - assert.fieldEquals('AccountVToken', accountVTokenId, 'market', aTokenAddress.toHexString()); + // MarketPosition + const marketPositionId = getMarketPositionId(minter, aTokenAddress).toHexString(); + assert.fieldEquals('MarketPosition', marketPositionId, 'account', minter.toHexString()); + assert.fieldEquals('MarketPosition', marketPositionId, 'market', aTokenAddress.toHexString()); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'accrualBlockNumber', oneBigInt.toString(), ); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'vTokenBalanceMantissa', accountBalance.toString(), ); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'storedBorrowBalanceMantissa', zeroBigInt32.toString(), ); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'totalUnderlyingRedeemedMantissa', zeroBigInt32.toString(), ); - assert.fieldEquals('AccountVToken', accountVTokenId, 'borrowIndex', '300000000000000000000'); + assert.fieldEquals('MarketPosition', marketPositionId, 'borrowIndex', '300000000000000000000'); }); test('registers redeem event', () => { @@ -279,35 +279,35 @@ describe('VToken', () => { assert.fieldEquals('Transaction', id, 'blockNumber', redeemEvent.block.number.toString()); assert.fieldEquals('Transaction', id, 'blockTime', redeemEvent.block.timestamp.toString()); - // AccountVToken - const accountVTokenId = getAccountVTokenId(redeemer, aTokenAddress).toHexString(); - assert.fieldEquals('AccountVToken', accountVTokenId, 'account', redeemer.toHexString()); - assert.fieldEquals('AccountVToken', accountVTokenId, 'market', aTokenAddress.toHexString()); + // MarketPosition + const marketPositionId = getMarketPositionId(redeemer, aTokenAddress).toHexString(); + assert.fieldEquals('MarketPosition', marketPositionId, 'account', redeemer.toHexString()); + assert.fieldEquals('MarketPosition', marketPositionId, 'market', aTokenAddress.toHexString()); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'accrualBlockNumber', oneBigInt.toString(), ); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'vTokenBalanceMantissa', zeroBigInt32.toString(), ); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'storedBorrowBalanceMantissa', zeroBigInt32.toString(), ); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'totalUnderlyingRedeemedMantissa', zeroBigInt32.toString(), ); - assert.fieldEquals('AccountVToken', accountVTokenId, 'borrowIndex', '300000000000000000000'); + assert.fieldEquals('MarketPosition', marketPositionId, 'borrowIndex', '300000000000000000000'); }); test('registers borrow event', () => { @@ -346,7 +346,7 @@ describe('VToken', () => { borrowEvent.transaction.hash, borrowEvent.transactionLogIndex, ).toHexString(); - const accountVTokenId = getAccountVTokenId(borrower, aTokenAddress).toHexString(); + const marketPositionId = getMarketPositionId(borrower, aTokenAddress).toHexString(); const market = getMarket(aTokenAddress); assert.assertNotNull(market); if (!market) { @@ -371,20 +371,20 @@ describe('VToken', () => { ); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'accrualBlockNumber', borrowEvent.block.number.toString(), ); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'storedBorrowBalanceMantissa', accountBorrows.toString(), ); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'borrowIndex', market.borrowIndex.toString(), ); @@ -429,7 +429,7 @@ describe('VToken', () => { repayBorrowEvent.transaction.hash, repayBorrowEvent.transactionLogIndex, ).toHexString(); - const accountVTokenId = getAccountVTokenId(borrower, aTokenAddress).toHexString(); + const marketPositionId = getMarketPositionId(borrower, aTokenAddress).toHexString(); const market = getMarket(aTokenAddress); assert.assertNotNull(market); if (!market) { @@ -459,20 +459,20 @@ describe('VToken', () => { ); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'accrualBlockNumber', repayBorrowEvent.block.number.toString(), ); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'storedBorrowBalanceMantissa', accountBorrows.toString(), ); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'borrowIndex', market.borrowIndex.toString(), ); @@ -610,7 +610,7 @@ describe('VToken', () => { transferEvent.transaction.hash, transferEvent.transactionLogIndex, ).toHexString(); - const accountVTokenId = getAccountVTokenId(from, aTokenAddress).toHexString(); + const marketPositionId = getMarketPositionId(from, aTokenAddress).toHexString(); /** Transaction */ assert.fieldEquals('Transaction', transactionId, 'id', transactionId); @@ -631,8 +631,8 @@ describe('VToken', () => { ); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'vTokenBalanceMantissa', balanceOf.minus(amount).toString(), ); @@ -663,7 +663,7 @@ describe('VToken', () => { transferEvent.transaction.hash, transferEvent.transactionLogIndex, ).toHexString(); - const accountVTokenId = getAccountVTokenId(to, aTokenAddress).toHexString(); + const marketPositionId = getMarketPositionId(to, aTokenAddress).toHexString(); /** Transaction */ assert.fieldEquals('Transaction', transactionId, 'id', transactionId); @@ -684,8 +684,8 @@ describe('VToken', () => { ); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'vTokenBalanceMantissa', balanceOf.plus(amount).toString(), ); @@ -724,7 +724,7 @@ describe('VToken', () => { badDebtNew, ); - const accountVTokenTBadDebtId = getBadDebtEventId( + const marketPositionTBadDebtId = getBadDebtEventId( badDebtIncreasedEvent.transaction.hash, badDebtIncreasedEvent.transaction.index, ).toHexString(); @@ -737,29 +737,29 @@ describe('VToken', () => { badDebtNew.toString(), ); assert.fieldEquals( - 'AccountVTokenBadDebt', - accountVTokenTBadDebtId, + 'MarketPositionBadDebt', + marketPositionTBadDebtId, 'account', - getAccountVTokenId( + getMarketPositionId( badDebtIncreasedEvent.params.borrower, badDebtIncreasedEvent.address, ).toHexString(), ); assert.fieldEquals( - 'AccountVTokenBadDebt', - accountVTokenTBadDebtId, + 'MarketPositionBadDebt', + marketPositionTBadDebtId, 'amountMantissa', badDebtDelta.toString(), ); assert.fieldEquals( - 'AccountVTokenBadDebt', - accountVTokenTBadDebtId, + 'MarketPositionBadDebt', + marketPositionTBadDebtId, 'timestamp', badDebtIncreasedEvent.block.timestamp.toString(), ); assert.fieldEquals( - 'AccountVTokenBadDebt', - accountVTokenTBadDebtId, + 'MarketPositionBadDebt', + marketPositionTBadDebtId, 'block', badDebtIncreasedEvent.block.number.toString(), ); @@ -853,7 +853,7 @@ describe('VToken', () => { mintTokens, accountBalance, ); - createAccountVTokenBalanceOfMock(aTokenAddress, supplier01, mintTokens); + createMarketPositionBalanceOfMock(aTokenAddress, supplier01, mintTokens); handleMint(mintEvent); assert.fieldEquals('Market', marketId, 'supplierCount', '1'); @@ -866,7 +866,7 @@ describe('VToken', () => { mintTokens, accountBalance, ); - createAccountVTokenBalanceOfMock(aTokenAddress, supplier02, mintTokens); + createMarketPositionBalanceOfMock(aTokenAddress, supplier02, mintTokens); handleMint(mintEvent); assert.fieldEquals('Market', marketId, 'supplierCount', '2'); @@ -878,7 +878,7 @@ describe('VToken', () => { mintTokens, zeroBigInt32, ); - createAccountVTokenBalanceOfMock(aTokenAddress, supplier02, zeroBigInt32); + createMarketPositionBalanceOfMock(aTokenAddress, supplier02, zeroBigInt32); handleRedeem(redeemEvent); assert.fieldEquals('Market', marketId, 'supplierCount', '1'); @@ -890,7 +890,7 @@ describe('VToken', () => { halfMintTokens, halfMintTokens, ); - createAccountVTokenBalanceOfMock(aTokenAddress, supplier01, halfMintTokens); + createMarketPositionBalanceOfMock(aTokenAddress, supplier01, halfMintTokens); handleRedeem(redeemEvent); assert.fieldEquals('Market', marketId, 'supplierCount', '1'); @@ -902,7 +902,7 @@ describe('VToken', () => { halfMintTokens, zeroBigInt32, ); - createAccountVTokenBalanceOfMock(aTokenAddress, supplier01, zeroBigInt32); + createMarketPositionBalanceOfMock(aTokenAddress, supplier01, zeroBigInt32); handleRedeem(redeemEvent); assert.fieldEquals('Market', marketId, 'supplierCount', '0'); diff --git a/subgraphs/isolated-pools/tests/VToken/mocks.ts b/subgraphs/isolated-pools/tests/VToken/mocks.ts index 72ab4b71..654b35f6 100644 --- a/subgraphs/isolated-pools/tests/VToken/mocks.ts +++ b/subgraphs/isolated-pools/tests/VToken/mocks.ts @@ -78,6 +78,25 @@ export const createPoolRegistryMock = (pools: Array): void => { }); }; +export const createBep20Mock = ( + contractAddress: Address, + name: string, + symbol: string, + decimals: BigInt, +): void => { + createMockedFunction(contractAddress, 'decimals', 'decimals():(uint8)').returns([ + ethereum.Value.fromUnsignedBigInt(decimals), + ]); + + createMockedFunction(contractAddress, 'name', 'name():(string)').returns([ + ethereum.Value.fromString(name), + ]); + + createMockedFunction(contractAddress, 'symbol', 'symbol():(string)').returns([ + ethereum.Value.fromString(symbol), + ]); +}; + export const createVBep20AndUnderlyingMock = ( contractAddress: Address, underlyingAddress: Address, @@ -130,17 +149,7 @@ export const createVBep20AndUnderlyingMock = ( ).returns([ethereum.Value.fromAddress(accessControlManagerAddress)]); // Underlying - createMockedFunction(underlyingAddress, 'decimals', 'decimals():(uint8)').returns([ - ethereum.Value.fromUnsignedBigInt(decimals), - ]); - - createMockedFunction(underlyingAddress, 'name', 'name():(string)').returns([ - ethereum.Value.fromString(name), - ]); - - createMockedFunction(underlyingAddress, 'symbol', 'symbol():(string)').returns([ - ethereum.Value.fromString(symbol), - ]); + createBep20Mock(underlyingAddress, name, symbol, decimals); createMockedFunction( mockPriceOracleAddress, @@ -228,7 +237,7 @@ export const createPriceOracleMock = (tokens: Array>): voi }); }; -export const createAccountVTokenBalanceOfMock = ( +export const createMarketPositionBalanceOfMock = ( vTokenAddress: Address, accountAddress: Address, balance: BigInt, diff --git a/subgraphs/isolated-pools/tests/integration/checkEntities.ts b/subgraphs/isolated-pools/tests/integration/checkEntities.ts index b4fd62f1..e75c42f4 100644 --- a/subgraphs/isolated-pools/tests/integration/checkEntities.ts +++ b/subgraphs/isolated-pools/tests/integration/checkEntities.ts @@ -13,13 +13,13 @@ const subgraphClient = createSubgraphClient( export const checkMarket = async (marketAddress: string) => { const vToken = await ethers.getContractAt('VToken', marketAddress); const comptroller = await ethers.getContractAt('Comptroller', await vToken.comptroller()); - const { accountVTokens: accountVTokensSupply } = - await subgraphClient.getAccountVTokensWithSupplyByMarketId(marketAddress.toLowerCase(), 0); - const { accountVTokens: accountVTokensBorrow } = - await subgraphClient.getAccountVTokensWithBorrowByMarketId(marketAddress.toLowerCase(), 0); + const { marketPositions: marketPositionsSupply } = + await subgraphClient.getMarketPositionsWithSupplyByMarketId(marketAddress.toLowerCase(), 0); + const { marketPositions: marketPositionsBorrow } = + await subgraphClient.getMarketPositionsWithBorrowByMarketId(marketAddress.toLowerCase(), 0); const { market } = await subgraphClient.getMarketById(marketAddress.toLowerCase()); - expect(market?.supplierCount).to.equal(accountVTokensSupply.length.toString()); - expect(market?.borrowerCount).to.equal(accountVTokensBorrow.length.toString()); + expect(market?.supplierCount).to.equal(marketPositionsSupply.length.toString()); + expect(market?.borrowerCount).to.equal(marketPositionsBorrow.length.toString()); expect(market?.totalBorrowsMantissa).to.equal(await vToken.totalBorrows()); expect(market?.totalSupplyVTokenMantissa).to.equal(await vToken.totalSupply()); @@ -41,7 +41,7 @@ export const checkMarket = async (marketAddress: string) => { expect(market?.reservesMantissa).to.equal(await vToken.totalReserves()); expect(market?.supplyRateMantissa).to.equal(await vToken.supplyRatePerBlock()); expect(market?.symbol).to.equal(await vToken.symbol()); - expect(getAddress(market?.underlyingAddress)).to.equal(await vToken.underlying()); + expect(getAddress(market?.underlyingToken.address)).to.equal(await vToken.underlying()); expect(market?.borrowCapMantissa).to.equal(await comptroller.borrowCaps(marketAddress)); expect(market?.supplyCapMantissa).to.equal(await comptroller.supplyCaps(marketAddress)); expect(market?.accrualBlockNumber).to.equal(await vToken.accrualBlockNumber()); @@ -50,22 +50,22 @@ export const checkMarket = async (marketAddress: string) => { return market; }; -export const checkAccountVToken = async ( +export const checkMarketPosition = async ( accountAddress: string, marketAddress: string, transaction: TransactionResponse, ) => { const vToken = await ethers.getContractAt('VToken', marketAddress); - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ accountId: accountAddress.toLowerCase(), marketId: marketAddress.toLowerCase(), }); - expect(accountVToken!.accrualBlockNumber).to.equal(transaction.blockNumber); - expect(accountVToken!.vTokenBalanceMantissa).to.equal(await vToken.balanceOf(accountAddress)); - expect(accountVToken!.storedBorrowBalanceMantissa).to.equal( + expect(marketPosition!.accrualBlockNumber).to.equal(transaction.blockNumber); + expect(marketPosition!.vTokenBalanceMantissa).to.equal(await vToken.balanceOf(accountAddress)); + expect(marketPosition!.storedBorrowBalanceMantissa).to.equal( await vToken.borrowBalanceStored(accountAddress), ); - expect(accountVToken!.borrowIndex).to.equal(await vToken.borrowIndex()); - expect(accountVToken!.enteredMarket).to.equal(await vToken.checkMembership(accountAddress)); + expect(marketPosition!.borrowIndex).to.equal(await vToken.borrowIndex()); + expect(marketPosition!.enteredMarket).to.equal(await vToken.checkMembership(accountAddress)); }; diff --git a/subgraphs/isolated-pools/tests/integration/pool.ts b/subgraphs/isolated-pools/tests/integration/pool.ts index 8261579c..dce86d6b 100644 --- a/subgraphs/isolated-pools/tests/integration/pool.ts +++ b/subgraphs/isolated-pools/tests/integration/pool.ts @@ -131,7 +131,7 @@ describe('Pools', function () { expect(marketActions.length).to.be.equal(1); marketActions.forEach(ma => { - expect(ma.vToken).to.be.equal(markets[1].id); + expect(ma.market.address).to.be.equal(markets[1].id); expect(ma.action).to.be.equal('REDEEM'); expect(ma.pauseState).to.be.equal(true); }); diff --git a/subgraphs/isolated-pools/tests/integration/vTokens.ts b/subgraphs/isolated-pools/tests/integration/vTokens.ts index c6074df7..c731afa9 100644 --- a/subgraphs/isolated-pools/tests/integration/vTokens.ts +++ b/subgraphs/isolated-pools/tests/integration/vTokens.ts @@ -5,7 +5,7 @@ import { Contract } from 'ethers'; import { ethers } from 'hardhat'; import createSubgraphClient from '../../subgraph-client'; -import { checkAccountVToken, checkMarket } from './checkEntities'; +import { checkMarketPosition, checkMarket } from './checkEntities'; const subgraphClient = createSubgraphClient( 'http://graph-node:8000/subgraphs/name/venusprotocol/venus-isolated-pools', @@ -116,9 +116,9 @@ describe('VToken events', function () { await waitForSubgraphToBeSynced(syncDelay); - checkAccountVToken(supplier1.address, vBtcbToken.address, tx1); + checkMarketPosition(supplier1.address, vBtcbToken.address, tx1); - checkAccountVToken(supplier2.address, vBtcbToken.address, tx2); + checkMarketPosition(supplier2.address, vBtcbToken.address, tx2); const vBtcbMarket = await checkMarket(vBtcbToken.address); // Deployer is initial supplier expect(vBtcbMarket?.supplierCount).to.equal('3'); @@ -140,9 +140,9 @@ describe('VToken events', function () { await waitForSubgraphToBeSynced(syncDelay); - checkAccountVToken(supplier1.address, vBtcbToken.address, tx1); + checkMarketPosition(supplier1.address, vBtcbToken.address, tx1); - checkAccountVToken(supplier2.address, vBtcbToken.address, tx2); + checkMarketPosition(supplier2.address, vBtcbToken.address, tx2); const vBtcbMarket = await checkMarket(vBtcbToken.address); // Deployer is initial supplier @@ -153,9 +153,9 @@ describe('VToken events', function () { await waitForSubgraphToBeSynced(syncDelay); - checkAccountVToken(supplier1.address, vBnxToken.address, tx1); + checkMarketPosition(supplier1.address, vBnxToken.address, tx1); - checkAccountVToken(supplier2.address, vBnxToken.address, tx2); + checkMarketPosition(supplier2.address, vBnxToken.address, tx2); const vBnxMarket = await checkMarket(vBnxToken.address); expect(vBnxMarket?.supplierCount).to.equal('3'); @@ -173,8 +173,8 @@ describe('VToken events', function () { await waitForSubgraphToBeSynced(syncDelay); - checkAccountVToken(supplier1.address, vBtcbToken.address, tx1); - checkAccountVToken(supplier1.address, vBtcbToken.address, tx2); + checkMarketPosition(supplier1.address, vBtcbToken.address, tx1); + checkMarketPosition(supplier1.address, vBtcbToken.address, tx2); const vBtcbMarket = await checkMarket(vBtcbToken.address); @@ -193,8 +193,8 @@ describe('VToken events', function () { await waitForSubgraphToBeSynced(syncDelay); - checkAccountVToken(supplier1.address, vBtcbToken.address, tx1); - checkAccountVToken(supplier1.address, vBtcbToken.address, tx2); + checkMarketPosition(supplier1.address, vBtcbToken.address, tx1); + checkMarketPosition(supplier1.address, vBtcbToken.address, tx2); const vBtcbMarket = await checkMarket(vBtcbToken.address); @@ -208,19 +208,19 @@ describe('VToken events', function () { await waitForSubgraphToBeSynced(syncDelay); for (const vTokenAddress of [vBnxToken.address, vBtcbToken.address]) { - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vTokenAddress.toLowerCase(), accountId: borrower1.address, }); - expect(accountVToken?.enteredMarket).to.equal(true); + expect(marketPosition?.enteredMarket).to.equal(true); } for (const vTokenAddress of [vBnxToken.address, vBtcbToken.address]) { - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vTokenAddress.toLowerCase(), accountId: borrower2.address, }); - expect(accountVToken?.enteredMarket).to.equal(true); + expect(marketPosition?.enteredMarket).to.equal(true); } }); @@ -230,19 +230,19 @@ describe('VToken events', function () { await waitForSubgraphToBeSynced(syncDelay); - const { accountVToken: accountVTokenVUsdt } = - await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition: marketPositionVUsdt } = + await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vBtcbToken.address.toLowerCase(), accountId: borrower1.address, }); - expect(accountVTokenVUsdt?.enteredMarket).to.equal(false); + expect(marketPositionVUsdt?.enteredMarket).to.equal(false); - const { accountVToken: accountVTokenVDoge } = - await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition: marketPositionVDoge } = + await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vBnxToken.address.toLowerCase(), accountId: borrower2.address, }); - expect(accountVTokenVDoge?.enteredMarket).to.equal(false); + expect(marketPositionVDoge?.enteredMarket).to.equal(false); }); it('should update the borrower count on the market for new borrows', async function () { @@ -266,8 +266,8 @@ describe('VToken events', function () { await waitForSubgraphToBeSynced(syncDelay); - checkAccountVToken(borrower1.address, vBtcbToken.address, tx1); - checkAccountVToken(borrower2.address, vBnxToken.address, tx2); + checkMarketPosition(borrower1.address, vBtcbToken.address, tx1); + checkMarketPosition(borrower2.address, vBnxToken.address, tx2); const vBtcbMarket = await checkMarket(vBtcbToken.address); expect(vBtcbMarket?.borrowerCount).to.equal('1'); @@ -286,8 +286,8 @@ describe('VToken events', function () { await waitForSubgraphToBeSynced(syncDelay); - checkAccountVToken(borrower1.address, vBtcbToken.address, tx1); - checkAccountVToken(borrower2.address, vBnxToken.address, tx2); + checkMarketPosition(borrower1.address, vBtcbToken.address, tx1); + checkMarketPosition(borrower2.address, vBnxToken.address, tx2); const vBtcbMarket = await checkMarket(vBtcbToken.address); expect(vBtcbMarket?.borrowerCount).to.equal('1'); @@ -303,7 +303,7 @@ describe('VToken events', function () { await waitForSubgraphToBeSynced(syncDelay); - checkAccountVToken(borrower1.address, vBtcbToken.address, tx1); + checkMarketPosition(borrower1.address, vBtcbToken.address, tx1); const vBnxMarket = await checkMarket(vBnxToken.address); expect(vBnxMarket?.borrowerCount).to.equal('1'); @@ -347,7 +347,7 @@ describe('VToken events', function () { await waitForSubgraphToBeSynced(syncDelay); - checkAccountVToken(borrower1.address, vBnxToken.address, tx); + checkMarketPosition(borrower1.address, vBnxToken.address, tx); await checkMarket(vBnxToken.address); @@ -365,7 +365,7 @@ describe('VToken events', function () { // root, one borrower, 2suppliers, and liquidator added as suppliers expect(vBnxMarket?.supplierCount).to.equal('5'); - checkAccountVToken(liquidator1.address, vBnxToken.address, tx); + checkMarketPosition(liquidator1.address, vBnxToken.address, tx); // @todo check why repaying exact amount causes an overflow error // let borrowBalanceCurrent = await vBnxToken.borrowBalanceStored(borrower2.address); // await vBtcbToken.connect(borrower1).repayBorrow(borrowBalanceCurrent.sub(750000000000000)); @@ -403,7 +403,7 @@ describe('VToken events', function () { await waitForSubgraphToBeSynced(syncDelay); - checkAccountVToken(borrower2.address, vBnxToken.address, tx); + checkMarketPosition(borrower2.address, vBnxToken.address, tx); const vBnxMarket = await checkMarket(vBnxToken.address); expect(vBnxMarket?.borrowerCount).to.equal('0'); @@ -422,8 +422,8 @@ describe('VToken events', function () { await waitForSubgraphToBeSynced(syncDelay); - checkAccountVToken(supplier.address, vToken.address, tx); - checkAccountVToken(liquidator1.address, vToken.address, tx); + checkMarketPosition(supplier.address, vToken.address, tx); + checkMarketPosition(liquidator1.address, vToken.address, tx); } }); @@ -455,9 +455,9 @@ describe('VToken events', function () { expect(market?.badDebtMantissa).to.equal((await vBnxToken.badDebt()).toString()); - const { accountVTokens } = await subgraphClient.getAccountVTokens({ first: 100, skip: 0 }); + const { marketPositions } = await subgraphClient.getMarketPositions({ first: 100, skip: 0 }); - const vBnxAccountTokens = accountVTokens.find( + const vBnxAccountTokens = marketPositions.find( avt => avt.id.includes(borrower2.address.slice(2, 42).toLowerCase()) && avt.market.id.toLowerCase() == vBnxToken.address.toLowerCase(), diff --git a/subgraphs/isolated-pools/tests/scripts/checkAccountVTokens.ts b/subgraphs/isolated-pools/tests/scripts/checkMarketPositions.ts similarity index 53% rename from subgraphs/isolated-pools/tests/scripts/checkAccountVTokens.ts rename to subgraphs/isolated-pools/tests/scripts/checkMarketPositions.ts index ce641d67..31a54264 100644 --- a/subgraphs/isolated-pools/tests/scripts/checkAccountVTokens.ts +++ b/subgraphs/isolated-pools/tests/scripts/checkMarketPositions.ts @@ -5,37 +5,37 @@ import { BigNumber, ethers } from 'ethers'; import createSubgraphClient from '../../subgraph-client'; -const checkAccountVTokens = async ( +const checkMarketPositions = async ( provider: providers.MulticallProvider, subgraphClient: ReturnType, ) => { let page = 0; const skip = 100; while (page >= 0) { - const { accountVTokens } = await subgraphClient.getAccountVTokens({ + const { marketPositions } = await subgraphClient.getMarketPositions({ first: skip, skip: skip * page, }); await Promise.all( - accountVTokens.map(async accountVToken => { + marketPositions.map(async marketPosition => { const vTokenContract = new ethers.Contract( - accountVToken.market.id, + marketPosition.market.id, VBep20Abi.abi, provider, ); - const accountBalance = await vTokenContract.balanceOf(accountVToken.account.id); + const accountBalance = await vTokenContract.balanceOf(marketPosition.account.id); const borrowBalanceStored = await vTokenContract.borrowBalanceStored( - accountVToken.account.id, + marketPosition.account.id, ); try { assert.equal( - accountVToken.vTokenBalanceMantissa, + marketPosition.vTokenBalanceMantissa, accountBalance.toString(), - `incorrect supply balance for account ${accountVToken.account.id} in market ${ - accountVToken.market.symbol - } ${accountVToken.market.id}. Subgraph Value: ${ - accountVToken.vTokenBalanceMantissa + `incorrect supply balance for account ${marketPosition.account.id} in market ${ + marketPosition.market.symbol + } ${marketPosition.market.id}. Subgraph Value: ${ + marketPosition.vTokenBalanceMantissa }, contractValue: ${accountBalance.toString()}`, ); } catch (e) { @@ -43,16 +43,16 @@ const checkAccountVTokens = async ( } try { - const updatedSubgraphValue = BigNumber.from(accountVToken.storedBorrowBalanceMantissa) - .mul(accountVToken.market.borrowIndex) - .div(accountVToken.borrowIndex) + const updatedSubgraphValue = BigNumber.from(marketPosition.storedBorrowBalanceMantissa) + .mul(marketPosition.market.borrowIndex) + .div(marketPosition.borrowIndex) .toString(); // borrower.borrowBalance * market.borrowIndex / borrower.borrowIndex assert.equal( updatedSubgraphValue, borrowBalanceStored.toString(), ` - incorrect borrow balance on account ${accountVToken.account.id} on market ${accountVToken.market.symbol} ${accountVToken.market.id}, accountBorrowIndex: ${accountVToken.borrowIndex}, marketBorrowIndex ${accountVToken.market.borrowIndex} subgraphValue: ${updatedSubgraphValue} contractValue: ${borrowBalanceStored}`, + incorrect borrow balance on account ${marketPosition.account.id} on market ${marketPosition.market.symbol} ${marketPosition.market.id}, accountBorrowIndex: ${marketPosition.borrowIndex}, marketBorrowIndex ${marketPosition.market.borrowIndex} subgraphValue: ${updatedSubgraphValue} contractValue: ${borrowBalanceStored}`, ); } catch (e) { console.log(e.message); @@ -60,7 +60,7 @@ const checkAccountVTokens = async ( }), ); console.log(`processed ${skip * (page + 1)}...`); - if (accountVTokens.length == 0) { + if (marketPositions.length == 0) { page = -1; } else { page += 1; @@ -68,4 +68,4 @@ const checkAccountVTokens = async ( } }; -export default checkAccountVTokens; +export default checkMarketPositions; diff --git a/subgraphs/isolated-pools/tests/scripts/checkMarkets.ts b/subgraphs/isolated-pools/tests/scripts/checkMarkets.ts index ec41d206..9c0ef7bc 100644 --- a/subgraphs/isolated-pools/tests/scripts/checkMarkets.ts +++ b/subgraphs/isolated-pools/tests/scripts/checkMarkets.ts @@ -24,13 +24,13 @@ const countSuppliers = async ( let supplierCount = 0; let page = 0; while (page >= 0) { - const { accountVTokens } = await subgraphClient.getAccountVTokensWithSupplyByMarketId( + const { marketPositions } = await subgraphClient.getMarketPositionsWithSupplyByMarketId( marketAddress, page, ); - supplierCount += accountVTokens.length; + supplierCount += marketPositions.length; - if (accountVTokens.length == 0) { + if (marketPositions.length == 0) { page = -1; } else { page += 1; @@ -47,14 +47,14 @@ const countBorrower = async ( let borrowerCount = 0; let page = 0; while (page >= 0) { - const { accountVTokens } = await subgraphClient.getAccountVTokensWithBorrowByMarketId( + const { marketPositions } = await subgraphClient.getMarketPositionsWithBorrowByMarketId( marketAddress, page, ); - borrowerCount += accountVTokens.length; + borrowerCount += marketPositions.length; - if (accountVTokens.length == 0) { + if (marketPositions.length == 0) { page = -1; } else { page += 1; @@ -140,10 +140,10 @@ const checkMarkets = async ( assertEqual(market, symbol, 'symbol'); assertEqual(market, decimals, 'vTokenDecimals'); - assertEqual(market, underlyingAddress, 'underlyingAddress', getAddress); - assertEqual(market, underlyingName, 'underlyingName'); - assertEqual(market, underlyingSymbol, 'underlyingSymbol'); - assertEqual(market, underlyingDecimals, 'underlyingDecimals'); + assertEqual(market.underlyingToken, underlyingAddress, 'address', getAddress); + assertEqual(market.underlyingToken, underlyingName, 'name'); + assertEqual(market.underlyingToken, underlyingSymbol, 'symbol'); + assertEqual(market.underlyingToken, underlyingDecimals, 'decimals'); assertEqual(market, marketStorage.isListed, 'isListed'); assertEqual(market, marketStorage.collateralFactorMantissa, 'collateralFactorMantissa'); assertEqual(market, marketStorage.liquidationThresholdMantissa, 'liquidationThresholdMantissa'); diff --git a/subgraphs/isolated-pools/tests/scripts/index.ts b/subgraphs/isolated-pools/tests/scripts/index.ts index e45d5145..df7f67da 100644 --- a/subgraphs/isolated-pools/tests/scripts/index.ts +++ b/subgraphs/isolated-pools/tests/scripts/index.ts @@ -2,9 +2,10 @@ import { providers } from '@0xsequence/multicall'; import { ethers } from 'ethers'; import createSubgraphClient from '../../subgraph-client'; -import checkAccountVTokens from './checkAccountVTokens'; +import checkMarketPositions from './checkMarketPositions'; import checkComptroller from './checkComptroller'; import checkMarkets from './checkMarkets'; +import checkRewardsDistributors from './rewardsDistributors'; import dotenv from 'dotenv'; dotenv.config({ path: '../../.env' }); @@ -19,7 +20,8 @@ const run = async () => { await checkComptroller(provider, subgraphClient); await checkMarkets(provider, subgraphClient); - await checkAccountVTokens(provider, subgraphClient); + await checkMarketPositions(provider, subgraphClient); + await checkRewardsDistributors(provider, subgraphClient); }; export default run(); diff --git a/subgraphs/isolated-pools/tests/scripts/rewardsDistributors.ts b/subgraphs/isolated-pools/tests/scripts/rewardsDistributors.ts new file mode 100644 index 00000000..2c32a72e --- /dev/null +++ b/subgraphs/isolated-pools/tests/scripts/rewardsDistributors.ts @@ -0,0 +1,94 @@ +import { providers } from '@0xsequence/multicall'; +import { abi as RewardsDistributorAbi } from '@venusprotocol/isolated-pools/artifacts/contracts/Rewards/RewardsDistributor.sol/RewardsDistributor.json'; +import { assertEqual } from '@venusprotocol/subgraph-utils'; +import { ethers } from 'ethers'; +import createSubgraphClient from '../../subgraph-client'; + +const { getAddress } = ethers.utils; + +const checkRewardsDistributors = async ( + provider: providers.MulticallProvider, + subgraphClient: ReturnType, +) => { + const { rewardsDistributors } = await subgraphClient.getRewardsDistributors(); + for (const rd of rewardsDistributors) { + const rewardDistributor = new ethers.Contract(rd.address, RewardsDistributorAbi, provider); + let isTimeBased = false; + try { + isTimeBased = await rewardDistributor.isTimeBased(); + } catch (e) { + console.log('failed to query isTimeBased'); + } + assertEqual(rd, isTimeBased, 'isTimeBased'); + assertEqual(rd.rewardToken, await rewardDistributor.rewardToken(), 'address', getAddress); + + for (const marketReward of rd.marketRewards) { + const [borrowSpeedPerBlockMantissa, supplySpeedPerBlockMantissa] = await Promise.all([ + rewardDistributor.rewardTokenBorrowSpeeds(marketReward.market.address), + rewardDistributor.rewardTokenSupplySpeeds(marketReward.market.address), + ]); + let supplyStateIndex; + let borrowStateIndex; + let supplyStateBlockNumberOrTimestamp; + let borrowStateBlockNumberOrTimestamp; + let supplyStateLastRewardingBlockTimestamp; + let borrowStateLastRewardingBlockTimestamp; + if (isTimeBased) { + const supplyState = await rewardDistributor.rewardTokenSupplyStateTimeBased( + marketReward.market.address, + ); + const borrowState = await rewardDistributor.rewardTokenBorrowStateTimeBased( + marketReward.market.address, + ); + + supplyStateIndex = supplyState.index; + borrowStateIndex = borrowState.index; + supplyStateBlockNumberOrTimestamp = supplyState.timestamp; + borrowStateBlockNumberOrTimestamp = borrowState.timestamp; + supplyStateLastRewardingBlockTimestamp = supplyState.lastRewardingBlock; + borrowStateLastRewardingBlockTimestamp = borrowState.lastRewardingBlock; + } else { + const supplyState = await rewardDistributor.rewardTokenSupplyState( + marketReward.market.address, + ); + const borrowState = await rewardDistributor.rewardTokenBorrowState( + marketReward.market.address, + ); + + supplyStateIndex = supplyState.index; + borrowStateIndex = borrowState.index; + supplyStateBlockNumberOrTimestamp = supplyState.block; + borrowStateBlockNumberOrTimestamp = borrowState.block; + supplyStateLastRewardingBlockTimestamp = supplyState.lastRewardingBlock; + borrowStateLastRewardingBlockTimestamp = borrowState.lastRewardingBlock; + } + // market + assertEqual(marketReward, borrowSpeedPerBlockMantissa, 'borrowSpeedPerBlockMantissa'); + assertEqual(marketReward, supplySpeedPerBlockMantissa, 'supplySpeedPerBlockMantissa'); + assertEqual(marketReward, supplyStateIndex, 'supplyStateIndex'); + assertEqual( + marketReward, + supplyStateBlockNumberOrTimestamp, + 'supplyStateBlockNumberOrTimestamp', + ); + assertEqual(marketReward, borrowStateIndex, 'borrowStateIndex'); + assertEqual( + marketReward, + borrowStateBlockNumberOrTimestamp, + 'borrowStateBlockNumberOrTimestamp', + ); + assertEqual( + marketReward, + supplyStateLastRewardingBlockTimestamp || 0, + 'supplyLastRewardingBlockTimestamp', + ); + assertEqual( + marketReward, + borrowStateLastRewardingBlockTimestamp || 0, + 'borrowLastRewardingBlockTimestamp', + ); + } + } +}; + +export default checkRewardsDistributors; diff --git a/subgraphs/protocol-reserve/.releaserc b/subgraphs/protocol-reserve/.releaserc index 31a2f26c..aa486939 100644 --- a/subgraphs/protocol-reserve/.releaserc +++ b/subgraphs/protocol-reserve/.releaserc @@ -58,7 +58,7 @@ } ], [ - "semantic-release-yarn", + "@semantic-release/npm", { "npmPublish": false } @@ -76,7 +76,8 @@ [ "@semantic-release/exec", { - "prepareCmd": "./prepare.sh" + "prepareCmd": "./prepare.sh", + "successCmd": "./deploy.sh" } ] ], @@ -85,8 +86,8 @@ "name": "main" }, { - "name": "pre-*", - "prerelease": "pre" + "name": "testnet", + "prerelease": true } ] } \ No newline at end of file diff --git a/subgraphs/protocol-reserve/deploy.sh b/subgraphs/protocol-reserve/deploy.sh new file mode 100755 index 00000000..bcf640a6 --- /dev/null +++ b/subgraphs/protocol-reserve/deploy.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +version=($(jq -r '.version' package.json)) + +if [[ $version == *"-testnet"* ]]; then + yarn graph auth --studio $TESTNET_GRAPH_CLI_API_KEY + yarn deploy:chapel --version-label $version + yarn deploy:sepolia --version-label $version +else + yarn graph auth --studio $MAINNET_GRAPH_CLI_API_KEY + yarn deploy:bsc --version-label $version + yarn deploy:ethereum --version-label $version +fi diff --git a/subgraphs/protocol-reserve/package.json b/subgraphs/protocol-reserve/package.json index f46cdc24..90efd096 100644 --- a/subgraphs/protocol-reserve/package.json +++ b/subgraphs/protocol-reserve/package.json @@ -1,6 +1,6 @@ { "name": "@venusprotocol/protocol-reserve-subgraph", - "version": "1.1.0", + "version": "1.2.0-testnet.6", "license": "MIT", "repository": { "url": "https://github.com/VenusProtocol/subgraphs", @@ -33,11 +33,12 @@ "devDependencies": { "@graphprotocol/client-cli": "3.0.0", "@graphprotocol/graph-cli": "^0.80.0", - "@venusprotocol/subgraph-utils": "workspace:^", + "@venusprotocol/subgraph-utils": "0.0.0", "apollo-fetch": "^0.7.0", "semantic-release": "^23.1.1", "semantic-release-monorepo": "^8.0.2", "ts-node": "^10.9.2", "urql": "^3.0.3" - } + }, + "stableVersion": "1.1.0" } diff --git a/subgraphs/protocol-reserve/prepare.sh b/subgraphs/protocol-reserve/prepare.sh index 131f8cc0..1f730dc9 100755 --- a/subgraphs/protocol-reserve/prepare.sh +++ b/subgraphs/protocol-reserve/prepare.sh @@ -1,4 +1,7 @@ #!/bin/bash # Install from root cd ../.. -yarn + +git pull + +YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn diff --git a/subgraphs/protocol-reserve/src/mappings/token.ts b/subgraphs/protocol-reserve/src/mappings/token.ts index 65c3815d..a70b7bad 100644 --- a/subgraphs/protocol-reserve/src/mappings/token.ts +++ b/subgraphs/protocol-reserve/src/mappings/token.ts @@ -1,5 +1,5 @@ import { TokenConverterConfig } from '../../generated/schema'; -import { Transfer } from '../../generated/templates/Token/ERC20'; +import { Transfer } from '../../generated/templates/ERC20/ERC20'; import { getTokenConverter } from '../operations/get'; export function handleTransferIn(event: Transfer): void { diff --git a/subgraphs/protocol-reserve/template-eth.yaml b/subgraphs/protocol-reserve/template-eth.yaml index e8a74322..804ff2da 100644 --- a/subgraphs/protocol-reserve/template-eth.yaml +++ b/subgraphs/protocol-reserve/template-eth.yaml @@ -226,12 +226,12 @@ dataSources: handler: handleDestinationAddressUpdated - event: BaseAssetUpdated(indexed address,indexed address) handler: handleBaseAssetUpdated + - event: PriceOracleUpdated(indexed address,indexed address) + handler: handlePriceOracleUpdated blockHandlers: - handler: handleInitializationXvsVaultConverter filter: kind: once - - event: PriceOracleUpdated(indexed address,indexed address) - handler: handlePriceOracleUpdated templates: - name: ERC20 kind: ethereum/contract diff --git a/subgraphs/venus-governance/.releaserc b/subgraphs/venus-governance/.releaserc index 31a2f26c..aa486939 100644 --- a/subgraphs/venus-governance/.releaserc +++ b/subgraphs/venus-governance/.releaserc @@ -58,7 +58,7 @@ } ], [ - "semantic-release-yarn", + "@semantic-release/npm", { "npmPublish": false } @@ -76,7 +76,8 @@ [ "@semantic-release/exec", { - "prepareCmd": "./prepare.sh" + "prepareCmd": "./prepare.sh", + "successCmd": "./deploy.sh" } ] ], @@ -85,8 +86,8 @@ "name": "main" }, { - "name": "pre-*", - "prerelease": "pre" + "name": "testnet", + "prerelease": true } ] } \ No newline at end of file diff --git a/subgraphs/venus-governance/config/index.ts b/subgraphs/venus-governance/config/index.ts index c84f32bb..e8eeb8e6 100644 --- a/subgraphs/venus-governance/config/index.ts +++ b/subgraphs/venus-governance/config/index.ts @@ -22,18 +22,18 @@ const main = () => { network: 'hardhat', accessControlManagerAddress: '0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9', accessControlManagerStartBlock: '0', - governorAlphaAddress: '0xb185E9f6531BA9877741022C92CE858cDCc5760E', + governorAlphaAddress: '0x71a0b8A2245A9770A4D887cE1E4eCc6C1d4FF28c', governorAlphaStartBlock: '0', - governorAlpha2Address: '0x01E21d7B8c39dc4C764c19b308Bd8b14B1ba139E', + governorAlpha2Address: '0x9Fcca440F19c62CDF7f973eB6DDF218B15d4C71D', governorAlpha2StartBlock: '0', - governorBravoDelegatorAddress: '0x7C8BaafA542c57fF9B2B90612bf8aB9E86e22C09', + governorBravoDelegatorAddress: '0x547382C0D1b23f707918D3c83A77317B71Aa8470', governorBravoDelegatorStartBlock: '0', xvsTokenAddress: '0x0E801D84Fa97b50751Dbf25036d067dCf18858bF', xvsTokenStartBlock: '0', xvsVaultAddress: '0x9d4454B023096f34B160D6B654540c56A1F81688', xvsVaultStartBlock: '0', xvsVaultPid: '0', - omnichainProposalSenderAddress: '0x0a17FabeA4633ce714F1Fa4a2dcA62C3bAc4758d', + omnichainProposalSenderAddress: '0x7C8BaafA542c57fF9B2B90612bf8aB9E86e22C09', omnichainProposalSenderStartBlock: '0', }, chapel: { diff --git a/subgraphs/venus-governance/deploy.sh b/subgraphs/venus-governance/deploy.sh new file mode 100755 index 00000000..683db2dd --- /dev/null +++ b/subgraphs/venus-governance/deploy.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +version=($(jq -r '.version' package.json)) + +if [[ $version == *"testnet"* ]]; then + yarn graph auth --studio $TESTNET_GRAPH_CLI_API_KEY + yarn deploy:chapel --version-label $version +else + yarn graph auth --studio $MAINNET_GRAPH_CLI_API_KEY + yarn deploy:bsc --version-label $version +fi + + + diff --git a/subgraphs/venus-governance/package.json b/subgraphs/venus-governance/package.json index 5fb6b401..b78d1b9c 100644 --- a/subgraphs/venus-governance/package.json +++ b/subgraphs/venus-governance/package.json @@ -1,6 +1,6 @@ { "name": "@venusprotocol/governance-subgraph", - "version": "1.0.2", + "version": "1.1.0-testnet.2", "license": "MIT", "repository": { "url": "https://github.com/VenusProtocol/subgraphs", @@ -28,13 +28,14 @@ "devDependencies": { "@graphprotocol/client-cli": "3.0.0", "@graphprotocol/graph-cli": "^0.80.0", - "@venusprotocol/governance-contracts": "2.5.0-dev.3", - "@venusprotocol/subgraph-utils": "workspace:^", + "@venusprotocol/governance-contracts": "2.7.0", + "@venusprotocol/subgraph-utils": "0.0.0", "apollo-fetch": "^0.7.0", "hardhat": "^2.10.2", "semantic-release": "^23.1.1", "semantic-release-monorepo": "^8.0.2", "ts-node": "^10.9.2", "urql": "^3.0.3" - } + }, + "stableVersion": "1.0.2" } diff --git a/subgraphs/venus-governance/prepare.sh b/subgraphs/venus-governance/prepare.sh old mode 100755 new mode 100644 index 131f8cc0..95627139 --- a/subgraphs/venus-governance/prepare.sh +++ b/subgraphs/venus-governance/prepare.sh @@ -1,4 +1,7 @@ #!/bin/bash # Install from root cd ../.. -yarn + +git pull + +YARN_ENABLE_IMMUTABLE_INSTALLS=true yarn diff --git a/subgraphs/venus/.releaserc b/subgraphs/venus/.releaserc index 31a2f26c..aa486939 100644 --- a/subgraphs/venus/.releaserc +++ b/subgraphs/venus/.releaserc @@ -58,7 +58,7 @@ } ], [ - "semantic-release-yarn", + "@semantic-release/npm", { "npmPublish": false } @@ -76,7 +76,8 @@ [ "@semantic-release/exec", { - "prepareCmd": "./prepare.sh" + "prepareCmd": "./prepare.sh", + "successCmd": "./deploy.sh" } ] ], @@ -85,8 +86,8 @@ "name": "main" }, { - "name": "pre-*", - "prerelease": "pre" + "name": "testnet", + "prerelease": true } ] } \ No newline at end of file diff --git a/subgraphs/venus/deploy.sh b/subgraphs/venus/deploy.sh new file mode 100755 index 00000000..683db2dd --- /dev/null +++ b/subgraphs/venus/deploy.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +version=($(jq -r '.version' package.json)) + +if [[ $version == *"testnet"* ]]; then + yarn graph auth --studio $TESTNET_GRAPH_CLI_API_KEY + yarn deploy:chapel --version-label $version +else + yarn graph auth --studio $MAINNET_GRAPH_CLI_API_KEY + yarn deploy:bsc --version-label $version +fi + + + diff --git a/subgraphs/venus/package.json b/subgraphs/venus/package.json index cf9a8398..6782da93 100644 --- a/subgraphs/venus/package.json +++ b/subgraphs/venus/package.json @@ -1,6 +1,6 @@ { "name": "@venusprotocol/core-pool-subgraph", - "version": "1.1.2", + "version": "1.2.0-testnet.5", "license": "MIT", "repository": { "url": "https://github.com/VenusProtocol/subgraphs", @@ -28,7 +28,7 @@ "dependencies": { "@graphprotocol/client-cli": "3.0.0", "@graphprotocol/graph-cli": "^0.80.0", - "@venusprotocol/venus-protocol": "9.3.0", + "@venusprotocol/venus-protocol": "9.4.0", "@venusprotocol/venus-protocol-orig-events": "npm:@venusprotocol/venus-protocol@2.2.1", "hardhat": "^2.10.2", "ts-node": "^10.9.2" @@ -36,5 +36,6 @@ "devDependencies": { "semantic-release": "^23.1.1", "semantic-release-monorepo": "^8.0.2" - } + }, + "stableVersion": "1.1.2" } diff --git a/subgraphs/venus/prepare.sh b/subgraphs/venus/prepare.sh index 131f8cc0..1f730dc9 100755 --- a/subgraphs/venus/prepare.sh +++ b/subgraphs/venus/prepare.sh @@ -1,4 +1,7 @@ #!/bin/bash # Install from root cd ../.. -yarn + +git pull + +YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn diff --git a/subgraphs/venus/schema.graphql b/subgraphs/venus/schema.graphql index 69e3cd5d..f8002a22 100644 --- a/subgraphs/venus/schema.graphql +++ b/subgraphs/venus/schema.graphql @@ -4,6 +4,8 @@ The Comptroller type has protocol level variables stored type Comptroller @entity { "ID is set to comptroller address" id: Bytes! + "Comptroller Address" + address: Bytes! "Address of price oracle the comptroller uses" priceOracle: Bytes! "Factor used to determine repayAmount for liquidating" @@ -14,14 +16,31 @@ type Comptroller @entity { maxAssets: BigInt! } +""" +ERC20 Token +""" +type Token @entity(immutable: true) { + "Address of the asset" + id: Bytes! + "Address of the asset" + address: Bytes! + "Name of the asset" + name: String! + "Symbol of the asset" + symbol: String + "Decimals of the asset" + decimals: Int! +} + """ Market stores all high level variables for a vToken market """ type Market @entity { "VToken address" id: Bytes! + "Vtoken Address" + address: Bytes! "vToken decimal length" - #Fields that match Venus API vTokenDecimals: Int! "Name of the vToken" name: String! @@ -47,14 +66,8 @@ type Market @entity { totalBorrowsMantissa: BigInt! "Total vToken supplied" totalSupplyVTokenMantissa: BigInt! - "Underlying token address" - underlyingAddress: Bytes! - "Underlying token name" - underlyingName: String! - "Underlying token symbol" - underlyingSymbol: String! - "Underlying token decimal length" - underlyingDecimals: Int! + "Underlying Token" + underlyingToken: Token! "XVS Supply Distribution Block" xvsSupplyStateBlock: BigInt! "XVS Supply Distribution Index" @@ -68,7 +81,6 @@ type Market @entity { "The rate at which XVS is distributed to the corresponding borrow market (per block)" xvsBorrowSpeed: BigInt! - # Fields that are not in Venus api "Block the market is updated to" accrualBlockNumber: BigInt! "The history of the markets borrow index return (Think S&P 500)" @@ -89,7 +101,7 @@ type Market @entity { borrowerCount: BigInt! "Accounts who participate in this market" - accounts: [AccountVToken!]! @derivedFrom(field:"market") + accounts: [MarketPosition!]! @derivedFrom(field:"market") } """ @@ -97,10 +109,12 @@ Account is an BNB address, with a list of all vToken markets the account has participated in, along with liquidation information. """ type Account @entity { - "User BNB address" + "Account address" id: Bytes! + "Account address" + address: Bytes! "Array of VTokens user is in" - tokens: [AccountVToken!]! @derivedFrom(field: "account") + tokens: [MarketPosition!]! @derivedFrom(field: "account") "Count user has been liquidated" countLiquidated: Int! "Count user has liquidated others" @@ -110,10 +124,9 @@ type Account @entity { } """ -AccountVToken is a single account within a single vToken market, with data such -as interest earned or paid +MarketPosition is a single account within a single vToken market """ -type AccountVToken @entity { +type MarketPosition @entity { "Concatenation of VToken address and user address" id: Bytes! "Relation to market" diff --git a/subgraphs/venus/src/mappings/comptroller.ts b/subgraphs/venus/src/mappings/comptroller.ts index 7e476cfd..da1aed11 100644 --- a/subgraphs/venus/src/mappings/comptroller.ts +++ b/subgraphs/venus/src/mappings/comptroller.ts @@ -20,13 +20,14 @@ import { Comptroller } from '../../generated/schema'; import { zeroBigInt32 } from '../constants'; import { comptrollerAddress, nullAddress } from '../constants/addresses'; import { getComptroller, getMarket } from '../operations/get'; -import { getOrCreateAccountVToken, getOrCreateMarket } from '../operations/getOrCreate'; +import { getOrCreateMarketPosition, getOrCreateMarket } from '../operations/getOrCreate'; import { updateXvsBorrowState } from '../operations/updateXvsBorrowState'; import { updateXvsSupplyState } from '../operations/updateXvsSupplyState'; // eslint-disable-next-line @typescript-eslint/no-unused-vars export function handleInitialization(block: ethereum.Block): void { const comptroller = new Comptroller(comptrollerAddress); + comptroller.address = comptrollerAddress; comptroller.priceOracle = nullAddress; comptroller.closeFactorMantissa = zeroBigInt32; comptroller.liquidationIncentive = zeroBigInt32; @@ -50,18 +51,18 @@ export function handleMarketUnlisted(event: MarketListed): void { export function handleMarketEntered(event: MarketEntered): void { const market = getOrCreateMarket(event.params.vToken, event); - const result = getOrCreateAccountVToken(event.params.account, Address.fromBytes(market.id)); - const accountVToken = result.entity; - accountVToken.enteredMarket = true; - accountVToken.save(); + const result = getOrCreateMarketPosition(event.params.account, Address.fromBytes(market.id)); + const marketPosition = result.entity; + marketPosition.enteredMarket = true; + marketPosition.save(); } export function handleMarketExited(event: MarketExited): void { const market = getOrCreateMarket(event.params.vToken, event); - const result = getOrCreateAccountVToken(event.params.account, Address.fromBytes(market.id)); - const accountVToken = result.entity; - accountVToken.enteredMarket = false; - accountVToken.save(); + const result = getOrCreateMarketPosition(event.params.account, Address.fromBytes(market.id)); + const marketPosition = result.entity; + marketPosition.enteredMarket = false; + marketPosition.save(); } export function handleNewCloseFactor(event: NewCloseFactor): void { diff --git a/subgraphs/venus/src/mappings/vToken.ts b/subgraphs/venus/src/mappings/vToken.ts index d64cdbb6..fa974477 100644 --- a/subgraphs/venus/src/mappings/vToken.ts +++ b/subgraphs/venus/src/mappings/vToken.ts @@ -1,5 +1,6 @@ /* eslint-disable prefer-const */ // to satisfy AS compiler +import { Address } from '@graphprotocol/graph-ts'; import { AccrueInterest, Borrow, @@ -29,10 +30,11 @@ import { } from '../operations/create'; import { getOrCreateAccount, - getOrCreateAccountVToken, + getOrCreateMarketPosition, getOrCreateMarket, + getOrCreateToken, } from '../operations/getOrCreate'; -import { updateAccountVTokenSupply, updateAccountVTokenBorrow } from '../operations/update'; +import { updateMarketPositionSupply, updateMarketPositionBorrow } from '../operations/update'; import { updateMarketCashMantissa } from '../operations/updateMarketCashMantissa'; import { updateMarketRates } from '../operations/updateMarketRates'; import { getUnderlyingPrice } from '../utilities'; @@ -51,7 +53,7 @@ import { getUnderlyingPrice } from '../utilities'; export function handleMint(event: Mint): void { const marketAddress = event.address; - updateAccountVTokenSupply( + updateMarketPositionSupply( event.params.minter, marketAddress, event.block.number, @@ -70,7 +72,7 @@ export function handleMint(event: Mint): void { export function handleMintBehalf(event: MintBehalf): void { const marketAddress = event.address; - updateAccountVTokenSupply( + updateMarketPositionSupply( event.params.receiver, marketAddress, event.block.number, @@ -99,17 +101,17 @@ export function handleMintBehalf(event: MintBehalf): void { export function handleRedeem(event: Redeem): void { const marketAddress = event.address; - updateAccountVTokenSupply( + updateMarketPositionSupply( event.params.redeemer, marketAddress, event.block.number, event.params.totalSupply, ); - const accountVToken = getOrCreateAccountVToken(event.params.redeemer, marketAddress); - accountVToken.entity.totalUnderlyingRedeemedMantissa = - accountVToken.entity.totalUnderlyingRedeemedMantissa.plus(event.params.redeemAmount); - accountVToken.entity.save(); + const marketPosition = getOrCreateMarketPosition(event.params.redeemer, marketAddress); + marketPosition.entity.totalUnderlyingRedeemedMantissa = + marketPosition.entity.totalUnderlyingRedeemedMantissa.plus(event.params.redeemAmount); + marketPosition.entity.save(); const market = getOrCreateMarket(marketAddress, event); @@ -141,7 +143,7 @@ export function handleBorrow(event: Borrow): void { account.hasBorrowed = true; account.save(); - updateAccountVTokenBorrow( + updateMarketPositionBorrow( event.params.borrower, marketAddress, event.block.number, @@ -172,17 +174,17 @@ export function handleRepayBorrow(event: RepayBorrow): void { market.save(); - const accountVToken = updateAccountVTokenBorrow( + const marketPosition = updateMarketPositionBorrow( event.params.borrower, marketAddress, event.block.number, event.params.accountBorrows, ); - accountVToken.totalUnderlyingRepaidMantissa = accountVToken.totalUnderlyingRepaidMantissa.plus( + marketPosition.totalUnderlyingRepaidMantissa = marketPosition.totalUnderlyingRepaidMantissa.plus( event.params.repayAmount, ); - accountVToken.save(); + marketPosition.save(); createRepayEvent(event); } @@ -241,12 +243,12 @@ export function handleTransfer(event: Transfer): void { accountToAddress.notEqual(event.address) ) { getOrCreateAccount(accountFromAddress); - const accountVToken = getOrCreateAccountVToken(accountFromAddress, event.address); - updateAccountVTokenSupply( + const marketPosition = getOrCreateMarketPosition(accountFromAddress, event.address); + updateMarketPositionSupply( accountFromAddress, event.address, event.block.number, - accountVToken.entity.vTokenBalanceMantissa.minus(event.params.amount), + marketPosition.entity.vTokenBalanceMantissa.minus(event.params.amount), ); } @@ -258,12 +260,12 @@ export function handleTransfer(event: Transfer): void { accountToAddress.notEqual(event.address) ) { getOrCreateAccount(accountToAddress); - const accountVToken = getOrCreateAccountVToken(accountToAddress, event.address); - updateAccountVTokenSupply( + const marketPosition = getOrCreateMarketPosition(accountToAddress, event.address); + updateMarketPositionSupply( accountToAddress, event.address, event.block.number, - accountVToken.entity.vTokenBalanceMantissa.plus(event.params.amount), + marketPosition.entity.vTokenBalanceMantissa.plus(event.params.amount), ); } @@ -280,7 +282,8 @@ export function handleAccrueInterest(event: AccrueInterest): void { market.borrowIndex = event.params.borrowIndex; market.totalBorrowsMantissa = event.params.totalBorrows; updateMarketCashMantissa(market, vTokenContract); - market.lastUnderlyingPriceCents = getUnderlyingPrice(marketAddress, market.underlyingDecimals); + const underlyingToken = getOrCreateToken(Address.fromBytes(market.underlyingToken)); + market.lastUnderlyingPriceCents = getUnderlyingPrice(marketAddress, underlyingToken.decimals); market.lastUnderlyingPriceBlockNumber = event.block.number; updateMarketRates(market, vTokenContract); @@ -302,13 +305,13 @@ export function handleNewMarketInterestRateModel(event: NewMarketInterestRateMod export function handleMintV1(event: MintV1): void { const marketAddress = event.address; - const accountVToken = getOrCreateAccountVToken(event.params.minter, marketAddress); + const marketPosition = getOrCreateMarketPosition(event.params.minter, marketAddress); // Creation updates balance - updateAccountVTokenSupply( + updateMarketPositionSupply( event.params.minter, event.address, event.block.number, - accountVToken.entity.vTokenBalanceMantissa.plus(event.params.mintTokens), + marketPosition.entity.vTokenBalanceMantissa.plus(event.params.mintTokens), ); const market = getOrCreateMarket(event.address, event); @@ -323,13 +326,13 @@ export function handleMintV1(event: MintV1): void { export function handleMintBehalfV1(event: MintBehalfV1): void { const marketAddress = event.address; - const accountVToken = getOrCreateAccountVToken(event.params.receiver, marketAddress); + const marketPosition = getOrCreateMarketPosition(event.params.receiver, marketAddress); // Creation updates balance - updateAccountVTokenSupply( + updateMarketPositionSupply( event.params.receiver, event.address, event.block.number, - accountVToken.entity.vTokenBalanceMantissa.plus(event.params.mintTokens), + marketPosition.entity.vTokenBalanceMantissa.plus(event.params.mintTokens), ); const market = getOrCreateMarket(event.address, event); @@ -353,14 +356,14 @@ export function handleRedeemV1(event: RedeemV1): void { createRedeemEvent(event); - const result = getOrCreateAccountVToken(event.params.redeemer, marketAddress); - const accountVToken = result.entity; + const result = getOrCreateMarketPosition(event.params.redeemer, marketAddress); + const marketPosition = result.entity; - updateAccountVTokenSupply( + updateMarketPositionSupply( event.params.redeemer, event.address, event.block.number, - accountVToken.vTokenBalanceMantissa.minus(event.params.redeemTokens), + marketPosition.vTokenBalanceMantissa.minus(event.params.redeemTokens), ); } diff --git a/subgraphs/venus/src/operations/getOrCreate.ts b/subgraphs/venus/src/operations/getOrCreate.ts index 591833b8..8cdda6df 100644 --- a/subgraphs/venus/src/operations/getOrCreate.ts +++ b/subgraphs/venus/src/operations/getOrCreate.ts @@ -1,6 +1,6 @@ import { Address, BigInt, Bytes, ethereum } from '@graphprotocol/graph-ts'; -import { Account, AccountVToken, Market } from '../../generated/schema'; +import { Account, MarketPosition, Market, Token } from '../../generated/schema'; import { VToken as VTokenTemplate, VTokenUpdatedEvents as VTokenUpdatedEventsTemplate, @@ -20,7 +20,7 @@ import { valueOrNotAvailableAddressIfReverted, valueOrNotAvailableIntIfReverted, } from '../utilities'; -import { getAccountVTokenId } from '../utilities/ids'; +import { getMarketPositionId, getTokenId } from '../utilities/ids'; import { getMarket } from './get'; import { updateMarketCashMantissa } from './updateMarketCashMantissa'; import { updateMarketRates } from './updateMarketRates'; @@ -31,6 +31,7 @@ export function getOrCreateMarket(marketAddress: Address, event: ethereum.Event) const vTokenContract = VToken.bind(marketAddress); const comptrollerContract = Comptroller.bind(vTokenContract.comptroller()); market = new Market(marketAddress); + market.address = marketAddress; market.isListed = true; market.xvsBorrowStateBlock = event.block.number; market.xvsSupplyStateBlock = event.block.number; @@ -53,16 +54,15 @@ export function getOrCreateMarket(marketAddress: Address, event: ethereum.Event) // It is vBNB, which has a slightly different interface if (market.symbol == 'vBNB') { - market.underlyingAddress = nativeAddress; - market.underlyingDecimals = 18; - market.underlyingName = 'BNB'; - market.underlyingSymbol = 'BNB'; + const tokenEntity = new Token(getTokenId(nativeAddress)); + tokenEntity.address = nativeAddress; + tokenEntity.name = 'BNB'; + tokenEntity.symbol = 'BNB'; + tokenEntity.decimals = 18; + tokenEntity.save(); + market.underlyingToken = tokenEntity.id; } else { - market.underlyingAddress = vTokenContract.underlying(); - const underlyingContract = BEP20.bind(Address.fromBytes(market.underlyingAddress)); - market.underlyingDecimals = underlyingContract.decimals(); - market.underlyingName = underlyingContract.name(); - market.underlyingSymbol = underlyingContract.symbol(); + market.underlyingToken = getOrCreateToken(vTokenContract.underlying()).id; } market.interestRateModelAddress = valueOrNotAvailableAddressIfReverted( @@ -73,7 +73,8 @@ export function getOrCreateMarket(marketAddress: Address, event: ethereum.Event) vTokenContract.try_reserveFactorMantissa(), 'vBEP20 try_reserveFactorMantissa()', ); - market.lastUnderlyingPriceCents = getUnderlyingPrice(marketAddress, market.underlyingDecimals); + const underlyingToken = getOrCreateToken(Address.fromBytes(market.underlyingToken)); + market.lastUnderlyingPriceCents = getUnderlyingPrice(marketAddress, underlyingToken.decimals); market.lastUnderlyingPriceBlockNumber = event.block.number; market.accrualBlockNumber = vTokenContract.accrualBlockNumber(); @@ -92,12 +93,6 @@ export function getOrCreateMarket(marketAddress: Address, event: ethereum.Event) market.totalBorrowsMantissa = zeroBigInt32; market.reservesMantissa = zeroBigInt32; - if (marketAddress.equals(vwbETHAddress)) { - market.underlyingAddress = Address.fromHexString( - '0x9c37E59Ba22c4320547F00D4f1857AF1abd1Dd6f', - ); - } - if (marketAddress.equals(vTRXAddressAddress)) { market.symbol = 'vTRXOLD'; market.name = 'Venus TRXOLD'; @@ -122,6 +117,7 @@ export function getOrCreateAccount(accountId: Bytes): Account { let account = Account.load(accountId); if (!account) { account = new Account(accountId); + account.address = accountId; account.countLiquidated = 0; account.countLiquidator = 0; account.hasBorrowed = false; @@ -130,39 +126,77 @@ export function getOrCreateAccount(accountId: Bytes): Account { return account; } -export class GetOrCreateAccountVTokenReturn { - entity: AccountVToken; +export class GetOrCreateMarketPositionReturn { + entity: MarketPosition; created: boolean; } -export function getOrCreateAccountVToken( +export function getOrCreateMarketPosition( accountId: Address, marketId: Address, -): GetOrCreateAccountVTokenReturn { - const accountVTokenId = getAccountVTokenId(accountId, marketId); - let accountVToken = AccountVToken.load(accountVTokenId); +): GetOrCreateMarketPositionReturn { + const marketPositionId = getMarketPositionId(accountId, marketId); + let marketPosition = MarketPosition.load(marketPositionId); let created = false; - if (!accountVToken) { + if (!marketPosition) { created = true; - accountVToken = new AccountVToken(accountVTokenId); - accountVToken.market = marketId; + marketPosition = new MarketPosition(marketPositionId); + marketPosition.market = marketId; getOrCreateAccount(accountId); - accountVToken.account = accountId; + marketPosition.account = accountId; const vTokenContract = VToken.bind(marketId); - accountVToken.vTokenBalanceMantissa = zeroBigInt32; + marketPosition.vTokenBalanceMantissa = zeroBigInt32; - accountVToken.totalUnderlyingRedeemedMantissa = zeroBigInt32; - accountVToken.totalUnderlyingRepaidMantissa = zeroBigInt32; - accountVToken.storedBorrowBalanceMantissa = zeroBigInt32; - accountVToken.accrualBlockNumber = zeroBigInt32; - accountVToken.borrowIndex = valueOrNotAvailableIntIfReverted( + marketPosition.totalUnderlyingRedeemedMantissa = zeroBigInt32; + marketPosition.totalUnderlyingRepaidMantissa = zeroBigInt32; + marketPosition.storedBorrowBalanceMantissa = zeroBigInt32; + marketPosition.accrualBlockNumber = zeroBigInt32; + marketPosition.borrowIndex = valueOrNotAvailableIntIfReverted( vTokenContract.try_borrowIndex(), 'vBEP20 try_borrowIndex()', ); - accountVToken.enteredMarket = false; - accountVToken.save(); + marketPosition.enteredMarket = false; + marketPosition.save(); + } + return { entity: marketPosition, created }; +} + +function getOrCreateWrappedEthToken(): Token { + const underlyingTokenAddress = Address.fromBytes( + Bytes.fromHexString('0x9c37E59Ba22c4320547F00D4f1857AF1abd1Dd6f'), + ); + const tokenEntity = new Token(getTokenId(underlyingTokenAddress)); + tokenEntity.address = underlyingTokenAddress; + tokenEntity.name = 'Wrapped Binance Beacon ETH'; + tokenEntity.symbol = 'wBETH'; + tokenEntity.decimals = 18; + tokenEntity.save(); + return tokenEntity; +} + +/** + * Creates and Token object with symbol and address + * + * @param asset Address of the token + * @returns Token + */ +export function getOrCreateToken(asset: Address): Token { + let tokenEntity = Token.load(getTokenId(asset)); + + if (!tokenEntity) { + if (asset.equals(vwbETHAddress)) { + return getOrCreateWrappedEthToken(); + } else { + const erc20 = BEP20.bind(asset); + tokenEntity = new Token(getTokenId(asset)); + tokenEntity.address = asset; + tokenEntity.name = erc20.name(); + tokenEntity.symbol = erc20.symbol(); + tokenEntity.decimals = erc20.decimals(); + tokenEntity.save(); + } } - return { entity: accountVToken, created }; + return tokenEntity; } diff --git a/subgraphs/venus/src/operations/update.ts b/subgraphs/venus/src/operations/update.ts index d1727852..d8460fec 100644 --- a/subgraphs/venus/src/operations/update.ts +++ b/subgraphs/venus/src/operations/update.ts @@ -1,39 +1,39 @@ import { Address, BigInt } from '@graphprotocol/graph-ts'; -import { AccountVToken } from '../../generated/schema'; +import { MarketPosition } from '../../generated/schema'; import { VToken } from '../../generated/templates/VToken/VToken'; import { valueOrNotAvailableIntIfReverted } from '../utilities'; import { getMarket } from './get'; -import { getOrCreateAccount, getOrCreateAccountVToken } from './getOrCreate'; +import { getOrCreateAccount, getOrCreateMarketPosition } from './getOrCreate'; import { oneBigInt, zeroBigInt32 } from '../constants'; -export const updateAccountVTokenAccrualBlockNumber = ( +export const updateMarketPositionAccrualBlockNumber = ( accountAddress: Address, marketAddress: Address, blockNumber: BigInt, -): AccountVToken => { +): MarketPosition => { getOrCreateAccount(accountAddress); - const accountVToken = getOrCreateAccountVToken(accountAddress, marketAddress); - accountVToken.entity.accrualBlockNumber = blockNumber; - accountVToken.entity.save(); - return accountVToken.entity as AccountVToken; + const marketPosition = getOrCreateMarketPosition(accountAddress, marketAddress); + marketPosition.entity.accrualBlockNumber = blockNumber; + marketPosition.entity.save(); + return marketPosition.entity as MarketPosition; }; -export const updateAccountVTokenSupply = ( +export const updateMarketPositionSupply = ( accountAddress: Address, marketAddress: Address, blockNumber: BigInt, accountSupplyBalanceMantissa: BigInt, -): AccountVToken => { +): MarketPosition => { const market = getMarket(marketAddress)!; - const accountVToken = updateAccountVTokenAccrualBlockNumber( + const marketPosition = updateMarketPositionAccrualBlockNumber( accountAddress, marketAddress, blockNumber, ); - const _vTokenBalanceMantissa = accountVToken.vTokenBalanceMantissa; - accountVToken.vTokenBalanceMantissa = accountSupplyBalanceMantissa; - accountVToken.save(); + const _vTokenBalanceMantissa = marketPosition.vTokenBalanceMantissa; + marketPosition.vTokenBalanceMantissa = accountSupplyBalanceMantissa; + marketPosition.save(); if ( _vTokenBalanceMantissa.equals(zeroBigInt32) && @@ -47,29 +47,29 @@ export const updateAccountVTokenSupply = ( market.supplierCount = market.supplierCount.minus(oneBigInt); } market.save(); - return accountVToken as AccountVToken; + return marketPosition as MarketPosition; }; -export const updateAccountVTokenBorrow = ( +export const updateMarketPositionBorrow = ( accountAddress: Address, marketAddress: Address, blockNumber: BigInt, accountBorrows: BigInt, -): AccountVToken => { +): MarketPosition => { const market = getMarket(marketAddress)!; - const accountVToken = updateAccountVTokenAccrualBlockNumber( + const marketPosition = updateMarketPositionAccrualBlockNumber( accountAddress, marketAddress, blockNumber, ); - const _storedBorrowBalanceMantissa = accountVToken.storedBorrowBalanceMantissa; - accountVToken.storedBorrowBalanceMantissa = accountBorrows; + const _storedBorrowBalanceMantissa = marketPosition.storedBorrowBalanceMantissa; + marketPosition.storedBorrowBalanceMantissa = accountBorrows; const vTokenContract = VToken.bind(marketAddress); - accountVToken.borrowIndex = valueOrNotAvailableIntIfReverted( + marketPosition.borrowIndex = valueOrNotAvailableIntIfReverted( vTokenContract.try_borrowIndex(), 'vBEP20 try_borrowIndex()', ); - accountVToken.save(); + marketPosition.save(); if (_storedBorrowBalanceMantissa.equals(zeroBigInt32) && accountBorrows.notEqual(zeroBigInt32)) { market.borrowerCount = market.borrowerCount.plus(oneBigInt); @@ -80,5 +80,5 @@ export const updateAccountVTokenBorrow = ( market.borrowerCount = market.borrowerCount.minus(oneBigInt); } market.save(); - return accountVToken as AccountVToken; + return marketPosition as MarketPosition; }; diff --git a/subgraphs/venus/src/operations/updateMarketExchangeRate.ts b/subgraphs/venus/src/operations/updateMarketExchangeRate.ts index bb4ce0e2..bf56bb11 100644 --- a/subgraphs/venus/src/operations/updateMarketExchangeRate.ts +++ b/subgraphs/venus/src/operations/updateMarketExchangeRate.ts @@ -8,7 +8,7 @@ import { valueOrNotAvailableIntIfReverted } from '../utilities'; - If you call the vUSDC contract on bscscan it comes back (2.0 * 10^14) - The real value is ~0.02. So vDAI is off by 10^28, and vUSDC 10^16 How to calculate for tokens with different decimals - - Must div by tokenDecimals, 10^market.underlyingDecimals + - Must div by tokenDecimals, 10^market.underlyingToken.decimals - Must multiply by vtokenDecimals, 10^8 - Must div by mantissa, 10^18 */ diff --git a/subgraphs/venus/src/utilities/ids.ts b/subgraphs/venus/src/utilities/ids.ts index de0a6895..babf364e 100644 --- a/subgraphs/venus/src/utilities/ids.ts +++ b/subgraphs/venus/src/utilities/ids.ts @@ -1,18 +1,20 @@ import { Address, BigInt, Bytes } from '@graphprotocol/graph-ts'; -export const getAccountVTokenId = (accountAddress: Address, marketAddress: Address): Bytes => +export const getMarketPositionId = (accountAddress: Address, marketAddress: Address): Bytes => accountAddress.concat(marketAddress); export const getTransactionId = (transactionHash: Bytes, logIndex: BigInt): Bytes => transactionHash.concatI32(logIndex.toI32()); -export const getAccountVTokenTransactionId = ( - accountVTokenId: Bytes, +export const getMarketPositionTransactionId = ( + marketPositionId: Bytes, transactionHash: Bytes, logIndex: BigInt, -): Bytes => accountVTokenId.concat(transactionHash).concatI32(logIndex.toI32()); +): Bytes => marketPositionId.concat(transactionHash).concatI32(logIndex.toI32()); export const getMarketActionId = (vTokenAddress: Address, action: i32): Bytes => vTokenAddress.concatI32(action); export const getMarketId = (vTokenAddress: Address): Bytes => vTokenAddress; + +export const getTokenId = (tokenAddress: Address): Bytes => tokenAddress; diff --git a/subgraphs/venus/subgraph-client/index.ts b/subgraphs/venus/subgraph-client/index.ts index e80adbad..283acc5a 100644 --- a/subgraphs/venus/subgraph-client/index.ts +++ b/subgraphs/venus/subgraph-client/index.ts @@ -3,13 +3,13 @@ import { Client as UrqlClient, createClient } from 'urql/core'; import { AccountByIdDocument, - AccountVTokenByAccountAndMarketQueryDocument, - AccountVTokenByAccountIdDocument, - AccountVTokensDocument, - AccountVTokensWithBorrowByMarketIdDocument, - AccountVTokensWithBorrowByMarketIdQuery, - AccountVTokensWithSupplyByMarketIdDocument, - AccountVTokensWithSupplyByMarketIdQuery, + MarketPositionByAccountAndMarketQueryDocument, + MarketPositionByAccountIdDocument, + MarketPositionsDocument, + MarketPositionsWithBorrowByMarketIdDocument, + MarketPositionsWithBorrowByMarketIdQuery, + MarketPositionsWithSupplyByMarketIdDocument, + MarketPositionsWithSupplyByMarketIdQuery, ComptrollersDocument, ComptrollersQuery, MarketByIdDocument, @@ -56,23 +56,23 @@ class SubgraphClient { return result; } - async getAccountVTokens({ first = 25, skip = 0 }: { first: number; skip: number }) { - const result = await this.query(AccountVTokensDocument, { + async getMarketPositions({ first = 25, skip = 0 }: { first: number; skip: number }) { + const result = await this.query(MarketPositionsDocument, { first: first as unknown as string, skip: skip as unknown as string, }); return result; } - async getAccountVTokensWithSupplyByMarketId({ + async getMarketPositionsWithSupplyByMarketId({ page, marketId, }: { marketId: string; page: number; - }): Promise { + }): Promise { const first = 100; - const result = await this.query(AccountVTokensWithSupplyByMarketIdDocument, { + const result = await this.query(MarketPositionsWithSupplyByMarketIdDocument, { first, skip: first * page, marketId, @@ -84,15 +84,15 @@ class SubgraphClient { return result; } - async getAccountVTokensWithBorrowByMarketId({ + async getMarketPositionsWithBorrowByMarketId({ page, marketId, }: { marketId: string; page: number; - }): Promise { + }): Promise { const first = 100; - const result = await this.query(AccountVTokensWithBorrowByMarketIdDocument, { + const result = await this.query(MarketPositionsWithBorrowByMarketIdDocument, { first, skip: first * page, marketId, @@ -104,19 +104,19 @@ class SubgraphClient { return result; } - async getAccountVTokensByAccountId(accountId: string) { - const result = await this.query(AccountVTokenByAccountIdDocument, { accountId }); + async getMarketPositionsByAccountId(accountId: string) { + const result = await this.query(MarketPositionByAccountIdDocument, { accountId }); return result; } - async getAccountVTokenByAccountAndMarket({ + async getMarketPositionByAccountAndMarket({ marketId, accountId, }: { marketId: string; accountId: string; }) { - const result = await this.query(AccountVTokenByAccountAndMarketQueryDocument, { + const result = await this.query(MarketPositionByAccountAndMarketQueryDocument, { id: `${accountId}${marketId.replace('0x', '')}`, }); return result; diff --git a/subgraphs/venus/subgraph-client/queries/accountVTokensWithBorrowByMarketId.graphql b/subgraphs/venus/subgraph-client/queries/accountVTokensWithBorrowByMarketId.graphql deleted file mode 100644 index 8aef4f09..00000000 --- a/subgraphs/venus/subgraph-client/queries/accountVTokensWithBorrowByMarketId.graphql +++ /dev/null @@ -1,10 +0,0 @@ -query AccountVTokensWithBorrowByMarketId($first: Int, $skip: Int, $marketId: String!) { - accountVTokens(first: $first, skip: $skip, where: { market: $marketId, storedBorrowBalanceMantissa_gt: 0 }) { - id - account { - id - } - storedBorrowBalanceMantissa - borrowIndex - } -} diff --git a/subgraphs/venus/subgraph-client/queries/accountVTokensWithSupplyByMarketId.graphql b/subgraphs/venus/subgraph-client/queries/accountVTokensWithSupplyByMarketId.graphql deleted file mode 100644 index 78dddfdc..00000000 --- a/subgraphs/venus/subgraph-client/queries/accountVTokensWithSupplyByMarketId.graphql +++ /dev/null @@ -1,9 +0,0 @@ -query AccountVTokensWithSupplyByMarketId($first: Int, $skip: Int, $marketId: String!) { - accountVTokens(first: $first, skip: $skip, where: { market: $marketId, vTokenBalanceMantissa_gt: 0 }) { - id - account { - id - } - vTokenBalanceMantissa - } -} diff --git a/subgraphs/venus/subgraph-client/queries/marketByIdQuery.graphql b/subgraphs/venus/subgraph-client/queries/marketByIdQuery.graphql index e1eb46ce..7bfb64dc 100644 --- a/subgraphs/venus/subgraph-client/queries/marketByIdQuery.graphql +++ b/subgraphs/venus/subgraph-client/queries/marketByIdQuery.graphql @@ -11,16 +11,18 @@ query MarketById($id: ID!) { reservesMantissa supplyRateMantissa symbol - underlyingAddress - underlyingName + underlyingToken { + name + symbol + address + decimals + } lastUnderlyingPriceCents lastUnderlyingPriceBlockNumber - underlyingSymbol accrualBlockNumber borrowIndex totalSupplyVTokenMantissa totalBorrowsMantissa - underlyingDecimals supplierCount borrowerCount xvsSupplyStateBlock diff --git a/subgraphs/venus/subgraph-client/queries/accountVTokenByAccount.graphql b/subgraphs/venus/subgraph-client/queries/marketPositionByAccount.graphql similarity index 59% rename from subgraphs/venus/subgraph-client/queries/accountVTokenByAccount.graphql rename to subgraphs/venus/subgraph-client/queries/marketPositionByAccount.graphql index 649c5633..ee12c23f 100644 --- a/subgraphs/venus/subgraph-client/queries/accountVTokenByAccount.graphql +++ b/subgraphs/venus/subgraph-client/queries/marketPositionByAccount.graphql @@ -1,5 +1,5 @@ -query AccountVTokenByAccountId($accountId: String!) { - accountVTokens(where: { account: $accountId }) { +query MarketPositionByAccountId($accountId: String!) { + marketPositions(where: { account: $accountId }) { id market { id diff --git a/subgraphs/venus/subgraph-client/queries/accountVTokenByAccountAndMarket.graphql b/subgraphs/venus/subgraph-client/queries/marketPositionByAccountAndMarket.graphql similarity index 74% rename from subgraphs/venus/subgraph-client/queries/accountVTokenByAccountAndMarket.graphql rename to subgraphs/venus/subgraph-client/queries/marketPositionByAccountAndMarket.graphql index de0b6368..7e65d949 100644 --- a/subgraphs/venus/subgraph-client/queries/accountVTokenByAccountAndMarket.graphql +++ b/subgraphs/venus/subgraph-client/queries/marketPositionByAccountAndMarket.graphql @@ -1,5 +1,5 @@ -query AccountVTokenByAccountAndMarketQuery($id: ID!) { - accountVToken(id: $id) { +query MarketPositionByAccountAndMarketQuery($id: ID!) { + marketPosition(id: $id) { id market { id diff --git a/subgraphs/venus/subgraph-client/queries/accountVTokens.graphql b/subgraphs/venus/subgraph-client/queries/marketPositions.graphql similarity index 72% rename from subgraphs/venus/subgraph-client/queries/accountVTokens.graphql rename to subgraphs/venus/subgraph-client/queries/marketPositions.graphql index 877d84f7..363da64f 100644 --- a/subgraphs/venus/subgraph-client/queries/accountVTokens.graphql +++ b/subgraphs/venus/subgraph-client/queries/marketPositions.graphql @@ -1,5 +1,5 @@ -query AccountVTokens($first: Int, $skip: Int) { - accountVTokens(first: $first, skip: $skip) { +query MarketPositions($first: Int, $skip: Int) { + marketPositions(first: $first, skip: $skip) { id market { id diff --git a/subgraphs/venus/subgraph-client/queries/marketPositionsWithBorrowByMarketId.graphql b/subgraphs/venus/subgraph-client/queries/marketPositionsWithBorrowByMarketId.graphql new file mode 100644 index 00000000..a26e6081 --- /dev/null +++ b/subgraphs/venus/subgraph-client/queries/marketPositionsWithBorrowByMarketId.graphql @@ -0,0 +1,10 @@ +query MarketPositionsWithBorrowByMarketId($first: Int, $skip: Int, $marketId: String!) { + marketPositions(first: $first, skip: $skip, where: { market: $marketId, storedBorrowBalanceMantissa_gt: 0 }) { + id + account { + id + } + storedBorrowBalanceMantissa + borrowIndex + } +} diff --git a/subgraphs/venus/subgraph-client/queries/marketPositionsWithSupplyByMarketId.graphql b/subgraphs/venus/subgraph-client/queries/marketPositionsWithSupplyByMarketId.graphql new file mode 100644 index 00000000..5bc6ce60 --- /dev/null +++ b/subgraphs/venus/subgraph-client/queries/marketPositionsWithSupplyByMarketId.graphql @@ -0,0 +1,9 @@ +query MarketPositionsWithSupplyByMarketId($first: Int, $skip: Int, $marketId: String!) { + marketPositions(first: $first, skip: $skip, where: { market: $marketId, vTokenBalanceMantissa_gt: 0 }) { + id + account { + id + } + vTokenBalanceMantissa + } +} diff --git a/subgraphs/venus/subgraph-client/queries/marketsQuery.graphql b/subgraphs/venus/subgraph-client/queries/marketsQuery.graphql index 48b59fdb..9a9a1a55 100644 --- a/subgraphs/venus/subgraph-client/queries/marketsQuery.graphql +++ b/subgraphs/venus/subgraph-client/queries/marketsQuery.graphql @@ -4,10 +4,12 @@ query Markets { name symbol vTokenDecimals - underlyingAddress - underlyingName - underlyingSymbol - underlyingDecimals + underlyingToken { + name + symbol + address + decimals + } isListed borrowRateMantissa cashMantissa diff --git a/subgraphs/venus/tests/Comptroller.test.ts b/subgraphs/venus/tests/Comptroller.test.ts index 1f448177..d1532b4d 100644 --- a/subgraphs/venus/tests/Comptroller.test.ts +++ b/subgraphs/venus/tests/Comptroller.test.ts @@ -76,10 +76,7 @@ describe('handleMarketListing', () => { }; assertMarketDocument('id', vBnbAddress.toHex()); assertMarketDocument('isListed', 'true'); - assertMarketDocument('underlyingAddress', nativeAddress.toHex()); - assertMarketDocument('underlyingDecimals', '18'); - assertMarketDocument('underlyingName', 'BNB'); - assertMarketDocument('underlyingSymbol', 'BNB'); + assertMarketDocument('underlyingToken', nativeAddress.toHex()); assertMarketDocument('lastUnderlyingPriceCents', '0'); assertMarketDocument('lastUnderlyingPriceBlockNumber', '1'); assertMarketDocument('borrowRateMantissa', '12678493'); @@ -100,6 +97,10 @@ describe('handleMarketListing', () => { assertMarketDocument('xvsSupplyStateIndex', '1000000000000000000000000000000000000'); assertMarketDocument('xvsBorrowStateBlock', '1'); assertMarketDocument('xvsSupplyStateBlock', '1'); + + assert.fieldEquals('Token', nativeAddress.toHex(), 'decimals', '18'); + assert.fieldEquals('Token', nativeAddress.toHex(), 'name', 'BNB'); + assert.fieldEquals('Token', nativeAddress.toHex(), 'symbol', 'BNB'); }); test('unlist vBNB market correctly', () => { diff --git a/subgraphs/venus/tests/VToken/index.test.ts b/subgraphs/venus/tests/VToken/index.test.ts index fdfaa475..57f77451 100644 --- a/subgraphs/venus/tests/VToken/index.test.ts +++ b/subgraphs/venus/tests/VToken/index.test.ts @@ -33,7 +33,7 @@ import { handleTransfer, } from '../../src/mappings/vToken'; import { getMarket } from '../../src/operations/get'; -import { getAccountVTokenId } from '../../src/utilities/ids'; +import { getMarketPositionId } from '../../src/utilities/ids'; import { createAccrueInterestEvent, createBorrowEvent, @@ -54,7 +54,7 @@ import { } from './events'; import { createComptrollerMock, - createAccountVTokenBalanceOfMock, + createMarketPositionBalanceOfMock, createBorrowBalanceCurrentMock, createMockBlock, createPriceOracleMock, @@ -91,8 +91,8 @@ beforeAll(() => { [ethereum.Value.fromAddress(aaaTokenAddress), ethereum.Value.fromI32(99)], ]); - createAccountVTokenBalanceOfMock(aaaTokenAddress, user1Address, zeroBigInt32); - createAccountVTokenBalanceOfMock(aaaTokenAddress, user2Address, zeroBigInt32); + createMarketPositionBalanceOfMock(aaaTokenAddress, user1Address, zeroBigInt32); + createMarketPositionBalanceOfMock(aaaTokenAddress, user2Address, zeroBigInt32); }); beforeEach(() => { @@ -115,7 +115,7 @@ describe('VToken', () => { const minter = user1Address; const actualMintAmount = BigInt.fromString('124620530798726345'); const mintTokens = BigInt.fromString('37035970026454'); - createAccountVTokenBalanceOfMock(aaaTokenAddress, user1Address, mintTokens); + createMarketPositionBalanceOfMock(aaaTokenAddress, user1Address, mintTokens); const accountBalance = mintTokens; const mintEvent = createMintEvent( aaaTokenAddress, @@ -129,11 +129,11 @@ describe('VToken', () => { handleMint(mintEvent); - const accountVTokenId = getAccountVTokenId(minter, aaaTokenAddress).toHexString(); + const marketPositionId = getMarketPositionId(minter, aaaTokenAddress).toHexString(); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'vTokenBalanceMantissa', mintTokens.toString(), ); @@ -154,7 +154,7 @@ describe('VToken', () => { ); handleMint(mintEvent); - const accountVTokenId = getAccountVTokenId(redeemer, aaaTokenAddress).toHexString(); + const marketPositionId = getMarketPositionId(redeemer, aaaTokenAddress).toHexString(); const redeemEvent = createRedeemEvent( aaaTokenAddress, @@ -169,15 +169,15 @@ describe('VToken', () => { handleRedeem(redeemEvent); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'vTokenBalanceMantissa', accountBalance.toString(), ); assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'totalUnderlyingRedeemedMantissa', redeemEvent.params.redeemAmount.toString(), ); @@ -257,7 +257,7 @@ describe('VToken', () => { /** Fire Event */ handleRepayBorrow(repayBorrowEvent); - const accountVTokenId = getAccountVTokenId(borrower, aaaTokenAddress).toHexString(); + const marketPositionId = getMarketPositionId(borrower, aaaTokenAddress).toHexString(); const market = getMarket(aaaTokenAddress); assert.assertNotNull(market); if (!market) { @@ -265,8 +265,8 @@ describe('VToken', () => { } assert.fieldEquals( - 'AccountVToken', - accountVTokenId, + 'MarketPosition', + marketPositionId, 'storedBorrowBalanceMantissa', accountBorrows.toString(), ); @@ -376,13 +376,13 @@ describe('VToken', () => { handleMint(mintEvent); - const accountVTokenFromId = getAccountVTokenId(from, aaaTokenAddress).toHexString(); - const accountVTokenToId = getAccountVTokenId(to, aaaTokenAddress).toHexString(); + const marketPositionFromId = getMarketPositionId(from, aaaTokenAddress).toHexString(); + const marketPositionToId = getMarketPositionId(to, aaaTokenAddress).toHexString(); - /** AccountVTokens */ + /** MarketPositions */ assert.fieldEquals( - 'AccountVToken', - accountVTokenFromId, + 'MarketPosition', + marketPositionFromId, 'vTokenBalanceMantissa', mintTokens.toString(), ); @@ -391,17 +391,17 @@ describe('VToken', () => { /** Fire Event */ handleTransfer(transferEvent); - /** AccountVToken */ + /** MarketPosition */ assert.fieldEquals( - 'AccountVToken', - accountVTokenFromId, + 'MarketPosition', + marketPositionFromId, 'vTokenBalanceMantissa', mintTokens.minus(amount).toString(), ); assert.fieldEquals( - 'AccountVToken', - accountVTokenToId, + 'MarketPosition', + marketPositionToId, 'vTokenBalanceMantissa', amount.toString(), ); diff --git a/subgraphs/venus/tests/integration/vTokens.ts b/subgraphs/venus/tests/integration/vTokens.ts index 1b3506d0..795478d2 100644 --- a/subgraphs/venus/tests/integration/vTokens.ts +++ b/subgraphs/venus/tests/integration/vTokens.ts @@ -14,13 +14,13 @@ const subgraphClient = createSubgraphClient( ); const checkSupply = async (account: string, vToken: Contract) => { - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vToken.address.toLowerCase(), accountId: account, }); const accountContractBalance = await vToken.balanceOf(account); - expect(accountVToken?.vTokenBalanceMantissa || '0').to.equal(accountContractBalance.toString()); + expect(marketPosition?.vTokenBalanceMantissa || '0').to.equal(accountContractBalance.toString()); // on market const accrualBlockNumber = await vToken.accrualBlockNumber(); const { market } = await subgraphClient.getMarketById(vToken.address.toLowerCase()); @@ -28,17 +28,17 @@ const checkSupply = async (account: string, vToken: Contract) => { }; const checkBorrows = async (account: string, vToken: Contract) => { - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vToken.address.toLowerCase(), accountId: account, }); const accountContractBalance = await vToken.borrowBalanceStored(account); const borrowIndex = await vToken.borrowIndex(); - expect(accountVToken?.storedBorrowBalanceMantissa || '0').to.equal( + expect(marketPosition?.storedBorrowBalanceMantissa || '0').to.equal( accountContractBalance.toString(), ); - expect(accountVToken?.borrowIndex || '0').to.equal(borrowIndex); - expect(accountVToken.account.hasBorrowed).to.equal(true); + expect(marketPosition?.borrowIndex || '0').to.equal(borrowIndex); + expect(marketPosition.account.hasBorrowed).to.equal(true); // on market const accrualBlockNumber = await vToken.accrualBlockNumber(); const { market } = await subgraphClient.getMarketById(vToken.address.toLowerCase()); @@ -340,11 +340,11 @@ describe('VToken events', function () { const supplyState = await comptroller.venusSupplyState(vToken.address); expect(market?.xvsSupplyStateIndex).to.equal(supplyState.index.toString()); expect(market?.xvsSupplyStateBlock).to.equal(supplyState.block.toString()); - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vToken.address.toLowerCase(), accountId: supplier2Signer._address, }); - expect(accountVToken.totalUnderlyingRedeemedMantissa).to.equal( + expect(marketPosition.totalUnderlyingRedeemedMantissa).to.equal( formatUnits(redeemAmount.mul(exchangeRate), 18).split('.')[0], ); // remove decimals } @@ -380,27 +380,27 @@ describe('VToken events', function () { await waitForSubgraphToBeSynced(syncDelay); for (const vTokenAddress of [vFdusdToken.address, vUsdtToken.address, vDogeToken.address]) { - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vTokenAddress.toLowerCase(), accountId: borrower1Signer._address, }); - expect(accountVToken?.enteredMarket).to.equal(true); + expect(marketPosition?.enteredMarket).to.equal(true); } for (const vTokenAddress of [vFdusdToken.address, vUsdtToken.address, vDogeToken.address]) { - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vTokenAddress.toLowerCase(), accountId: borrower2Signer._address, }); - expect(accountVToken?.enteredMarket).to.equal(true); + expect(marketPosition?.enteredMarket).to.equal(true); } for (const vTokenAddress of [vFdusdToken.address, vUsdtToken.address, vDogeToken.address]) { - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vTokenAddress.toLowerCase(), accountId: borrower3Signer._address, }); - expect(accountVToken?.enteredMarket).to.equal(true); + expect(marketPosition?.enteredMarket).to.equal(true); } }); @@ -411,26 +411,26 @@ describe('VToken events', function () { await waitForSubgraphToBeSynced(syncDelay); - const { accountVToken: accountVTokenVUsdt } = - await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition: marketPositionVUsdt } = + await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vUsdtToken.address.toLowerCase(), accountId: borrower1Signer._address, }); - expect(accountVTokenVUsdt?.enteredMarket).to.equal(false); + expect(marketPositionVUsdt?.enteredMarket).to.equal(false); - const { accountVToken: accountVTokenVDoge } = - await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition: marketPositionVDoge } = + await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vDogeToken.address.toLowerCase(), accountId: borrower2Signer._address, }); - expect(accountVTokenVDoge?.enteredMarket).to.equal(false); + expect(marketPositionVDoge?.enteredMarket).to.equal(false); - const { accountVToken: accountVTokenVFusd } = - await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition: marketPositionVFusd } = + await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vFdusdToken.address.toLowerCase(), accountId: borrower3Signer._address, }); - expect(accountVTokenVFusd?.enteredMarket).to.equal(false); + expect(marketPositionVFusd?.enteredMarket).to.equal(false); }); it('should update the borrower count on the market for new borrows', async function () { @@ -496,11 +496,11 @@ describe('VToken events', function () { expect(market?.borrowerCount).to.equal('1'); expect(market?.totalBorrowsMantissa).to.equal((await vDogeToken.totalBorrows()).toString()); - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vDogeToken.address.toLowerCase(), accountId: borrower2Signer._address, }); - expect(accountVToken.totalUnderlyingRepaidMantissa).to.equal(doge20Usd.toString()); + expect(marketPosition.totalUnderlyingRepaidMantissa).to.equal(doge20Usd.toString()); }); it('should handle accrue interest event', async function () { @@ -559,7 +559,7 @@ describe('VToken events', function () { await waitForSubgraphToBeSynced(syncDelay); - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vDogeToken.address.toLowerCase(), accountId: borrower2Signer._address, }); @@ -570,13 +570,13 @@ describe('VToken events', function () { expect(market?.xvsBorrowStateIndex).to.equal(borrowState.index.toString()); expect(market?.xvsBorrowStateBlock).to.equal(borrowState.block.toString()); - expect(accountVToken.storedBorrowBalanceMantissa).to.be.approximately( + expect(marketPosition.storedBorrowBalanceMantissa).to.be.approximately( ethers.BigNumber.from( await vDogeToken.callStatic.borrowBalanceCurrent(borrower2Signer._address), ), 1e11, ); - expect(accountVToken?.borrowIndex || '0').to.equal(await vDogeToken.borrowIndex()); + expect(marketPosition?.borrowIndex || '0').to.equal(await vDogeToken.borrowIndex()); const { account: accountBorrower } = await subgraphClient.getAccountById( borrower2Signer._address, @@ -594,13 +594,13 @@ describe('VToken events', function () { ); expect(marketUpdated?.supplierCount).to.equal('6'); - const { accountVToken: liquidatorAccountVToken } = - await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition: liquidatorMarketPosition } = + await subgraphClient.getMarketPositionByAccountAndMarket({ accountId: liquidator1Signer._address.toLowerCase(), marketId: vFdusdToken.address.toLowerCase(), }); - expect(liquidatorAccountVToken.vTokenBalanceMantissa).to.be.approximately( + expect(liquidatorMarketPosition.vTokenBalanceMantissa).to.be.approximately( ethers.BigNumber.from(await vFdusdToken.balanceOf(liquidator1Signer._address)), 1e11, ); @@ -611,8 +611,8 @@ describe('VToken events', function () { }); it('should update the borrower count on the market for full repayment of borrow', async function () { - const { accountVToken: accountVTokenPrev } = - await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition: MarketPositionPrev } = + await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vDogeToken.address.toLowerCase(), accountId: borrower2Signer._address, }); @@ -637,12 +637,12 @@ describe('VToken events', function () { expect(market?.xvsBorrowStateIndex).to.equal(borrowState.index.toString()); expect(market?.xvsBorrowStateBlock).to.equal(borrowState.block.toString()); - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vDogeToken.address.toLowerCase(), accountId: borrower2Signer._address, }); - expect(accountVToken.totalUnderlyingRepaidMantissa).to.be.approximately( - ethers.BigNumber.from(accountVTokenPrev.totalUnderlyingRepaidMantissa).add(repayAmount), + expect(marketPosition.totalUnderlyingRepaidMantissa).to.be.approximately( + ethers.BigNumber.from(MarketPositionPrev.totalUnderlyingRepaidMantissa).add(repayAmount), 1e10, ); }); @@ -662,19 +662,19 @@ describe('VToken events', function () { await waitForSubgraphToBeSynced(syncDelay); - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vToken.address.toLowerCase(), accountId: supplier._address, }); - expect(accountVToken.vTokenBalanceMantissa).to.equal(supplierBalance.toString()); + expect(marketPosition.vTokenBalanceMantissa).to.equal(supplierBalance.toString()); - const { accountVToken: accountVTokenLiquidator } = - await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition: marketPositionLiquidator } = + await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vToken.address.toLowerCase(), accountId: liquidator1Signer._address, }); - expect(accountVTokenLiquidator.vTokenBalanceMantissa).to.equal( + expect(marketPositionLiquidator.vTokenBalanceMantissa).to.equal( liquidatorBalance.add(supplierBalance).toString(), ); @@ -807,11 +807,11 @@ describe('VToken events', function () { const supplyState = await comptroller.venusSupplyState(vToken.address); expect(market?.xvsSupplyStateIndex).to.equal(supplyState.index.toString()); expect(market?.xvsSupplyStateBlock).to.equal(supplyState.block.toString()); - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vToken.address.toLowerCase(), accountId: supplier2Signer._address, }); - expect(accountVToken.totalUnderlyingRedeemedMantissa).to.equal( + expect(marketPosition.totalUnderlyingRedeemedMantissa).to.equal( formatUnits(redeemAmount.mul(exchangeRate), 18).split('.')[0], ); // remove decimals } @@ -844,27 +844,27 @@ describe('VToken events', function () { await waitForSubgraphToBeSynced(syncDelay); for (const vTokenAddress of [vUsdcToken.address, vWBnbToken.address, vEthToken.address]) { - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vTokenAddress.toLowerCase(), accountId: borrower1Signer._address, }); - expect(accountVToken?.enteredMarket).to.equal(true); + expect(marketPosition?.enteredMarket).to.equal(true); } for (const vTokenAddress of [vUsdcToken.address, vWBnbToken.address, vEthToken.address]) { - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vTokenAddress.toLowerCase(), accountId: borrower2Signer._address, }); - expect(accountVToken?.enteredMarket).to.equal(true); + expect(marketPosition?.enteredMarket).to.equal(true); } for (const vTokenAddress of [vUsdcToken.address, vWBnbToken.address, vEthToken.address]) { - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vTokenAddress.toLowerCase(), accountId: borrower3Signer._address, }); - expect(accountVToken?.enteredMarket).to.equal(true); + expect(marketPosition?.enteredMarket).to.equal(true); } }); @@ -875,26 +875,26 @@ describe('VToken events', function () { await waitForSubgraphToBeSynced(syncDelay); - const { accountVToken: accountVTokenVWbnb } = - await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition: marketPositionVWbnb } = + await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vWBnbToken.address.toLowerCase(), accountId: borrower1Signer._address, }); - expect(accountVTokenVWbnb?.enteredMarket).to.equal(false); + expect(marketPositionVWbnb?.enteredMarket).to.equal(false); - const { accountVToken: accountVTokenVEth } = - await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition: marketPositionVEth } = + await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vEthToken.address.toLowerCase(), accountId: borrower2Signer._address, }); - expect(accountVTokenVEth?.enteredMarket).to.equal(false); + expect(marketPositionVEth?.enteredMarket).to.equal(false); - const { accountVToken: accountVTokenVUsdc } = - await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition: marketPositionVUsdc } = + await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vUsdcToken.address.toLowerCase(), accountId: borrower3Signer._address, }); - expect(accountVTokenVUsdc?.enteredMarket).to.equal(false); + expect(marketPositionVUsdc?.enteredMarket).to.equal(false); }); it('should update the borrower count on the market for new borrows', async function () { @@ -964,11 +964,11 @@ describe('VToken events', function () { expect(market?.xvsBorrowStateIndex).to.equal(borrowState.index.toString()); expect(market?.xvsBorrowStateBlock).to.equal(borrowState.block.toString()); - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vEthToken.address.toLowerCase(), accountId: borrower1Signer._address, }); - expect(accountVToken.totalUnderlyingRepaidMantissa).to.equal(eth20Usd.toString()); + expect(marketPosition.totalUnderlyingRepaidMantissa).to.equal(eth20Usd.toString()); }); it('should handle accrue interest event', async function () { @@ -1021,18 +1021,18 @@ describe('VToken events', function () { .liquidateBorrow(borrower1Signer._address, eth200Usd.toString(), vUsdcToken.address); await waitForSubgraphToBeSynced(syncDelay); - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vEthToken.address.toLowerCase(), accountId: borrower1Signer._address, }); - expect(accountVToken.storedBorrowBalanceMantissa).to.be.approximately( + expect(marketPosition.storedBorrowBalanceMantissa).to.be.approximately( ethers.BigNumber.from( await vEthToken.callStatic.borrowBalanceCurrent(borrower1Signer._address), ), 1e11, ); - expect(accountVToken?.borrowIndex || '0').to.equal(await vEthToken.borrowIndex()); + expect(marketPosition?.borrowIndex || '0').to.equal(await vEthToken.borrowIndex()); const { account: accountBorrower } = await subgraphClient.getAccountById( borrower1Signer._address, @@ -1055,8 +1055,8 @@ describe('VToken events', function () { }); it('should update the borrower count on the market for full repayment of borrow', async function () { - const { accountVToken: accountVTokenPrev } = - await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition: MarketPositionPrev } = + await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vEthToken.address.toLowerCase(), accountId: borrower1Signer._address, }); @@ -1082,12 +1082,12 @@ describe('VToken events', function () { expect(market?.xvsBorrowStateIndex).to.equal(borrowState.index.toString()); expect(market?.xvsBorrowStateBlock).to.equal(borrowState.block.toString()); - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vEthToken.address.toLowerCase(), accountId: borrower1Signer._address, }); - expect(accountVToken.totalUnderlyingRepaidMantissa).to.be.approximately( - ethers.BigNumber.from(accountVTokenPrev.totalUnderlyingRepaidMantissa).add(repayAmount), + expect(marketPosition.totalUnderlyingRepaidMantissa).to.be.approximately( + ethers.BigNumber.from(MarketPositionPrev.totalUnderlyingRepaidMantissa).add(repayAmount), 1e10, ); }); @@ -1113,19 +1113,19 @@ describe('VToken events', function () { expect(market?.xvsSupplyStateIndex).to.equal(supplyState.index.toString()); expect(market?.xvsSupplyStateBlock).to.equal(supplyState.block.toString()); - const { accountVToken } = await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition } = await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vToken.address.toLowerCase(), accountId: supplier._address, }); - expect(accountVToken.vTokenBalanceMantissa).to.equal(supplierBalance.toString()); + expect(marketPosition.vTokenBalanceMantissa).to.equal(supplierBalance.toString()); - const { accountVToken: accountVTokenLiquidator } = - await subgraphClient.getAccountVTokenByAccountAndMarket({ + const { marketPosition: marketPositionLiquidator } = + await subgraphClient.getMarketPositionByAccountAndMarket({ marketId: vToken.address.toLowerCase(), accountId: liquidator1Signer._address, }); - expect(accountVTokenLiquidator.vTokenBalanceMantissa).to.equal( + expect(marketPositionLiquidator.vTokenBalanceMantissa).to.equal( liquidatorBalance.add(supplierBalance).toString(), ); } diff --git a/subgraphs/venus/tests/mocks.ts b/subgraphs/venus/tests/mocks.ts index 17a6c7c5..85391b2f 100644 --- a/subgraphs/venus/tests/mocks.ts +++ b/subgraphs/venus/tests/mocks.ts @@ -148,7 +148,7 @@ export const createPriceOracleMock = (tokens: Array>): voi }); }; -export const createAccountVTokenBalanceOfMock = ( +export const createMarketPositionBalanceOfMock = ( vTokenAddress: Address, accountAddress: Address, balance: BigInt, diff --git a/subgraphs/venus/tests/scripts/checkAccountVTokens.ts b/subgraphs/venus/tests/scripts/checkAccountVTokens.ts deleted file mode 100644 index 2cede65c..00000000 --- a/subgraphs/venus/tests/scripts/checkAccountVTokens.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { providers } from '@0xsequence/multicall'; -import VBep20Abi from '@venusprotocol/venus-protocol/artifacts/contracts/Tokens/VTokens/VBep20.sol/VBep20.json'; -import assert from 'assert'; -import { BigNumber, ethers } from 'ethers'; - -import createSubgraphClient from '../../subgraph-client'; - -const checkAccountVTokens = async ( - provider: providers.MulticallProvider, - subgraphClient: ReturnType, -) => { - let skip = 0; - while (skip >= 0) { - console.log(`processed ${skip * 25}...`); - const { accountVTokens } = await subgraphClient.getAccountVTokens({ - first: 25, - skip: skip * 25, - }); - for (const accountVToken of accountVTokens) { - const vTokenContract = new ethers.Contract(accountVToken.market.id, VBep20Abi.abi, provider); - const accountBalance = await vTokenContract.balanceOf(accountVToken.account.id); - try { - assert.equal( - accountVToken.vTokenBalanceMantissa, - accountBalance.toString(), - `incorrect supply balance for account ${accountVToken.account.id} in market ${accountVToken.market.symbol} ${accountVToken.market.id}. Subgraph Value: ${ - accountVToken.vTokenBalanceMantissa - }, contractValue: ${accountBalance.toString()}`, - ); - } catch (e) { - console.log(e.message); - } - const borrowBalanceStored = await vTokenContract.borrowBalanceStored( - accountVToken.account.id, - ); - - const updatedSubgraphValue = BigNumber.from(accountVToken.storedBorrowBalanceMantissa) - .mul(accountVToken.market.borrowIndex) - .div(accountVToken.borrowIndex) - .toString(); - - try { - // borrower.borrowBalance * market.borrowIndex / borrower.borrowIndex - assert.equal( - updatedSubgraphValue, - borrowBalanceStored.toString(), - ` - incorrect borrow balance on account ${accountVToken.account.id} on market ${accountVToken.market.symbol} ${accountVToken.market.id}, accountBorrowIndex: ${accountVToken.borrowIndex}, marketBorrowIndex ${accountVToken.market.borrowIndex} subgraphValue: ${accountVToken.storedBorrowBalanceMantissa} contractValue: ${borrowBalanceStored}`, - ); - } catch (e) { - console.log(e.message); - } - } - if (accountVTokens) { - skip += 1; - } else { - skip = -1; - } - } -}; - -export default checkAccountVTokens; diff --git a/subgraphs/venus/tests/scripts/checkMarketPositions.ts b/subgraphs/venus/tests/scripts/checkMarketPositions.ts new file mode 100644 index 00000000..61741e20 --- /dev/null +++ b/subgraphs/venus/tests/scripts/checkMarketPositions.ts @@ -0,0 +1,62 @@ +import { providers } from '@0xsequence/multicall'; +import VBep20Abi from '@venusprotocol/venus-protocol/artifacts/contracts/Tokens/VTokens/VBep20.sol/VBep20.json'; +import assert from 'assert'; +import { BigNumber, ethers } from 'ethers'; + +import createSubgraphClient from '../../subgraph-client'; + +const checkMarketPositions = async ( + provider: providers.MulticallProvider, + subgraphClient: ReturnType, +) => { + let skip = 0; + while (skip >= 0) { + console.log(`processed ${skip * 25}...`); + const { marketPositions } = await subgraphClient.getMarketPositions({ + first: 25, + skip: skip * 25, + }); + for (const marketPosition of marketPositions) { + const vTokenContract = new ethers.Contract(marketPosition.market.id, VBep20Abi.abi, provider); + const accountBalance = await vTokenContract.balanceOf(marketPosition.account.id); + try { + assert.equal( + marketPosition.vTokenBalanceMantissa, + accountBalance.toString(), + `incorrect supply balance for account ${marketPosition.account.id} in market ${MarketPosition.market.symbol} ${MarketPosition.market.id}. Subgraph Value: ${ + marketPosition.vTokenBalanceMantissa + }, contractValue: ${accountBalance.toString()}`, + ); + } catch (e) { + console.log(e.message); + } + const borrowBalanceStored = await vTokenContract.borrowBalanceStored( + marketPosition.account.id, + ); + + const updatedSubgraphValue = BigNumber.from(marketPosition.storedBorrowBalanceMantissa) + .mul(marketPosition.market.borrowIndex) + .div(marketPosition.borrowIndex) + .toString(); + + try { + // borrower.borrowBalance * market.borrowIndex / borrower.borrowIndex + assert.equal( + updatedSubgraphValue, + borrowBalanceStored.toString(), + ` + incorrect borrow balance on account ${marketPosition.account.id} on market ${MarketPosition.market.symbol} ${MarketPosition.market.id}, accountBorrowIndex: ${MarketPosition.borrowIndex}, marketBorrowIndex ${MarketPosition.market.borrowIndex} subgraphValue: ${MarketPosition.storedBorrowBalanceMantissa} contractValue: ${borrowBalanceStored}`, + ); + } catch (e) { + console.log(e.message); + } + } + if (marketPositions) { + skip += 1; + } else { + skip = -1; + } + } +}; + +export default checkMarketPositions; diff --git a/subgraphs/venus/tests/scripts/checkMarkets.ts b/subgraphs/venus/tests/scripts/checkMarkets.ts index ab9b837b..ab0290c1 100644 --- a/subgraphs/venus/tests/scripts/checkMarkets.ts +++ b/subgraphs/venus/tests/scripts/checkMarkets.ts @@ -24,13 +24,13 @@ const countSuppliers = async ( let supplierCount = 0; let page = 0; while (page >= 0) { - const { accountVTokens } = await subgraphClient.getAccountVTokensWithSupplyByMarketId({ + const { marketPositions } = await subgraphClient.getMarketPositionsWithSupplyByMarketId({ marketId: marketAddress, page, }); - supplierCount += accountVTokens.length; + supplierCount += marketPositions.length; - if (accountVTokens.length == 0) { + if (marketPositions.length == 0) { page = -1; } else { page += 1; @@ -47,14 +47,14 @@ const countBorrower = async ( let borrowerCount = 0; let page = 0; while (page >= 0) { - const { accountVTokens } = await subgraphClient.getAccountVTokensWithBorrowByMarketId({ + const { marketPositions } = await subgraphClient.getMarketPositionsWithBorrowByMarketId({ marketId: marketAddress, page, }); - borrowerCount += accountVTokens.length; + borrowerCount += marketPositions.length; - if (accountVTokens.length == 0) { + if (marketPositions.length == 0) { page = -1; } else { page += 1; @@ -155,10 +155,10 @@ const checkMarkets = async ( assertEqual(market, name, 'name'); assertEqual(market, symbol, 'symbol'); assertEqual(market, decimals, 'vTokenDecimals'); - assertEqual(market, underlyingAddress, 'underlyingAddress', getAddress); - assertEqual(market, underlyingName, 'underlyingName'); - assertEqual(market, underlyingSymbol, 'underlyingSymbol'); - assertEqual(market, underlyingDecimals, 'underlyingDecimals'); + assertEqual(market.underlyingToken, underlyingAddress, 'address', getAddress); + assertEqual(market.underlyingToken, underlyingName, 'name'); + assertEqual(market.underlyingToken, underlyingSymbol, 'symbol'); + assertEqual(market.underlyingToken, underlyingDecimals, 'decimals'); assertEqual(market, marketStorage.isListed, 'isListed'); assertEqual(market, marketStorage.collateralFactorMantissa, 'collateralFactorMantissa'); diff --git a/subgraphs/venus/tests/scripts/index.ts b/subgraphs/venus/tests/scripts/index.ts index 85c3ecb8..2e381c66 100644 --- a/subgraphs/venus/tests/scripts/index.ts +++ b/subgraphs/venus/tests/scripts/index.ts @@ -2,7 +2,7 @@ import { providers } from '@0xsequence/multicall'; import { ethers } from 'ethers'; import createSubgraphClient from '../../subgraph-client'; -import checkAccountVTokens from './checkAccountVTokens'; +import checkMarketPositions from './checkMarketPositions'; import checkComptroller from './checkComptroller'; import checkMarkets from './checkMarkets'; @@ -21,7 +21,7 @@ const run = async () => { await checkComptroller(provider, subgraphClient); await checkMarkets(provider, subgraphClient); - await checkAccountVTokens(provider, subgraphClient); + await checkMarketPositions(provider, subgraphClient); }; export default run(); diff --git a/yarn.lock b/yarn.lock index 6f2047d6..07bd8470 100644 --- a/yarn.lock +++ b/yarn.lock @@ -98,43 +98,6 @@ __metadata: languageName: node linkType: hard -"@apollo/client@npm:~3.2.5 || ~3.3.0 || ~3.4.0 || ~3.5.0 || ~3.6.0 || ~3.7.0 || ~3.8.0 || ~3.9.0 || ~3.10.0 || ~3.11.0": - version: 3.11.10 - resolution: "@apollo/client@npm:3.11.10" - dependencies: - "@graphql-typed-document-node/core": ^3.1.1 - "@wry/caches": ^1.0.0 - "@wry/equality": ^0.5.6 - "@wry/trie": ^0.5.0 - graphql-tag: ^2.12.6 - hoist-non-react-statics: ^3.3.2 - optimism: ^0.18.0 - prop-types: ^15.7.2 - rehackt: ^0.1.0 - response-iterator: ^0.2.6 - symbol-observable: ^4.0.0 - ts-invariant: ^0.10.3 - tslib: ^2.3.0 - zen-observable-ts: ^1.2.5 - peerDependencies: - graphql: ^15.0.0 || ^16.0.0 - graphql-ws: ^5.5.5 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 - subscriptions-transport-ws: ^0.9.0 || ^0.11.0 - peerDependenciesMeta: - graphql-ws: - optional: true - react: - optional: true - react-dom: - optional: true - subscriptions-transport-ws: - optional: true - checksum: fb0bdcbc6cd2411c5ecf74bfeaf9c31d60865b454b2cd0f08876597402d26bcb49facb273de152517f3faf2b21f0a8f06d628cc7130a7231624918c4fb99a6db - languageName: node - linkType: hard - "@ardatan/fast-json-stringify@npm:^0.0.6": version: 0.0.6 resolution: "@ardatan/fast-json-stringify@npm:0.0.6" @@ -210,12 +173,12 @@ __metadata: linkType: hard "@aws-sdk/types@npm:^3.1.0": - version: 3.696.0 - resolution: "@aws-sdk/types@npm:3.696.0" + version: 3.713.0 + resolution: "@aws-sdk/types@npm:3.713.0" dependencies: - "@smithy/types": ^3.7.1 + "@smithy/types": ^3.7.2 tslib: ^2.6.2 - checksum: fde46e42e341602020406aaa5ec0ba8abd4c5ebcf2c5e9940a39890631c59ecf84b1331d0220f19a57d01cc38a424c391e9f7dfb164f711128c792c1b090c5f4 + checksum: 4e2d211838da5f64bb04693b0a0ab198e28fa1e1d1e394d96b91c87e07af525211bd88f2b91e9619158b595c23d688f2dc2de44fe2d01e8c21ef9a1d7ba0cece languageName: node linkType: hard @@ -228,7 +191,7 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.21.4, @babel/code-frame@npm:^7.22.13, @babel/code-frame@npm:^7.25.9, @babel/code-frame@npm:^7.26.0": +"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.22.13, @babel/code-frame@npm:^7.25.9, @babel/code-frame@npm:^7.26.0, @babel/code-frame@npm:^7.26.2": version: 7.26.2 resolution: "@babel/code-frame@npm:7.26.2" dependencies: @@ -240,9 +203,9 @@ __metadata: linkType: hard "@babel/compat-data@npm:^7.20.5, @babel/compat-data@npm:^7.25.9": - version: 7.26.2 - resolution: "@babel/compat-data@npm:7.26.2" - checksum: d52fae9b0dc59b409d6005ae6b172e89329f46d68136130065ebe923a156fc633e0f1c8600b3e319b9e0f99fd948f64991a5419e2e9431d00d9d235d5f7a7618 + version: 7.26.3 + resolution: "@babel/compat-data@npm:7.26.3" + checksum: 85c5a9fb365231688c7faeb977f1d659da1c039e17b416f8ef11733f7aebe11fe330dce20c1844cacf243766c1d643d011df1d13cac9eda36c46c6c475693d21 languageName: node linkType: hard @@ -280,16 +243,16 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.14.0, @babel/generator@npm:^7.23.0, @babel/generator@npm:^7.25.9, @babel/generator@npm:^7.26.0": - version: 7.26.2 - resolution: "@babel/generator@npm:7.26.2" +"@babel/generator@npm:^7.14.0, @babel/generator@npm:^7.23.0, @babel/generator@npm:^7.26.0, @babel/generator@npm:^7.26.3": + version: 7.26.3 + resolution: "@babel/generator@npm:7.26.3" dependencies: - "@babel/parser": ^7.26.2 - "@babel/types": ^7.26.0 + "@babel/parser": ^7.26.3 + "@babel/types": ^7.26.3 "@jridgewell/gen-mapping": ^0.3.5 "@jridgewell/trace-mapping": ^0.3.25 jsesc: ^3.0.2 - checksum: 6ff850b7d6082619f8c2f518d993cf7254cfbaa20b026282cbef5c9b2197686d076a432b18e36c4d1a42721c016df4f77a8f62c67600775d9683621d534b91b4 + checksum: fb09fa55c66f272badf71c20a3a2cee0fa1a447fed32d1b84f16a668a42aff3e5f5ddc6ed5d832dda1e952187c002ca1a5cdd827022efe591b6ac44cada884ea languageName: node linkType: hard @@ -380,7 +343,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-transforms@npm:^7.25.9, @babel/helper-module-transforms@npm:^7.26.0": +"@babel/helper-module-transforms@npm:^7.26.0": version: 7.26.0 resolution: "@babel/helper-module-transforms@npm:7.26.0" dependencies: @@ -422,16 +385,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-simple-access@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/helper-simple-access@npm:7.25.9" - dependencies: - "@babel/traverse": ^7.25.9 - "@babel/types": ^7.25.9 - checksum: 6d96c94b88e8288d15e5352c1221486bd4f62de8c7dc7c7b9f5b107ce2c79f67fec5ed71a0476e146f1fefbbbf1d69abe35dc821d80ce01fc7f472286c342421 - languageName: node - linkType: hard - "@babel/helper-skip-transparent-expression-wrappers@npm:^7.25.9": version: 7.25.9 resolution: "@babel/helper-skip-transparent-expression-wrappers@npm:7.25.9" @@ -482,14 +435,14 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.14.0, @babel/parser@npm:^7.16.8, @babel/parser@npm:^7.20.5, @babel/parser@npm:^7.23.0, @babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.2": - version: 7.26.2 - resolution: "@babel/parser@npm:7.26.2" +"@babel/parser@npm:^7.14.0, @babel/parser@npm:^7.16.8, @babel/parser@npm:^7.20.5, @babel/parser@npm:^7.23.0, @babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.3": + version: 7.26.3 + resolution: "@babel/parser@npm:7.26.3" dependencies: - "@babel/types": ^7.26.0 + "@babel/types": ^7.26.3 bin: parser: ./bin/babel-parser.js - checksum: c88b5ea0adf357ef909cdc2c31e284a154943edc59f63f6e8a4c20bf773a1b2f3d8c2205e59c09ca7cdad91e7466300114548876529277a80651b6436a48d5d9 + checksum: e2bff2e9fa6540ee18fecc058bc74837eda2ddcecbe13454667314a93fc0ba26c1fb862c812d84f6d5f225c3bd8d191c3a42d4296e287a882c4e1f82ff2815ff languageName: node linkType: hard @@ -707,15 +660,14 @@ __metadata: linkType: hard "@babel/plugin-transform-modules-commonjs@npm:^7.0.0": - version: 7.25.9 - resolution: "@babel/plugin-transform-modules-commonjs@npm:7.25.9" + version: 7.26.3 + resolution: "@babel/plugin-transform-modules-commonjs@npm:7.26.3" dependencies: - "@babel/helper-module-transforms": ^7.25.9 + "@babel/helper-module-transforms": ^7.26.0 "@babel/helper-plugin-utils": ^7.25.9 - "@babel/helper-simple-access": ^7.25.9 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 4f101f0ea4a57d1d27a7976d668c63a7d0bbb0d9c1909d8ac43c785fd1496c31e6552ffd9673730c088873df1bc64f1cc4aad7c3c90413ac5e80b33e336d80e4 + checksum: 0ac9aa4e5fe9fe34b58ee174881631e5e1c89eee5b1ebfd1147934686be92fc5fbfdc11119f0b607b3743d36a1cbcb7c36f18e0dd4424d6d7b749b1b9a18808a languageName: node linkType: hard @@ -852,17 +804,17 @@ __metadata: linkType: hard "@babel/traverse@npm:^7.14.0, @babel/traverse@npm:^7.16.8, @babel/traverse@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/traverse@npm:7.25.9" + version: 7.26.4 + resolution: "@babel/traverse@npm:7.26.4" dependencies: - "@babel/code-frame": ^7.25.9 - "@babel/generator": ^7.25.9 - "@babel/parser": ^7.25.9 + "@babel/code-frame": ^7.26.2 + "@babel/generator": ^7.26.3 + "@babel/parser": ^7.26.3 "@babel/template": ^7.25.9 - "@babel/types": ^7.25.9 + "@babel/types": ^7.26.3 debug: ^4.3.1 globals: ^11.1.0 - checksum: 901d325662ff1dd9bc51de00862e01055fa6bc374f5297d7e3731f2f0e268bbb1d2141f53fa82860aa308ee44afdcf186a948f16c83153927925804b95a9594d + checksum: dcdf51b27ab640291f968e4477933465c2910bfdcbcff8f5315d1f29b8ff861864f363e84a71fb489f5e9708e8b36b7540608ce019aa5e57ef7a4ba537e62700 languageName: node linkType: hard @@ -876,13 +828,13 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.16.8, @babel/types@npm:^7.17.0, @babel/types@npm:^7.23.0, @babel/types@npm:^7.24.7, @babel/types@npm:^7.25.9, @babel/types@npm:^7.26.0": - version: 7.26.0 - resolution: "@babel/types@npm:7.26.0" +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.16.8, @babel/types@npm:^7.17.0, @babel/types@npm:^7.23.0, @babel/types@npm:^7.24.7, @babel/types@npm:^7.25.9, @babel/types@npm:^7.26.0, @babel/types@npm:^7.26.3": + version: 7.26.3 + resolution: "@babel/types@npm:7.26.3" dependencies: "@babel/helper-string-parser": ^7.25.9 "@babel/helper-validator-identifier": ^7.25.9 - checksum: a3dd37dabac693018872da96edb8c1843a605c1bfacde6c3f504fba79b972426a6f24df70aa646356c0c1b19bdd2c722c623c684a996c002381071680602280d + checksum: 195f428080dcaadbcecc9445df7f91063beeaa91b49ccd78f38a5af6b75a6a58391d0c6614edb1ea322e57889a1684a0aab8e667951f820196901dd341f931e9 languageName: node linkType: hard @@ -1196,7 +1148,7 @@ __metadata: languageName: node linkType: hard -"@envelop/core@npm:^5.0.0, @envelop/core@npm:^5.0.1": +"@envelop/core@npm:^5.0.0, @envelop/core@npm:^5.0.1, @envelop/core@npm:^5.0.2": version: 5.0.2 resolution: "@envelop/core@npm:5.0.2" dependencies: @@ -2145,6 +2097,15 @@ __metadata: languageName: node linkType: hard +"@graphql-hive/gateway-abort-signal-any@npm:^0.0.1": + version: 0.0.1 + resolution: "@graphql-hive/gateway-abort-signal-any@npm:0.0.1" + dependencies: + tslib: ^2.8.1 + checksum: 363f8876318add3fcddea78590e329e0e79d358ac41ceb51bef541b02f1d76ca34828f37d92a050236fdd11f930b65178f42be9469c0ec726decb2e337625331 + languageName: node + linkType: hard + "@graphql-inspector/core@npm:3.3.0": version: 3.3.0 resolution: "@graphql-inspector/core@npm:3.3.0" @@ -2158,6 +2119,19 @@ __metadata: languageName: node linkType: hard +"@graphql-inspector/core@npm:6.2.1": + version: 6.2.1 + resolution: "@graphql-inspector/core@npm:6.2.1" + dependencies: + dependency-graph: 1.0.0 + object-inspect: 1.13.2 + tslib: 2.6.2 + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 + checksum: ef30953a9786070786d08e81476d29f36675b20cc00b928887ace40b691fe3c8bcd913f3721650add8e921e1f90b6bbbca27ea418284cb12edf878dfc5dc5dd8 + languageName: node + linkType: hard + "@graphql-mesh/cache-localforage@npm:^0.93.1": version: 0.93.1 resolution: "@graphql-mesh/cache-localforage@npm:0.93.1" @@ -2262,15 +2236,15 @@ __metadata: languageName: node linkType: hard -"@graphql-mesh/cross-helpers@npm:^0.4.6": - version: 0.4.8 - resolution: "@graphql-mesh/cross-helpers@npm:0.4.8" +"@graphql-mesh/cross-helpers@npm:^0.4.6, @graphql-mesh/cross-helpers@npm:^0.4.9": + version: 0.4.9 + resolution: "@graphql-mesh/cross-helpers@npm:0.4.9" dependencies: + "@graphql-tools/utils": ^10.6.0 path-browserify: 1.0.1 peerDependencies: - "@graphql-tools/utils": ^10.6.0 graphql: "*" - checksum: 10a103616b39d671b67efa82a1b4837351f486e37dfe36e9cc08a923599b34d5fc8574ed78efbd5a8555382b31c7bdf49bd04d12789149ecefdbd1e2224c61ef + checksum: a0b6468382dd957386a5426dee8bd561c9963a84d496fc2bdfa2652f6a33349c72b277c7a3e33b897709f4d0c655701785aebc2794b0eefffa512031ef0cbd8e languageName: node linkType: hard @@ -2422,6 +2396,22 @@ __metadata: languageName: node linkType: hard +"@graphql-mesh/store@npm:^0.103.9": + version: 0.103.9 + resolution: "@graphql-mesh/store@npm:0.103.9" + dependencies: + "@graphql-inspector/core": 6.2.1 + "@graphql-mesh/cross-helpers": ^0.4.9 + "@graphql-mesh/types": ^0.103.9 + "@graphql-mesh/utils": ^0.103.9 + "@graphql-tools/utils": ^10.6.0 + tslib: ^2.4.0 + peerDependencies: + graphql: "*" + checksum: 85845ebf7d8a45cb2ded5cea10f124f6c63700c86a9e1e6192a0d6c7d58d657d90038e0d183c816ac03c78ce89551b5410098371f879ca60f44605eea73534e4 + languageName: node + linkType: hard + "@graphql-mesh/store@npm:^0.93.1": version: 0.93.1 resolution: "@graphql-mesh/store@npm:0.93.1" @@ -2452,17 +2442,17 @@ __metadata: languageName: node linkType: hard -"@graphql-mesh/string-interpolation@npm:^0.5.6": - version: 0.5.6 - resolution: "@graphql-mesh/string-interpolation@npm:0.5.6" +"@graphql-mesh/string-interpolation@npm:^0.5.6, @graphql-mesh/string-interpolation@npm:^0.5.7": + version: 0.5.7 + resolution: "@graphql-mesh/string-interpolation@npm:0.5.7" dependencies: dayjs: 1.11.13 json-pointer: 0.6.2 lodash.get: 4.4.2 + tslib: ^2.4.0 peerDependencies: graphql: "*" - tslib: ^2.4.0 - checksum: 244ac60416ae48077f9888a3b602e53bf825d2c70b6efb1b06957739a7017a99cdf6b8ec92fac85cf1ea6f9b41c87ae76c563358b4c6352b897564755078ee9f + checksum: e914c3e8daef810d65be147013f79fe144dfecc57a441c2cb07462327e74b987fe49c0d3eec17805b8600a5c663058844b823c40859211bce320b2cade180b98 languageName: node linkType: hard @@ -2482,17 +2472,18 @@ __metadata: linkType: hard "@graphql-mesh/transport-common@npm:^0.7.7": - version: 0.7.15 - resolution: "@graphql-mesh/transport-common@npm:0.7.15" + version: 0.7.23 + resolution: "@graphql-mesh/transport-common@npm:0.7.23" dependencies: "@envelop/core": ^5.0.1 - "@graphql-mesh/types": ^0.103.0 - "@graphql-tools/delegate": ^10.2.0 - "@graphql-tools/utils": ^10.5.6 - tslib: ^2.4.0 + "@graphql-hive/gateway-abort-signal-any": ^0.0.1 + "@graphql-mesh/types": ^0.103.6 + "@graphql-tools/executor": ^1.3.8 + "@graphql-tools/utils": ^10.6.2 + tslib: ^2.8.1 peerDependencies: graphql: ^15.9.0 || ^16.9.0 - checksum: 7974a08435b9e53dd24a5e03515f663ad9ff9a40b2e93e033464f9b7036fcdfba5c076f0cb430745c1daba85f80e1fb07e23f9955eafd68935446e68d6f54597 + checksum: cb49d13300fe9d9eeff75634f3636a42e5bf70950134dd2071ccca20c704c35fb9e030efa7a362767f3e457b670b23ce8201a87fe8bdef5b68c46683e7706d58 languageName: node linkType: hard @@ -2512,19 +2503,19 @@ __metadata: languageName: node linkType: hard -"@graphql-mesh/types@npm:^0.103.0": - version: 0.103.4 - resolution: "@graphql-mesh/types@npm:0.103.4" +"@graphql-mesh/types@npm:^0.103.6, @graphql-mesh/types@npm:^0.103.9": + version: 0.103.9 + resolution: "@graphql-mesh/types@npm:0.103.9" dependencies: + "@graphql-mesh/store": ^0.103.9 "@graphql-tools/batch-delegate": ^9.0.10 "@graphql-tools/delegate": ^10.0.28 + "@graphql-tools/utils": ^10.6.0 "@graphql-typed-document-node/core": ^3.2.0 + tslib: ^2.4.0 peerDependencies: - "@graphql-mesh/store": ^0.103.4 - "@graphql-tools/utils": ^10.6.0 graphql: "*" - tslib: ^2.4.0 - checksum: c980ceb4de571e07eba2fa7a17812fb76a3f513c52e5727dca9f749fe0d910faf216cd7908cc770a5084210703565b771e2cb67bd87ff9daa13b1149bfdcd0cb + checksum: d6c89952af1e5a2f01b9de01c620770f023902c72ea2ff401ce8ebd42050922692acd916bb6d810c1bd4068d74b7e57b362f9928695db1d53ca932328f778992 languageName: node linkType: hard @@ -2567,6 +2558,31 @@ __metadata: languageName: node linkType: hard +"@graphql-mesh/utils@npm:^0.103.9": + version: 0.103.9 + resolution: "@graphql-mesh/utils@npm:0.103.9" + dependencies: + "@graphql-mesh/cross-helpers": ^0.4.9 + "@graphql-mesh/string-interpolation": ^0.5.7 + "@graphql-mesh/types": ^0.103.9 + "@graphql-tools/batch-delegate": ^9.0.16 + "@graphql-tools/delegate": ^10.0.28 + "@graphql-tools/utils": ^10.6.0 + "@graphql-tools/wrap": ^10.0.18 + "@whatwg-node/disposablestack": ^0.0.5 + "@whatwg-node/fetch": ^0.10.0 + dset: ^3.1.2 + js-yaml: ^4.1.0 + lodash.get: ^4.4.2 + lodash.topath: ^4.5.2 + tiny-lru: ^11.0.0 + tslib: ^2.4.0 + peerDependencies: + graphql: "*" + checksum: c02c53d8e2b8424cf0c66c23eb3b7e6a1ddb79438ad4343d7e46a2a9f25e8cd43dae6e928c9fd4e263fba5f16831f7af48b4d084caa72453fffa4a8f683586da + languageName: node + linkType: hard + "@graphql-mesh/utils@npm:^0.93.1": version: 0.93.2 resolution: "@graphql-mesh/utils@npm:0.93.2" @@ -2603,18 +2619,17 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/batch-delegate@npm:^9.0.10, @graphql-tools/batch-delegate@npm:^9.0.16, @graphql-tools/batch-delegate@npm:^9.0.9": - version: 9.0.16 - resolution: "@graphql-tools/batch-delegate@npm:9.0.16" +"@graphql-tools/batch-delegate@npm:^9.0.10, @graphql-tools/batch-delegate@npm:^9.0.16, @graphql-tools/batch-delegate@npm:^9.0.24, @graphql-tools/batch-delegate@npm:^9.0.9": + version: 9.0.24 + resolution: "@graphql-tools/batch-delegate@npm:9.0.24" dependencies: - "@graphql-tools/delegate": ^10.2.0 - "@graphql-tools/utils": ^10.5.6 - dataloader: 2.2.2 - tslib: ^2.4.0 - value-or-promise: ^1.0.12 + "@graphql-tools/delegate": ^10.2.8 + "@graphql-tools/utils": ^10.6.2 + dataloader: ^2.2.3 + tslib: ^2.8.1 peerDependencies: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: af142990a46f9ee22f11bc5c35924e6577b7bbd6796f6a627b63f180b186e2ed03ef0257fa834638baf98d8e595ae40914da2f8f220ce7e5ec2d7572f99d1602 + checksum: 26c52fc36ba1750ca67839acf7cbc02e07f41329809553c3643e1a27d47c349711a4249d65f407f08801a5fcf5fa801d22e06033ed3aba88684051a14df78c8a languageName: node linkType: hard @@ -2632,17 +2647,16 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/batch-execute@npm:^9.0.6": - version: 9.0.6 - resolution: "@graphql-tools/batch-execute@npm:9.0.6" +"@graphql-tools/batch-execute@npm:^9.0.10": + version: 9.0.10 + resolution: "@graphql-tools/batch-execute@npm:9.0.10" dependencies: - "@graphql-tools/utils": ^10.5.6 - dataloader: ^2.2.2 - tslib: ^2.4.0 - value-or-promise: ^1.0.12 + "@graphql-tools/utils": ^10.6.2 + dataloader: ^2.2.3 + tslib: ^2.8.1 peerDependencies: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: b4551a8b9a4bbc48e726e3417d149f27383c473211960b792f2199e4f4ee8965e392a40a6f3353c6732c552310d4ec7fec12d7fc2e1d09dd92cfcd3bef652ad6 + checksum: 700009a491f95b97979d8b2becc2d4b4be22418b66ebd1e59fca9b6a9409ee4a981577c35123e3e54384245a9e71d12398158b22b1e4e8b7cd5c67a8873ed612 languageName: node linkType: hard @@ -2661,21 +2675,21 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/delegate@npm:^10.0.21, @graphql-tools/delegate@npm:^10.0.28, @graphql-tools/delegate@npm:^10.2.0": - version: 10.2.0 - resolution: "@graphql-tools/delegate@npm:10.2.0" +"@graphql-tools/delegate@npm:^10.0.21, @graphql-tools/delegate@npm:^10.0.28, @graphql-tools/delegate@npm:^10.2.7, @graphql-tools/delegate@npm:^10.2.8": + version: 10.2.8 + resolution: "@graphql-tools/delegate@npm:10.2.8" dependencies: - "@graphql-tools/batch-execute": ^9.0.6 - "@graphql-tools/executor": ^1.3.3 - "@graphql-tools/schema": ^10.0.8 - "@graphql-tools/utils": ^10.5.6 + "@graphql-tools/batch-execute": ^9.0.10 + "@graphql-tools/executor": ^1.3.8 + "@graphql-tools/schema": ^10.0.11 + "@graphql-tools/utils": ^10.6.2 "@repeaterjs/repeater": ^3.0.6 - dataloader: ^2.2.2 + dataloader: ^2.2.3 dset: ^3.1.2 - tslib: ^2.5.0 + tslib: ^2.8.1 peerDependencies: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 73843005c2c60f6d1dbcbfe0fea034f99eab0724700bfbd00962655d12d0bc851833741bdda5b2911238b132d4aa1323419ec6d50191278747db0c21c099323e + checksum: 9ac5fc49e3da29b6892c9753d99474656541ef1196d63679d4a20df74a5b393341d4a10ba5ec68adce6310f44c0d01777ca7eaeb3f39ae290ace8db48f91e93d languageName: node linkType: hard @@ -2731,20 +2745,22 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/executor-http@npm:^1.1.9": - version: 1.1.9 - resolution: "@graphql-tools/executor-http@npm:1.1.9" +"@graphql-tools/executor-http@npm:^1.1.14": + version: 1.2.1 + resolution: "@graphql-tools/executor-http@npm:1.2.1" dependencies: - "@graphql-tools/utils": ^10.5.6 + "@graphql-hive/gateway-abort-signal-any": ^0.0.1 + "@graphql-tools/utils": ^10.6.2 "@repeaterjs/repeater": ^3.0.4 - "@whatwg-node/fetch": ^0.10.0 + "@whatwg-node/disposablestack": ^0.0.5 + "@whatwg-node/fetch": ^0.10.1 extract-files: ^11.0.0 meros: ^1.2.1 - tslib: ^2.4.0 + tslib: ^2.8.1 value-or-promise: ^1.0.12 peerDependencies: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: dd79e67e95d1256be31797f68bdfc767ba876384deaa31c6f87334abd303eb317a7bf4b8f37e4a055cfb0260951426815d454d84778d536e61887fdf54522bcb + checksum: c837973e555ab78a85c8bb23c7218c831a7ee3a4b40f0873bf5053dbda7ef7faa76f5f4d70682a9176f719d84a6959b32acaec05e1f11e91784d8f60153b5646 languageName: node linkType: hard @@ -2793,42 +2809,38 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/executor@npm:^1.3.1, @graphql-tools/executor@npm:^1.3.2, @graphql-tools/executor@npm:^1.3.3": - version: 1.3.4 - resolution: "@graphql-tools/executor@npm:1.3.4" +"@graphql-tools/executor@npm:^1.3.1, @graphql-tools/executor@npm:^1.3.2, @graphql-tools/executor@npm:^1.3.6, @graphql-tools/executor@npm:^1.3.7, @graphql-tools/executor@npm:^1.3.8": + version: 1.3.9 + resolution: "@graphql-tools/executor@npm:1.3.9" dependencies: - "@graphql-tools/utils": ^10.6.0 - "@graphql-typed-document-node/core": 3.2.0 + "@graphql-tools/utils": ^10.6.4 + "@graphql-typed-document-node/core": ^3.2.0 "@repeaterjs/repeater": ^3.0.4 + "@whatwg-node/disposablestack": ^0.0.5 tslib: ^2.4.0 value-or-promise: ^1.0.12 peerDependencies: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 899165cd40abcc4f7347b66fa8730abb0bc594f84e0d73246a30337e734dfbb3e375c479f1634190fb44e47f71e11c1985269837eb267e38cf6b57c8cfc7a03d + checksum: c148b9e99278dc23048f5155e75139c5a2d7a94482fa489443f0ed9d3fdaa59019107d1ceb4fd2c477872d52d33af480cf11bfb0b14f31b7bfdb1f6945074dad languageName: node linkType: hard "@graphql-tools/federation@npm:^2.2.10": - version: 2.2.30 - resolution: "@graphql-tools/federation@npm:2.2.30" - dependencies: - "@apollo/client": ~3.2.5 || ~3.3.0 || ~3.4.0 || ~3.5.0 || ~3.6.0 || ~3.7.0 || ~3.8.0 || ~3.9.0 || ~3.10.0 || ~3.11.0 - "@graphql-tools/delegate": ^10.2.0 - "@graphql-tools/executor-http": ^1.1.9 - "@graphql-tools/merge": ^9.0.9 - "@graphql-tools/schema": ^10.0.8 - "@graphql-tools/stitch": ^9.4.1 - "@graphql-tools/utils": ^10.5.6 - "@graphql-tools/wrap": ^10.0.18 - "@whatwg-node/fetch": ^0.10.0 - tslib: ^2.4.0 - value-or-promise: ^1.0.12 + version: 2.2.40 + resolution: "@graphql-tools/federation@npm:2.2.40" + dependencies: + "@graphql-tools/delegate": ^10.2.7 + "@graphql-tools/executor-http": ^1.1.14 + "@graphql-tools/merge": ^9.0.12 + "@graphql-tools/schema": ^10.0.11 + "@graphql-tools/stitch": ^9.4.9 + "@graphql-tools/utils": ^10.6.2 + "@graphql-tools/wrap": ^10.0.25 + "@whatwg-node/fetch": ^0.10.1 + tslib: ^2.8.1 peerDependencies: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - dependenciesMeta: - "@apollo/client": - optional: true - checksum: ac3c356af1c096d6351fc856b39f2fafece619f52fdc20c0a4f2bfef36e914e928ed4ecaacd2d128a17e58a5455483089ec5413be23bade6f9c067a43e8088cc + checksum: 95ae51ffcc1b0fa56b4a6da6a16e42a21f9c92515d9a771e17976297cc4d7f885493fd33293d83b26ae463d2db171aa31ff63778da6e8788ef0bc456976520f8 languageName: node linkType: hard @@ -2902,15 +2914,15 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/merge@npm:^9.0.10, @graphql-tools/merge@npm:^9.0.9": - version: 9.0.10 - resolution: "@graphql-tools/merge@npm:9.0.10" +"@graphql-tools/merge@npm:^9.0.12, @graphql-tools/merge@npm:^9.0.14": + version: 9.0.14 + resolution: "@graphql-tools/merge@npm:9.0.14" dependencies: - "@graphql-tools/utils": ^10.6.0 + "@graphql-tools/utils": ^10.6.4 tslib: ^2.4.0 peerDependencies: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 7a8e10bec79394a04944280609bf82af23374344e2e08074b9bdad57df817e622efee3593498de972a6645758922d9577e6de69945ece91c365eb394960de6c8 + checksum: 07a65bef47d60317a4d7ed593efa1355e01016e9f0401a4fd22d82d42b17b7a38223612a80a3a8c23d657ed75e4ebe80888814ea33f90b8b2a0d8dfac49b4e3c languageName: node linkType: hard @@ -2952,17 +2964,17 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/schema@npm:^10.0.4, @graphql-tools/schema@npm:^10.0.7, @graphql-tools/schema@npm:^10.0.8": - version: 10.0.9 - resolution: "@graphql-tools/schema@npm:10.0.9" +"@graphql-tools/schema@npm:^10.0.11": + version: 10.0.13 + resolution: "@graphql-tools/schema@npm:10.0.13" dependencies: - "@graphql-tools/merge": ^9.0.10 - "@graphql-tools/utils": ^10.6.0 + "@graphql-tools/merge": ^9.0.14 + "@graphql-tools/utils": ^10.6.4 tslib: ^2.4.0 value-or-promise: ^1.0.12 peerDependencies: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 72adf7780f046b509a6ddda3bc932fa59fed0f8a41e94f454467229d97af68dee2f715213e30593f1e24f7ec66642017e334146a907e5141885c38e8905fe09d + checksum: a8a9505da30cda6b2e52309f104f3b76d9703b47357607e449d11907cef50ceeaf4d252751bffcbbcfbf8cf8d1fe4140655f2ef28dd59f88c88646e756393ad1 languageName: node linkType: hard @@ -2985,22 +2997,21 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/stitch@npm:^9.2.10, @graphql-tools/stitch@npm:^9.4.1": - version: 9.4.1 - resolution: "@graphql-tools/stitch@npm:9.4.1" +"@graphql-tools/stitch@npm:^9.2.10, @graphql-tools/stitch@npm:^9.4.9": + version: 9.4.10 + resolution: "@graphql-tools/stitch@npm:9.4.10" dependencies: - "@graphql-tools/batch-delegate": ^9.0.16 - "@graphql-tools/delegate": ^10.2.0 - "@graphql-tools/executor": ^1.3.3 - "@graphql-tools/merge": ^9.0.9 - "@graphql-tools/schema": ^10.0.8 - "@graphql-tools/utils": ^10.5.6 - "@graphql-tools/wrap": ^10.0.18 - tslib: ^2.4.0 - value-or-promise: ^1.0.11 + "@graphql-tools/batch-delegate": ^9.0.24 + "@graphql-tools/delegate": ^10.2.8 + "@graphql-tools/executor": ^1.3.6 + "@graphql-tools/merge": ^9.0.12 + "@graphql-tools/schema": ^10.0.11 + "@graphql-tools/utils": ^10.6.2 + "@graphql-tools/wrap": ^10.0.26 + tslib: ^2.8.1 peerDependencies: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: e753c2ab0f8cb83855bcc0951c5c1d6b48c82ba192f5556f82e33ba2d924df9edf14dbade2c2cd7cb98f5f20f34dcf0c9f794a9a5150990432a879ef8e856ba4 + checksum: 674080aeac41547ba1705f26ab656aed72343710be5454abc5a98e8bd83bc643104560bb314456691c9cef0056c13f6efbf66d24549e039186da72292cd594c3 languageName: node linkType: hard @@ -3018,15 +3029,15 @@ __metadata: linkType: hard "@graphql-tools/stitching-directives@npm:^3.1.2, @graphql-tools/stitching-directives@npm:^3.1.9": - version: 3.1.15 - resolution: "@graphql-tools/stitching-directives@npm:3.1.15" + version: 3.1.23 + resolution: "@graphql-tools/stitching-directives@npm:3.1.23" dependencies: - "@graphql-tools/delegate": ^10.2.0 - "@graphql-tools/utils": ^10.5.6 - tslib: ^2.4.0 + "@graphql-tools/delegate": ^10.2.8 + "@graphql-tools/utils": ^10.6.2 + tslib: ^2.8.1 peerDependencies: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 5121908219291021a1d08c32d9f289815bacf7ba9894d0dcd22d872ba8665c74e8dcf8ab1f1821dfc97753f0f603a433aa2f023662c4f9402fb534518f1e8872 + checksum: ce4e56827975d073752b845a5189e9e90a510a26fb5dbc3f28df54832dc5039bf9100d7149bacc00d41034cda7fe141fea6638b77c706403f5886b93fc645a0f languageName: node linkType: hard @@ -3053,9 +3064,9 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/utils@npm:^10.0.0, @graphql-tools/utils@npm:^10.3.2, @graphql-tools/utils@npm:^10.5.3, @graphql-tools/utils@npm:^10.5.6, @graphql-tools/utils@npm:^10.6.0": - version: 10.6.0 - resolution: "@graphql-tools/utils@npm:10.6.0" +"@graphql-tools/utils@npm:^10.0.0, @graphql-tools/utils@npm:^10.5.3, @graphql-tools/utils@npm:^10.6.0, @graphql-tools/utils@npm:^10.6.2, @graphql-tools/utils@npm:^10.6.4": + version: 10.6.4 + resolution: "@graphql-tools/utils@npm:10.6.4" dependencies: "@graphql-typed-document-node/core": ^3.1.1 cross-inspect: 1.0.1 @@ -3063,7 +3074,7 @@ __metadata: tslib: ^2.4.0 peerDependencies: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: a93cfa70c667a9482fcc727401d86a9bd69ba72a41bccd159b5c3dad06692e14e06a3993aa40178938caaaf05dd87906fd93560837e334f386f42abc9b4850c2 + checksum: b3915ae1508f26fc777624fbeb93864981c29419a6fbcf72fbd28c4b5617bf90323d6198a84938d56c266f7de9bf74dca7672985642a1556c4a8854b3e3f7ff0 languageName: node linkType: hard @@ -3090,18 +3101,17 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/wrap@npm:^10.0.12, @graphql-tools/wrap@npm:^10.0.18, @graphql-tools/wrap@npm:^10.0.5": - version: 10.0.18 - resolution: "@graphql-tools/wrap@npm:10.0.18" +"@graphql-tools/wrap@npm:^10.0.12, @graphql-tools/wrap@npm:^10.0.18, @graphql-tools/wrap@npm:^10.0.25, @graphql-tools/wrap@npm:^10.0.26, @graphql-tools/wrap@npm:^10.0.5": + version: 10.0.26 + resolution: "@graphql-tools/wrap@npm:10.0.26" dependencies: - "@graphql-tools/delegate": ^10.2.0 - "@graphql-tools/schema": ^10.0.7 - "@graphql-tools/utils": ^10.5.6 - tslib: ^2.4.0 - value-or-promise: ^1.0.12 + "@graphql-tools/delegate": ^10.2.8 + "@graphql-tools/schema": ^10.0.11 + "@graphql-tools/utils": ^10.6.2 + tslib: ^2.8.1 peerDependencies: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: c5678d843fcf063345b9cfb23bf4828c10fef3c02133777325b202d1d33cebcd4a629c7b12083d57b25edff646f0f4ec75f7f6feea5c2f2da8193aae0ec1b43d + checksum: 353d7f98bf18592b4596b185421dc22c9290776bb4cc57964522adc49757f8a85aa0e42ee747ede9e8532a09aa7668410f7ae7547ee22d50f362ed8ccc9bbf9a languageName: node linkType: hard @@ -3159,15 +3169,15 @@ __metadata: languageName: node linkType: hard -"@graphql-yoga/subscription@npm:^5.0.1": - version: 5.0.1 - resolution: "@graphql-yoga/subscription@npm:5.0.1" +"@graphql-yoga/subscription@npm:^5.0.2": + version: 5.0.2 + resolution: "@graphql-yoga/subscription@npm:5.0.2" dependencies: - "@graphql-yoga/typed-event-target": ^3.0.0 + "@graphql-yoga/typed-event-target": ^3.0.1 "@repeaterjs/repeater": ^3.0.4 "@whatwg-node/events": ^0.1.0 tslib: ^2.5.2 - checksum: d3f08a530069fcb736819199f3d327f264dd90c953e4870b177a5235ed3757effe43f9292465e22b8f71c37d67c9dc1171cc2ef139f855a206260753c3790a6e + checksum: 570b1191d80ed8dfd7eab3d814dd3d66aeeca32ee673cac9e24ec6757bbc36582c8701c4395c164fffcdb49d082f05026706e317c84d7194fa12e1c9de336ef3 languageName: node linkType: hard @@ -3181,13 +3191,13 @@ __metadata: languageName: node linkType: hard -"@graphql-yoga/typed-event-target@npm:^3.0.0": - version: 3.0.0 - resolution: "@graphql-yoga/typed-event-target@npm:3.0.0" +"@graphql-yoga/typed-event-target@npm:^3.0.1": + version: 3.0.1 + resolution: "@graphql-yoga/typed-event-target@npm:3.0.1" dependencies: "@repeaterjs/repeater": ^3.0.4 tslib: ^2.5.2 - checksum: 0101e71658b519e935bcfc439f9a9db401d2ac17cacfa893a5cb15de947f1962ea84c3ebc89a88dc91f7f1030a758595c20903fa1d3b685c854723688f3a4a08 + checksum: 296dcbdad716bbaf3ddf0143b904f6551eced01bc749bc8efb4d018b60b9c686c04caaec6561318befbebf7a147151c26af0caeac4fbfd04b6598579105d6e4d languageName: node linkType: hard @@ -3276,13 +3286,13 @@ __metadata: linkType: hard "@jridgewell/gen-mapping@npm:^0.3.5": - version: 0.3.5 - resolution: "@jridgewell/gen-mapping@npm:0.3.5" + version: 0.3.8 + resolution: "@jridgewell/gen-mapping@npm:0.3.8" dependencies: "@jridgewell/set-array": ^1.2.1 "@jridgewell/sourcemap-codec": ^1.4.10 "@jridgewell/trace-mapping": ^0.3.24 - checksum: ff7a1764ebd76a5e129c8890aa3e2f46045109dabde62b0b6c6a250152227647178ff2069ea234753a690d8f3c4ac8b5e7b267bbee272bffb7f3b0a370ab6e52 + checksum: c0687b5227461717aa537fe71a42e356bcd1c43293b3353796a148bf3b0d6f59109def46c22f05b60e29a46f19b2e4676d027959a7c53a6c92b9d5b0d87d0420 languageName: node linkType: hard @@ -3377,16 +3387,7 @@ __metadata: languageName: node linkType: hard -"@noble/curves@npm:1.6.0, @noble/curves@npm:~1.6.0": - version: 1.6.0 - resolution: "@noble/curves@npm:1.6.0" - dependencies: - "@noble/hashes": 1.5.0 - checksum: 258f3feb2a6098cf35521562ecb7d452fd728e8a008ff9f1ef435184f9d0c782ceb8f7b7fa8df3317c3be7a19f53995ee124cd05c8080b130bd42e3cb072f24d - languageName: node - linkType: hard - -"@noble/curves@npm:^1.4.0, @noble/curves@npm:^1.6.0, @noble/curves@npm:~1.7.0": +"@noble/curves@npm:1.7.0, @noble/curves@npm:^1.4.0, @noble/curves@npm:^1.6.0, @noble/curves@npm:~1.7.0": version: 1.7.0 resolution: "@noble/curves@npm:1.7.0" dependencies: @@ -3402,13 +3403,6 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:1.5.0, @noble/hashes@npm:~1.5.0": - version: 1.5.0 - resolution: "@noble/hashes@npm:1.5.0" - checksum: 9cc031d5c888c455bfeef76af649b87f75380a4511405baea633c1e4912fd84aff7b61e99716f0231d244c9cfeda1fafd7d718963e6a0c674ed705e9b1b4f76b - languageName: node - linkType: hard - "@noble/hashes@npm:1.6.0": version: 1.6.0 resolution: "@noble/hashes@npm:1.6.0" @@ -3416,7 +3410,7 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:^1.4.0, @noble/hashes@npm:^1.5.0, @noble/hashes@npm:~1.6.0": +"@noble/hashes@npm:1.6.1, @noble/hashes@npm:^1.4.0, @noble/hashes@npm:^1.5.0, @noble/hashes@npm:~1.6.0": version: 1.6.1 resolution: "@noble/hashes@npm:1.6.1" checksum: 57c62f65ee217c0293b4321b547792aa6d79812bfe70a7d62dc83e0f936cc677b14ed981b4e88cf8fdad37cd6d3a0cbd3bd0908b0728adc9daf066e678be8901 @@ -3506,7 +3500,7 @@ __metadata: languageName: node linkType: hard -"@nomicfoundation/edr@npm:^0.6.4": +"@nomicfoundation/edr@npm:^0.6.5": version: 0.6.5 resolution: "@nomicfoundation/edr@npm:0.6.5" dependencies: @@ -4045,19 +4039,6 @@ __metadata: languageName: node linkType: hard -"@npmcli/agent@npm:^2.0.0": - version: 2.2.2 - resolution: "@npmcli/agent@npm:2.2.2" - dependencies: - agent-base: ^7.1.0 - http-proxy-agent: ^7.0.0 - https-proxy-agent: ^7.0.1 - lru-cache: ^10.0.1 - socks-proxy-agent: ^8.0.3 - checksum: 67de7b88cc627a79743c88bab35e023e23daf13831a8aa4e15f998b92f5507b644d8ffc3788afc8e64423c612e0785a6a92b74782ce368f49a6746084b50d874 - languageName: node - linkType: hard - "@npmcli/agent@npm:^3.0.0": version: 3.0.0 resolution: "@npmcli/agent@npm:3.0.0" @@ -4132,15 +4113,6 @@ __metadata: languageName: node linkType: hard -"@npmcli/fs@npm:^3.1.0": - version: 3.1.1 - resolution: "@npmcli/fs@npm:3.1.1" - dependencies: - semver: ^7.3.5 - checksum: d960cab4b93adcb31ce223bfb75c5714edbd55747342efb67dcc2f25e023d930a7af6ece3e75f2f459b6f38fc14d031c766f116cd124fdc937fd33112579e820 - languageName: node - linkType: hard - "@npmcli/fs@npm:^4.0.0": version: 4.0.0 resolution: "@npmcli/fs@npm:4.0.0" @@ -4179,7 +4151,7 @@ __metadata: languageName: node linkType: hard -"@npmcli/map-workspaces@npm:^4.0.1": +"@npmcli/map-workspaces@npm:^4.0.1, @npmcli/map-workspaces@npm:^4.0.2": version: 4.0.2 resolution: "@npmcli/map-workspaces@npm:4.0.2" dependencies: @@ -4218,9 +4190,9 @@ __metadata: languageName: node linkType: hard -"@npmcli/package-json@npm:^6.0.0, @npmcli/package-json@npm:^6.0.1": - version: 6.0.1 - resolution: "@npmcli/package-json@npm:6.0.1" +"@npmcli/package-json@npm:^6.0.0, @npmcli/package-json@npm:^6.0.1, @npmcli/package-json@npm:^6.1.0": + version: 6.1.0 + resolution: "@npmcli/package-json@npm:6.1.0" dependencies: "@npmcli/git": ^6.0.0 glob: ^10.2.2 @@ -4229,7 +4201,7 @@ __metadata: normalize-package-data: ^7.0.0 proc-log: ^5.0.0 semver: ^7.5.3 - checksum: cd2c7f62450ebf08f58bc434bbe4ebd2200c699707c50e51b7d597524ca5aa7184a348207e72925658decb383c3f5f60b407b8cb2c6a8f04a7dccd6e3c7eff5b + checksum: 645ce40b159de40f292f0a12a6957eed5127ad1d8aada3f519279cf8700b629e1f51f8215532f33a0094337be571044f8e1a9066b45196447f54440c1326baaf languageName: node linkType: hard @@ -4259,16 +4231,16 @@ __metadata: linkType: hard "@npmcli/run-script@npm:^9.0.0, @npmcli/run-script@npm:^9.0.1": - version: 9.0.1 - resolution: "@npmcli/run-script@npm:9.0.1" + version: 9.0.2 + resolution: "@npmcli/run-script@npm:9.0.2" dependencies: "@npmcli/node-gyp": ^4.0.0 "@npmcli/package-json": ^6.0.0 "@npmcli/promise-spawn": ^8.0.0 - node-gyp: ^10.0.0 + node-gyp: ^11.0.0 proc-log: ^5.0.0 which: ^5.0.0 - checksum: 8422e4c4a5c55bb0aa0c8d746fe3763281a7d3b6526b29298ccb048a97bf166fd233198fc896c9b44bd2f598f719c842202e21c52e3f2a26c5d9b3d2e8d14957 + checksum: 85d83c093bfce589632e82b6c26e50a365a61a88e4ad27ba287563cbc6dc5ec05652de4ac60871b42b2c454209fd996d47889217d5358fdcfd0b0fbc109f46a4 languageName: node linkType: hard @@ -4763,7 +4735,7 @@ __metadata: languageName: node linkType: hard -"@scure/base@npm:~1.1.0, @scure/base@npm:~1.1.7, @scure/base@npm:~1.1.8": +"@scure/base@npm:~1.1.0": version: 1.1.9 resolution: "@scure/base@npm:1.1.9" checksum: 120820a37dfe9dfe4cab2b7b7460552d08e67dee8057ed5354eb68d8e3440890ae983ce3bee957d2b45684950b454a2b6d71d5ee77c1fd3fddc022e2a510337f @@ -4788,18 +4760,7 @@ __metadata: languageName: node linkType: hard -"@scure/bip32@npm:1.5.0": - version: 1.5.0 - resolution: "@scure/bip32@npm:1.5.0" - dependencies: - "@noble/curves": ~1.6.0 - "@noble/hashes": ~1.5.0 - "@scure/base": ~1.1.7 - checksum: 2e119525cdffccc3aad7ca64aec22df2101233708111dfb551410f82aae85fe14acf39dc87cea1a535adc327451f9c3dea3c6a2dd22b859508025bc46a7a80ce - languageName: node - linkType: hard - -"@scure/bip32@npm:^1.5.0": +"@scure/bip32@npm:1.6.0, @scure/bip32@npm:^1.5.0": version: 1.6.0 resolution: "@scure/bip32@npm:1.6.0" dependencies: @@ -4820,17 +4781,7 @@ __metadata: languageName: node linkType: hard -"@scure/bip39@npm:1.4.0": - version: 1.4.0 - resolution: "@scure/bip39@npm:1.4.0" - dependencies: - "@noble/hashes": ~1.5.0 - "@scure/base": ~1.1.8 - checksum: 211f2c01361993bfe54c0e4949f290224381457c7f76d7cd51d6a983f3f4b6b9f85adfd0e623977d777ed80417a5fe729eb19dd34e657147810a0e58a8e7b9e0 - languageName: node - linkType: hard - -"@scure/bip39@npm:^1.4.0": +"@scure/bip39@npm:1.5.0, @scure/bip39@npm:^1.4.0": version: 1.5.0 resolution: "@scure/bip39@npm:1.5.0" dependencies: @@ -4847,20 +4798,6 @@ __metadata: languageName: node linkType: hard -"@semantic-release/changelog@npm:^6.0.3": - version: 6.0.3 - resolution: "@semantic-release/changelog@npm:6.0.3" - dependencies: - "@semantic-release/error": ^3.0.0 - aggregate-error: ^3.0.0 - fs-extra: ^11.0.0 - lodash: ^4.17.4 - peerDependencies: - semantic-release: ">=18.0.0" - checksum: 63283df7aaff7b2d5c08ac322faf362fd953d4ca4f2d2a1855ca51482ff8e973e38497a4c4a35a5b6ebec8373608895ef74d41072565e5bf3766850b4a6def37 - languageName: node - linkType: hard - "@semantic-release/commit-analyzer@npm:^12.0.0": version: 12.0.0 resolution: "@semantic-release/commit-analyzer@npm:12.0.0" @@ -4952,7 +4889,7 @@ __metadata: languageName: node linkType: hard -"@semantic-release/npm@npm:^12.0.0": +"@semantic-release/npm@npm:^12.0.0, @semantic-release/npm@npm:^12.0.1": version: 12.0.1 resolution: "@semantic-release/npm@npm:12.0.1" dependencies: @@ -5156,12 +5093,12 @@ __metadata: languageName: node linkType: hard -"@smithy/types@npm:^3.7.1": - version: 3.7.1 - resolution: "@smithy/types@npm:3.7.1" +"@smithy/types@npm:^3.7.2": + version: 3.7.2 + resolution: "@smithy/types@npm:3.7.2" dependencies: tslib: ^2.6.2 - checksum: 8db4393211db97aec515cc06748fa23acfc0c26a19c5ed6d009add623e1b1b7a470603a71f55b9de31a15696a2918e4a0913cb3531bfc7951b80bc7872f594f0 + checksum: f3ae277d2f81eeb67c12e651b2e999225cda115dff8fab257a77fbe3739d32c515dbd19218590dd2c33d203259b00c80c9fc6027f8484c50725390a8fc0f1e3e languageName: node linkType: hard @@ -5432,11 +5369,11 @@ __metadata: linkType: hard "@types/node@npm:*, @types/node@npm:>=13.7.0": - version: 22.10.0 - resolution: "@types/node@npm:22.10.0" + version: 22.10.2 + resolution: "@types/node@npm:22.10.2" dependencies: undici-types: ~6.20.0 - checksum: 72b1314ba9dfbabaf1ba01480086399ff3831c8fc30ce82be4755d87cfc25f2ef17ec43d528e655797bbe4de4dd7d3eb7fa7ce2f91dccb8d434865a72870a149 + checksum: b22401e6e7d1484e437d802c72f5560e18100b1257b9ad0574d6fe05bebe4dbcb620ea68627d1f1406775070d29ace8b6b51f57e7b1c7b8bafafe6da7f29c843 languageName: node linkType: hard @@ -5462,11 +5399,11 @@ __metadata: linkType: hard "@types/node@npm:^20.5.9": - version: 20.17.8 - resolution: "@types/node@npm:20.17.8" + version: 20.17.10 + resolution: "@types/node@npm:20.17.10" dependencies: undici-types: ~6.19.2 - checksum: c963c363bda5ade3d60b66eaeb1cf809e6a333fdd08cc40120bb86d112b58a667893d23b02cb9876ba69619214384c08e60b7dd0718ca404e954cf2ce6b24840 + checksum: 44cfa7cd9a4ebb8f74efa4b89cf963ca0e522121a7d24d8121d40872bbcfd607eaccdc203c4fe92c8b587125be9ca7b071fe4f9b356f263434b8a8512dbebef0 languageName: node linkType: hard @@ -5477,7 +5414,7 @@ __metadata: languageName: node linkType: hard -"@types/normalize-package-data@npm:^2.4.0, @types/normalize-package-data@npm:^2.4.1, @types/normalize-package-data@npm:^2.4.3": +"@types/normalize-package-data@npm:^2.4.0, @types/normalize-package-data@npm:^2.4.3": version: 2.4.4 resolution: "@types/normalize-package-data@npm:2.4.4" checksum: 65dff72b543997b7be8b0265eca7ace0e34b75c3e5fee31de11179d08fa7124a7a5587265d53d0409532ecb7f7fba662c2012807963e1f9b059653ec2c83ee05 @@ -5680,9 +5617,9 @@ __metadata: linkType: hard "@ungap/structured-clone@npm:^1.2.0": - version: 1.2.0 - resolution: "@ungap/structured-clone@npm:1.2.0" - checksum: 4f656b7b4672f2ce6e272f2427d8b0824ed11546a601d8d5412b9d7704e83db38a8d9f402ecdf2b9063fc164af842ad0ec4a55819f621ed7e7ea4d1efcc74524 + version: 1.2.1 + resolution: "@ungap/structured-clone@npm:1.2.1" + checksum: 1e3b9fef293118861f0b2159b3695fc7f3793c0707095888ebb3ac7183f78c390e68f04cd4b4cf9ac979ae0da454505e08b3aae887cdd639609a3fe529e19e59 languageName: node linkType: hard @@ -5703,7 +5640,7 @@ __metadata: dependencies: "@graphprotocol/client-cli": 3.0.0 "@graphprotocol/graph-cli": ^0.80.0 - "@venusprotocol/venus-protocol": 9.3.0 + "@venusprotocol/venus-protocol": 9.4.0 "@venusprotocol/venus-protocol-orig-events": "npm:@venusprotocol/venus-protocol@2.2.1" hardhat: ^2.10.2 semantic-release: ^23.1.1 @@ -5719,8 +5656,8 @@ __metadata: "@graphprotocol/client-cli": 3.0.0 "@graphprotocol/graph-cli": ^0.80.0 "@layerzerolabs/solidity-examples": ^1.0.0 - "@venusprotocol/governance-contracts": 2.5.0-dev.6 - "@venusprotocol/subgraph-utils": "workspace:^" + "@venusprotocol/governance-contracts": 2.7.0 + "@venusprotocol/subgraph-utils": 0.0.0 apollo-fetch: ^0.7.0 hardhat: ^2.10.2 semantic-release: ^23.1.1 @@ -5735,7 +5672,7 @@ __metadata: resolution: "@venusprotocol/etherfi-promo-subgraph@workspace:subgraphs/etherfi-promo" dependencies: "@graphprotocol/graph-cli": ^0.80.0 - "@venusprotocol/isolated-pools": 3.7.0-dev.5 + "@venusprotocol/isolated-pools": 3.7.1-dev.1 semantic-release: ^23.1.1 semantic-release-monorepo: ^8.0.2 ts-node: ^10.9.2 @@ -5743,14 +5680,14 @@ __metadata: languageName: unknown linkType: soft -"@venusprotocol/governance-contracts@npm:2.5.0-dev.6": - version: 2.5.0-dev.6 - resolution: "@venusprotocol/governance-contracts@npm:2.5.0-dev.6" +"@venusprotocol/governance-contracts@npm:2.7.0": + version: 2.7.0 + resolution: "@venusprotocol/governance-contracts@npm:2.7.0" dependencies: "@venusprotocol/solidity-utilities": 2.0.0 hardhat-deploy-ethers: ^0.3.0-beta.13 module-alias: ^2.2.2 - checksum: b0c975ea3c0620cbde8cda7c25c0525ba0b876ebedf31ff74f4f51637e2fc0d73f4c17c8fb5c57392645c11ef1eac91c702861247895d8a03ad15063638c6616 + checksum: 1e4e0cb3d0fbad4a155d623d25f9d5144940d8b90d1a62933c31cb6d8ea16e5fa30503aa3bad0f835e23529f0c1876be9b66f78a3a7de31986f17d4a6bff786e languageName: node linkType: hard @@ -5760,8 +5697,8 @@ __metadata: dependencies: "@graphprotocol/client-cli": 3.0.0 "@graphprotocol/graph-cli": ^0.80.0 - "@venusprotocol/governance-contracts": 2.5.0-dev.3 - "@venusprotocol/subgraph-utils": "workspace:^" + "@venusprotocol/governance-contracts": 2.7.0 + "@venusprotocol/subgraph-utils": 0.0.0 apollo-fetch: ^0.7.0 hardhat: ^2.10.2 semantic-release: ^23.1.1 @@ -5777,8 +5714,8 @@ __metadata: dependencies: "@graphprotocol/client-cli": 3.0.0 "@graphprotocol/graph-cli": ^0.80.0 - "@venusprotocol/isolated-pools": 3.7.0-dev.6 - "@venusprotocol/subgraph-utils": "workspace:^" + "@venusprotocol/isolated-pools": 3.7.1-dev.1 + "@venusprotocol/subgraph-utils": 0.0.0 apollo-fetch: ^0.7.0 hardhat: ^2.10.2 semantic-release: ^23.1.1 @@ -5788,26 +5725,26 @@ __metadata: languageName: unknown linkType: soft -"@venusprotocol/isolated-pools@npm:3.7.0-dev.5": - version: 3.7.0-dev.5 - resolution: "@venusprotocol/isolated-pools@npm:3.7.0-dev.5" +"@venusprotocol/isolated-pools@npm:3.7.1-dev.1": + version: 3.7.1-dev.1 + resolution: "@venusprotocol/isolated-pools@npm:3.7.1-dev.1" dependencies: "@nomiclabs/hardhat-ethers": ^2.2.3 "@openzeppelin/contracts": ^4.8.3 "@openzeppelin/contracts-upgradeable": ^4.8.3 "@openzeppelin/hardhat-upgrades": ^1.21.0 "@solidity-parser/parser": ^0.13.2 - "@venusprotocol/solidity-utilities": ^2.0.0 + "@venusprotocol/solidity-utilities": 2.0.3 ethers: ^5.7.0 hardhat-deploy: ^0.11.14 module-alias: ^2.2.2 - checksum: 0d4cea585025102481d6634ab5ec902b6d8abffcdfee4769b27023d5f4ad6d0fc86ad63ea4e30a73d43bf5f729e05bc5eb786b27233630a4982b366e124a34c6 + checksum: 272128815137c950456eb5998978a36ff96b64b24589c19025f450ce86aa113883f89f46272ce9093776d5d38dc9662b58431f21b96228eb2e20703054be4e4d languageName: node linkType: hard -"@venusprotocol/isolated-pools@npm:3.7.0-dev.6": - version: 3.7.0-dev.6 - resolution: "@venusprotocol/isolated-pools@npm:3.7.0-dev.6" +"@venusprotocol/isolated-pools@npm:^3.4.0": + version: 3.7.0 + resolution: "@venusprotocol/isolated-pools@npm:3.7.0" dependencies: "@nomiclabs/hardhat-ethers": ^2.2.3 "@openzeppelin/contracts": ^4.8.3 @@ -5818,13 +5755,13 @@ __metadata: ethers: ^5.7.0 hardhat-deploy: ^0.11.14 module-alias: ^2.2.2 - checksum: 94cc295b4bc5cc4720b9f2a5b4b2a6914d460ba18440c1ad66840ea43930f91c703668e15ad73ce41130889249dcc9a07f267ff03c7be11d6ff086951dd0cb2f + checksum: 666fe6961bfc5f42795aa9bfca4bd33affb459347946c9e0ea61b13a7946fa8e202c2a0a0d92ca384075d28fae48f503018d580230b19d3828c249e3bfe80ab0 languageName: node linkType: hard -"@venusprotocol/oracle@npm:2.6.0": - version: 2.6.0 - resolution: "@venusprotocol/oracle@npm:2.6.0" +"@venusprotocol/oracle@npm:2.7.0, @venusprotocol/oracle@npm:^2.7.0": + version: 2.7.0 + resolution: "@venusprotocol/oracle@npm:2.7.0" dependencies: "@chainlink/contracts": ^0.5.1 "@defi-wonderland/smock": 2.3.5 @@ -5839,7 +5776,7 @@ __metadata: hardhat-deploy: ^0.12.4 module-alias: ^2.2.2 solidity-docgen: ^0.6.0-beta.29 - checksum: 47c36e0cbba6f4963113e8e2db268063a52f4ffe913a8aab398f25d5c83ac5f448e45cb57992cb8f406e1be9a581557b7c75c4d8754d42f5d3164bff49f2b5c9 + checksum: 1fd036da69399b2d7024958bf12e07b053be553d0ba136334035b055b691a2b3b748dd6f52f6756c9770a216df8a8915a0e1a49d7169efcd1c658a21107e2ba4 languageName: node linkType: hard @@ -5849,7 +5786,7 @@ __metadata: dependencies: "@graphprotocol/client-cli": 3.0.0 "@graphprotocol/graph-cli": ^0.80.0 - "@venusprotocol/subgraph-utils": "workspace:^" + "@venusprotocol/subgraph-utils": 0.0.0 apollo-fetch: ^0.7.0 semantic-release: ^23.1.1 semantic-release-monorepo: ^8.0.2 @@ -5858,39 +5795,24 @@ __metadata: languageName: unknown linkType: soft -"@venusprotocol/protocol-reserve@npm:2.3.0": - version: 2.3.0 - resolution: "@venusprotocol/protocol-reserve@npm:2.3.0" - dependencies: - "@nomiclabs/hardhat-ethers": ^2.2.3 - "@openzeppelin/contracts": ^4.8.3 - "@openzeppelin/contracts-upgradeable": ^4.8.3 - "@openzeppelin/hardhat-upgrades": ^1.21.0 - "@solidity-parser/parser": ^0.13.2 - "@venusprotocol/solidity-utilities": ^2.0.3 - "@venusprotocol/venus-protocol": ^9.1.0 - ethers: ^5.7.0 - hardhat-deploy: ^0.11.14 - module-alias: ^2.2.2 - checksum: b9e12702281d0790c0136f922400b5f90ff88d04d2af97580620a2677190c1957a4fdb38ff6600ff5e4f71e4d521c8bb013d7775814a2f68e3883544f38caa95 - languageName: node - linkType: hard - -"@venusprotocol/protocol-reserve@npm:^2.4.0": - version: 2.4.0 - resolution: "@venusprotocol/protocol-reserve@npm:2.4.0" +"@venusprotocol/protocol-reserve@npm:3.0.1": + version: 3.0.1 + resolution: "@venusprotocol/protocol-reserve@npm:3.0.1" dependencies: "@nomiclabs/hardhat-ethers": ^2.2.3 "@openzeppelin/contracts": ^4.8.3 "@openzeppelin/contracts-upgradeable": ^4.8.3 "@openzeppelin/hardhat-upgrades": ^1.21.0 "@solidity-parser/parser": ^0.13.2 + "@venusprotocol/governance-contracts": ^2.6.0 + "@venusprotocol/isolated-pools": ^3.4.0 + "@venusprotocol/oracle": ^2.7.0 "@venusprotocol/solidity-utilities": ^2.0.3 "@venusprotocol/venus-protocol": ^9.1.0 ethers: ^5.7.0 - hardhat-deploy: ^0.11.14 + hardhat-deploy: ^0.14.0 module-alias: ^2.2.2 - checksum: 6e5ffa1c458cff073f9b920ab6385d9db0c86ac11d0950fe421a853e709ee12ec0013c6d3e9cb4e50e94f749dcd33e7a515d57828c5aa6f925dee8324e896ee5 + checksum: 704e4b923ef8fae6840cb53b9eced0504778ba879e3930de26ceb79d65e017d598b71baeeba980fff2b01ca78d6745bd48d9bb7082cda4178c547078661ea594 languageName: node linkType: hard @@ -5901,14 +5823,14 @@ __metadata: languageName: node linkType: hard -"@venusprotocol/solidity-utilities@npm:^2.0.0, @venusprotocol/solidity-utilities@npm:^2.0.3": +"@venusprotocol/solidity-utilities@npm:2.0.3, @venusprotocol/solidity-utilities@npm:^2.0.0, @venusprotocol/solidity-utilities@npm:^2.0.3": version: 2.0.3 resolution: "@venusprotocol/solidity-utilities@npm:2.0.3" checksum: 5f196d61989e1b276b6f2d515c0410f3af07deee9bec58a6657e61d46b1810b2da6e2880d1ec737fd410f23a035c2db47b6a3ab2274cac229cabfcf03d4424ac languageName: node linkType: hard -"@venusprotocol/subgraph-utils@workspace:^, @venusprotocol/subgraph-utils@workspace:packages/utils": +"@venusprotocol/subgraph-utils@0.0.0, @venusprotocol/subgraph-utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@venusprotocol/subgraph-utils@workspace:packages/utils" dependencies: @@ -5932,9 +5854,9 @@ __metadata: "@nomicfoundation/hardhat-network-helpers": ^1.0.4 "@nomiclabs/hardhat-ethers": ^2.1.1 "@nomiclabs/hardhat-etherscan": ^3.1.0 - "@semantic-release/changelog": ^6.0.3 "@semantic-release/exec": ^6.0.3 "@semantic-release/git": ^10.0.1 + "@semantic-release/npm": ^12.0.1 "@trivago/prettier-plugin-sort-imports": ^4.3.0 "@typechain/ethers-v5": ^10.1.0 "@typechain/hardhat": ^6.1.2 @@ -5943,12 +5865,12 @@ __metadata: "@types/node": ^20.5.9 "@typescript-eslint/eslint-plugin": ^5.40.1 "@typescript-eslint/parser": ^5.40.1 - "@venusprotocol/governance-contracts": 2.5.0-dev.6 - "@venusprotocol/isolated-pools": 3.7.0-dev.6 - "@venusprotocol/oracle": 2.6.0 - "@venusprotocol/protocol-reserve": 2.3.0 + "@venusprotocol/governance-contracts": 2.7.0 + "@venusprotocol/isolated-pools": 3.7.1-dev.1 + "@venusprotocol/oracle": 2.7.0 + "@venusprotocol/protocol-reserve": 3.0.1 "@venusprotocol/solidity-utilities": ^2.0.3 - "@venusprotocol/venus-protocol": 9.3.0 + "@venusprotocol/venus-protocol": 9.4.0 assemblyscript: 0.19.23 chai: ^4.3.6 dotenv: ^16.4.5 @@ -5970,16 +5892,15 @@ __metadata: mustache: ^4.2.0 patch-package: 6.5.1 prettier: ^3.0.3 - semantic-release-yarn: ^3.0.2 ts-node: ^10.9.2 typechain: ^8.1.0 typescript: ^4.8.4 languageName: unknown linkType: soft -"@venusprotocol/token-bridge@npm:^2.3.0": - version: 2.3.0 - resolution: "@venusprotocol/token-bridge@npm:2.3.0" +"@venusprotocol/token-bridge@npm:^2.4.0": + version: 2.4.0 + resolution: "@venusprotocol/token-bridge@npm:2.4.0" dependencies: "@layerzerolabs/solidity-examples": ^1.0.0 "@openzeppelin/contracts": ^4.8.3 @@ -5988,7 +5909,7 @@ __metadata: "@solidity-parser/parser": ^0.13.2 ethers: ^5.7.0 module-alias: ^2.2.2 - checksum: c9f3dcf9eb014592404de14998f817c230e51ec640074ad0811c4ab21e141478b91daefe949b51fc80d6437f3b1f1bb9f606f2c50c2720b01a2e673008208917 + checksum: f9d087df9c7e643b058c5c468f07145d76e44c01049ce1c824e326ec4b5549769b18575234267d1bef808c1eda2703b7a9ba6a3bb6ced99b46ccd5341657bf21 languageName: node linkType: hard @@ -6006,21 +5927,21 @@ __metadata: languageName: node linkType: hard -"@venusprotocol/venus-protocol@npm:9.3.0": - version: 9.3.0 - resolution: "@venusprotocol/venus-protocol@npm:9.3.0" +"@venusprotocol/venus-protocol@npm:9.4.0": + version: 9.4.0 + resolution: "@venusprotocol/venus-protocol@npm:9.4.0" dependencies: "@nomicfoundation/hardhat-ethers": ^3.0.0 "@openzeppelin/contracts": 4.9.3 "@openzeppelin/contracts-upgradeable": ^4.8.0 - "@venusprotocol/governance-contracts": ^2.4.0 - "@venusprotocol/protocol-reserve": ^2.4.0 + "@venusprotocol/governance-contracts": ^2.6.0 + "@venusprotocol/protocol-reserve": ^3.0.0 "@venusprotocol/solidity-utilities": ^2.0.3 - "@venusprotocol/token-bridge": ^2.3.0 + "@venusprotocol/token-bridge": ^2.4.0 bignumber.js: ^9.1.2 dotenv: ^16.0.1 module-alias: ^2.2.2 - checksum: e9869d63a5c6a4f00ad091357cf76ee6b27a2c61459e69e6818fb36fedb677ae4717c047c5241c6993b86ce29d8657e69abbd88ce4f3344d636a0069ca1559d2 + checksum: 8c5c6fa31f6aaef9816143f353986cc9e8faf9fabae1fdc999c477d61b952303f8b7004e5c5f4e8f3432157af14e5c831d6117b479787fc8d851ad6318fcca04 languageName: node linkType: hard @@ -6125,15 +6046,15 @@ __metadata: linkType: hard "@whatwg-node/node-fetch@npm:^0.7.1": - version: 0.7.4 - resolution: "@whatwg-node/node-fetch@npm:0.7.4" + version: 0.7.5 + resolution: "@whatwg-node/node-fetch@npm:0.7.5" dependencies: "@kamilkisiela/fast-url-parser": ^1.1.4 "@whatwg-node/disposablestack": ^0.0.5 busboy: ^1.6.0 fast-querystring: ^1.1.1 tslib: ^2.6.3 - checksum: 7e59e06be3efd3b5f4061ebb4b433914c7548400feed4d2d1d04129073acceb47281f687bbd7c5787c04870d4e2ea160c8d4ba57d80f2a98ae7a6851d4daa3cd + checksum: 92d1b09fd747936b2600c00d1bf718cc3d1381cd477e1ed50d485b73650c0369a13f66cd0ec82d3992a06ecc2c013d0a411286184626894144a99433ed4fae01 languageName: node linkType: hard @@ -6147,50 +6068,14 @@ __metadata: languageName: node linkType: hard -"@whatwg-node/server@npm:^0.9.55": - version: 0.9.60 - resolution: "@whatwg-node/server@npm:0.9.60" +"@whatwg-node/server@npm:^0.9.63": + version: 0.9.64 + resolution: "@whatwg-node/server@npm:0.9.64" dependencies: "@whatwg-node/disposablestack": ^0.0.5 "@whatwg-node/fetch": ^0.10.0 tslib: ^2.6.3 - checksum: fb541ad4ed2ca52bcaa1ed531b06d0924ce0462ed1ab11fdbc8f479260dfd5ffc49ea2ba6ab9af5a9da312b93404cc08141890496e2ae8c43871cd495a0cbdd3 - languageName: node - linkType: hard - -"@wry/caches@npm:^1.0.0": - version: 1.0.1 - resolution: "@wry/caches@npm:1.0.1" - dependencies: - tslib: ^2.3.0 - checksum: 9e89aa8e9e08577b2e4acbe805f406b141ae49c2ac4a2e22acf21fbee68339fa0550e0dee28cf2158799f35bb812326e80212e49e2afd169f39f02ad56ae4ef4 - languageName: node - linkType: hard - -"@wry/context@npm:^0.7.0": - version: 0.7.4 - resolution: "@wry/context@npm:0.7.4" - dependencies: - tslib: ^2.3.0 - checksum: 9bc8c30a31f9c7d36b616e89daa9280c03d196576a4f9fef800e9bd5de9434ba70216322faeeacc7ef1ab95f59185599d702538114045df729a5ceea50aef4e2 - languageName: node - linkType: hard - -"@wry/equality@npm:^0.5.6": - version: 0.5.7 - resolution: "@wry/equality@npm:0.5.7" - dependencies: - tslib: ^2.3.0 - checksum: 892f262fae362df80f199b12658ea6966949539d4a3a50c1acf00d94a367d673a38f8efa1abcb726ae9e5cc5e62fce50c540c70f797b7c8a2c4308b401dfd903 - languageName: node - linkType: hard - -"@wry/trie@npm:^0.5.0": - version: 0.5.0 - resolution: "@wry/trie@npm:0.5.0" - dependencies: - tslib: ^2.3.0 - checksum: 92aeea34152bd8485184236fe328d3d05fc98ee3b431d82ee60cf3584dbf68155419c3d65d0ff3731b204ee79c149440a9b7672784a545afddc8d4342fbf21c9 + checksum: 4d39de4fcb17b5c59b0cc26e3c2d1a32742cda6054b411b8baba77395b36fdab2d7b3130b9ea9f7efc4e338d16b14e92f6253b6dc5ffa489f513b9f532b8fb7d languageName: node linkType: hard @@ -6239,9 +6124,9 @@ __metadata: languageName: node linkType: hard -"abitype@npm:1.0.6, abitype@npm:^1.0.6": - version: 1.0.6 - resolution: "abitype@npm:1.0.6" +"abitype@npm:1.0.7, abitype@npm:^1.0.6": + version: 1.0.7 + resolution: "abitype@npm:1.0.7" peerDependencies: typescript: ">=5.0.4" zod: ^3 >=3.22.0 @@ -6250,7 +6135,7 @@ __metadata: optional: true zod: optional: true - checksum: 0bf6ed5ec785f372746c3ec5d6c87bf4d8cf0b6db30867b8d24e86fbc66d9f6599ae3d463ccd49817e67eedec6deba7cdae317bcf4da85b02bc48009379b9f84 + checksum: c3b3ee19becbbce1d5c55a40a13dee6c09c0d710eee9c601433eb496c5ee2cd39e97dd0d043fa1ff7e68b1239ef83fe56951b2009d467e989fe941785cd7f8b8 languageName: node linkType: hard @@ -6328,12 +6213,10 @@ __metadata: languageName: node linkType: hard -"agent-base@npm:^7.0.2, agent-base@npm:^7.1.0, agent-base@npm:^7.1.1": - version: 7.1.1 - resolution: "agent-base@npm:7.1.1" - dependencies: - debug: ^4.3.4 - checksum: 51c158769c5c051482f9ca2e6e1ec085ac72b5a418a9b31b4e82fe6c0a6699adb94c1c42d246699a587b3335215037091c79e0de512c516f73b6ea844202f037 +"agent-base@npm:^7.1.0, agent-base@npm:^7.1.2": + version: 7.1.3 + resolution: "agent-base@npm:7.1.3" + checksum: 87bb7ee54f5ecf0ccbfcba0b07473885c43ecd76cb29a8db17d6137a19d9f9cd443a2a7c5fd8a3f24d58ad8145f9eb49116344a66b107e1aeab82cf2383f4753 languageName: node linkType: hard @@ -6702,42 +6585,41 @@ __metadata: linkType: hard "array.prototype.flat@npm:^1.3.2": - version: 1.3.2 - resolution: "array.prototype.flat@npm:1.3.2" + version: 1.3.3 + resolution: "array.prototype.flat@npm:1.3.3" dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 - es-shim-unscopables: ^1.0.0 - checksum: 5d6b4bf102065fb3f43764bfff6feb3295d372ce89591e6005df3d0ce388527a9f03c909af6f2a973969a4d178ab232ffc9236654149173e0e187ec3a1a6b87b + call-bind: ^1.0.8 + define-properties: ^1.2.1 + es-abstract: ^1.23.5 + es-shim-unscopables: ^1.0.2 + checksum: 5d5a7829ab2bb271a8d30a1c91e6271cef0ec534593c0fe6d2fb9ebf8bb62c1e5326e2fddcbbcbbe5872ca04f5e6b54a1ecf092e0af704fb538da9b2bfd95b40 languageName: node linkType: hard "array.prototype.flatmap@npm:^1.3.2": - version: 1.3.2 - resolution: "array.prototype.flatmap@npm:1.3.2" + version: 1.3.3 + resolution: "array.prototype.flatmap@npm:1.3.3" dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 - es-shim-unscopables: ^1.0.0 - checksum: ce09fe21dc0bcd4f30271f8144083aa8c13d4639074d6c8dc82054b847c7fc9a0c97f857491f4da19d4003e507172a78f4bcd12903098adac8b9cd374f734be3 + call-bind: ^1.0.8 + define-properties: ^1.2.1 + es-abstract: ^1.23.5 + es-shim-unscopables: ^1.0.2 + checksum: 11b4de09b1cf008be6031bb507d997ad6f1892e57dc9153583de6ebca0f74ea403fffe0f203461d359de05048d609f3f480d9b46fed4099652d8b62cc972f284 languageName: node linkType: hard -"arraybuffer.prototype.slice@npm:^1.0.3": - version: 1.0.3 - resolution: "arraybuffer.prototype.slice@npm:1.0.3" +"arraybuffer.prototype.slice@npm:^1.0.4": + version: 1.0.4 + resolution: "arraybuffer.prototype.slice@npm:1.0.4" dependencies: array-buffer-byte-length: ^1.0.1 - call-bind: ^1.0.5 + call-bind: ^1.0.8 define-properties: ^1.2.1 - es-abstract: ^1.22.3 - es-errors: ^1.2.1 - get-intrinsic: ^1.2.3 + es-abstract: ^1.23.5 + es-errors: ^1.3.0 + get-intrinsic: ^1.2.6 is-array-buffer: ^3.0.4 - is-shared-array-buffer: ^1.0.2 - checksum: 352259cba534dcdd969c92ab002efd2ba5025b2e3b9bead3973150edbdf0696c629d7f4b3f061c5931511e8207bdc2306da614703c820b45dabce39e3daf7e3e + checksum: b1d1fd20be4e972a3779b1569226f6740170dca10f07aa4421d42cefeec61391e79c557cda8e771f5baefe47d878178cd4438f60916ce831813c08132bced765 languageName: node linkType: hard @@ -6881,13 +6763,13 @@ __metadata: linkType: hard "axios@npm:^1.4.0, axios@npm:^1.5.1": - version: 1.7.8 - resolution: "axios@npm:1.7.8" + version: 1.7.9 + resolution: "axios@npm:1.7.9" dependencies: follow-redirects: ^1.15.6 form-data: ^4.0.0 proxy-from-env: ^1.1.0 - checksum: 3d21652faf8e29fb36c47517d2872bb5e2285127a24f5c53ce23082c4eac7f5a88de84dd49d4a1a83068e5301dcfd9067b41e5fbd00b0d20ab7b0a843559273d + checksum: cb8ce291818effda09240cb60f114d5625909b345e10f389a945320e06acf0bc949d0f8422d25720f5dd421362abee302c99f5e97edec4c156c8939814b23d19 languageName: node linkType: hard @@ -7188,16 +7070,16 @@ __metadata: linkType: hard "browserslist@npm:^4.24.0": - version: 4.24.2 - resolution: "browserslist@npm:4.24.2" + version: 4.24.3 + resolution: "browserslist@npm:4.24.3" dependencies: - caniuse-lite: ^1.0.30001669 - electron-to-chromium: ^1.5.41 - node-releases: ^2.0.18 + caniuse-lite: ^1.0.30001688 + electron-to-chromium: ^1.5.73 + node-releases: ^2.0.19 update-browserslist-db: ^1.1.1 bin: browserslist: cli.js - checksum: cf64085f12132d38638f38937a255edb82c7551b164a98577b055dd79719187a816112f7b97b9739e400c4954cd66479c0d7a843cb816e346f4795dc24fd5d97 + checksum: 016efc9953350e3a7212edcfdd72210cb33b339c1a974a77c0715eb67d23d7e5cd0a073ce1c801ab09235d8c213425ca51b92d41bbb829b833872b45f885fe7c languageName: node linkType: hard @@ -7312,31 +7194,11 @@ __metadata: languageName: node linkType: hard -"cacache@npm:^18.0.0": - version: 18.0.4 - resolution: "cacache@npm:18.0.4" +"cacache@npm:^19.0.0, cacache@npm:^19.0.1": + version: 19.0.1 + resolution: "cacache@npm:19.0.1" dependencies: - "@npmcli/fs": ^3.1.0 - fs-minipass: ^3.0.0 - glob: ^10.2.2 - lru-cache: ^10.0.1 - minipass: ^7.0.3 - minipass-collect: ^2.0.1 - minipass-flush: ^1.0.5 - minipass-pipeline: ^1.2.4 - p-map: ^4.0.0 - ssri: ^10.0.0 - tar: ^6.1.11 - unique-filename: ^3.0.0 - checksum: b7422c113b4ec750f33beeca0f426a0024c28e3172f332218f48f963e5b970647fa1ac05679fe5bb448832c51efea9fda4456b9a95c3a1af1105fe6c1833cde2 - languageName: node - linkType: hard - -"cacache@npm:^19.0.0, cacache@npm:^19.0.1": - version: 19.0.1 - resolution: "cacache@npm:19.0.1" - dependencies: - "@npmcli/fs": ^4.0.0 + "@npmcli/fs": ^4.0.0 fs-minipass: ^3.0.0 glob: ^10.2.2 lru-cache: ^10.0.1 @@ -7352,16 +7214,35 @@ __metadata: languageName: node linkType: hard -"call-bind@npm:^1.0.2, call-bind@npm:^1.0.5, call-bind@npm:^1.0.6, call-bind@npm:^1.0.7": - version: 1.0.7 - resolution: "call-bind@npm:1.0.7" +"call-bind-apply-helpers@npm:^1.0.0, call-bind-apply-helpers@npm:^1.0.1": + version: 1.0.1 + resolution: "call-bind-apply-helpers@npm:1.0.1" dependencies: - es-define-property: ^1.0.0 es-errors: ^1.3.0 function-bind: ^1.1.2 + checksum: 3c55343261bb387c58a4762d15ad9d42053659a62681ec5eb50690c6b52a4a666302a01d557133ce6533e8bd04530ee3b209f23dd06c9577a1925556f8fcccdf + languageName: node + linkType: hard + +"call-bind@npm:^1.0.5, call-bind@npm:^1.0.6, call-bind@npm:^1.0.7, call-bind@npm:^1.0.8": + version: 1.0.8 + resolution: "call-bind@npm:1.0.8" + dependencies: + call-bind-apply-helpers: ^1.0.0 + es-define-property: ^1.0.0 get-intrinsic: ^1.2.4 - set-function-length: ^1.2.1 - checksum: 295c0c62b90dd6522e6db3b0ab1ce26bdf9e7404215bda13cfee25b626b5ff1a7761324d58d38b1ef1607fc65aca2d06e44d2e18d0dfc6c14b465b00d8660029 + set-function-length: ^1.2.2 + checksum: aa2899bce917a5392fd73bd32e71799c37c0b7ab454e0ed13af7f6727549091182aade8bbb7b55f304a5bc436d543241c14090fb8a3137e9875e23f444f4f5a9 + languageName: node + linkType: hard + +"call-bound@npm:^1.0.2, call-bound@npm:^1.0.3": + version: 1.0.3 + resolution: "call-bound@npm:1.0.3" + dependencies: + call-bind-apply-helpers: ^1.0.1 + get-intrinsic: ^1.2.6 + checksum: a93bbe0f2d0a2d6c144a4349ccd0593d5d0d5d9309b69101710644af8964286420062f2cc3114dca120b9bc8cc07507952d4b1b3ea7672e0d7f6f1675efedb32 languageName: node linkType: hard @@ -7432,10 +7313,10 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.30001669": - version: 1.0.30001684 - resolution: "caniuse-lite@npm:1.0.30001684" - checksum: 5ee7aca9c29067d2e4c88cd05cbc062599d86389cd99e26e4d4bf84de8fad3f9ed2be9d3d909dfb65f50e77a17192175cb132eca7f0988ab0f3e8c4aa0dccd38 +"caniuse-lite@npm:^1.0.30001688": + version: 1.0.30001689 + resolution: "caniuse-lite@npm:1.0.30001689" + checksum: 8d4152076517ac1dfd6d6733ecc8055f3cd3a8b679af8f5858e731312f03967f6a2184553636696e44cee39abdd9ccccc914716235791b0c25f68ef8dea4e24a languageName: node linkType: hard @@ -7692,11 +7573,11 @@ __metadata: linkType: hard "chokidar@npm:^4.0.0": - version: 4.0.1 - resolution: "chokidar@npm:4.0.1" + version: 4.0.2 + resolution: "chokidar@npm:4.0.2" dependencies: readdirp: ^4.0.1 - checksum: 193da9786b0422a895d59c7552195d15c6c636e6a2293ae43d09e34e243e24ccd02d693f007c767846a65abbeae5fea6bfacb8fc2ddec4ea4d397620d552010d + checksum: ba7c43d249fa99bdc19c809b0085468e0709b2f1e27eb8573ed2b21af51667677d663dbc68d30ad9eb7620fc216131d98f9017952776db03063955ee58ed2834 languageName: node linkType: hard @@ -8287,7 +8168,7 @@ __metadata: languageName: node linkType: hard -"cosmiconfig@npm:^8.0.0, cosmiconfig@npm:^8.1.0, cosmiconfig@npm:^8.1.3": +"cosmiconfig@npm:^8.0.0, cosmiconfig@npm:^8.1.3": version: 8.3.6 resolution: "cosmiconfig@npm:8.3.6" dependencies: @@ -8499,13 +8380,20 @@ __metadata: languageName: node linkType: hard -"dataloader@npm:2.2.2, dataloader@npm:^2.2.2": +"dataloader@npm:2.2.2": version: 2.2.2 resolution: "dataloader@npm:2.2.2" checksum: 4dabd247089c29f194e94d5434d504f99156c5c214a03463c20f3f17f40398d7e179edee69a27c16e315519ac8739042a810090087ae26449a0e685156a02c65 languageName: node linkType: hard +"dataloader@npm:^2.2.2, dataloader@npm:^2.2.3": + version: 2.2.3 + resolution: "dataloader@npm:2.2.3" + checksum: cc272181f6cad0ea20511c0a0d270cbc1df960a3526ab24941bbeb2cb7120499a598fe2cd41b4818527367acf7bc1be0723b6e5034637db4759a396c904b78a6 + languageName: node + linkType: hard + "dayjs@npm:1.11.13": version: 1.11.13 resolution: "dayjs@npm:1.11.13" @@ -8521,14 +8409,14 @@ __metadata: linkType: hard "debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.3.5, debug@npm:^4.3.6": - version: 4.3.7 - resolution: "debug@npm:4.3.7" + version: 4.4.0 + resolution: "debug@npm:4.4.0" dependencies: ms: ^2.1.3 peerDependenciesMeta: supports-color: optional: true - checksum: 822d74e209cd910ef0802d261b150314bbcf36c582ccdbb3e70f0894823c17e49a50d3e66d96b633524263975ca16b6a833f3e3b7e030c157169a5fabac63160 + checksum: fb42df878dd0e22816fc56e1fdca9da73caa85212fbe40c868b1295a6878f9101ae684f4eeef516c13acfc700f5ea07f1136954f43d4cd2d477a811144136479 languageName: node linkType: hard @@ -8627,7 +8515,7 @@ __metadata: languageName: node linkType: hard -"define-properties@npm:^1.2.0, define-properties@npm:^1.2.1": +"define-properties@npm:^1.2.1": version: 1.2.1 resolution: "define-properties@npm:1.2.1" dependencies: @@ -8682,6 +8570,13 @@ __metadata: languageName: node linkType: hard +"dependency-graph@npm:1.0.0": + version: 1.0.0 + resolution: "dependency-graph@npm:1.0.0" + checksum: c2e37c599877e5006020715686aa4f2c04746644124a0037f074873f5f9ccb3f2e8402393a280d52c26b9949deea0fbfeab3eb9e9839332dc7f37eede6c6f743 + languageName: node + linkType: hard + "diff@npm:^4.0.1": version: 4.0.2 resolution: "diff@npm:4.0.2" @@ -8803,9 +8698,9 @@ __metadata: linkType: hard "dotenv@npm:^16.0.1, dotenv@npm:^16.0.3, dotenv@npm:^16.4.5": - version: 16.4.5 - resolution: "dotenv@npm:16.4.5" - checksum: 301a12c3d44fd49888b74eb9ccf9f07a1f5df43f489e7fcb89647a2edcd84c42d6bc349dc8df099cd18f07c35c7b04685c1a4f3e6a6a9e6b30f8d48c15b7f49c + version: 16.4.7 + resolution: "dotenv@npm:16.4.7" + checksum: c27419b5875a44addcc56cc69b7dc5b0e6587826ca85d5b355da9303c6fc317fc9989f1f18366a16378c9fdd9532d14117a1abe6029cc719cdbbef6eaef2cea4 languageName: node linkType: hard @@ -8816,6 +8711,17 @@ __metadata: languageName: node linkType: hard +"dunder-proto@npm:^1.0.0": + version: 1.0.1 + resolution: "dunder-proto@npm:1.0.1" + dependencies: + call-bind-apply-helpers: ^1.0.1 + es-errors: ^1.3.0 + gopd: ^1.2.0 + checksum: 149207e36f07bd4941921b0ca929e3a28f1da7bd6b6ff8ff7f4e2f2e460675af4576eeba359c635723dc189b64cdd4787e0255897d5b135ccc5d15cb8685fc90 + languageName: node + linkType: hard + "duplexer2@npm:~0.1.0": version: 0.1.4 resolution: "duplexer2@npm:0.1.4" @@ -8863,10 +8769,10 @@ __metadata: languageName: node linkType: hard -"electron-to-chromium@npm:^1.5.41": - version: 1.5.65 - resolution: "electron-to-chromium@npm:1.5.65" - checksum: 4a112a038771c415f77e88fb3e3d929ceac4600b4612c55eb5d955a37c24842725f00c14f0f6838fd46edd832351c702b24c592c544d2e1e630d084f9df9f275 +"electron-to-chromium@npm:^1.5.73": + version: 1.5.74 + resolution: "electron-to-chromium@npm:1.5.74" + checksum: e93db5fdfafe927dcefe2ffef5b8670ae0c340eb8a4fe176918ec8efa53c37aff0ba4c3649c234950af2809d16a186ffead64dd921c9021d629658bf6d17c21f languageName: node linkType: hard @@ -9010,7 +8916,7 @@ __metadata: languageName: node linkType: hard -"error-ex@npm:^1.3.1, error-ex@npm:^1.3.2": +"error-ex@npm:^1.3.1": version: 1.3.2 resolution: "error-ex@npm:1.3.2" dependencies: @@ -9019,70 +8925,70 @@ __metadata: languageName: node linkType: hard -"es-abstract@npm:^1.22.1, es-abstract@npm:^1.22.3, es-abstract@npm:^1.23.0, es-abstract@npm:^1.23.2, es-abstract@npm:^1.23.5": - version: 1.23.5 - resolution: "es-abstract@npm:1.23.5" +"es-abstract@npm:^1.23.2, es-abstract@npm:^1.23.5": + version: 1.23.6 + resolution: "es-abstract@npm:1.23.6" dependencies: array-buffer-byte-length: ^1.0.1 - arraybuffer.prototype.slice: ^1.0.3 + arraybuffer.prototype.slice: ^1.0.4 available-typed-arrays: ^1.0.7 - call-bind: ^1.0.7 + call-bind: ^1.0.8 + call-bound: ^1.0.3 data-view-buffer: ^1.0.1 data-view-byte-length: ^1.0.1 data-view-byte-offset: ^1.0.0 - es-define-property: ^1.0.0 + es-define-property: ^1.0.1 es-errors: ^1.3.0 es-object-atoms: ^1.0.0 es-set-tostringtag: ^2.0.3 - es-to-primitive: ^1.2.1 - function.prototype.name: ^1.1.6 - get-intrinsic: ^1.2.4 + es-to-primitive: ^1.3.0 + function.prototype.name: ^1.1.7 + get-intrinsic: ^1.2.6 get-symbol-description: ^1.0.2 globalthis: ^1.0.4 - gopd: ^1.0.1 + gopd: ^1.2.0 has-property-descriptors: ^1.0.2 - has-proto: ^1.0.3 - has-symbols: ^1.0.3 + has-proto: ^1.2.0 + has-symbols: ^1.1.0 hasown: ^2.0.2 - internal-slot: ^1.0.7 + internal-slot: ^1.1.0 is-array-buffer: ^3.0.4 is-callable: ^1.2.7 - is-data-view: ^1.0.1 + is-data-view: ^1.0.2 is-negative-zero: ^2.0.3 - is-regex: ^1.1.4 + is-regex: ^1.2.1 is-shared-array-buffer: ^1.0.3 - is-string: ^1.0.7 + is-string: ^1.1.1 is-typed-array: ^1.1.13 - is-weakref: ^1.0.2 + is-weakref: ^1.1.0 + math-intrinsics: ^1.0.0 object-inspect: ^1.13.3 object-keys: ^1.1.1 object.assign: ^4.1.5 regexp.prototype.flags: ^1.5.3 - safe-array-concat: ^1.1.2 - safe-regex-test: ^1.0.3 - string.prototype.trim: ^1.2.9 - string.prototype.trimend: ^1.0.8 + safe-array-concat: ^1.1.3 + safe-regex-test: ^1.1.0 + string.prototype.trim: ^1.2.10 + string.prototype.trimend: ^1.0.9 string.prototype.trimstart: ^1.0.8 typed-array-buffer: ^1.0.2 typed-array-byte-length: ^1.0.1 - typed-array-byte-offset: ^1.0.2 - typed-array-length: ^1.0.6 + typed-array-byte-offset: ^1.0.3 + typed-array-length: ^1.0.7 unbox-primitive: ^1.0.2 - which-typed-array: ^1.1.15 - checksum: 17c81f8a42f0322fd11e0025d3c2229ecfd7923560c710906b8e68660e19c42322750dcedf8ba5cf28bae50d5befd8174d3903ac50dbabb336d3efc3aabed2ee + which-typed-array: ^1.1.16 + checksum: bc1b5a78ca243a9abd00e30aa84d644957878980e8bad961c9362a58e7790b56f54e146fc1871b15eed406fcd495cf2296a8ffb261370878f36316b62a67bbb4 languageName: node linkType: hard -"es-define-property@npm:^1.0.0": - version: 1.0.0 - resolution: "es-define-property@npm:1.0.0" - dependencies: - get-intrinsic: ^1.2.4 - checksum: f66ece0a887b6dca71848fa71f70461357c0e4e7249696f81bad0a1f347eed7b31262af4a29f5d726dc026426f085483b6b90301855e647aa8e21936f07293c6 +"es-define-property@npm:^1.0.0, es-define-property@npm:^1.0.1": + version: 1.0.1 + resolution: "es-define-property@npm:1.0.1" + checksum: 0512f4e5d564021c9e3a644437b0155af2679d10d80f21adaf868e64d30efdfbd321631956f20f42d655fedb2e3a027da479fad3fa6048f768eb453a80a5f80a languageName: node linkType: hard -"es-errors@npm:^1.2.1, es-errors@npm:^1.3.0": +"es-errors@npm:^1.3.0": version: 1.3.0 resolution: "es-errors@npm:1.3.0" checksum: ec1414527a0ccacd7f15f4a3bc66e215f04f595ba23ca75cdae0927af099b5ec865f9f4d33e9d7e86f512f252876ac77d4281a7871531a50678132429b1271b5 @@ -9109,7 +9015,7 @@ __metadata: languageName: node linkType: hard -"es-shim-unscopables@npm:^1.0.0, es-shim-unscopables@npm:^1.0.2": +"es-shim-unscopables@npm:^1.0.2": version: 1.0.2 resolution: "es-shim-unscopables@npm:1.0.2" dependencies: @@ -9118,7 +9024,7 @@ __metadata: languageName: node linkType: hard -"es-to-primitive@npm:^1.2.1": +"es-to-primitive@npm:^1.3.0": version: 1.3.0 resolution: "es-to-primitive@npm:1.3.0" dependencies: @@ -9596,7 +9502,7 @@ __metadata: languageName: node linkType: hard -"execa@npm:^8.0.0, execa@npm:^8.0.1": +"execa@npm:^8.0.0": version: 8.0.1 resolution: "execa@npm:8.0.1" dependencies: @@ -9614,8 +9520,8 @@ __metadata: linkType: hard "execa@npm:^9.0.0": - version: 9.5.1 - resolution: "execa@npm:9.5.1" + version: 9.5.2 + resolution: "execa@npm:9.5.2" dependencies: "@sindresorhus/merge-streams": ^4.0.0 cross-spawn: ^7.0.3 @@ -9629,7 +9535,7 @@ __metadata: signal-exit: ^4.1.0 strip-final-newline: ^4.0.0 yoctocolors: ^2.0.0 - checksum: 41766cc8bc3c0656f6ca3519347a625243d67c70aea06daead2af5aa47b93a7a6f2b8d478df93dde2079103d9fd61a24c91b4c6a020c2e6f8bf2d567eed43bbd + checksum: dbe18d07ef58d88116c94450e3f8422ad1ce498bdbfed51b0ed0e7c219d7842d2bccab36b1c0d61d58e99a944cf3c5f60ba08e6a3c5dfe51e1d6e84b0b4f82aa languageName: node linkType: hard @@ -10131,7 +10037,7 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^11.0.0, fs-extra@npm:^11.1.0": +"fs-extra@npm:^11.0.0": version: 11.2.0 resolution: "fs-extra@npm:11.2.0" dependencies: @@ -10228,15 +10134,16 @@ __metadata: languageName: node linkType: hard -"function.prototype.name@npm:^1.1.6": - version: 1.1.6 - resolution: "function.prototype.name@npm:1.1.6" +"function.prototype.name@npm:^1.1.6, function.prototype.name@npm:^1.1.7": + version: 1.1.7 + resolution: "function.prototype.name@npm:1.1.7" dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 + call-bind: ^1.0.8 + define-properties: ^1.2.1 functions-have-names: ^1.2.3 - checksum: 7a3f9bd98adab09a07f6e1f03da03d3f7c26abbdeaeee15223f6c04a9fb5674792bdf5e689dac19b97ac71de6aad2027ba3048a9b883aa1b3173eed6ab07f479 + hasown: ^2.0.2 + is-callable: ^1.2.7 + checksum: 271000814fd44b45ee5dbd595fe9aa45c20f276d04e2d3191476331e44d39c3d83d758bd7482e4dc7dacb67a2f196f5183834ab7a3546aa6d98f1de9020c676a languageName: node linkType: hard @@ -10284,16 +10191,21 @@ __metadata: languageName: node linkType: hard -"get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.1, get-intrinsic@npm:^1.2.3, get-intrinsic@npm:^1.2.4": - version: 1.2.4 - resolution: "get-intrinsic@npm:1.2.4" +"get-intrinsic@npm:^1.2.4, get-intrinsic@npm:^1.2.5, get-intrinsic@npm:^1.2.6": + version: 1.2.6 + resolution: "get-intrinsic@npm:1.2.6" dependencies: + call-bind-apply-helpers: ^1.0.1 + dunder-proto: ^1.0.0 + es-define-property: ^1.0.1 es-errors: ^1.3.0 + es-object-atoms: ^1.0.0 function-bind: ^1.1.2 - has-proto: ^1.0.1 - has-symbols: ^1.0.3 - hasown: ^2.0.0 - checksum: 414e3cdf2c203d1b9d7d33111df746a4512a1aa622770b361dadddf8ed0b5aeb26c560f49ca077e24bfafb0acb55ca908d1f709216ccba33ffc548ec8a79a951 + gopd: ^1.2.0 + has-symbols: ^1.1.0 + hasown: ^2.0.2 + math-intrinsics: ^1.0.0 + checksum: a7592a0b7f023a2e83c0121fa9449ca83780e370a5feeebe8452119474d148016e43b455049134ae7a683b9b11b93d3f65eac199a0ad452ab740d5f0c299de47 languageName: node linkType: hard @@ -10373,13 +10285,13 @@ __metadata: linkType: hard "get-symbol-description@npm:^1.0.2": - version: 1.0.2 - resolution: "get-symbol-description@npm:1.0.2" + version: 1.1.0 + resolution: "get-symbol-description@npm:1.1.0" dependencies: - call-bind: ^1.0.5 + call-bound: ^1.0.3 es-errors: ^1.3.0 - get-intrinsic: ^1.2.4 - checksum: e1cb53bc211f9dbe9691a4f97a46837a553c4e7caadd0488dc24ac694db8a390b93edd412b48dcdd0b4bbb4c595de1709effc75fc87c0839deedc6968f5bd973 + get-intrinsic: ^1.2.6 + checksum: 655ed04db48ee65ef2ddbe096540d4405e79ba0a7f54225775fef43a7e2afcb93a77d141c5f05fdef0afce2eb93bcbfb3597142189d562ac167ff183582683cd languageName: node linkType: hard @@ -10616,12 +10528,10 @@ __metadata: languageName: node linkType: hard -"gopd@npm:^1.0.1": - version: 1.0.1 - resolution: "gopd@npm:1.0.1" - dependencies: - get-intrinsic: ^1.1.3 - checksum: a5ccfb8806e0917a94e0b3de2af2ea4979c1da920bc381667c260e00e7cafdbe844e2cb9c5bcfef4e5412e8bf73bab837285bc35c7ba73aaaf0134d4583393a6 +"gopd@npm:^1.0.1, gopd@npm:^1.2.0": + version: 1.2.0 + resolution: "gopd@npm:1.2.0" + checksum: cc6d8e655e360955bdccaca51a12a474268f95bb793fc3e1f2bdadb075f28bfd1fd988dab872daf77a61d78cbaf13744bc8727a17cfb1d150d76047d805375f3 languageName: node linkType: hard @@ -10671,7 +10581,7 @@ __metadata: languageName: node linkType: hard -"graphql-tag@npm:2.12.6, graphql-tag@npm:^2.11.0, graphql-tag@npm:^2.12.6": +"graphql-tag@npm:2.12.6, graphql-tag@npm:^2.11.0": version: 2.12.6 resolution: "graphql-tag@npm:2.12.6" dependencies: @@ -10723,23 +10633,23 @@ __metadata: linkType: hard "graphql-yoga@npm:^5.7.0": - version: 5.10.3 - resolution: "graphql-yoga@npm:5.10.3" + version: 5.10.6 + resolution: "graphql-yoga@npm:5.10.6" dependencies: - "@envelop/core": ^5.0.1 - "@graphql-tools/executor": ^1.3.3 - "@graphql-tools/schema": ^10.0.4 - "@graphql-tools/utils": ^10.3.2 + "@envelop/core": ^5.0.2 + "@graphql-tools/executor": ^1.3.7 + "@graphql-tools/schema": ^10.0.11 + "@graphql-tools/utils": ^10.6.2 "@graphql-yoga/logger": ^2.0.0 - "@graphql-yoga/subscription": ^5.0.1 + "@graphql-yoga/subscription": ^5.0.2 "@whatwg-node/fetch": ^0.10.1 - "@whatwg-node/server": ^0.9.55 + "@whatwg-node/server": ^0.9.63 dset: ^3.1.1 lru-cache: ^10.0.0 - tslib: ^2.5.2 + tslib: ^2.8.1 peerDependencies: graphql: ^15.2.0 || ^16.0.0 - checksum: 6b1d52f4a0453fc4c602aab40e36e906fed30af5c4a5ad82522b0bf7ee48bc300e12ffa9c27efb1fd52174d9495cfbbcce6171deccd688385d22bb2d12d32eb3 + checksum: de373fc18ce79f0bea294a7bceb4646d5d1fc4e14dee8b339a56ef660d7da2e7b4e3ab17f6e9f3948ef4b3dc64cba7fc3113a2efdca1752fa072e70e344481d8 languageName: node linkType: hard @@ -10758,9 +10668,9 @@ __metadata: linkType: hard "graphql@npm:^16.6.0": - version: 16.9.0 - resolution: "graphql@npm:16.9.0" - checksum: 8cb3d54100e9227310383ce7f791ca48d12f15ed9f2021f23f8735f1121aafe4e5e611a853081dd935ce221724ea1ae4638faef5d2921fb1ad7c26b5f46611e9 + version: 16.10.0 + resolution: "graphql@npm:16.10.0" + checksum: 969c2d1061d69ad6fe08a7fe642428212b0b8485a2f9b5d8650203eb6c3221479e81ec6a757708f849d84b85afcb3ebc5a8ff2f71778bb66c5e4850f051c170e languageName: node linkType: hard @@ -10918,6 +10828,38 @@ __metadata: languageName: node linkType: hard +"hardhat-deploy@npm:^0.14.0": + version: 0.14.0 + resolution: "hardhat-deploy@npm:0.14.0" + dependencies: + "@ethersproject/abi": ^5.7.0 + "@ethersproject/abstract-signer": ^5.7.0 + "@ethersproject/address": ^5.7.0 + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/constants": ^5.7.0 + "@ethersproject/contracts": ^5.7.0 + "@ethersproject/providers": ^5.7.2 + "@ethersproject/solidity": ^5.7.0 + "@ethersproject/transactions": ^5.7.0 + "@ethersproject/wallet": ^5.7.0 + "@types/qs": ^6.9.7 + axios: ^0.21.1 + chalk: ^4.1.2 + chokidar: ^3.5.2 + debug: ^4.3.2 + enquirer: ^2.3.6 + ethers: ^5.7.0 + form-data: ^4.0.0 + fs-extra: ^10.0.0 + match-all: ^1.2.6 + murmur-128: ^0.2.1 + qs: ^6.9.4 + zksync-ethers: ^5.0.0 + checksum: aea9d737f0b4a12a5bcf4b36f9b993dd94d8a190dc930a11d5b5ffa65a955e654fe9ebc416cf09c515653574ddf6654223ae51d6885987207674d9e262ee8dab + languageName: node + linkType: hard + "hardhat-gas-reporter@npm:^1.0.6, hardhat-gas-reporter@npm:^1.0.8": version: 1.0.10 resolution: "hardhat-gas-reporter@npm:1.0.10" @@ -10999,12 +10941,12 @@ __metadata: linkType: hard "hardhat@npm:^2.10.2, hardhat@npm:^2.16.1, hardhat@npm:^2.8.0": - version: 2.22.16 - resolution: "hardhat@npm:2.22.16" + version: 2.22.17 + resolution: "hardhat@npm:2.22.17" dependencies: "@ethersproject/abi": ^5.1.2 "@metamask/eth-sig-util": ^4.0.0 - "@nomicfoundation/edr": ^0.6.4 + "@nomicfoundation/edr": ^0.6.5 "@nomicfoundation/ethereumjs-common": 4.0.4 "@nomicfoundation/ethereumjs-tx": 5.0.4 "@nomicfoundation/ethereumjs-util": 9.0.4 @@ -11056,11 +10998,11 @@ __metadata: optional: true bin: hardhat: internal/cli/bootstrap.js - checksum: 758fa3a0ade06a539a9ddb362c6d904db5bdc0430d9955ddf18cf6bd5365eee1b2f462fa66d7b202e9b4c0a7b291d007e3b3e84e293dec6135c7313785e68d2a + checksum: 52fe0b846c6e5808adf85c7704dfb13bfd22368f54b9ade3ba7719e60ea725a6558715f79e4eb92071ef71d1e66bdd02ff0138f71aedf3fea77784ed5ae11809 languageName: node linkType: hard -"has-bigints@npm:^1.0.1, has-bigints@npm:^1.0.2": +"has-bigints@npm:^1.0.2": version: 1.0.2 resolution: "has-bigints@npm:1.0.2" checksum: 390e31e7be7e5c6fe68b81babb73dfc35d413604d7ee5f56da101417027a4b4ce6a27e46eff97ad040c835b5d228676eae99a9b5c3bc0e23c8e81a49241ff45b @@ -11090,17 +11032,19 @@ __metadata: languageName: node linkType: hard -"has-proto@npm:^1.0.1, has-proto@npm:^1.0.3": - version: 1.0.3 - resolution: "has-proto@npm:1.0.3" - checksum: fe7c3d50b33f50f3933a04413ed1f69441d21d2d2944f81036276d30635cad9279f6b43bc8f32036c31ebdfcf6e731150f46c1907ad90c669ffe9b066c3ba5c4 +"has-proto@npm:^1.0.3, has-proto@npm:^1.2.0": + version: 1.2.0 + resolution: "has-proto@npm:1.2.0" + dependencies: + dunder-proto: ^1.0.0 + checksum: f55010cb94caa56308041d77967c72a02ffd71386b23f9afa8447e58bc92d49d15c19bf75173713468e92fe3fb1680b03b115da39c21c32c74886d1d50d3e7ff languageName: node linkType: hard -"has-symbols@npm:^1.0.2, has-symbols@npm:^1.0.3": - version: 1.0.3 - resolution: "has-symbols@npm:1.0.3" - checksum: a054c40c631c0d5741a8285010a0777ea0c068f99ed43e5d6eb12972da223f8af553a455132fdb0801bdcfa0e0f443c0c03a68d8555aa529b3144b446c3f2410 +"has-symbols@npm:^1.0.3, has-symbols@npm:^1.1.0": + version: 1.1.0 + resolution: "has-symbols@npm:1.1.0" + checksum: b2316c7302a0e8ba3aaba215f834e96c22c86f192e7310bdf689dd0e6999510c89b00fbc5742571507cebf25764d68c988b3a0da217369a73596191ac0ce694b languageName: node linkType: hard @@ -11187,15 +11131,6 @@ __metadata: languageName: node linkType: hard -"hoist-non-react-statics@npm:^3.3.2": - version: 3.3.2 - resolution: "hoist-non-react-statics@npm:3.3.2" - dependencies: - react-is: ^16.7.0 - checksum: b1538270429b13901ee586aa44f4cc3ecd8831c061d06cb8322e50ea17b3f5ce4d0e2e66394761e6c8e152cd8c34fb3b4b690116c6ce2bd45b18c746516cb9e8 - languageName: node - linkType: hard - "hook-std@npm:^3.0.0": version: 3.0.0 resolution: "hook-std@npm:3.0.0" @@ -11306,12 +11241,12 @@ __metadata: linkType: hard "https-proxy-agent@npm:^7.0.0, https-proxy-agent@npm:^7.0.1": - version: 7.0.5 - resolution: "https-proxy-agent@npm:7.0.5" + version: 7.0.6 + resolution: "https-proxy-agent@npm:7.0.6" dependencies: - agent-base: ^7.0.2 + agent-base: ^7.1.2 debug: 4 - checksum: 2e1a28960f13b041a50702ee74f240add8e75146a5c37fc98f1960f0496710f6918b3a9fe1e5aba41e50f58e6df48d107edd9c405c5f0d73ac260dabf2210857 + checksum: b882377a120aa0544846172e5db021fa8afbf83fea2a897d397bd2ddd8095ab268c24bc462f40a15f2a8c600bf4aa05ce52927f70038d4014e68aefecfa94e8d languageName: node linkType: hard @@ -11544,9 +11479,9 @@ __metadata: languageName: node linkType: hard -"init-package-json@npm:^7.0.1": - version: 7.0.1 - resolution: "init-package-json@npm:7.0.1" +"init-package-json@npm:^7.0.2": + version: 7.0.2 + resolution: "init-package-json@npm:7.0.2" dependencies: "@npmcli/package-json": ^6.0.0 npm-package-arg: ^12.0.0 @@ -11555,7 +11490,7 @@ __metadata: semver: ^7.3.5 validate-npm-package-license: ^3.0.4 validate-npm-package-name: ^6.0.0 - checksum: 6992237d9a66ff5caebc0b07c792ef2de00dd1b23c519d365cd9c901d222dcf644b2b08f4c0685fd3a74e2949bd1a79412df45de5ce2c8119ed7878a6660589a + checksum: b8321d8c32f689665e9a8669fd16e46ba38fe4c5dfb6acd4f695bbc1178f1960942839c99ff8ab1766ba77b0c676aee47b88f5105532b35e7a82f98b2f70a27c languageName: node linkType: hard @@ -11577,14 +11512,14 @@ __metadata: languageName: node linkType: hard -"internal-slot@npm:^1.0.7": - version: 1.0.7 - resolution: "internal-slot@npm:1.0.7" +"internal-slot@npm:^1.1.0": + version: 1.1.0 + resolution: "internal-slot@npm:1.1.0" dependencies: es-errors: ^1.3.0 - hasown: ^2.0.0 - side-channel: ^1.0.4 - checksum: cadc5eea5d7d9bc2342e93aae9f31f04c196afebb11bde97448327049f492cd7081e18623ae71388aac9cd237b692ca3a105be9c68ac39c1dec679d7409e33eb + hasown: ^2.0.2 + side-channel: ^1.1.0 + checksum: 8e0991c2d048cc08dab0a91f573c99f6a4215075887517ea4fa32203ce8aea60fa03f95b177977fa27eb502e5168366d0f3e02c762b799691411d49900611861 languageName: node linkType: hard @@ -11751,12 +11686,13 @@ __metadata: linkType: hard "is-array-buffer@npm:^3.0.4": - version: 3.0.4 - resolution: "is-array-buffer@npm:3.0.4" + version: 3.0.5 + resolution: "is-array-buffer@npm:3.0.5" dependencies: - call-bind: ^1.0.2 - get-intrinsic: ^1.2.1 - checksum: e4e3e6ef0ff2239e75371d221f74bc3c26a03564a22efb39f6bb02609b598917ddeecef4e8c877df2a25888f247a98198959842a5e73236bc7f22cabdf6351a7 + call-bind: ^1.0.8 + call-bound: ^1.0.3 + get-intrinsic: ^1.2.6 + checksum: f137a2a6e77af682cdbffef1e633c140cf596f72321baf8bba0f4ef22685eb4339dde23dfe9e9ca430b5f961dee4d46577dcf12b792b68518c8449b134fb9156 languageName: node linkType: hard @@ -11776,12 +11712,12 @@ __metadata: languageName: node linkType: hard -"is-bigint@npm:^1.0.1": - version: 1.0.4 - resolution: "is-bigint@npm:1.0.4" +"is-bigint@npm:^1.1.0": + version: 1.1.0 + resolution: "is-bigint@npm:1.1.0" dependencies: - has-bigints: ^1.0.1 - checksum: c56edfe09b1154f8668e53ebe8252b6f185ee852a50f9b41e8d921cb2bed425652049fbe438723f6cb48a63ca1aa051e948e7e401e093477c99c84eba244f666 + has-bigints: ^1.0.2 + checksum: ee1544f0e664f253306786ed1dce494b8cf242ef415d6375d8545b4d8816b0f054bd9f948a8988ae2c6325d1c28260dd02978236b2f7b8fb70dfc4838a6c9fa7 languageName: node linkType: hard @@ -11794,13 +11730,13 @@ __metadata: languageName: node linkType: hard -"is-boolean-object@npm:^1.1.0": - version: 1.1.2 - resolution: "is-boolean-object@npm:1.1.2" +"is-boolean-object@npm:^1.2.1": + version: 1.2.1 + resolution: "is-boolean-object@npm:1.2.1" dependencies: - call-bind: ^1.0.2 - has-tostringtag: ^1.0.0 - checksum: c03b23dbaacadc18940defb12c1c0e3aaece7553ef58b162a0f6bba0c2a7e1551b59f365b91e00d2dbac0522392d576ef322628cb1d036a0fe51eb466db67222 + call-bound: ^1.0.2 + has-tostringtag: ^1.0.2 + checksum: 2672609f0f2536172873810a38ec006a415e43ddc6a240f7638a1659cb20dfa91cc75c8a1bed36247bb046aa8f0eab945f20d1203bc69606418bd129c745f861 languageName: node linkType: hard @@ -11838,30 +11774,33 @@ __metadata: languageName: node linkType: hard -"is-core-module@npm:^2.13.0, is-core-module@npm:^2.15.1, is-core-module@npm:^2.5.0": - version: 2.15.1 - resolution: "is-core-module@npm:2.15.1" +"is-core-module@npm:^2.13.0, is-core-module@npm:^2.15.1, is-core-module@npm:^2.16.0, is-core-module@npm:^2.5.0": + version: 2.16.0 + resolution: "is-core-module@npm:2.16.0" dependencies: hasown: ^2.0.2 - checksum: df134c168115690724b62018c37b2f5bba0d5745fa16960b329c5a00883a8bea6a5632fdb1e3efcce237c201826ba09f93197b7cd95577ea56b0df335be23633 + checksum: 98aa14eaee864c2e86fff4e08813e0da3ca7ac38dd0a43b9f10aeec48bfbc4827e2677349adb626f66921caef7fa9e2745c80b8b7cafe8ac24d46dc8124cc216 languageName: node linkType: hard -"is-data-view@npm:^1.0.1": - version: 1.0.1 - resolution: "is-data-view@npm:1.0.1" +"is-data-view@npm:^1.0.1, is-data-view@npm:^1.0.2": + version: 1.0.2 + resolution: "is-data-view@npm:1.0.2" dependencies: + call-bound: ^1.0.2 + get-intrinsic: ^1.2.6 is-typed-array: ^1.1.13 - checksum: 4ba4562ac2b2ec005fefe48269d6bd0152785458cd253c746154ffb8a8ab506a29d0cfb3b74af87513843776a88e4981ae25c89457bf640a33748eab1a7216b5 + checksum: 31600dd19932eae7fd304567e465709ffbfa17fa236427c9c864148e1b54eb2146357fcf3aed9b686dee13c217e1bb5a649cb3b9c479e1004c0648e9febde1b2 languageName: node linkType: hard -"is-date-object@npm:^1.0.5": - version: 1.0.5 - resolution: "is-date-object@npm:1.0.5" +"is-date-object@npm:^1.0.5, is-date-object@npm:^1.1.0": + version: 1.1.0 + resolution: "is-date-object@npm:1.1.0" dependencies: - has-tostringtag: ^1.0.0 - checksum: baa9077cdf15eb7b58c79398604ca57379b2fc4cf9aa7a9b9e295278648f628c9b201400c01c5e0f7afae56507d741185730307cbe7cad3b9f90a77e5ee342fc + call-bound: ^1.0.2 + has-tostringtag: ^1.0.2 + checksum: d6c36ab9d20971d65f3fc64cef940d57a4900a2ac85fb488a46d164c2072a33da1cb51eefcc039e3e5c208acbce343d3480b84ab5ff0983f617512da2742562a languageName: node linkType: hard @@ -11896,11 +11835,11 @@ __metadata: linkType: hard "is-finalizationregistry@npm:^1.1.0": - version: 1.1.0 - resolution: "is-finalizationregistry@npm:1.1.0" + version: 1.1.1 + resolution: "is-finalizationregistry@npm:1.1.1" dependencies: - call-bind: ^1.0.7 - checksum: 480818ab86e112a00444410a2fd551a5363bca0c39c7bc66e29df665b1e47c803ba107227c1db86d67264a3f020779fab257061463ce02b01b6abbe5966e33b8 + call-bound: ^1.0.3 + checksum: 38c646c506e64ead41a36c182d91639833311970b6b6c6268634f109eef0a1a9d2f1f2e499ef4cb43c744a13443c4cdd2f0812d5afdcee5e9b65b72b28c48557 languageName: node linkType: hard @@ -11966,13 +11905,6 @@ __metadata: languageName: node linkType: hard -"is-lambda@npm:^1.0.1": - version: 1.0.1 - resolution: "is-lambda@npm:1.0.1" - checksum: 93a32f01940220532e5948538699ad610d5924ac86093fcee83022252b363eb0cc99ba53ab084a04e4fb62bf7b5731f55496257a4c38adf87af9c4d352c71c35 - languageName: node - linkType: hard - "is-lower-case@npm:^2.0.2": version: 2.0.2 resolution: "is-lower-case@npm:2.0.2" @@ -11996,12 +11928,13 @@ __metadata: languageName: node linkType: hard -"is-number-object@npm:^1.0.4": - version: 1.0.7 - resolution: "is-number-object@npm:1.0.7" +"is-number-object@npm:^1.1.1": + version: 1.1.1 + resolution: "is-number-object@npm:1.1.1" dependencies: - has-tostringtag: ^1.0.0 - checksum: d1e8d01bb0a7134c74649c4e62da0c6118a0bfc6771ea3c560914d52a627873e6920dd0fd0ebc0e12ad2ff4687eac4c308f7e80320b973b2c8a2c8f97a7524f7 + call-bound: ^1.0.3 + has-tostringtag: ^1.0.2 + checksum: 6517f0a0e8c4b197a21afb45cd3053dc711e79d45d8878aa3565de38d0102b130ca8732485122c7b336e98c27dacd5236854e3e6526e0eb30cae64956535662f languageName: node linkType: hard @@ -12061,13 +11994,15 @@ __metadata: languageName: node linkType: hard -"is-regex@npm:^1.1.4": - version: 1.1.4 - resolution: "is-regex@npm:1.1.4" +"is-regex@npm:^1.2.1": + version: 1.2.1 + resolution: "is-regex@npm:1.2.1" dependencies: - call-bind: ^1.0.2 - has-tostringtag: ^1.0.0 - checksum: 362399b33535bc8f386d96c45c9feb04cf7f8b41c182f54174c1a45c9abbbe5e31290bbad09a458583ff6bf3b2048672cdb1881b13289569a7c548370856a652 + call-bound: ^1.0.2 + gopd: ^1.2.0 + has-tostringtag: ^1.0.2 + hasown: ^2.0.2 + checksum: 99ee0b6d30ef1bb61fa4b22fae7056c6c9b3c693803c0c284ff7a8570f83075a7d38cda53b06b7996d441215c27895ea5d1af62124562e13d91b3dbec41a5e13 languageName: node linkType: hard @@ -12087,7 +12022,7 @@ __metadata: languageName: node linkType: hard -"is-shared-array-buffer@npm:^1.0.2, is-shared-array-buffer@npm:^1.0.3": +"is-shared-array-buffer@npm:^1.0.3": version: 1.0.3 resolution: "is-shared-array-buffer@npm:1.0.3" dependencies: @@ -12124,21 +12059,24 @@ __metadata: languageName: node linkType: hard -"is-string@npm:^1.0.5, is-string@npm:^1.0.7": - version: 1.0.7 - resolution: "is-string@npm:1.0.7" +"is-string@npm:^1.0.7, is-string@npm:^1.1.1": + version: 1.1.1 + resolution: "is-string@npm:1.1.1" dependencies: - has-tostringtag: ^1.0.0 - checksum: 323b3d04622f78d45077cf89aab783b2f49d24dc641aa89b5ad1a72114cfeff2585efc8c12ef42466dff32bde93d839ad321b26884cf75e5a7892a938b089989 + call-bound: ^1.0.3 + has-tostringtag: ^1.0.2 + checksum: 2eeaaff605250f5e836ea3500d33d1a5d3aa98d008641d9d42fb941e929ffd25972326c2ef912987e54c95b6f10416281aaf1b35cdf81992cfb7524c5de8e193 languageName: node linkType: hard -"is-symbol@npm:^1.0.3, is-symbol@npm:^1.0.4": - version: 1.0.4 - resolution: "is-symbol@npm:1.0.4" +"is-symbol@npm:^1.0.4, is-symbol@npm:^1.1.1": + version: 1.1.1 + resolution: "is-symbol@npm:1.1.1" dependencies: - has-symbols: ^1.0.2 - checksum: 92805812ef590738d9de49d677cd17dfd486794773fb6fa0032d16452af46e9b91bb43ffe82c983570f015b37136f4b53b28b8523bfb10b0ece7a66c31a54510 + call-bound: ^1.0.2 + has-symbols: ^1.1.0 + safe-regex-test: ^1.1.0 + checksum: bfafacf037af6f3c9d68820b74be4ae8a736a658a3344072df9642a090016e281797ba8edbeb1c83425879aae55d1cb1f30b38bf132d703692b2570367358032 languageName: node linkType: hard @@ -12161,11 +12099,11 @@ __metadata: linkType: hard "is-typed-array@npm:^1.1.13": - version: 1.1.13 - resolution: "is-typed-array@npm:1.1.13" + version: 1.1.14 + resolution: "is-typed-array@npm:1.1.14" dependencies: - which-typed-array: ^1.1.14 - checksum: 150f9ada183a61554c91e1c4290086d2c100b0dff45f60b028519be72a8db964da403c48760723bf5253979b8dffe7b544246e0e5351dcd05c5fdb1dcc1dc0f0 + which-typed-array: ^1.1.16 + checksum: 8cfbf7440de50428d5ee306e2691b8b335733c0cc58e36894340811657fdc76e8d214c13d2ac4ea7a351d1a983a5cca350023d93dc5abe322db35984f8247ac7 languageName: node linkType: hard @@ -12208,22 +12146,22 @@ __metadata: languageName: node linkType: hard -"is-weakref@npm:^1.0.2": - version: 1.0.2 - resolution: "is-weakref@npm:1.0.2" +"is-weakref@npm:^1.0.2, is-weakref@npm:^1.1.0": + version: 1.1.0 + resolution: "is-weakref@npm:1.1.0" dependencies: - call-bind: ^1.0.2 - checksum: 95bd9a57cdcb58c63b1c401c60a474b0f45b94719c30f548c891860f051bc2231575c290a6b420c6bc6e7ed99459d424c652bd5bf9a1d5259505dc35b4bf83de + call-bound: ^1.0.2 + checksum: 2a2f3a1746ee1baecf9ac6483d903cd3f8ef3cca88e2baa42f2e85ea064bd246d218eed5f6d479fc1c76dae2231e71133b6b86160e821d176932be9fae3da4da languageName: node linkType: hard "is-weakset@npm:^2.0.3": - version: 2.0.3 - resolution: "is-weakset@npm:2.0.3" + version: 2.0.4 + resolution: "is-weakset@npm:2.0.4" dependencies: - call-bind: ^1.0.7 - get-intrinsic: ^1.2.4 - checksum: 8b6a20ee9f844613ff8f10962cfee49d981d584525f2357fee0a04dfbcde9fd607ed60cb6dab626dbcc470018ae6392e1ff74c0c1aced2d487271411ad9d85ae + call-bound: ^1.0.3 + get-intrinsic: ^1.2.6 + checksum: 5c6c8415a06065d78bdd5e3a771483aa1cd928df19138aa73c4c51333226f203f22117b4325df55cc8b3085a6716870a320c2d757efee92d7a7091a039082041 languageName: node linkType: hard @@ -12538,11 +12476,11 @@ __metadata: linkType: hard "jsesc@npm:^3.0.2": - version: 3.0.2 - resolution: "jsesc@npm:3.0.2" + version: 3.1.0 + resolution: "jsesc@npm:3.1.0" bin: jsesc: bin/jsesc - checksum: a36d3ca40574a974d9c2063bf68c2b6141c20da8f2a36bd3279fc802563f35f0527a6c828801295bdfb2803952cf2cf387786c2c90ed564f88d5782475abfe3c + checksum: 19c94095ea026725540c0d29da33ab03144f6bcf2d4159e4833d534976e99e0c09c38cefa9a575279a51fc36b31166f8d6d05c9fe2645d5f15851d690b41f17f languageName: node linkType: hard @@ -12574,13 +12512,6 @@ __metadata: languageName: node linkType: hard -"json-parse-even-better-errors@npm:^3.0.0": - version: 3.0.2 - resolution: "json-parse-even-better-errors@npm:3.0.2" - checksum: 6f04ea6c9ccb783630a59297959247e921cc90b917b8351197ca7fd058fccc7079268fd9362be21ba876fc26aa5039369dd0a2280aae49aae425784794a94927 - languageName: node - linkType: hard - "json-parse-even-better-errors@npm:^4.0.0": version: 4.0.0 resolution: "json-parse-even-better-errors@npm:4.0.0" @@ -12980,13 +12911,6 @@ __metadata: languageName: node linkType: hard -"lines-and-columns@npm:^2.0.3": - version: 2.0.4 - resolution: "lines-and-columns@npm:2.0.4" - checksum: f5e3e207467d3e722280c962b786dc20ebceb191821dcd771d14ab3146b6744cae28cf305ee4638805bec524ac54800e15698c853fcc53243821f88df37e4975 - languageName: node - linkType: hard - "lint-staged@npm:^12.3.3": version: 12.5.0 resolution: "lint-staged@npm:12.5.0" @@ -13367,7 +13291,7 @@ __metadata: languageName: node linkType: hard -"loose-envify@npm:^1.0.0, loose-envify@npm:^1.4.0": +"loose-envify@npm:^1.0.0": version: 1.4.0 resolution: "loose-envify@npm:1.4.0" dependencies: @@ -13451,26 +13375,6 @@ __metadata: languageName: node linkType: hard -"make-fetch-happen@npm:^13.0.0": - version: 13.0.1 - resolution: "make-fetch-happen@npm:13.0.1" - dependencies: - "@npmcli/agent": ^2.0.0 - cacache: ^18.0.0 - http-cache-semantics: ^4.1.1 - is-lambda: ^1.0.1 - minipass: ^7.0.2 - minipass-fetch: ^3.0.0 - minipass-flush: ^1.0.5 - minipass-pipeline: ^1.2.4 - negotiator: ^0.6.3 - proc-log: ^4.2.0 - promise-retry: ^2.0.1 - ssri: ^10.0.0 - checksum: 5c9fad695579b79488fa100da05777213dd9365222f85e4757630f8dd2a21a79ddd3206c78cfd6f9b37346819681782b67900ac847a57cf04190f52dda5343fd - languageName: node - linkType: hard - "make-fetch-happen@npm:^14.0.0, make-fetch-happen@npm:^14.0.1, make-fetch-happen@npm:^14.0.3": version: 14.0.3 resolution: "make-fetch-happen@npm:14.0.3" @@ -13560,6 +13464,13 @@ __metadata: languageName: node linkType: hard +"math-intrinsics@npm:^1.0.0": + version: 1.0.0 + resolution: "math-intrinsics@npm:1.0.0" + checksum: ad9edf8b5bec32c78d25163a9343dbe960331c8b4815b099181de7be4681e5abff9642a4b2fbeb3e882d7616567ffc45a5bae59dc8fec417cf5c76d47b92b197 + languageName: node + linkType: hard + "mcl-wasm@npm:^0.7.1": version: 0.7.9 resolution: "mcl-wasm@npm:0.7.9" @@ -13790,21 +13701,6 @@ __metadata: languageName: node linkType: hard -"minipass-fetch@npm:^3.0.0": - version: 3.0.5 - resolution: "minipass-fetch@npm:3.0.5" - dependencies: - encoding: ^0.1.13 - minipass: ^7.0.3 - minipass-sized: ^1.0.3 - minizlib: ^2.1.2 - dependenciesMeta: - encoding: - optional: true - checksum: 8047d273236157aab27ab7cd8eab7ea79e6ecd63e8f80c3366ec076cb9a0fed550a6935bab51764369027c414647fd8256c2a20c5445fb250c483de43350de83 - languageName: node - linkType: hard - "minipass-fetch@npm:^4.0.0": version: 4.0.0 resolution: "minipass-fetch@npm:4.0.0" @@ -13877,7 +13773,7 @@ __metadata: languageName: node linkType: hard -"minizlib@npm:^2.1.1, minizlib@npm:^2.1.2": +"minizlib@npm:^2.1.1": version: 2.1.2 resolution: "minizlib@npm:2.1.2" dependencies: @@ -14117,13 +14013,6 @@ __metadata: languageName: node linkType: hard -"negotiator@npm:^0.6.3": - version: 0.6.4 - resolution: "negotiator@npm:0.6.4" - checksum: 7ded10aa02a0707d1d12a9973fdb5954f98547ca7beb60e31cb3a403cc6e8f11138db7a3b0128425cf836fc85d145ec4ce983b2bdf83dca436af879c2d683510 - languageName: node - linkType: hard - "negotiator@npm:^1.0.0": version: 1.0.0 resolution: "negotiator@npm:1.0.0" @@ -14181,14 +14070,14 @@ __metadata: linkType: hard "node-emoji@npm:^2.1.3": - version: 2.1.3 - resolution: "node-emoji@npm:2.1.3" + version: 2.2.0 + resolution: "node-emoji@npm:2.2.0" dependencies: "@sindresorhus/is": ^4.6.0 char-regex: ^1.0.2 emojilib: ^2.4.0 skin-tone: ^2.0.0 - checksum: 9ae5a1fb12fd5ce6885f251f345986115de4bb82e7d06fdc943845fb19260d89d0aaaccbaf85cae39fe7aaa1fc391640558865ba690c9bb8a7236c3ac10bbab0 + checksum: 9642bee0b8c5f2124580e6a2d4c5ec868987bc77b6ce3a335bbec8db677082cbe1a9b72c11aac60043396a8d36e0afad4bcc33d92105d103d2d1b6a59106219a languageName: node linkType: hard @@ -14227,23 +14116,23 @@ __metadata: languageName: node linkType: hard -"node-gyp@npm:^10.0.0, node-gyp@npm:^10.2.0, node-gyp@npm:latest": - version: 10.2.0 - resolution: "node-gyp@npm:10.2.0" +"node-gyp@npm:^11.0.0, node-gyp@npm:latest": + version: 11.0.0 + resolution: "node-gyp@npm:11.0.0" dependencies: env-paths: ^2.2.0 exponential-backoff: ^3.1.1 glob: ^10.3.10 graceful-fs: ^4.2.6 - make-fetch-happen: ^13.0.0 - nopt: ^7.0.0 - proc-log: ^4.1.0 + make-fetch-happen: ^14.0.3 + nopt: ^8.0.0 + proc-log: ^5.0.0 semver: ^7.3.5 - tar: ^6.2.1 - which: ^4.0.0 + tar: ^7.4.3 + which: ^5.0.0 bin: node-gyp: bin/node-gyp.js - checksum: 0233759d8c19765f7fdc259a35eb046ad86c3d09e22f7384613ae2b89647dd27fcf833fdf5293d9335041e91f9b1c539494225959cdb312a5c8080b7534b926f + checksum: d7d5055ccc88177f721c7cd4f8f9440c29a0eb40e7b79dba89ef882ec957975dfc1dcb8225e79ab32481a02016eb13bbc051a913ea88d482d3cbdf2131156af4 languageName: node linkType: hard @@ -14254,10 +14143,10 @@ __metadata: languageName: node linkType: hard -"node-releases@npm:^2.0.18": - version: 2.0.18 - resolution: "node-releases@npm:2.0.18" - checksum: ef55a3d853e1269a6d6279b7692cd6ff3e40bc74947945101138745bfdc9a5edabfe72cb19a31a8e45752e1910c4c65c77d931866af6357f242b172b7283f5b3 +"node-releases@npm:^2.0.19": + version: 2.0.19 + resolution: "node-releases@npm:2.0.19" + checksum: 917dbced519f48c6289a44830a0ca6dc944c3ee9243c468ebd8515a41c97c8b2c256edb7f3f750416bc37952cc9608684e6483c7b6c6f39f6bd8d86c52cfe658 languageName: node linkType: hard @@ -14268,17 +14157,6 @@ __metadata: languageName: node linkType: hard -"nopt@npm:^7.0.0": - version: 7.2.1 - resolution: "nopt@npm:7.2.1" - dependencies: - abbrev: ^2.0.0 - bin: - nopt: bin/nopt.js - checksum: 6fa729cc77ce4162cfad8abbc9ba31d4a0ff6850c3af61d59b505653bef4781ec059f8890ecfe93ee8aa0c511093369cca88bfc998101616a2904e715bbbb7c9 - languageName: node - linkType: hard - "nopt@npm:^8.0.0": version: 8.0.0 resolution: "nopt@npm:8.0.0" @@ -14392,14 +14270,14 @@ __metadata: linkType: hard "npm-package-arg@npm:^12.0.0": - version: 12.0.0 - resolution: "npm-package-arg@npm:12.0.0" + version: 12.0.1 + resolution: "npm-package-arg@npm:12.0.1" dependencies: hosted-git-info: ^8.0.0 proc-log: ^5.0.0 semver: ^7.3.5 validate-npm-package-name: ^6.0.0 - checksum: c2c0d8ebe1072c3226dcded0a59691804841c413802bed40f196fdcedfafbf1f00e87d77b373b3f31273a59ae815a9c9d234bd29d9e7d21786c3bf8ae421e871 + checksum: 01c1c620e07940c9c6c243fc3811f1ce745f217800d9d94982519adac1e283790fcc84183e59b0fe10151bbf9967708891eb58256198b153820d79988db98c32 languageName: node linkType: hard @@ -14495,15 +14373,15 @@ __metadata: linkType: hard "npm@npm:^10.5.0": - version: 10.9.1 - resolution: "npm@npm:10.9.1" + version: 10.9.2 + resolution: "npm@npm:10.9.2" dependencies: "@isaacs/string-locale-compare": ^1.1.0 "@npmcli/arborist": ^8.0.0 "@npmcli/config": ^9.0.0 "@npmcli/fs": ^4.0.0 - "@npmcli/map-workspaces": ^4.0.1 - "@npmcli/package-json": ^6.0.1 + "@npmcli/map-workspaces": ^4.0.2 + "@npmcli/package-json": ^6.1.0 "@npmcli/promise-spawn": ^8.0.2 "@npmcli/redact": ^3.0.0 "@npmcli/run-script": ^9.0.1 @@ -14520,7 +14398,7 @@ __metadata: graceful-fs: ^4.2.11 hosted-git-info: ^8.0.2 ini: ^5.0.0 - init-package-json: ^7.0.1 + init-package-json: ^7.0.2 is-cidr: ^5.1.0 json-parse-even-better-errors: ^4.0.0 libnpmaccess: ^9.0.0 @@ -14539,7 +14417,7 @@ __metadata: minipass: ^7.1.1 minipass-pipeline: ^1.2.4 ms: ^2.1.2 - node-gyp: ^10.2.0 + node-gyp: ^11.0.0 nopt: ^8.0.0 normalize-package-data: ^7.0.0 npm-audit-report: ^6.0.0 @@ -14569,7 +14447,7 @@ __metadata: bin: npm: bin/npm-cli.js npx: bin/npx-cli.js - checksum: 12fee36e7985b8b2ff67ecb639b2e0f3e0692a09ff2e02c24985bfd1ddacf57dad89be56a052dfb8b6bb7a1472203362e536a92488c54f506ceffdeb172466c6 + checksum: 38bfc63f64610f2b8d879719b102827e0423a13291cfda0196b3ea25bfbe01518d1f9aa24ec44beb462769e1bbc6ab854ca0449def21e94008c8d582b7b7866f languageName: node linkType: hard @@ -14590,7 +14468,7 @@ __metadata: languageName: node linkType: hard -"object-assign@npm:^4.0.1, object-assign@npm:^4.1.0, object-assign@npm:^4.1.1": +"object-assign@npm:^4.0.1, object-assign@npm:^4.1.0": version: 4.1.1 resolution: "object-assign@npm:4.1.1" checksum: fcc6e4ea8c7fe48abfbb552578b1c53e0d194086e2e6bbbf59e0a536381a292f39943c6e9628af05b5528aa5e3318bb30d6b2e53cadaf5b8fe9e12c4b69af23f @@ -14604,7 +14482,14 @@ __metadata: languageName: node linkType: hard -"object-inspect@npm:^1.12.2, object-inspect@npm:^1.13.1, object-inspect@npm:^1.13.3": +"object-inspect@npm:1.13.2": + version: 1.13.2 + resolution: "object-inspect@npm:1.13.2" + checksum: 9f850b3c045db60e0e97746e809ee4090d6ce62195af17dd1e9438ac761394a7d8ec4f7906559aea5424eaf61e35d3e53feded2ccd5f62fcc7d9670d3c8eb353 + languageName: node + linkType: hard + +"object-inspect@npm:^1.12.2, object-inspect@npm:^1.13.3": version: 1.13.3 resolution: "object-inspect@npm:1.13.3" checksum: 8c962102117241e18ea403b84d2521f78291b774b03a29ee80a9863621d88265ffd11d0d7e435c4c2cea0dc2a2fbf8bbc92255737a05536590f2df2e8756f297 @@ -14742,18 +14627,6 @@ __metadata: languageName: node linkType: hard -"optimism@npm:^0.18.0": - version: 0.18.1 - resolution: "optimism@npm:0.18.1" - dependencies: - "@wry/caches": ^1.0.0 - "@wry/context": ^0.7.0 - "@wry/trie": ^0.5.0 - tslib: ^2.3.0 - checksum: bb913a2ac28e3c39fc829bf7b219cc877a085f45f8e5778f25113b251fe26b53a3c2a0e65ce29c3b294dc35e323ede3f52052a3bc2f96caaaec70f9d76cd9622 - languageName: node - linkType: hard - "optionator@npm:^0.9.3": version: 0.9.4 resolution: "optionator@npm:0.9.4" @@ -14944,9 +14817,9 @@ __metadata: linkType: hard "p-map@npm:^7.0.1, p-map@npm:^7.0.2": - version: 7.0.2 - resolution: "p-map@npm:7.0.2" - checksum: bc128c2b244ef5d4619392b2247d718a3fe471d5fa4a73834fd96182a237f460ec7e0ad0f95139ef7103a6b50ed164228c62e2f8e41ba2b15360fe1c20d13563 + version: 7.0.3 + resolution: "p-map@npm:7.0.3" + checksum: 8c92d533acf82f0d12f7e196edccff773f384098bbb048acdd55a08778ce4fc8889d8f1bde72969487bd96f9c63212698d79744c20bedfce36c5b00b46d369f8 languageName: node linkType: hard @@ -15077,9 +14950,9 @@ __metadata: linkType: hard "parse-duration@npm:^1.0.0": - version: 1.1.0 - resolution: "parse-duration@npm:1.1.0" - checksum: 3cfc10aa61b3a06373a347289e1704de47d5d845c79330bbab20b54c02567f3710ba84544a3a44a986c3381c68670d89542fe9de607fb0814e52f78b34893cd9 + version: 1.1.1 + resolution: "parse-duration@npm:1.1.1" + checksum: 60622742c411139e7656643fb1c91f7c6ef0f96bb71de8a1689fb0290c7f68e1c1c160672f3a7239ec379944f79b92300d453dbd2efa8c633cd11ebb006ea7dd languageName: node linkType: hard @@ -15116,19 +14989,6 @@ __metadata: languageName: node linkType: hard -"parse-json@npm:^7.0.0": - version: 7.1.1 - resolution: "parse-json@npm:7.1.1" - dependencies: - "@babel/code-frame": ^7.21.4 - error-ex: ^1.3.2 - json-parse-even-better-errors: ^3.0.0 - lines-and-columns: ^2.0.3 - type-fest: ^3.8.0 - checksum: 187275c7ac097dcfb3c7420bca2399caa4da33bcd5d5aac3604bda0e2b8eee4df61cc26aa0d79fab97f0d67bf42d41d332baa9f9f56ad27636ad785f1ae639e5 - languageName: node - linkType: hard - "parse-json@npm:^8.0.0": version: 8.1.0 resolution: "parse-json@npm:8.1.0" @@ -15446,11 +15306,11 @@ __metadata: linkType: hard "prettier@npm:^3.0.3": - version: 3.4.1 - resolution: "prettier@npm:3.4.1" + version: 3.4.2 + resolution: "prettier@npm:3.4.2" bin: prettier: bin/prettier.cjs - checksum: f83ae83e38ae38f42c0b174833f58f820ed6eb063abfc5aa6725e8f9c1d626b54b1cb9d595cace525f8d59de89e186285f6bbcb460dc644ea9d8a7823cc54aca + checksum: 061c84513db62d3944c8dc8df36584dad82883ce4e49efcdbedd8703dce5b173c33fd9d2a4e1725d642a3b713c932b55418342eaa347479bc4a9cca114a04cd0 languageName: node linkType: hard @@ -15463,13 +15323,6 @@ __metadata: languageName: node linkType: hard -"proc-log@npm:^4.1.0, proc-log@npm:^4.2.0": - version: 4.2.0 - resolution: "proc-log@npm:4.2.0" - checksum: 98f6cd012d54b5334144c5255ecb941ee171744f45fca8b43b58ae5a0c1af07352475f481cadd9848e7f0250376ee584f6aa0951a856ff8f021bdfbff4eb33fc - languageName: node - linkType: hard - "proc-log@npm:^5.0.0": version: 5.0.0 resolution: "proc-log@npm:5.0.0" @@ -15549,17 +15402,6 @@ __metadata: languageName: node linkType: hard -"prop-types@npm:^15.7.2": - version: 15.8.1 - resolution: "prop-types@npm:15.8.1" - dependencies: - loose-envify: ^1.4.0 - object-assign: ^4.1.1 - react-is: ^16.13.1 - checksum: c056d3f1c057cb7ff8344c645450e14f088a915d078dcda795041765047fa080d38e5d626560ccaac94a4e16e3aa15f3557c1a9a8d1174530955e992c675e459 - languageName: node - linkType: hard - "proper-lockfile@npm:^4.1.1": version: 4.1.2 resolution: "proper-lockfile@npm:4.1.2" @@ -15733,13 +15575,6 @@ __metadata: languageName: node linkType: hard -"react-is@npm:^16.13.1, react-is@npm:^16.7.0": - version: 16.13.1 - resolution: "react-is@npm:16.13.1" - checksum: f7a19ac3496de32ca9ae12aa030f00f14a3d45374f1ceca0af707c831b2a6098ef0d6bdae51bd437b0a306d7f01d4677fcc8de7c0d331eb47ad0f46130e53c5f - languageName: node - linkType: hard - "react-native-fetch-api@npm:^3.0.0": version: 3.0.0 resolution: "react-native-fetch-api@npm:3.0.0" @@ -15834,18 +15669,6 @@ __metadata: languageName: node linkType: hard -"read-pkg@npm:^8.0.0": - version: 8.1.0 - resolution: "read-pkg@npm:8.1.0" - dependencies: - "@types/normalize-package-data": ^2.4.1 - normalize-package-data: ^6.0.0 - parse-json: ^7.0.0 - type-fest: ^4.2.0 - checksum: f4cd164f096e78cf3e338a55f800043524e3055f9b0b826143290002fafc951025fc3cbd6ca683ebaf7945efcfb092d31c683dd252a7871a974662985c723b67 - languageName: node - linkType: hard - "read-pkg@npm:^9.0.0": version: 9.0.1 resolution: "read-pkg@npm:9.0.1" @@ -15958,17 +15781,18 @@ __metadata: linkType: hard "reflect.getprototypeof@npm:^1.0.6": - version: 1.0.7 - resolution: "reflect.getprototypeof@npm:1.0.7" + version: 1.0.8 + resolution: "reflect.getprototypeof@npm:1.0.8" dependencies: - call-bind: ^1.0.7 + call-bind: ^1.0.8 define-properties: ^1.2.1 + dunder-proto: ^1.0.0 es-abstract: ^1.23.5 es-errors: ^1.3.0 get-intrinsic: ^1.2.4 - gopd: ^1.0.1 - which-builtin-type: ^1.1.4 - checksum: e023846d4d9631b46476a2315f5cdebb1f98782e145e807d985b47df8314776220b0d82244c9f3e51718acb09da79149f406afa9872e4fb4ca473dcc4e980598 + gopd: ^1.2.0 + which-builtin-type: ^1.2.0 + checksum: d7dcbe34bec80f50e2b2f824af83302aae2520863b56b967052ade76402cddcb61933690931d567b973ff7635ae39ff655237ad9cdb2be755190eace95c1768b languageName: node linkType: hard @@ -15992,26 +15816,11 @@ __metadata: linkType: hard "registry-auth-token@npm:^5.0.0": - version: 5.0.2 - resolution: "registry-auth-token@npm:5.0.2" + version: 5.0.3 + resolution: "registry-auth-token@npm:5.0.3" dependencies: "@pnpm/npm-conf": ^2.1.0 - checksum: 0d7683b71ee418993e7872b389024b13645c4295eb7bb850d10728eaf46065db24ea4d47dc6cbb71a60d1aa4bef077b0d8b7363c9ac9d355fdba47bebdfb01dd - languageName: node - linkType: hard - -"rehackt@npm:^0.1.0": - version: 0.1.0 - resolution: "rehackt@npm:0.1.0" - peerDependencies: - "@types/react": "*" - react: "*" - peerDependenciesMeta: - "@types/react": - optional: true - react: - optional: true - checksum: 2c3bcd72524bf47672640265e79cba785e0e6837b9b385ccb0a3ea7d00f55a439d9aed3e0ae71e991d88e0d4b2b3158457c92e75fff5ebf99cd46e280068ddeb + checksum: 5976f822d6a55267319b011dd4c64ef037ffee038c97529d09ea619835afe59cf89d545ec6b393098de4d7ba7a44664ce740bc1820215a2a90c7d66a1e676f9f languageName: node linkType: hard @@ -16112,15 +15921,15 @@ __metadata: linkType: hard "resolve@npm:^1.10.0, resolve@npm:^1.22.4": - version: 1.22.8 - resolution: "resolve@npm:1.22.8" + version: 1.22.9 + resolution: "resolve@npm:1.22.9" dependencies: - is-core-module: ^2.13.0 + is-core-module: ^2.16.0 path-parse: ^1.0.7 supports-preserve-symlinks-flag: ^1.0.0 bin: resolve: bin/resolve - checksum: f8a26958aa572c9b064562750b52131a37c29d072478ea32e129063e2da7f83e31f7f11e7087a18225a8561cfe8d2f0df9dbea7c9d331a897571c0a2527dbb4c + checksum: dd7da6c4ccc60bb4884f636b987102bb1cae6c486f7172361719a7f52769660c9a83a2d3520bef71d91f3da27e4fb8a40404c63ee4372a15863f3208bef5af67 languageName: node linkType: hard @@ -16134,22 +15943,15 @@ __metadata: linkType: hard "resolve@patch:resolve@^1.10.0#~builtin, resolve@patch:resolve@^1.22.4#~builtin": - version: 1.22.8 - resolution: "resolve@patch:resolve@npm%3A1.22.8#~builtin::version=1.22.8&hash=c3c19d" + version: 1.22.9 + resolution: "resolve@patch:resolve@npm%3A1.22.9#~builtin::version=1.22.9&hash=c3c19d" dependencies: - is-core-module: ^2.13.0 + is-core-module: ^2.16.0 path-parse: ^1.0.7 supports-preserve-symlinks-flag: ^1.0.0 bin: resolve: bin/resolve - checksum: 5479b7d431cacd5185f8db64bfcb7286ae5e31eb299f4c4f404ad8aa6098b77599563ac4257cb2c37a42f59dfc06a1bec2bcf283bb448f319e37f0feb9a09847 - languageName: node - linkType: hard - -"response-iterator@npm:^0.2.6": - version: 0.2.6 - resolution: "response-iterator@npm:0.2.6" - checksum: b0db3c0665a0d698d65512951de9623c086b9c84ce015a76076d4bd0bf733779601d0b41f0931d16ae38132fba29e1ce291c1f8e6550fc32daaa2dc3ab4f338d + checksum: 8db5c0f16ab65f58c036cb5be0964605c97c29b9fdf1e20f298ec027e2a4fd96ad0413aa14f6e761629956dc552cd478c2f9b6c5a07e37e4c85209090162501e languageName: node linkType: hard @@ -16295,15 +16097,16 @@ __metadata: languageName: node linkType: hard -"safe-array-concat@npm:^1.1.2": - version: 1.1.2 - resolution: "safe-array-concat@npm:1.1.2" +"safe-array-concat@npm:^1.1.3": + version: 1.1.3 + resolution: "safe-array-concat@npm:1.1.3" dependencies: - call-bind: ^1.0.7 - get-intrinsic: ^1.2.4 - has-symbols: ^1.0.3 + call-bind: ^1.0.8 + call-bound: ^1.0.2 + get-intrinsic: ^1.2.6 + has-symbols: ^1.1.0 isarray: ^2.0.5 - checksum: a3b259694754ddfb73ae0663829e396977b99ff21cbe8607f35a469655656da8e271753497e59da8a7575baa94d2e684bea3e10ddd74ba046c0c9b4418ffa0c4 + checksum: 00f6a68140e67e813f3ad5e73e6dedcf3e42a9fa01f04d44b0d3f7b1f4b257af876832a9bfc82ac76f307e8a6cc652e3cf95876048a26cbec451847cf6ae3707 languageName: node linkType: hard @@ -16321,14 +16124,14 @@ __metadata: languageName: node linkType: hard -"safe-regex-test@npm:^1.0.3": - version: 1.0.3 - resolution: "safe-regex-test@npm:1.0.3" +"safe-regex-test@npm:^1.1.0": + version: 1.1.0 + resolution: "safe-regex-test@npm:1.1.0" dependencies: - call-bind: ^1.0.6 + call-bound: ^1.0.2 es-errors: ^1.3.0 - is-regex: ^1.1.4 - checksum: 6c7d392ff1ae7a3ae85273450ed02d1d131f1d2c76e177d6b03eb88e6df8fa062639070e7d311802c1615f351f18dc58f9454501c58e28d5ffd9b8f502ba6489 + is-regex: ^1.2.1 + checksum: 3c809abeb81977c9ed6c869c83aca6873ea0f3ab0f806b8edbba5582d51713f8a6e9757d24d2b4b088f563801475ea946c8e77e7713e8c65cdd02305b6caedab languageName: node linkType: hard @@ -16390,26 +16193,6 @@ __metadata: languageName: node linkType: hard -"semantic-release-yarn@npm:^3.0.2": - version: 3.0.2 - resolution: "semantic-release-yarn@npm:3.0.2" - dependencies: - "@semantic-release/error": ^4.0.0 - aggregate-error: ^5.0.0 - cosmiconfig: ^8.1.0 - execa: ^8.0.1 - fs-extra: ^11.1.0 - js-yaml: ^4.1.0 - lodash: ^4.17.21 - nerf-dart: ^1.0.0 - read-pkg: ^8.0.0 - semver: ^7.3.8 - peerDependencies: - semantic-release: ">=19.0.0" - checksum: ac89435f10891dc628e64422332871ede232428788470a0e086c92882b38d90122c0b3af353c28b4af3aeb6f2b4916429386fa0ce00abe4f803facad4c2313dd - languageName: node - linkType: hard - "semantic-release@npm:^23.1.1": version: 23.1.1 resolution: "semantic-release@npm:23.1.1" @@ -16523,7 +16306,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.1.1, semver@npm:^7.1.2, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.2, semver@npm:^7.5.3, semver@npm:^7.6.3": +"semver@npm:^7.1.1, semver@npm:^7.1.2, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.2, semver@npm:^7.5.3, semver@npm:^7.6.3": version: 7.6.3 resolution: "semver@npm:7.6.3" bin: @@ -16559,7 +16342,7 @@ __metadata: languageName: node linkType: hard -"set-function-length@npm:^1.2.1": +"set-function-length@npm:^1.2.2": version: 1.2.2 resolution: "set-function-length@npm:1.2.2" dependencies: @@ -16653,15 +16436,51 @@ __metadata: languageName: node linkType: hard -"side-channel@npm:^1.0.4, side-channel@npm:^1.0.6": - version: 1.0.6 - resolution: "side-channel@npm:1.0.6" +"side-channel-list@npm:^1.0.0": + version: 1.0.0 + resolution: "side-channel-list@npm:1.0.0" dependencies: - call-bind: ^1.0.7 es-errors: ^1.3.0 - get-intrinsic: ^1.2.4 - object-inspect: ^1.13.1 - checksum: bfc1afc1827d712271453e91b7cd3878ac0efd767495fd4e594c4c2afaa7963b7b510e249572bfd54b0527e66e4a12b61b80c061389e129755f34c493aad9b97 + object-inspect: ^1.13.3 + checksum: 603b928997abd21c5a5f02ae6b9cc36b72e3176ad6827fab0417ead74580cc4fb4d5c7d0a8a2ff4ead34d0f9e35701ed7a41853dac8a6d1a664fcce1a044f86f + languageName: node + linkType: hard + +"side-channel-map@npm:^1.0.1": + version: 1.0.1 + resolution: "side-channel-map@npm:1.0.1" + dependencies: + call-bound: ^1.0.2 + es-errors: ^1.3.0 + get-intrinsic: ^1.2.5 + object-inspect: ^1.13.3 + checksum: 42501371cdf71f4ccbbc9c9e2eb00aaaab80a4c1c429d5e8da713fd4d39ef3b8d4a4b37ed4f275798a65260a551a7131fd87fe67e922dba4ac18586d6aab8b06 + languageName: node + linkType: hard + +"side-channel-weakmap@npm:^1.0.2": + version: 1.0.2 + resolution: "side-channel-weakmap@npm:1.0.2" + dependencies: + call-bound: ^1.0.2 + es-errors: ^1.3.0 + get-intrinsic: ^1.2.5 + object-inspect: ^1.13.3 + side-channel-map: ^1.0.1 + checksum: a815c89bc78c5723c714ea1a77c938377ea710af20d4fb886d362b0d1f8ac73a17816a5f6640f354017d7e292a43da9c5e876c22145bac00b76cfb3468001736 + languageName: node + linkType: hard + +"side-channel@npm:^1.0.6, side-channel@npm:^1.1.0": + version: 1.1.0 + resolution: "side-channel@npm:1.1.0" + dependencies: + es-errors: ^1.3.0 + object-inspect: ^1.13.3 + side-channel-list: ^1.0.0 + side-channel-map: ^1.0.1 + side-channel-weakmap: ^1.0.2 + checksum: bf73d6d6682034603eb8e99c63b50155017ed78a522d27c2acec0388a792c3ede3238b878b953a08157093b85d05797217d270b7666ba1f111345fbe933380ff languageName: node linkType: hard @@ -16791,13 +16610,13 @@ __metadata: linkType: hard "socks-proxy-agent@npm:^8.0.3": - version: 8.0.4 - resolution: "socks-proxy-agent@npm:8.0.4" + version: 8.0.5 + resolution: "socks-proxy-agent@npm:8.0.5" dependencies: - agent-base: ^7.1.1 + agent-base: ^7.1.2 debug: ^4.3.4 socks: ^2.8.3 - checksum: b2ec5051d85fe49072f9a250c427e0e9571fd09d5db133819192d078fd291276e1f0f50f6dbc04329b207738b1071314cee8bdbb4b12e27de42dbcf1d4233c67 + checksum: b4fbcdb7ad2d6eec445926e255a1fb95c975db0020543fbac8dfa6c47aecc6b3b619b7fb9c60a3f82c9b2969912a5e7e174a056ae4d98cb5322f3524d6036e1d languageName: node linkType: hard @@ -16996,15 +16815,6 @@ __metadata: languageName: node linkType: hard -"ssri@npm:^10.0.0": - version: 10.0.6 - resolution: "ssri@npm:10.0.6" - dependencies: - minipass: ^7.0.3 - checksum: 4603d53a05bcd44188747d38f1cc43833b9951b5a1ee43ba50535bdfc5fe4a0897472dbe69837570a5417c3c073377ef4f8c1a272683b401857f72738ee57299 - languageName: node - linkType: hard - "ssri@npm:^12.0.0": version: 12.0.0 resolution: "ssri@npm:12.0.0" @@ -17102,26 +16912,30 @@ __metadata: languageName: node linkType: hard -"string.prototype.trim@npm:^1.2.9": - version: 1.2.9 - resolution: "string.prototype.trim@npm:1.2.9" +"string.prototype.trim@npm:^1.2.10": + version: 1.2.10 + resolution: "string.prototype.trim@npm:1.2.10" dependencies: - call-bind: ^1.0.7 + call-bind: ^1.0.8 + call-bound: ^1.0.2 + define-data-property: ^1.1.4 define-properties: ^1.2.1 - es-abstract: ^1.23.0 + es-abstract: ^1.23.5 es-object-atoms: ^1.0.0 - checksum: ea2df6ec1e914c9d4e2dc856fa08228e8b1be59b59e50b17578c94a66a176888f417264bb763d4aac638ad3b3dad56e7a03d9317086a178078d131aa293ba193 + has-property-descriptors: ^1.0.2 + checksum: 87659cd8561237b6c69f5376328fda934693aedde17bb7a2c57008e9d9ff992d0c253a391c7d8d50114e0e49ff7daf86a362f7961cf92f7564cd01342ca2e385 languageName: node linkType: hard -"string.prototype.trimend@npm:^1.0.8": - version: 1.0.8 - resolution: "string.prototype.trimend@npm:1.0.8" +"string.prototype.trimend@npm:^1.0.8, string.prototype.trimend@npm:^1.0.9": + version: 1.0.9 + resolution: "string.prototype.trimend@npm:1.0.9" dependencies: - call-bind: ^1.0.7 + call-bind: ^1.0.8 + call-bound: ^1.0.2 define-properties: ^1.2.1 es-object-atoms: ^1.0.0 - checksum: cc3bd2de08d8968a28787deba9a3cb3f17ca5f9f770c91e7e8fa3e7d47f079bad70fadce16f05dda9f261788be2c6e84a942f618c3bed31e42abc5c1084f8dfd + checksum: cb86f639f41d791a43627784be2175daa9ca3259c7cb83e7a207a729909b74f2ea0ec5d85de5761e6835e5f443e9420c6ff3f63a845378e4a61dd793177bc287 languageName: node linkType: hard @@ -17344,13 +17158,6 @@ __metadata: languageName: node linkType: hard -"symbol-observable@npm:^4.0.0": - version: 4.0.0 - resolution: "symbol-observable@npm:4.0.0" - checksum: 212c7edce6186634d671336a88c0e0bbd626c2ab51ed57498dc90698cce541839a261b969c2a1e8dd43762133d47672e8b62e0b1ce9cf4157934ba45fd172ba8 - languageName: node - linkType: hard - "sync-request@npm:6.1.0, sync-request@npm:^6.0.0": version: 6.1.0 resolution: "sync-request@npm:6.1.0" @@ -17384,15 +17191,15 @@ __metadata: linkType: hard "table@npm:^6.8.0": - version: 6.8.2 - resolution: "table@npm:6.8.2" + version: 6.9.0 + resolution: "table@npm:6.9.0" dependencies: ajv: ^8.0.1 lodash.truncate: ^4.4.2 slice-ansi: ^4.0.0 string-width: ^4.2.3 strip-ansi: ^6.0.1 - checksum: 61188652f53a980d1759ca460ca8dea5c5322aece3210457e7084882f053c2b6a870041295e08a82cb1d676e31b056406845d94b0abf3c79a4b104777bec413b + checksum: f54a7d1c11cda8c676e1e9aff5e723646905ed4579cca14b3ce12d2b12eac3e18f5dbe2549fe0b79697164858e18961145db4dd0660bbeb0fb4032af0aaf32b4 languageName: node linkType: hard @@ -17747,15 +17554,6 @@ __metadata: languageName: node linkType: hard -"ts-invariant@npm:^0.10.3": - version: 0.10.3 - resolution: "ts-invariant@npm:0.10.3" - dependencies: - tslib: ^2.1.0 - checksum: bb07d56fe4aae69d8860e0301dfdee2d375281159054bc24bf1e49e513fb0835bf7f70a11351344d213a79199c5e695f37ebbf5a447188a377ce0cd81d91ddb5 - languageName: node - linkType: hard - "ts-node@npm:^10.8.1, ts-node@npm:^10.9.1, ts-node@npm:^10.9.2": version: 10.9.2 resolution: "ts-node@npm:10.9.2" @@ -17817,6 +17615,13 @@ __metadata: languageName: node linkType: hard +"tslib@npm:2.6.2": + version: 2.6.2 + resolution: "tslib@npm:2.6.2" + checksum: 329ea56123005922f39642318e3d1f0f8265d1e7fcb92c633e0809521da75eeaca28d2cf96d7248229deb40e5c19adf408259f4b9640afd20d13aecc1430f3ad + languageName: node + linkType: hard + "tslib@npm:^1.11.1, tslib@npm:^1.8.1, tslib@npm:^1.9.3": version: 1.14.1 resolution: "tslib@npm:1.14.1" @@ -17824,7 +17629,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.0.0, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.3.0, tslib@npm:^2.3.1, tslib@npm:^2.4.0, tslib@npm:^2.5.0, tslib@npm:^2.5.2, tslib@npm:^2.6.2, tslib@npm:^2.6.3, tslib@npm:^2.7.0, tslib@npm:^2.8.1": +"tslib@npm:^2.0.0, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.3.1, tslib@npm:^2.4.0, tslib@npm:^2.5.0, tslib@npm:^2.5.2, tslib@npm:^2.6.2, tslib@npm:^2.6.3, tslib@npm:^2.7.0, tslib@npm:^2.8.1": version: 2.8.1 resolution: "tslib@npm:2.8.1" checksum: e4aba30e632b8c8902b47587fd13345e2827fa639e7c3121074d5ee0880723282411a8838f830b55100cbe4517672f84a2472667d355b81e8af165a55dc6203a @@ -17967,17 +17772,10 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^3.8.0": - version: 3.13.1 - resolution: "type-fest@npm:3.13.1" - checksum: c06b0901d54391dc46de3802375f5579868949d71f93b425ce564e19a428a0d411ae8d8cb0e300d330071d86152c3ea86e744c3f2860a42a79585b6ec2fdae8e - languageName: node - linkType: hard - -"type-fest@npm:^4.2.0, type-fest@npm:^4.6.0, type-fest@npm:^4.7.1": - version: 4.28.1 - resolution: "type-fest@npm:4.28.1" - checksum: 2fb1e8f906e9d86317b3497c9ebb0cbcd3e48363f2d5ea1f31c624e2e692a0f32acfc15af057cb4fc4555863f4918551f4696628772ab4bb7cb8fd1be0dc33dc +"type-fest@npm:^4.6.0, type-fest@npm:^4.7.1": + version: 4.30.2 + resolution: "type-fest@npm:4.30.2" + checksum: 861f7ae761fa11194743318a486c04b369f6f39060c8c24a099880478efa5c7562b72ad88c38fb7d7dc57111fb378b8922fceddaff363cfc002c6005a99d6bb6 languageName: node linkType: hard @@ -18027,7 +17825,7 @@ __metadata: languageName: node linkType: hard -"typed-array-byte-offset@npm:^1.0.2": +"typed-array-byte-offset@npm:^1.0.3": version: 1.0.3 resolution: "typed-array-byte-offset@npm:1.0.3" dependencies: @@ -18042,7 +17840,7 @@ __metadata: languageName: node linkType: hard -"typed-array-length@npm:^1.0.6": +"typed-array-length@npm:^1.0.7": version: 1.0.7 resolution: "typed-array-length@npm:1.0.7" dependencies: @@ -18145,14 +17943,14 @@ __metadata: linkType: hard "unbox-primitive@npm:^1.0.2": - version: 1.0.2 - resolution: "unbox-primitive@npm:1.0.2" + version: 1.1.0 + resolution: "unbox-primitive@npm:1.1.0" dependencies: - call-bind: ^1.0.2 + call-bound: ^1.0.3 has-bigints: ^1.0.2 - has-symbols: ^1.0.3 - which-boxed-primitive: ^1.0.2 - checksum: b7a1cf5862b5e4b5deb091672ffa579aa274f648410009c81cca63fed3b62b610c4f3b773f912ce545bb4e31edc3138975b5bc777fc6e4817dca51affb6380e9 + has-symbols: ^1.1.0 + which-boxed-primitive: ^1.1.1 + checksum: 729f13b84a5bfa3fead1d8139cee5c38514e63a8d6a437819a473e241ba87eeb593646568621c7fc7f133db300ef18d65d1a5a60dc9c7beb9000364d93c581df languageName: node linkType: hard @@ -18214,15 +18012,6 @@ __metadata: languageName: node linkType: hard -"unique-filename@npm:^3.0.0": - version: 3.0.0 - resolution: "unique-filename@npm:3.0.0" - dependencies: - unique-slug: ^4.0.0 - checksum: 8e2f59b356cb2e54aab14ff98a51ac6c45781d15ceaab6d4f1c2228b780193dc70fae4463ce9e1df4479cb9d3304d7c2043a3fb905bdeca71cc7e8ce27e063df - languageName: node - linkType: hard - "unique-filename@npm:^4.0.0": version: 4.0.0 resolution: "unique-filename@npm:4.0.0" @@ -18232,15 +18021,6 @@ __metadata: languageName: node linkType: hard -"unique-slug@npm:^4.0.0": - version: 4.0.0 - resolution: "unique-slug@npm:4.0.0" - dependencies: - imurmurhash: ^0.1.4 - checksum: 0884b58365af59f89739e6f71e3feacb5b1b41f2df2d842d0757933620e6de08eff347d27e9d499b43c40476cbaf7988638d3acb2ffbcb9d35fd035591adfd15 - languageName: node - linkType: hard - "unique-slug@npm:^5.0.0": version: 5.0.0 resolution: "unique-slug@npm:5.0.0" @@ -18454,14 +18234,14 @@ __metadata: linkType: soft "viem@npm:^2.9.26": - version: 2.21.51 - resolution: "viem@npm:2.21.51" - dependencies: - "@noble/curves": 1.6.0 - "@noble/hashes": 1.5.0 - "@scure/bip32": 1.5.0 - "@scure/bip39": 1.4.0 - abitype: 1.0.6 + version: 2.21.55 + resolution: "viem@npm:2.21.55" + dependencies: + "@noble/curves": 1.7.0 + "@noble/hashes": 1.6.1 + "@scure/bip32": 1.6.0 + "@scure/bip39": 1.5.0 + abitype: 1.0.7 isows: 1.0.6 ox: 0.1.2 webauthn-p256: 0.0.10 @@ -18471,7 +18251,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 8f3ae4cacdbba57bc804240be1c9b602959b7022e435c2594fe26d704932009715fb2e2322a9a8c9d3a0ffbea6cf9f5d9d8db448e98fb56d23104d38d13ce3d5 + checksum: db937a33071f744951edf98f31f9c25e71ebce07bb620389980cd4c921f310b808ec87d132c23e022b5576b943c359dde65cbba5b9ab8d63c27ad8a6cba877dd languageName: node linkType: hard @@ -18587,37 +18367,37 @@ __metadata: languageName: node linkType: hard -"which-boxed-primitive@npm:^1.0.2": - version: 1.0.2 - resolution: "which-boxed-primitive@npm:1.0.2" +"which-boxed-primitive@npm:^1.1.0, which-boxed-primitive@npm:^1.1.1": + version: 1.1.1 + resolution: "which-boxed-primitive@npm:1.1.1" dependencies: - is-bigint: ^1.0.1 - is-boolean-object: ^1.1.0 - is-number-object: ^1.0.4 - is-string: ^1.0.5 - is-symbol: ^1.0.3 - checksum: 53ce774c7379071729533922adcca47220228405e1895f26673bbd71bdf7fb09bee38c1d6399395927c6289476b5ae0629863427fd151491b71c4b6cb04f3a5e + is-bigint: ^1.1.0 + is-boolean-object: ^1.2.1 + is-number-object: ^1.1.1 + is-string: ^1.1.1 + is-symbol: ^1.1.1 + checksum: ee41d0260e4fd39551ad77700c7047d3d281ec03d356f5e5c8393fe160ba0db53ef446ff547d05f76ffabfd8ad9df7c9a827e12d4cccdbc8fccf9239ff8ac21e languageName: node linkType: hard -"which-builtin-type@npm:^1.1.4": - version: 1.2.0 - resolution: "which-builtin-type@npm:1.2.0" +"which-builtin-type@npm:^1.2.0": + version: 1.2.1 + resolution: "which-builtin-type@npm:1.2.1" dependencies: - call-bind: ^1.0.7 + call-bound: ^1.0.2 function.prototype.name: ^1.1.6 has-tostringtag: ^1.0.2 is-async-function: ^2.0.0 - is-date-object: ^1.0.5 + is-date-object: ^1.1.0 is-finalizationregistry: ^1.1.0 is-generator-function: ^1.0.10 - is-regex: ^1.1.4 + is-regex: ^1.2.1 is-weakref: ^1.0.2 isarray: ^2.0.5 - which-boxed-primitive: ^1.0.2 + which-boxed-primitive: ^1.1.0 which-collection: ^1.0.2 - which-typed-array: ^1.1.15 - checksum: 6d40ecdf33a28c3fdeab13e7e3b4289fb51f7ebd0983e628d50fa42e113d8be1bc7dd0e6eb23c6b6a0c2c0c7667763eca3a2af1f6d768e48efba8073870eb568 + which-typed-array: ^1.1.16 + checksum: 7a3617ba0e7cafb795f74db418df889867d12bce39a477f3ee29c6092aa64d396955bf2a64eae3726d8578440e26777695544057b373c45a8bcf5fbe920bf633 languageName: node linkType: hard @@ -18640,16 +18420,16 @@ __metadata: languageName: node linkType: hard -"which-typed-array@npm:^1.1.14, which-typed-array@npm:^1.1.15": - version: 1.1.15 - resolution: "which-typed-array@npm:1.1.15" +"which-typed-array@npm:^1.1.16": + version: 1.1.16 + resolution: "which-typed-array@npm:1.1.16" dependencies: available-typed-arrays: ^1.0.7 call-bind: ^1.0.7 for-each: ^0.3.3 gopd: ^1.0.1 has-tostringtag: ^1.0.2 - checksum: 65227dcbfadf5677aacc43ec84356d17b5500cb8b8753059bb4397de5cd0c2de681d24e1a7bd575633f976a95f88233abfd6549c2105ef4ebd58af8aa1807c75 + checksum: 903d398ec234d608011e1df09af6c004e66965bb24d5e1a82856cba0495fa6389ae393d1c9d5411498a9cba8e61b2e39a8e8be7b3005cbeadd317f772b1bdaef languageName: node linkType: hard @@ -18675,17 +18455,6 @@ __metadata: languageName: node linkType: hard -"which@npm:^4.0.0": - version: 4.0.0 - resolution: "which@npm:4.0.0" - dependencies: - isexe: ^3.1.1 - bin: - node-which: bin/which.js - checksum: f17e84c042592c21e23c8195108cff18c64050b9efb8459589116999ea9da6dd1509e6a1bac3aeebefd137be00fabbb61b5c2bc0aa0f8526f32b58ee2f545651 - languageName: node - linkType: hard - "which@npm:^5.0.0": version: 5.0.0 resolution: "which@npm:5.0.0" @@ -19009,22 +18778,6 @@ __metadata: languageName: node linkType: hard -"zen-observable-ts@npm:^1.2.5": - version: 1.2.5 - resolution: "zen-observable-ts@npm:1.2.5" - dependencies: - zen-observable: 0.8.15 - checksum: 3b707b7a0239a9bc40f73ba71b27733a689a957c1f364fabb9fa9cbd7d04b7c2faf0d517bf17004e3ed3f4330ac613e84c0d32313e450ddaa046f3350af44541 - languageName: node - linkType: hard - -"zen-observable@npm:0.8.15": - version: 0.8.15 - resolution: "zen-observable@npm:0.8.15" - checksum: b7289084bc1fc74a559b7259faa23d3214b14b538a8843d2b001a35e27147833f4107590b1b44bf5bc7f6dfe6f488660d3a3725f268e09b3925b3476153b7821 - languageName: node - linkType: hard - "zksync-ethers@npm:^5.0.0": version: 5.10.0 resolution: "zksync-ethers@npm:5.10.0" @@ -19046,17 +18799,17 @@ __metadata: linkType: hard "zod-to-json-schema@npm:^3.20.5": - version: 3.23.5 - resolution: "zod-to-json-schema@npm:3.23.5" + version: 3.24.1 + resolution: "zod-to-json-schema@npm:3.24.1" peerDependencies: - zod: ^3.23.3 - checksum: 3ac37128d1b989b027e55684201e1da90237f0955dc9bb40da013bc60f2ed23c57026df2fdc14da187be4d53873daad08210807c28c0dde4375c9df0e5fe7901 + zod: ^3.24.1 + checksum: 7195563f611bc21ea7f44129b8e32780125a9bd98b2e6b8709ac98bd2645729fecd87b8aeeaa8789617ee3f38e6585bab23dd613e2a35c31c6c157908f7a1681 languageName: node linkType: hard "zod@npm:^3.21.4": - version: 3.23.8 - resolution: "zod@npm:3.23.8" - checksum: 15949ff82118f59c893dacd9d3c766d02b6fa2e71cf474d5aa888570c469dbf5446ac5ad562bb035bf7ac9650da94f290655c194f4a6de3e766f43febd432c5c + version: 3.24.1 + resolution: "zod@npm:3.24.1" + checksum: dcd5334725b29555593c186fd6505878bb7ccb4f5954f728d2de24bf71f9397492d83bdb69d5b8a376eb500a02273ae0691b57deb1eb8718df3f64c77cc5534a languageName: node linkType: hard