From 01d701ae964f0c6507cdfff1810defe513b9fb73 Mon Sep 17 00:00:00 2001 From: Alain Nicolas Date: Fri, 26 Apr 2024 12:31:40 +0200 Subject: [PATCH] feat: Deploy Verax on Base Mainnet (#597) --- README.md | 17 + contracts/.openzeppelin/unknown-8453.json | 955 ++++++++++++++++++++++ contracts/env/.env.base | 16 + contracts/hardhat.config.ts | 13 + contracts/script/utils.ts | 2 + sdk/package.json | 2 +- sdk/src/VeraxSdk.ts | 16 + subgraph/networks.json | 18 + subgraph/package.json | 4 + subgraph/subgraph.base-sepolia.yaml | 8 +- subgraph/subgraph.base.yaml | 98 +++ 11 files changed, 1144 insertions(+), 5 deletions(-) create mode 100644 contracts/.openzeppelin/unknown-8453.json create mode 100644 contracts/env/.env.base create mode 100644 subgraph/subgraph.base.yaml diff --git a/README.md b/README.md index b3ed809f..343644f7 100644 --- a/README.md +++ b/README.md @@ -232,6 +232,22 @@ Here are the addresses on those networks: +
+ Base Mainnet + +- Router = + [0x63b2d528805Fc9373586366705852FA89debd4d0](https://basescan.org/address/0x63b2d528805Fc9373586366705852FA89debd4d0) +- AttestationRegistry = + [0xA0080DBd35711faD39258E45d9A5D798852b05D4](https://basescan.org/address/0xA0080DBd35711faD39258E45d9A5D798852b05D4) +- ModuleRegistry = + [0xAd0C12db58098A6665CBEf48f60eB67d81d1F1ff](https://basescan.org/address/0xAd0C12db58098A6665CBEf48f60eB67d81d1F1ff) +- PortalRegistry = + [0xcbf28432C25B400E645F0EaC05F8954e8EE7c0d6](https://basescan.org/address/0xcbf28432C25B400E645F0EaC05F8954e8EE7c0d6) +- SchemaRegistry = + [0x8081dCd745f160c148Eb5be510F78628A0951c31](https://basescan.org/address/0x8081dCd745f160c148Eb5be510F78628A0951c31) + +
+ ## Subgraphs Addresses - [Linea Goerli](https://api.goldsky.com/api/public/project_clqghnrbp9nx201wtgylv8748/subgraphs/verax/subgraph-testnet/gn) @@ -241,6 +257,7 @@ Here are the addresses on those networks: - [Arbitrum Mainnet](https://api.thegraph.com/subgraphs/name/cliqueofficial/verax-arbitrum) - [Arbitrum Nova](https://api.goldsky.com/api/public/project_clr9aj9alwgwg01q7ci1rh781/subgraphs/verax-arbitrum-nova/0.0.5/gn) - [Base Sepolia](https://api.studio.thegraph.com/query/67946/verax-v1-base-sepolia/v0.0.1) +- [Base Mainnet](https://api.studio.thegraph.com/query/67946/verax-v1-base/v0.0.1) ## License diff --git a/contracts/.openzeppelin/unknown-8453.json b/contracts/.openzeppelin/unknown-8453.json new file mode 100644 index 00000000..1fc8a76f --- /dev/null +++ b/contracts/.openzeppelin/unknown-8453.json @@ -0,0 +1,955 @@ +{ + "manifestVersion": "3.2", + "admin": { + "address": "0x39e0033027F40A47F737C0E97720F2e7Add95211", + "txHash": "0x7a3832d46172dcab5dff1183f1eac2528054bc34ddbfc6f23bbb6bf078578479" + }, + "proxies": [ + { + "address": "0x63b2d528805Fc9373586366705852FA89debd4d0", + "txHash": "0x117cca5f44a5367432d28530da173d07243a27fc99b42a88039d3f10d3c64fce", + "kind": "transparent" + }, + { + "address": "0xA0080DBd35711faD39258E45d9A5D798852b05D4", + "txHash": "0x81d7a18f2c8f11e14f192183897a2387df700ce52c1e4670685bc6418d454d83", + "kind": "transparent" + }, + { + "address": "0xAd0C12db58098A6665CBEf48f60eB67d81d1F1ff", + "txHash": "0x02ecaf30c64129ec25e9b05f27aae3ee96ee2c8a2dad5ab06c856f98470b2fb3", + "kind": "transparent" + }, + { + "address": "0xcbf28432C25B400E645F0EaC05F8954e8EE7c0d6", + "txHash": "0xc0e96592e2688dd1727c0c939d8b6db1bcf8342ba459c13206076848d17b55ea", + "kind": "transparent" + }, + { + "address": "0x8081dCd745f160c148Eb5be510F78628A0951c31", + "txHash": "0x30065f64b6283cef0664657928de0813b403142f60f22420023015c0244dd7e8", + "kind": "transparent" + }, + { + "address": "0xD2E0469237b19A6cE2a326fC2cabf233FB5B31ca", + "txHash": "0xfaa4d2a51d405a214045e51486b32be22504e7693fb4eaf73a7ee11a261c05b6", + "kind": "transparent" + } + ], + "impls": { + "4353fbe787c13443291bba3d18e906853909285ba948d10f4d95994940b68c97": { + "address": "0xF2c4Faee2BA3Bd2DA439E0D08f00D3f59783811A", + "txHash": "0xce532dff69f0d1af1c3103688cfbea21ae025d910069e7f68f1fed331ecba098", + "layout": { + "solcVersion": "0.8.21", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:94" + }, + { + "label": "ATTESTATION_REGISTRY", + "offset": 0, + "slot": "101", + "type": "t_address", + "contract": "Router", + "src": "src/Router.sol:13" + }, + { + "label": "MODULE_REGISTRY", + "offset": 0, + "slot": "102", + "type": "t_address", + "contract": "Router", + "src": "src/Router.sol:14" + }, + { + "label": "PORTAL_REGISTRY", + "offset": 0, + "slot": "103", + "type": "t_address", + "contract": "Router", + "src": "src/Router.sol:15" + }, + { + "label": "SCHEMA_REGISTRY", + "offset": 0, + "slot": "104", + "type": "t_address", + "contract": "Router", + "src": "src/Router.sol:16" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } + }, + "afc9287c19cb1b830999d2016348e104b2143101ed97ea26cf1c1b48849ca551": { + "address": "0x7863e2C6B11227eA058934E2E43e5B3b746Ea7B0", + "txHash": "0x4b8c55433838424b44fb11124872ffd4e73aa5f09290789d0b554a4e718f71ae", + "layout": { + "solcVersion": "0.8.21", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:94" + }, + { + "label": "router", + "offset": 0, + "slot": "101", + "type": "t_contract(IRouter)7813", + "contract": "AttestationRegistry", + "src": "src/AttestationRegistry.sol:17" + }, + { + "label": "version", + "offset": 20, + "slot": "101", + "type": "t_uint16", + "contract": "AttestationRegistry", + "src": "src/AttestationRegistry.sol:19" + }, + { + "label": "attestationIdCounter", + "offset": 22, + "slot": "101", + "type": "t_uint32", + "contract": "AttestationRegistry", + "src": "src/AttestationRegistry.sol:20" + }, + { + "label": "attestations", + "offset": 0, + "slot": "102", + "type": "t_mapping(t_bytes32,t_struct(Attestation)9314_storage)", + "contract": "AttestationRegistry", + "src": "src/AttestationRegistry.sol:22" + }, + { + "label": "chainPrefix", + "offset": 0, + "slot": "103", + "type": "t_uint256", + "contract": "AttestationRegistry", + "src": "src/AttestationRegistry.sol:24" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(IRouter)7813": { + "label": "contract IRouter", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_struct(Attestation)9314_storage)": { + "label": "mapping(bytes32 => struct Attestation)", + "numberOfBytes": "32" + }, + "t_struct(Attestation)9314_storage": { + "label": "struct Attestation", + "members": [ + { + "label": "attestationId", + "type": "t_bytes32", + "offset": 0, + "slot": "0" + }, + { + "label": "schemaId", + "type": "t_bytes32", + "offset": 0, + "slot": "1" + }, + { + "label": "replacedBy", + "type": "t_bytes32", + "offset": 0, + "slot": "2" + }, + { + "label": "attester", + "type": "t_address", + "offset": 0, + "slot": "3" + }, + { + "label": "portal", + "type": "t_address", + "offset": 0, + "slot": "4" + }, + { + "label": "attestedDate", + "type": "t_uint64", + "offset": 20, + "slot": "4" + }, + { + "label": "expirationDate", + "type": "t_uint64", + "offset": 0, + "slot": "5" + }, + { + "label": "revocationDate", + "type": "t_uint64", + "offset": 8, + "slot": "5" + }, + { + "label": "version", + "type": "t_uint16", + "offset": 16, + "slot": "5" + }, + { + "label": "revoked", + "type": "t_bool", + "offset": 18, + "slot": "5" + }, + { + "label": "subject", + "type": "t_bytes_storage", + "offset": 0, + "slot": "6" + }, + { + "label": "attestationData", + "type": "t_bytes_storage", + "offset": 0, + "slot": "7" + } + ], + "numberOfBytes": "256" + }, + "t_uint16": { + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } + }, + "855a9f1d8e96c2bd24b6a929c90e3681a27dfdf6e80bf08bdaf0de5f33e7accf": { + "address": "0x20771528c8CB6CcBc9a2A1aE52412D03F154C94e", + "txHash": "0xcacfc26450b40a859e2145f2b32bd5f4fa9dda301d05b17e12f42688a066ffbc", + "layout": { + "solcVersion": "0.8.21", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:94" + }, + { + "label": "router", + "offset": 0, + "slot": "101", + "type": "t_contract(IRouter)7813", + "contract": "ModuleRegistry", + "src": "src/ModuleRegistry.sol:19" + }, + { + "label": "modules", + "offset": 0, + "slot": "102", + "type": "t_mapping(t_address,t_struct(Module)9346_storage)", + "contract": "ModuleRegistry", + "src": "src/ModuleRegistry.sol:21" + }, + { + "label": "moduleAddresses", + "offset": 0, + "slot": "103", + "type": "t_array(t_address)dyn_storage", + "contract": "ModuleRegistry", + "src": "src/ModuleRegistry.sol:23" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_address)dyn_storage": { + "label": "address[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IRouter)7813": { + "label": "contract IRouter", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_struct(Module)9346_storage)": { + "label": "mapping(address => struct Module)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Module)9346_storage": { + "label": "struct Module", + "members": [ + { + "label": "moduleAddress", + "type": "t_address", + "offset": 0, + "slot": "0" + }, + { + "label": "name", + "type": "t_string_storage", + "offset": 0, + "slot": "1" + }, + { + "label": "description", + "type": "t_string_storage", + "offset": 0, + "slot": "2" + } + ], + "numberOfBytes": "96" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } + }, + "4354fba979d8af67ae201159e1b7f7c6048ac523a759db0e2d448b58a54cde2a": { + "address": "0xB0c43b8Ade08A550ece33F1e0D08d611285dB1Ac", + "txHash": "0xc0e684b5e648d5f9780a8fa065733ba7dffc91856ab92be75dd672e9b8ed7b8a", + "layout": { + "solcVersion": "0.8.21", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:94" + }, + { + "label": "router", + "offset": 0, + "slot": "101", + "type": "t_contract(IRouter)7813", + "contract": "PortalRegistry", + "src": "src/PortalRegistry.sol:21" + }, + { + "label": "portals", + "offset": 0, + "slot": "102", + "type": "t_mapping(t_address,t_struct(Portal)9339_storage)", + "contract": "PortalRegistry", + "src": "src/PortalRegistry.sol:23" + }, + { + "label": "issuers", + "offset": 0, + "slot": "103", + "type": "t_mapping(t_address,t_bool)", + "contract": "PortalRegistry", + "src": "src/PortalRegistry.sol:25" + }, + { + "label": "portalAddresses", + "offset": 0, + "slot": "104", + "type": "t_array(t_address)dyn_storage", + "contract": "PortalRegistry", + "src": "src/PortalRegistry.sol:27" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_address)dyn_storage": { + "label": "address[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IRouter)7813": { + "label": "contract IRouter", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_struct(Portal)9339_storage)": { + "label": "mapping(address => struct Portal)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Portal)9339_storage": { + "label": "struct Portal", + "members": [ + { + "label": "id", + "type": "t_address", + "offset": 0, + "slot": "0" + }, + { + "label": "ownerAddress", + "type": "t_address", + "offset": 0, + "slot": "1" + }, + { + "label": "modules", + "type": "t_array(t_address)dyn_storage", + "offset": 0, + "slot": "2" + }, + { + "label": "isRevocable", + "type": "t_bool", + "offset": 0, + "slot": "3" + }, + { + "label": "name", + "type": "t_string_storage", + "offset": 0, + "slot": "4" + }, + { + "label": "description", + "type": "t_string_storage", + "offset": 0, + "slot": "5" + }, + { + "label": "ownerName", + "type": "t_string_storage", + "offset": 0, + "slot": "6" + } + ], + "numberOfBytes": "224" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } + }, + "68d0630cb0ae02e0e7d37f7e07193d62999ecb9070d3ca38b245f3954a34b089": { + "address": "0xCE84ee14DC25281DaADC6441E61dC511A6bE02aF", + "txHash": "0x8ce5d1c8e53029d24a99855d05547e44a786f26dd4d2822ba9705f24b6ec04b0", + "layout": { + "solcVersion": "0.8.21", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:94" + }, + { + "label": "router", + "offset": 0, + "slot": "101", + "type": "t_contract(IRouter)7813", + "contract": "SchemaRegistry", + "src": "src/SchemaRegistry.sol:16" + }, + { + "label": "schemas", + "offset": 0, + "slot": "102", + "type": "t_mapping(t_bytes32,t_struct(Schema)9323_storage)", + "contract": "SchemaRegistry", + "src": "src/SchemaRegistry.sol:18" + }, + { + "label": "schemaIds", + "offset": 0, + "slot": "103", + "type": "t_array(t_bytes32)dyn_storage", + "contract": "SchemaRegistry", + "src": "src/SchemaRegistry.sol:20" + }, + { + "label": "schemasIssuers", + "offset": 0, + "slot": "104", + "type": "t_mapping(t_bytes32,t_address)", + "contract": "SchemaRegistry", + "src": "src/SchemaRegistry.sol:22" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IRouter)7813": { + "label": "contract IRouter", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_address)": { + "label": "mapping(bytes32 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(Schema)9323_storage)": { + "label": "mapping(bytes32 => struct Schema)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Schema)9323_storage": { + "label": "struct Schema", + "members": [ + { + "label": "name", + "type": "t_string_storage", + "offset": 0, + "slot": "0" + }, + { + "label": "description", + "type": "t_string_storage", + "offset": 0, + "slot": "1" + }, + { + "label": "context", + "type": "t_string_storage", + "offset": 0, + "slot": "2" + }, + { + "label": "schema", + "type": "t_string_storage", + "offset": 0, + "slot": "3" + } + ], + "numberOfBytes": "128" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } + }, + "cc3bd5ce0f70ee7ad8fd47bda375d640dc7035da4746a94f0ccf30df96358f53": { + "address": "0x5F297C8778DD168aFB1BAb93aD347f85F699A092", + "txHash": "0x5853b55920eba320306e67fe24b6c30589fc581a656aa6a1653747be60a72463", + "layout": { + "solcVersion": "0.8.21", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:94" + }, + { + "label": "router", + "offset": 0, + "slot": "101", + "type": "t_contract(IRouter)7813", + "contract": "AttestationReader", + "src": "src/AttestationReader.sol:17" + }, + { + "label": "easRegistry", + "offset": 0, + "slot": "102", + "type": "t_contract(IEAS)7764", + "contract": "AttestationReader", + "src": "src/AttestationReader.sol:18" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IEAS)7764": { + "label": "contract IEAS", + "numberOfBytes": "20" + }, + "t_contract(IRouter)7813": { + "label": "contract IRouter", + "numberOfBytes": "20" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } + } + } +} diff --git a/contracts/env/.env.base b/contracts/env/.env.base new file mode 100644 index 00000000..073d0339 --- /dev/null +++ b/contracts/env/.env.base @@ -0,0 +1,16 @@ +# Config +INFURA_KEY= + +PRIVATE_KEY_LINEA_TESTNET=0000000000000000000000000000000000000000000000000000000000000001 + +LINEASCAN_API_KEY= + +# Contracts +ROUTER_ADDRESS=0x63b2d528805Fc9373586366705852FA89debd4d0 +PORTAL_REGISTRY_ADDRESS=0xcbf28432C25B400E645F0EaC05F8954e8EE7c0d6 +SCHEMA_REGISTRY_ADDRESS=0x8081dCd745f160c148Eb5be510F78628A0951c31 +MODULE_REGISTRY_ADDRESS=0xAd0C12db58098A6665CBEf48f60eB67d81d1F1ff +ATTESTATION_REGISTRY_ADDRESS=0xA0080DBd35711faD39258E45d9A5D798852b05D4 +ATTESTATION_READER_ADDRESS= +EAS_REGISTRY_ADDRESS= + diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index f3c3566c..eb751d49 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -38,6 +38,10 @@ const config: HardhatUserConfig = { url: `https://sepolia.base.org`, accounts: process.env.PRIVATE_KEY_LINEA_TESTNET !== undefined ? [process.env.PRIVATE_KEY_LINEA_TESTNET] : [], }, + base: { + url: `https://mainnet.base.org`, + accounts: process.env.PRIVATE_KEY_LINEA_MAINNET !== undefined ? [process.env.PRIVATE_KEY_LINEA_MAINNET] : [], + }, "linea-goerli": { url: `https://linea-goerli.infura.io/v3/${process.env.INFURA_KEY ?? ""}`, accounts: process.env.PRIVATE_KEY_LINEA_TESTNET !== undefined ? [process.env.PRIVATE_KEY_LINEA_TESTNET] : [], @@ -65,6 +69,7 @@ const config: HardhatUserConfig = { arbitrum: process.env.ARBISCAN_API_KEY ?? "", "arbitrum-nova": process.env.ARBISCAN_NOVA_API_KEY ?? "", "base-sepolia": process.env.BASESCAN_API_KEY ?? "", + base: process.env.BASESCAN_API_KEY ?? "", "linea-goerli": process.env.LINEASCAN_API_KEY ?? "", "linea-sepolia": process.env.LINEASCAN_API_KEY ?? "", linea: process.env.LINEASCAN_API_KEY ?? "", @@ -111,6 +116,14 @@ const config: HardhatUserConfig = { browserURL: "https://sepolia.basescan.org/", }, }, + { + network: "base", + chainId: 8453, + urls: { + apiURL: "https://api.basescan.org/api", + browserURL: "https://basescan.org", + }, + }, { network: "linea-goerli", chainId: 59140, diff --git a/contracts/script/utils.ts b/contracts/script/utils.ts index fc899bf5..fb7180f4 100644 --- a/contracts/script/utils.ts +++ b/contracts/script/utils.ts @@ -16,6 +16,8 @@ export const getChainPrefix = (chainId: bigint): `0x${string}` => { return "0x0002000000000000000000000000000000000000000000000000000000000000"; case 84532n: // Base Sepolia return "0x0005000000000000000000000000000000000000000000000000000000000000"; + case 8453n: // Base mainnet + return "0x0005000000000000000000000000000000000000000000000000000000000000"; default: throw new Error("Unknown network"); } diff --git a/sdk/package.json b/sdk/package.json index 793e1458..345467e1 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@verax-attestation-registry/verax-sdk", - "version": "1.5.0", + "version": "1.6.0", "description": "Verax Attestation Registry SDK to interact with the subgraph and the contracts", "keywords": [ "linea-attestation-registry", diff --git a/sdk/src/VeraxSdk.ts b/sdk/src/VeraxSdk.ts index 4bc9d2f8..627654ad 100644 --- a/sdk/src/VeraxSdk.ts +++ b/sdk/src/VeraxSdk.ts @@ -3,6 +3,7 @@ import { arbitrumGoerli, arbitrumNova, arbitrumSepolia, + base, baseSepolia, linea, lineaSepolia, @@ -143,6 +144,21 @@ export class VeraxSdk { mode: SDKMode.FRONTEND, }; + static DEFAULT_BASE: Conf = { + chain: base, + mode: SDKMode.BACKEND, + subgraphUrl: "https://api.studio.thegraph.com/query/67946/verax-v1-base/v0.0.1", + portalRegistryAddress: "0xcbf28432C25B400E645F0EaC05F8954e8EE7c0d6", + moduleRegistryAddress: "0xAd0C12db58098A6665CBEf48f60eB67d81d1F1ff", + schemaRegistryAddress: "0x8081dCd745f160c148Eb5be510F78628A0951c31", + attestationRegistryAddress: "0xA0080DBd35711faD39258E45d9A5D798852b05D4", + }; + + static DEFAULT_BASE_FRONTEND: Conf = { + ...VeraxSdk.DEFAULT_BASE, + mode: SDKMode.FRONTEND, + }; + private readonly web3Client: PublicClient; private readonly walletClient: WalletClient | undefined; diff --git a/subgraph/networks.json b/subgraph/networks.json index ad973d7f..1a53db93 100644 --- a/subgraph/networks.json +++ b/subgraph/networks.json @@ -142,5 +142,23 @@ "address": "0x66D2F3DCc970343b83a6263E20832184fa71CFe7", "startBlock": 9174253 } + }, + "base": { + "AttestationRegistry": { + "address": "0xA0080DBd35711faD39258E45d9A5D798852b05D4", + "startBlock": 13666866 + }, + "ModuleRegistry": { + "address": "0xAd0C12db58098A6665CBEf48f60eB67d81d1F1ff", + "startBlock": 13666866 + }, + "PortalRegistry": { + "address": "0xcbf28432C25B400E645F0EaC05F8954e8EE7c0d6", + "startBlock": 13666866 + }, + "SchemaRegistry": { + "address": "0x8081dCd745f160c148Eb5be510F78628A0951c31", + "startBlock": 13666866 + } } } diff --git a/subgraph/package.json b/subgraph/package.json index 6530fef1..304dd86e 100644 --- a/subgraph/package.json +++ b/subgraph/package.json @@ -19,6 +19,7 @@ "build:linea-goerli": "cp subgraph.linea-goerli.yaml subgraph.yaml && pnpm run codegen:linea-goerli && graph build --network linea-goerli", "build:linea-sepolia": "cp subgraph.linea-sepolia.yaml subgraph.yaml && pnpm run codegen:linea-sepolia && graph build --network linea-sepolia", "build:base-sepolia": "cp subgraph.base-sepolia.yaml subgraph.yaml && pnpm run codegen:base-sepolia && graph build --network base-sepolia", + "build:base": "cp subgraph.base.yaml subgraph.yaml && pnpm run codegen:base && graph build --network base", "build:arbitrum-goerli": "cp subgraph.arbitrum-goerli.yaml subgraph.yaml && pnpm run codegen:arbitrum-goerli && graph build --network arbitrum-goerli", "build:arbitrum-sepolia": "cp subgraph.arbitrum-sepolia.yaml subgraph.yaml && pnpm run codegen:arbitrum-sepolia && graph build --network arbitrum-sepolia", "build:arbitrum-mainnet": "cp subgraph.arbitrum-mainnet.yaml subgraph.yaml && pnpm run codegen:arbitrum-mainnet && graph build --network arbitrum-mainnet", @@ -27,6 +28,7 @@ "codegen:linea-goerli": "cp subgraph.linea-goerli.yaml subgraph.yaml && graph codegen", "codegen:linea-sepolia": "cp subgraph.linea-sepolia.yaml subgraph.yaml && graph codegen", "codegen:base-sepolia": "cp subgraph.base-sepolia.yaml subgraph.yaml && graph codegen", + "codegen:base": "cp subgraph.base.yaml subgraph.yaml && graph codegen", "codegen:arbitrum-goerli": "cp subgraph.arbitrum-goerli.yaml subgraph.yaml && graph codegen", "codegen:arbitrum-sepolia": "cp subgraph.arbitrum-sepolia.yaml subgraph.yaml && graph codegen", "codegen:arbitrum-mainnet": "cp subgraph.arbitrum-mainnet.yaml subgraph.yaml && graph codegen", @@ -35,6 +37,7 @@ "create:linea-goerli": "source .env && graph create --node $DEPLOY_ENDPOINT_LINEA_GOERLI $SUBGRAPH_NAME_LINEA_GOERLI", "create:linea-sepolia": "source .env && graph create --node $DEPLOY_ENDPOINT_LINEA_SEPOLIA $SUBGRAPH_NAME_LINEA_SEPOLIA", "create:base-sepolia": "source .env && graph create --node $DEPLOY_ENDPOINT_BASE_SEPOLIA $SUBGRAPH_NAME_BASE_SEPOLIA", + "create:base": "source .env && graph create --node $DEPLOY_ENDPOINT_BASE $SUBGRAPH_NAME_BASE", "create:arbitrum-goerli": "source .env && graph create --node $DEPLOY_ENDPOINT_ARBITRUM_GOERLI Consensys/verax-arbitrum-goerli", "create:arbitrum-sepolia": "source .env && graph create --node $DEPLOY_ENDPOINT_ARBITRUM_SEPOLIA $SUBGRAPH_NAME_ARBITRUM_SEPOLIA", "create:arbitrum-one": "source .env && graph create --node $DEPLOY_ENDPOINT_ARBITRUM_GOERLI Consensys/verax-arbitrum", @@ -42,6 +45,7 @@ "deploy:linea-goerli": "source .env && cp subgraph.linea-goerli.yaml subgraph.yaml && graph deploy --studio $SUBGRAPH_NAME_LINEA_GOERLI", "deploy:linea-sepolia": "source .env && cp subgraph.linea-sepolia.yaml subgraph.yaml && graph deploy --studio $SUBGRAPH_NAME_LINEA_SEPOLIA", "deploy:base-sepolia": "source .env && cp subgraph.base-sepolia.yaml subgraph.yaml && graph deploy --studio $SUBGRAPH_NAME_BASE_SEPOLIA", + "deploy:base": "source .env && cp subgraph.base.yaml subgraph.yaml && graph deploy --studio $SUBGRAPH_NAME_BASE", "deploy:arbitrum-goerli": "source .env && cp subgraph.arbitrum-goerli.yaml subgraph.yaml && graph deploy --network arbitrum-goerli --node $DEPLOY_ENDPOINT_ARBITRUM_GOERLI --headers \"{\\\"Authorization\\\": \\\"Basic $IPFS_IDENTIFIERS\\\"}\" --ipfs $IPFS_ENDPOINT --version-label v0.0.5 Consensys/verax-arbitrum-goerli", "deploy:arbitrum-sepolia": "source .env && cp subgraph.arbitrum-sepolia.yaml subgraph.yaml && pnpm run build:arbitrum-sepolia && graph deploy --studio $SUBGRAPH_NAME_ARBITRUM_SEPOLIA", "deploy:arbitrum-mainnet": "source .env && cp subgraph.arbitrum-mainnet.yaml subgraph.yaml && pnpm run build:arbitrum-mainnet && graph deploy --network arbitrum-mainnet --node $DEPLOY_ENDPOINT_ARBITRUM_MAINNET --headers \"{\\\"Authorization\\\": \\\"Basic $IPFS_IDENTIFIERS\\\"}\" --ipfs $IPFS_ENDPOINT --version-label v0.0.5 Consensys/verax-arbitrum", diff --git a/subgraph/subgraph.base-sepolia.yaml b/subgraph/subgraph.base-sepolia.yaml index 6aeb8bdf..7a7878d7 100644 --- a/subgraph/subgraph.base-sepolia.yaml +++ b/subgraph/subgraph.base-sepolia.yaml @@ -4,7 +4,7 @@ schema: dataSources: - kind: ethereum name: AttestationRegistry - network: linea-sepolia + network: base-sepolia source: abi: AttestationRegistry address: "0x374B686137eC0DB442a8d833451f8C12cD4B5De4" @@ -30,7 +30,7 @@ dataSources: file: ./src/attestation-registry.ts - kind: ethereum name: ModuleRegistry - network: linea-sepolia + network: base-sepolia source: abi: ModuleRegistry address: "0xEC572277d4E87a64DcfA774ED219Dd4E69E4BDc6" @@ -50,7 +50,7 @@ dataSources: file: ./src/module-registry.ts - kind: ethereum name: PortalRegistry - network: linea-sepolia + network: base-sepolia source: abi: PortalRegistry address: "0x025531b655D9EE335B8E6cc4C118b313f26ACc8F" @@ -76,7 +76,7 @@ dataSources: file: ./src/portal-registry.ts - kind: ethereum name: SchemaRegistry - network: linea-sepolia + network: base-sepolia source: abi: SchemaRegistry address: "0x66D2F3DCc970343b83a6263E20832184fa71CFe7" diff --git a/subgraph/subgraph.base.yaml b/subgraph/subgraph.base.yaml new file mode 100644 index 00000000..f8a60a1d --- /dev/null +++ b/subgraph/subgraph.base.yaml @@ -0,0 +1,98 @@ +specVersion: 0.0.5 +schema: + file: ./schema.graphql +dataSources: + - kind: ethereum + name: AttestationRegistry + network: base + source: + abi: AttestationRegistry + address: "0xA0080DBd35711faD39258E45d9A5D798852b05D4" + startBlock: 13666866 + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - Attestation + abis: + - name: AttestationRegistry + file: ./abis/AttestationRegistry.json + eventHandlers: + - event: AttestationRegistered(indexed bytes32) + handler: handleAttestationRegistered + - event: AttestationRevoked(bytes32) + handler: handleAttestationRevoked + - event: AttestationReplaced(bytes32,bytes32) + handler: handleAttestationReplaced + - event: VersionUpdated(uint16) + handler: handleVersionUpdated + file: ./src/attestation-registry.ts + - kind: ethereum + name: ModuleRegistry + network: base + source: + abi: ModuleRegistry + address: "0xAd0C12db58098A6665CBEf48f60eB67d81d1F1ff" + startBlock: 13666866 + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - Module + abis: + - name: ModuleRegistry + file: ./abis/ModuleRegistry.json + eventHandlers: + - event: ModuleRegistered(string,string,address) + handler: handleModuleRegistered + file: ./src/module-registry.ts + - kind: ethereum + name: PortalRegistry + network: base + source: + abi: PortalRegistry + address: "0xcbf28432C25B400E645F0EaC05F8954e8EE7c0d6" + startBlock: 13666866 + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - Portal + abis: + - name: PortalRegistry + file: ./abis/PortalRegistry.json + eventHandlers: + - event: PortalRegistered(string,string,address) + handler: handlePortalRegistered + - event: PortalRevoked(address) + handler: handlePortalRevoked + - event: IssuerAdded(address) + handler: handleIssuerAdded + - event: IssuerRemoved(address) + handler: handleIssuerRemoved + file: ./src/portal-registry.ts + - kind: ethereum + name: SchemaRegistry + network: base + source: + abi: SchemaRegistry + address: "0x8081dCd745f160c148Eb5be510F78628A0951c31" + startBlock: 13666866 + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - Portal + abis: + - name: SchemaRegistry + file: ./abis/SchemaRegistry.json + eventHandlers: + - event: SchemaCreated(indexed bytes32,string,string,string,string) + handler: handleSchemaCreated + - event: SchemaContextUpdated(indexed bytes32) + handler: handleSchemaContextUpdated + file: ./src/schema-registry.ts