* refactor contracts usage

* add docker support for barge

* add tests
pull/318/head
Alex Coseru 10 months ago committed by GitHub
parent 01e2a33021
commit f04fe156ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      .dockerignore
  2. 55
      .github/workflows/tests.yml
  3. 9
      Dockerfile
  4. 22
      README.md
  5. 398
      abis/BFactory.json
  6. 314
      abis/BMath.json
  7. 1757
      abis/BPool.json
  8. 489
      abis/BToken.json
  9. 371
      abis/Dispenser.json
  10. 234
      abis/ERC20Roles.json
  11. 1554
      abis/ERC20Template.json
  12. 1693
      abis/ERC20TemplateEnterprise.json
  13. 1273
      abis/ERC721Factory.json
  14. 1616
      abis/ERC721Template.json
  15. 1420
      abis/FactoryRouter.json
  16. 930
      abis/FixedRateExchange.json
  17. 17
      docker-entrypoint.sh
  18. 67214
      package-lock.json
  19. 46
      package.json
  20. 57
      scripts/generatebargesubgraph.js
  21. 47
      scripts/generatenetworkssubgraphs.js
  22. 55
      scripts/subgraph.yaml
  23. 213
      subgraph.bsc.yaml
  24. 213
      subgraph.catenaxtestnet.yaml
  25. 213
      subgraph.celoalfajores.yaml
  26. 213
      subgraph.energyweb.yaml
  27. 213
      subgraph.gaiaxtestnet.yaml
  28. 207
      subgraph.moonbeamalpha.yaml
  29. 213
      subgraph.moonriver.yaml
  30. 207
      subgraph.mumbai.yaml
  31. 213
      subgraph.polygon.yaml
  32. 213
      subgraph.ropsten.yaml
  33. 53
      subgraph.yaml
  34. 44
      test/integration/Datatokens.test.ts
  35. 235
      test/integration/Dispenser.test.ts
  36. 193
      test/integration/SimplePublishConsume.test.ts

@ -0,0 +1,7 @@
node_modules
contracts
.env.local
.env
build
coverage
__mocks__

@ -15,47 +15,56 @@ jobs:
max-parallel: 1
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Cache node modules
- name: Cache node_modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-lint-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-lint-${{ env.cache-name }}-
key: ${{ runner.os }}-test-integration-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-test-integration-${{ env.cache-name }}-
- uses: actions/checkout@v2
name: Checkout Barge
# Env var expansion workaround
# https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
- name: Set ADDRESS_FILE
run: echo "ADDRESS_FILE=${HOME}/.ocean/ocean-contracts/artifacts/address.json" >> $GITHUB_ENV
- name: Checkout Barge
uses: actions/checkout@v2
with:
repository: 'oceanprotocol/barge'
path: 'barge'
- run: npm ci
ref: v4
- name: Login to Docker Hub
if: ${{ env.DOCKERHUB_PASSWORD && env.DOCKERHUB_USERNAME }}
run: |
echo "Login to Docker Hub";echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Run Barge
working-directory: ${{ github.workspace }}/barge
env:
ADDRESS_FILE: ${HOME}/.ocean/ocean-contracts/artifacts/address.json
run: |
bash -x start_ocean.sh --with-thegraph --no-dashboard 2>&1 > start_ocean.log &
for i in $(seq 1 1500); do
sleep 5
bash -x start_ocean.sh --with-thegraph --skip-subgraph-deploy --no-dashboard 2>&1 > start_ocean.log &
- run: npm ci
- name: Wait for contracts deployment
working-directory: ${{ github.workspace }}/barge
run: |
for i in $(seq 1 250); do
sleep 10
[ -f "$HOME/.ocean/ocean-contracts/artifacts/ready" ] && break
done
cat "$HOME/.ocean/ocean-contracts/artifacts/address.json"
- run: npm run bargesetup
env:
ADDRESS_FILE: /home/runner/.ocean/ocean-contracts/artifacts/address.json
- name: create and deploy subgraph
run: |
npm run codegen
npm run build
npm run create:local-barge
npm run deploy:local-barge
npm run quickstart:development
sleep 20
env:
ADDRESS_FILE: /home/runner/.ocean/ocean-contracts/artifacts/address.json

