diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..1a17c9b --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,35 @@ +FROM ubuntu:24.04 + +SHELL ["/bin/bash", "-l", "-c"] + +# Install essential packages +RUN apt-get update && apt-get install -y \ + curl \ + git \ + build-essential \ + procps \ + file \ + unzip \ + sudo \ + && rm -rf /var/lib/apt/lists/* + +# Create sudoers directory and non-root user +RUN mkdir -p /etc/sudoers.d && \ + useradd -m -s /bin/bash vscode && \ + echo "vscode ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/vscode + +# Switch to non-root user +USER vscode +WORKDIR /home/vscode + +# Install Node +RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && \ + sudo apt-get install -y nodejs + +# Install Bun +RUN curl -fsSL https://bun.sh/install | bash +ENV PATH="/home/vscode/.bun/bin:${PATH}" + +# Install Foundry +RUN curl -L https://foundry.paradigm.xyz | bash +RUN /home/vscode/.foundry/bin/foundryup -i nightly \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..f7d7b1b --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,18 @@ +{ + "name": "EthSign: Solidity", + "build": { + "dockerfile": "Dockerfile" + }, + "customizations": { + "vscode": { + "extensions": [ + "juanblanco.solidity", + "esbenp.prettier-vscode", + "dbaeumer.vscode-eslint", + "adpyke.codesnap" + ] + } + }, + "remoteUser": "vscode", + "features": {} + } \ No newline at end of file diff --git a/.gitignore b/.gitignore index d14dae8..dbbfc0d 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,8 @@ node_modules # Hardhat files /cache /artifacts +/artifacts-zk +/cache_hardhat-zk # TypeChain files /typechain diff --git a/.openzeppelin/celo-alfajores.json b/.openzeppelin/celo-alfajores.json new file mode 100644 index 0000000..c3cf29a --- /dev/null +++ b/.openzeppelin/celo-alfajores.json @@ -0,0 +1,406 @@ +{ + "manifestVersion": "3.2", + "proxies": [ + { + "address": "0x4e4af2a21ebf62850fD99Eb6253E1eFBb56098cD", + "txHash": "0x005357c6a8ea7c4db538ecb5e7accf1024fbcaf776ffc4a300a59f52905bbeee", + "kind": "uups" + } + ], + "impls": { + "afb018a4df9ce37df92dbcb4ef960efe77e0dc059ba09179521095894c202c97": { + "address": "0x8D92827CdB67A503e9FB21B28a58F9dAb36B4973", + "txHash": "0x4a613a71b2c064c62f951f0011f281654a086e028e9a9359133526728f84d148", + "layout": { + "solcVersion": "0.8.26", + "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)2791": { + "label": "contract ISPGlobalHook", + "numberOfBytes": "20" + }, + "t_contract(ISPHook)2851": { + "label": "contract ISPHook", + "numberOfBytes": "20" + }, + "t_enum(DataLocation)3077": { + "label": "enum DataLocation", + "members": [ + "ONCHAIN", + "ARWEAVE", + "IPFS", + "CUSTOM" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_string_memory_ptr,t_struct(OffchainAttestation)3069_storage)": { + "label": "mapping(string => struct OffchainAttestation)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint64,t_struct(Attestation)3063_storage)": { + "label": "mapping(uint64 => struct Attestation)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint64,t_struct(Schema)3101_storage)": { + "label": "mapping(uint64 => struct Schema)", + "numberOfBytes": "32" + }, + "t_string_memory_ptr": { + "label": "string", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Attestation)3063_storage": { + "label": "struct Attestation", + "members": [ + { + "label": "schemaId", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "linkedAttestationId", + "type": "t_uint64", + "offset": 8, + "slot": "0" + }, + { + "label": "attestTimestamp", + "type": "t_uint64", + "offset": 16, + "slot": "0" + }, + { + "label": "revokeTimestamp", + "type": "t_uint64", + "offset": 24, + "slot": "0" + }, + { + "label": "attester", + "type": "t_address", + "offset": 0, + "slot": "1" + }, + { + "label": "validUntil", + "type": "t_uint64", + "offset": 20, + "slot": "1" + }, + { + "label": "dataLocation", + "type": "t_enum(DataLocation)3077", + "offset": 28, + "slot": "1" + }, + { + "label": "revoked", + "type": "t_bool", + "offset": 29, + "slot": "1" + }, + { + "label": "recipients", + "type": "t_array(t_bytes_storage)dyn_storage", + "offset": 0, + "slot": "2" + }, + { + "label": "data", + "type": "t_bytes_storage", + "offset": 0, + "slot": "3" + } + ], + "numberOfBytes": "128" + }, + "t_struct(InitializableStorage)93_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)3069_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)1740_storage": { + "label": "struct SP.SPStorage", + "members": [ + { + "label": "paused", + "type": "t_bool", + "offset": 0, + "slot": "0" + }, + { + "label": "schemaRegistry", + "type": "t_mapping(t_uint64,t_struct(Schema)3101_storage)", + "offset": 0, + "slot": "1" + }, + { + "label": "attestationRegistry", + "type": "t_mapping(t_uint64,t_struct(Attestation)3063_storage)", + "offset": 0, + "slot": "2" + }, + { + "label": "offchainAttestationRegistry", + "type": "t_mapping(t_string_memory_ptr,t_struct(OffchainAttestation)3069_storage)", + "offset": 0, + "slot": "3" + }, + { + "label": "schemaCounter", + "type": "t_uint64", + "offset": 0, + "slot": "4" + }, + { + "label": "attestationCounter", + "type": "t_uint64", + "offset": 8, + "slot": "4" + }, + { + "label": "initialSchemaCounter", + "type": "t_uint64", + "offset": 16, + "slot": "4" + }, + { + "label": "initialAttestationCounter", + "type": "t_uint64", + "offset": 24, + "slot": "4" + }, + { + "label": "globalHook", + "type": "t_contract(ISPGlobalHook)2791", + "offset": 0, + "slot": "5" + } + ], + "numberOfBytes": "192" + }, + "t_struct(Schema)3101_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)3077", + "offset": 21, + "slot": "0" + }, + { + "label": "maxValidFor", + "type": "t_uint64", + "offset": 22, + "slot": "0" + }, + { + "label": "hook", + "type": "t_contract(ISPHook)2851", + "offset": 0, + "slot": "1" + }, + { + "label": "timestamp", + "type": "t_uint64", + "offset": 20, + "slot": "1" + }, + { + "label": "data", + "type": "t_string_storage", + "offset": 0, + "slot": "2" + } + ], + "numberOfBytes": "96" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + } + }, + "namespaces": { + "erc7201:ethsign.SP": [ + { + "contract": "SP", + "label": "paused", + "type": "t_bool", + "src": "src/core/SP.sol:19", + "offset": 0, + "slot": "0" + }, + { + "contract": "SP", + "label": "schemaRegistry", + "type": "t_mapping(t_uint64,t_struct(Schema)3101_storage)", + "src": "src/core/SP.sol:20", + "offset": 0, + "slot": "1" + }, + { + "contract": "SP", + "label": "attestationRegistry", + "type": "t_mapping(t_uint64,t_struct(Attestation)3063_storage)", + "src": "src/core/SP.sol:21", + "offset": 0, + "slot": "2" + }, + { + "contract": "SP", + "label": "offchainAttestationRegistry", + "type": "t_mapping(t_string_memory_ptr,t_struct(OffchainAttestation)3069_storage)", + "src": "src/core/SP.sol:22", + "offset": 0, + "slot": "3" + }, + { + "contract": "SP", + "label": "schemaCounter", + "type": "t_uint64", + "src": "src/core/SP.sol:23", + "offset": 0, + "slot": "4" + }, + { + "contract": "SP", + "label": "attestationCounter", + "type": "t_uint64", + "src": "src/core/SP.sol:24", + "offset": 8, + "slot": "4" + }, + { + "contract": "SP", + "label": "initialSchemaCounter", + "type": "t_uint64", + "src": "src/core/SP.sol:25", + "offset": 16, + "slot": "4" + }, + { + "contract": "SP", + "label": "initialAttestationCounter", + "type": "t_uint64", + "src": "src/core/SP.sol:26", + "offset": 24, + "slot": "4" + }, + { + "contract": "SP", + "label": "globalHook", + "type": "t_contract(ISPGlobalHook)2791", + "src": "src/core/SP.sol:27", + "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/celo.json b/.openzeppelin/celo.json new file mode 100644 index 0000000..13846dd --- /dev/null +++ b/.openzeppelin/celo.json @@ -0,0 +1,406 @@ +{ + "manifestVersion": "3.2", + "proxies": [ + { + "address": "0x4e4af2a21ebf62850fD99Eb6253E1eFBb56098cD", + "txHash": "0xa99d18c1f5f0c7b278f5d4478dda5af48f5615f3c3022db80a5f8c58cd5f72f3", + "kind": "uups" + } + ], + "impls": { + "afb018a4df9ce37df92dbcb4ef960efe77e0dc059ba09179521095894c202c97": { + "address": "0x8D92827CdB67A503e9FB21B28a58F9dAb36B4973", + "txHash": "0x8654d73e47035b76f32a7600b8c7084bca6237bd8ab97a788ac6360461b806d7", + "layout": { + "solcVersion": "0.8.26", + "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)2791": { + "label": "contract ISPGlobalHook", + "numberOfBytes": "20" + }, + "t_contract(ISPHook)2851": { + "label": "contract ISPHook", + "numberOfBytes": "20" + }, + "t_enum(DataLocation)3077": { + "label": "enum DataLocation", + "members": [ + "ONCHAIN", + "ARWEAVE", + "IPFS", + "CUSTOM" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_string_memory_ptr,t_struct(OffchainAttestation)3069_storage)": { + "label": "mapping(string => struct OffchainAttestation)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint64,t_struct(Attestation)3063_storage)": { + "label": "mapping(uint64 => struct Attestation)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint64,t_struct(Schema)3101_storage)": { + "label": "mapping(uint64 => struct Schema)", + "numberOfBytes": "32" + }, + "t_string_memory_ptr": { + "label": "string", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Attestation)3063_storage": { + "label": "struct Attestation", + "members": [ + { + "label": "schemaId", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "linkedAttestationId", + "type": "t_uint64", + "offset": 8, + "slot": "0" + }, + { + "label": "attestTimestamp", + "type": "t_uint64", + "offset": 16, + "slot": "0" + }, + { + "label": "revokeTimestamp", + "type": "t_uint64", + "offset": 24, + "slot": "0" + }, + { + "label": "attester", + "type": "t_address", + "offset": 0, + "slot": "1" + }, + { + "label": "validUntil", + "type": "t_uint64", + "offset": 20, + "slot": "1" + }, + { + "label": "dataLocation", + "type": "t_enum(DataLocation)3077", + "offset": 28, + "slot": "1" + }, + { + "label": "revoked", + "type": "t_bool", + "offset": 29, + "slot": "1" + }, + { + "label": "recipients", + "type": "t_array(t_bytes_storage)dyn_storage", + "offset": 0, + "slot": "2" + }, + { + "label": "data", + "type": "t_bytes_storage", + "offset": 0, + "slot": "3" + } + ], + "numberOfBytes": "128" + }, + "t_struct(InitializableStorage)93_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)3069_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)1740_storage": { + "label": "struct SP.SPStorage", + "members": [ + { + "label": "paused", + "type": "t_bool", + "offset": 0, + "slot": "0" + }, + { + "label": "schemaRegistry", + "type": "t_mapping(t_uint64,t_struct(Schema)3101_storage)", + "offset": 0, + "slot": "1" + }, + { + "label": "attestationRegistry", + "type": "t_mapping(t_uint64,t_struct(Attestation)3063_storage)", + "offset": 0, + "slot": "2" + }, + { + "label": "offchainAttestationRegistry", + "type": "t_mapping(t_string_memory_ptr,t_struct(OffchainAttestation)3069_storage)", + "offset": 0, + "slot": "3" + }, + { + "label": "schemaCounter", + "type": "t_uint64", + "offset": 0, + "slot": "4" + }, + { + "label": "attestationCounter", + "type": "t_uint64", + "offset": 8, + "slot": "4" + }, + { + "label": "initialSchemaCounter", + "type": "t_uint64", + "offset": 16, + "slot": "4" + }, + { + "label": "initialAttestationCounter", + "type": "t_uint64", + "offset": 24, + "slot": "4" + }, + { + "label": "globalHook", + "type": "t_contract(ISPGlobalHook)2791", + "offset": 0, + "slot": "5" + } + ], + "numberOfBytes": "192" + }, + "t_struct(Schema)3101_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)3077", + "offset": 21, + "slot": "0" + }, + { + "label": "maxValidFor", + "type": "t_uint64", + "offset": 22, + "slot": "0" + }, + { + "label": "hook", + "type": "t_contract(ISPHook)2851", + "offset": 0, + "slot": "1" + }, + { + "label": "timestamp", + "type": "t_uint64", + "offset": 20, + "slot": "1" + }, + { + "label": "data", + "type": "t_string_storage", + "offset": 0, + "slot": "2" + } + ], + "numberOfBytes": "96" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + } + }, + "namespaces": { + "erc7201:ethsign.SP": [ + { + "contract": "SP", + "label": "paused", + "type": "t_bool", + "src": "src/core/SP.sol:19", + "offset": 0, + "slot": "0" + }, + { + "contract": "SP", + "label": "schemaRegistry", + "type": "t_mapping(t_uint64,t_struct(Schema)3101_storage)", + "src": "src/core/SP.sol:20", + "offset": 0, + "slot": "1" + }, + { + "contract": "SP", + "label": "attestationRegistry", + "type": "t_mapping(t_uint64,t_struct(Attestation)3063_storage)", + "src": "src/core/SP.sol:21", + "offset": 0, + "slot": "2" + }, + { + "contract": "SP", + "label": "offchainAttestationRegistry", + "type": "t_mapping(t_string_memory_ptr,t_struct(OffchainAttestation)3069_storage)", + "src": "src/core/SP.sol:22", + "offset": 0, + "slot": "3" + }, + { + "contract": "SP", + "label": "schemaCounter", + "type": "t_uint64", + "src": "src/core/SP.sol:23", + "offset": 0, + "slot": "4" + }, + { + "contract": "SP", + "label": "attestationCounter", + "type": "t_uint64", + "src": "src/core/SP.sol:24", + "offset": 8, + "slot": "4" + }, + { + "contract": "SP", + "label": "initialSchemaCounter", + "type": "t_uint64", + "src": "src/core/SP.sol:25", + "offset": 16, + "slot": "4" + }, + { + "contract": "SP", + "label": "initialAttestationCounter", + "type": "t_uint64", + "src": "src/core/SP.sol:26", + "offset": 24, + "slot": "4" + }, + { + "contract": "SP", + "label": "globalHook", + "type": "t_contract(ISPGlobalHook)2791", + "src": "src/core/SP.sol:27", + "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/.upgradable/unknown-network-2741.json b/.upgradable/unknown-network-2741.json new file mode 100644 index 0000000..4e17ad7 --- /dev/null +++ b/.upgradable/unknown-network-2741.json @@ -0,0 +1,235 @@ +{ + "manifestVersion": "3.2", + "proxies": [ + { + "address": "0x70140Bd1ec8019efA74C8795D555D5FFef60fb12", + "txHash": "0x913659c681d2d06d1fb165025396b2ea107fb8a35b1c984f4c34f82444ee538b", + "kind": "uups" + } + ], + "impls": { + "3ea8c9cac1eec79fbb0132dd82e2574e519161b0eb2c6a9063ebb018dd31cd0d": { + "address": "0x227D59f5938185A8F22274ef82bBB1475f3cd4A0", + "txHash": "0xed05df5915c4dab549c609a8eeb8a18a345c235aea5637e6f4ea1c399d4c7f2a", + "layout": { + "solcVersion": "0.8.26", + "storage": [], + "types": { + "t_bool": { + "label": "bool" + }, + "t_mapping(t_uint64,t_struct(Schema)8088_storage)": { + "label": "mapping(uint64 => struct Schema)" + }, + "t_uint64": { + "label": "uint64" + }, + "t_struct(Schema)8088_storage": { + "label": "struct Schema", + "members": [ + { + "label": "registrant", + "type": "t_address" + }, + { + "label": "revocable", + "type": "t_bool" + }, + { + "label": "dataLocation", + "type": "t_enum(DataLocation)8064" + }, + { + "label": "maxValidFor", + "type": "t_uint64" + }, + { + "label": "hook", + "type": "t_contract(ISPHook)7656" + }, + { + "label": "timestamp", + "type": "t_uint64" + }, + { + "label": "data", + "type": "t_string_storage" + } + ] + }, + "t_address": { + "label": "address" + }, + "t_enum(DataLocation)8064": { + "label": "enum DataLocation", + "members": [ + "ONCHAIN", + "ARWEAVE", + "IPFS", + "CUSTOM" + ] + }, + "t_contract(ISPHook)7656": { + "label": "contract ISPHook" + }, + "t_string_storage": { + "label": "string" + }, + "t_mapping(t_uint64,t_struct(Attestation)8050_storage)": { + "label": "mapping(uint64 => struct Attestation)" + }, + "t_struct(Attestation)8050_storage": { + "label": "struct Attestation", + "members": [ + { + "label": "schemaId", + "type": "t_uint64" + }, + { + "label": "linkedAttestationId", + "type": "t_uint64" + }, + { + "label": "attestTimestamp", + "type": "t_uint64" + }, + { + "label": "revokeTimestamp", + "type": "t_uint64" + }, + { + "label": "attester", + "type": "t_address" + }, + { + "label": "validUntil", + "type": "t_uint64" + }, + { + "label": "dataLocation", + "type": "t_enum(DataLocation)8064" + }, + { + "label": "revoked", + "type": "t_bool" + }, + { + "label": "recipients", + "type": "t_array(t_bytes_storage)dyn_storage" + }, + { + "label": "data", + "type": "t_bytes_storage" + } + ] + }, + "t_array(t_bytes_storage)dyn_storage": { + "label": "bytes[]" + }, + "t_bytes_storage": { + "label": "bytes" + }, + "t_mapping(t_string_memory_ptr,t_struct(OffchainAttestation)8056_storage)": { + "label": "mapping(string => struct OffchainAttestation)" + }, + "t_struct(OffchainAttestation)8056_storage": { + "label": "struct OffchainAttestation", + "members": [ + { + "label": "attester", + "type": "t_address" + }, + { + "label": "timestamp", + "type": "t_uint64" + } + ] + }, + "t_contract(ISPGlobalHook)7596": { + "label": "contract ISPGlobalHook" + } + }, + "namespaces": { + "erc7201:ethsign.SP": [ + { + "contract": "SP", + "label": "paused", + "type": "t_bool", + "src": "src/core/SP.sol:19" + }, + { + "contract": "SP", + "label": "schemaRegistry", + "type": "t_mapping(t_uint64,t_struct(Schema)8088_storage)", + "src": "src/core/SP.sol:20" + }, + { + "contract": "SP", + "label": "attestationRegistry", + "type": "t_mapping(t_uint64,t_struct(Attestation)8050_storage)", + "src": "src/core/SP.sol:21" + }, + { + "contract": "SP", + "label": "offchainAttestationRegistry", + "type": "t_mapping(t_string_memory_ptr,t_struct(OffchainAttestation)8056_storage)", + "src": "src/core/SP.sol:22" + }, + { + "contract": "SP", + "label": "schemaCounter", + "type": "t_uint64", + "src": "src/core/SP.sol:23" + }, + { + "contract": "SP", + "label": "attestationCounter", + "type": "t_uint64", + "src": "src/core/SP.sol:24" + }, + { + "contract": "SP", + "label": "initialSchemaCounter", + "type": "t_uint64", + "src": "src/core/SP.sol:25" + }, + { + "contract": "SP", + "label": "initialAttestationCounter", + "type": "t_uint64", + "src": "src/core/SP.sol:26" + }, + { + "contract": "SP", + "label": "globalHook", + "type": "t_contract(ISPGlobalHook)7596", + "src": "src/core/SP.sol:27" + } + ], + "erc7201:openzeppelin.storage.Ownable": [ + { + "contract": "OwnableUpgradeable", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73" + } + ] + } + } + } + } +} diff --git a/bun.lockb b/bun.lockb index cddec6a..84d681d 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/hardhat.config.ts b/hardhat.config.ts index af06ca3..85f5a78 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -2,18 +2,13 @@ import { HardhatUserConfig } from "hardhat/config"; import { config as configENV } from "dotenv"; import "@nomicfoundation/hardhat-foundry"; import "@openzeppelin/hardhat-upgrades"; -import "solidity-docgen"; +import "@nomicfoundation/hardhat-verify"; +import "@matterlabs/hardhat-zksync"; +import "@matterlabs/hardhat-zksync-verify"; -if (process.env.NODE_ENV !== "PRODUCTION") { - configENV(); -} +configENV(); const config: HardhatUserConfig = { - namedAccounts: { - deployer: { - default: 0, - }, - }, solidity: { compilers: [ { @@ -27,6 +22,14 @@ const config: HardhatUserConfig = { }, ], }, + zksolc: { + // Settings for Abstract Mainnet + version: "1.5.7", // Ensure version is 1.5.7! + settings: { + // Note: This must be true to call NonceHolder & ContractDeployer system contracts + enableEraVMExtensions: false, + }, + }, networks: { amoy: { url: "https://rpc-amoy.polygon.technology/", @@ -154,6 +157,22 @@ const config: HardhatUserConfig = { url: "https://bsc-dataseed.bnbchain.org", accounts: [process.env.PRIVATE_KEY!], }, + celoAlfajores: { + chainId: 44787, + url: "https://alfajores-forno.celo-testnet.org", + accounts: [process.env.PRIVATE_KEY!], + }, + celo: { + chainId: 42220, + url: "https://forno.celo.org", + accounts: [process.env.PRIVATE_KEY!], + }, + abstractMainnet: { + url: "https://api.mainnet.abs.xyz", + ethNetwork: "mainnet", + zksync: true, + chainId: 2741, + }, plume: { chainId: 98865, url: "https://rpc.plumenetwork.xyz", @@ -188,7 +207,6 @@ const config: HardhatUserConfig = { degen: "0", cyber: "0", bnb: process.env.BSCSCAN_API_KEY!, - plume: "0", }, customChains: [ { @@ -367,14 +385,6 @@ const config: HardhatUserConfig = { browserURL: "https://bscscan.com", }, }, - { - network: "plume", - chainId: 98865, - urls: { - apiURL: "https://explorer.plumenetwork.xyz/api", - browserURL: "https://rpc.plumenetwork.xyz", - }, - }, ], }, docgen: { diff --git a/package.json b/package.json index 72c2cdd..27cd6c8 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "url": "git+https://github.com/EthSign/sign-protocol-evm" }, "scripts": { - "clean": "forge clean && hardhat clean && rm -rf cache_hardhat", + "clean": "forge clean && hardhat clean && rm -rf cache_hardhat && rm -rf cache_hardhat-zk && rm -rf artifacts-zk", "build": "forge build", "build:hh": "hardhat compile", "lint:sol": "forge fmt --check && solhint {script,src,test}/**/*.sol", @@ -23,6 +23,9 @@ "@openzeppelin/contracts-upgradeable": "5.0.1" }, "devDependencies": { + "@matterlabs/hardhat-zksync": "1.3.0", + "@matterlabs/hardhat-zksync-upgradable": "1.8.2", + "@matterlabs/hardhat-zksync-verify": "1.7.1", "@nomicfoundation/hardhat-foundry": "^1.1.1", "@nomicfoundation/hardhat-verify": "^2.0.8", "@openzeppelin/hardhat-upgrades": "^3.2.0", @@ -30,13 +33,13 @@ "ethers": "^6.11.1", "dotenv": "^16.3.1", "ds-test": "github:dapphub/ds-test", - "forge-std": "github:foundry-rs/forge-std#v1", + "forge-std": "github:foundry-rs/forge-std", "hardhat": "^2.22.5", "hardhat-deploy": "^0.12.4", "prettier": "^3.2.1", "solhint": "^4.1.1", - "solidity-docgen": "0.6.0-beta.36", "ts-node": ">=8.0.0", - "typescript": "~5.0.4" + "typescript": "~5.0.4", + "zksync-ethers": "6.15.4" } } diff --git a/scripts/deploy-zk.ts b/scripts/deploy-zk.ts new file mode 100644 index 0000000..bddc9c5 --- /dev/null +++ b/scripts/deploy-zk.ts @@ -0,0 +1,20 @@ +import { Deployer } from "@matterlabs/hardhat-zksync"; +import { Wallet } from "zksync-ethers"; + +import * as hre from "hardhat"; + +async function main() { + const contractName = "SP"; + console.log("Deploying " + contractName + "..."); + const zkWallet = new Wallet(process.env.PRIVATE_KEY!); + const deployer = new Deployer(hre, zkWallet); + const contract = await deployer.loadArtifact(contractName); + const instance = await hre.zkUpgrades.deployProxy(deployer.zkWallet, contract, [1, 1], { initializer: "initialize" }); + await instance.waitForDeployment(); + console.log(contractName + " deployed to:", await instance.getAddress()); +} + +main().catch((error) => { + console.error(error); + process.exitCode = 1; +});