diff --git a/package.json b/package.json index 7c930cde..a06137fa 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "pretty": "prettier '**/*.ts' --write", "test": "yarn workspaces foreach run test", "test:integration": "yarn workspaces foreach run test:integration", - "postinstall": "patch-package && ./copy_contracts.sh" + "postinstall": "./copy_contracts.sh" }, "devDependencies": { "@graphprotocol/client-cli": "^3.0.0", @@ -69,7 +69,6 @@ "matchstick-as": "^0.5.0", "module-alias": "^2.2.2", "mustache": "^4.2.0", - "patch-package": "6.5.1", "prettier": "^2.5.1", "prettier-airbnb-config": "^1.0.0", "solidity-coverage": "^0.7.21", diff --git a/patches/@venusprotocol+venus-protocol+0.6.0.patch b/patches/@venusprotocol+venus-protocol+0.6.0.patch deleted file mode 100644 index 33896302..00000000 --- a/patches/@venusprotocol+venus-protocol+0.6.0.patch +++ /dev/null @@ -1,111 +0,0 @@ -diff --git a/node_modules/@venusprotocol/venus-protocol/contracts/Comptroller/Comptroller.sol b/node_modules/@venusprotocol/venus-protocol/contracts/Comptroller/Comptroller.sol -index 918388f..233b6fc 100644 ---- a/node_modules/@venusprotocol/venus-protocol/contracts/Comptroller/Comptroller.sol -+++ b/node_modules/@venusprotocol/venus-protocol/contracts/Comptroller/Comptroller.sol -@@ -15,7 +15,7 @@ import "./Unitroller.sol"; - * @title Venus's Comptroller Contract - * @author Venus - */ --contract Comptroller is ComptrollerV10Storage, ComptrollerInterfaceG2, ComptrollerErrorReporter, ExponentialNoError { -+contract CorePoolComptroller is ComptrollerV10Storage, ComptrollerInterfaceG2, ComptrollerErrorReporter, ExponentialNoError { - /// @notice Emitted when an admin supports a market - event MarketListed(VToken vToken); - -diff --git a/node_modules/@venusprotocol/venus-protocol/contracts/Comptroller/ComptrollerInterface.sol b/node_modules/@venusprotocol/venus-protocol/contracts/Comptroller/ComptrollerInterface.sol -index 4c0ce6c..f18c3a5 100644 ---- a/node_modules/@venusprotocol/venus-protocol/contracts/Comptroller/ComptrollerInterface.sol -+++ b/node_modules/@venusprotocol/venus-protocol/contracts/Comptroller/ComptrollerInterface.sol -@@ -1,6 +1,6 @@ - pragma solidity ^0.5.16; - --import "../Tokens/VTokens/VToken.sol"; -+import { CorePoolVToken as VToken } from "../Tokens/VTokens/VToken.sol"; - import "../Oracle/PriceOracle.sol"; - - contract ComptrollerInterfaceG1 { -diff --git a/node_modules/@venusprotocol/venus-protocol/contracts/Lens/ComptrollerLens.sol b/node_modules/@venusprotocol/venus-protocol/contracts/Lens/ComptrollerLens.sol -index b5a296a..7b104ef 100644 ---- a/node_modules/@venusprotocol/venus-protocol/contracts/Lens/ComptrollerLens.sol -+++ b/node_modules/@venusprotocol/venus-protocol/contracts/Lens/ComptrollerLens.sol -@@ -6,7 +6,8 @@ import "../Tokens/VTokens/VToken.sol"; - import "../Tokens/EIP20Interface.sol"; - import "../Oracle/PriceOracle.sol"; - import "../Utils/ErrorReporter.sol"; --import "../Comptroller/Comptroller.sol"; -+import { ComptrollerLensInterface } from "../Comptroller/ComptrollerLensInterface.sol"; -+import { CorePoolComptroller as Comptroller, ComptrollerErrorReporter, ExponentialNoError } from "../Comptroller/Comptroller.sol"; - import "../Tokens/VAI/VAIControllerInterface.sol"; - - contract ComptrollerLens is ComptrollerLensInterface, ComptrollerErrorReporter, ExponentialNoError { -diff --git a/node_modules/@venusprotocol/venus-protocol/contracts/Lens/SnapshotLens.sol b/node_modules/@venusprotocol/venus-protocol/contracts/Lens/SnapshotLens.sol -index d44d94a..826ce00 100644 ---- a/node_modules/@venusprotocol/venus-protocol/contracts/Lens/SnapshotLens.sol -+++ b/node_modules/@venusprotocol/venus-protocol/contracts/Lens/SnapshotLens.sol -@@ -1,9 +1,9 @@ - pragma solidity ^0.5.16; - pragma experimental ABIEncoderV2; - --import "../Tokens/VTokens/VToken.sol"; -+import { CorePoolVToken as VToken } from "../Tokens/VTokens/VToken.sol"; - import "../Utils/SafeMath.sol"; --import "../Comptroller/Comptroller.sol"; -+import { CorePoolComptroller as Comptroller } from "../Comptroller/Comptroller.sol"; - import "../Tokens/EIP20Interface.sol"; - import "../Tokens/VTokens/VBep20.sol"; - -diff --git a/node_modules/@venusprotocol/venus-protocol/contracts/Tokens/VAI/VAIController.sol b/node_modules/@venusprotocol/venus-protocol/contracts/Tokens/VAI/VAIController.sol -index 2f472d8..9655f39 100644 ---- a/node_modules/@venusprotocol/venus-protocol/contracts/Tokens/VAI/VAIController.sol -+++ b/node_modules/@venusprotocol/venus-protocol/contracts/Tokens/VAI/VAIController.sol -@@ -4,9 +4,9 @@ import "../../Oracle/PriceOracle.sol"; - import "../../Utils/ErrorReporter.sol"; - import "../../Utils/Exponential.sol"; - import "../../Comptroller/ComptrollerStorage.sol"; --import "../../Comptroller/Comptroller.sol"; -+import { CorePoolComptroller as Comptroller } from "../../Comptroller/Comptroller.sol"; - import "../../Governance/IAccessControlManager.sol"; --import "../VTokens/VToken.sol"; -+import { CorePoolVToken as VToken } from "../VTokens/VToken.sol"; - import "./VAIControllerStorage.sol"; - import "./VAIUnitroller.sol"; - import "./VAI.sol"; -diff --git a/node_modules/@venusprotocol/venus-protocol/contracts/Tokens/VTokens/VToken.sol b/node_modules/@venusprotocol/venus-protocol/contracts/Tokens/VTokens/VToken.sol -index 3cc3e70..e7be892 100644 ---- a/node_modules/@venusprotocol/venus-protocol/contracts/Tokens/VTokens/VToken.sol -+++ b/node_modules/@venusprotocol/venus-protocol/contracts/Tokens/VTokens/VToken.sol -@@ -13,7 +13,7 @@ import "./VTokenInterfaces.sol"; - * @notice Abstract base for VTokens - * @author Venus - */ --contract VToken is VTokenInterface, Exponential, TokenErrorReporter { -+contract CorePoolVToken is VTokenInterface, Exponential, TokenErrorReporter { - /** - * @notice Initialize the money market - * @param comptroller_ The address of the Comptroller -diff --git a/node_modules/@venusprotocol/venus-protocol/contracts/test/ComptrollerHarness.sol b/node_modules/@venusprotocol/venus-protocol/contracts/test/ComptrollerHarness.sol -index f5495f4..362cb61 100644 ---- a/node_modules/@venusprotocol/venus-protocol/contracts/test/ComptrollerHarness.sol -+++ b/node_modules/@venusprotocol/venus-protocol/contracts/test/ComptrollerHarness.sol -@@ -1,6 +1,8 @@ - pragma solidity ^0.5.16; - --import "../Comptroller/Comptroller.sol"; -+import { UnitrollerAdminStorage } from "../Comptroller/ComptrollerStorage.sol"; -+import { Unitroller } from "../Comptroller/Unitroller.sol"; -+import { CorePoolComptroller as Comptroller } from "../Comptroller/Comptroller.sol"; - import "../Oracle/PriceOracle.sol"; - - contract ComptrollerKovan is Comptroller { -diff --git a/node_modules/@venusprotocol/venus-protocol/contracts/test/ComptrollerScenario.sol b/node_modules/@venusprotocol/venus-protocol/contracts/test/ComptrollerScenario.sol -index 8c247aa..1c6e3db 100644 ---- a/node_modules/@venusprotocol/venus-protocol/contracts/test/ComptrollerScenario.sol -+++ b/node_modules/@venusprotocol/venus-protocol/contracts/test/ComptrollerScenario.sol -@@ -1,6 +1,7 @@ - pragma solidity ^0.5.16; - --import "../Comptroller/Comptroller.sol"; -+import { CorePoolComptroller as Comptroller } from "../Comptroller/Comptroller.sol"; -+import { CorePoolVToken as VToken } from "../Tokens/VTokens/VToken.sol"; - - contract ComptrollerScenario is Comptroller { - uint public blockNumber; diff --git a/subgraphs/venus/src/mappings/vToken.ts b/subgraphs/venus/src/mappings/vToken.ts index 72d64e2e..35b3a129 100644 --- a/subgraphs/venus/src/mappings/vToken.ts +++ b/subgraphs/venus/src/mappings/vToken.ts @@ -363,10 +363,6 @@ export const handleTransfer = (event: Transfer): void => { } let vTokenDecimals = market.vTokenDecimals; let amountUnderlying = market.exchangeRateMantissa.times(event.params.amount); - // const exchangeRateBigDecimal = getExchangeRateBigDecimal(exchangeRate, underlyingDecimals); - // const amountUnderlyingMantissa = exchangeRateBigDecimal - // .times(exponentToBigDecimal(underlyingDecimals)) - // .times(amount.toBigDecimal()); // Checking if the tx is FROM the vToken contract (i.e. this will not run when minting) // If so, it is a mint, and we don't need to run these calculations diff --git a/subgraphs/venus/template.yaml b/subgraphs/venus/template.yaml index 02b90ef3..6274207e 100644 --- a/subgraphs/venus/template.yaml +++ b/subgraphs/venus/template.yaml @@ -57,7 +57,7 @@ templates: kind: ethereum/events apiVersion: 0.0.5 language: wasm/assemblyscript - file: ./src/mappings/vToken.ts + file: ./src/mappings/vtoken.ts entities: - User - Market @@ -65,6 +65,8 @@ templates: abis: - name: VToken file: ../../node_modules/@venusprotocol/venus-protocol/artifacts/contracts/Tokens/VTokens/VBep20.sol/VBep20.json + - name: VBep20Storage + file: ../../node_modules/@venusprotocol/venus-protocol/artifacts/contracts/Tokens/VTokens/VTokenInterfaces.sol/VBep20Storage.json - name: PriceOracle file: ../../node_modules/@venusprotocol/oracle/artifacts/contracts/ResilientOracle.sol/ResilientOracle.json - name: BEP20 diff --git a/yarn.lock b/yarn.lock index db475db7..8e438796 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3696,13 +3696,6 @@ __metadata: languageName: node linkType: hard -"@openzeppelin/contracts@npm:^4.8.3": - version: 4.9.0 - resolution: "@openzeppelin/contracts@npm:4.9.0" - checksum: aa1499897f85821f9184497f5201152a4a272b05749c85c209e9e553d734467a78557bcd2efe35f07994d6e14f30c545b239a4f63622f27f808182efb3103658 - languageName: node - linkType: hard - "@openzeppelin/contracts@npm:^4.8.3": version: 4.9.1 resolution: "@openzeppelin/contracts@npm:4.9.1" @@ -4756,13 +4749,6 @@ __metadata: languageName: node linkType: hard -"@yarnpkg/lockfile@npm:^1.1.0": - version: 1.1.0 - resolution: "@yarnpkg/lockfile@npm:1.1.0" - checksum: 05b881b4866a3546861fee756e6d3812776ea47fa6eb7098f983d6d0eefa02e12b66c3fff931574120f196286a7ad4879ce02743c8bb2be36c6a576c7852083a - languageName: node - linkType: hard - "JSONStream@npm:1.3.2": version: 1.3.2 resolution: "JSONStream@npm:1.3.2" @@ -6884,7 +6870,7 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^6.0.0, cross-spawn@npm:^6.0.5": +"cross-spawn@npm:^6.0.0": version: 6.0.5 resolution: "cross-spawn@npm:6.0.5" dependencies: @@ -8468,15 +8454,6 @@ __metadata: languageName: node linkType: hard -"find-yarn-workspace-root@npm:^2.0.0": - version: 2.0.0 - resolution: "find-yarn-workspace-root@npm:2.0.0" - dependencies: - micromatch: ^4.0.2 - checksum: fa5ca8f9d08fe7a54ce7c0a5931ff9b7e36f9ee7b9475fb13752bcea80ec6b5f180fa5102d60b376d5526ce924ea3fc6b19301262efa0a5d248dd710f3644242 - languageName: node - linkType: hard - "flat-cache@npm:^3.0.4": version: 3.0.4 resolution: "flat-cache@npm:3.0.4" @@ -8634,7 +8611,7 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:9.1.0, fs-extra@npm:^9.0.0, fs-extra@npm:^9.1.0": +"fs-extra@npm:9.1.0, fs-extra@npm:^9.1.0": version: 9.1.0 resolution: "fs-extra@npm:9.1.0" dependencies: @@ -9245,7 +9222,7 @@ __metadata: languageName: node linkType: hard -"graceful-fs@npm:^4.1.11, graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.1.9, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6": +"graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.1.9, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6": version: 4.2.10 resolution: "graceful-fs@npm:4.2.10" checksum: 3f109d70ae123951905d85032ebeae3c2a5a7a997430df00ea30df0e3a6c60cf6689b109654d6fdacd28810a053348c4d14642da1d075049e6be1ba5216218da @@ -10172,17 +10149,6 @@ __metadata: languageName: node linkType: hard -"is-ci@npm:^2.0.0": - version: 2.0.0 - resolution: "is-ci@npm:2.0.0" - dependencies: - ci-info: ^2.0.0 - bin: - is-ci: bin.js - checksum: 77b869057510f3efa439bbb36e9be429d53b3f51abd4776eeea79ab3b221337fe1753d1e50058a9e2c650d38246108beffb15ccfd443929d77748d8c0cc90144 - languageName: node - linkType: hard - "is-core-module@npm:^2.8.1, is-core-module@npm:^2.9.0": version: 2.11.0 resolution: "is-core-module@npm:2.11.0" @@ -10980,15 +10946,6 @@ __metadata: languageName: node linkType: hard -"klaw-sync@npm:^6.0.0": - version: 6.0.0 - resolution: "klaw-sync@npm:6.0.0" - dependencies: - graceful-fs: ^4.1.11 - checksum: 0da397f8961313c3ef8f79fb63af9002cde5a8fb2aeb1a37351feff0dd6006129c790400c3f5c3b4e757bedcabb13d21ec0a5eaef5a593d59515d4f2c291e475 - languageName: node - linkType: hard - "klaw@npm:^1.0.0": version: 1.3.1 resolution: "klaw@npm:1.3.1" @@ -11624,7 +11581,7 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:^4.0.2, micromatch@npm:^4.0.4, micromatch@npm:^4.0.5": +"micromatch@npm:^4.0.4, micromatch@npm:^4.0.5": version: 4.0.5 resolution: "micromatch@npm:4.0.5" dependencies: @@ -12961,30 +12918,6 @@ __metadata: languageName: node linkType: hard -"patch-package@npm:6.5.1": - version: 6.5.1 - resolution: "patch-package@npm:6.5.1" - dependencies: - "@yarnpkg/lockfile": ^1.1.0 - chalk: ^4.1.2 - cross-spawn: ^6.0.5 - find-yarn-workspace-root: ^2.0.0 - fs-extra: ^9.0.0 - is-ci: ^2.0.0 - klaw-sync: ^6.0.0 - minimist: ^1.2.6 - open: ^7.4.2 - rimraf: ^2.6.3 - semver: ^5.6.0 - slash: ^2.0.0 - tmp: ^0.0.33 - yaml: ^1.10.2 - bin: - patch-package: index.js - checksum: 8530ffa30f11136b527c6eddf6da48fa12856ee510a47edb1f9cdf8a025636adb82968f5fae778b5e04ce8c87915ebdf5911422b54add59a5a42e372a8f30eb2 - languageName: node - linkType: hard - "path-browserify@npm:1.0.1": version: 1.0.1 resolution: "path-browserify@npm:1.0.1" @@ -14145,7 +14078,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:2 || 3 || 4 || 5, semver@npm:^5.5.0, semver@npm:^5.6.0, semver@npm:^5.7.0": +"semver@npm:2 || 3 || 4 || 5, semver@npm:^5.5.0, semver@npm:^5.7.0": version: 5.7.1 resolution: "semver@npm:5.7.1" bin: @@ -14407,13 +14340,6 @@ __metadata: languageName: node linkType: hard -"slash@npm:^2.0.0": - version: 2.0.0 - resolution: "slash@npm:2.0.0" - checksum: 512d4350735375bd11647233cb0e2f93beca6f53441015eea241fe784d8068281c3987fbaa93e7ef1c38df68d9c60013045c92837423c69115297d6169aa85e6 - languageName: node - linkType: hard - "slash@npm:^3.0.0": version: 3.0.0 resolution: "slash@npm:3.0.0" @@ -14949,7 +14875,6 @@ __metadata: matchstick-as: ^0.5.0 module-alias: ^2.2.2 mustache: ^4.2.0 - patch-package: 6.5.1 prettier: ^2.5.1 prettier-airbnb-config: ^1.0.0 solidity-coverage: ^0.7.21 @@ -15233,7 +15158,7 @@ __metadata: languageName: node linkType: hard -"tmp@npm:0.0.33, tmp@npm:^0.0.33": +"tmp@npm:0.0.33": version: 0.0.33 resolution: "tmp@npm:0.0.33" dependencies: