diff --git a/contracts/.openzeppelin/sepolia.json b/contracts/.openzeppelin/sepolia.json deleted file mode 100644 index 2bf9a1ed..00000000 --- a/contracts/.openzeppelin/sepolia.json +++ /dev/null @@ -1,888 +0,0 @@ -{ - "manifestVersion": "3.2", - "admin": { - "address": "0x347541F33505853171D628F9e8f46A05ACc7056F", - "txHash": "0xa8494c5fb1ee109416d8384167a2041261e0fcce240dffe5116b5c0e8a73f875" - }, - "proxies": [ - { - "address": "0xF242b04E5dFdB6D6A7461ab55E99d86844cCbBC2", - "txHash": "0xaea282713643649ec20aec98c9683a746e2d429e225f251a93647dd30542123c", - "kind": "transparent" - }, - { - "address": "0xAa42EA7d6F880318e2e493E408b89A4F6628b056", - "txHash": "0xa193c5444354862d886b9cd7e004bad350ea56f0b6c23767a1414ee4b84a2a77", - "kind": "transparent" - }, - { - "address": "0x53fe4Fc4bb400F0604d4C69694D2D0F6348869EF", - "txHash": "0x0650134da10557d3bc0c80edaef83d016e1ea1bc722d40051300a0a52cb4ca2e", - "kind": "transparent" - }, - { - "address": "0x944998Fd56ac74C95f7e9FA894102E205869a635", - "txHash": "0x38bd36d4a092a8a052e9ad0ce28c8868b77e3ed16962b2f14fc42914c4ff1ad6", - "kind": "transparent" - }, - { - "address": "0x6A7d23fb4768aEAA6A45bCe21C0d245E10DE53e2", - "txHash": "0x315763736fc1641626c5d0745398b5259944879ef55def6582c1bce47e025558", - "kind": "transparent" - } - ], - "impls": { - "4353fbe787c13443291bba3d18e906853909285ba948d10f4d95994940b68c97": { - "address": "0x3608768A28d742075cDA584c5e69982F5c651d77", - "txHash": "0x02a0b8306f8ea6e036487b6ebb9b57c23805bc8e837a05a60ea6a1ac13dd7fc9", - "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" - } - } - } - }, - "3a10f786d2f88ef43609cda786d7d3e3710bb254abbebaddec15881d1598a999": { - "address": "0xAc7b2C375c0Aa9b07FA91eB9BEE556Ed3e2Bb99E", - "txHash": "0x78feba7ce82f67cb8087eb19cfcc6c3fc1b44904182cc5dc1abe748ace712c88", - "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": "__gap", - "offset": 0, - "slot": "101", - "type": "t_array(t_uint256)50_storage", - "contract": "ERC165Upgradeable", - "src": "openzeppelin-contracts-upgradeable/contracts/utils/introspection/ERC165Upgradeable.sol:41" - }, - { - "label": "_balances", - "offset": 0, - "slot": "151", - "type": "t_mapping(t_uint256,t_mapping(t_address,t_uint256))", - "contract": "ERC1155Upgradeable", - "src": "openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:25" - }, - { - "label": "_operatorApprovals", - "offset": 0, - "slot": "152", - "type": "t_mapping(t_address,t_mapping(t_address,t_bool))", - "contract": "ERC1155Upgradeable", - "src": "openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:28" - }, - { - "label": "_uri", - "offset": 0, - "slot": "153", - "type": "t_string_storage", - "contract": "ERC1155Upgradeable", - "src": "openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:31" - }, - { - "label": "__gap", - "offset": 0, - "slot": "154", - "type": "t_array(t_uint256)47_storage", - "contract": "ERC1155Upgradeable", - "src": "openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:508" - }, - { - "label": "router", - "offset": 0, - "slot": "201", - "type": "t_contract(IRouter)8166", - "contract": "AttestationRegistry", - "src": "src/AttestationRegistry.sol:17" - }, - { - "label": "version", - "offset": 20, - "slot": "201", - "type": "t_uint16", - "contract": "AttestationRegistry", - "src": "src/AttestationRegistry.sol:19" - }, - { - "label": "attestationIdCounter", - "offset": 22, - "slot": "201", - "type": "t_uint32", - "contract": "AttestationRegistry", - "src": "src/AttestationRegistry.sol:20" - }, - { - "label": "attestations", - "offset": 0, - "slot": "202", - "type": "t_mapping(t_bytes32,t_struct(Attestation)8234_storage)", - "contract": "AttestationRegistry", - "src": "src/AttestationRegistry.sol:22" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)47_storage": { - "label": "uint256[47]", - "numberOfBytes": "1504" - }, - "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)8166": { - "label": "contract IRouter", - "numberOfBytes": "20" - }, - "t_mapping(t_address,t_bool)": { - "label": "mapping(address => bool)", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_mapping(t_address,t_bool))": { - "label": "mapping(address => mapping(address => bool))", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_uint256)": { - "label": "mapping(address => uint256)", - "numberOfBytes": "32" - }, - "t_mapping(t_bytes32,t_struct(Attestation)8234_storage)": { - "label": "mapping(bytes32 => struct Attestation)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_mapping(t_address,t_uint256))": { - "label": "mapping(uint256 => mapping(address => uint256))", - "numberOfBytes": "32" - }, - "t_string_storage": { - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(Attestation)8234_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" - } - } - } - }, - "84786e98eee515d63a28b28d3e67d5f91e07fe863a9045e2dbfec7f203693cad": { - "address": "0x201C4dFD63032c11bcA30c22EDDaffda43866ddB", - "txHash": "0x6701b9e4cb4f45fc801c4e774c56e9892b4aebb915239d5a11b71cf2c93f39b2", - "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)8166", - "contract": "ModuleRegistry", - "src": "src/ModuleRegistry.sol:18" - }, - { - "label": "modules", - "offset": 0, - "slot": "102", - "type": "t_mapping(t_address,t_struct(Module)8266_storage)", - "contract": "ModuleRegistry", - "src": "src/ModuleRegistry.sol:20" - }, - { - "label": "moduleAddresses", - "offset": 0, - "slot": "103", - "type": "t_array(t_address)dyn_storage", - "contract": "ModuleRegistry", - "src": "src/ModuleRegistry.sol:22" - } - ], - "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)8166": { - "label": "contract IRouter", - "numberOfBytes": "20" - }, - "t_mapping(t_address,t_struct(Module)8266_storage)": { - "label": "mapping(address => struct Module)", - "numberOfBytes": "32" - }, - "t_string_storage": { - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(Module)8266_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" - } - } - } - }, - "e66ce7c5948444f1fbf62e100f89ab14957c39bfa631d0e28f816823865b3177": { - "address": "0x1Aab7606dbaa16b854e2E55C4AD9Fdb1c81601A8", - "txHash": "0x767e4e05edec31467f9ea81ffce05fd37239cec08adc3a8b77c4f6a35dd5ef39", - "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)8166", - "contract": "PortalRegistry", - "src": "src/PortalRegistry.sol:18" - }, - { - "label": "portals", - "offset": 0, - "slot": "102", - "type": "t_mapping(t_address,t_struct(Portal)8259_storage)", - "contract": "PortalRegistry", - "src": "src/PortalRegistry.sol:20" - }, - { - "label": "issuers", - "offset": 0, - "slot": "103", - "type": "t_mapping(t_address,t_bool)", - "contract": "PortalRegistry", - "src": "src/PortalRegistry.sol:22" - }, - { - "label": "portalAddresses", - "offset": 0, - "slot": "104", - "type": "t_array(t_address)dyn_storage", - "contract": "PortalRegistry", - "src": "src/PortalRegistry.sol:24" - } - ], - "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)8166": { - "label": "contract IRouter", - "numberOfBytes": "20" - }, - "t_mapping(t_address,t_bool)": { - "label": "mapping(address => bool)", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_struct(Portal)8259_storage)": { - "label": "mapping(address => struct Portal)", - "numberOfBytes": "32" - }, - "t_string_storage": { - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(Portal)8259_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" - } - } - } - }, - "9b0b84cc1046d395294ecdfe067a693eda5c23f9473ae2d4f22f82674d2eb7d6": { - "address": "0xFD3F38D4E8F5300903C86a073552BDC2FB57F66d", - "txHash": "0x89916baf9f99a9634266378d18b5bf826baf595db86cb0f9f3ad95d2388182ed", - "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)8166", - "contract": "SchemaRegistry", - "src": "src/SchemaRegistry.sol:15" - }, - { - "label": "schemas", - "offset": 0, - "slot": "102", - "type": "t_mapping(t_bytes32,t_struct(Schema)8243_storage)", - "contract": "SchemaRegistry", - "src": "src/SchemaRegistry.sol:17" - }, - { - "label": "schemaIds", - "offset": 0, - "slot": "103", - "type": "t_array(t_bytes32)dyn_storage", - "contract": "SchemaRegistry", - "src": "src/SchemaRegistry.sol:19" - } - ], - "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)8166": { - "label": "contract IRouter", - "numberOfBytes": "20" - }, - "t_mapping(t_bytes32,t_struct(Schema)8243_storage)": { - "label": "mapping(bytes32 => struct Schema)", - "numberOfBytes": "32" - }, - "t_string_storage": { - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(Schema)8243_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" - } - } - } - } - } -} diff --git a/contracts/.openzeppelin/unknown-59140.json b/contracts/.openzeppelin/unknown-59140.json index c61eee0b..67e9e19c 100644 --- a/contracts/.openzeppelin/unknown-59140.json +++ b/contracts/.openzeppelin/unknown-59140.json @@ -4,10 +4,6 @@ "address": "0x8D2001F35592d5EC064c8F39025C6CD4F5f29FD3" }, "proxies": [ - { - "address": "0x736c78b2f2cBf4F921E8551b2acB6A5Edc9177D5", - "kind": "transparent" - }, { "address": "0xC765F28096F6121C2F2b82D35A4346280164428b", "kind": "transparent" @@ -24,9 +20,12 @@ "address": "0xB2c4Da1f8F08A0CA25862509E5431289BE2b598B", "kind": "transparent" }, + { + "address": "0x736c78b2f2cBf4F921E8551b2acB6A5Edc9177D5", + "kind": "transparent" + }, { "address": "0x65c8294C7aF0f0bDDe51eF92AF850613bb629fc6", - "txHash": "0xb3faa8c708ccf7c9da492b6519e519b8b1c48750de54b0f48f3d4665b3d66895", "kind": "transparent" } ], @@ -876,8 +875,20 @@ "label": "uint8", "numberOfBytes": "1" } - } - } + }, + "namespaces": {} + }, + "allAddresses": [ + "0xC88E223D7a11E0b148b14C91411ED47e920f8c97", + "0xAfA952790492DDeB474012cEA12ba34B788ab39F", + "0x8498100c925eD4daA87D5D17DF9783244c8B7F46", + "0xe3c36DEB0Ce1444fc8c847d6865217A6B2133765", + "0xFd3b9e9C60e9E7694751CfA8B10dE5850bC78C2F", + "0x1348ebE9373a4D8A5bE923dBf00408c951e28228", + "0xB3311B3CfF2752cd26B9964D3d7CB0FeB0b0d215", + "0x582Ca0f4482166A01b19FE1D0abeF0b9b236228f", + "0x79E25CD672032F3a7A315312d54F28ce3aBE3847" + ] }, "0e565d3af4874384e79b514fc2386c7fa28858f16795fd7f69763b0a84ba7df2": { "address": "0x5A8726B3EdbCD5554bb5C0508617cB7171495736", @@ -2289,7 +2300,7 @@ "label": "router", "offset": 0, "slot": "101", - "type": "t_contract(IRouter)3398", + "type": "t_contract(IRouter)6963", "contract": "AttestationReader", "src": "src/AttestationReader.sol:17" }, @@ -2297,7 +2308,7 @@ "label": "easRegistry", "offset": 0, "slot": "102", - "type": "t_contract(IEAS)3370", + "type": "t_contract(IEAS)6935", "contract": "AttestationReader", "src": "src/AttestationReader.sol:18" } @@ -2319,11 +2330,11 @@ "label": "bool", "numberOfBytes": "1" }, - "t_contract(IEAS)3370": { + "t_contract(IEAS)6935": { "label": "contract IEAS", "numberOfBytes": "20" }, - "t_contract(IRouter)3398": { + "t_contract(IRouter)6963": { "label": "contract IRouter", "numberOfBytes": "20" }, @@ -2337,7 +2348,692 @@ } }, "namespaces": {} - } + }, + "allAddresses": ["0x90f1810bfcE4b98dbc95B5b6AbF19A6324a57DB2", "0xA4a7517F62216BD42e42a67dF09C25adc72A5897"] + }, + "99e5c37885aa5ad80cbb068486aa970411fb36d14c1326df24fc2bb7585c0d3a": { + "address": "0x7DCDdF1A30D29C198f0f21cb6ce6B7c25d8CBCA9", + "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)6963", + "contract": "AttestationRegistry", + "src": "src/AttestationRegistry.sol:16" + }, + { + "label": "version", + "offset": 20, + "slot": "101", + "type": "t_uint16", + "contract": "AttestationRegistry", + "src": "src/AttestationRegistry.sol:18" + }, + { + "label": "attestationIdCounter", + "offset": 22, + "slot": "101", + "type": "t_uint32", + "contract": "AttestationRegistry", + "src": "src/AttestationRegistry.sol:19" + }, + { + "label": "attestations", + "offset": 0, + "slot": "102", + "type": "t_mapping(t_bytes32,t_struct(Attestation)7031_storage)", + "contract": "AttestationRegistry", + "src": "src/AttestationRegistry.sol:21" + } + ], + "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)6963": { + "label": "contract IRouter", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_struct(Attestation)7031_storage)": { + "label": "mapping(bytes32 => struct Attestation)", + "numberOfBytes": "32" + }, + "t_struct(Attestation)7031_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": {} + }, + "allAddresses": ["0x7DCDdF1A30D29C198f0f21cb6ce6B7c25d8CBCA9", "0xDaf3C3632327343f7df0Baad2dc9144fa4e1001F"] + }, + "84786e98eee515d63a28b28d3e67d5f91e07fe863a9045e2dbfec7f203693cad": { + "address": "0x3037720CE3191fEDDAF9C7b9fF0bD3B50213538E", + "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)6963", + "contract": "ModuleRegistry", + "src": "src/ModuleRegistry.sol:18" + }, + { + "label": "modules", + "offset": 0, + "slot": "102", + "type": "t_mapping(t_address,t_struct(Module)7063_storage)", + "contract": "ModuleRegistry", + "src": "src/ModuleRegistry.sol:20" + }, + { + "label": "moduleAddresses", + "offset": 0, + "slot": "103", + "type": "t_array(t_address)dyn_storage", + "contract": "ModuleRegistry", + "src": "src/ModuleRegistry.sol:22" + } + ], + "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)6963": { + "label": "contract IRouter", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_struct(Module)7063_storage)": { + "label": "mapping(address => struct Module)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Module)7063_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": {} + }, + "allAddresses": ["0x3037720CE3191fEDDAF9C7b9fF0bD3B50213538E", "0x4594A8DA79F6bb2C75E548F185B5BDbE5fEdb759"] + }, + "3cce55a07d15cd46366e9b70a6d32d4e902069ca0b87f90461172ef32131e26a": { + "address": "0x4Ce1dEC90eC2cF6c45353C7Dc50c0be2207E3736", + "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)6963", + "contract": "PortalRegistry", + "src": "src/PortalRegistry.sol:18" + }, + { + "label": "portals", + "offset": 0, + "slot": "102", + "type": "t_mapping(t_address,t_struct(Portal)7056_storage)", + "contract": "PortalRegistry", + "src": "src/PortalRegistry.sol:20" + }, + { + "label": "issuers", + "offset": 0, + "slot": "103", + "type": "t_mapping(t_address,t_bool)", + "contract": "PortalRegistry", + "src": "src/PortalRegistry.sol:22" + }, + { + "label": "portalAddresses", + "offset": 0, + "slot": "104", + "type": "t_array(t_address)dyn_storage", + "contract": "PortalRegistry", + "src": "src/PortalRegistry.sol:24" + } + ], + "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)6963": { + "label": "contract IRouter", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_struct(Portal)7056_storage)": { + "label": "mapping(address => struct Portal)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Portal)7056_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": {} + }, + "allAddresses": ["0x4Ce1dEC90eC2cF6c45353C7Dc50c0be2207E3736", "0x4371Cc5C503e1285875016C9B65c7278f1EDFc56"] + }, + "9b0b84cc1046d395294ecdfe067a693eda5c23f9473ae2d4f22f82674d2eb7d6": { + "address": "0xAb5702589d5Af810Ac14A852b02133958E50f10D", + "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)6963", + "contract": "SchemaRegistry", + "src": "src/SchemaRegistry.sol:15" + }, + { + "label": "schemas", + "offset": 0, + "slot": "102", + "type": "t_mapping(t_bytes32,t_struct(Schema)7040_storage)", + "contract": "SchemaRegistry", + "src": "src/SchemaRegistry.sol:17" + }, + { + "label": "schemaIds", + "offset": 0, + "slot": "103", + "type": "t_array(t_bytes32)dyn_storage", + "contract": "SchemaRegistry", + "src": "src/SchemaRegistry.sol:19" + } + ], + "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)6963": { + "label": "contract IRouter", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_struct(Schema)7040_storage)": { + "label": "mapping(bytes32 => struct Schema)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Schema)7040_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": {} + }, + "allAddresses": ["0xAb5702589d5Af810Ac14A852b02133958E50f10D", "0x5Cc4029f0dDae1FFE527385459D06d81DFD50EEe"] } } } diff --git a/contracts/lib/forge-std b/contracts/lib/forge-std index 1d9650e9..f73c73d2 160000 --- a/contracts/lib/forge-std +++ b/contracts/lib/forge-std @@ -1 +1 @@ -Subproject commit 1d9650e951204a0ddce9ff89c32f1997984cef4d +Subproject commit f73c73d2018eb6a111f35e4dae7b4f27401e9421 diff --git a/contracts/lib/openzeppelin-contracts b/contracts/lib/openzeppelin-contracts index 98c7a4cf..9329cfac 160000 --- a/contracts/lib/openzeppelin-contracts +++ b/contracts/lib/openzeppelin-contracts @@ -1 +1 @@ -Subproject commit 98c7a4cf958f7014e3c5347aeb0678b585eb870d +Subproject commit 9329cfacd4c7d20bcb43d772d947ff9e39b65df9 diff --git a/contracts/package.json b/contracts/package.json index 424c193e..ef010325 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -52,7 +52,7 @@ "upgrade:all:goerli": "npx hardhat run --network linea-goerli script/upgrade/upgradeEverything.ts", "upgrade:all:goerli:force": "npx hardhat run --network linea-goerli script/upgrade/forceUpgradeEverything.ts", "upgrade:all:scroll-sepolia": "npx hardhat run --network scroll-sepolia script/upgrade/upgradeEverything.ts", - "upgrade:all:goerli:scroll-sepolia": "npx hardhat run --network scroll-sepolia script/upgrade/forceUpgradeEverything.ts" + "upgrade:all:scroll-sepolia:force": "npx hardhat run --network scroll-sepolia script/upgrade/forceUpgradeEverything.ts" }, "devDependencies": { "@nomicfoundation/hardhat-ethers": "^3.0.4", diff --git a/contracts/script/recreateNetworkFile.ts b/contracts/script/recreateNetworkFile.ts index 1e57a384..64109375 100644 --- a/contracts/script/recreateNetworkFile.ts +++ b/contracts/script/recreateNetworkFile.ts @@ -39,6 +39,12 @@ async function main() { await upgrades.forceImport(schemaRegistryProxyAddress, SchemaRegistry, { kind: "transparent" }); + console.log("Re-importing AttestationReader..."); + const attestationReaderProxyAddress = process.env.ATTESTATION_READER_ADDRESS ?? ""; + const AttestationReader = await ethers.getContractFactory("AttestationReader"); + + await upgrades.forceImport(attestationReaderProxyAddress, AttestationReader, { kind: "transparent" }); + console.log("All contracts are re-imported and the network file is re-created!"); } diff --git a/contracts/src/portal/DefaultPortal.sol b/contracts/src/DefaultPortal.sol similarity index 91% rename from contracts/src/portal/DefaultPortal.sol rename to contracts/src/DefaultPortal.sol index 0e28af63..4cdc9304 100644 --- a/contracts/src/portal/DefaultPortal.sol +++ b/contracts/src/DefaultPortal.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.21; -import { AbstractPortal } from "../interface/AbstractPortal.sol"; +import { AbstractPortal } from "./interface/AbstractPortal.sol"; /** * @title Default Portal diff --git a/contracts/src/PortalRegistry.sol b/contracts/src/PortalRegistry.sol index 47cfa53c..d0d008aa 100644 --- a/contracts/src/PortalRegistry.sol +++ b/contracts/src/PortalRegistry.sol @@ -5,9 +5,10 @@ import { OwnableUpgradeable } from "openzeppelin-contracts-upgradeable/contracts // solhint-disable-next-line max-line-length import { ERC165CheckerUpgradeable } from "openzeppelin-contracts-upgradeable/contracts/utils/introspection/ERC165CheckerUpgradeable.sol"; import { AbstractPortal } from "./interface/AbstractPortal.sol"; -import { DefaultPortal } from "./portal/DefaultPortal.sol"; +import { DefaultPortal } from "./DefaultPortal.sol"; import { Portal } from "./types/Structs.sol"; import { IRouter } from "./interface/IRouter.sol"; +import { IPortal } from "./interface/IPortal.sol"; /** * @title Portal Registry @@ -130,7 +131,7 @@ contract PortalRegistry is OwnableUpgradeable { if (bytes(ownerName).length == 0) revert PortalOwnerNameMissing(); // Check if portal has implemented AbstractPortal - if (!ERC165CheckerUpgradeable.supportsInterface(id, type(AbstractPortal).interfaceId)) revert PortalInvalid(); + if (!ERC165CheckerUpgradeable.supportsInterface(id, type(IPortal).interfaceId)) revert PortalInvalid(); // Get the array of modules implemented by the portal address[] memory modules = AbstractPortal(id).getModules(); diff --git a/contracts/src/example/IncorrectModule.sol b/contracts/src/example/IncorrectModule.sol deleted file mode 100644 index fc849a18..00000000 --- a/contracts/src/example/IncorrectModule.sol +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.21; - -/** - * @title Incorrect Module - * @author Consensys - * @notice This contract illustrates an invalid Module that doesn't follow the AbstractModule interface - */ -contract IncorrectModule { - -} diff --git a/contracts/src/example/MsgSenderModule.sol b/contracts/src/examples/modules/MsgSenderModule.sol similarity index 89% rename from contracts/src/example/MsgSenderModule.sol rename to contracts/src/examples/modules/MsgSenderModule.sol index 5cdc3a95..03e4b411 100644 --- a/contracts/src/example/MsgSenderModule.sol +++ b/contracts/src/examples/modules/MsgSenderModule.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.21; -import { AbstractModule } from "../interface/AbstractModule.sol"; -import { AttestationPayload } from "../types/Structs.sol"; +import { AbstractModule } from "../../interface/AbstractModule.sol"; +import { AttestationPayload } from "../../types/Structs.sol"; /** * @title Msg Sender Module diff --git a/contracts/src/example/PayableModule.sol b/contracts/src/examples/modules/PayableModule.sol similarity index 90% rename from contracts/src/example/PayableModule.sol rename to contracts/src/examples/modules/PayableModule.sol index ddf1804c..77b5108e 100644 --- a/contracts/src/example/PayableModule.sol +++ b/contracts/src/examples/modules/PayableModule.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.21; -import { AbstractModule } from "../interface/AbstractModule.sol"; -import { AttestationPayload } from "../types/Structs.sol"; +import { AbstractModule } from "../../interface/AbstractModule.sol"; +import { AttestationPayload } from "../../types/Structs.sol"; import { Ownable } from "openzeppelin-contracts/contracts/access/Ownable.sol"; /** diff --git a/contracts/src/example/EASPortal.sol b/contracts/src/examples/portals/EASPortal.sol similarity index 96% rename from contracts/src/example/EASPortal.sol rename to contracts/src/examples/portals/EASPortal.sol index 74c6c7b1..2912ff4a 100644 --- a/contracts/src/example/EASPortal.sol +++ b/contracts/src/examples/portals/EASPortal.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.21; -import { AbstractPortal } from "../interface/AbstractPortal.sol"; -import { AttestationPayload } from "../types/Structs.sol"; +import { AbstractPortal } from "../../interface/AbstractPortal.sol"; +import { AttestationPayload } from "../../types/Structs.sol"; /** * @title EAS Portal diff --git a/contracts/src/example/NFTPortal.sol b/contracts/src/examples/portals/NFTPortal.sol similarity index 94% rename from contracts/src/example/NFTPortal.sol rename to contracts/src/examples/portals/NFTPortal.sol index 8e7a9963..102e50d6 100644 --- a/contracts/src/example/NFTPortal.sol +++ b/contracts/src/examples/portals/NFTPortal.sol @@ -3,8 +3,8 @@ pragma solidity 0.8.21; import { IERC721, ERC721 } from "openzeppelin-contracts/contracts/token/ERC721/ERC721.sol"; import { IERC165 } from "openzeppelin-contracts/contracts/utils/introspection/ERC165.sol"; -import { AbstractPortal } from "../interface/AbstractPortal.sol"; -import { Attestation, AttestationPayload } from "../types/Structs.sol"; +import { AbstractPortal } from "../../interface/AbstractPortal.sol"; +import { Attestation, AttestationPayload } from "../../types/Structs.sol"; /** * @title NFT Portal diff --git a/contracts/src/interface/AbstractPortal.sol b/contracts/src/interface/AbstractPortal.sol index 11abaf69..2a3f4b02 100644 --- a/contracts/src/interface/AbstractPortal.sol +++ b/contracts/src/interface/AbstractPortal.sol @@ -7,8 +7,16 @@ import { PortalRegistry } from "../PortalRegistry.sol"; import { AttestationPayload } from "../types/Structs.sol"; import { IERC165 } from "openzeppelin-contracts/contracts/utils/introspection/ERC165.sol"; import { IRouter } from "../interface/IRouter.sol"; - -abstract contract AbstractPortal is IERC165 { +import { IPortal } from "../interface/IPortal.sol"; + +/** + * @title Abstract Portal + * @author Consensys + * @notice This contract is an abstract contract with basic Portal logic + * to be inherited. We strongly encourage all Portals to implement + * this contract. + */ +abstract contract AbstractPortal is IPortal { IRouter public router; address[] public modules; ModuleRegistry public moduleRegistry; @@ -139,7 +147,10 @@ abstract contract AbstractPortal is IERC165 { * @return The list of modules addresses linked to the Portal */ function supportsInterface(bytes4 interfaceID) public pure virtual override returns (bool) { - return interfaceID == type(AbstractPortal).interfaceId || interfaceID == type(IERC165).interfaceId; + return + interfaceID == type(AbstractPortal).interfaceId || + interfaceID == type(IPortal).interfaceId || + interfaceID == type(IERC165).interfaceId; } /** diff --git a/contracts/src/interface/IPortal.sol b/contracts/src/interface/IPortal.sol new file mode 100644 index 00000000..7ede1e2f --- /dev/null +++ b/contracts/src/interface/IPortal.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.21; + +import { IERC165 } from "openzeppelin-contracts/contracts/utils/introspection/ERC165.sol"; + +/** + * @title IPortal + * @author Consensys + * @notice This contract is the interface to be implemented by any Portal. + * NOTE: A portal must implement this interface to registered on + * the PortalRegistry contract. + */ +interface IPortal is IERC165 { + /** + * @notice Get all the modules addresses used by the Portal + * @return The list of modules addresses linked to the Portal + */ + function getModules() external view returns (address[] memory); + + /** + * @notice Defines the address of the entity issuing attestations to the subject + * @dev We strongly encourage a reflection when implementing this method + */ + function getAttester() external view returns (address); +} diff --git a/contracts/test/portal/DefaultPortal.t.sol b/contracts/test/DefaultPortal.t.sol similarity index 93% rename from contracts/test/portal/DefaultPortal.t.sol rename to contracts/test/DefaultPortal.t.sol index 7cc9e19f..f7451c6b 100644 --- a/contracts/test/portal/DefaultPortal.t.sol +++ b/contracts/test/DefaultPortal.t.sol @@ -2,15 +2,15 @@ pragma solidity 0.8.21; import { Test } from "forge-std/Test.sol"; -import { AbstractPortal } from "../../src/interface/AbstractPortal.sol"; -import { DefaultPortal } from "../../src/portal/DefaultPortal.sol"; -import { AttestationPayload } from "../../src/types/Structs.sol"; -import { CorrectModule } from "../../src/example/CorrectModule.sol"; -import { AttestationRegistryMock } from "../mocks/AttestationRegistryMock.sol"; -import { ModuleRegistryMock } from "../mocks/ModuleRegistryMock.sol"; -import { PortalRegistryMock } from "../mocks/PortalRegistryMock.sol"; +import { AbstractPortal } from "../src/interface/AbstractPortal.sol"; +import { DefaultPortal } from "../src/DefaultPortal.sol"; +import { AttestationPayload } from "../src/types/Structs.sol"; +import { CorrectModule } from "./mocks/MockModules.sol"; +import { AttestationRegistryMock } from "./mocks/AttestationRegistryMock.sol"; +import { ModuleRegistryMock } from "./mocks/ModuleRegistryMock.sol"; +import { PortalRegistryMock } from "./mocks/PortalRegistryMock.sol"; import { ERC165Upgradeable } from "openzeppelin-contracts-upgradeable/contracts/utils/introspection/ERC165Upgradeable.sol"; -import { Router } from "../../src/Router.sol"; +import { Router } from "./../src/Router.sol"; contract DefaultPortalTest is Test { CorrectModule public correctModule = new CorrectModule(); diff --git a/contracts/test/ModuleRegistry.t.sol b/contracts/test/ModuleRegistry.t.sol index 5719a97e..86e236b5 100644 --- a/contracts/test/ModuleRegistry.t.sol +++ b/contracts/test/ModuleRegistry.t.sol @@ -3,8 +3,8 @@ pragma solidity 0.8.21; import { Test } from "forge-std/Test.sol"; import { ModuleRegistry } from "../src/ModuleRegistry.sol"; -import { CorrectModule } from "../src/example/CorrectModule.sol"; -import { IncorrectModule } from "../src/example/IncorrectModule.sol"; +import { CorrectModule } from "./mocks/MockModules.sol"; +import { IncorrectModule } from "./mocks/MockModules.sol"; import { PortalRegistryMock } from "./mocks/PortalRegistryMock.sol"; import { AttestationPayload } from "../src/types/Structs.sol"; import { Router } from "../src/Router.sol"; diff --git a/contracts/test/PortalRegistry.t.sol b/contracts/test/PortalRegistry.t.sol index 5465994f..5c1e2abf 100644 --- a/contracts/test/PortalRegistry.t.sol +++ b/contracts/test/PortalRegistry.t.sol @@ -3,13 +3,14 @@ pragma solidity 0.8.21; import { Test } from "forge-std/Test.sol"; import { PortalRegistry } from "../src/PortalRegistry.sol"; -import { CorrectModule } from "../src/example/CorrectModule.sol"; +import { CorrectModule } from "./mocks/MockModules.sol"; import { Portal } from "../src/types/Structs.sol"; import { Router } from "../src/Router.sol"; import { AttestationRegistryMock } from "./mocks/AttestationRegistryMock.sol"; import { ModuleRegistryMock } from "./mocks/ModuleRegistryMock.sol"; import { ValidPortalMock } from "./mocks/ValidPortalMock.sol"; import { InvalidPortalMock } from "./mocks/InvalidPortalMock.sol"; +import { IPortalImplementation } from "./mocks/IPortalImplementation.sol"; contract PortalRegistryTest is Test { address public user = makeAddr("user"); @@ -22,6 +23,7 @@ contract PortalRegistryTest is Test { string public expectedOwnerName = "Owner Name"; ValidPortalMock public validPortalMock; InvalidPortalMock public invalidPortalMock = new InvalidPortalMock(); + IPortalImplementation public iPortalImplementation = new IPortalImplementation(); event Initialized(uint8 version); event PortalRegistered(string name, string description, address portalAddress); @@ -83,6 +85,7 @@ contract PortalRegistryTest is Test { } function test_register() public { + // Register a portal implmenting AbstractPortal vm.expectEmit(); emit PortalRegistered(expectedName, expectedDescription, address(validPortalMock)); vm.prank(user); @@ -91,6 +94,21 @@ contract PortalRegistryTest is Test { uint256 portalCount = portalRegistry.getPortalsCount(); assertEq(portalCount, 1); + // Register a portal implementing IPortal + vm.expectEmit(); + emit PortalRegistered("IPortalImplementation", "IPortalImplementation description", address(iPortalImplementation)); + vm.prank(user); + portalRegistry.register( + address(iPortalImplementation), + "IPortalImplementation", + "IPortalImplementation description", + true, + expectedOwnerName + ); + + portalCount = portalRegistry.getPortalsCount(); + assertEq(portalCount, 2); + Portal memory expectedPortal = Portal( address(validPortalMock), user, diff --git a/contracts/test/example/EASPortal.t.sol b/contracts/test/example/EASPortal.t.sol index 7c12d6c0..db3c5353 100644 --- a/contracts/test/example/EASPortal.t.sol +++ b/contracts/test/example/EASPortal.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.21; import { Test } from "forge-std/Test.sol"; -import { EASPortal } from "../../src/example/EASPortal.sol"; +import { EASPortal } from "../../src/examples/portals/EASPortal.sol"; import { Router } from "../../src/Router.sol"; import { AbstractPortal } from "../../src/interface/AbstractPortal.sol"; import { AttestationRegistryMock } from "../mocks/AttestationRegistryMock.sol"; diff --git a/contracts/test/example/MsgSenderModule.t.sol b/contracts/test/example/MsgSenderModule.t.sol index 9459f94f..6c94e536 100644 --- a/contracts/test/example/MsgSenderModule.t.sol +++ b/contracts/test/example/MsgSenderModule.t.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.21; import { Test } from "forge-std/Test.sol"; import { AbstractModule } from "../../src/interface/AbstractModule.sol"; -import { MsgSenderModule } from "../../src/example/MsgSenderModule.sol"; +import { MsgSenderModule } from "../../src/examples/modules/MsgSenderModule.sol"; import { AttestationPayload } from "../../src/types/Structs.sol"; contract MsgSenderModuleTest is Test { diff --git a/contracts/test/example/NFTPortal.t.sol b/contracts/test/example/NFTPortal.t.sol index 6139c940..ab5c3de1 100644 --- a/contracts/test/example/NFTPortal.t.sol +++ b/contracts/test/example/NFTPortal.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.21; import { Test } from "forge-std/Test.sol"; -import { NFTPortal } from "../../src/example/NFTPortal.sol"; +import { NFTPortal } from "../../src/examples/portals/NFTPortal.sol"; import { Router } from "../../src/Router.sol"; import { AbstractPortal } from "../../src/interface/AbstractPortal.sol"; import { AttestationPayload } from "../../src/types/Structs.sol"; diff --git a/contracts/test/example/PayableModule.t.sol b/contracts/test/example/PayableModule.t.sol index 445a9493..04677af3 100644 --- a/contracts/test/example/PayableModule.t.sol +++ b/contracts/test/example/PayableModule.t.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.21; import { Test } from "forge-std/Test.sol"; import { AbstractModule } from "../../src/interface/AbstractModule.sol"; -import { PayableModule } from "../../src/example/PayableModule.sol"; +import { PayableModule } from "../../src/examples/modules/PayableModule.sol"; import { AttestationPayload } from "../../src/types/Structs.sol"; contract PayableModuleTest is Test { diff --git a/contracts/test/integration/AttestationRegistryMass.t.sol b/contracts/test/integration/AttestationRegistryMass.t.sol index b1dfe395..21cd6bce 100644 --- a/contracts/test/integration/AttestationRegistryMass.t.sol +++ b/contracts/test/integration/AttestationRegistryMass.t.sol @@ -6,7 +6,7 @@ import { AttestationRegistry } from "../../src/AttestationRegistry.sol"; import { PortalRegistry } from "../../src/PortalRegistry.sol"; import { SchemaRegistry } from "../../src/SchemaRegistry.sol"; import { ModuleRegistry } from "../../src/ModuleRegistry.sol"; -import { DefaultPortal } from "../../src/portal/DefaultPortal.sol"; +import { DefaultPortal } from "../../src/DefaultPortal.sol"; import { Attestation, AttestationPayload } from "../../src/types/Structs.sol"; import { Router } from "../../src/Router.sol"; diff --git a/contracts/test/mocks/EASRegistryMock.sol b/contracts/test/mocks/EASRegistryMock.sol index b5770efe..f265018a 100644 --- a/contracts/test/mocks/EASRegistryMock.sol +++ b/contracts/test/mocks/EASRegistryMock.sol @@ -4,6 +4,9 @@ pragma solidity 0.8.21; import { IEAS, Attestation } from "../../src/interface/IEAS.sol"; contract EASRegistryMock is IEAS { + /// @dev This empty method prevents Foundry from counting this contract in code coverage + function test() public {} + mapping(bytes32 attestationId => Attestation attestation) private attestations; function getAttestation(bytes32 uid) external view override returns (Attestation memory) { diff --git a/contracts/test/mocks/IPortalImplementation.sol b/contracts/test/mocks/IPortalImplementation.sol new file mode 100644 index 00000000..ab5fe556 --- /dev/null +++ b/contracts/test/mocks/IPortalImplementation.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.21; + +import { IPortal } from "../../src/interface/IPortal.sol"; +import { IERC165 } from "openzeppelin-contracts/contracts/utils/introspection/ERC165.sol"; + +contract IPortalImplementation is IPortal { + function test() public {} + + function getModules() external pure override returns (address[] memory) { + return new address[](0); + } + + function getAttester() external view override returns (address) { + return msg.sender; + } + + function supportsInterface(bytes4 interfaceID) public pure override returns (bool) { + return interfaceID == type(IPortal).interfaceId || interfaceID == type(IERC165).interfaceId; + } +} diff --git a/contracts/src/example/CorrectModule.sol b/contracts/test/mocks/MockModules.sol similarity index 64% rename from contracts/src/example/CorrectModule.sol rename to contracts/test/mocks/MockModules.sol index 3ccb9cbc..415fb4a5 100644 --- a/contracts/src/example/CorrectModule.sol +++ b/contracts/test/mocks/MockModules.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.21; -import { AbstractModule } from "../interface/AbstractModule.sol"; -import { AttestationPayload } from "../types/Structs.sol"; +import { AbstractModule } from "../../src/interface/AbstractModule.sol"; +import { AttestationPayload } from "../../src/types/Structs.sol"; /** * @title Correct Module @@ -21,3 +21,12 @@ contract CorrectModule is AbstractModule { uint256 /*value*/ ) public pure override {} } + +/** + * @title Incorrect Module + * @author Consensys + * @notice This contract illustrates an invalid Module that doesn't follow the AbstractModule interface + */ +contract IncorrectModule { + +} diff --git a/sdk/README.md b/sdk/README.md index 8919180f..3e3cfc42 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -1,21 +1,26 @@ # Verax Attestation Registry - SDK -The `verax-sdk` facilitates the interactions with the contracts and the subgraph, both from a frontend and a backend. +The Verax SDK facilitates the interactions with the contracts and the subgraph, both from a frontend and a backend. [DRAFT] ## Installation -VeraxSDK is a [npm package](https://www.npmjs.com/package/verax-sdk/). +VeraxSDK is a [npm package](https://www.npmjs.com/package/@verax-attestation-registry/verax-sdk/). ```bash # npm -npm install --save verax-sdk +npm i @verax-attestation-registry/verax-sdk ``` ```bash # yarn -yarn add verax-sdk +yarn add @verax-attestation-registry/verax-sdk +``` + +```bash +# pnpm +pnpm add @verax-attestation-registry/verax-sdk ``` ## Getting Started @@ -24,26 +29,26 @@ yarn add verax-sdk ```js // CommonJS -var VeraxSdk = require("verax-sdk"); +var VeraxSdk = require("@verax-attestation-registry/verax-sdk"); ``` ```js // ES6 -import VeraxSdk from "verax-sdk"; +import VeraxSdk from "@verax-attestation-registry/verax-sdk"; ``` ### 2. Instantiate VeraxSdk ```js // Default configuration for Linea Testnet -const veraxSdk = new VeraxSdk(VeraxSdk.LineaConfTestnet); +const veraxSdk = new VeraxSdk(VeraxSdk.DEFAULT_LINEA_TESTNET); ``` or, ```js // Default configuration for Linea Mainnet -const veraxSdk = new VeraxSdk(VeraxSdk.LineaConfMainnet); +const veraxSdk = new VeraxSdk(VeraxSdk.DEFAULT_LINEA_MAINNET); ``` or, @@ -51,8 +56,8 @@ or, ```js // Custom configuration const myVeraxConfiguration = { - rpcUrl: "https://my.rpc.url", - chain: 12345, + chain: lineaTestnet, + mode: SDKMode.BACKEND, subgraphUrl: "https://my.subgraph.url", portalRegistryAddress: "0xMyPortalRegistryAddress", moduleRegistryAddress: "0xMyModuleRegistryAddress", @@ -69,10 +74,10 @@ const veraxSdk = new VeraxSdk(myVeraxConfiguration); ```js // Each Verax classes has its DataMapper // Get them from the SDK instance -const portalDataMapper = veraxSdk.portalDataMapper; // RW Portals -const schemaDataMapper = veraxSdk.schemaDataMapper; // RW Schemas -const moduleDataMapper = veraxSdk.moduleDataMapper; // RW Modules -const attestationDataMapper = veraxSdk.attestationDataMapper; // RW Attestations +const portalDataMapper = veraxSdk.portal; // RW Portals +const schemaDataMapper = veraxSdk.schema; // RW Schemas +const moduleDataMapper = veraxSdk.module; // RW Modules +const attestationDataMapper = veraxSdk.attestation; // RW Attestations ``` ### 2. Read content (one object)