@graphprotocol/graph-cli 0.23.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +83 -0
  2. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/.travis.yml +4 -0
  3. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/README.md +83 -0
  4. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/chain/ethereum.ts +12 -16
  5. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/chain/near.ts +402 -0
  6. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/common/collections.ts +125 -4
  7. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/common/eager_offset.ts +2 -1
  8. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/common/json.ts +14 -0
  9. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/common/numbers.ts +58 -16
  10. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/common/value.ts +2 -5
  11. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/global/global.ts +108 -0
  12. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/helper-functions.ts +5 -5
  13. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/index.ts +6 -15
  14. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/package.json +5 -7
  15. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/test/bigInt.ts +138 -108
  16. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/test/bytes.ts +31 -20
  17. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/test/test.js +120 -88
  18. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/tsconfig.json +2 -2
  19. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/types/tsconfig.base.json +3 -0
  20. package/examples/basic-event-handlers/package.json +1 -1
  21. package/examples/basic-event-handlers/yarn.lock +4 -4
  22. package/examples/example-subgraph/package.json +1 -1
  23. package/examples/example-subgraph/yarn.lock +4 -4
  24. package/jest.config.js +2 -2
  25. package/package.json +2 -6
  26. package/src/commands/init.js +31 -3
  27. package/src/commands/test.js +37 -27
  28. package/src/migrations/mapping_api_version_0_0_5.js +74 -0
  29. package/src/scaffold.js +18 -2
  30. package/tests/cli/globalSetup.js +6 -0
  31. package/tests/cli/globalTeardown.js +6 -0
  32. package/tests/cli/init.test.js +1 -1
  33. package/tests/cli/util.js +17 -8
  34. package/tests/cli/init/from-contract/abis/Contract.json +0 -69
  35. package/tests/cli/init/from-contract/package.json +0 -16
  36. package/tests/cli/init/from-contract/schema.graphql +0 -6
  37. package/tests/cli/init/from-contract/src/mapping.ts +0 -49
  38. package/tests/cli/init/from-contract/subgraph.yaml +0 -26
@@ -257,16 +257,25 @@ const loadAbiFromBlockScout = async (network, address) =>
257
257
  },
258
258
  )
259
259
 
260
+ const getEtherscanLikeAPIUrl = (network) => {
261
+ switch(network){
262
+ case "mainnet": return `https://api.etherscan.io/api`;
263
+ case "bsc": return `https://api.bscscan.com/api`;
264
+ case "matic": return `https://api.polygonscan.com/api`;
265
+ case "mumbai": return `https://api-testnet.polygonscan.com/api`;
266
+ default: return `https://api-${network}.etherscan.io/api`;
267
+ }
268
+ }
269
+
260
270
  const loadAbiFromEtherscan = async (network, address) =>
261
271
  await withSpinner(
262
272
  `Fetching ABI from Etherscan`,
263
273
  `Failed to fetch ABI from Etherscan`,
264
274
  `Warnings while fetching ABI from Etherscan`,
265
275
  async spinner => {
276
+ const scanApiUrl = getEtherscanLikeAPIUrl(network);
266
277
  let result = await fetch(
267
- `https://${
268
- network === 'mainnet' ? 'api' : `api-${network}`
269
- }.etherscan.io/api?module=contract&action=getabi&address=${address}`,
278
+ `${scanApiUrl}?module=contract&action=getabi&address=${address}`,
270
279
  )
271
280
  let json = await result.json()
272
281
 
@@ -530,12 +539,26 @@ const initRepository = async (toolbox, directory) =>
530
539
  },
531
540
  )
532
541
 
542
+ // Only used for local testing / continuous integration.
543
+ //
544
+ // This requires that the command `npm link` is called
545
+ // on the root directory of this repository, as described here:
546
+ // https://docs.npmjs.com/cli/v7/commands/npm-link.
547
+ const npmLinkToLocalCli = async (toolbox, directory) => {
548
+ if (process.env.GRAPH_CLI_TESTS) {
549
+ await toolbox.system.run('npm link @graphprotocol/graph-cli', { cwd: directory })
550
+ }
551
+ }
552
+
533
553
  const installDependencies = async (toolbox, directory, installCommand) =>
534
554
  await withSpinner(
535
555
  `Install dependencies with ${toolbox.print.colors.muted(installCommand)}`,
536
556
  `Failed to install dependencies`,
537
557
  `Warnings while installing dependencies`,
538
558
  async spinner => {
559
+ // Links to local graph-cli if we're running the automated tests
560
+ await npmLinkToLocalCli(toolbox, directory)
561
+
539
562
  await toolbox.system.run(installCommand, { cwd: directory })
540
563
  return true
541
564
  },
@@ -643,6 +666,11 @@ const initSubgraphFromExample = async (
643
666
  delete pkgJson['license']
644
667
  delete pkgJson['repository']
645
668
 
669
+ // Remove example's cli in favor of the local one (added via `npm link`)
670
+ if (process.env.GRAPH_CLI_TESTS) {
671
+ delete pkgJson['devDependencies']['@graphprotocol/graph-cli']
672
+ }
673
+
646
674
  // Write package.json
647
675
  await filesystem.write(pkgJsonFilename, pkgJson, { jsonIndent: 2 })
648
676
  return true
@@ -11,6 +11,7 @@ ${chalk.dim('Options:')}
11
11
 
12
12
  -f --force Overwrite folder + file when downloading
13
13
  -h, --help Show usage information
14
+ -l, --logs Logs to the console information about the OS, CPU model and download url (debugging purposes)
14
15
  -v, --version <tag> Choose the version of the rust binary that you want to be downloaded/used
15
16
  `
16
17
 
@@ -21,12 +22,13 @@ module.exports = {
21
22
  let { print } = toolbox
22
23
 
23
24
  // Read CLI parameters
24
- let { f, force, h, help, v, version } = toolbox.parameters.options
25
+ let { f, force, h, help, l, logs, v, version } = toolbox.parameters.options
25
26
  let datasource = toolbox.parameters.first
26
27
 
27
28
  // Support both long and short option variants
28
29
  force = force || f
29
30
  help = help || h
31
+ logs = logs || l
30
32
  version = version || v
31
33
 
32
34
  // Show help text if requested
@@ -35,48 +37,56 @@ module.exports = {
35
37
  return
36
38
  }
37
39
 
38
- const platform = getPlatform();
40
+ const platform = getPlatform(logs)
39
41
  if (!version) {
40
- let result = await fetch('https://api.github.com/repos/LimeChain/matchstick/releases/latest');
41
- let json = await result.json();
42
- version = json.tag_name;
42
+ let result = await fetch('https://api.github.com/repos/LimeChain/matchstick/releases/latest')
43
+ let json = await result.json()
44
+ version = json.tag_name
43
45
  }
44
46
 
45
- const url = `https://github.com/LimeChain/matchstick/releases/download/${version}/${platform}`;
47
+ const url = `https://github.com/LimeChain/matchstick/releases/download/${version}/${platform}`
46
48
 
47
- let binary = new Binary(platform, url, version);
48
- await binary.install(force);
49
- binary.run(datasource);
49
+ if (logs) {
50
+ console.log(`Download link: ${url}`)
51
+ }
52
+
53
+ let binary = new Binary(platform, url, version)
54
+ await binary.install(force)
55
+ datasource ? binary.run(datasource) : binary.run()
50
56
  }
51
57
  }
52
58
 
