diff --git a/graph/build/SmartReader/abis/SmartReader.json b/graph/build/SmartReader/abis/SmartReader.json index a6aa9be..82720a0 100644 --- a/graph/build/SmartReader/abis/SmartReader.json +++ b/graph/build/SmartReader/abis/SmartReader.json @@ -137,4 +137,4 @@ "stateMutability": "view", "type": "function" } -] +] \ No newline at end of file diff --git a/graph/build/subgraph.yaml b/graph/build/subgraph.yaml index 2b58688..3b6fbc1 100644 --- a/graph/build/subgraph.yaml +++ b/graph/build/subgraph.yaml @@ -6,7 +6,7 @@ dataSources: name: SmartReader network: goerli source: - address: '0xdFFfB2E3CCeB7D25B4be73Ce5e03a78Fb22342A2' + address: "0xdFFfB2E3CCeB7D25B4be73Ce5e03a78Fb22342A2" abi: SmartReader startBlock: 8598408 mapping: diff --git a/graph/generated/SmartReader/SmartReader.ts b/graph/generated/SmartReader/SmartReader.ts index 8407f9e..3544ce9 100644 --- a/graph/generated/SmartReader/SmartReader.ts +++ b/graph/generated/SmartReader/SmartReader.ts @@ -7,8 +7,8 @@ import { Entity, Bytes, Address, - BigInt, -} from '@graphprotocol/graph-ts'; + BigInt +} from "@graphprotocol/graph-ts"; export class AnnotationAdded extends ethereum.Event { get params(): AnnotationAdded__Params { @@ -64,13 +64,13 @@ export class ContractAdded__Params { export class SmartReader extends ethereum.SmartContract { static bind(address: Address): SmartReader { - return new SmartReader('SmartReader', address); + return new SmartReader("SmartReader", address); } contractStorage(param0: Address, param1: string): string { let result = super.call( - 'contractStorage', - 'contractStorage(address,string):(string)', + "contractStorage", + "contractStorage(address,string):(string)", [ethereum.Value.fromAddress(param0), ethereum.Value.fromString(param1)] ); @@ -82,8 +82,8 @@ export class SmartReader extends ethereum.SmartContract { param1: string ): ethereum.CallResult { let result = super.tryCall( - 'contractStorage', - 'contractStorage(address,string):(string)', + "contractStorage", + "contractStorage(address,string):(string)", [ethereum.Value.fromAddress(param0), ethereum.Value.fromString(param1)] ); if (result.reverted) { @@ -94,13 +94,13 @@ export class SmartReader extends ethereum.SmartContract { } owner(): Address { - let result = super.call('owner', 'owner():(address)', []); + let result = super.call("owner", "owner():(address)", []); return result[0].toAddress(); } try_owner(): ethereum.CallResult
{ - let result = super.tryCall('owner', 'owner():(address)', []); + let result = super.tryCall("owner", "owner():(address)", []); if (result.reverted) { return new ethereum.CallResult(); } diff --git a/graph/generated/schema.ts b/graph/generated/schema.ts index a489ca4..e1ef4d7 100644 --- a/graph/generated/schema.ts +++ b/graph/generated/schema.ts @@ -8,326 +8,326 @@ import { store, Bytes, BigInt, - BigDecimal, -} from '@graphprotocol/graph-ts'; + BigDecimal +} from "@graphprotocol/graph-ts"; export class Contract extends Entity { constructor(id: string) { super(); - this.set('id', Value.fromString(id)); + this.set("id", Value.fromString(id)); } save(): void { - let id = this.get('id'); - assert(id != null, 'Cannot save Contract entity without an ID'); + let id = this.get("id"); + assert(id != null, "Cannot save Contract entity without an ID"); if (id) { assert( id.kind == ValueKind.STRING, `Entities of type Contract must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set('Contract', id.toString(), this); + store.set("Contract", id.toString(), this); } } static load(id: string): Contract | null { - return changetype(store.get('Contract', id)); + return changetype(store.get("Contract", id)); } get id(): string { - let value = this.get('id'); + let value = this.get("id"); return value!.toString(); } set id(value: string) { - this.set('id', Value.fromString(value)); + this.set("id", Value.fromString(value)); } get smartReaderContract(): Bytes { - let value = this.get('smartReaderContract'); + let value = this.get("smartReaderContract"); return value!.toBytes(); } set smartReaderContract(value: Bytes) { - this.set('smartReaderContract', Value.fromBytes(value)); + this.set("smartReaderContract", Value.fromBytes(value)); } get mainContractAddress(): Bytes { - let value = this.get('mainContractAddress'); + let value = this.get("mainContractAddress"); return value!.toBytes(); } set mainContractAddress(value: Bytes) { - this.set('mainContractAddress', Value.fromBytes(value)); + this.set("mainContractAddress", Value.fromBytes(value)); } get network(): string { - let value = this.get('network'); + let value = this.get("network"); return value!.toString(); } set network(value: string) { - this.set('network', Value.fromString(value)); + this.set("network", Value.fromString(value)); } get createdAt(): BigInt { - let value = this.get('createdAt'); + let value = this.get("createdAt"); return value!.toBigInt(); } set createdAt(value: BigInt) { - this.set('createdAt', Value.fromBigInt(value)); + this.set("createdAt", Value.fromBigInt(value)); } get blockNumber(): BigInt { - let value = this.get('blockNumber'); + let value = this.get("blockNumber"); return value!.toBigInt(); } set blockNumber(value: BigInt) { - this.set('blockNumber', Value.fromBigInt(value)); + this.set("blockNumber", Value.fromBigInt(value)); } get transactionHash(): Bytes { - let value = this.get('transactionHash'); + let value = this.get("transactionHash"); return value!.toBytes(); } set transactionHash(value: Bytes) { - this.set('transactionHash', Value.fromBytes(value)); + this.set("transactionHash", Value.fromBytes(value)); } get blockTimestamp(): BigInt { - let value = this.get('blockTimestamp'); + let value = this.get("blockTimestamp"); return value!.toBigInt(); } set blockTimestamp(value: BigInt) { - this.set('blockTimestamp', Value.fromBigInt(value)); + this.set("blockTimestamp", Value.fromBigInt(value)); } get subContracts(): Array { - let value = this.get('subContracts'); + let value = this.get("subContracts"); return value!.toStringArray(); } set subContracts(value: Array) { - this.set('subContracts', Value.fromStringArray(value)); + this.set("subContracts", Value.fromStringArray(value)); } get Annotations(): Array { - let value = this.get('Annotations'); + let value = this.get("Annotations"); return value!.toStringArray(); } set Annotations(value: Array) { - this.set('Annotations', Value.fromStringArray(value)); + this.set("Annotations", Value.fromStringArray(value)); } } export class subContract extends Entity { constructor(id: string) { super(); - this.set('id', Value.fromString(id)); + this.set("id", Value.fromString(id)); } save(): void { - let id = this.get('id'); - assert(id != null, 'Cannot save subContract entity without an ID'); + let id = this.get("id"); + assert(id != null, "Cannot save subContract entity without an ID"); if (id) { assert( id.kind == ValueKind.STRING, `Entities of type subContract must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set('subContract', id.toString(), this); + store.set("subContract", id.toString(), this); } } static load(id: string): subContract | null { - return changetype(store.get('subContract', id)); + return changetype(store.get("subContract", id)); } get id(): string { - let value = this.get('id'); + let value = this.get("id"); return value!.toString(); } set id(value: string) { - this.set('id', Value.fromString(value)); + this.set("id", Value.fromString(value)); } get smartReaderContract(): Bytes { - let value = this.get('smartReaderContract'); + let value = this.get("smartReaderContract"); return value!.toBytes(); } set smartReaderContract(value: Bytes) { - this.set('smartReaderContract', Value.fromBytes(value)); + this.set("smartReaderContract", Value.fromBytes(value)); } get mainContract(): Bytes { - let value = this.get('mainContract'); + let value = this.get("mainContract"); return value!.toBytes(); } set mainContract(value: Bytes) { - this.set('mainContract', Value.fromBytes(value)); + this.set("mainContract", Value.fromBytes(value)); } get subContractName(): string { - let value = this.get('subContractName'); + let value = this.get("subContractName"); return value!.toString(); } set subContractName(value: string) { - this.set('subContractName', Value.fromString(value)); + this.set("subContractName", Value.fromString(value)); } get network(): string { - let value = this.get('network'); + let value = this.get("network"); return value!.toString(); } set network(value: string) { - this.set('network', Value.fromString(value)); + this.set("network", Value.fromString(value)); } get createdAt(): BigInt { - let value = this.get('createdAt'); + let value = this.get("createdAt"); return value!.toBigInt(); } set createdAt(value: BigInt) { - this.set('createdAt', Value.fromBigInt(value)); + this.set("createdAt", Value.fromBigInt(value)); } get blockNumber(): BigInt { - let value = this.get('blockNumber'); + let value = this.get("blockNumber"); return value!.toBigInt(); } set blockNumber(value: BigInt) { - this.set('blockNumber', Value.fromBigInt(value)); + this.set("blockNumber", Value.fromBigInt(value)); } get transactionHash(): Bytes { - let value = this.get('transactionHash'); + let value = this.get("transactionHash"); return value!.toBytes(); } set transactionHash(value: Bytes) { - this.set('transactionHash', Value.fromBytes(value)); + this.set("transactionHash", Value.fromBytes(value)); } get blockTimestamp(): BigInt { - let value = this.get('blockTimestamp'); + let value = this.get("blockTimestamp"); return value!.toBigInt(); } set blockTimestamp(value: BigInt) { - this.set('blockTimestamp', Value.fromBigInt(value)); + this.set("blockTimestamp", Value.fromBigInt(value)); } get ipfsSchema(): string { - let value = this.get('ipfsSchema'); + let value = this.get("ipfsSchema"); return value!.toString(); } set ipfsSchema(value: string) { - this.set('ipfsSchema', Value.fromString(value)); + this.set("ipfsSchema", Value.fromString(value)); } } export class Annotation extends Entity { constructor(id: string) { super(); - this.set('id', Value.fromString(id)); + this.set("id", Value.fromString(id)); } save(): void { - let id = this.get('id'); - assert(id != null, 'Cannot save Annotation entity without an ID'); + let id = this.get("id"); + assert(id != null, "Cannot save Annotation entity without an ID"); if (id) { assert( id.kind == ValueKind.STRING, `Entities of type Annotation must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set('Annotation', id.toString(), this); + store.set("Annotation", id.toString(), this); } } static load(id: string): Annotation | null { - return changetype(store.get('Annotation', id)); + return changetype(store.get("Annotation", id)); } get id(): string { - let value = this.get('id'); + let value = this.get("id"); return value!.toString(); } set id(value: string) { - this.set('id', Value.fromString(value)); + this.set("id", Value.fromString(value)); } get mainContract(): Bytes { - let value = this.get('mainContract'); + let value = this.get("mainContract"); return value!.toBytes(); } set mainContract(value: Bytes) { - this.set('mainContract', Value.fromBytes(value)); + this.set("mainContract", Value.fromBytes(value)); } get blockNumber(): BigInt { - let value = this.get('blockNumber'); + let value = this.get("blockNumber"); return value!.toBigInt(); } set blockNumber(value: BigInt) { - this.set('blockNumber', Value.fromBigInt(value)); + this.set("blockNumber", Value.fromBigInt(value)); } get blockTimestamp(): BigInt { - let value = this.get('blockTimestamp'); + let value = this.get("blockTimestamp"); return value!.toBigInt(); } set blockTimestamp(value: BigInt) { - this.set('blockTimestamp', Value.fromBigInt(value)); + this.set("blockTimestamp", Value.fromBigInt(value)); } get transactionHash(): Bytes { - let value = this.get('transactionHash'); + let value = this.get("transactionHash"); return value!.toBytes(); } set transactionHash(value: Bytes) { - this.set('transactionHash', Value.fromBytes(value)); + this.set("transactionHash", Value.fromBytes(value)); } get subContractName(): string { - let value = this.get('subContractName'); + let value = this.get("subContractName"); return value!.toString(); } set subContractName(value: string) { - this.set('subContractName', Value.fromString(value)); + this.set("subContractName", Value.fromString(value)); } get annotation(): string { - let value = this.get('annotation'); + let value = this.get("annotation"); return value!.toString(); } set annotation(value: string) { - this.set('annotation', Value.fromString(value)); + this.set("annotation", Value.fromString(value)); } get createdAt(): BigInt { - let value = this.get('createdAt'); + let value = this.get("createdAt"); return value!.toBigInt(); } set createdAt(value: BigInt) { - this.set('createdAt', Value.fromBigInt(value)); + this.set("createdAt", Value.fromBigInt(value)); } } diff --git a/graph/src/smart-reader.ts b/graph/src/smart-reader.ts index 963b828..82c102f 100644 --- a/graph/src/smart-reader.ts +++ b/graph/src/smart-reader.ts @@ -50,7 +50,7 @@ export function handleAnnotationAdded(event: AnnotationAddedEvent): void { log.info('handleAnnotationAdded {}', [ event.params.mainContract.toHexString(), ]); - if (contract != null) { + if (contract !== null) { let annotation = new Annotation(event.transaction.hash.toHexString()); log.info('lizard {}', [event.transaction.hash.toHexString()]); annotation.mainContract = event.params.mainContract;