diff --git a/.openzeppelin/polygon.json b/.openzeppelin/polygon.json new file mode 100644 index 0000000..ad5f3cd --- /dev/null +++ b/.openzeppelin/polygon.json @@ -0,0 +1,350 @@ +{ + "manifestVersion": "3.2", + "proxies": [ + { + "address": "0x72efA4093539A909C1f9bcCA1aE6bcDa435a3433", + "txHash": "0x5904c52c319554debffc4d8f2a6e5c57cd0dcee6b84fcb454bcf639f9e7826da", + "kind": "uups" + } + ], + "impls": { + "d2159a359ec439aef747b1feae877ee294ba057f32dd34021b568615798e8503": { + "address": "0x36e3f7a8C88EE63740b50f7b87c069a74e461f85", + "txHash": "0xb72d356cc8f6b07b1e1ea8b182dc1a3f61c216f6dc62fbfd0a0f8ab721177201", + "layout": { + "solcVersion": "0.8.23", + "storage": [], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes_storage)dyn_storage": { + "label": "bytes[]", + "numberOfBytes": "32" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes_storage": { + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(ISPGlobalHook)909": { + "label": "contract ISPGlobalHook", + "numberOfBytes": "20" + }, + "t_contract(ISPHook)923": { + "label": "contract ISPHook", + "numberOfBytes": "20" + }, + "t_enum(DataLocation)967": { + "label": "enum DataLocation", + "members": [ + "ONCHAIN", + "ARWEAVE", + "IPFS", + "CUSTOM" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_string_memory_ptr,t_struct(OffchainAttestation)959_storage)": { + "label": "mapping(string => struct OffchainAttestation)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_struct(Attestation)953_storage)": { + "label": "mapping(uint256 => struct Attestation)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_struct(Schema)989_storage)": { + "label": "mapping(uint256 => struct Schema)", + "numberOfBytes": "32" + }, + "t_string_memory_ptr": { + "label": "string", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Attestation)953_storage": { + "label": "struct Attestation", + "members": [ + { + "label": "schemaId", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "dataLocation", + "type": "t_enum(DataLocation)967", + "offset": 0, + "slot": "1" + }, + { + "label": "linkedAttestationId", + "type": "t_uint256", + "offset": 0, + "slot": "2" + }, + { + "label": "attester", + "type": "t_address", + "offset": 0, + "slot": "3" + }, + { + "label": "validUntil", + "type": "t_uint64", + "offset": 20, + "slot": "3" + }, + { + "label": "revoked", + "type": "t_bool", + "offset": 28, + "slot": "3" + }, + { + "label": "recipients", + "type": "t_array(t_bytes_storage)dyn_storage", + "offset": 0, + "slot": "4" + }, + { + "label": "data", + "type": "t_bytes_storage", + "offset": 0, + "slot": "5" + } + ], + "numberOfBytes": "192" + }, + "t_struct(InitializableStorage)64_storage": { + "label": "struct Initializable.InitializableStorage", + "members": [ + { + "label": "_initialized", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "_initializing", + "type": "t_bool", + "offset": 8, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OffchainAttestation)959_storage": { + "label": "struct OffchainAttestation", + "members": [ + { + "label": "attester", + "type": "t_address", + "offset": 0, + "slot": "0" + }, + { + "label": "timestamp", + "type": "t_uint64", + "offset": 20, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OwnableStorage)14_storage": { + "label": "struct OwnableUpgradeable.OwnableStorage", + "members": [ + { + "label": "_owner", + "type": "t_address", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(SPStorage)622_storage": { + "label": "struct SP.SPStorage", + "members": [ + { + "label": "_schemaRegistry", + "type": "t_mapping(t_uint256,t_struct(Schema)989_storage)", + "offset": 0, + "slot": "0" + }, + { + "label": "_attestationRegistry", + "type": "t_mapping(t_uint256,t_struct(Attestation)953_storage)", + "offset": 0, + "slot": "1" + }, + { + "label": "_offchainAttestationRegistry", + "type": "t_mapping(t_string_memory_ptr,t_struct(OffchainAttestation)959_storage)", + "offset": 0, + "slot": "2" + }, + { + "label": "schemaCounter", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "attestationCounter", + "type": "t_uint256", + "offset": 0, + "slot": "4" + }, + { + "label": "globalHook", + "type": "t_contract(ISPGlobalHook)909", + "offset": 0, + "slot": "5" + } + ], + "numberOfBytes": "192" + }, + "t_struct(Schema)989_storage": { + "label": "struct Schema", + "members": [ + { + "label": "registrant", + "type": "t_address", + "offset": 0, + "slot": "0" + }, + { + "label": "revocable", + "type": "t_bool", + "offset": 20, + "slot": "0" + }, + { + "label": "dataLocation", + "type": "t_enum(DataLocation)967", + "offset": 21, + "slot": "0" + }, + { + "label": "maxValidFor", + "type": "t_uint64", + "offset": 22, + "slot": "0" + }, + { + "label": "hook", + "type": "t_contract(ISPHook)923", + "offset": 0, + "slot": "1" + }, + { + "label": "data", + "type": "t_string_storage", + "offset": 0, + "slot": "2" + } + ], + "numberOfBytes": "96" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + } + }, + "namespaces": { + "erc7201:ethsign.SP": [ + { + "contract": "SP", + "label": "_schemaRegistry", + "type": "t_mapping(t_uint256,t_struct(Schema)989_storage)", + "src": "src/core/SP.sol:19", + "offset": 0, + "slot": "0" + }, + { + "contract": "SP", + "label": "_attestationRegistry", + "type": "t_mapping(t_uint256,t_struct(Attestation)953_storage)", + "src": "src/core/SP.sol:20", + "offset": 0, + "slot": "1" + }, + { + "contract": "SP", + "label": "_offchainAttestationRegistry", + "type": "t_mapping(t_string_memory_ptr,t_struct(OffchainAttestation)959_storage)", + "src": "src/core/SP.sol:21", + "offset": 0, + "slot": "2" + }, + { + "contract": "SP", + "label": "schemaCounter", + "type": "t_uint256", + "src": "src/core/SP.sol:22", + "offset": 0, + "slot": "3" + }, + { + "contract": "SP", + "label": "attestationCounter", + "type": "t_uint256", + "src": "src/core/SP.sol:23", + "offset": 0, + "slot": "4" + }, + { + "contract": "SP", + "label": "globalHook", + "type": "t_contract(ISPGlobalHook)909", + "src": "src/core/SP.sol:24", + "offset": 0, + "slot": "5" + } + ], + "erc7201:openzeppelin.storage.Ownable": [ + { + "contract": "OwnableUpgradeable", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", + "offset": 0, + "slot": "0" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", + "offset": 8, + "slot": "0" + } + ] + } + } + } + } +} diff --git a/.openzeppelin/unknown-204.json b/.openzeppelin/unknown-204.json new file mode 100644 index 0000000..94e5db1 --- /dev/null +++ b/.openzeppelin/unknown-204.json @@ -0,0 +1,350 @@ +{ + "manifestVersion": "3.2", + "proxies": [ + { + "address": "0x4e4af2a21ebf62850fD99Eb6253E1eFBb56098cD", + "txHash": "0x08034cd80d79c415b34f1d0e2e32d1a1090eab98f1cbaf650e00115b2b20b81d", + "kind": "uups" + } + ], + "impls": { + "d2159a359ec439aef747b1feae877ee294ba057f32dd34021b568615798e8503": { + "address": "0x8D92827CdB67A503e9FB21B28a58F9dAb36B4973", + "txHash": "0x06f149d22021ae38d1e477ffb41f3c84975812834e43a248b1ce8378a2d3e865", + "layout": { + "solcVersion": "0.8.23", + "storage": [], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes_storage)dyn_storage": { + "label": "bytes[]", + "numberOfBytes": "32" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes_storage": { + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(ISPGlobalHook)909": { + "label": "contract ISPGlobalHook", + "numberOfBytes": "20" + }, + "t_contract(ISPHook)923": { + "label": "contract ISPHook", + "numberOfBytes": "20" + }, + "t_enum(DataLocation)967": { + "label": "enum DataLocation", + "members": [ + "ONCHAIN", + "ARWEAVE", + "IPFS", + "CUSTOM" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_string_memory_ptr,t_struct(OffchainAttestation)959_storage)": { + "label": "mapping(string => struct OffchainAttestation)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_struct(Attestation)953_storage)": { + "label": "mapping(uint256 => struct Attestation)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_struct(Schema)989_storage)": { + "label": "mapping(uint256 => struct Schema)", + "numberOfBytes": "32" + }, + "t_string_memory_ptr": { + "label": "string", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Attestation)953_storage": { + "label": "struct Attestation", + "members": [ + { + "label": "schemaId", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "dataLocation", + "type": "t_enum(DataLocation)967", + "offset": 0, + "slot": "1" + }, + { + "label": "linkedAttestationId", + "type": "t_uint256", + "offset": 0, + "slot": "2" + }, + { + "label": "attester", + "type": "t_address", + "offset": 0, + "slot": "3" + }, + { + "label": "validUntil", + "type": "t_uint64", + "offset": 20, + "slot": "3" + }, + { + "label": "revoked", + "type": "t_bool", + "offset": 28, + "slot": "3" + }, + { + "label": "recipients", + "type": "t_array(t_bytes_storage)dyn_storage", + "offset": 0, + "slot": "4" + }, + { + "label": "data", + "type": "t_bytes_storage", + "offset": 0, + "slot": "5" + } + ], + "numberOfBytes": "192" + }, + "t_struct(InitializableStorage)64_storage": { + "label": "struct Initializable.InitializableStorage", + "members": [ + { + "label": "_initialized", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "_initializing", + "type": "t_bool", + "offset": 8, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OffchainAttestation)959_storage": { + "label": "struct OffchainAttestation", + "members": [ + { + "label": "attester", + "type": "t_address", + "offset": 0, + "slot": "0" + }, + { + "label": "timestamp", + "type": "t_uint64", + "offset": 20, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OwnableStorage)14_storage": { + "label": "struct OwnableUpgradeable.OwnableStorage", + "members": [ + { + "label": "_owner", + "type": "t_address", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(SPStorage)622_storage": { + "label": "struct SP.SPStorage", + "members": [ + { + "label": "_schemaRegistry", + "type": "t_mapping(t_uint256,t_struct(Schema)989_storage)", + "offset": 0, + "slot": "0" + }, + { + "label": "_attestationRegistry", + "type": "t_mapping(t_uint256,t_struct(Attestation)953_storage)", + "offset": 0, + "slot": "1" + }, + { + "label": "_offchainAttestationRegistry", + "type": "t_mapping(t_string_memory_ptr,t_struct(OffchainAttestation)959_storage)", + "offset": 0, + "slot": "2" + }, + { + "label": "schemaCounter", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "attestationCounter", + "type": "t_uint256", + "offset": 0, + "slot": "4" + }, + { + "label": "globalHook", + "type": "t_contract(ISPGlobalHook)909", + "offset": 0, + "slot": "5" + } + ], + "numberOfBytes": "192" + }, + "t_struct(Schema)989_storage": { + "label": "struct Schema", + "members": [ + { + "label": "registrant", + "type": "t_address", + "offset": 0, + "slot": "0" + }, + { + "label": "revocable", + "type": "t_bool", + "offset": 20, + "slot": "0" + }, + { + "label": "dataLocation", + "type": "t_enum(DataLocation)967", + "offset": 21, + "slot": "0" + }, + { + "label": "maxValidFor", + "type": "t_uint64", + "offset": 22, + "slot": "0" + }, + { + "label": "hook", + "type": "t_contract(ISPHook)923", + "offset": 0, + "slot": "1" + }, + { + "label": "data", + "type": "t_string_storage", + "offset": 0, + "slot": "2" + } + ], + "numberOfBytes": "96" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + } + }, + "namespaces": { + "erc7201:ethsign.SP": [ + { + "contract": "SP", + "label": "_schemaRegistry", + "type": "t_mapping(t_uint256,t_struct(Schema)989_storage)", + "src": "src/core/SP.sol:19", + "offset": 0, + "slot": "0" + }, + { + "contract": "SP", + "label": "_attestationRegistry", + "type": "t_mapping(t_uint256,t_struct(Attestation)953_storage)", + "src": "src/core/SP.sol:20", + "offset": 0, + "slot": "1" + }, + { + "contract": "SP", + "label": "_offchainAttestationRegistry", + "type": "t_mapping(t_string_memory_ptr,t_struct(OffchainAttestation)959_storage)", + "src": "src/core/SP.sol:21", + "offset": 0, + "slot": "2" + }, + { + "contract": "SP", + "label": "schemaCounter", + "type": "t_uint256", + "src": "src/core/SP.sol:22", + "offset": 0, + "slot": "3" + }, + { + "contract": "SP", + "label": "attestationCounter", + "type": "t_uint256", + "src": "src/core/SP.sol:23", + "offset": 0, + "slot": "4" + }, + { + "contract": "SP", + "label": "globalHook", + "type": "t_contract(ISPGlobalHook)909", + "src": "src/core/SP.sol:24", + "offset": 0, + "slot": "5" + } + ], + "erc7201:openzeppelin.storage.Ownable": [ + { + "contract": "OwnableUpgradeable", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", + "offset": 0, + "slot": "0" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", + "offset": 8, + "slot": "0" + } + ] + } + } + } + } +} diff --git a/hardhat.config.ts b/hardhat.config.ts index f00c802..4c2746b 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -38,6 +38,13 @@ const config: HardhatUserConfig = { saveDeployments: true, zksync: false, }, + polygon: { + url: "https://polygon-rpc.com", + chainId: 137, + accounts: [process.env.PRIVATE_KEY!], + saveDeployments: true, + zksync: false, + }, zetachainTestnet: { chainId: 7001, url: "https://zetachain-athens-evm.blockpi.network/v1/rpc/public", @@ -59,9 +66,17 @@ const config: HardhatUserConfig = { saveDeployments: true, zksync: false, }, + opBnb: { + chainId: 204, + url: "https://opbnb-mainnet-rpc.bnbchain.org", + accounts: [process.env.PRIVATE_KEY!], + saveDeployments: true, + zksync: false, + }, }, etherscan: { apiKey: { + polygon: process.env.POLYGONSCAN_KEY!, polygonMumbai: process.env.POLYGONSCAN_KEY!, mantaPacific: process.env.MANTAPACIFIC_KEY!, mantaPacificTestnet: process.env.MANTAPACIFIC_TEST_KEY!, diff --git a/src/interfaces/ISP.sol b/src/interfaces/ISP.sol index 9e78a24..949af7e 100644 --- a/src/interfaces/ISP.sol +++ b/src/interfaces/ISP.sol @@ -66,6 +66,8 @@ interface ISP is IVersionable { * @notice Registers a Schema. * @dev Emits `SchemaRegistered`. * @param schema See `Schema`. + * @param delegateSignature An optional ECDSA delegateSignature if this is a delegated attestation. Use `""` or `0x` + * otherwise. * @return schemaId The assigned ID of the registered schema. */ function register(Schema memory schema, bytes calldata delegateSignature) external returns (uint256 schemaId); @@ -75,7 +77,7 @@ interface ISP is IVersionable { * @dev Emits `AttestationMade`. * @param attestation See `Attestation`. * @param indexingKey Used by the frontend to aid indexing. - * @param delegateSignature An optional ECDSA delegateSignature if this is a delegated attestation. Use `""` + * @param delegateSignature An optional ECDSA delegateSignature if this is a delegated attestation. Use `""` or `0x` * otherwise. * @param extraData This is forwarded to the resolver directly. * @return attestationId The assigned ID of the attestation. @@ -95,7 +97,7 @@ interface ISP is IVersionable { * @param attestation See `Attestation`. * @param resolverFeesETH Amount of funds to send to the hook. * @param indexingKey Used by the frontend to aid indexing. - * @param delegateSignature An optional ECDSA delegateSignature if this is a delegated attestation. Use `""` + * @param delegateSignature An optional ECDSA delegateSignature if this is a delegated attestation. Use `""` or `0x` * otherwise. * @param extraData This is forwarded to the resolver directly. * @return attestationId The assigned ID of the attestation. @@ -118,7 +120,7 @@ interface ISP is IVersionable { * @param resolverFeesERC20Token ERC20 token address used for payment. * @param resolverFeesERC20Amount Amount of funds to send to the hook. * @param indexingKey Used by the frontend to aid indexing. - * @param delegateSignature An optional ECDSA delegateSignature if this is a delegated attestation. Use `""` + * @param delegateSignature An optional ECDSA delegateSignature if this is a delegated attestation. Use `""` or `0x` * otherwise. * @param extraData This is forwarded to the resolver directly. * @return attestationId The assigned ID of the attestation. @@ -140,8 +142,8 @@ interface ISP is IVersionable { * @param offchainAttestationId The off-chain data ID. * @param delegateAttester An optional delegated attester that authorized the caller to attest on their behalf if * this is a delegated attestation. Use `address(0)` otherwise. - * @param delegateSignature An optional ECDSA delegateSignature if this is a delegated attestation. Use `""` - * otherwise. Use `""` otherwise. + * @param delegateSignature An optional ECDSA delegateSignature if this is a delegated attestation. Use `""` or `0x` + * otherwise. Use `""` or `0x` otherwise. */ function attestOffchain( string calldata offchainAttestationId,