53
- function getPlatform() {
54
- const type = os.type();
55
- const arch = os.arch();
56
- const release = os.release();
57
- const cpuCore = os.cpus()[0];
58
- const majorVersion = semver.major(release);
59
- const isM1 = cpuCore.model.includes("Apple M1");
59
+ function getPlatform(logs) {
60
+ const type = os.type()
61
+ const arch = os.arch()
62
+ const release = os.release()
63
+ const cpuCore = os.cpus()[0]
64
+ const majorVersion = semver.major(release)
65
+ const isM1 = cpuCore.model.includes("Apple M1")
66
+
67
+ if (logs) {
68
+ console.log(`OS type: ${type}\nOS arch: ${arch}\nOS release: ${release}\nOS major version: ${majorVersion}\nCPU model: ${cpuCore.model}`)
69
+ }
60
70
 
61
71
  if (arch === 'x64' || (arch === 'arm64' && isM1)) {
62
72
  if (type === 'Darwin') {
63
- if (majorVersion === '19') {
64
- return 'binary-macos-10.15';
65
- } else if (majorVersion === '18') {
66
- return 'binary-macos-10.14';
73
+ if (majorVersion === 19) {
74
+ return 'binary-macos-10.15'
75
+ } else if (majorVersion === 18) {
76
+ return 'binary-macos-10.14'
67
77
  } else if (isM1) {
68
- return 'binary-macos-11-m1';
78
+ return 'binary-macos-11-m1'
69
79
  }
70
- return 'binary-macos-11';
80
+ return 'binary-macos-11'
71
81
  } else if (type === 'Linux') {
72
- if (majorVersion === '18') {
73
- return 'binary-linux-18';
82
+ if (majorVersion === 18) {
83
+ return 'binary-linux-18'
74
84
  }
75
- return 'binary-linux-20';
85
+ return 'binary-linux-20'
76
86
  } else if (type === 'Windows_NT') {
77
- return 'binary-windows';
87
+ return 'binary-windows'
78
88
  }
79
89
  }
80
90
 
81
- throw new Error(`Unsupported platform: ${type} ${arch} ${majorVersion}`);
91
+ throw new Error(`Unsupported platform: ${type} ${arch} ${majorVersion}`)
82
92
  }
@@ -0,0 +1,74 @@
1
+ const fs = require('fs-extra')
2
+ const semver = require('semver')
3
+ const toolbox = require('gluegun/toolbox')
4
+ const yaml = require('js-yaml')
5
+ const { loadManifest } = require('./util/load-manifest')
6
+ const { getGraphTsVersion } = require('./util/versions')
7
+
8
+ // If any of the manifest apiVersions are 0.0.5, replace them with 0.0.6
9
+ module.exports = {
10
+ name: 'Bump mapping apiVersion from 0.0.5 to 0.0.6',
11
+ predicate: async ({ sourceDir, manifestFile }) => {
12
+ // Obtain the graph-ts version, if possible
13
+ let graphTsVersion
14
+ try {
15
+ graphTsVersion = await getGraphTsVersion(sourceDir)
16
+ } catch (_) {
17
+ // If we cannot obtain the version, return a hint that the graph-ts
18
+ // hasn't been installed yet
19
+ return 'graph-ts dependency not installed yet'
20
+ }
21
+
22
+ let manifest = loadManifest(manifestFile)
23
+ return (
24
+ // Only migrate if the graph-ts version is >= 0.23.0...
25
+ // Coerce needed because we may be dealing with an alpha version
26
+ // and in the `semver` library this would not return true on equality.
27
+ semver.gte(semver.coerce(graphTsVersion), '0.24.0') &&
28
+ // ...and we have a manifest with mapping > apiVersion = 0.0.5
29
+ manifest &&
30
+ typeof manifest === 'object' &&
31
+ Array.isArray(manifest.dataSources) &&
32
+ (manifest.dataSources.reduce(
33
+ (hasOldMappings, dataSource) =>
34
+ hasOldMappings ||
35
+ (typeof dataSource === 'object' &&
36
+ dataSource.mapping &&
37
+ typeof dataSource.mapping === 'object' &&
38
+ dataSource.mapping.apiVersion === '0.0.5'),
39
+ false,
40
+ ) ||
41
+ (Array.isArray(manifest.templates) &&
42
+ manifest.templates.reduce(
43
+ (hasOldMappings, template) =>
44
+ hasOldMappings ||
45
+ (typeof template === 'object' &&
46
+ template.mapping &&
47
+ typeof template.mapping === 'object' &&
48
+ template.mapping.apiVersion === '0.0.5'),
49
+ false,
50
+ )))
51
+ )
52
+ },
53
+ apply: async ({ manifestFile }) => {
54
+ // Make sure we catch all variants; we could load the manifest
55
+ // and replace the values in the data structures here; unfortunately
56
+ // writing that back to the file messes with the formatting more than
57
+ // we'd like; that's why for now, we use a simple patching approach
58
+ await toolbox.patching.replace(
59
+ manifestFile,
60
+ new RegExp('apiVersion: 0.0.5', 'g'),
61
+ 'apiVersion: 0.0.6',
62
+ )
63
+ await toolbox.patching.replace(
64
+ manifestFile,
65
+ new RegExp("apiVersion: '0.0.5'", 'g'),
66
+ "apiVersion: '0.0.6'",
67
+ )
68
+ await toolbox.patching.replace(
69
+ manifestFile,
70
+ new RegExp('apiVersion: "0.0.5"', 'g'),
71
+ 'apiVersion: "0.0.6"',
72
+ )
73
+ },
74
+ }
package/src/scaffold.js CHANGED
@@ -18,6 +18,13 @@ const abiEvents = abi =>
18
18
  setName: (event, name) => event.set('_alias', name),
19
19
  })
20
20
 
21
+ const graphCliVersion = process.env.GRAPH_CLI_TESTS
22
+ // JSON.stringify should remove this key, we will install the local
23
+ // graph-cli for the tests using `npm link` instead of fetching from npm.
24
+ ? undefined
25
+ // For scaffolding real subgraphs
26
+ : `${module.exports.version}`
27
+
21
28
  // package.json
22
29
 
23
30
  const generatePackageJson = ({ subgraphName, node }) =>
@@ -41,8 +48,8 @@ const generatePackageJson = ({ subgraphName, node }) =>
41
48
  subgraphName,
42
49
  },