@ -0,0 +1,9 @@
FROM node:16
COPY package*.json /usr/src/app/
WORKDIR /usr/src/app
RUN npm install
COPY . /usr/src/app
ENV DEPLOY_SUBGRAPH=true
ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh"]

@ -137,27 +137,35 @@ cd ocean-subgraph
npm i
```
3. Let the components know where to pickup the smart contract addresses:
3. If you use barge, then let the components know where to pickup the smart contract addresses. For production networks, skip this step
```
export ADDRESS_FILE="${HOME}/.ocean/ocean-contracts/artifacts/address.json"
```
4. Generate the subgraph
4. Generate the subgraphs
```bash
node ./scripts/generatenetworkssubgraphs.js
npm run codegen
npm run bargesetup
```
5. To deploy a subgraph connected to Barge, use:
To generate subgraph for just one network, add the network name as parameter
```bash
node ./scripts/generatenetworkssubgraphs.js rinkeby
```
5. To deploy a subgraph use:
npm run create:local-[network]
npm run deploy:local-[network]
```bash
npm run create:local-barge
npm run deploy:local-barge
npm run create:local-development
npm run deploy:local-development
```
- Alternatively, if you want to get the sub-graph quickly running on barge, you can run `npm run quickstart:barge` which combines steps 3-5 above.
You now have a local graph-node running on http://localhost:9000
You now have a local graph-node running on http://127.0.0.1:9000/subgraphs/name/oceanprotocol/ocean-subgraph/graphql

File diff suppressed because one or more lines are too long

@ -1,314 +0,0 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "BMath",
"sourceName": "contracts/pools/balancer/BMath.sol",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "swapFeeAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "oceanFeeAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "marketFeeAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "address",
"name": "tokenFees",
"type": "address"
}
],
"name": "SWAP_FEES",
"type": "event"
},
{
"inputs": [],
"name": "BONE",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "BPOW_PRECISION",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "EXIT_FEE",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "INIT_POOL_SUPPLY",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MAX_BOUND_TOKENS",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MAX_BPOW_BASE",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MAX_FEE",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MAX_IN_RATIO",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MAX_OUT_RATIO",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MAX_TOTAL_WEIGHT",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MAX_WEIGHT",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MIN_BALANCE",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MIN_BOUND_TOKENS",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MIN_BPOW_BASE",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MIN_FEE",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MIN_WEIGHT",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_swapPublishMarketFee",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "communityFees",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getOPCFee",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "publishMarketFees",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x608060405234801561001057600080fd5b50610451806100206000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c8063992e2a92116100ad578063bc694ea211610071578063bc694ea2146101eb578063c36596a614610153578063c6580d12146101f3578063e4a28a5214610131578063ec093021146101fb57600080fd5b8063992e2a92146101cb578063b0e0d136146101d3578063b7b800a4146101d3578063ba019dab146101db578063bc063e1a146101e357600080fd5b806376c7a3c7116100f457806376c7a3c71461018a5780637a284be4146101925780637c5918b31461019b578063867378c5146101bb5780639381cd2b146101c357600080fd5b806309a3bbe414610131578063189d00ca1461014b578063218b53821461015357806329b88a6a14610162578063300621921461016a575b600080fd5b610139610203565b60405190815260200160405180910390f35b610139610219565b610139670de0b6b3a764000081565b610139610230565b61013961017836600461034c565b60056020526000908152604090205481565b6101396102aa565b61013960005481565b6101396101a936600461034c565b60066020526000908152604090205481565b6101396102bf565b6101396102d6565b6101396102e9565b610139600281565b610139600181565b610139610307565b61013961031a565b610139600081565b610139610339565b610216670de0b6b3a76400006032610392565b81565b6102166402540be400670de0b6b3a76400006103b1565b6002546004805460405163b8421e2b60e01b81526001600160a01b0391821692810192909252600092169063b8421e2b90602401602060405180830381865afa158015610281573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a591906103d3565b905090565b610216620f4240670de0b6b3a76400006103b1565b61021664e8d4a51000670de0b6b3a76400006103b1565b610216670de0b6b3a76400006064610392565b6102fc6003670de0b6b3a76400006103b1565b6102169060016103ec565b610216600a670de0b6b3a76400006103b1565b600161032f670de0b6b3a76400006002610392565b6102169190610404565b6102166002670de0b6b3a76400006103b1565b60006020828403121561035e57600080fd5b81356001600160a01b038116811461037557600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156103ac576103ac61037c565b500290565b6000826103ce57634e487b7160e01b600052601260045260246000fd5b500490565b6000602082840312156103e557600080fd5b5051919050565b600082198211156103ff576103ff61037c565b500190565b6000828210156104165761041661037c565b50039056fea2646970667358221220bb7675d200528b1ac138059c595a95fd2adb2b36b61e0bac3f6baeafc4fc887c64736f6c634300080a0033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061012c5760003560e01c8063992e2a92116100ad578063bc694ea211610071578063bc694ea2146101eb578063c36596a614610153578063c6580d12146101f3578063e4a28a5214610131578063ec093021146101fb57600080fd5b8063992e2a92146101cb578063b0e0d136146101d3578063b7b800a4146101d3578063ba019dab146101db578063bc063e1a146101e357600080fd5b806376c7a3c7116100f457806376c7a3c71461018a5780637a284be4146101925780637c5918b31461019b578063867378c5146101bb5780639381cd2b146101c357600080fd5b806309a3bbe414610131578063189d00ca1461014b578063218b53821461015357806329b88a6a14610162578063300621921461016a575b600080fd5b610139610203565b60405190815260200160405180910390f35b610139610219565b610139670de0b6b3a764000081565b610139610230565b61013961017836600461034c565b60056020526000908152604090205481565b6101396102aa565b61013960005481565b6101396101a936600461034c565b60066020526000908152604090205481565b6101396102bf565b6101396102d6565b6101396102e9565b610139600281565b610139600181565b610139610307565b61013961031a565b610139600081565b610139610339565b610216670de0b6b3a76400006032610392565b81565b6102166402540be400670de0b6b3a76400006103b1565b6002546004805460405163b8421e2b60e01b81526001600160a01b0391821692810192909252600092169063b8421e2b90602401602060405180830381865afa158015610281573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a591906103d3565b905090565b610216620f4240670de0b6b3a76400006103b1565b61021664e8d4a51000670de0b6b3a76400006103b1565b610216670de0b6b3a76400006064610392565b6102fc6003670de0b6b3a76400006103b1565b6102169060016103ec565b610216600a670de0b6b3a76400006103b1565b600161032f670de0b6b3a76400006002610392565b6102169190610404565b6102166002670de0b6b3a76400006103b1565b60006020828403121561035e57600080fd5b81356001600160a01b038116811461037557600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156103ac576103ac61037c565b500290565b6000826103ce57634e487b7160e01b600052601260045260246000fd5b500490565b6000602082840312156103e557600080fd5b5051919050565b600082198211156103ff576103ff61037c565b500190565b6000828210156104165761041661037c565b50039056fea2646970667358221220bb7675d200528b1ac138059c595a95fd2adb2b36b61e0bac3f6baeafc4fc887c64736f6c634300080a0033",
"linkReferences": {},
"deployedLinkReferences": {}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,234 +0,0 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "ERC20Roles",
"sourceName": "contracts/utils/ERC20Roles.sol",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "user",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "signer",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "AddedMinter",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "user",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "signer",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "AddedPaymentManager",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "signer",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "CleanedPermissions",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "user",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "signer",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "RemovedMinter",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "user",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "signer",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "RemovedPaymentManager",
"type": "event"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "authERC20",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "user",
"type": "address"
}
],
"name": "getPermissions",
"outputs": [
{
"components": [
{
"internalType": "bool",
"name": "minter",
"type": "bool"
},
{
"internalType": "bool",
"name": "paymentManager",
"type": "bool"
}
],
"internalType": "struct ERC20Roles.RolesERC20",
"name": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "permissions",
"outputs": [
{
"internalType": "bool",
"name": "minter",
"type": "bool"
},
{
"internalType": "bool",
"name": "paymentManager",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x608060405234801561001057600080fd5b506101df806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806301e8820814610046578063160a79251461008e578063ef867ff41461010b575b600080fd5b610072610054366004610160565b60006020819052908152604090205460ff8082169161010090041682565b6040805192151583529015156020830152015b60405180910390f35b6100ec61009c366004610160565b6040805180820190915260008082526020820152506001600160a01b03166000908152602081815260409182902082518084019093525460ff808216151584526101009091041615159082015290565b6040805182511515815260209283015115159281019290925201610085565b61011e610119366004610190565b610136565b6040516001600160a01b039091168152602001610085565b6001818154811061014657600080fd5b6000918252602090912001546001600160a01b0316905081565b60006020828403121561017257600080fd5b81356001600160a01b038116811461018957600080fd5b9392505050565b6000602082840312156101a257600080fd5b503591905056fea2646970667358221220ccf3df6db224ddd4890801a3179ede2341d3b79e67297621cef6008f522b4b9e64736f6c634300080a0033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c806301e8820814610046578063160a79251461008e578063ef867ff41461010b575b600080fd5b610072610054366004610160565b60006020819052908152604090205460ff8082169161010090041682565b6040805192151583529015156020830152015b60405180910390f35b6100ec61009c366004610160565b6040805180820190915260008082526020820152506001600160a01b03166000908152602081815260409182902082518084019093525460ff808216151584526101009091041615159082015290565b6040805182511515815260209283015115159281019290925201610085565b61011e610119366004610190565b610136565b6040516001600160a01b039091168152602001610085565b6001818154811061014657600080fd5b6000918252602090912001546001600160a01b0316905081565b60006020828403121561017257600080fd5b81356001600160a01b038116811461018957600080fd5b9392505050565b6000602082840312156101a257600080fd5b503591905056fea2646970667358221220ccf3df6db224ddd4890801a3179ede2341d3b79e67297621cef6008f522b4b9e64736f6c634300080a0033",
"linkReferences": {},
"deployedLinkReferences": {}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,17 @@
#!/bin/bash
# default to true in case it is not set
DEPLOY_SUBGRAPH="${DEPLOY_SUBGRAPH:-true}"
echo "deploy subgraph is ${DEPLOY_SUBGRAPH}"
if [ "${DEPLOY_SUBGRAPH}" = "true" ]
then
echo "Waiting for contracts to be deployed"
while [ ! -f "/ocean-contracts/artifacts/ready" ]; do
sleep 2
done
export ADDRESS_FILE="/ocean-contracts/artifacts/address.json"
/usr/src/app/
npm run quickstart:barge
fi
tail -f /dev/null

67214
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -3,11 +3,12 @@
"version": "1.2.0",
"scripts": {
"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",
"bargesetup": "node ./scripts/generatebargesubgraph.js",
"quickstart:development": "node ./scripts/generatenetworkssubgraphs.js development && npm run codegen && npm run create:local-development && npm run deploy:local-development",
"quickstart:barge": "node ./scripts/generatenetworkssubgraphs.js development && npm run codegen && npm run create:local-barge && npm run deploy:local-barge",
"create": "graph create oceanprotocol/ocean-subgraph --node https://api.thegraph.com/deploy/",
"create:local": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
"create:local-barge": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:9020",
"create:local-development": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:9020",
"create:local-barge": "graph create oceanprotocol/ocean-subgraph --node http://172.15.0.15:8020",
"create:local-rinkeby": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
"create:local-ropsten": "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",
@ -21,32 +22,35 @@
"create:local-moonriver": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
"codegen": "graph codegen --output-dir src/@types",
"build": "graph build",
"deploy": "graph deploy oceanprotocol/ocean-subgraph --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy:beta": "graph deploy oceanprotocol/ocean-subgraph-beta --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy:local": "graph deploy oceanprotocol/ocean-subgraph subgraph.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"deploy:local-barge": "graph deploy oceanprotocol/ocean-subgraph subgraph.barge.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:9020",
"deploy:local-rinkeby": "graph deploy oceanprotocol/ocean-subgraph subgraph.rinkeby.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"deploy:local-ropsten": "graph deploy oceanprotocol/ocean-subgraph subgraph.ropsten.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-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-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",
"xx": "graph deploy --help",
"deploy": "graph deploy oceanprotocol/ocean-subgraph -l $npm_package_version --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy:beta": "graph deploy oceanprotocol/ocean-subgraph-beta -l $npm_package_version --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy:local": "graph deploy oceanprotocol/ocean-subgraph subgraph.yaml -l $npm_package_version --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"deploy:local-development": "graph deploy oceanprotocol/ocean-subgraph subgraph.yaml -l $npm_package_version --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:9020",
"deploy:local-barge": "graph deploy oceanprotocol/ocean-subgraph subgraph.yaml -l $npm_package_version --debug --ipfs http://172.15.0.16:5001 --node http://172.15.0.15:8020",
"deploy:local-rinkeby": "graph deploy oceanprotocol/ocean-subgraph subgraph.rinkeby.yaml -l $npm_package_version --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"deploy:local-ropsten": "graph deploy oceanprotocol/ocean-subgraph subgraph.ropsten.yaml -l $npm_package_version --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 -l $npm_package_version --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 -l $npm_package_version --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 -l $npm_package_version --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 -l $npm_package_version --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 -l $npm_package_version --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 -l $npm_package_version --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 -l $npm_package_version --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 -l $npm_package_version --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 -l $npm_package_version --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-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:fix": "eslint --ignore-path .gitignore --ext .js,.ts,.tsx . --fix",
"format": "prettier --ignore-path .gitignore './**/*.{css,yml,js,ts,tsx,json,yaml}' --write",
"type-check": "tsc --noEmit",
"release": "release-it --non-interactive",
"changelog": "auto-changelog -p"
},
"devDependencies": {
"@graphprotocol/graph-cli": "^0.22.4",
"@graphprotocol/graph-ts": "^0.22.1",
"@graphprotocol/graph-cli": "^0.26.0",
"@graphprotocol/graph-ts": "^0.24.1",
"@types/chai": "^4.2.22",
"@types/chai-spies": "^1.0.3",
"@types/mocha": "^9.0.0",
@ -70,7 +74,7 @@
"typescript": "^4.4.3"
},
"dependencies": {
"@oceanprotocol/lib": "^0.19.2",
"@oceanprotocol/lib": "^1.0.0-next.15",
"cross-fetch": "^3.1.4"
},
"repository": {

@ -1,57 +0,0 @@
/* eslint-disable no-unused-vars */
var fs = require('fs')
async function replaceContractAddresses() {
// load barge addresses first
try {
// const data = JSON.parse(
// fs.readFileSync(
// '/home/mihai/.ocean/ocean-contracts/artifacts/address.json',
// 'utf8'
// )
// )
// const {
// DTFactory,
// // eslint-disable-next-line no-unused-vars
// ERC721Factory
// } = data.development
// let subgraph = fs.readFileSync('subgraph.yaml', 'utf8')
// if (!data) {
// return false
// }
const ERC721Factory = '0x0599a4a2873B38D836E10302De1ca4834F7BDF4E'
const FixedRateExchange = '0x2356DeCd8CFB6c6f2bf46b5ED4531818B4662337'
const Dispenser = '0xb119b8895801111ff323ba63a77D4Fe78ED057a5'
// ERC721Factory
subgraph = subgraph.replace(
/0x0599a4a2873B38D836E10302De1ca4834F7BDF4E/g,
ERC721Factory
)
subgraph = subgraph.replace(
/0x2356DeCd8CFB6c6f2bf46b5ED4531818B4662337/g,
FixedRateExchange
)
subgraph = subgraph.replace(
/0xb119b8895801111ff323ba63a77D4Fe78ED057a5/g,
Dispenser
)
// network
subgraph = subgraph.replace(/network: mainnet/g, 'network: barge')
// startBlocks
subgraph = subgraph.replace(/startBlock:[ 0-9].*/g, 'startBlock: 0')
fs.writeFileSync('subgraph.barge.yaml', subgraph, 'utf8')
} catch (e) {
console.error('Failed to load address.json')
console.error(e)
process.exit(1)
}
}
replaceContractAddresses()

@ -0,0 +1,47 @@
/* eslint-disable no-unused-vars */
var fs = require('fs')
var addresses = require('@oceanprotocol/contracts/addresses/address.json')
async function replaceContractAddresses() {
// load addresses file first
if (process.env.ADDRESS_FILE) {
console.log('Using custom ADDRESS_FILE instead of ocean-contracts npm dep')
addresses = JSON.parse(fs.readFileSync(process.env.ADDRESS_FILE, 'utf8'))
}
console.log(process.argv)
for (const network in addresses) {
if (process.argv[2] && process.argv[2] != network) {
console.log('Skipping ' + network)
continue
}
console.log('Creating subgraph.' + network + '.yaml')
let subgraph = fs.readFileSync('./scripts/subgraph.yaml', 'utf8')
subgraph = subgraph.replace(/__NETWORK__/g, network)
subgraph = subgraph.replace(
/__STARTBLOCK__/g,
addresses[network].startBlock
)
subgraph = subgraph.replace(
/__ERC721FACTORYADDRESS__/g,
"'" + addresses[network].ERC721Factory + "'"
)
subgraph = subgraph.replace(
/__FIXEDRATEEXCHANGEADDRESS__/g,
"'" + addresses[network].FixedPrice + "'"
)
subgraph = subgraph.replace(
/__DISPENSERADDRESS__/g,
"'" + addresses[network].FixedPrice + "'"
)
subgraph = subgraph.replace(
/__FACTORYROUTERADDRESS__/g,
"'" + addresses[network].Router + "'"
)
if (network != 'development')
fs.writeFileSync('subgraph.' + network + '.yaml', subgraph, 'utf8')
else fs.writeFileSync('subgraph.yaml', subgraph, 'utf8')
}
}
replaceContractAddresses()

@ -6,11 +6,11 @@ schema:
dataSources:
- kind: ethereum/contract
name: ERC721Factory
network: rinkeby
network: __NETWORK__
source:
address: '0xD9b5488363463E3689C1430030F5A17b427718E1'
address: __ERC721FACTORYADDRESS__
abi: ERC721Factory
startBlock: 10065057
startBlock: __STARTBLOCK__
mapping:
kind: ethereum/events
apiVersion: 0.0.6
@ -20,7 +20,7 @@ dataSources:
- ERC721Factory
abis:
- name: ERC721Factory
file: ./abis/ERC721Factory.json
file: ./node_modules/@oceanprotocol/contracts/artifacts/contracts/ERC721Factory.sol/ERC721Factory.json
eventHandlers:
- event: NFTCreated(indexed address,indexed address,string,address,string,string)
handler: handleNftCreated
@ -28,11 +28,11 @@ dataSources:
handler: handleNewToken
- kind: ethereum/contract
name: FixedRateExchange
network: rinkeby
network: __NETWORK__
source:
address: '0xdf29DA8FF979170eBfEd7133068dA247dc04CdC9'
address: __FIXEDRATEEXCHANGEADDRESS__
abi: FixedRateExchange
startBlock: 10065057
startBlock: __STARTBLOCK__
mapping:
kind: ethereum/events
apiVersion: 0.0.6
@ -42,7 +42,7 @@ dataSources:
- FixedRateExchange
abis:
- name: FixedRateExchange
file: ./abis/FixedRateExchange.json
file: ./node_modules/@oceanprotocol/contracts/artifacts/contracts/pools/fixedRate/FixedRateExchange.sol/FixedRateExchange.json
- name: ERC20
file: ./abis/ERC20.json
eventHandlers:
@ -62,11 +62,11 @@ dataSources:
handler: handleSwap
- kind: ethereum/contract
name: Dispenser
network: rinkeby
network: __NETWORK__
source:
address: '0x5FfDe8179E095803de22CBe1D405Eeef18406852'
address: __DISPENSERADDRESS__
abi: Dispenser
startBlock: 10065057
startBlock: __STARTBLOCK__
mapping:
kind: ethereum/events
apiVersion: 0.0.6
@ -76,7 +76,7 @@ dataSources:
- Dispenser
abis:
- name: Dispenser
file: ./abis/Dispenser.json
file: ./node_modules/@oceanprotocol/contracts/artifacts/contracts/pools/dispenser/Dispenser.sol/Dispenser.json
eventHandlers:
- event: DispenserCreated(indexed address,indexed address,uint256,uint256,address)
handler: handleNewDispenser
@ -93,11 +93,11 @@ dataSources:
- kind: ethereum/contract
name: FactoryRouter
network: rinkeby
network: __NETWORK__
source:
address: '0x5De02B776106d0dC81d4335f58E29ECaE717e90A'
address: __FACTORYROUTERADDRESS__
abi: FactoryRouter
startBlock: 10065057
startBlock: __STARTBLOCK__
mapping:
kind: ethereum/events
apiVersion: 0.0.6
@ -107,7 +107,7 @@ dataSources:
- FactoryRouter
abis:
- name: FactoryRouter
file: ./abis/FactoryRouter.json
file: ./node_modules/@oceanprotocol/contracts/artifacts/contracts/pools/FactoryRouter.sol/FactoryRouter.json
eventHandlers:
- event: NewPool(indexed address,bool)
handler: handleNewPool
@ -115,7 +115,7 @@ dataSources:
templates:
- name: ERC20Template
kind: ethereum/contract
network: rinkeby
network: __NETWORK__
source:
abi: ERC20Template
mapping:
@ -127,13 +127,13 @@ templates:
- ERC20Template
abis:
- name: ERC20Template
file: ./abis/ERC20Template.json
file: ./node_modules/@oceanprotocol/contracts/artifacts/contracts/templates/ERC20Template.sol/ERC20Template.json
- name: ERC20TemplateEnterprise
file: ./abis/ERC20TemplateEnterprise.json
file: ./node_modules/@oceanprotocol/contracts/artifacts/contracts/templates/ERC20TemplateEnterprise.sol/ERC20TemplateEnterprise.json
- name: ERC20
file: ./abis/ERC20.json
- name: ERC20Roles
file: ./abis/ERC20Roles.json
file: ./node_modules/@oceanprotocol/contracts/artifacts/contracts/utils/ERC20Roles.sol/ERC20Roles.json
eventHandlers:
- event: OrderStarted(indexed address,address,uint256,uint256,uint256,indexed address,uint256)
handler: handleOrderStarted
@ -144,7 +144,7 @@ templates:
- name: BPool
kind: ethereum/contract
network: rinkeby
network: __NETWORK__
source:
abi: BPool
mapping:
@ -156,11 +156,11 @@ templates:
- BPool
abis:
- name: BPool
file: ./abis/BPool.json
file: ./node_modules/@oceanprotocol/contracts/artifacts/contracts/pools/balancer/BPool.sol/BPool.json
- name: BToken
file: ./abis/BToken.json
file: ./node_modules/@oceanprotocol/contracts/artifacts/contracts/pools/balancer/BToken.sol/BToken.json
- name: BMath
file: ./abis/BMath.json
file: ./node_modules/@oceanprotocol/contracts/artifacts/contracts/pools/balancer/BMath.sol/BMath.json
- name: ERC20
file: ./abis/ERC20.json
eventHandlers:
@ -174,9 +174,10 @@ templates:
handler: handleSetup
- event: Transfer(indexed address,indexed address,uint256)
handler: handlerBptTransfer
- name: ERC721Template
kind: ethereum/contract
network: rinkeby
network: __NETWORK__
source:
abi: ERC721Template
mapping:
@ -188,7 +189,9 @@ templates:
- ERC721Template
abis:
- name: ERC721Template
file: ./abis/ERC721Template.json
file: ./node_modules/@oceanprotocol/contracts/artifacts/contracts/templates/ERC721Template.sol/ERC721Template.json
- name: ERC721RolesAddress
file: ./node_modules/@oceanprotocol/contracts/artifacts/contracts/utils/ERC721RolesAddress.sol/ERC721RolesAddress.json
eventHandlers:
- event: MetadataCreated(indexed address,uint8,string,bytes,bytes,bytes32,uint256,uint256)
handler: handleCreated

@ -1,213 +0,0 @@
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: bsc
source:
address: '0xc313e19146Fc9a04470689C9d41a4D3054693531'
abi: Factory
startBlock: 8114772
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: bsc
source:
address: '0xE9397625Df9B63f0C152f975234b7988b54710B8'
abi: DTFactory
startBlock: 8114772
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: bsc
source:
address: '0x1d535147a97bd87c8443125376E6671B60556E07'
abi: Metadata
startBlock: 8114772
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: bsc
source:
address: '0x98679D582AB3398C03D3308dEB9c7AeC50B52ded'
abi: FixedRateExchange
startBlock: 8114772
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: bsc
source:
address: '0xFe7967A5176fDAFa8DE109b3507016B885a82D6e'
abi: Dispenser
startBlock: 8114772
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: bsc
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: bsc
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

@ -1,213 +0,0 @@
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: