Feature/bump libs (#255)

* fix id (#214)

* Bump eslint-plugin-prettier from 3.4.0 to 3.4.1 (#206)

Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/commits)

---
updated-dependencies:
- dependency-name: eslint-plugin-prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump typescript from 4.3.5 to 4.4.2 (#211)

Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.3.5 to 4.4.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.3.5...v4.4.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @typescript-eslint/eslint-plugin from 4.29.1 to 4.29.3 (#209)

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.29.1 to 4.29.3.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.29.3/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump mocha from 9.0.3 to 9.1.1 (#210)

Bumps [mocha](https://github.com/mochajs/mocha) from 9.0.3 to 9.1.1.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v9.0.3...v9.1.1)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @typescript-eslint/parser from 4.29.0 to 4.30.0 (#215)

Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.29.0 to 4.30.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.30.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump eslint-plugin-prettier from 3.4.1 to 4.0.0 (#217)

Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 3.4.1 to 4.0.0.
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/commits/v4.0.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump prettier from 2.3.2 to 2.4.0 (#220)

Bumps [prettier](https://github.com/prettier/prettier) from 2.3.2 to 2.4.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.3.2...2.4.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @typescript-eslint/parser from 4.30.0 to 4.31.0 (#221)

Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.30.0 to 4.31.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.31.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @oceanprotocol/lib from 0.17.1 to 0.17.3 (#216)

Bumps [@oceanprotocol/lib](https://github.com/oceanprotocol/ocean.js) from 0.17.1 to 0.17.3.
- [Release notes](https://github.com/oceanprotocol/ocean.js/releases)
- [Changelog](https://github.com/oceanprotocol/ocean.js/blob/main/CHANGELOG.md)
- [Commits](https://github.com/oceanprotocol/ocean.js/compare/v0.17.1...v0.17.3)

---
updated-dependencies:
- dependency-name: "@oceanprotocol/lib"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @typescript-eslint/eslint-plugin from 4.29.3 to 4.31.0 (#222)

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.29.3 to 4.31.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.31.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump typescript from 4.4.2 to 4.4.3 (#223)

Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.4.2 to 4.4.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.4.2...v4.4.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix gaia-x abi

Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>

* add catenax & bump ocean.js (#227)

* add catenax & bump ocean.js

* fix typo

* fix lint deps

* add nr of sales for user (#231)

* Bump @typescript-eslint/eslint-plugin from 4.31.1 to 4.32.0 (#242)

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.31.1 to 4.32.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.32.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump release-it from 14.11.5 to 14.11.6 (#244)

Bumps [release-it](https://github.com/release-it/release-it) from 14.11.5 to 14.11.6.
- [Release notes](https://github.com/release-it/release-it/releases)
- [Changelog](https://github.com/release-it/release-it/blob/master/CHANGELOG.md)
- [Commits](https://github.com/release-it/release-it/compare/14.11.5...14.11.6)

---
updated-dependencies:
- dependency-name: release-it
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @typescript-eslint/parser from 4.31.1 to 4.33.0 (#245)

Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.31.1 to 4.33.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.33.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* add EnergyWeb, Moonriver & Celo Alfajores (#239)

* add EnergyWeb, Moonriver & Celo Alfajores

* fix ocean address

* add ERC20 abis

* Bump mocha from 9.1.1 to 9.1.2 (#247)

Bumps [mocha](https://github.com/mochajs/mocha) from 9.1.1 to 9.1.2.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v9.1.1...v9.1.2)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @typescript-eslint/eslint-plugin from 4.32.0 to 4.33.0 (#248)

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.32.0 to 4.33.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.33.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @oceanprotocol/lib from 0.17.4 to 0.19.2 (#246)

Bumps [@oceanprotocol/lib](https://github.com/oceanprotocol/ocean.js) from 0.17.4 to 0.19.2.
- [Release notes](https://github.com/oceanprotocol/ocean.js/releases)
- [Changelog](https://github.com/oceanprotocol/ocean.js/blob/main/CHANGELOG.md)
- [Commits](https://github.com/oceanprotocol/ocean.js/compare/v0.17.4...v0.19.2)

---
updated-dependencies:
- dependency-name: "@oceanprotocol/lib"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Release 1.2.0

* lib bumps, remove logs

* more fixes

* more fixes

* bump other libs + fixes

* more fixes!

* remove unusued function, lint exceptions

* downgrade eslint

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Coseru <alex.coseru@gmail.com>
This commit is contained in:
mihaisc 2021-10-28 09:43:50 -07:00 committed by GitHub
parent 82fd689144
commit c4633aa381
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 22721 additions and 6591 deletions

View File

@ -1,14 +1,24 @@
{ {
"parser": "@typescript-eslint/parser", "parser": "@typescript-eslint/parser",
"parserOptions": { "parserOptions": {
"project": ["./tsconfig.json"] "project": [
"./tsconfig.json"
]
}, },
"extends": ["oceanprotocol", "plugin:prettier/recommended"], "extends": [
"plugins": ["@typescript-eslint"], "oceanprotocol",
"plugin:prettier/recommended"
],
"plugins": [
"@typescript-eslint"
],
"rules": { "rules": {
"no-use-before-define": "off", "no-use-before-define": "off",
"eqeqeq": "off", "eqeqeq": "off",
"@typescript-eslint/no-use-before-define": "error", "@typescript-eslint/no-use-before-define": "error",
"no-undef": ["warn"] "no-undef": "off",
"prefer-destructuring": "off",
"no-unneeded-ternary": "off",
"no-undefined": "off"
} }
} }

View File

@ -4,8 +4,76 @@ All notable changes to this project will be documented in this file. Dates are d
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
#### [v1.2.0](https://github.com/oceanprotocol/ocean-subgraph/compare/v1.1.2...v1.2.0)
- Bump @oceanprotocol/lib from 0.17.4 to 0.19.2 [`#246`](https://github.com/oceanprotocol/ocean-subgraph/pull/246)
- Bump @typescript-eslint/eslint-plugin from 4.32.0 to 4.33.0 [`#248`](https://github.com/oceanprotocol/ocean-subgraph/pull/248)
- Bump mocha from 9.1.1 to 9.1.2 [`#247`](https://github.com/oceanprotocol/ocean-subgraph/pull/247)
- add EnergyWeb, Moonriver & Celo Alfajores [`#239`](https://github.com/oceanprotocol/ocean-subgraph/pull/239)
- Bump @typescript-eslint/parser from 4.31.1 to 4.33.0 [`#245`](https://github.com/oceanprotocol/ocean-subgraph/pull/245)
- Bump release-it from 14.11.5 to 14.11.6 [`#244`](https://github.com/oceanprotocol/ocean-subgraph/pull/244)
- Bump @typescript-eslint/eslint-plugin from 4.31.1 to 4.32.0 [`#242`](https://github.com/oceanprotocol/ocean-subgraph/pull/242)
- add nr of sales for user [`#231`](https://github.com/oceanprotocol/ocean-subgraph/pull/231)
- add catenax & bump ocean.js [`#227`](https://github.com/oceanprotocol/ocean-subgraph/pull/227)
- Bump typescript from 4.4.2 to 4.4.3 [`#223`](https://github.com/oceanprotocol/ocean-subgraph/pull/223)
- Bump @typescript-eslint/eslint-plugin from 4.29.3 to 4.31.0 [`#222`](https://github.com/oceanprotocol/ocean-subgraph/pull/222)
- Bump @oceanprotocol/lib from 0.17.1 to 0.17.3 [`#216`](https://github.com/oceanprotocol/ocean-subgraph/pull/216)
- Bump @typescript-eslint/parser from 4.30.0 to 4.31.0 [`#221`](https://github.com/oceanprotocol/ocean-subgraph/pull/221)
- Bump prettier from 2.3.2 to 2.4.0 [`#220`](https://github.com/oceanprotocol/ocean-subgraph/pull/220)
- Bump eslint-plugin-prettier from 3.4.1 to 4.0.0 [`#217`](https://github.com/oceanprotocol/ocean-subgraph/pull/217)
- Bump @typescript-eslint/parser from 4.29.0 to 4.30.0 [`#215`](https://github.com/oceanprotocol/ocean-subgraph/pull/215)
- Bump mocha from 9.0.3 to 9.1.1 [`#210`](https://github.com/oceanprotocol/ocean-subgraph/pull/210)
- Bump @typescript-eslint/eslint-plugin from 4.29.1 to 4.29.3 [`#209`](https://github.com/oceanprotocol/ocean-subgraph/pull/209)
- Bump typescript from 4.3.5 to 4.4.2 [`#211`](https://github.com/oceanprotocol/ocean-subgraph/pull/211)
- Bump eslint-plugin-prettier from 3.4.0 to 3.4.1 [`#206`](https://github.com/oceanprotocol/ocean-subgraph/pull/206)
- fix id [`#214`](https://github.com/oceanprotocol/ocean-subgraph/pull/214)
- Bump release-it from 14.11.0 to 14.11.5 [`#203`](https://github.com/oceanprotocol/ocean-subgraph/pull/203)
- Added baseTokenSymbol to FixedRateExchange [`#201`](https://github.com/oceanprotocol/ocean-subgraph/pull/201)
- Bump @oceanprotocol/lib from 0.17.0 to 0.17.1 [`#189`](https://github.com/oceanprotocol/ocean-subgraph/pull/189)
- add nvmrc [`#199`](https://github.com/oceanprotocol/ocean-subgraph/pull/199)
- Bump @typescript-eslint/eslint-plugin from 4.28.5 to 4.29.1 [`#198`](https://github.com/oceanprotocol/ocean-subgraph/pull/198)
- Bump release-it from 14.10.1 to 14.11.0 [`#187`](https://github.com/oceanprotocol/ocean-subgraph/pull/187)
- Bump @typescript-eslint/parser from 4.28.5 to 4.29.0 [`#188`](https://github.com/oceanprotocol/ocean-subgraph/pull/188)
- Manual bump test [`#181`](https://github.com/oceanprotocol/ocean-subgraph/pull/181)
- Bump @typescript-eslint/parser from 4.28.4 to 4.28.5 [`#183`](https://github.com/oceanprotocol/ocean-subgraph/pull/183)
- Bump eslint from 7.31.0 to 7.32.0 [`#185`](https://github.com/oceanprotocol/ocean-subgraph/pull/185)
- Add swap volume, consume volume to subgraph [`#64`](https://github.com/oceanprotocol/ocean-subgraph/pull/64)
- add token name symbol to pools [`#61`](https://github.com/oceanprotocol/ocean-subgraph/pull/61)
- Bump @types/mocha from 8.2.3 to 9.0.0 [`#176`](https://github.com/oceanprotocol/ocean-subgraph/pull/176)
- Bump @typescript-eslint/parser from 4.28.3 to 4.28.4 [`#177`](https://github.com/oceanprotocol/ocean-subgraph/pull/177)
- Bump mocha from 9.0.2 to 9.0.3 [`#171`](https://github.com/oceanprotocol/ocean-subgraph/pull/171)
- Bump @typescript-eslint/eslint-plugin from 4.28.3 to 4.28.4 [`#173`](https://github.com/oceanprotocol/ocean-subgraph/pull/173)
- Bump release-it from 14.10.0 to 14.10.1 [`#172`](https://github.com/oceanprotocol/ocean-subgraph/pull/172)
- Bump eslint from 7.30.0 to 7.31.0 [`#170`](https://github.com/oceanprotocol/ocean-subgraph/pull/170)
- Feature: add Ploygon and Bsc in supported networks [`#168`](https://github.com/oceanprotocol/ocean-subgraph/pull/168)
- Bump @typescript-eslint/eslint-plugin from 4.28.2 to 4.28.3 [`#166`](https://github.com/oceanprotocol/ocean-subgraph/pull/166)
- Bump @typescript-eslint/parser from 4.28.0 to 4.28.3 [`#165`](https://github.com/oceanprotocol/ocean-subgraph/pull/165)
- Bump @types/chai from 4.2.19 to 4.2.21 [`#164`](https://github.com/oceanprotocol/ocean-subgraph/pull/164)
- Bump mocha from 9.0.1 to 9.0.2 [`#161`](https://github.com/oceanprotocol/ocean-subgraph/pull/161)
- Bump @types/mocha from 8.2.2 to 8.2.3 [`#160`](https://github.com/oceanprotocol/ocean-subgraph/pull/160)
- Bump @typescript-eslint/eslint-plugin from 4.28.0 to 4.28.2 [`#162`](https://github.com/oceanprotocol/ocean-subgraph/pull/162)
- Bump eslint from 7.29.0 to 7.30.0 [`#156`](https://github.com/oceanprotocol/ocean-subgraph/pull/156)
- Bump prettier from 2.3.1 to 2.3.2 [`#152`](https://github.com/oceanprotocol/ocean-subgraph/pull/152)
- Bump @graphprotocol/graph-ts from 0.20.0 to 0.20.1 [`#155`](https://github.com/oceanprotocol/ocean-subgraph/pull/155)
- Bump typescript from 4.3.4 to 4.3.5 [`#154`](https://github.com/oceanprotocol/ocean-subgraph/pull/154)
- new moonbeam alpha deployment [`#158`](https://github.com/oceanprotocol/ocean-subgraph/pull/158)
- Bump @typescript-eslint/parser from 4.26.1 to 4.28.0 [`#151`](https://github.com/oceanprotocol/ocean-subgraph/pull/151)
- Bump @typescript-eslint/eslint-plugin from 4.26.1 to 4.28.0 [`#150`](https://github.com/oceanprotocol/ocean-subgraph/pull/150)
- Bump mocha from 9.0.0 to 9.0.1 [`#149`](https://github.com/oceanprotocol/ocean-subgraph/pull/149)
- Bump @types/chai from 4.2.18 to 4.2.19 [`#148`](https://github.com/oceanprotocol/ocean-subgraph/pull/148)
- Bump typescript from 4.3.2 to 4.3.4 [`#146`](https://github.com/oceanprotocol/ocean-subgraph/pull/146)
- Bump release-it from 14.8.0 to 14.10.0 [`#145`](https://github.com/oceanprotocol/ocean-subgraph/pull/145)
- Bump eslint from 7.28.0 to 7.29.0 [`#144`](https://github.com/oceanprotocol/ocean-subgraph/pull/144)
- Bump @typescript-eslint/parser from 4.26.1 to 4.27.0 [`#143`](https://github.com/oceanprotocol/ocean-subgraph/pull/143)
- Bump @graphprotocol/graph-cli from 0.20.0 to 0.20.1 [`#141`](https://github.com/oceanprotocol/ocean-subgraph/pull/141)
- Use debug instead of info [`#147`](https://github.com/oceanprotocol/ocean-subgraph/pull/147)
- fix gaia-x abi [`931cbe0`](https://github.com/oceanprotocol/ocean-subgraph/commit/931cbe0ac016ac50abc24f2d73a76a44515d3e9f)
- fix bsc yaml [`2a65774`](https://github.com/oceanprotocol/ocean-subgraph/commit/2a65774abb9950109e7a2b2f60c7f2be2bcd5398)
#### [v1.1.2](https://github.com/oceanprotocol/ocean-subgraph/compare/v1.1.1...v1.1.2) #### [v1.1.2](https://github.com/oceanprotocol/ocean-subgraph/compare/v1.1.1...v1.1.2)
> 10 June 2021
- add Gaia-X testnet, BSC & Mumbai [`#140`](https://github.com/oceanprotocol/ocean-subgraph/pull/140) - add Gaia-X testnet, BSC & Mumbai [`#140`](https://github.com/oceanprotocol/ocean-subgraph/pull/140)
- Bump prettier from 2.3.0 to 2.3.1 [`#138`](https://github.com/oceanprotocol/ocean-subgraph/pull/138) - Bump prettier from 2.3.0 to 2.3.1 [`#138`](https://github.com/oceanprotocol/ocean-subgraph/pull/138)
- Bump @typescript-eslint/parser from 4.25.0 to 4.26.1 [`#135`](https://github.com/oceanprotocol/ocean-subgraph/pull/135) - Bump @typescript-eslint/parser from 4.25.0 to 4.26.1 [`#135`](https://github.com/oceanprotocol/ocean-subgraph/pull/135)
@ -38,6 +106,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- Bump eslint from 7.24.0 to 7.25.0 [`#96`](https://github.com/oceanprotocol/ocean-subgraph/pull/96) - Bump eslint from 7.24.0 to 7.25.0 [`#96`](https://github.com/oceanprotocol/ocean-subgraph/pull/96)
- Issue 92 readme improvements [`#93`](https://github.com/oceanprotocol/ocean-subgraph/pull/93) - Issue 92 readme improvements [`#93`](https://github.com/oceanprotocol/ocean-subgraph/pull/93)
- Bump eslint-plugin-prettier from 3.3.1 to 3.4.0 [`#88`](https://github.com/oceanprotocol/ocean-subgraph/pull/88) - Bump eslint-plugin-prettier from 3.3.1 to 3.4.0 [`#88`](https://github.com/oceanprotocol/ocean-subgraph/pull/88)
- Release 1.1.2 [`d073f2d`](https://github.com/oceanprotocol/ocean-subgraph/commit/d073f2dc33935abb3e7cc153616317870bac51bf)
- Add ADDRESS_FILE env docs [`81c5ad7`](https://github.com/oceanprotocol/ocean-subgraph/commit/81c5ad782e2dc1eb0cf0d52bc62ab699f179427b) - Add ADDRESS_FILE env docs [`81c5ad7`](https://github.com/oceanprotocol/ocean-subgraph/commit/81c5ad782e2dc1eb0cf0d52bc62ab699f179427b)
- Update README.md [`8aebc1f`](https://github.com/oceanprotocol/ocean-subgraph/commit/8aebc1f26f938f43ad1fe1487982cec3f992f998) - Update README.md [`8aebc1f`](https://github.com/oceanprotocol/ocean-subgraph/commit/8aebc1f26f938f43ad1fe1487982cec3f992f998)

27612
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "ocean-subgraph", "name": "ocean-subgraph",
"version": "1.1.2", "version": "1.2.0",
"scripts": { "scripts": {
"start": "", "start": "",
"quickstart:barge": "export ADDRESS_FILE=\"${HOME}/.ocean/ocean-contracts/artifacts/address.json\" && npm run codegen && npm run bargesetup && npm run create:local-barge && npm run deploy:local-barge", "quickstart:barge": "export ADDRESS_FILE=\"${HOME}/.ocean/ocean-contracts/artifacts/address.json\" && npm run codegen && npm run bargesetup && npm run create:local-barge && npm run deploy:local-barge",
@ -13,8 +13,12 @@
"create:local-polygon": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020", "create:local-polygon": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
"create:local-moonbeamalpha": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020", "create:local-moonbeamalpha": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
"create:local-gaiaxtestnet": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020", "create:local-gaiaxtestnet": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
"create:local-catenaxtestnet": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
"create:local-mumbai": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020", "create:local-mumbai": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
"create:local-bsc": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020", "create:local-bsc": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
"create:local-celoalfajores": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
"create:local-energyweb": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
"create:local-moonriver": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
"codegen": "graph codegen --output-dir src/@types", "codegen": "graph codegen --output-dir src/@types",
"build": "graph build", "build": "graph build",
"deploy": "graph deploy oceanprotocol/ocean-subgraph --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/", "deploy": "graph deploy oceanprotocol/ocean-subgraph --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
@ -26,8 +30,12 @@
"deploy:local-polygon": "graph deploy oceanprotocol/ocean-subgraph subgraph.polygon.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020", "deploy:local-polygon": "graph deploy oceanprotocol/ocean-subgraph subgraph.polygon.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"deploy:local-moonbeamalpha": "graph deploy oceanprotocol/ocean-subgraph subgraph.moonbeamalpha.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020", "deploy:local-moonbeamalpha": "graph deploy oceanprotocol/ocean-subgraph subgraph.moonbeamalpha.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"deploy:local-gaiaxtestnet": "graph deploy oceanprotocol/ocean-subgraph subgraph.gaiaxtestnet.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020", "deploy:local-gaiaxtestnet": "graph deploy oceanprotocol/ocean-subgraph subgraph.gaiaxtestnet.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"deploy:local-catenaxtestnet": "graph deploy oceanprotocol/ocean-subgraph subgraph.catenaxtestnet.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"deploy:local-mumbai": "graph deploy oceanprotocol/ocean-subgraph subgraph.mumbai.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020", "deploy:local-mumbai": "graph deploy oceanprotocol/ocean-subgraph subgraph.mumbai.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"deploy:local-bsc": "graph deploy oceanprotocol/ocean-subgraph subgraph.bsc.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020", "deploy:local-bsc": "graph deploy oceanprotocol/ocean-subgraph subgraph.bsc.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"deploy:local-celoalfajores": "graph deploy oceanprotocol/ocean-subgraph subgraph.celoalfajores.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"deploy:local-energyweb": "graph deploy oceanprotocol/ocean-subgraph subgraph.energyweb.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"deploy:local-moonriver": "graph deploy oceanprotocol/ocean-subgraph subgraph.moonriver.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"test": "npm run codegen && npm run lint && npm run type-check", "test": "npm run codegen && npm run lint && npm run type-check",
"test-integration": "TS_NODE_PROJECT='test/integration/tsconfig.json' mocha --config=test/integration/.mocharc.json --node-env=test --exit 'test/integration/**/*.test.ts'", "test-integration": "TS_NODE_PROJECT='test/integration/tsconfig.json' mocha --config=test/integration/.mocharc.json --node-env=test --exit 'test/integration/**/*.test.ts'",
"lint": "eslint --ignore-path .gitignore --ext .js --ext .ts --ext .tsx .", "lint": "eslint --ignore-path .gitignore --ext .js --ext .ts --ext .tsx .",
@ -37,29 +45,32 @@
"changelog": "auto-changelog -p" "changelog": "auto-changelog -p"
}, },
"devDependencies": { "devDependencies": {
"@graphprotocol/graph-cli": "^0.18.0", "@graphprotocol/graph-cli": "^0.22.4",
"@graphprotocol/graph-ts": "^0.20.1", "@graphprotocol/graph-ts": "^0.22.1",
"@types/chai": "^4.2.21", "@types/chai": "^4.2.22",
"@types/chai-spies": "^1.0.3", "@types/chai-spies": "^1.0.3",
"@types/mocha": "^9.0.0", "@types/mocha": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^4.29.1", "@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.29.0", "@typescript-eslint/parser": "^4.33.0",
"auto-changelog": "^2.3.0", "auto-changelog": "^2.3.0",
"chai": "^4.3.4", "chai": "^4.3.4",
"chai-spies": "^1.0.0", "chai-spies": "^1.0.0",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-config-oceanprotocol": "^1.5.0", "eslint-config-oceanprotocol": "^1.5.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0", "eslint-plugin-import": "^2.24.2",
"mocha": "^9.0.3", "eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-standard": "^5.0.0",
"mocha": "^9.1.3",
"mock-local-storage": "^1.1.17", "mock-local-storage": "^1.1.17",
"prettier": "^2.3.2", "prettier": "^2.4.0",
"release-it": "^14.11.5", "release-it": "^14.11.6",
"ts-node-register": "^1.0.0", "ts-node-register": "^1.0.0",
"typescript": "^4.3.5" "typescript": "^4.4.3"
}, },
"dependencies": { "dependencies": {
"@oceanprotocol/lib": "^0.17.1", "@oceanprotocol/lib": "^0.19.2",
"cross-fetch": "^3.1.4" "cross-fetch": "^3.1.4"
}, },
"repository": { "repository": {

View File

@ -47,14 +47,22 @@ export function getOceanAddress(): string {
return '0xf6410bf5d773c7a41ebff972f38e7463fa242477' return '0xf6410bf5d773c7a41ebff972f38e7463fa242477'
if (network == 'gaiaxtestnet') if (network == 'gaiaxtestnet')
return '0x80e63f73cac60c1662f27d2dfd2ea834acddbaa8' return '0x80e63f73cac60c1662f27d2dfd2ea834acddbaa8'
if (network == 'catenaxtestnet')
return '0x80e63f73cac60c1662f27d2dfd2ea834acddbaa8'
if (network == 'mumbai') return '0xd8992ed72c445c35cb4a2be468568ed1079357c8' if (network == 'mumbai') return '0xd8992ed72c445c35cb4a2be468568ed1079357c8'
if (network == 'bsc') return '0xdce07662ca8ebc241316a15b611c89711414dd1a' if (network == 'bsc') return '0xdce07662ca8ebc241316a15b611c89711414dd1a'
if (network == 'celoalfajores')
return '0xd8992ed72c445c35cb4a2be468568ed1079357c8'
if (network == 'energyweb')
return '0x593122aae80a6fc3183b2ac0c4ab3336debee528'
if (network == 'moonriver')
return '0x99c409e5f62e4bd2ac142f17cafb6810b8f0baae'
return '0x967da4048cd07ab37855c090aaf366e4ce1b9f48' return '0x967da4048cd07ab37855c090aaf366e4ce1b9f48'
} }
export const OCEAN: string = getOceanAddress() export const OCEAN: string = getOceanAddress()
export function getGlobalStats(): Global | null { export function getGlobalStats(): Global {
let gStats: Global | null = Global.load('1') let gStats: Global | null = Global.load('1')
if (gStats == null) { if (gStats == null) {
gStats = new Global('1') gStats = new Global('1')
@ -69,30 +77,6 @@ export function getGlobalStats(): Global | null {
return gStats return gStats
} }
export function _debuglog(
message: string,
event: ethereum.Event,
args: Array<string>
): void {
if (event != null) {
args.push(event.transaction.hash.toHex())
args.push(event.address.toHex())
}
for (let i = 0; i < args.length; i++) {
message = message.concat(' {}')
}
log.debug('@@@@@@ ' + message, args)
}
export function debuglog(
message: string,
event: ethereum.Event,
args: Array<string>
): void {
if (!ENABLE_DEBUG) return
_debuglog(message, event, args)
}
export function hexToDecimal(hexString: string, decimals: i32): BigDecimal { export function hexToDecimal(hexString: string, decimals: i32): BigDecimal {
const bytes = Bytes.fromHexString(hexString.toString()).reverse() as Bytes const bytes = Bytes.fromHexString(hexString.toString()).reverse() as Bytes
const bi = BigInt.fromUnsignedBytes(bytes) const bi = BigInt.fromUnsignedBytes(bytes)
@ -188,53 +172,16 @@ export function updatePoolTokenBalance(
balance: BigDecimal, balance: BigDecimal,
source: string source: string
): void { ): void {
debuglog( if (!poolToken) return
'########## updating poolToken balance (source, oldBalance, newBalance, poolId) ',
null,
[source, poolToken.balance.toString(), balance.toString(), poolToken.poolId]
)
if (balance < ZERO_BD || poolToken.balance < ZERO_BD) { if (balance < ZERO_BD || poolToken.balance < ZERO_BD) {
log.warning(
'EEEEEEEEEEEEEEEEE poolToken.balance < Zero: pool={}, poolToken={}, oldBalance={}, newBalance={}',
[
poolToken.poolId,
poolToken.address.toString(),
poolToken.balance.toString(),
balance.toString()
]
)
}
poolToken.balance = balance poolToken.balance = balance
} }
export function updatePoolSwapVolume(
pool: Pool,
swapAmount: BigDecimal
// source: string
): void {
debuglog(
'########## updating poolToken balance (source, oldBalance, newBalance, poolId) ',
null,
[source, pool.totalSwapVolume.toString(), swapAmount.toString(), pool.id]
)
if (swapAmount < ZERO_BD || pool.totalSwapVolume < ZERO_BD) {
log.warning(
'EEEEEEEEEEEEEEEEE poolToken.balance < Zero: pool={}, poolToken={}, oldBalance={}, newBalance={}',
[
pool.id,
poolToken.tokenAddress.toString(),
poolToken.balance.toString(),
swapAmount.toString()
]
)
} }
poolToken.swapBalanceOcean = poolToken.swapBalanceOcean.plus(swapAmount)
}
export function createUserEntity(address: string): void { export function createUserEntity(address: string): void {
if (User.load(address) == null) { if (User.load(address) == null) {
const user = new User(address) const user = new User(address)
user.nrSales = 0
user.save() user.save()
} }
} }
@ -281,40 +228,39 @@ export function updatePoolTransactionToken(
balance: BigDecimal, balance: BigDecimal,
feeValue: BigDecimal feeValue: BigDecimal
): void { ): void {
log.warning('WWWWWWWWWW ---- started update ptx with id {}', [poolTx])
log.warning('updatePoolTransactionToken({}, {} , {} , {} , {}}', [
poolTx,
poolTokenId,
amount.toString(),
balance.toString(),
feeValue.toString()
])
const ptx = PoolTransaction.load(poolTx) const ptx = PoolTransaction.load(poolTx)
const poolToken = PoolToken.load(poolTokenId) const poolToken = PoolToken.load(poolTokenId)
const pool = PoolEntity.load(poolToken.poolId)
if (!ptx) { if (!ptx) {
log.error('Cannot load PoolTransaction {}', [poolTx]) log.error('Cannot load PoolTransaction {}', [poolTx])
return return
} }
if (!poolToken) { if (!poolToken) {
log.error('Cannot load PoolToken {}', [poolTokenId]) log.error('Cannot load PoolToken {}', [poolTokenId])
return return
} }
const pool = PoolEntity.load(poolToken.poolId)
if (!pool) { if (!pool) {
log.error('Cannot load PoolEntity {}', [poolToken.poolId]) log.error('Cannot load PoolEntity {}', [poolToken.poolId])
return return
} }
const ptxTokenValuesId = poolTx.concat('-').concat(poolToken.tokenAddress) const ptxTokenValuesId = poolTx.concat('-').concat(poolTokenId)
let ptxTokenValues = PoolTransactionTokenValues.load(ptxTokenValuesId) let ptxTokenValues = PoolTransactionTokenValues.load(ptxTokenValuesId)
if (ptxTokenValues == null) { if (ptxTokenValues == null) {
ptxTokenValues = new PoolTransactionTokenValues(ptxTokenValuesId) ptxTokenValues = new PoolTransactionTokenValues(ptxTokenValuesId)
log.warning('created PoolTransactionTokenValues for {}', [ptxTokenValuesId]) log.warning('created PoolTransactionTokenValues for {}', [ptxTokenValuesId])
} }
if (!ptxTokenValues) return
ptxTokenValues.txId = poolTx ptxTokenValues.txId = poolTx
ptxTokenValues.poolToken = poolTokenId ptxTokenValues.poolToken = poolTokenId
ptxTokenValues.poolAddress = poolToken.poolId ptxTokenValues.poolAddress = poolToken.poolId
ptxTokenValues.userAddress = ptx.userAddress const ptxUserAddress = ptx.userAddress
ptxTokenValues.tokenAddress = PoolToken.load(poolTokenId).address ptxTokenValues.userAddress = ptxUserAddress ? ptxUserAddress : ''
const poolTokenAddress = poolToken.address
ptxTokenValues.tokenAddress = poolTokenAddress ? poolTokenAddress : ''
ptxTokenValues.value = amount ptxTokenValues.value = amount
ptxTokenValues.tokenReserve = balance ptxTokenValues.tokenReserve = balance
@ -326,46 +272,30 @@ export function updatePoolTransactionToken(
} }
ptxTokenValues.save() ptxTokenValues.save()
log.warning('ptxTokenValues {} saved', [ptxTokenValues.id])
if (ptxTokenValues.tokenAddress == OCEAN) { if (ptxTokenValues.tokenAddress == OCEAN) {
const factory = PoolFactory.load('1') const factory = PoolFactory.load('1')
if (factory !== null) {
factory.totalOceanLiquidity = factory.totalOceanLiquidity factory.totalOceanLiquidity = factory.totalOceanLiquidity
.plus(ptxTokenValues.tokenReserve) .plus(ptxTokenValues.tokenReserve)
.minus(pool.oceanReserve) .minus(pool.oceanReserve)
const gStats: Global | null = getGlobalStats() const gStats: Global = getGlobalStats()
if (gStats !== null) {
gStats.totalOceanLiquidity = factory.totalOceanLiquidity gStats.totalOceanLiquidity = factory.totalOceanLiquidity
gStats.save() gStats.save()
if (factory.totalOceanLiquidity < ZERO_BD || pool.oceanReserve < ZERO_BD) {
log.warning(
'EEEEEEEEEEEEEEEEE totalOceanLiquidity or oceanReserve < Zero: pool={}, totOcnLiq={}, ocnRes={}',
[
pool.id,
factory.totalOceanLiquidity.toString(),
pool.oceanReserve.toString()
]
)
} }
ptx.oceanReserve = ptxTokenValues.tokenReserve ptx.oceanReserve = ptxTokenValues.tokenReserve
pool.oceanReserve = ptxTokenValues.tokenReserve pool.oceanReserve = ptxTokenValues.tokenReserve
factory.save() factory.save()
}
} else { } else {
ptx.datatokenReserve = ptxTokenValues.tokenReserve ptx.datatokenReserve = ptxTokenValues.tokenReserve
pool.datatokenReserve = ptxTokenValues.tokenReserve pool.datatokenReserve = ptxTokenValues.tokenReserve
} }
// debuglog('########## updatePoolTransactionToken: ', null, [
// BigInt.fromI32(ptx.block).toString(),
// BigInt.fromI32(ptx.timestamp).toString(),
// ptxTokenValues.type,
// ptxTokenValues.value.toString(),
// ptxTokenValues.tokenReserve.toString(),
// poolToken.poolId
// ])
log.warning('saving ptx {} ', [ptx.id.toString()])
ptx.save() ptx.save()
log.warning('saving pool {} ', [pool.id.toString()])
pool.save() pool.save()
} }
@ -377,13 +307,6 @@ export function calcSpotPrice(
swapFee: BigDecimal swapFee: BigDecimal
): BigDecimal { ): BigDecimal {
if (balanceIn <= ZERO_BD || balanceOut <= ZERO_BD) return MINUS_1_BD if (balanceIn <= ZERO_BD || balanceOut <= ZERO_BD) return MINUS_1_BD
debuglog('################ calcSpotPrice', null, [
balanceIn.toString(),
wIn.toString(),
balanceOut.toString(),
wOut.toString(),
swapFee.toString()
])
const numer = balanceIn.div(wIn) const numer = balanceIn.div(wIn)
const denom = balanceOut.div(wOut) const denom = balanceOut.div(wOut)
@ -393,13 +316,6 @@ export function calcSpotPrice(
const scale = ONE_BD.div(ONE_BD.minus(swapFee)) const scale = ONE_BD.div(ONE_BD.minus(swapFee))
const price = ratio.times(scale) const price = ratio.times(scale)
price.truncate(18) price.truncate(18)
debuglog('################ calcSpotPrice values:', null, [
numer.toString(),
denom.toString(),
ratio.toString(),
scale.toString(),
price.toString()
])
return price return price
} }
@ -411,6 +327,7 @@ export function createPoolTransaction(
): void { ): void {
const poolId = event.address.toHex() const poolId = event.address.toHex()
const pool = PoolEntity.load(poolId) const pool = PoolEntity.load(poolId)
if (!pool) return
const ptx = event.transaction.hash.toHexString() const ptx = event.transaction.hash.toHexString()
const ocnToken = PoolToken.load(poolId.concat('-').concat(OCEAN)) const ocnToken = PoolToken.load(poolId.concat('-').concat(OCEAN))
@ -440,24 +357,9 @@ export function createPoolTransaction(
// Initial reserve values, will be updated in `updatePoolTransactionToken` // Initial reserve values, will be updated in `updatePoolTransactionToken`
poolTx.datatokenReserve = dtToken.balance poolTx.datatokenReserve = dtToken.balance
poolTx.oceanReserve = ocnToken.balance poolTx.oceanReserve = ocnToken.balance
debuglog('poolTX reserves:(dt, ocean)', null, [
poolTx.datatokenReserve.toString(),
poolTx.oceanReserve.toString()
])
const p = Pool.bind(Address.fromString(poolId)) const p = Pool.bind(Address.fromString(poolId))
debuglog(
'createPoolTransaction args sent to calcInGivenOut (ocnBalance, ocnWeight, dtBalance, dtWeight, dtAmount, swapFee)',
null,
[
decimalToBigInt(ocnToken.balance).toString(),
decimalToBigInt(ocnToken.denormWeight).toString(),
decimalToBigInt(dtToken.balance).toString(),
decimalToBigInt(dtToken.denormWeight).toString(),
ONE_BASE_18.toString(),
decimalToBigInt(pool.swapFee).toString()
]
)
const priceResult = p.try_calcInGivenOut( const priceResult = p.try_calcInGivenOut(
decimalToBigInt(ocnToken.balance), decimalToBigInt(ocnToken.balance),
decimalToBigInt(ocnToken.denormWeight), decimalToBigInt(ocnToken.denormWeight),
@ -466,13 +368,10 @@ export function createPoolTransaction(
ONE_BASE_18, ONE_BASE_18,
decimalToBigInt(pool.swapFee) decimalToBigInt(pool.swapFee)
) )
debuglog('got results', null, [])
poolTx.consumePrice = priceResult.reverted poolTx.consumePrice = priceResult.reverted
? MINUS_1_BD ? MINUS_1_BD
: bigIntToDecimal(priceResult.value, 18) : bigIntToDecimal(priceResult.value, 18)
debuglog('calcInGivenOut:', null, [
priceResult.reverted ? 'failed' : priceResult.value.toString()
])
const priceSpot = p.try_calcSpotPrice( const priceSpot = p.try_calcSpotPrice(
decimalToBigInt(ocnToken.balance), decimalToBigInt(ocnToken.balance),
@ -484,9 +383,6 @@ export function createPoolTransaction(
poolTx.spotPrice = priceSpot.reverted poolTx.spotPrice = priceSpot.reverted
? ZERO_BD ? ZERO_BD
: bigIntToDecimal(priceSpot.value, 18) : bigIntToDecimal(priceSpot.value, 18)
debuglog('SpotPrice:', null, [
priceSpot.reverted ? 'failed' : priceSpot.value.toString()
])
pool.consumePrice = poolTx.consumePrice pool.consumePrice = poolTx.consumePrice
pool.spotPrice = poolTx.spotPrice pool.spotPrice = poolTx.spotPrice
@ -496,65 +392,41 @@ export function createPoolTransaction(
poolTx.datatokenReserve.times(spotPrice) poolTx.datatokenReserve.times(spotPrice)
) )
const factory = PoolFactory.load('1') const factory = PoolFactory.load('1')
if (oldValueLocked < ZERO_BD || pool.valueLocked < ZERO_BD) { if (!factory) return
log.warning( if (factory.totalValueLocked !== null) {
'EEEEEEEEEEEEEEEEE valueLocked < Zero: pool={}, oldVL={}, newVL={}, OCEAN={}, DT={}, spotPrice={}', const tvl = factory.totalValueLocked
[
pool.id, factory.totalValueLocked = tvl
oldValueLocked.toString(), ? tvl.minus(oldValueLocked).plus(pool.valueLocked)
pool.valueLocked.toString(), : BigDecimal.fromString('0')
poolTx.oceanReserve.toString(),
poolTx.datatokenReserve.toString(),
pool.spotPrice.toString()
]
)
} }
factory.totalValueLocked = factory.totalValueLocked
.minus(oldValueLocked)
.plus(pool.valueLocked)
const gStats: Global | null = getGlobalStats()
const gStats: Global = getGlobalStats()
if (gStats !== null) {
gStats.totalValueLocked = factory.totalValueLocked gStats.totalValueLocked = factory.totalValueLocked
gStats.save() gStats.save()
}
pool.transactionCount = pool.transactionCount.plus(BigInt.fromI32(1)) pool.transactionCount = pool.transactionCount.plus(BigInt.fromI32(1))
pool.save() pool.save()
factory.save() factory.save()
debuglog(
'updated pool reserves (source, dtBalance, ocnBalance, dtReserve, ocnReserve): ',
event,
[
'createPoolTransaction',
dtToken.balance.toString(),
ocnToken.balance.toString(),
pool.datatokenReserve.toString(),
pool.oceanReserve.toString()
]
)
poolTx.tx = event.transaction.hash poolTx.tx = event.transaction.hash
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
poolTx.event = event_type poolTx.event = event_type
poolTx.block = event.block.number.toI32() poolTx.block = event.block.number.toI32()
poolTx.timestamp = event.block.timestamp.toI32() poolTx.timestamp = event.block.timestamp.toI32()
poolTx.gasUsed = event.transaction.gasUsed.toBigDecimal() // Property 'gasUsed' does not exist on type '~lib/@graphprotocol/graph-ts/chain/ethereum/ethereum.Transaction'
// poolTx.gasUsed = event.transaction.gasUsed.toBigDecimal()
poolTx.gasPrice = event.transaction.gasPrice.toBigDecimal() poolTx.gasPrice = event.transaction.gasPrice.toBigDecimal()
debuglog('####################### poolTransaction: ', event, [
ptx,
BigInt.fromI32(poolTx.block).toString(),
BigInt.fromI32(poolTx.timestamp).toString(),
pool.oceanReserve.toString()
])
poolTx.save() poolTx.save()
} }
export function decrPoolCount(finalized: boolean): void { export function decrPoolCount(finalized: boolean): void {
const factory = PoolFactory.load('1') const factory = PoolFactory.load('1')
if (!factory) return
factory.poolCount -= 1 factory.poolCount -= 1
if (finalized) factory.finalizedPoolCount -= 1 if (finalized) factory.finalizedPoolCount -= 1
factory.save() factory.save()
@ -576,7 +448,7 @@ export function saveTokenTransaction(
transaction.event = eventName transaction.event = eventName
transaction.datatokenAddress = event.address.toHex() transaction.datatokenAddress = event.address.toHex()
transaction.userAddress = userAddress transaction.userAddress = userAddress
transaction.gasUsed = event.transaction.gasUsed.toBigDecimal() // transaction.gasUsed = event.transaction.gasUsed.toBigDecimal()
transaction.gasPrice = event.transaction.gasPrice.toBigDecimal() transaction.gasPrice = event.transaction.gasPrice.toBigDecimal()
transaction.tx = event.transaction.hash transaction.tx = event.transaction.hash
transaction.timestamp = event.block.timestamp.toI32() transaction.timestamp = event.block.timestamp.toI32()

View File

@ -6,7 +6,8 @@ import {
Global, Global,
PoolFactory, PoolFactory,
TokenBalance, TokenBalance,
TokenOrder TokenOrder,
User
} from '../@types/schema' } from '../@types/schema'
import { import {
tokenToDecimal, tokenToDecimal,
@ -40,6 +41,7 @@ export function handleTransfer(event: Transfer): void {
const isBurn = tokenShareTo == ZERO_ADDRESS const isBurn = tokenShareTo == ZERO_ADDRESS
const datatoken = Datatoken.load(tokenId) const datatoken = Datatoken.load(tokenId)
if (!datatoken) return
if (isMint) { if (isMint) {
tokenBalanceTo = TokenBalance.load(tokenBalanceToId) tokenBalanceTo = TokenBalance.load(tokenBalanceToId)
@ -99,7 +101,7 @@ export function handleOrderStarted(event: OrderStarted): void {
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
const tokenId = event.address.toHex() const tokenId = event.address.toHex()
const datatoken = Datatoken.load(tokenId) const datatoken = Datatoken.load(tokenId)
if (datatoken == null) return if (!datatoken) return
const payer = event.params.payer.toHex() const payer = event.params.payer.toHex()
// let feeCollector = event.params.mrktFeeCollector // let feeCollector = event.params.mrktFeeCollector
@ -114,6 +116,7 @@ export function handleOrderStarted(event: OrderStarted): void {
if (order == null) { if (order == null) {
order = new TokenOrder(orderId) order = new TokenOrder(orderId)
} }
if (!order) return
order.datatokenId = tokenId order.datatokenId = tokenId
order.amount = tokenToDecimal(event.params.amount.toBigDecimal(), 18) order.amount = tokenToDecimal(event.params.amount.toBigDecimal(), 18)
order.consumer = event.params.consumer.toHex() order.consumer = event.params.consumer.toHex()
@ -121,8 +124,8 @@ export function handleOrderStarted(event: OrderStarted): void {
order.serviceId = event.params.serviceId.toI32() order.serviceId = event.params.serviceId.toI32()
order.timestamp = event.params.timestamp.toI32() order.timestamp = event.params.timestamp.toI32()
if ( if (
event.params.mrktFeeCollector != null && event.params.mrktFeeCollector !== null &&
event.params.mrktFeeCollector.toHex() != ZERO_ADDRESS event.params.mrktFeeCollector.toHex() !== ZERO_ADDRESS
) { ) {
order.marketFeeCollector = event.params.mrktFeeCollector.toHexString() order.marketFeeCollector = event.params.mrktFeeCollector.toHexString()
} }
@ -132,8 +135,15 @@ export function handleOrderStarted(event: OrderStarted): void {
order.save() order.save()
datatoken.orderVolume = datatoken.orderVolume.plus(order.amount) const orderVolume = datatoken.orderVolume
datatoken.orderCount = datatoken.orderCount.plus(BigInt.fromI32(1)) datatoken.orderVolume = orderVolume
? orderVolume.plus(order.amount)
: BigDecimal.fromString('0')
const orderCount = datatoken.orderCount
datatoken.orderCount = orderCount
? orderCount.plus(BigInt.fromI32(1))
: BigInt.fromI32(0)
datatoken.save() datatoken.save()
@ -151,12 +161,28 @@ export function handleOrderStarted(event: OrderStarted): void {
factory.poolCount = 0 factory.poolCount = 0
factory.finalizedPoolCount = 0 factory.finalizedPoolCount = 0
} }
if (factory !== null) {
factory.orderCount = factory.orderCount.plus(BigInt.fromI32(1)) const orderCount = factory.orderCount
factory.totalOrderVolume = factory.totalOrderVolume.plus(order.amount) factory.orderCount = orderCount
? orderCount.plus(BigInt.fromI32(1))
: BigInt.fromI32(0)
const totalOrderValue = factory.totalOrderVolume
factory.totalOrderVolume = totalOrderValue
? totalOrderValue.plus(order.amount)
: BigDecimal.fromString('0')
factory.save() factory.save()
const gStats: Global | null = getGlobalStats() }
const user = User.load(datatoken.minter)
if (user !== null) {
user.nrSales = user.nrSales + 1
user.save()
}
const gStats: Global = getGlobalStats()
if (gStats !== null) {
gStats.orderCount = factory.orderCount gStats.orderCount = factory.orderCount
gStats.totalOrderVolume = factory.totalOrderVolume gStats.totalOrderVolume = factory.totalOrderVolume
gStats.save() gStats.save()
} }
}

View File

@ -16,32 +16,25 @@ import {
Datatoken Datatoken
} from '../@types/schema' } from '../@types/schema'
import { tokenToDecimal, _debuglog } from '../helpers' import { tokenToDecimal } from '../helpers'
function _processDispenserUpdate( function _processDispenserUpdate(
event: ethereum.Event, event: ethereum.Event,
datatoken: string, datatoken: string,
contractAddress: Address contractAddress: Address
): void { ): void {
_debuglog('Start processDispenserUpdate', null, [
datatoken,
contractAddress.toHexString()
])
const dt = Datatoken.load(datatoken) const dt = Datatoken.load(datatoken)
if (!dt) { if (!dt) {
return return
} }
let dispenser = Dispenser.load(datatoken) let dispenser = Dispenser.load(datatoken)
if (!dispenser) { if (!dispenser) {
_debuglog('Creating new dispenser', null, null)
dispenser = new Dispenser(datatoken) dispenser = new Dispenser(datatoken)
} }
const dispenserEntity = DispenserEntity.bind(contractAddress) const dispenserEntity = DispenserEntity.bind(contractAddress)
_debuglog('Bound dispenser entity', null, null)
const dispenserStatus = dispenserEntity.try_status( const dispenserStatus = dispenserEntity.try_status(
Address.fromString(datatoken) Address.fromString(datatoken)
) )
_debuglog('Got status', null, null)
if (dispenserStatus.reverted) return if (dispenserStatus.reverted) return
dispenser.active = dispenserStatus.value.value0 dispenser.active = dispenserStatus.value.value0
let owner = User.load(dispenserStatus.value.value1.toHexString()) let owner = User.load(dispenserStatus.value.value1.toHexString())
@ -69,9 +62,6 @@ function _processDispenserUpdate(
} }
export function handleDispenserActivated(event: Activated): void { export function handleDispenserActivated(event: Activated): void {
_debuglog('Start handleDispenserActivated', event, [
event.params.datatokenAddress.toHexString()
])
_processDispenserUpdate( _processDispenserUpdate(
event, event,
event.params.datatokenAddress.toHexString(), event.params.datatokenAddress.toHexString(),

View File

@ -61,8 +61,11 @@ export function handleNewPool(event: BPoolRegistered): void {
factory.poolCount = factory.poolCount + 1 factory.poolCount = factory.poolCount + 1
factory.save() factory.save()
const gStats: Global | null = getGlobalStats() const gStats: Global | null = getGlobalStats()
if (gStats) {
gStats.poolCount = factory.poolCount gStats.poolCount = factory.poolCount
gStats.save() gStats.save()
}
PoolContract.create(event.params.bpoolAddress) PoolContract.create(event.params.bpoolAddress)
} }

View File

@ -50,17 +50,19 @@ function _processActiveUpdated(
const freupdate = new FixedRateExchangeUpdate(id) const freupdate = new FixedRateExchangeUpdate(id)
freupdate.exchangeId = exchangeId freupdate.exchangeId = exchangeId
if (fixedrateexchange) {
freupdate.oldRate = fixedrateexchange.rate freupdate.oldRate = fixedrateexchange.rate
freupdate.newRate = fixedrateexchange.rate freupdate.newRate = fixedrateexchange.rate
freupdate.oldActive = fixedrateexchange.active freupdate.oldActive = fixedrateexchange.active
fixedrateexchange.active = active
fixedrateexchange.save()
}
freupdate.newActive = active freupdate.newActive = active
freupdate.block = event.block.number.toI32() freupdate.block = event.block.number.toI32()
freupdate.timestamp = event.block.timestamp.toI32() freupdate.timestamp = event.block.timestamp.toI32()
freupdate.tx = tx freupdate.tx = tx
freupdate.save() freupdate.save()
fixedrateexchange.active = active
fixedrateexchange.save()
} }
export function handleExchangeActivated(event: ExchangeActivated): void { export function handleExchangeActivated(event: ExchangeActivated): void {

View File

@ -28,7 +28,6 @@ import {
updatePoolTransactionToken, updatePoolTransactionToken,
createPoolTransaction, createPoolTransaction,
OCEAN, OCEAN,
debuglog,
updatePoolTokenBalance, updatePoolTokenBalance,
getOceanAddress, getOceanAddress,
getGlobalStats, getGlobalStats,
@ -41,20 +40,22 @@ import {
export function handleSetSwapFee( export function handleSetSwapFee(
event: LOG_CALL, event: LOG_CALL,
swapFeeStr: string = null swapFeeStr: string | null = null
): void { ): void {
const poolId = event.address.toHex() const poolId = event.address.toHex()
const pool = Pool.load(poolId) const pool = Pool.load(poolId)
if (!pool) return
if (!swapFeeStr) { if (!swapFeeStr) {
swapFeeStr = event.params.data.toHexString().slice(-40) swapFeeStr = event.params.data.toHexString().slice(-40)
} }
pool.swapFee = hexToDecimal(swapFeeStr, 18) if (swapFeeStr !== null) pool.swapFee = hexToDecimal(swapFeeStr, 18)
pool.save() pool.save()
} }
export function handleSetController(event: LOG_CALL): void { export function handleSetController(event: LOG_CALL): void {
const poolId = event.address.toHex() const poolId = event.address.toHex()
const pool = Pool.load(poolId) const pool = Pool.load(poolId)
if (!pool) return
pool.controller = Address.fromString( pool.controller = Address.fromString(
event.params.data.toHexString().slice(-40) event.params.data.toHexString().slice(-40)
) )
@ -64,6 +65,7 @@ export function handleSetController(event: LOG_CALL): void {
export function handleSetPublicSwap(event: LOG_CALL): void { export function handleSetPublicSwap(event: LOG_CALL): void {
const poolId = event.address.toHex() const poolId = event.address.toHex()
const pool = Pool.load(poolId) const pool = Pool.load(poolId)
if (!pool) return
pool.publicSwap = event.params.data.toHexString().slice(-1) == '1' pool.publicSwap = event.params.data.toHexString().slice(-1) == '1'
pool.save() pool.save()
} }
@ -71,7 +73,7 @@ export function handleSetPublicSwap(event: LOG_CALL): void {
export function handleFinalize(event: LOG_CALL): void { export function handleFinalize(event: LOG_CALL): void {
const poolId = event.address.toHex() const poolId = event.address.toHex()
const pool = Pool.load(poolId) const pool = Pool.load(poolId)
if (pool === null) { if (!pool) {
log.error('Cannot handle finalize for unknown pool {} ', [poolId]) log.error('Cannot handle finalize for unknown pool {} ', [poolId])
return return
} }
@ -87,6 +89,7 @@ export function handleFinalize(event: LOG_CALL): void {
pool.save() pool.save()
const factory = PoolFactory.load('1') const factory = PoolFactory.load('1')
if (!factory) return
factory.finalizedPoolCount = factory.finalizedPoolCount + 1 factory.finalizedPoolCount = factory.finalizedPoolCount + 1
factory.save() factory.save()
} }
@ -99,6 +102,7 @@ export function _handleRebind(
denormWeightStr: string denormWeightStr: string
): void { ): void {
const pool = Pool.load(poolId) const pool = Pool.load(poolId)
if (!pool) return
const decimals = BigInt.fromI32(18).toI32() const decimals = BigInt.fromI32(18).toI32()
if (tokenAddress != OCEAN) { if (tokenAddress != OCEAN) {
@ -121,8 +125,9 @@ export function _handleRebind(
pool.totalWeight = pool.totalWeight.minus(oldWeight).minus(denormWeight) pool.totalWeight = pool.totalWeight.minus(oldWeight).minus(denormWeight)
} }
} }
if (!poolToken) return
poolToken.denormWeight = denormWeight poolToken.denormWeight =
denormWeight !== null ? denormWeight : BigDecimal.fromString('0')
const balance = hexToDecimal(balanceStr, decimals) const balance = hexToDecimal(balanceStr, decimals)
updatePoolTokenBalance(poolToken as PoolToken, balance, '_handleRebind') updatePoolTokenBalance(poolToken as PoolToken, balance, '_handleRebind')
@ -151,7 +156,6 @@ export function handleSetup(event: LOG_CALL): void {
} }
const poolId = event.address.toHex() const poolId = event.address.toHex()
debuglog('handleSetup: ', event, [])
const data = event.params.data.toHexString() const data = event.params.data.toHexString()
// First 2 chars are 0x // First 2 chars are 0x
// Next there is 8 chars // Next there is 8 chars
@ -178,7 +182,7 @@ export function handleSetup(event: LOG_CALL): void {
} }
const poolTokenId = poolId.concat('-').concat(baseTokenAddress) const poolTokenId = poolId.concat('-').concat(baseTokenAddress)
const poolToken = PoolToken.load(poolTokenId) const poolToken = PoolToken.load(poolTokenId)
if (poolToken != null) return if (!poolToken) return
_handleRebind( _handleRebind(
event, event,
@ -201,23 +205,32 @@ export function handleSetup(event: LOG_CALL): void {
// update base token // update base token
let amount = hexToDecimal(baseTokenAmount, 18) let amount = hexToDecimal(baseTokenAmount, 18)
const poolTokenBalance = poolToken.balance
const balance = poolTokenBalance
? poolTokenBalance
: BigDecimal.fromString('0')
updatePoolTransactionToken( updatePoolTransactionToken(
event.transaction.hash.toHexString(), event.transaction.hash.toHexString(),
poolTokenId, poolTokenId,
amount, amount,
PoolToken.load(poolTokenId).balance, balance,
ZERO_BD ZERO_BD
) )
// update the datatoken // update the datatoken
const poolDataToken = PoolToken.load(
poolId.concat('-').concat(dataTokenAddress)
)
if (poolDataToken !== null) {
amount = hexToDecimal(dataTokenAmount, 18) amount = hexToDecimal(dataTokenAmount, 18)
updatePoolTransactionToken( updatePoolTransactionToken(
event.transaction.hash.toHexString(), event.transaction.hash.toHexString(),
poolId.concat('-').concat(dataTokenAddress), poolId.concat('-').concat(dataTokenAddress),
amount, amount,
PoolToken.load(poolId.concat('-').concat(dataTokenAddress)).balance, poolDataToken.balance,
ZERO_BD ZERO_BD
) )
} }
}
/************************************ /************************************
********** JOINS & EXITS *********** ********** JOINS & EXITS ***********
@ -225,39 +238,24 @@ export function handleSetup(event: LOG_CALL): void {
export function handleJoinPool(event: LOG_JOIN): void { export function handleJoinPool(event: LOG_JOIN): void {
const poolId = event.address.toHex() const poolId = event.address.toHex()
const address = event.params.tokenIn.toHex()
const ptx = event.transaction.hash.toHexString()
const poolTokenId = poolId.concat('-').concat(address)
const poolToken = PoolToken.load(poolTokenId)
const pool = Pool.load(poolId) const pool = Pool.load(poolId)
const datatoken = Datatoken.load(poolTokenId)
const poolTx = PoolTransaction.load(ptx)
if (poolTx !== null) return
if (!pool || !poolToken || !datatoken) return
if (pool.finalized == false) { if (pool.finalized == false) {
return return
} }
pool.joinCount = pool.joinCount.plus(BigInt.fromI32(1)) pool.joinCount = pool.joinCount.plus(BigInt.fromI32(1))
pool.save() pool.save()
const ptx = event.transaction.hash.toHexString()
const poolTx = PoolTransaction.load(ptx)
if (poolTx != null) {
debuglog(
'!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!! JOIN JOIN JOIN !!!!!!!!!!!! PoolTransaction EXISTS: ',
event,
[]
)
return
}
const address = event.params.tokenIn.toHex()
const poolTokenId = poolId.concat('-').concat(address)
const poolToken = PoolToken.load(poolTokenId)
if (poolToken == null) {
debuglog(
'!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!! JOIN JOIN JOIN !!!!!!!!!!!! NO PoolToken: ',
event,
[address, poolTokenId]
)
return
}
const datatoken: Datatoken | null =
poolToken.tokenId != null ? Datatoken.load(poolToken.tokenId) : null
const decimals = const decimals =
datatoken == null ? BigInt.fromI32(18).toI32() : datatoken.decimals datatoken == null ? BigInt.fromI32(18).toI32() : datatoken.decimals
const tokenAmountIn = tokenToDecimal( const tokenAmountIn = tokenToDecimal(
@ -269,11 +267,6 @@ export function handleJoinPool(event: LOG_JOIN): void {
poolToken.balance.plus(tokenAmountIn), poolToken.balance.plus(tokenAmountIn),
'handleJoinPool' 'handleJoinPool'
) )
debuglog(
'!!!!!!!!!!!!!!!!!! JOIN JOIN JOIN : (token, amountIn, amountIn) ',
event,
[address, tokenAmountIn.toString(), event.params.tokenAmountIn.toString()]
)
poolToken.save() poolToken.save()
createPoolTransaction(event, 'join', event.params.caller.toHexString()) createPoolTransaction(event, 'join', event.params.caller.toHexString())
@ -291,18 +284,13 @@ export function handleExitPool(event: LOG_EXIT): void {
const address = event.params.tokenOut.toHex() const address = event.params.tokenOut.toHex()
const poolTokenId = poolId.concat('-').concat(address.toString()) const poolTokenId = poolId.concat('-').concat(address.toString())
const pool = Pool.load(poolId)
const poolToken = PoolToken.load(poolTokenId) const poolToken = PoolToken.load(poolTokenId)
if (!poolToken) { const datatoken = Datatoken.load(poolTokenId)
debuglog( if (!poolToken || !pool || !datatoken) {
'!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!! EXIT EXIT EXIT !!!!!!!!!!!! NO PoolToken: ',
event,
[address, poolTokenId]
)
return return
} }
const datatoken: Datatoken | null =
poolToken.tokenId != null ? Datatoken.load(poolToken.tokenId) : null
const decimals = const decimals =
datatoken == null ? BigInt.fromI32(18).toI32() : datatoken.decimals datatoken == null ? BigInt.fromI32(18).toI32() : datatoken.decimals
const tokenAmountOut = tokenToDecimal( const tokenAmountOut = tokenToDecimal(
@ -312,12 +300,7 @@ export function handleExitPool(event: LOG_EXIT): void {
const newAmount = poolToken.balance.minus(tokenAmountOut) const newAmount = poolToken.balance.minus(tokenAmountOut)
updatePoolTokenBalance(poolToken as PoolToken, newAmount, 'handleExitPool') updatePoolTokenBalance(poolToken as PoolToken, newAmount, 'handleExitPool')
poolToken.save() poolToken.save()
debuglog(
'!!!!!!!!!!!!!!!!!! EXIT EXIT EXIT : (token, amountOut, amountOut)',
event,
[address, tokenAmountOut.toString(), event.params.tokenAmountOut.toString()]
)
const pool = Pool.load(poolId)
pool.exitCount = pool.exitCount.plus(BigInt.fromI32(1)) pool.exitCount = pool.exitCount.plus(BigInt.fromI32(1))
if (newAmount.equals(ZERO_BD)) { if (newAmount.equals(ZERO_BD)) {
decrPoolCount(pool.finalized) decrPoolCount(pool.finalized)
@ -347,11 +330,6 @@ export function handleSwap(event: LOG_SWAP): void {
const poolTokenInId = poolId.concat('-').concat(tokenIn.toString()) const poolTokenInId = poolId.concat('-').concat(tokenIn.toString())
const poolTokenIn = PoolToken.load(poolTokenInId) const poolTokenIn = PoolToken.load(poolTokenInId)
if (!poolTokenIn) { if (!poolTokenIn) {
debuglog(
'!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!! SWAP SWAP SWAP !!!!!!!!!!!! NO PoolToken: ',
event,
[tokenIn, poolTokenInId]
)
return return
} }
const dtIn = Datatoken.load(tokenIn) const dtIn = Datatoken.load(tokenIn)
@ -370,7 +348,11 @@ export function handleSwap(event: LOG_SWAP): void {
const tokenOut = event.params.tokenOut.toHex() const tokenOut = event.params.tokenOut.toHex()
const poolTokenOutId = poolId.concat('-').concat(tokenOut.toString()) const poolTokenOutId = poolId.concat('-').concat(tokenOut.toString())
const poolTokenOut = PoolToken.load(poolTokenOutId) const poolTokenOut = PoolToken.load(poolTokenOutId)
const pool = Pool.load(poolId)
const factory = PoolFactory.load('1')
const dtOut = Datatoken.load(tokenOut) const dtOut = Datatoken.load(tokenOut)
if (!poolTokenOut || !dtOut || !factory || !pool) return
const tokenAmountOut = tokenToDecimal( const tokenAmountOut = tokenToDecimal(
event.params.tokenAmountOut.toBigDecimal(), event.params.tokenAmountOut.toBigDecimal(),
dtOut == null ? 18 : dtOut.decimals dtOut == null ? 18 : dtOut.decimals
@ -382,20 +364,6 @@ export function handleSwap(event: LOG_SWAP): void {
'handleSwap.tokenOut' 'handleSwap.tokenOut'
) )
poolTokenOut.save() poolTokenOut.save()
debuglog(
'!!!!!!!!!!!!!!!!!! SWAP SWAP SWAP : (tokenIn, tokenOut, amountIn, amountIn, amountOut, amountOut)',
event,
[
tokenIn,
tokenOut,
tokenAmountIn.toString(),
event.params.tokenAmountIn.toString(),
tokenAmountOut.toString(),
event.params.tokenAmountOut.toString()
]
)
const pool = Pool.load(poolId)
const factory = PoolFactory.load('1')
pool.swapCount = pool.swapCount.plus(BigInt.fromI32(1)) pool.swapCount = pool.swapCount.plus(BigInt.fromI32(1))
if (newAmountIn.equals(ZERO_BD) || newAmountOut.equals(ZERO_BD)) { if (newAmountIn.equals(ZERO_BD) || newAmountOut.equals(ZERO_BD)) {
@ -412,10 +380,11 @@ export function handleSwap(event: LOG_SWAP): void {
factory.save() factory.save()
pool.save() pool.save()
const gStats: Global | null = getGlobalStats() const gStats: Global = getGlobalStats()
if (gStats !== null) {
gStats.totalSwapVolume = factory.totalSwapVolume gStats.totalSwapVolume = factory.totalSwapVolume
gStats.save() gStats.save()
}
createPoolTransaction(event, 'swap', event.params.caller.toHexString()) createPoolTransaction(event, 'swap', event.params.caller.toHexString())
updatePoolTransactionToken( updatePoolTransactionToken(
@ -448,96 +417,69 @@ export function handleTransfer(event: Transfer): void {
const poolShareFromId = poolId.concat('-').concat(event.params.from.toHex()) const poolShareFromId = poolId.concat('-').concat(event.params.from.toHex())
let poolShareFrom = PoolShare.load(poolShareFromId) let poolShareFrom = PoolShare.load(poolShareFromId)
const poolShareFromBalance =
poolShareFrom == null ? ZERO_BD : poolShareFrom.balance
const poolShareToId = poolId.concat('-').concat(event.params.to.toHex()) const poolShareToId = poolId.concat('-').concat(event.params.to.toHex())
let poolShareTo = PoolShare.load(poolShareToId) let poolShareTo = PoolShare.load(poolShareToId)
const poolShareToBalance = poolShareTo == null ? ZERO_BD : poolShareTo.balance const poolShareToBalance = poolShareTo == null ? ZERO_BD : poolShareTo.balance
const pool = Pool.load(poolId) const pool = Pool.load(poolId)
if (!pool) return
const poolTx = PoolTransaction.load(event.transaction.hash.toHexString()) const poolTx = PoolTransaction.load(event.transaction.hash.toHexString())
const value = tokenToDecimal(event.params.value.toBigDecimal(), 18) const value = tokenToDecimal(event.params.value.toBigDecimal(), 18)
debuglog('poolShare Transfer event: (from, to, value)', event, [
event.params.from.toHex(),
event.params.to.toHex(),
value.toString()
])
if (isMint) { if (isMint) {
if (poolShareTo == null) { if (poolShareTo == null) {
createPoolShareEntity(poolShareToId, poolId, event.params.to.toHex()) createPoolShareEntity(poolShareToId, poolId, event.params.to.toHex())
poolShareTo = PoolShare.load(poolShareToId) poolShareTo = PoolShare.load(poolShareToId)
} }
if (poolShareTo !== null) {
poolShareTo.balance = poolShareTo.balance.plus(value) poolShareTo.balance = poolShareTo.balance.plus(value)
poolShareTo.save() poolShareTo.save()
}
pool.totalShares = pool.totalShares.plus(value) pool.totalShares = pool.totalShares.plus(value)
if (poolTx != null) { if (poolTx != null) {
poolTx.sharesTransferAmount = value poolTx.sharesTransferAmount = value
poolTx.sharesBalance = poolShareTo.balance if (poolShareTo !== null) poolTx.sharesBalance = poolShareTo.balance
} }
debuglog(
'pool shares mint: (id, value, totalShares, shareToBalance, toAddress)',
event,
[
poolId,
value.toString(),
pool.totalShares.toString(),
poolShareTo.balance.toString(),
poolShareTo.userAddress
]
)
} else if (isBurn) { } else if (isBurn) {
if (poolShareFrom == null) { if (poolShareFrom == null) {
createPoolShareEntity(poolShareFromId, poolId, event.params.from.toHex()) createPoolShareEntity(poolShareFromId, poolId, event.params.from.toHex())
poolShareFrom = PoolShare.load(poolShareFromId) poolShareFrom = PoolShare.load(poolShareFromId)
} }
poolShareFrom.balance = poolShareFrom.balance.minus(value)
poolShareFrom.save()
pool.totalShares = pool.totalShares.minus(value) pool.totalShares = pool.totalShares.minus(value)
if (poolTx != null) { if (poolTx !== null) {
poolTx.sharesTransferAmount = poolTx.sharesTransferAmount.minus(value) poolTx.sharesTransferAmount = poolTx.sharesTransferAmount.minus(value)
}
if (poolTx !== null && poolShareFrom !== null) {
poolTx.sharesBalance = poolShareFrom.balance poolTx.sharesBalance = poolShareFrom.balance
} }
debuglog(
'pool shares burn: (id, value, totalShares, shareFromBalance, fromAddress)', if (poolShareFrom !== null) {
event, poolShareFrom.balance = poolShareFrom.balance.minus(value)
[ poolShareFrom.save()
poolId, }
value.toString(),
pool.totalShares.toString(),
poolShareFrom.balance.toString(),
poolShareFrom.userAddress
]
)
} else { } else {
if (poolShareTo == null) { if (poolShareTo == null) {
createPoolShareEntity(poolShareToId, poolId, event.params.to.toHex()) createPoolShareEntity(poolShareToId, poolId, event.params.to.toHex())
poolShareTo = PoolShare.load(poolShareToId) poolShareTo = PoolShare.load(poolShareToId)
} }
if (poolShareTo !== null) {
poolShareTo.balance = poolShareTo.balance.plus(value) poolShareTo.balance = poolShareTo.balance.plus(value)
poolShareTo.save() poolShareTo.save()
}
if (poolShareFrom == null) { if (poolShareFrom == null) {
createPoolShareEntity(poolShareFromId, poolId, event.params.from.toHex()) createPoolShareEntity(poolShareFromId, poolId, event.params.from.toHex())
poolShareFrom = PoolShare.load(poolShareFromId) poolShareFrom = PoolShare.load(poolShareFromId)
} }
if (poolShareFrom !== null) {
poolShareFrom.balance = poolShareFrom.balance.minus(value) poolShareFrom.balance = poolShareFrom.balance.minus(value)
poolShareFrom.save() poolShareFrom.save()
debuglog( }
'pool shares transfer: ' +
'(id, value, totalShares, shareToBalance, shareFromBalance, toAddress, fromAddress)',
event,
[
poolId,
value.toString(),
pool.totalShares.toString(),
poolShareTo.balance.toString(),
poolShareFrom.balance.toString(),
poolShareTo.userAddress,
poolShareFrom.userAddress
]
)
} }
if ( if (
@ -549,14 +491,14 @@ export function handleTransfer(event: Transfer): void {
} }
if ( if (
poolShareFrom != null && poolShareFrom !== null &&
poolShareFrom.balance.equals(ZERO_BD) && poolShareFrom.balance.equals(ZERO_BD) &&
poolShareFromBalance.notEqual(ZERO_BD) poolShareFrom.balance.notEqual(ZERO_BD)
) { ) {
pool.holderCount = pool.holderCount.plus(BigInt.fromI32(1)) pool.holderCount = pool.holderCount.plus(BigInt.fromI32(1))
} }
if (poolTx != null) { if (poolTx !== null) {
poolTx.save() poolTx.save()
} }
@ -580,11 +522,11 @@ export function handleGulp(event: LOG_CALL): void {
const dtToken = PoolToken.load( const dtToken = PoolToken.load(
poolId.concat('-').concat(pool.datatokenAddress) poolId.concat('-').concat(pool.datatokenAddress)
) )
const ocnTokenBalance = ocnToken.balance
const dtTokenBalance = dtToken.balance
// get the balances from the contract // get the balances from the contract
// for ocean // for ocean
if (ocnToken) { if (ocnToken) {
const ocnTokenBalance = ocnToken.balance
const balanceAttempt = poolEbtity.try_getBalance(Address.fromString(OCEAN)) const balanceAttempt = poolEbtity.try_getBalance(Address.fromString(OCEAN))
if (!balanceAttempt.reverted) { if (!balanceAttempt.reverted) {
const contractBalance = bigIntToDecimal(balanceAttempt.value, 18) const contractBalance = bigIntToDecimal(balanceAttempt.value, 18)
@ -608,6 +550,7 @@ export function handleGulp(event: LOG_CALL): void {
} }
// for dt // for dt
if (dtToken) { if (dtToken) {
const dtTokenBalance = dtToken.balance
const balanceAttempt = poolEbtity.try_getBalance( const balanceAttempt = poolEbtity.try_getBalance(
Address.fromString(pool.datatokenAddress) Address.fromString(pool.datatokenAddress)
) )

View File

@ -13,7 +13,7 @@ dataSources:
startBlock: 8114772 startBlock: 8114772
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/factory.ts file: ./src/mappings/factory.ts
entities: entities:
@ -33,7 +33,7 @@ dataSources:
startBlock: 8114772 startBlock: 8114772
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/dtfactory.ts file: ./src/mappings/dtfactory.ts
entities: entities:
@ -53,7 +53,7 @@ dataSources:
startBlock: 8114772 startBlock: 8114772
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/metadata.ts file: ./src/mappings/metadata.ts
entities: entities:
@ -75,7 +75,7 @@ dataSources:
startBlock: 8114772 startBlock: 8114772
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/fixedrateexchange.ts file: ./src/mappings/fixedrateexchange.ts
entities: entities:
@ -109,7 +109,7 @@ dataSources:
startBlock: 8114772 startBlock: 8114772
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/dispenser.ts file: ./src/mappings/dispenser.ts
entities: entities:
@ -138,7 +138,7 @@ templates:
abi: Pool abi: Pool
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/pool.ts file: ./src/mappings/pool.ts
entities: entities:
@ -197,7 +197,7 @@ templates:
abi: DataToken abi: DataToken
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/datatoken.ts file: ./src/mappings/datatoken.ts
entities: entities:

View File

@ -0,0 +1,213 @@
specVersion: 0.0.2
description: Ocean provides data sharing through IDOs
repository: https://github.com/oceanprotocol/ocean-subgraph
schema:
file: ./schema.graphql
dataSources:
- kind: ethereum/contract
name: Factory
network: catenaxtestnet
source:
address: '0x3C5605202eD47C162450AE975415473e73F93072'
abi: Factory
startBlock: 9223
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/factory.ts
entities:
- PoolFactory
abis:
- name: Factory
file: ./abis/BFactory.json
eventHandlers:
- event: BPoolRegistered(address,indexed address)
handler: handleNewPool
- kind: ethereum/contract
name: DTFactory
network: catenaxtestnet
source:
address: '0x2112Eb973af1DBf83a4f11eda82f7a7527D7Fde5'
abi: DTFactory
startBlock: 9221
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/dtfactory.ts
entities:
- DatatokenFactory
abis:
- name: DTFactory
file: ./abis/DTFactory.json
eventHandlers:
- event: TokenRegistered(indexed address,string,string,uint256,indexed address,indexed string)
handler: handleNewToken
- kind: ethereum/contract
name: Metadata
network: catenaxtestnet
source:
address: '0xDEfD0018969cd2d4E648209F876ADe184815f038'
abi: Metadata
startBlock: 9225
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/metadata.ts
entities:
- Metadata
abis:
- name: Metadata
file: ./abis/Metadata.json
eventHandlers:
- event: MetadataCreated(indexed address,indexed address,bytes,bytes)
handler: handleMetadataCreated
- event: MetadataUpdated(indexed address,indexed address,bytes,bytes)
handler: handleMetadataUpdated
- kind: ethereum/contract
name: FixedRateExchange
network: catenaxtestnet
source:
address: '0x30E4CC2C7A9c6aA2b2Ce93586E3Df24a3A00bcDD'
abi: FixedRateExchange
startBlock: 9224
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/fixedrateexchange.ts
entities:
- FixedRateExchange
abis:
- name: FixedRateExchange
file: ./abis/FixedRateExchange.json
- name: ERC20
file: ./abis/ERC20.json
- name: ERC20SymbolBytes
file: ./abis/ERC20SymbolBytes.json
- name: ERC20NameBytes
file: ./abis/ERC20NameBytes.json
eventHandlers:
- event: ExchangeCreated(indexed bytes32,indexed address,indexed address,address,uint256)
handler: handleExchangeCreated
- event: ExchangeActivated(indexed bytes32,indexed address)
handler: handleExchangeActivated
- event: ExchangeDeactivated(indexed bytes32,indexed address)
handler: handleExchangeDeactivated
- event: ExchangeRateChanged(indexed bytes32,indexed address,uint256)
handler: handleExchangeRateChanged
- event: Swapped(indexed bytes32,indexed address,uint256,uint256)
handler: handleSwapped
- kind: ethereum/contract
name: Dispenser
network: catenaxtestnet
source:
address: '0x9C9eE07b8Ce907D2f9244F8317C1Ed29A3193bAe'
abi: Dispenser
startBlock: 9226
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/dispenser.ts
entities:
- Dispenser
abis:
- name: Dispenser
file: ./abis/Dispenser.json
eventHandlers:
- event: Activated(indexed address)
handler: handleDispenserActivated
- event: Deactivated(indexed address)
handler: handleDispenserDeactivated
- event: AcceptedMinter(indexed address)
handler: handleDispenserAcceptedMinter
- event: RemovedMinter(indexed address)
handler: handleDispenserRemovedMinter
- event: TokensDispensed(indexed address,indexed address,uint256)
handler: handleDispenserTokensDispensed
- event: OwnerWithdrawed(indexed address,indexed address,uint256)
handler: handleDispenserOwnerWithdrawed
templates:
- kind: ethereum/contract
name: Pool
network: catenaxtestnet
source:
abi: Pool
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/pool.ts
entities:
- Pool
- PoolFactory
- Swap
abis:
- name: Pool
file: ./abis/BPool.json
- name: BToken
file: ./abis/BToken.json
- name: ERC20
file: ./abis/ERC20.json
- name: ERC20SymbolBytes
file: ./abis/ERC20SymbolBytes.json
- name: ERC20NameBytes
file: ./abis/ERC20NameBytes.json
eventHandlers:
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x34e1990700000000000000000000000000000000000000000000000000000000'
handler: handleSetSwapFee
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x92eefe9b00000000000000000000000000000000000000000000000000000000'
handler: handleSetController
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x49b5955200000000000000000000000000000000000000000000000000000000'
handler: handleSetPublicSwap
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x4bb278f300000000000000000000000000000000000000000000000000000000'
handler: handleFinalize
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0xd1d7bc9100000000000000000000000000000000000000000000000000000000'
handler: handleSetup
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x3fdddaa200000000000000000000000000000000000000000000000000000000'
handler: handleRebind
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0xe4e1e53800000000000000000000000000000000000000000000000000000000'
handler: handleRebind
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x8c28cbe800000000000000000000000000000000000000000000000000000000'
handler: handleGulp
- event: LOG_JOIN(indexed address,indexed address,uint256)
handler: handleJoinPool
- event: LOG_EXIT(indexed address,indexed address,uint256)
handler: handleExitPool
- event: LOG_SWAP(indexed address,indexed address,indexed address,uint256,uint256)
handler: handleSwap
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer
- kind: ethereum/contract
name: DataToken
network: catenaxtestnet
source:
abi: DataToken
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/datatoken.ts
entities:
- DataToken
- DatatokenFactory
abis:
- name: DataToken
file: ./abis/DataTokenTemplate.json
eventHandlers:
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer
- event: OrderStarted(indexed address,indexed address,uint256,uint256,uint256,indexed address,uint256)
handler: handleOrderStarted

213
subgraph.celoalfajores.yaml Normal file
View File

@ -0,0 +1,213 @@
specVersion: 0.0.2
description: Ocean provides data sharing through IDOs
repository: https://github.com/oceanprotocol/ocean-subgraph
schema:
file: ./schema.graphql
dataSources:
- kind: ethereum/contract
name: Factory
network: celoalfajores
source:
address: '0x80E63f73cAc60c1662f27D2DFd2EA834acddBaa8'
abi: Factory
startBlock: 7542884
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/factory.ts
entities:
- PoolFactory
abis:
- name: Factory
file: ./abis/BFactory.json
eventHandlers:
- event: BPoolRegistered(address,indexed address)
handler: handleNewPool
- kind: ethereum/contract
name: DTFactory
network: celoalfajores
source:
address: '0x69B6E54Ad2b3c2801d11d8Ad56ea1d892555b776'
abi: DTFactory
startBlock: 7542879
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/dtfactory.ts
entities:
- DatatokenFactory
abis:
- name: DTFactory
file: ./abis/DTFactory.json
eventHandlers:
- event: TokenRegistered(indexed address,string,string,uint256,indexed address,indexed string)
handler: handleNewToken
- kind: ethereum/contract
name: Metadata
network: celoalfajores
source:
address: '0x30E4CC2C7A9c6aA2b2Ce93586E3Df24a3A00bcDD'
abi: Metadata
startBlock: 7542888
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/metadata.ts
entities:
- Metadata
abis:
- name: Metadata
file: ./abis/Metadata.json
eventHandlers:
- event: MetadataCreated(indexed address,indexed address,bytes,bytes)
handler: handleMetadataCreated
- event: MetadataUpdated(indexed address,indexed address,bytes,bytes)
handler: handleMetadataUpdated
- kind: ethereum/contract
name: FixedRateExchange
network: celoalfajores
source:
address: '0x3C5605202eD47C162450AE975415473e73F93072'
abi: FixedRateExchange
startBlock: 7542886
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/fixedrateexchange.ts
entities:
- FixedRateExchange
abis:
- name: FixedRateExchange
file: ./abis/FixedRateExchange.json
- name: ERC20
file: ./abis/ERC20.json
- name: ERC20SymbolBytes
file: ./abis/ERC20SymbolBytes.json
- name: ERC20NameBytes
file: ./abis/ERC20NameBytes.json
eventHandlers:
- event: ExchangeCreated(indexed bytes32,indexed address,indexed address,address,uint256)
handler: handleExchangeCreated
- event: ExchangeActivated(indexed bytes32,indexed address)
handler: handleExchangeActivated
- event: ExchangeDeactivated(indexed bytes32,indexed address)
handler: handleExchangeDeactivated
- event: ExchangeRateChanged(indexed bytes32,indexed address,uint256)
handler: handleExchangeRateChanged
- event: Swapped(indexed bytes32,indexed address,uint256,uint256)
handler: handleSwapped
- kind: ethereum/contract
name: Dispenser
network: celoalfajores
source:
address: '0xDEfD0018969cd2d4E648209F876ADe184815f038'
abi: Dispenser
startBlock: 7542890
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/dispenser.ts
entities:
- Dispenser
abis:
- name: Dispenser
file: ./abis/Dispenser.json
eventHandlers:
- event: Activated(indexed address)
handler: handleDispenserActivated
- event: Deactivated(indexed address)
handler: handleDispenserDeactivated
- event: AcceptedMinter(indexed address)
handler: handleDispenserAcceptedMinter
- event: RemovedMinter(indexed address)
handler: handleDispenserRemovedMinter
- event: TokensDispensed(indexed address,indexed address,uint256)
handler: handleDispenserTokensDispensed
- event: OwnerWithdrawed(indexed address,indexed address,uint256)
handler: handleDispenserOwnerWithdrawed
templates:
- kind: ethereum/contract
name: Pool
network: celoalfajores
source:
abi: Pool
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/pool.ts
entities:
- Pool
- PoolFactory
- Swap
abis:
- name: Pool
file: ./abis/BPool.json
- name: BToken
file: ./abis/BToken.json
- name: ERC20
file: ./abis/ERC20.json
- name: ERC20SymbolBytes
file: ./abis/ERC20SymbolBytes.json
- name: ERC20NameBytes
file: ./abis/ERC20NameBytes.json
eventHandlers:
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x34e1990700000000000000000000000000000000000000000000000000000000'
handler: handleSetSwapFee
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x92eefe9b00000000000000000000000000000000000000000000000000000000'
handler: handleSetController
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x49b5955200000000000000000000000000000000000000000000000000000000'
handler: handleSetPublicSwap
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x4bb278f300000000000000000000000000000000000000000000000000000000'
handler: handleFinalize
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0xd1d7bc9100000000000000000000000000000000000000000000000000000000'
handler: handleSetup
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x3fdddaa200000000000000000000000000000000000000000000000000000000'
handler: handleRebind
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0xe4e1e53800000000000000000000000000000000000000000000000000000000'
handler: handleRebind
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x8c28cbe800000000000000000000000000000000000000000000000000000000'
handler: handleGulp
- event: LOG_JOIN(indexed address,indexed address,uint256)
handler: handleJoinPool
- event: LOG_EXIT(indexed address,indexed address,uint256)
handler: handleExitPool
- event: LOG_SWAP(indexed address,indexed address,indexed address,uint256,uint256)
handler: handleSwap
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer
- kind: ethereum/contract
name: DataToken
network: celoalfajores
source:
abi: DataToken
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/datatoken.ts
entities:
- DataToken
- DatatokenFactory
abis:
- name: DataToken
file: ./abis/DataTokenTemplate.json
eventHandlers:
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer
- event: OrderStarted(indexed address,indexed address,uint256,uint256,uint256,indexed address,uint256)
handler: handleOrderStarted

213
subgraph.energyweb.yaml Normal file
View File

@ -0,0 +1,213 @@
specVersion: 0.0.2
description: Ocean provides data sharing through IDOs
repository: https://github.com/oceanprotocol/ocean-subgraph
schema:
file: ./schema.graphql
dataSources:
- kind: ethereum/contract
name: Factory
network: energyweb
source:
address: '0x2112Eb973af1DBf83a4f11eda82f7a7527D7Fde5'
abi: Factory
startBlock: 14101890
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/factory.ts
entities:
- PoolFactory
abis:
- name: Factory
file: ./abis/BFactory.json
eventHandlers:
- event: BPoolRegistered(address,indexed address)
handler: handleNewPool
- kind: ethereum/contract
name: DTFactory
network: energyweb
source:
address: '0x1B083D8584dd3e6Ff37d04a6e7e82b5F622f3985'
abi: DTFactory
startBlock: 14101885
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/dtfactory.ts
entities:
- DatatokenFactory
abis:
- name: DTFactory
file: ./abis/DTFactory.json
eventHandlers:
- event: TokenRegistered(indexed address,string,string,uint256,indexed address,indexed string)
handler: handleNewToken
- kind: ethereum/contract
name: Metadata
network: energyweb
source:
address: '0x3C5605202eD47C162450AE975415473e73F93072'
abi: Metadata
startBlock: 14101894
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/metadata.ts
entities:
- Metadata
abis:
- name: Metadata
file: ./abis/Metadata.json
eventHandlers:
- event: MetadataCreated(indexed address,indexed address,bytes,bytes)
handler: handleMetadataCreated
- event: MetadataUpdated(indexed address,indexed address,bytes,bytes)
handler: handleMetadataUpdated
- kind: ethereum/contract
name: FixedRateExchange
network: energyweb
source:
address: '0x80E63f73cAc60c1662f27D2DFd2EA834acddBaa8'
abi: FixedRateExchange
startBlock: 14101892
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/fixedrateexchange.ts
entities:
- FixedRateExchange
abis:
- name: FixedRateExchange
file: ./abis/FixedRateExchange.json
- name: ERC20
file: ./abis/ERC20.json
- name: ERC20SymbolBytes
file: ./abis/ERC20SymbolBytes.json
- name: ERC20NameBytes
file: ./abis/ERC20NameBytes.json
eventHandlers:
- event: ExchangeCreated(indexed bytes32,indexed address,indexed address,address,uint256)
handler: handleExchangeCreated
- event: ExchangeActivated(indexed bytes32,indexed address)
handler: handleExchangeActivated
- event: ExchangeDeactivated(indexed bytes32,indexed address)
handler: handleExchangeDeactivated
- event: ExchangeRateChanged(indexed bytes32,indexed address,uint256)
handler: handleExchangeRateChanged
- event: Swapped(indexed bytes32,indexed address,uint256,uint256)
handler: handleSwapped
- kind: ethereum/contract
name: Dispenser
network: energyweb
source:
address: '0x30E4CC2C7A9c6aA2b2Ce93586E3Df24a3A00bcDD'
abi: Dispenser
startBlock: 14101896
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/dispenser.ts
entities:
- Dispenser
abis:
- name: Dispenser
file: ./abis/Dispenser.json
eventHandlers:
- event: Activated(indexed address)
handler: handleDispenserActivated
- event: Deactivated(indexed address)
handler: handleDispenserDeactivated
- event: AcceptedMinter(indexed address)
handler: handleDispenserAcceptedMinter
- event: RemovedMinter(indexed address)
handler: handleDispenserRemovedMinter
- event: TokensDispensed(indexed address,indexed address,uint256)
handler: handleDispenserTokensDispensed
- event: OwnerWithdrawed(indexed address,indexed address,uint256)
handler: handleDispenserOwnerWithdrawed
templates:
- kind: ethereum/contract
name: Pool
network: energyweb
source:
abi: Pool
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/pool.ts
entities:
- Pool
- PoolFactory
- Swap
abis:
- name: Pool
file: ./abis/BPool.json
- name: BToken
file: ./abis/BToken.json
- name: ERC20
file: ./abis/ERC20.json
- name: ERC20SymbolBytes
file: ./abis/ERC20SymbolBytes.json
- name: ERC20NameBytes
file: ./abis/ERC20NameBytes.json
eventHandlers:
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x34e1990700000000000000000000000000000000000000000000000000000000'
handler: handleSetSwapFee
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x92eefe9b00000000000000000000000000000000000000000000000000000000'
handler: handleSetController
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x49b5955200000000000000000000000000000000000000000000000000000000'
handler: handleSetPublicSwap
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x4bb278f300000000000000000000000000000000000000000000000000000000'
handler: handleFinalize
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0xd1d7bc9100000000000000000000000000000000000000000000000000000000'
handler: handleSetup
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x3fdddaa200000000000000000000000000000000000000000000000000000000'
handler: handleRebind
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0xe4e1e53800000000000000000000000000000000000000000000000000000000'
handler: handleRebind
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x8c28cbe800000000000000000000000000000000000000000000000000000000'
handler: handleGulp
- event: LOG_JOIN(indexed address,indexed address,uint256)
handler: handleJoinPool
- event: LOG_EXIT(indexed address,indexed address,uint256)
handler: handleExitPool
- event: LOG_SWAP(indexed address,indexed address,indexed address,uint256,uint256)
handler: handleSwap
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer
- kind: ethereum/contract
name: DataToken
network: energyweb
source:
abi: DataToken
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/datatoken.ts
entities:
- DataToken
- DatatokenFactory
abis:
- name: DataToken
file: ./abis/DataTokenTemplate.json
eventHandlers:
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer
- event: OrderStarted(indexed address,indexed address,uint256,uint256,uint256,indexed address,uint256)
handler: handleOrderStarted

View File

@ -13,7 +13,7 @@ dataSources:
startBlock: 177644 startBlock: 177644
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/factory.ts file: ./src/mappings/factory.ts
entities: entities:
@ -33,7 +33,7 @@ dataSources:
startBlock: 177644 startBlock: 177644
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/dtfactory.ts file: ./src/mappings/dtfactory.ts
entities: entities:
@ -53,7 +53,7 @@ dataSources:
startBlock: 177644 startBlock: 177644
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/metadata.ts file: ./src/mappings/metadata.ts
entities: entities:
@ -75,7 +75,7 @@ dataSources:
startBlock: 177644 startBlock: 177644
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/fixedrateexchange.ts file: ./src/mappings/fixedrateexchange.ts
entities: entities:
@ -109,7 +109,7 @@ dataSources:
startBlock: 177644 startBlock: 177644
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/dispenser.ts file: ./src/mappings/dispenser.ts
entities: entities:
@ -138,7 +138,7 @@ templates:
abi: Pool abi: Pool
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/pool.ts file: ./src/mappings/pool.ts
entities: entities:
@ -150,6 +150,12 @@ templates:
file: ./abis/BPool.json file: ./abis/BPool.json
- name: BToken - name: BToken
file: ./abis/BToken.json file: ./abis/BToken.json
- name: ERC20
file: ./abis/ERC20.json
- name: ERC20SymbolBytes
file: ./abis/ERC20SymbolBytes.json
- name: ERC20NameBytes
file: ./abis/ERC20NameBytes.json
eventHandlers: eventHandlers:
- event: LOG_CALL(indexed bytes4,indexed address,bytes) - event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x34e1990700000000000000000000000000000000000000000000000000000000' topic0: '0x34e1990700000000000000000000000000000000000000000000000000000000'
@ -191,7 +197,7 @@ templates:
abi: DataToken abi: DataToken
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/datatoken.ts file: ./src/mappings/datatoken.ts
entities: entities:

View File

@ -13,7 +13,7 @@ dataSources:
startBlock: 281776 startBlock: 281776
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/factory.ts file: ./src/mappings/factory.ts
entities: entities:
@ -33,7 +33,7 @@ dataSources:
startBlock: 281773 startBlock: 281773
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/dtfactory.ts file: ./src/mappings/dtfactory.ts
entities: entities:
@ -53,7 +53,7 @@ dataSources:
startBlock: 281778 startBlock: 281778
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/metadata.ts file: ./src/mappings/metadata.ts
entities: entities:
@ -75,7 +75,7 @@ dataSources:
startBlock: 281777 startBlock: 281777
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/fixedrateexchange.ts file: ./src/mappings/fixedrateexchange.ts
entities: entities:
@ -109,7 +109,7 @@ dataSources:
startBlock: 281779 startBlock: 281779
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/dispenser.ts file: ./src/mappings/dispenser.ts
entities: entities:
@ -138,7 +138,7 @@ templates:
abi: Pool abi: Pool
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/pool.ts file: ./src/mappings/pool.ts
entities: entities:
@ -191,7 +191,7 @@ templates:
abi: DataToken abi: DataToken
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/datatoken.ts file: ./src/mappings/datatoken.ts
entities: entities:

213
subgraph.moonriver.yaml Normal file
View File

@ -0,0 +1,213 @@
specVersion: 0.0.2
description: Ocean provides data sharing through IDOs
repository: https://github.com/oceanprotocol/ocean-subgraph
schema:
file: ./schema.graphql
dataSources:
- kind: ethereum/contract
name: Factory
network: moonriver
source:
address: '0x4dD281EB67DED07E76E413Df16176D66ae69e240'
abi: Factory
startBlock: 637156
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/factory.ts
entities:
- PoolFactory
abis:
- name: Factory
file: ./abis/BFactory.json
eventHandlers:
- event: BPoolRegistered(address,indexed address)
handler: handleNewPool
- kind: ethereum/contract
name: DTFactory
network: moonriver
source:
address: '0x1d535147a97bd87c8443125376E6671B60556E07'
abi: DTFactory
startBlock: 637150
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/dtfactory.ts
entities:
- DatatokenFactory
abis:
- name: DTFactory
file: ./abis/DTFactory.json
eventHandlers:
- event: TokenRegistered(indexed address,string,string,uint256,indexed address,indexed string)
handler: handleNewToken
- kind: ethereum/contract
name: Metadata
network: moonriver
source:
address: '0xe8c6Dc39602031A152440311e364818ba25C2Bc1'
abi: Metadata
startBlock: 637161
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/metadata.ts
entities:
- Metadata
abis:
- name: Metadata
file: ./abis/Metadata.json
eventHandlers:
- event: MetadataCreated(indexed address,indexed address,bytes,bytes)
handler: handleMetadataCreated
- event: MetadataUpdated(indexed address,indexed address,bytes,bytes)
handler: handleMetadataUpdated
- kind: ethereum/contract
name: FixedRateExchange
network: moonriver
source:
address: '0xFe7967A5176fDAFa8DE109b3507016B885a82D6e'
abi: FixedRateExchange
startBlock: 637158
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/fixedrateexchange.ts
entities:
- FixedRateExchange
abis:
- name: FixedRateExchange
file: ./abis/FixedRateExchange.json
- name: ERC20
file: ./abis/ERC20.json
- name: ERC20SymbolBytes
file: ./abis/ERC20SymbolBytes.json
- name: ERC20NameBytes
file: ./abis/ERC20NameBytes.json
eventHandlers:
- event: ExchangeCreated(indexed bytes32,indexed address,indexed address,address,uint256)
handler: handleExchangeCreated
- event: ExchangeActivated(indexed bytes32,indexed address)
handler: handleExchangeActivated
- event: ExchangeDeactivated(indexed bytes32,indexed address)
handler: handleExchangeDeactivated
- event: ExchangeRateChanged(indexed bytes32,indexed address,uint256)
handler: handleExchangeRateChanged
- event: Swapped(indexed bytes32,indexed address,uint256,uint256)
handler: handleSwapped
- kind: ethereum/contract
name: Dispenser
network: moonriver
source:
address: '0xA4E108a4fa07C931cFe4bF2c1c6f9C1579d5a819'
abi: Dispenser
startBlock: 637162
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/dispenser.ts
entities:
- Dispenser
abis:
- name: Dispenser
file: ./abis/Dispenser.json
eventHandlers:
- event: Activated(indexed address)
handler: handleDispenserActivated
- event: Deactivated(indexed address)
handler: handleDispenserDeactivated
- event: AcceptedMinter(indexed address)
handler: handleDispenserAcceptedMinter
- event: RemovedMinter(indexed address)
handler: handleDispenserRemovedMinter
- event: TokensDispensed(indexed address,indexed address,uint256)
handler: handleDispenserTokensDispensed
- event: OwnerWithdrawed(indexed address,indexed address,uint256)
handler: handleDispenserOwnerWithdrawed
templates:
- kind: ethereum/contract
name: Pool
network: moonriver
source:
abi: Pool
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/pool.ts
entities:
- Pool
- PoolFactory
- Swap
abis:
- name: Pool
file: ./abis/BPool.json
- name: BToken
file: ./abis/BToken.json
- name: ERC20
file: ./abis/ERC20.json
- name: ERC20SymbolBytes
file: ./abis/ERC20SymbolBytes.json
- name: ERC20NameBytes
file: ./abis/ERC20NameBytes.json
eventHandlers:
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x34e1990700000000000000000000000000000000000000000000000000000000'
handler: handleSetSwapFee
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x92eefe9b00000000000000000000000000000000000000000000000000000000'
handler: handleSetController
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x49b5955200000000000000000000000000000000000000000000000000000000'
handler: handleSetPublicSwap
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x4bb278f300000000000000000000000000000000000000000000000000000000'
handler: handleFinalize
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0xd1d7bc9100000000000000000000000000000000000000000000000000000000'
handler: handleSetup
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x3fdddaa200000000000000000000000000000000000000000000000000000000'
handler: handleRebind
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0xe4e1e53800000000000000000000000000000000000000000000000000000000'
handler: handleRebind
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
topic0: '0x8c28cbe800000000000000000000000000000000000000000000000000000000'
handler: handleGulp
- event: LOG_JOIN(indexed address,indexed address,uint256)
handler: handleJoinPool
- event: LOG_EXIT(indexed address,indexed address,uint256)
handler: handleExitPool
- event: LOG_SWAP(indexed address,indexed address,indexed address,uint256,uint256)
handler: handleSwap
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer
- kind: ethereum/contract
name: DataToken
network: moonriver
source:
abi: DataToken
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/mappings/datatoken.ts
entities:
- DataToken
- DatatokenFactory
abis:
- name: DataToken
file: ./abis/DataTokenTemplate.json
eventHandlers:
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer
- event: OrderStarted(indexed address,indexed address,uint256,uint256,uint256,indexed address,uint256)
handler: handleOrderStarted

View File

@ -13,7 +13,7 @@ dataSources:
startBlock: 14791845 startBlock: 14791845
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/factory.ts file: ./src/mappings/factory.ts
entities: entities:
@ -33,7 +33,7 @@ dataSources:
startBlock: 14791845 startBlock: 14791845
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/dtfactory.ts file: ./src/mappings/dtfactory.ts
entities: entities:
@ -53,7 +53,7 @@ dataSources:
startBlock: 14791845 startBlock: 14791845
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/metadata.ts file: ./src/mappings/metadata.ts
entities: entities:
@ -75,7 +75,7 @@ dataSources:
startBlock: 14791845 startBlock: 14791845
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/fixedrateexchange.ts file: ./src/mappings/fixedrateexchange.ts
entities: entities:
@ -109,7 +109,7 @@ dataSources:
startBlock: 14791845 startBlock: 14791845
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/dispenser.ts file: ./src/mappings/dispenser.ts
entities: entities:
@ -138,7 +138,7 @@ templates:
abi: Pool abi: Pool
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/pool.ts file: ./src/mappings/pool.ts
entities: entities:
@ -191,7 +191,7 @@ templates:
abi: DataToken abi: DataToken
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/datatoken.ts file: ./src/mappings/datatoken.ts
entities: entities:

View File

@ -13,7 +13,7 @@ dataSources:
startBlock: 11005239 startBlock: 11005239
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/factory.ts file: ./src/mappings/factory.ts
entities: entities:
@ -33,7 +33,7 @@ dataSources:
startBlock: 11005230 startBlock: 11005230
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/dtfactory.ts file: ./src/mappings/dtfactory.ts
entities: entities:
@ -53,7 +53,7 @@ dataSources:
startBlock: 11005247 startBlock: 11005247
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/metadata.ts file: ./src/mappings/metadata.ts
entities: entities:
@ -75,7 +75,7 @@ dataSources:
startBlock: 11005247 startBlock: 11005247
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/fixedrateexchange.ts file: ./src/mappings/fixedrateexchange.ts
entities: entities:
@ -109,7 +109,7 @@ dataSources:
startBlock: 14275634 startBlock: 14275634
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/dispenser.ts file: ./src/mappings/dispenser.ts
entities: entities:
@ -138,7 +138,7 @@ templates:
abi: Pool abi: Pool
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/pool.ts file: ./src/mappings/pool.ts
entities: entities:
@ -197,7 +197,7 @@ templates:
abi: DataToken abi: DataToken
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/datatoken.ts file: ./src/mappings/datatoken.ts
entities: entities:

View File

@ -13,7 +13,7 @@ dataSources:
startBlock: 7298806 startBlock: 7298806
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/factory.ts file: ./src/mappings/factory.ts
entities: entities:
@ -33,7 +33,7 @@ dataSources:
startBlock: 7298804 startBlock: 7298804
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/dtfactory.ts file: ./src/mappings/dtfactory.ts
entities: entities:
@ -53,7 +53,7 @@ dataSources:
startBlock: 7298808 startBlock: 7298808
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/metadata.ts file: ./src/mappings/metadata.ts
entities: entities:
@ -75,7 +75,7 @@ dataSources:
startBlock: 7298808 startBlock: 7298808
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/fixedrateexchange.ts file: ./src/mappings/fixedrateexchange.ts
entities: entities:
@ -109,7 +109,7 @@ dataSources:
startBlock: 8554110 startBlock: 8554110
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/dispenser.ts file: ./src/mappings/dispenser.ts
entities: entities:
@ -138,7 +138,7 @@ templates:
abi: Pool abi: Pool
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/pool.ts file: ./src/mappings/pool.ts
entities: entities:
@ -197,7 +197,7 @@ templates:
abi: DataToken abi: DataToken
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/datatoken.ts file: ./src/mappings/datatoken.ts
entities: entities:

View File

@ -13,7 +13,7 @@ dataSources:
startBlock: 9227587 startBlock: 9227587
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/factory.ts file: ./src/mappings/factory.ts
entities: entities:
@ -33,7 +33,7 @@ dataSources:
startBlock: 9227578 startBlock: 9227578
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/dtfactory.ts file: ./src/mappings/dtfactory.ts
entities: entities:
@ -53,7 +53,7 @@ dataSources:
startBlock: 9227595 startBlock: 9227595
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/metadata.ts file: ./src/mappings/metadata.ts
entities: entities:
@ -75,7 +75,7 @@ dataSources:
startBlock: 9227595 startBlock: 9227595
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/fixedrateexchange.ts file: ./src/mappings/fixedrateexchange.ts
entities: entities:
@ -109,7 +109,7 @@ dataSources:
startBlock: 10201082 startBlock: 10201082
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/dispenser.ts file: ./src/mappings/dispenser.ts
entities: entities:
@ -138,7 +138,7 @@ templates:
abi: Pool abi: Pool
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/pool.ts file: ./src/mappings/pool.ts
entities: entities:
@ -197,7 +197,7 @@ templates:
abi: DataToken abi: DataToken
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/datatoken.ts file: ./src/mappings/datatoken.ts
entities: entities:

View File

@ -13,7 +13,7 @@ dataSources:
startBlock: 11105585 startBlock: 11105585
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/factory.ts file: ./src/mappings/factory.ts
entities: entities:
@ -33,7 +33,7 @@ dataSources:
startBlock: 11105560 startBlock: 11105560
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/dtfactory.ts file: ./src/mappings/dtfactory.ts
entities: entities:
@ -53,7 +53,7 @@ dataSources:
startBlock: 11105610 startBlock: 11105610
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/metadata.ts file: ./src/mappings/metadata.ts
entities: entities:
@ -75,7 +75,7 @@ dataSources:
startBlock: 11105610 startBlock: 11105610
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/fixedrateexchange.ts file: ./src/mappings/fixedrateexchange.ts
entities: entities:
@ -109,7 +109,7 @@ dataSources:
startBlock: 12398958 startBlock: 12398958
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/dispenser.ts file: ./src/mappings/dispenser.ts
entities: entities:
@ -138,7 +138,7 @@ templates:
abi: Pool abi: Pool
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/pool.ts file: ./src/mappings/pool.ts
entities: entities:
@ -197,7 +197,7 @@ templates:
abi: DataToken abi: DataToken
mapping: mapping:
kind: ethereum/events kind: ethereum/events
apiVersion: 0.0.4 apiVersion: 0.0.5
language: wasm/assemblyscript language: wasm/assemblyscript
file: ./src/mappings/datatoken.ts file: ./src/mappings/datatoken.ts
entities: entities: