diff --git a/.gitignore b/.gitignore index 06121c8a..6ed4c9f5 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,6 @@ docs/_build /node_modules -.idea \ No newline at end of file +.idea +*/**/artifacts +*/**/build \ No newline at end of file diff --git a/Implementations/Subgraph/daostar/build/EIP4824Index/EIP4824Index.wasm b/Implementations/Subgraph/daostar/build/EIP4824Index/EIP4824Index.wasm index 8ebf4ee9..c3d664ca 100644 Binary files a/Implementations/Subgraph/daostar/build/EIP4824Index/EIP4824Index.wasm and b/Implementations/Subgraph/daostar/build/EIP4824Index/EIP4824Index.wasm differ diff --git a/Implementations/Subgraph/daostar/build/subgraph.yaml b/Implementations/Subgraph/daostar/build/subgraph.yaml index 2c4d0d2a..bcf8ed8a 100644 --- a/Implementations/Subgraph/daostar/build/subgraph.yaml +++ b/Implementations/Subgraph/daostar/build/subgraph.yaml @@ -6,7 +6,7 @@ features: templates: - name: EIP4824Registration kind: ethereum/contract - network: chapel + network: arbitrum-one source: abi: EIP4824Registration mapping: @@ -25,11 +25,11 @@ templates: dataSources: - kind: ethereum name: EIP4824Index - network: chapel + network: arbitrum-one source: abi: EIP4824Index address: "0x18CbB356cd64193b1a0CA49911fc72CB3D02a5E4" - startBlock: 32947350 + startBlock: 171329384 mapping: kind: ethereum/events apiVersion: 0.0.6 diff --git a/Implementations/Subgraph/daostar/generated/schema.ts b/Implementations/Subgraph/daostar/generated/schema.ts index 3167a7cb..bd55001a 100644 --- a/Implementations/Subgraph/daostar/generated/schema.ts +++ b/Implementations/Subgraph/daostar/generated/schema.ts @@ -15,6 +15,11 @@ export class RegistrationInstance extends Entity { constructor(id: string) { super(); this.set("id", Value.fromString(id)); + + this.set("registrationAddress", Value.fromBytes(Bytes.empty())); + this.set("daoAddress", Value.fromBytes(Bytes.empty())); + this.set("daoURI", Value.fromString("")); + this.set("registrationNetwork", Value.fromString("")); } save(): void { @@ -29,12 +34,6 @@ export class RegistrationInstance extends Entity { } } - static loadInBlock(id: string): RegistrationInstance | null { - return changetype( - store.get_in_block("RegistrationInstance", id) - ); - } - static load(id: string): RegistrationInstance | null { return changetype( store.get("RegistrationInstance", id) @@ -43,11 +42,7 @@ export class RegistrationInstance extends Entity { get id(): string { let value = this.get("id"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } + return value!.toString(); } set id(value: string) { @@ -56,11 +51,7 @@ export class RegistrationInstance extends Entity { get registrationAddress(): Bytes { let value = this.get("registrationAddress"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBytes(); - } + return value!.toBytes(); } set registrationAddress(value: Bytes) { @@ -69,11 +60,7 @@ export class RegistrationInstance extends Entity { get daoAddress(): Bytes { let value = this.get("daoAddress"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBytes(); - } + return value!.toBytes(); } set daoAddress(value: Bytes) { @@ -82,11 +69,7 @@ export class RegistrationInstance extends Entity { get daoURI(): string { let value = this.get("daoURI"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } + return value!.toString(); } set daoURI(value: string) { @@ -112,11 +95,7 @@ export class RegistrationInstance extends Entity { get registrationNetwork(): string { let value = this.get("registrationNetwork"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } + return value!.toString(); } set registrationNetwork(value: string) { @@ -264,6 +243,8 @@ export class RegistrationNetwork extends Entity { constructor(id: string) { super(); this.set("id", Value.fromString(id)); + + this.set("chainId", Value.fromString("")); } save(): void { @@ -278,12 +259,6 @@ export class RegistrationNetwork extends Entity { } } - static loadInBlock(id: string): RegistrationNetwork | null { - return changetype( - store.get_in_block("RegistrationNetwork", id) - ); - } - static load(id: string): RegistrationNetwork | null { return changetype( store.get("RegistrationNetwork", id) @@ -292,53 +267,36 @@ export class RegistrationNetwork extends Entity { get id(): string { let value = this.get("id"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } + return value!.toString(); } set id(value: string) { this.set("id", Value.fromString(value)); } - get registrations(): RegistrationInstanceLoader { - return new RegistrationInstanceLoader( - "RegistrationNetwork", - this.get("id")!.toString(), - "registrations" - ); - } - - get chainId(): string { - let value = this.get("chainId"); + get registrations(): Array | null { + let value = this.get("registrations"); if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); + return null; } else { - return value.toString(); + return value.toStringArray(); } } - set chainId(value: string) { - this.set("chainId", Value.fromString(value)); + set registrations(value: Array | null) { + if (!value) { + this.unset("registrations"); + } else { + this.set("registrations", Value.fromStringArray(>value)); + } } -} -export class RegistrationInstanceLoader extends Entity { - _entity: string; - _field: string; - _id: string; - - constructor(entity: string, id: string, field: string) { - super(); - this._entity = entity; - this._id = id; - this._field = field; + get chainId(): string { + let value = this.get("chainId"); + return value!.toString(); } - load(): RegistrationInstance[] { - let value = store.loadRelated(this._entity, this._id, this._field); - return changetype(value); + set chainId(value: string) { + this.set("chainId", Value.fromString(value)); } } diff --git a/Implementations/Subgraph/daostar/networks.json b/Implementations/Subgraph/daostar/networks.json index bfe6790c..16268196 100644 --- a/Implementations/Subgraph/daostar/networks.json +++ b/Implementations/Subgraph/daostar/networks.json @@ -40,5 +40,11 @@ "address": "0x18CbB356cd64193b1a0CA49911fc72CB3D02a5E4", "startBlock": 109109991 } + }, + "arbitrum-one": { + "EIP4824Index": { + "address": "0x18CbB356cd64193b1a0CA49911fc72CB3D02a5E4", + "startBlock": 171329384 + } } } diff --git a/Implementations/Subgraph/daostar/package.json b/Implementations/Subgraph/daostar/package.json index 108f0c39..7495c6bc 100644 --- a/Implementations/Subgraph/daostar/package.json +++ b/Implementations/Subgraph/daostar/package.json @@ -4,6 +4,7 @@ "scripts": { "build:mainnet": "graph codegen && graph build --network mainnet", "build:optimism": "graph codegen && graph build --network optimism", + "build:arbitrum": "graph codegen && graph build --network arbitrum-one", "build:goerli": "graph codegen && graph build --network goerli", "build:gnosis": "graph codegen && graph build --network gnosis", "build:optimism-goerli": "graph codegen && graph build --network optimism-goerli", @@ -13,6 +14,7 @@ "build": "graph build", "deploy:mainnet": "graph deploy --node https://api.thegraph.com/deploy/ ipatka/daostar", "deploy:optimism": "graph deploy --node https://api.thegraph.com/deploy/ crazyyuan/daostar-optimism", + "deploy:arbitrum": "graph deploy --node https://api.thegraph.com/deploy/ crazyyuan/daostar-arbitrum", "deploy:goerli": "graph deploy --node https://api.thegraph.com/deploy/ ipatka/daostar-goerli", "deploy:optimism-goerli": "graph deploy --node https://api.thegraph.com/deploy/ rashmi-278/daostar-optimism-goerli", "deploy:gnosis": "graph deploy --node https://api.thegraph.com/deploy/ rashmi-278/daostar-gnosis", diff --git a/Implementations/Subgraph/daostar/subgraph.yaml b/Implementations/Subgraph/daostar/subgraph.yaml index e475df99..183d3ee6 100644 --- a/Implementations/Subgraph/daostar/subgraph.yaml +++ b/Implementations/Subgraph/daostar/subgraph.yaml @@ -6,7 +6,7 @@ features: templates: - name: EIP4824Registration kind: ethereum/contract - network: chapel + network: arbitrum-one source: abi: EIP4824Registration mapping: @@ -25,11 +25,11 @@ templates: dataSources: - kind: ethereum name: EIP4824Index - network: chapel + network: arbitrum-one source: abi: EIP4824Index address: "0x18CbB356cd64193b1a0CA49911fc72CB3D02a5E4" - startBlock: 32947350 + startBlock: 171329384 mapping: kind: ethereum/events apiVersion: 0.0.6 diff --git a/README.md b/README.md index 7732ddad..a9d45487 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ These contracts are used to register on DAOstar website. * **EIP4824RegistrationSummoner** * Contract: [0x5C0340AD34f7284f9272E784FF76638E8dDb5dE4](https://optimistic.etherscan.io/address/0x5C0340AD34f7284f9272E784FF76638E8dDb5dE4) * Version: 1.0.0 + + #### Arbitrum * **EIP4824Index**: * Contract: [0x18CbB356cd64193b1a0CA49911fc72CB3D02a5E4](https://arbiscan.io/address/0x18cbb356cd64193b1a0ca49911fc72cb3d02a5e4) diff --git a/contracts/compiler_config.json b/contracts/compiler_config.json new file mode 100644 index 00000000..f9b9236d --- /dev/null +++ b/contracts/compiler_config.json @@ -0,0 +1,33 @@ +{ + "language": "Solidity", + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "": [ + "ast" + ], + "*": [ + "abi", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.legacyAssembly", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "evm.gasEstimates", + "evm.assembly" + ] + } + }, + "remappings": [ + "ds-test/=lib/forge-std/lib/ds-test/src/", + "forge-std/=lib/forge-std/src/" + ] + } +} \ No newline at end of file diff --git a/daostar-website/src/components/ExplorePage/queries/registrations 2.js b/daostar-website/src/components/ExplorePage/queries/registrations 2.js new file mode 100644 index 00000000..324606aa --- /dev/null +++ b/daostar-website/src/components/ExplorePage/queries/registrations 2.js @@ -0,0 +1,46 @@ +import { gql } from '@apollo/client' + +const REGISTRATIONS = gql` + query Registrations($id: String) @api(contextKey: "apiName") { + registrationNetwork(id: $id) { + id + registrations { + id + daoAddress + daoURI + daoName + daoDescription + membersURI + proposalsURI + governanceURI + activityLogURI + registrationAddress + registrationNetwork { + id + } + } + } + } +` + +const REGISTRATION = gql` + query Registration($id: String) @api(contextKey: "apiName") { + registrationInstance(id: $id) { + id + daoAddress + daoURI + daoName + daoDescription + membersURI + proposalsURI + governanceURI + activityLogURI + registrationAddress + registrationNetwork { + id + } + } + } +` + +export default { REGISTRATIONS, REGISTRATION}