43
50
  dependencies: {
44
- '@graphprotocol/graph-cli': `${module.exports.version}`,
45
- '@graphprotocol/graph-ts': `0.22.1`,
51
+ '@graphprotocol/graph-cli': graphCliVersion,
52
+ '@graphprotocol/graph-ts': `0.24.0`,
46
53
  },
47
54
  }),
48
55
  { parser: 'json' },
@@ -145,6 +152,14 @@ const generateSchema = ({ abi, indexEvents }) => {
145
152
  )
146
153
  }
147
154
 
155
+ const tsConfig = prettier.format(
156
+ JSON.stringify({
157
+ extends: '@graphprotocol/graph-ts/types/tsconfig.base.json',
158
+ include: ['src'],
159
+ }),
160
+ { parser: 'json' },
161
+ )
162
+
148
163
  // Mapping
149
164
 
150
165
  const generateTupleFieldAssignments = ({ keyPath, index, component }) => {
@@ -303,6 +318,7 @@ const generateScaffold = async (
303
318
  'package.json': packageJson,
304
319
  'subgraph.yaml': manifest,
305
320
  'schema.graphql': schema,
321
+ 'tsconfig.json': tsConfig,
306
322
  src: { 'mapping.ts': mapping },
307
323
  abis: {
308
324
  [`${contractName}.json`]: prettier.format(JSON.stringify(abi.data), {
@@ -0,0 +1,6 @@
1
+ const { npmLinkCli } = require('./util')
2
+
3
+ module.exports = async () => {
4
+ process.env.GRAPH_CLI_TESTS = '1'
5
+ await npmLinkCli()
6
+ }
@@ -0,0 +1,6 @@
1
+ const { npmUnlinkCli } = require('./util')
2
+
3
+ module.exports = async () => {
4
+ delete process.env.GRAPH_CLI_TESTS
5
+ await npmUnlinkCli()
6
+ }
@@ -1,6 +1,6 @@
1
1
  const fs = require('fs-extra')
2
2
  const path = require('path')
3
- const cliTest = require('./util').cliTest
3
+ const { cliTest } = require('./util')
4
4
 
5
5
  describe('Init', () => {
6
6
  let baseDir = path.join(__dirname, 'init')
package/tests/cli/util.js CHANGED
@@ -13,7 +13,7 @@ const cliTest = (title, args, testPath, options) => {
13
13
  let cwd =
14
14
  options !== undefined && options.cwd ? options.cwd : resolvePath(`./${testPath}`)
15
15
 
16
- let [exitCode, stdout, stderr] = await runCli(args, cwd)
16
+ let [exitCode, stdout, stderr] = await runGraphCli(args, cwd)
17
17
 
18
18
  let expectedExitCode = undefined
19
19
  if (options !== undefined && options.exitCode !== undefined) {
@@ -55,18 +55,14 @@ const cliTest = (title, args, testPath, options) => {
55
55
  )
56
56
  }
57
57
 
58
- const runCli = async (args = [], cwd = process.cwd()) => {
59
- // Resolve the path to graph.js
60
- let graphCli = path.join(__dirname, '..', '..', 'bin', 'graph')
61
-
58
+ const runCommand = async (command, args = [], cwd = process.cwd()) => {
62
59
  // Make sure to set an absolute working directory
63
60
  cwd = cwd[0] !== '/' ? path.resolve(__dirname, cwd) : cwd
64
61
 
65
62
  return new Promise((resolve, reject) => {
66
63
  let stdout = ''
67
64
  let stderr = ''
68
- const command = `${graphCli} ${args.join(' ')}`
69
- const child = spawn(command, { cwd })
65
+ const child = spawn(`${command} ${args.join(' ')}`, { cwd })
70
66
 
71
67
  child.on('error', error => {
72
68
  reject(error)
@@ -86,7 +82,20 @@ const runCli = async (args = [], cwd = process.cwd()) => {
86
82
  })
87
83
  }
88
84
 
85
+ const runGraphCli = async (args, cwd) => {
86
+ // Resolve the path to graph.js
87
+ let graphCli = path.join(__dirname, '..', '..', 'bin', 'graph')
88
+
89
+ return await runCommand(graphCli, args, cwd)
90
+ }
91
+
92
+ const npmLinkCli = () => runCommand('npm', ['link'])
93
+
94
+ const npmUnlinkCli = () => runCommand('npm', ['unlink'])
95
+
89
96
  module.exports = {
90
97
  cliTest,
91
- runCli,
98
+ npmLinkCli,
99
+ npmUnlinkCli,
100
+ runGraphCli,
92
101
  }
@@ -1,69 +0,0 @@
1
- [
2
- {
3
- "constant": true,
4
- "inputs": [],
5
- "name": "proxyOwner",
6
- "outputs": [{ "name": "", "type": "address" }],
7
- "payable": false,
8
- "stateMutability": "view",
9
- "type": "function"
10
- },
11
- {
12
- "constant": true,
13
- "inputs": [],
14
- "name": "currentContract",
15
- "outputs": [{ "name": "", "type": "address" }],
16
- "payable": false,
17
- "stateMutability": "view",
18
- "type": "function"
19
- },
20
- {
21
- "constant": true,
22
- "inputs": [],
23
- "name": "owner",
24
- "outputs": [{ "name": "", "type": "address" }],
25
- "payable": false,
26
- "stateMutability": "view",
27
- "type": "function"
28
- },
29
- {
30
- "constant": false,
31
- "inputs": [
32
- { "name": "newContract", "type": "address" },
33
- { "name": "data", "type": "bytes" }
34
- ],
35
- "name": "upgrade",
36
- "outputs": [],
37
- "payable": false,
38
- "stateMutability": "nonpayable",
39
- "type": "function"
40
- },
41
- {
42
- "constant": false,
43
- "inputs": [{ "name": "_newOwner", "type": "address" }],
44
- "name": "transferOwnership",
45
- "outputs": [],
46
- "payable": false,
47
- "stateMutability": "nonpayable",
48
- "type": "function"
49
- },
50
- { "payable": true, "stateMutability": "payable", "type": "fallback" },
51
- {
52
- "anonymous": false,
53
- "inputs": [
54
- { "indexed": true, "name": "newContract", "type": "address" },
55
- { "indexed": false, "name": "initializedWith", "type": "bytes" }
56
- ],
57
- "name": "Upgrade",
58
- "type": "event"
59
- },
60
- {
61
- "anonymous": false,
62
- "inputs": [
63
- { "indexed": false, "name": "_prevOwner", "type": "address" },
64
- { "indexed": false, "name": "_newOwner", "type": "address" }
65
- ],
66
- "name": "OwnerUpdate",
67
- "type": "event"
68
- }
69
- ]
@@ -1,16 +0,0 @@
1
- {
2
- "name": "subgraph-from-contract",
3
- "license": "UNLICENSED",
4
- "scripts": {
5
- "codegen": "graph codegen",
6
- "build": "graph build",
7
- "deploy": "graph deploy --node https://api.studio.thegraph.com/deploy/ user/subgraph-from-contract",
8
- "create-local": "graph create --node http://localhost:8020/ user/subgraph-from-contract",
9
- "remove-local": "graph remove --node http://localhost:8020/ user/subgraph-from-contract",
10
- "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 user/subgraph-from-contract"
11
- },
12
- "dependencies": {
13
- "@graphprotocol/graph-cli": "file:../../../../",
14
- "@graphprotocol/graph-ts": "0.22.1"
15
- }
16
- }
@@ -1,6 +0,0 @@
1
- type ExampleEntity @entity {
2
- id: ID!
3
- count: BigInt!
4
- newContract: Bytes! # address
5
- initializedWith: Bytes! # bytes
6
- }
@@ -1,49 +0,0 @@
1
- import { BigInt } from "@graphprotocol/graph-ts"
2
- import { Contract, Upgrade, OwnerUpdate } from "../generated/Contract/Contract"
3
- import { ExampleEntity } from "../generated/schema"
4
-
5
- export function handleUpgrade(event: Upgrade): void {
6
- // Entities can be loaded from the store using a string ID; this ID
7
- // needs to be unique across all entities of the same type
8
- let entity = ExampleEntity.load(event.transaction.from.toHex())
9
-
10
- // Entities only exist after they have been saved to the store;
11
- // `null` checks allow to create entities on demand
12
- if (!entity) {
13
- entity = new ExampleEntity(event.transaction.from.toHex())
14
-
15
- // Entity fields can be set using simple assignments
16
- entity.count = BigInt.fromI32(0)
17
- }
18
-
19
- // BigInt and BigDecimal math are supported
20
- entity.count = entity.count + BigInt.fromI32(1)
21
-
22
- // Entity fields can be set based on event parameters
23
- entity.newContract = event.params.newContract
24
- entity.initializedWith = event.params.initializedWith
25
-
26
- // Entities can be written to the store with `.save()`
27
- entity.save()
28
-
29
- // Note: If a handler doesn't require existing field values, it is faster
30
- // _not_ to load the entity from the store. Instead, create it fresh with
31
- // `new Entity(...)`, set the fields that should be updated and save the
32
- // entity back to the store. Fields that were not set or unset remain
33
- // unchanged, allowing for partial updates to be applied.
34
-
35
- // It is also possible to access smart contracts from mappings. For
36
- // example, the contract that has emitted the event can be connected to
37
- // with:
38
- //
39
- // let contract = Contract.bind(event.address)
40
- //
41
- // The following functions can then be called on this contract to access
42
- // state variables and other data:
43
- //
44
- // - contract.proxyOwner(...)
45
- // - contract.currentContract(...)
46
- // - contract.owner(...)
47
- }
48
-
49
- export function handleOwnerUpdate(event: OwnerUpdate): void {}
@@ -1,26 +0,0 @@
1
- specVersion: 0.0.1
2
- schema:
3
- file: ./schema.graphql
4
- dataSources:
5
- - kind: ethereum/contract
6
- name: Contract
7
- network: mainnet
8
- source:
9
- address: "0xF87E31492Faf9A91B02Ee0dEAAd50d51d56D5d4d"
10
- abi: Contract
11
- mapping:
12
- kind: ethereum/events
13
- apiVersion: 0.0.5
14
- language: wasm/assemblyscript
15
- entities:
16
- - Upgrade
17
- - OwnerUpdate
18
- abis:
19
- - name: Contract
20
- file: ./abis/Contract.json
21
- eventHandlers:
22
- - event: Upgrade(indexed address,bytes)
23
- handler: handleUpgrade
24
- - event: OwnerUpdate(address,address)
25
- handler: handleOwnerUpdate
26
- file: ./src/mapping.ts